@wordpress/editor 14.50.0 → 14.51.1-next.v.202607070741.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 (197) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/build/components/collab-sidebar/format.cjs +83 -0
  3. package/build/components/collab-sidebar/format.cjs.map +7 -0
  4. package/build/components/collab-sidebar/hooks.cjs +117 -16
  5. package/build/components/collab-sidebar/hooks.cjs.map +2 -2
  6. package/build/components/collab-sidebar/index.cjs +18 -2
  7. package/build/components/collab-sidebar/index.cjs.map +2 -2
  8. package/build/components/collab-sidebar/note-highlight-styles.cjs +67 -0
  9. package/build/components/collab-sidebar/note-highlight-styles.cjs.map +7 -0
  10. package/build/components/collab-sidebar/utils.cjs +139 -0
  11. package/build/components/collab-sidebar/utils.cjs.map +2 -2
  12. package/build/components/collaborators-presence/use-collaborator-notifications.cjs +55 -30
  13. package/build/components/collaborators-presence/use-collaborator-notifications.cjs.map +2 -2
  14. package/build/components/commands/index.cjs +99 -3
  15. package/build/components/commands/index.cjs.map +2 -2
  16. package/build/components/document-bar/index.cjs +28 -34
  17. package/build/components/document-bar/index.cjs.map +2 -2
  18. package/build/components/entities-saved-states/index.cjs +1 -4
  19. package/build/components/entities-saved-states/index.cjs.map +2 -2
  20. package/build/components/media-categories/index.cjs +92 -6
  21. package/build/components/media-categories/index.cjs.map +2 -2
  22. package/build/components/page-attributes/parent.cjs +0 -1
  23. package/build/components/page-attributes/parent.cjs.map +2 -2
  24. package/build/components/post-author/combobox.cjs +0 -1
  25. package/build/components/post-author/combobox.cjs.map +2 -2
  26. package/build/components/post-author/select.cjs +0 -1
  27. package/build/components/post-author/select.cjs.map +2 -2
  28. package/build/components/post-preview-button/index.cjs +29 -2
  29. package/build/components/post-preview-button/index.cjs.map +2 -2
  30. package/build/components/post-publish-panel/maybe-upload-media.cjs +15 -26
  31. package/build/components/post-publish-panel/maybe-upload-media.cjs.map +3 -3
  32. package/build/components/post-revisions-preview/revisions-slider.cjs +3 -1
  33. package/build/components/post-revisions-preview/revisions-slider.cjs.map +2 -2
  34. package/build/components/post-taxonomies/flat-term-selector.cjs +0 -1
  35. package/build/components/post-taxonomies/flat-term-selector.cjs.map +2 -2
  36. package/build/components/post-taxonomies/hierarchical-term-selector.cjs +0 -2
  37. package/build/components/post-taxonomies/hierarchical-term-selector.cjs.map +2 -2
  38. package/build/components/post-template/classic-theme.cjs +0 -1
  39. package/build/components/post-template/classic-theme.cjs.map +2 -2
  40. package/build/components/preferences-modal/index.cjs +54 -28
  41. package/build/components/preferences-modal/index.cjs.map +2 -2
  42. package/build/components/preview-dropdown/index.cjs +3 -3
  43. package/build/components/preview-dropdown/index.cjs.map +2 -2
  44. package/build/components/provider/use-block-editor-settings.cjs +23 -3
  45. package/build/components/provider/use-block-editor-settings.cjs.map +3 -3
  46. package/build/components/sidebar/dataform-post-summary.cjs +5 -1
  47. package/build/components/sidebar/dataform-post-summary.cjs.map +3 -3
  48. package/build/components/sidebar/index.cjs +29 -38
  49. package/build/components/sidebar/index.cjs.map +3 -3
  50. package/build/components/sidebar/post-summary.cjs +0 -13
  51. package/build/components/sidebar/post-summary.cjs.map +3 -3
  52. package/build/dataviews/store/private-actions.cjs +24 -19
  53. package/build/dataviews/store/private-actions.cjs.map +2 -2
  54. package/build/store/private-actions.cjs +5 -2
  55. package/build/store/private-actions.cjs.map +2 -2
  56. package/build/utils/media-sideload-from-url/index.cjs +63 -0
  57. package/build/utils/media-sideload-from-url/index.cjs.map +7 -0
  58. package/build-module/components/collab-sidebar/format.mjs +57 -0
  59. package/build-module/components/collab-sidebar/format.mjs.map +7 -0
  60. package/build-module/components/collab-sidebar/hooks.mjs +121 -16
  61. package/build-module/components/collab-sidebar/hooks.mjs.map +2 -2
  62. package/build-module/components/collab-sidebar/index.mjs +21 -5
  63. package/build-module/components/collab-sidebar/index.mjs.map +2 -2
  64. package/build-module/components/collab-sidebar/note-highlight-styles.mjs +41 -0
  65. package/build-module/components/collab-sidebar/note-highlight-styles.mjs.map +7 -0
  66. package/build-module/components/collab-sidebar/utils.mjs +133 -0
  67. package/build-module/components/collab-sidebar/utils.mjs.map +2 -2
  68. package/build-module/components/collaborators-presence/use-collaborator-notifications.mjs +55 -30
  69. package/build-module/components/collaborators-presence/use-collaborator-notifications.mjs.map +2 -2
  70. package/build-module/components/commands/index.mjs +99 -3
  71. package/build-module/components/commands/index.mjs.map +2 -2
  72. package/build-module/components/document-bar/index.mjs +28 -34
  73. package/build-module/components/document-bar/index.mjs.map +2 -2
  74. package/build-module/components/entities-saved-states/index.mjs +1 -4
  75. package/build-module/components/entities-saved-states/index.mjs.map +2 -2
  76. package/build-module/components/media-categories/index.mjs +93 -7
  77. package/build-module/components/media-categories/index.mjs.map +2 -2
  78. package/build-module/components/page-attributes/parent.mjs +0 -1
  79. package/build-module/components/page-attributes/parent.mjs.map +2 -2
  80. package/build-module/components/post-author/combobox.mjs +0 -1
  81. package/build-module/components/post-author/combobox.mjs.map +2 -2
  82. package/build-module/components/post-author/select.mjs +0 -1
  83. package/build-module/components/post-author/select.mjs.map +2 -2
  84. package/build-module/components/post-preview-button/index.mjs +29 -2
  85. package/build-module/components/post-preview-button/index.mjs.map +2 -2
  86. package/build-module/components/post-publish-panel/maybe-upload-media.mjs +19 -27
  87. package/build-module/components/post-publish-panel/maybe-upload-media.mjs.map +2 -2
  88. package/build-module/components/post-revisions-preview/revisions-slider.mjs +3 -1
  89. package/build-module/components/post-revisions-preview/revisions-slider.mjs.map +2 -2
  90. package/build-module/components/post-taxonomies/flat-term-selector.mjs +0 -1
  91. package/build-module/components/post-taxonomies/flat-term-selector.mjs.map +2 -2
  92. package/build-module/components/post-taxonomies/hierarchical-term-selector.mjs +0 -2
  93. package/build-module/components/post-taxonomies/hierarchical-term-selector.mjs.map +2 -2
  94. package/build-module/components/post-template/classic-theme.mjs +0 -1
  95. package/build-module/components/post-template/classic-theme.mjs.map +2 -2
  96. package/build-module/components/preferences-modal/index.mjs +54 -28
  97. package/build-module/components/preferences-modal/index.mjs.map +2 -2
  98. package/build-module/components/preview-dropdown/index.mjs +3 -3
  99. package/build-module/components/preview-dropdown/index.mjs.map +2 -2
  100. package/build-module/components/provider/use-block-editor-settings.mjs +23 -3
  101. package/build-module/components/provider/use-block-editor-settings.mjs.map +2 -2
  102. package/build-module/components/sidebar/dataform-post-summary.mjs +6 -2
  103. package/build-module/components/sidebar/dataform-post-summary.mjs.map +2 -2
  104. package/build-module/components/sidebar/index.mjs +29 -42
  105. package/build-module/components/sidebar/index.mjs.map +2 -2
  106. package/build-module/components/sidebar/post-summary.mjs +0 -13
  107. package/build-module/components/sidebar/post-summary.mjs.map +2 -2
  108. package/build-module/dataviews/store/private-actions.mjs +26 -19
  109. package/build-module/dataviews/store/private-actions.mjs.map +2 -2
  110. package/build-module/store/private-actions.mjs +5 -2
  111. package/build-module/store/private-actions.mjs.map +2 -2
  112. package/build-module/utils/media-sideload-from-url/index.mjs +32 -0
  113. package/build-module/utils/media-sideload-from-url/index.mjs.map +7 -0
  114. package/build-style/style-rtl.css +65 -33
  115. package/build-style/style.css +65 -33
  116. package/build-types/components/collab-sidebar/format.d.ts +17 -0
  117. package/build-types/components/collab-sidebar/format.d.ts.map +1 -0
  118. package/build-types/components/collab-sidebar/hooks.d.ts.map +1 -1
  119. package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
  120. package/build-types/components/collab-sidebar/note-highlight-styles.d.ts +31 -0
  121. package/build-types/components/collab-sidebar/note-highlight-styles.d.ts.map +1 -0
  122. package/build-types/components/collab-sidebar/utils.d.ts +82 -2
  123. package/build-types/components/collab-sidebar/utils.d.ts.map +1 -1
  124. package/build-types/components/collaborators-presence/use-collaborator-notifications.d.ts.map +1 -1
  125. package/build-types/components/commands/index.d.ts.map +1 -1
  126. package/build-types/components/document-bar/index.d.ts.map +1 -1
  127. package/build-types/components/entities-saved-states/index.d.ts.map +1 -1
  128. package/build-types/components/media-categories/index.d.ts +12 -3
  129. package/build-types/components/media-categories/index.d.ts.map +1 -1
  130. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  131. package/build-types/components/post-author/combobox.d.ts.map +1 -1
  132. package/build-types/components/post-author/select.d.ts.map +1 -1
  133. package/build-types/components/post-preview-button/index.d.ts.map +1 -1
  134. package/build-types/components/post-publish-panel/maybe-upload-media.d.ts.map +1 -1
  135. package/build-types/components/post-revisions-preview/revisions-slider.d.ts.map +1 -1
  136. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
  137. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
  138. package/build-types/components/post-template/classic-theme.d.ts.map +1 -1
  139. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
  140. package/build-types/components/sidebar/dataform-post-summary.d.ts.map +1 -1
  141. package/build-types/components/sidebar/index.d.ts.map +1 -1
  142. package/build-types/components/sidebar/post-summary.d.ts.map +1 -1
  143. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  144. package/build-types/store/private-actions.d.ts.map +1 -1
  145. package/build-types/store/selectors.d.ts.map +1 -1
  146. package/build-types/utils/get-template-part-icon.d.ts.map +1 -1
  147. package/build-types/utils/media-sideload-from-url/index.d.ts +18 -0
  148. package/build-types/utils/media-sideload-from-url/index.d.ts.map +1 -0
  149. package/package.json +48 -46
  150. package/src/components/collab-sidebar/format.js +72 -0
  151. package/src/components/collab-sidebar/hooks.js +203 -22
  152. package/src/components/collab-sidebar/index.js +19 -5
  153. package/src/components/collab-sidebar/note-highlight-styles.js +83 -0
  154. package/src/components/collab-sidebar/style.scss +9 -0
  155. package/src/components/collab-sidebar/test/note-highlight-styles.js +106 -0
  156. package/src/components/collab-sidebar/test/utils.js +471 -0
  157. package/src/components/collab-sidebar/utils.js +225 -2
  158. package/src/components/collaborators-presence/test/use-collaborator-notifications.ts +265 -262
  159. package/src/components/collaborators-presence/use-collaborator-notifications.ts +70 -34
  160. package/src/components/commands/index.js +142 -0
  161. package/src/components/document-bar/index.js +0 -9
  162. package/src/components/document-bar/style.scss +0 -17
  163. package/src/components/entities-saved-states/index.js +1 -5
  164. package/src/components/header/style.scss +7 -3
  165. package/src/components/media-categories/index.js +160 -6
  166. package/src/components/media-categories/test/index.js +202 -0
  167. package/src/components/page-attributes/parent.js +0 -1
  168. package/src/components/post-author/combobox.js +0 -1
  169. package/src/components/post-author/select.js +0 -1
  170. package/src/components/post-preview-button/index.js +68 -2
  171. package/src/components/post-publish-panel/maybe-upload-media.js +25 -30
  172. package/src/components/post-publish-panel/style.scss +1 -1
  173. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +11 -127
  174. package/src/components/post-revisions-preview/revisions-slider.js +4 -1
  175. package/src/components/post-revisions-preview/test/block-diff.js +2 -2
  176. package/src/components/post-taxonomies/flat-term-selector.js +0 -1
  177. package/src/components/post-taxonomies/hierarchical-term-selector.js +0 -2
  178. package/src/components/post-template/classic-theme.js +0 -1
  179. package/src/components/preferences-modal/index.js +40 -22
  180. package/src/components/preferences-modal/test/index.js +83 -0
  181. package/src/components/preview-dropdown/index.js +3 -3
  182. package/src/components/provider/use-block-editor-settings.js +42 -1
  183. package/src/components/sidebar/dataform-post-summary.js +13 -1
  184. package/src/components/sidebar/index.js +32 -47
  185. package/src/components/sidebar/post-summary.js +0 -17
  186. package/src/dataviews/store/private-actions.ts +30 -26
  187. package/src/store/private-actions.js +6 -2
  188. package/src/utils/media-sideload-from-url/index.js +54 -0
  189. package/src/utils/media-sideload-from-url/test/index.js +162 -0
  190. package/build/components/post-publish-panel/media-util.cjs +0 -72
  191. package/build/components/post-publish-panel/media-util.cjs.map +0 -7
  192. package/build-module/components/post-publish-panel/media-util.mjs +0 -46
  193. package/build-module/components/post-publish-panel/media-util.mjs.map +0 -7
  194. package/build-types/components/post-publish-panel/media-util.d.ts +0 -20
  195. package/build-types/components/post-publish-panel/media-util.d.ts.map +0 -1
  196. package/src/components/post-publish-panel/media-util.js +0 -87
  197. package/src/components/post-publish-panel/test/media-util.js +0 -118
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/provider/use-block-editor-settings.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tstore as coreStore,\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n\tprivateApis as coreDataPrivateApis,\n} from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tprivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { privateApis as mediaEditorPrivateApis } from '@wordpress/media-editor';\n\n/**\n * Internal dependencies\n */\nimport inserterMediaCategories from '../media-categories';\nimport { mediaUpload } from '../../utils';\nimport mediaUploadOnSuccess from '../../utils/media-upload/on-success';\nimport { default as mediaSideload } from '../../utils/media-sideload';\nimport { default as mediaFinalize } from '../../utils/media-finalize';\nimport { default as mediaDelete } from '../../utils/media-delete';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useGlobalStyles } from '../global-styles';\n\nconst { store: mediaEditorStore } = unlock( mediaEditorPrivateApis );\n\nconst EMPTY_OBJECT = {};\n\nfunction __experimentalReusableBlocksSelect( select ) {\n\tconst { RECEIVE_INTERMEDIATE_RESULTS } = unlock( coreDataPrivateApis );\n\tconst { getEntityRecords } = select( coreStore );\n\treturn getEntityRecords( 'postType', 'wp_block', {\n\t\tper_page: -1,\n\t\t[ RECEIVE_INTERMEDIATE_RESULTS ]: true,\n\t} );\n}\n\nfunction __experimentalUserPatternCategoriesSelect( select ) {\n\treturn select( coreStore ).getUserPatternCategories();\n}\n\nconst BLOCK_EDITOR_SETTINGS = [\n\t'__experimentalBlockBindingsSupportedAttributes',\n\t'__experimentalBlockDirectory',\n\t'__experimentalDiscussionSettings',\n\t'__experimentalFeatures',\n\t'__experimentalGlobalStylesBaseStyles',\n\t'allImageSizes',\n\t'alignWide',\n\t'blockInspectorTabs',\n\t'maxUploadFileSize',\n\t'allowedMimeTypes',\n\t'bodyPlaceholder',\n\t'canEditCSS',\n\t'canLockBlocks',\n\t'canUpdateBlockBindings',\n\t'capabilities',\n\t'clearBlockSelection',\n\t'codeEditingEnabled',\n\t'colors',\n\t'disableContentOnlyForTemplateParts',\n\t'disableContentOnlyForUnsyncedPatterns',\n\t'disableCustomColors',\n\t'disableCustomFontSizes',\n\t'disableCustomSpacingSizes',\n\t'disableCustomGradients',\n\t'disableLayoutStyles',\n\t'enableCustomLineHeight',\n\t'enableCustomSpacing',\n\t'enableCustomUnits',\n\t'enableOpenverseMediaCategory',\n\t'fontSizes',\n\t'gradients',\n\t'generateAnchors',\n\t'onNavigateToEntityRecord',\n\t'imageDefaultSize',\n\t'imageDimensions',\n\t'imageEditing',\n\t'imageSizes',\n\t'isPreviewMode',\n\t'isRTL',\n\t'locale',\n\t'maxWidth',\n\t'postContentAttributes',\n\t'postsPerPage',\n\t'readOnly',\n\t'styles',\n\t'titlePlaceholder',\n\t'supportsLayout',\n\t'widgetTypesToHideFromLegacyWidgetBlock',\n\t'__unstableHasCustomAppender',\n\t'__unstableResolvedAssets',\n\t'__unstableIsBlockBasedTheme',\n];\n\nconst {\n\tglobalStylesDataKey,\n\tglobalStylesLinksDataKey,\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n\tuserPatternCategoriesSelectKey,\n\tsectionRootClientIdKey,\n\tmediaEditKey,\n\tgetMediaSelectKey,\n\tisIsolatedEditorKey,\n\tdeviceTypeKey,\n\tisNavigationOverlayContextKey,\n\tisNavigationPostEditorKey,\n\tmediaUploadOnSuccessKey,\n\topenMediaEditorModalKey,\n} = unlock( privateApis );\n\n/**\n * React hook used to compute the block editor settings to use for the post editor.\n *\n * @param {Object} settings EditorProvider settings prop.\n * @param {string} postType Editor root level post type.\n * @param {string} postId Editor root level post ID.\n * @param {string} renderingMode Editor rendering mode.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, postType, postId, renderingMode ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\tallImageSizes,\n\t\tbigImageSizeThreshold,\n\t\tallowRightClickOverrides,\n\t\tblockTypes,\n\t\tfocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\thasUploadPermissions,\n\t\thiddenBlockTypes,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\trestBlockPatternCategories,\n\t\tsectionRootClientId,\n\t\tdeviceType,\n\t\tisNavigationOverlayContext,\n\t\tisRevisionsMode,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tcanUser,\n\t\t\t\tgetRawEntityRecord,\n\t\t\t\tgetEntityRecord,\n\t\t\t\tgetBlockPatternCategories,\n\t\t\t} = select( coreStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { getBlockTypes } = select( blocksStore );\n\t\t\tconst { getDeviceType, isRevisionsMode: _isRevisionsMode } = unlock(\n\t\t\t\tselect( editorStore )\n\t\t\t);\n\t\t\tconst { getBlocksByName, getBlockAttributes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst siteSettings = canUser( 'read', {\n\t\t\t\tkind: 'root',\n\t\t\t\tname: 'site',\n\t\t\t} )\n\t\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t\t: undefined;\n\n\t\t\t// Fetch image sizes from REST API index for client-side media processing.\n\t\t\tconst baseData = getEntityRecord( 'root', '__unstableBase' );\n\n\t\t\tfunction getSectionRootBlock() {\n\t\t\t\tif ( renderingMode === 'template-locked' ) {\n\t\t\t\t\treturn getBlocksByName( 'core/post-content' )?.[ 0 ] ?? '';\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\tgetBlocksByName( 'core/group' ).find(\n\t\t\t\t\t\t( clientId ) =>\n\t\t\t\t\t\t\tgetBlockAttributes( clientId )?.tagName === 'main'\n\t\t\t\t\t) ?? ''\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tallImageSizes: baseData?.image_sizes,\n\t\t\t\tbigImageSizeThreshold: baseData?.image_size_threshold,\n\t\t\t\tallowRightClickOverrides: get(\n\t\t\t\t\t'core',\n\t\t\t\t\t'allowRightClickOverrides'\n\t\t\t\t),\n\t\t\t\tblockTypes: getBlockTypes(),\n\t\t\t\tcanUseUnfilteredHTML: getRawEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId\n\t\t\t\t)?._links?.hasOwnProperty( 'wp:action-unfiltered-html' ),\n\t\t\t\tfocusMode: get( 'core', 'focusMode' ),\n\t\t\t\thasFixedToolbar:\n\t\t\t\t\tget( 'core', 'fixedToolbar' ) || ! isLargeViewport,\n\t\t\t\thiddenBlockTypes: get( 'core', 'hiddenBlockTypes' ),\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tkeepCaretInsideBlock: get( 'core', 'keepCaretInsideBlock' ),\n\t\t\t\thasUploadPermissions:\n\t\t\t\t\tcanUser( 'create', {\n\t\t\t\t\t\tkind: 'postType',\n\t\t\t\t\t\tname: 'attachment',\n\t\t\t\t\t} ) ?? true,\n\t\t\t\tuserCanCreatePages: canUser( 'create', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: 'page',\n\t\t\t\t} ),\n\t\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t\t\trestBlockPatternCategories: getBlockPatternCategories(),\n\t\t\t\tsectionRootClientId: getSectionRootBlock(),\n\t\t\t\tdeviceType: getDeviceType(),\n\t\t\t\tisNavigationOverlayContext:\n\t\t\t\t\tpostType === 'wp_template_part' && postId\n\t\t\t\t\t\t? getEntityRecord(\n\t\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t\t'wp_template_part',\n\t\t\t\t\t\t\t\tpostId\n\t\t\t\t\t\t )?.area === 'navigation-overlay'\n\t\t\t\t\t\t: false,\n\t\t\t\tisRevisionsMode: _isRevisionsMode(),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId, isLargeViewport, renderingMode ]\n\t);\n\n\tconst { merged: mergedGlobalStyles } = useGlobalStyles();\n\tconst globalStylesData = mergedGlobalStyles.styles ?? EMPTY_OBJECT;\n\tconst globalStylesLinksData = mergedGlobalStyles._links ?? EMPTY_OBJECT;\n\n\tconst settingsBlockPatterns =\n\t\tsettings.__experimentalAdditionalBlockPatterns ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatterns; // WP 5.9\n\tconst settingsBlockPatternCategories =\n\t\tsettings.__experimentalAdditionalBlockPatternCategories ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatternCategories; // WP 5.9\n\n\tconst blockPatterns = useMemo(\n\t\t() =>\n\t\t\t[ ...( settingsBlockPatterns || [] ) ].filter(\n\t\t\t\t( { postTypes } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t! postTypes ||\n\t\t\t\t\t\t( Array.isArray( postTypes ) &&\n\t\t\t\t\t\t\tpostTypes.includes( postType ) )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t),\n\t\t[ settingsBlockPatterns, postType ]\n\t);\n\n\tconst blockPatternCategories = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t...( settingsBlockPatternCategories || [] ),\n\t\t\t\t...( restBlockPatternCategories || [] ),\n\t\t\t].filter(\n\t\t\t\t( x, index, arr ) =>\n\t\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t\t),\n\t\t[ settingsBlockPatternCategories, restBlockPatternCategories ]\n\t);\n\n\tconst { undo, setIsInserterOpened } = useDispatch( editorStore );\n\tconst { editMediaEntity } = unlock( useDispatch( coreStore ) );\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst { openMediaEditorModal } = useDispatch( mediaEditorStore );\n\n\t/**\n\t * Creates a Post entity.\n\t * This is utilised by the Link UI to allow for on-the-fly creation of Posts/Pages.\n\t *\n\t * @param {Object} options parameters for the post being created. These mirror those used on 3rd param of saveEntityRecord.\n\t * @return {Object} the post type object that was created.\n\t */\n\tconst createPageEntity = useCallback(\n\t\t( options ) => {\n\t\t\tif ( ! userCanCreatePages ) {\n\t\t\t\treturn Promise.reject( {\n\t\t\t\t\tmessage: __(\n\t\t\t\t\t\t'You do not have permission to create Pages.'\n\t\t\t\t\t),\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn saveEntityRecord( 'postType', 'page', options );\n\t\t},\n\t\t[ saveEntityRecord, userCanCreatePages ]\n\t);\n\n\tconst allowedBlockTypes = useMemo( () => {\n\t\t// Omit hidden block types if exists and non-empty.\n\t\tif ( hiddenBlockTypes && hiddenBlockTypes.length > 0 ) {\n\t\t\t// Defer to passed setting for `allowedBlockTypes` if provided as\n\t\t\t// anything other than `true` (where `true` is equivalent to allow\n\t\t\t// all block types).\n\t\t\tconst defaultAllowedBlockTypes =\n\t\t\t\ttrue === settings.allowedBlockTypes\n\t\t\t\t\t? blockTypes.map( ( { name } ) => name )\n\t\t\t\t\t: settings.allowedBlockTypes || [];\n\n\t\t\treturn defaultAllowedBlockTypes.filter(\n\t\t\t\t( type ) => ! hiddenBlockTypes.includes( type )\n\t\t\t);\n\t\t}\n\n\t\treturn settings.allowedBlockTypes;\n\t}, [ settings.allowedBlockTypes, hiddenBlockTypes, blockTypes ] );\n\n\tconst forceDisableFocusMode = settings.focusMode === false;\n\n\treturn useMemo( () => {\n\t\tconst blockEditorSettings = {\n\t\t\t...Object.fromEntries(\n\t\t\t\tObject.entries( settings ).filter( ( [ key ] ) =>\n\t\t\t\t\tBLOCK_EDITOR_SETTINGS.includes( key )\n\t\t\t\t)\n\t\t\t),\n\t\t\t[ globalStylesDataKey ]: globalStylesData,\n\t\t\t[ globalStylesLinksDataKey ]: globalStylesLinksData,\n\t\t\tallImageSizes,\n\t\t\tbigImageSizeThreshold,\n\t\t\tallowedBlockTypes,\n\t\t\tallowRightClickOverrides,\n\t\t\tfocusMode: focusMode && ! forceDisableFocusMode,\n\t\t\thasFixedToolbar,\n\t\t\tisDistractionFree,\n\t\t\tkeepCaretInsideBlock,\n\t\t\t[ getMediaSelectKey ]: ( select, attachmentId ) => {\n\t\t\t\treturn select( coreStore ).getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'attachment',\n\t\t\t\t\tattachmentId\n\t\t\t\t);\n\t\t\t},\n\t\t\t[ mediaEditKey ]: hasUploadPermissions\n\t\t\t\t? editMediaEntity\n\t\t\t\t: undefined,\n\t\t\t[ openMediaEditorModalKey ]: ( { id, onUpdate, onClose } ) =>\n\t\t\t\topenMediaEditorModal( { id, onUpdate, onClose } ),\n\t\t\tmediaUpload: hasUploadPermissions ? mediaUpload : undefined,\n\t\t\t[ mediaUploadOnSuccessKey ]: hasUploadPermissions\n\t\t\t\t? mediaUploadOnSuccess\n\t\t\t\t: undefined,\n\t\t\tmediaSideload: hasUploadPermissions ? mediaSideload : undefined,\n\t\t\tmediaFinalize: hasUploadPermissions ? mediaFinalize : undefined,\n\t\t\tmediaDelete: hasUploadPermissions ? mediaDelete : undefined,\n\t\t\t__experimentalBlockPatterns: blockPatterns,\n\t\t\t[ selectBlockPatternsKey ]: ( select ) => {\n\t\t\t\tconst { hasFinishedResolution, getBlockPatternsForPostType } =\n\t\t\t\t\tunlock( select( coreStore ) );\n\t\t\t\tconst patterns = getBlockPatternsForPostType( postType );\n\t\t\t\treturn hasFinishedResolution( 'getBlockPatterns' )\n\t\t\t\t\t? patterns\n\t\t\t\t\t: undefined;\n\t\t\t},\n\t\t\t[ reusableBlocksSelectKey ]: __experimentalReusableBlocksSelect,\n\t\t\t[ userPatternCategoriesSelectKey ]:\n\t\t\t\t__experimentalUserPatternCategoriesSelect,\n\t\t\t__experimentalBlockPatternCategories: blockPatternCategories,\n\t\t\t__experimentalFetchLinkSuggestions: ( search, searchOptions ) =>\n\t\t\t\tfetchLinkSuggestions( search, searchOptions, settings ),\n\t\t\tinserterMediaCategories,\n\t\t\t__experimentalFetchRichUrlData: fetchUrlData,\n\t\t\t// Todo: This only checks the top level post, not the post within a template or any other entity that can be edited.\n\t\t\t// This might be better as a generic \"canUser\" selector.\n\t\t\t__experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,\n\t\t\t//Todo: this is only needed for native and should probably be removed.\n\t\t\t__experimentalUndo: undo,\n\t\t\t// Check whether we want all site editor frames to have outlines\n\t\t\t// including the navigation / pattern / parts editors.\n\t\t\toutlineMode: ! isDistractionFree && postType === 'wp_template',\n\t\t\t// Check these two properties: they were not present in the site editor.\n\t\t\t__experimentalCreatePageEntity: createPageEntity,\n\t\t\t__experimentalUserCanCreatePages: userCanCreatePages,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t\t__experimentalPreferPatternsOnRoot: postType === 'wp_template',\n\t\t\ttemplateLock:\n\t\t\t\tpostType === 'wp_navigation' ? 'insert' : settings.templateLock,\n\t\t\ttemplate:\n\t\t\t\tpostType === 'wp_navigation'\n\t\t\t\t\t? [ [ 'core/navigation', {}, [] ] ]\n\t\t\t\t\t: settings.template,\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t\t[ sectionRootClientIdKey ]: sectionRootClientId,\n\t\t\teditorTool:\n\t\t\t\trenderingMode === 'post-only' && postType !== 'wp_template'\n\t\t\t\t\t? 'edit'\n\t\t\t\t\t: undefined,\n\t\t\t// When editing template parts, patterns, or navigation directly,\n\t\t\t// we're in an isolated editing context (focused on that entity alone).\n\t\t\t[ isIsolatedEditorKey ]: [\n\t\t\t\t'wp_template_part',\n\t\t\t\t'wp_block',\n\t\t\t\t'wp_navigation',\n\t\t\t].includes( postType ),\n\t\t\t[ isNavigationPostEditorKey ]: postType === 'wp_navigation',\n\t\t\t// When in template-locked mode (e.g., \"Show Template\" in the post editor),\n\t\t\t// don't treat template parts as contentOnly sections.\n\t\t\tdisableContentOnlyForTemplateParts:\n\t\t\t\trenderingMode === 'template-locked' ||\n\t\t\t\tsettings.disableContentOnlyForTemplateParts,\n\t\t\t...( deviceType ? { [ deviceTypeKey ]: deviceType } : {} ),\n\t\t\t[ isNavigationOverlayContextKey ]: isNavigationOverlayContext,\n\t\t};\n\n\t\tif ( isRevisionsMode ) {\n\t\t\tblockEditorSettings.isPreviewMode = true;\n\t\t}\n\n\t\treturn blockEditorSettings;\n\t}, [\n\t\tisRevisionsMode,\n\t\tallowedBlockTypes,\n\t\tallowRightClickOverrides,\n\t\tfocusMode,\n\t\tforceDisableFocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\tsettings,\n\t\thasUploadPermissions,\n\t\tblockPatterns,\n\t\tblockPatternCategories,\n\t\tcanUseUnfilteredHTML,\n\t\tundo,\n\t\tcreatePageEntity,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tpostType,\n\t\tsetIsInserterOpened,\n\t\tsectionRootClientId,\n\t\tglobalStylesData,\n\t\tglobalStylesLinksData,\n\t\trenderingMode,\n\t\teditMediaEntity,\n\t\topenMediaEditorModal,\n\t\tdeviceType,\n\t\tallImageSizes,\n\t\tbigImageSizeThreshold,\n\t\tisNavigationOverlayContext,\n\t] );\n}\n\nexport default useBlockEditorSettings;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAqC;AACrC,kBAAuC;AACvC,uBAKO;AACP,kBAAmB;AACnB,yBAA0C;AAC1C,qBAAiC;AACjC,oBAAqC;AACrC,0BAGO;AACP,0BAAsD;AAKtD,8BAAoC;AACpC,mBAA4B;AAC5B,wBAAiC;AACjC,4BAAyC;AACzC,4BAAy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CAAQ;",
6
- "names": ["mediaEditorPrivateApis", "coreDataPrivateApis", "coreStore", "preferencesStore", "blocksStore", "editorStore", "blockEditorStore", "mediaUploadOnSuccess", "mediaSideload", "mediaFinalize", "mediaDelete", "fetchLinkSuggestions", "inserterMediaCategories", "fetchUrlData"]
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\tstore as coreStore,\n\t__experimentalFetchLinkSuggestions as fetchLinkSuggestions,\n\t__experimentalFetchUrlData as fetchUrlData,\n\tprivateApis as coreDataPrivateApis,\n} from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tprivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { privateApis as mediaEditorPrivateApis } from '@wordpress/media-editor';\n\n/**\n * Internal dependencies\n */\nimport getInserterMediaCategories from '../media-categories';\nimport { mediaUpload } from '../../utils';\nimport mediaUploadOnSuccess from '../../utils/media-upload/on-success';\nimport { default as mediaSideload } from '../../utils/media-sideload';\nimport { default as mediaSideloadFromUrl } from '../../utils/media-sideload-from-url';\nimport { default as mediaFinalize } from '../../utils/media-finalize';\nimport { default as mediaDelete } from '../../utils/media-delete';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useGlobalStyles } from '../global-styles';\n\nconst { store: mediaEditorStore } = unlock( mediaEditorPrivateApis );\n\nconst EMPTY_OBJECT = {};\n\nfunction __experimentalReusableBlocksSelect( select ) {\n\tconst { RECEIVE_INTERMEDIATE_RESULTS } = unlock( coreDataPrivateApis );\n\tconst { getEntityRecords } = select( coreStore );\n\treturn getEntityRecords( 'postType', 'wp_block', {\n\t\tper_page: -1,\n\t\t[ RECEIVE_INTERMEDIATE_RESULTS ]: true,\n\t} );\n}\n\nfunction __experimentalUserPatternCategoriesSelect( select ) {\n\treturn select( coreStore ).getUserPatternCategories();\n}\n\nconst BLOCK_EDITOR_SETTINGS = [\n\t'__experimentalBlockBindingsSupportedAttributes',\n\t'__experimentalBlockDirectory',\n\t'__experimentalDiscussionSettings',\n\t'__experimentalFeatures',\n\t'__experimentalGlobalStylesBaseStyles',\n\t'allImageSizes',\n\t'alignWide',\n\t'blockInspectorTabs',\n\t'maxUploadFileSize',\n\t'allowedMimeTypes',\n\t'bodyPlaceholder',\n\t'canEditCSS',\n\t'canLockBlocks',\n\t'canUpdateBlockBindings',\n\t'capabilities',\n\t'clearBlockSelection',\n\t'codeEditingEnabled',\n\t'colors',\n\t'disableContentOnlyForTemplateParts',\n\t'disableContentOnlyForUnsyncedPatterns',\n\t'disableCustomColors',\n\t'disableCustomFontSizes',\n\t'disableCustomSpacingSizes',\n\t'disableCustomGradients',\n\t'disableLayoutStyles',\n\t'enableCustomLineHeight',\n\t'enableCustomSpacing',\n\t'enableCustomUnits',\n\t'enableOpenverseMediaCategory',\n\t'fontSizes',\n\t'gradients',\n\t'generateAnchors',\n\t'onNavigateToEntityRecord',\n\t'imageDefaultSize',\n\t'imageDimensions',\n\t'imageEditing',\n\t'imageSizes',\n\t'isPreviewMode',\n\t'isRTL',\n\t'locale',\n\t'maxWidth',\n\t'postContentAttributes',\n\t'postsPerPage',\n\t'readOnly',\n\t'styles',\n\t'titlePlaceholder',\n\t'supportsLayout',\n\t'widgetTypesToHideFromLegacyWidgetBlock',\n\t'__unstableHasCustomAppender',\n\t'__unstableResolvedAssets',\n\t'__unstableIsBlockBasedTheme',\n];\n\nconst {\n\tglobalStylesDataKey,\n\tglobalStylesLinksDataKey,\n\tselectBlockPatternsKey,\n\treusableBlocksSelectKey,\n\tuserPatternCategoriesSelectKey,\n\tsectionRootClientIdKey,\n\tmediaEditKey,\n\tgetMediaSelectKey,\n\tisIsolatedEditorKey,\n\tdeviceTypeKey,\n\tisNavigationOverlayContextKey,\n\tisNavigationPostEditorKey,\n\tmediaUploadOnSuccessKey,\n\tmediaSideloadFromUrlKey,\n\topenMediaEditorModalKey,\n} = unlock( privateApis );\n\n/**\n * React hook used to compute the block editor settings to use for the post editor.\n *\n * @param {Object} settings EditorProvider settings prop.\n * @param {string} postType Editor root level post type.\n * @param {string} postId Editor root level post ID.\n * @param {string} renderingMode Editor rendering mode.\n *\n * @return {Object} Block Editor Settings.\n */\nfunction useBlockEditorSettings( settings, postType, postId, renderingMode ) {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst {\n\t\tallImageSizes,\n\t\tbigImageSizeThreshold,\n\t\tallowRightClickOverrides,\n\t\tblockTypes,\n\t\tfocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\thasUploadPermissions,\n\t\thiddenBlockTypes,\n\t\tcanUseUnfilteredHTML,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\trestBlockPatternCategories,\n\t\tsectionRootClientId,\n\t\tdeviceType,\n\t\tisNavigationOverlayContext,\n\t\tisRevisionsMode,\n\t\tviewablePostTypeLabel,\n\t\tcurrentPostId,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tcanUser,\n\t\t\t\tgetRawEntityRecord,\n\t\t\t\tgetEntityRecord,\n\t\t\t\tgetBlockPatternCategories,\n\t\t\t\tgetPostType,\n\t\t\t} = select( coreStore );\n\t\t\tconst { get } = select( preferencesStore );\n\t\t\tconst { getBlockTypes } = select( blocksStore );\n\t\t\tconst { getCurrentPostId, getCurrentPostType } =\n\t\t\t\tselect( editorStore );\n\t\t\tconst { getDeviceType, isRevisionsMode: _isRevisionsMode } = unlock(\n\t\t\t\tselect( editorStore )\n\t\t\t);\n\t\t\tconst { getBlocksByName, getBlockAttributes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\tconst siteSettings = canUser( 'read', {\n\t\t\t\tkind: 'root',\n\t\t\t\tname: 'site',\n\t\t\t} )\n\t\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t\t: undefined;\n\n\t\t\t// Fetch image sizes from REST API index for client-side media processing.\n\t\t\tconst baseData = getEntityRecord( 'root', '__unstableBase' );\n\n\t\t\t// The attached-images category follows the post being edited, not the\n\t\t\t// root-level entity in `postType`/`postId`. With \"Show template\" on,\n\t\t\t// the root becomes the template (wp_template), but media still attaches\n\t\t\t// to the page being edited.\n\t\t\t//\n\t\t\t// Guard on a truthy slug: `getPostType()` with no slug resolves the\n\t\t\t// whole `/wp/v2/types` collection rather than the single, already\n\t\t\t// fetched record for the current type.\n\t\t\tconst currentPostType = getCurrentPostType();\n\t\t\tconst postTypeObject = currentPostType\n\t\t\t\t? getPostType( currentPostType )\n\t\t\t\t: undefined;\n\n\t\t\tfunction getSectionRootBlock() {\n\t\t\t\tif ( renderingMode === 'template-locked' ) {\n\t\t\t\t\treturn getBlocksByName( 'core/post-content' )?.[ 0 ] ?? '';\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\tgetBlocksByName( 'core/group' ).find(\n\t\t\t\t\t\t( clientId ) =>\n\t\t\t\t\t\t\tgetBlockAttributes( clientId )?.tagName === 'main'\n\t\t\t\t\t) ?? ''\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tallImageSizes: baseData?.image_sizes,\n\t\t\t\tbigImageSizeThreshold: baseData?.image_size_threshold,\n\t\t\t\tallowRightClickOverrides: get(\n\t\t\t\t\t'core',\n\t\t\t\t\t'allowRightClickOverrides'\n\t\t\t\t),\n\t\t\t\tblockTypes: getBlockTypes(),\n\t\t\t\tcanUseUnfilteredHTML: getRawEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId\n\t\t\t\t)?._links?.hasOwnProperty( 'wp:action-unfiltered-html' ),\n\t\t\t\tfocusMode: get( 'core', 'focusMode' ),\n\t\t\t\thasFixedToolbar:\n\t\t\t\t\tget( 'core', 'fixedToolbar' ) || ! isLargeViewport,\n\t\t\t\thiddenBlockTypes: get( 'core', 'hiddenBlockTypes' ),\n\t\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\t\tkeepCaretInsideBlock: get( 'core', 'keepCaretInsideBlock' ),\n\t\t\t\thasUploadPermissions:\n\t\t\t\t\tcanUser( 'create', {\n\t\t\t\t\t\tkind: 'postType',\n\t\t\t\t\t\tname: 'attachment',\n\t\t\t\t\t} ) ?? true,\n\t\t\t\tuserCanCreatePages: canUser( 'create', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: 'page',\n\t\t\t\t} ),\n\t\t\t\tpageOnFront: siteSettings?.page_on_front,\n\t\t\t\tpageForPosts: siteSettings?.page_for_posts,\n\t\t\t\t// The post type's singular name, but only for real, front-end\n\t\t\t\t// rendered content (`viewable`). Empty for synced patterns,\n\t\t\t\t// navigation and templates, which gates the attached-images\n\t\t\t\t// category off for them and words its copy for everything else.\n\t\t\t\tviewablePostTypeLabel: postTypeObject?.viewable\n\t\t\t\t\t? postTypeObject?.labels?.singular_name\n\t\t\t\t\t: undefined,\n\t\t\t\tcurrentPostId: getCurrentPostId(),\n\t\t\t\trestBlockPatternCategories: getBlockPatternCategories(),\n\t\t\t\tsectionRootClientId: getSectionRootBlock(),\n\t\t\t\tdeviceType: getDeviceType(),\n\t\t\t\tisNavigationOverlayContext:\n\t\t\t\t\tpostType === 'wp_template_part' && postId\n\t\t\t\t\t\t? getEntityRecord(\n\t\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t\t'wp_template_part',\n\t\t\t\t\t\t\t\tpostId\n\t\t\t\t\t\t )?.area === 'navigation-overlay'\n\t\t\t\t\t\t: false,\n\t\t\t\tisRevisionsMode: _isRevisionsMode(),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId, isLargeViewport, renderingMode ]\n\t);\n\n\tconst { merged: mergedGlobalStyles } = useGlobalStyles();\n\tconst globalStylesData = mergedGlobalStyles.styles ?? EMPTY_OBJECT;\n\tconst globalStylesLinksData = mergedGlobalStyles._links ?? EMPTY_OBJECT;\n\n\tconst settingsBlockPatterns =\n\t\tsettings.__experimentalAdditionalBlockPatterns ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatterns; // WP 5.9\n\tconst settingsBlockPatternCategories =\n\t\tsettings.__experimentalAdditionalBlockPatternCategories ?? // WP 6.0\n\t\tsettings.__experimentalBlockPatternCategories; // WP 5.9\n\n\tconst blockPatterns = useMemo(\n\t\t() =>\n\t\t\t[ ...( settingsBlockPatterns || [] ) ].filter(\n\t\t\t\t( { postTypes } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t! postTypes ||\n\t\t\t\t\t\t( Array.isArray( postTypes ) &&\n\t\t\t\t\t\t\tpostTypes.includes( postType ) )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t),\n\t\t[ settingsBlockPatterns, postType ]\n\t);\n\n\tconst blockPatternCategories = useMemo(\n\t\t() =>\n\t\t\t[\n\t\t\t\t...( settingsBlockPatternCategories || [] ),\n\t\t\t\t...( restBlockPatternCategories || [] ),\n\t\t\t].filter(\n\t\t\t\t( x, index, arr ) =>\n\t\t\t\t\tindex === arr.findIndex( ( y ) => x.name === y.name )\n\t\t\t),\n\t\t[ settingsBlockPatternCategories, restBlockPatternCategories ]\n\t);\n\n\tconst { undo, setIsInserterOpened } = useDispatch( editorStore );\n\tconst { editMediaEntity } = unlock( useDispatch( coreStore ) );\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst { openMediaEditorModal } = useDispatch( mediaEditorStore );\n\n\t/**\n\t * Creates a Post entity.\n\t * This is utilised by the Link UI to allow for on-the-fly creation of Posts/Pages.\n\t *\n\t * @param {Object} options parameters for the post being created. These mirror those used on 3rd param of saveEntityRecord.\n\t * @return {Object} the post type object that was created.\n\t */\n\tconst createPageEntity = useCallback(\n\t\t( options ) => {\n\t\t\tif ( ! userCanCreatePages ) {\n\t\t\t\treturn Promise.reject( {\n\t\t\t\t\tmessage: __(\n\t\t\t\t\t\t'You do not have permission to create Pages.'\n\t\t\t\t\t),\n\t\t\t\t} );\n\t\t\t}\n\t\t\treturn saveEntityRecord( 'postType', 'page', options );\n\t\t},\n\t\t[ saveEntityRecord, userCanCreatePages ]\n\t);\n\n\tconst allowedBlockTypes = useMemo( () => {\n\t\t// Omit hidden block types if exists and non-empty.\n\t\tif ( hiddenBlockTypes && hiddenBlockTypes.length > 0 ) {\n\t\t\t// Defer to passed setting for `allowedBlockTypes` if provided as\n\t\t\t// anything other than `true` (where `true` is equivalent to allow\n\t\t\t// all block types).\n\t\t\tconst defaultAllowedBlockTypes =\n\t\t\t\ttrue === settings.allowedBlockTypes\n\t\t\t\t\t? blockTypes.map( ( { name } ) => name )\n\t\t\t\t\t: settings.allowedBlockTypes || [];\n\n\t\t\treturn defaultAllowedBlockTypes.filter(\n\t\t\t\t( type ) => ! hiddenBlockTypes.includes( type )\n\t\t\t);\n\t\t}\n\n\t\treturn settings.allowedBlockTypes;\n\t}, [ settings.allowedBlockTypes, hiddenBlockTypes, blockTypes ] );\n\n\tconst forceDisableFocusMode = settings.focusMode === false;\n\n\t// The \"Attachments\" media category depends on the edited post and its post\n\t// type label (which gates whether it's offered and words its copy), so the\n\t// categories are derived rather than being a static list.\n\tconst inserterMediaCategories = useMemo(\n\t\t() =>\n\t\t\tgetInserterMediaCategories( currentPostId, viewablePostTypeLabel ),\n\t\t[ currentPostId, viewablePostTypeLabel ]\n\t);\n\n\treturn useMemo( () => {\n\t\tconst blockEditorSettings = {\n\t\t\t...Object.fromEntries(\n\t\t\t\tObject.entries( settings ).filter( ( [ key ] ) =>\n\t\t\t\t\tBLOCK_EDITOR_SETTINGS.includes( key )\n\t\t\t\t)\n\t\t\t),\n\t\t\t[ globalStylesDataKey ]: globalStylesData,\n\t\t\t[ globalStylesLinksDataKey ]: globalStylesLinksData,\n\t\t\tallImageSizes,\n\t\t\tbigImageSizeThreshold,\n\t\t\tallowedBlockTypes,\n\t\t\tallowRightClickOverrides,\n\t\t\tfocusMode: focusMode && ! forceDisableFocusMode,\n\t\t\thasFixedToolbar,\n\t\t\tisDistractionFree,\n\t\t\tkeepCaretInsideBlock,\n\t\t\t[ getMediaSelectKey ]: ( select, attachmentId ) => {\n\t\t\t\treturn select( coreStore ).getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'attachment',\n\t\t\t\t\tattachmentId\n\t\t\t\t);\n\t\t\t},\n\t\t\t[ mediaEditKey ]: hasUploadPermissions\n\t\t\t\t? editMediaEntity\n\t\t\t\t: undefined,\n\t\t\t[ openMediaEditorModalKey ]: ( { id, onUpdate, onClose } ) =>\n\t\t\t\topenMediaEditorModal( { id, onUpdate, onClose } ),\n\t\t\tmediaUpload: hasUploadPermissions ? mediaUpload : undefined,\n\t\t\t[ mediaUploadOnSuccessKey ]: hasUploadPermissions\n\t\t\t\t? mediaUploadOnSuccess\n\t\t\t\t: undefined,\n\t\t\tmediaSideload: hasUploadPermissions ? mediaSideload : undefined,\n\t\t\t[ mediaSideloadFromUrlKey ]: hasUploadPermissions\n\t\t\t\t? mediaSideloadFromUrl\n\t\t\t\t: undefined,\n\t\t\tmediaFinalize: hasUploadPermissions ? mediaFinalize : undefined,\n\t\t\tmediaDelete: hasUploadPermissions ? mediaDelete : undefined,\n\t\t\t__experimentalBlockPatterns: blockPatterns,\n\t\t\t[ selectBlockPatternsKey ]: ( select ) => {\n\t\t\t\tconst { hasFinishedResolution, getBlockPatternsForPostType } =\n\t\t\t\t\tunlock( select( coreStore ) );\n\t\t\t\tconst patterns = getBlockPatternsForPostType( postType );\n\t\t\t\treturn hasFinishedResolution( 'getBlockPatterns' )\n\t\t\t\t\t? patterns\n\t\t\t\t\t: undefined;\n\t\t\t},\n\t\t\t[ reusableBlocksSelectKey ]: __experimentalReusableBlocksSelect,\n\t\t\t[ userPatternCategoriesSelectKey ]:\n\t\t\t\t__experimentalUserPatternCategoriesSelect,\n\t\t\t__experimentalBlockPatternCategories: blockPatternCategories,\n\t\t\t__experimentalFetchLinkSuggestions: ( search, searchOptions ) =>\n\t\t\t\tfetchLinkSuggestions( search, searchOptions, settings ),\n\t\t\tinserterMediaCategories,\n\t\t\t__experimentalFetchRichUrlData: fetchUrlData,\n\t\t\t// Todo: This only checks the top level post, not the post within a template or any other entity that can be edited.\n\t\t\t// This might be better as a generic \"canUser\" selector.\n\t\t\t__experimentalCanUserUseUnfilteredHTML: canUseUnfilteredHTML,\n\t\t\t//Todo: this is only needed for native and should probably be removed.\n\t\t\t__experimentalUndo: undo,\n\t\t\t// Check whether we want all site editor frames to have outlines\n\t\t\t// including the navigation / pattern / parts editors.\n\t\t\toutlineMode: ! isDistractionFree && postType === 'wp_template',\n\t\t\t// Check these two properties: they were not present in the site editor.\n\t\t\t__experimentalCreatePageEntity: createPageEntity,\n\t\t\t__experimentalUserCanCreatePages: userCanCreatePages,\n\t\t\tpageOnFront,\n\t\t\tpageForPosts,\n\t\t\t__experimentalPreferPatternsOnRoot: postType === 'wp_template',\n\t\t\ttemplateLock:\n\t\t\t\tpostType === 'wp_navigation' ? 'insert' : settings.templateLock,\n\t\t\ttemplate:\n\t\t\t\tpostType === 'wp_navigation'\n\t\t\t\t\t? [ [ 'core/navigation', {}, [] ] ]\n\t\t\t\t\t: settings.template,\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t\t[ sectionRootClientIdKey ]: sectionRootClientId,\n\t\t\teditorTool:\n\t\t\t\trenderingMode === 'post-only' && postType !== 'wp_template'\n\t\t\t\t\t? 'edit'\n\t\t\t\t\t: undefined,\n\t\t\t// When editing template parts, patterns, or navigation directly,\n\t\t\t// we're in an isolated editing context (focused on that entity alone).\n\t\t\t[ isIsolatedEditorKey ]: [\n\t\t\t\t'wp_template_part',\n\t\t\t\t'wp_block',\n\t\t\t\t'wp_navigation',\n\t\t\t].includes( postType ),\n\t\t\t[ isNavigationPostEditorKey ]: postType === 'wp_navigation',\n\t\t\t// When in template-locked mode (e.g., \"Show Template\" in the post editor),\n\t\t\t// don't treat template parts as contentOnly sections.\n\t\t\tdisableContentOnlyForTemplateParts:\n\t\t\t\trenderingMode === 'template-locked' ||\n\t\t\t\tsettings.disableContentOnlyForTemplateParts,\n\t\t\t...( deviceType ? { [ deviceTypeKey ]: deviceType } : {} ),\n\t\t\t[ isNavigationOverlayContextKey ]: isNavigationOverlayContext,\n\t\t};\n\n\t\tif ( isRevisionsMode ) {\n\t\t\tblockEditorSettings.isPreviewMode = true;\n\t\t}\n\n\t\treturn blockEditorSettings;\n\t}, [\n\t\tisRevisionsMode,\n\t\tallowedBlockTypes,\n\t\tallowRightClickOverrides,\n\t\tfocusMode,\n\t\tforceDisableFocusMode,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tkeepCaretInsideBlock,\n\t\tsettings,\n\t\thasUploadPermissions,\n\t\tblockPatterns,\n\t\tblockPatternCategories,\n\t\tinserterMediaCategories,\n\t\tcanUseUnfilteredHTML,\n\t\tundo,\n\t\tcreatePageEntity,\n\t\tuserCanCreatePages,\n\t\tpageOnFront,\n\t\tpageForPosts,\n\t\tpostType,\n\t\tsetIsInserterOpened,\n\t\tsectionRootClientId,\n\t\tglobalStylesData,\n\t\tglobalStylesLinksData,\n\t\trenderingMode,\n\t\teditMediaEntity,\n\t\topenMediaEditorModal,\n\t\tdeviceType,\n\t\tallImageSizes,\n\t\tbigImageSizeThreshold,\n\t\tisNavigationOverlayContext,\n\t] );\n}\n\nexport default useBlockEditorSettings;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,qBAAqC;AACrC,kBAAuC;AACvC,uBAKO;AACP,kBAAmB;AACnB,yBAA0C;AAC1C,qBAAiC;AACjC,oBAAqC;AACrC,0BAGO;AACP,0BAAsD;AAKtD,8BAAuC;AACvC,mBAA4B;AAC5B,wBAAiC;AACjC,4BAAyC;AACzC,qCAAgD;AAChD,4BAAyC;AACzC,0BAAuC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K,iBAAkB;AACtB,0BAAoB,gBAAgB;AAAA,IACrC;AAEA,WAAO;AAAA,EACR,GAAG;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AACH;AAEA,IAAO,oCAAQ;",
6
+ "names": ["mediaEditorPrivateApis", "coreDataPrivateApis", "coreStore", "preferencesStore", "blocksStore", "editorStore", "blockEditorStore", "getInserterMediaCategories", "mediaUploadOnSuccess", "mediaSideload", "mediaSideloadFromUrl", "mediaFinalize", "mediaDelete", "fetchLinkSuggestions", "fetchUrlData"]
7
7
  }
@@ -41,6 +41,7 @@ var import_ui = require("@wordpress/ui");
41
41
  var import_element = require("@wordpress/element");
42
42
  var import_views = require("@wordpress/views");
43
43
  var import_post_card_panel = __toESM(require("../post-card-panel/index.cjs"));
44
+ var import_plugin_post_status_info = __toESM(require("../plugin-post-status-info/index.cjs"));
44
45
  var import_post_panel_section = __toESM(require("../post-panel-section/index.cjs"));
45
46
  var import_store = require("../../store/index.cjs");
46
47
  var import_post_trash = __toESM(require("../post-trash/index.cjs"));
@@ -306,7 +307,10 @@ function DataFormPostSummary({ onActionPerformed }) {
306
307
  onChange
307
308
  }
308
309
  ),
309
- !isPostStatusRemoved && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_post_trash.default, { onActionPerformed })
310
+ !isPostStatusRemoved && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
311
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_post_status_info.default.Slot, { children: (fills) => fills.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ui.Stack, { direction: "column", gap: "xs", children: fills }) }),
312
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_post_trash.default, { onActionPerformed })
313
+ ] })
310
314
  ] }) });
311
315
  }
312
316
  //# sourceMappingURL=dataform-post-summary.cjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/sidebar/dataform-post-summary.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect, useRegistry } from '@wordpress/data';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { DataForm } from '@wordpress/dataviews';\nimport { Stack } from '@wordpress/ui';\nimport { useMemo } from '@wordpress/element';\nimport { useViewConfig } from '@wordpress/views';\n\n/**\n * Internal dependencies\n */\nimport PostCardPanel from '../post-card-panel';\nimport PostPanelSection from '../post-panel-section';\nimport { store as editorStore } from '../../store';\nimport PostTrash from '../post-trash';\nimport usePostFields from '../post-fields';\nimport { usePostTemplatePanelMode } from '../post-template/hooks';\nimport revisionsField from '../../dataviews/fields/revisions';\n\nconst EMPTY_FORM = { layout: { type: 'panel' }, fields: [] };\nconst VIEW_CONFIG_FIELDS = [ 'form' ];\n\n/**\n * Bridges the legacy editor-panel visibility controls onto the DataForm summary,\n * returning the form with the hidden fields removed. The new inspector has no\n * concept of the Preferences → Panels switches or of `removeEditorPanel`, so we\n * reproduce their effect on the form.\n *\n * @param {Object} form The DataForm summary form configuration.\n * @return {Object} The form with the hidden fields removed.\n */\nfunction useInspectorPanelVisibility( form ) {\n\tconst {\n\t\tisPostStatusRemoved,\n\t\tfeaturedImageEnabled,\n\t\texcerptEnabled,\n\t\tdiscussionEnabled,\n\t\tpageAttributesEnabled,\n\t} = useSelect( ( select ) => {\n\t\tconst { isEditorPanelRemoved, isEditorPanelEnabled } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tisPostStatusRemoved: isEditorPanelRemoved( 'post-status' ),\n\t\t\tfeaturedImageEnabled: isEditorPanelEnabled( 'featured-image' ),\n\t\t\texcerptEnabled: isEditorPanelEnabled( 'post-excerpt' ),\n\t\t\tdiscussionEnabled: isEditorPanelEnabled( 'discussion-panel' ),\n\t\t\tpageAttributesEnabled: isEditorPanelEnabled( 'page-attributes' ),\n\t\t};\n\t}, [] );\n\n\tconst visibleForm = useMemo( () => {\n\t\tif ( ! form.fields?.length ) {\n\t\t\treturn form;\n\t\t}\n\t\t// `featured_media`/`excerpt` are their own top-level panels and\n\t\t// `post-content-info` is always shown, so they survive. Everything else\n\t\t// belongs to the `post-status` summary panel: `discussion`/`parent` honor\n\t\t// their own switch, but every one of them is hidden while the `post-status`\n\t\t// panel is removed.\n\t\tconst visibilityById = {\n\t\t\tfeatured_media: featuredImageEnabled,\n\t\t\texcerpt: excerptEnabled,\n\t\t\t'post-content-info': true,\n\t\t\tdiscussion: discussionEnabled && ! isPostStatusRemoved,\n\t\t\tparent: pageAttributesEnabled && ! isPostStatusRemoved,\n\t\t};\n\t\tconst isFieldVisible = ( id ) =>\n\t\t\tid in visibilityById ? visibilityById[ id ] : ! isPostStatusRemoved;\n\t\t// Recurse into `children` so a panel-tied field is dropped wherever it\n\t\t// sits in the form: the PHP view-config filter can nest such a field\n\t\t// inside another field's group.\n\t\tconst filterFields = ( fields ) =>\n\t\t\tfields.reduce( ( acc, field ) => {\n\t\t\t\tconst id = typeof field === 'string' ? field : field.id;\n\t\t\t\tif ( ! isFieldVisible( id ) ) {\n\t\t\t\t\treturn acc;\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\ttypeof field !== 'string' &&\n\t\t\t\t\tArray.isArray( field.children )\n\t\t\t\t) {\n\t\t\t\t\tconst children = filterFields( field.children );\n\t\t\t\t\t// A group whose children were all removed would render as\n\t\t\t\t\t// an empty panel, so drop it too.\n\t\t\t\t\tif ( ! children.length ) {\n\t\t\t\t\t\treturn acc;\n\t\t\t\t\t}\n\t\t\t\t\tacc.push( { ...field, children } );\n\t\t\t\t\treturn acc;\n\t\t\t\t}\n\t\t\t\tacc.push( field );\n\t\t\t\treturn acc;\n\t\t\t}, [] );\n\t\treturn { ...form, fields: filterFields( form.fields ) };\n\t}, [\n\t\tform,\n\t\tisPostStatusRemoved,\n\t\tfeaturedImageEnabled,\n\t\texcerptEnabled,\n\t\tdiscussionEnabled,\n\t\tpageAttributesEnabled,\n\t] );\n\n\treturn visibleForm;\n}\n\n// Some post types expose summary fields that edit entities other than the one\n// being edited. Keyed by the post type that needs them, the related records are\n// merged into the form data under a `${ kind }_${ name }` namespace key so that\n// a single DataForm can read and write all of them, and edits to those keys are\n// routed back to their entity.\n//\n// The fields themselves are namespace-agnostic: they read and write a plain\n// record. The `fields` list ties each one to the entity it edits, and this\n// component overrides their `getValue`/`setValue`/`render` to operate on the\n// namespaced record, plus their `isVisible` to only show where that record is\n// present (e.g. the `home`/`index` template summary).\n//\n// Currently only `wp_template` uses this: `posts_per_page` and\n// `default_comment_status` target `root/site`, and `posts_page_title` targets\n// the posts page (the `page` assigned as `page_for_posts`).\nconst ENTITIES = {\n\twp_template: {\n\t\troot_site: {\n\t\t\tkind: 'root',\n\t\t\tname: 'site',\n\t\t\tfields: [ 'posts_per_page', 'default_comment_status' ],\n\t\t\tisVisible: ( item ) =>\n\t\t\t\t[ 'home', 'index' ].includes( item.slug ?? '' ),\n\t\t},\n\t\tposttype_page: {\n\t\t\tkind: 'postType',\n\t\t\tname: 'page',\n\t\t\tgetId: ( select ) =>\n\t\t\t\tselect( coreDataStore ).getEditedEntityRecord( 'root', 'site' )\n\t\t\t\t\t?.page_for_posts,\n\t\t\tfields: [ 'posts_page_title' ],\n\t\t\tisVisible: ( item ) =>\n\t\t\t\t[ 'home', 'index' ].includes( item.slug ?? '' ),\n\t\t},\n\t},\n};\n\n// Rebinds a namespace-agnostic field to the namespaced record it edits. Every\n// field callback that receives the form `item` is redirected to the\n// `item[ namespace ]` sub-record so the field operates on its own entity:\n// `getValue`/`setValue`/`render` here, and the rest indirectly because they all\n// funnel through the (remapped) `getValue` (default `render`, `getValueFormatted`\n// and `isValid` range/`custom` validation). Edits are wrapped back under the\n// namespace key. The caller-supplied `isVisible` encodes entity-specific\n// conditions (e.g. only for `home`/`index` templates); the generic guard\n// `!! item[ namespace ]` ensures the field is hidden when the sub-record\n// hasn't been fetched.\nfunction bindFieldToNamespace( field, namespace, isVisible = () => true ) {\n\tconst subItem = ( item ) => item?.[ namespace ] ?? {};\n\treturn {\n\t\t...field,\n\t\tgetValue: ( { item } ) =>\n\t\t\tfield.getValue\n\t\t\t\t? field.getValue( { item: subItem( item ) } )\n\t\t\t\t: subItem( item )[ field.id ],\n\t\tsetValue: ( { item, value } ) => ( {\n\t\t\t[ namespace ]: field.setValue( { item: subItem( item ), value } ),\n\t\t} ),\n\t\trender: field.render\n\t\t\t? ( props ) =>\n\t\t\t\t\tfield.render( { ...props, item: subItem( props.item ) } )\n\t\t\t: undefined,\n\t\tisVisible: ( item ) => isVisible( item ) && !! item[ namespace ],\n\t};\n}\n\nexport default function DataFormPostSummary( { onActionPerformed } ) {\n\tconst { postType, postId, isPostStatusRemoved, availableTemplates } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst {\n\t\t\t\tgetCurrentPostType,\n\t\t\t\tgetCurrentPostId,\n\t\t\t\tisEditorPanelRemoved,\n\t\t\t\tgetEditorSettings,\n\t\t\t} = select( editorStore );\n\t\t\tconst _availableTemplates = select(\n\t\t\t\tcoreDataStore\n\t\t\t).getCurrentTheme()?.is_block_theme\n\t\t\t\t? null\n\t\t\t\t: getEditorSettings().availableTemplates ?? null;\n\t\t\treturn {\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t\tpostId: getCurrentPostId(),\n\t\t\t\tisPostStatusRemoved: isEditorPanelRemoved( 'post-status' ),\n\t\t\t\tavailableTemplates: _availableTemplates,\n\t\t\t};\n\t\t}, [] );\n\tconst { form: formConfig } = useViewConfig( {\n\t\tkind: 'postType',\n\t\tname: postType,\n\t\tfields: VIEW_CONFIG_FIELDS,\n\t} );\n\t// Bridge the legacy editor-panel visibility (Preferences → Panels and\n\t// programmatic panel removal) onto the form by dropping hidden fields.\n\tconst form = useInspectorPanelVisibility( formConfig ?? EMPTY_FORM );\n\tconst record = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! postType || ! postId ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn select( coreDataStore ).getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t);\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tconst templatePanelMode = usePostTemplatePanelMode();\n\n\tconst entityRecords = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, canUser } = select( coreDataStore );\n\n\t\t\tconst records = {};\n\n\t\t\t// Other entities the current post type needs merged into its form.\n\t\t\tfor ( const [ namespace, entity ] of Object.entries(\n\t\t\t\tENTITIES[ postType ] ?? {}\n\t\t\t) ) {\n\t\t\t\tif (\n\t\t\t\t\t! canUser( 'read', {\n\t\t\t\t\t\tkind: entity.kind,\n\t\t\t\t\t\tname: entity.name,\n\t\t\t\t\t} )\n\t\t\t\t) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst id = entity.getId ? entity.getId( select ) : undefined;\n\t\t\t\t// Entities resolved through another record need a valid id.\n\t\t\t\tif ( entity.getId && ! id ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\trecords[ namespace ] = getEditedEntityRecord(\n\t\t\t\t\tentity.kind,\n\t\t\t\t\tentity.name,\n\t\t\t\t\tid\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn records;\n\t\t},\n\t\t[ postType ]\n\t);\n\n\t// Merge the supplementary data onto the record.\n\tconst data = useMemo( () => {\n\t\tif ( ! record ) {\n\t\t\treturn record;\n\t\t}\n\t\tconst extra = { ...entityRecords };\n\t\tif ( availableTemplates && Object.keys( availableTemplates ).length ) {\n\t\t\textra.available_templates = availableTemplates;\n\t\t}\n\t\treturn { ...record, ...extra };\n\t}, [ record, entityRecords, availableTemplates ] );\n\n\tconst { editEntityRecord } = useDispatch( coreDataStore );\n\tconst registry = useRegistry();\n\n\t// Map of namespaced field id to the namespace key its entity is merged under.\n\tconst fieldNamespaces = useMemo( () => {\n\t\tconst map = {};\n\t\tfor ( const [ namespace, entity ] of Object.entries(\n\t\t\tENTITIES[ postType ] ?? {}\n\t\t) ) {\n\t\t\tfor ( const id of entity.fields ?? [] ) {\n\t\t\t\tmap[ id ] = namespace;\n\t\t\t}\n\t\t}\n\t\treturn map;\n\t}, [ postType ] );\n\n\tconst _fields = usePostFields( { postType } );\n\tconst fields = useMemo(\n\t\t() =>\n\t\t\t_fields\n\t\t\t\t?.map( ( field ) => {\n\t\t\t\t\tconst namespace = fieldNamespaces[ field.id ];\n\t\t\t\t\tif ( namespace ) {\n\t\t\t\t\t\treturn bindFieldToNamespace(\n\t\t\t\t\t\t\tfield,\n\t\t\t\t\t\t\tnamespace,\n\t\t\t\t\t\t\tENTITIES[ postType ]?.[ namespace ]?.isVisible\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tif ( field.id === 'status' ) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t...field,\n\t\t\t\t\t\t\telements: field.elements.filter(\n\t\t\t\t\t\t\t\t( element ) => element.value !== 'trash'\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\tif ( field.id === 'template' ) {\n\t\t\t\t\t\t// `usePostTemplatePanelMode` is reused in the Post Template panel to match\n\t\t\t\t\t\t// the existing behavior. If the panel rendered nothing we should exclude the\n\t\t\t\t\t\t// template field from the form.\n\t\t\t\t\t\tif ( ! templatePanelMode ) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// In classic themes without available templates we need to make the field read-only.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttemplatePanelMode === 'classic' &&\n\t\t\t\t\t\t\tObject.keys( availableTemplates ?? {} ).length === 0\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t...field,\n\t\t\t\t\t\t\t\treadOnly: true,\n\t\t\t\t\t\t\t\trender: () => __( 'Default template' ),\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn field;\n\t\t\t\t\t}\n\t\t\t\t\treturn field;\n\t\t\t\t} )\n\t\t\t\t.filter( Boolean )\n\t\t\t\t// Editor-only field, injected here rather than registered\n\t\t\t\t// so it never leaks into the site editor list / quick-edit fields.\n\t\t\t\t.concat( revisionsField ),\n\t\t[\n\t\t\t_fields,\n\t\t\ttemplatePanelMode,\n\t\t\tavailableTemplates,\n\t\t\tfieldNamespaces,\n\t\t\tpostType,\n\t\t]\n\t);\n\n\tconst onChange = ( edits ) => {\n\t\t// Route edits that target another entity (merged in under a namespace)\n\t\t// back to that entity; collect the rest for the post being edited.\n\t\tconst entities = ENTITIES[ postType ] ?? {};\n\t\tconst baseEdits = {};\n\t\tfor ( const [ key, value ] of Object.entries( edits ) ) {\n\t\t\tconst entity = entities[ key ];\n\t\t\tif ( entity ) {\n\t\t\t\t// Resolve the id the same way it was resolved to read the\n\t\t\t\t// record, so the save targets the right entity regardless of\n\t\t\t\t// its key field (`undefined` for the `root/site` singleton).\n\t\t\t\tconst id = entity.getId\n\t\t\t\t\t? entity.getId( registry.select )\n\t\t\t\t\t: undefined;\n\t\t\t\teditEntityRecord( entity.kind, entity.name, id, value );\n\t\t\t} else {\n\t\t\t\tbaseEdits[ key ] = value;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! Object.keys( baseEdits ).length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\tbaseEdits.status &&\n\t\t\tbaseEdits.status !== 'future' &&\n\t\t\trecord?.status === 'future' &&\n\t\t\tnew Date( record.date ) > new Date()\n\t\t) {\n\t\t\tbaseEdits.date = null;\n\t\t}\n\t\tif (\n\t\t\tbaseEdits.status &&\n\t\t\tbaseEdits.status === 'private' &&\n\t\t\trecord?.password\n\t\t) {\n\t\t\tbaseEdits.password = '';\n\t\t}\n\n\t\teditEntityRecord( 'postType', postType, postId, baseEdits );\n\t};\n\treturn (\n\t\t<PostPanelSection className=\"editor-post-summary\">\n\t\t\t<Stack direction=\"column\" gap=\"lg\">\n\t\t\t\t<PostCardPanel\n\t\t\t\t\tpostType={ postType }\n\t\t\t\t\tpostId={ postId }\n\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t/>\n\t\t\t\t<DataForm\n\t\t\t\t\tdata={ data }\n\t\t\t\t\tfields={ fields }\n\t\t\t\t\tform={ form }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t/>\n\t\t\t\t{ ! isPostStatusRemoved && (\n\t\t\t\t\t<PostTrash onActionPerformed={ onActionPerformed } />\n\t\t\t\t) }\n\t\t\t</Stack>\n\t\t</PostPanelSection>\n\t);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,kBAAoD;AACpD,uBAAuC;AACvC,uBAAyB;AACzB,gBAAsB;AACtB,qBAAwB;AACxB,mBAA8B;AAK9B,6BAA0B;AAC1B,gCAA6B;AAC7B,mBAAqC;AACrC,wBAAsB;AACtB,yBAA0B;AAC1B,mBAAyC;AACzC,uBAA2B;AA2WxB;AAzWH,IAAM,aAAa,EAAE,QAAQ,EAAE,MAAM,QAAQ,GAAG,QAAQ,CAAC,EAAE;AAC3D,IAAM,qBAAqB,CAAE,MAAO;AAWpC,SAAS,4BAA6B,MAAO;AAC5C,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,QAAI,uBAAW,CAAE,WAAY;AA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AA,EAAiB,WAAU,uBAC3B,uDAAC,mBAAM,WAAU,UAAS,KAAI,MAC7B;AAAA;AAAA,MAAC,uBAAAC;AAAA,MAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD;AAAA,IACE,CAAE,uBACH,4CAAC,kBAAAC,SAAA,EAAU,mBAAwC;AAAA,KAErD,GACD;AAEF;",
6
- "names": ["editorStore", "coreDataStore", "usePostFields", "revisionsField", "PostPanelSection", "PostCardPanel", "PostTrash"]
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect, useRegistry } from '@wordpress/data';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { DataForm } from '@wordpress/dataviews';\nimport { Stack } from '@wordpress/ui';\nimport { useMemo } from '@wordpress/element';\nimport { useViewConfig } from '@wordpress/views';\n\n/**\n * Internal dependencies\n */\nimport PostCardPanel from '../post-card-panel';\nimport PluginPostStatusInfo from '../plugin-post-status-info';\nimport PostPanelSection from '../post-panel-section';\nimport { store as editorStore } from '../../store';\nimport PostTrash from '../post-trash';\nimport usePostFields from '../post-fields';\nimport { usePostTemplatePanelMode } from '../post-template/hooks';\nimport revisionsField from '../../dataviews/fields/revisions';\n\nconst EMPTY_FORM = { layout: { type: 'panel' }, fields: [] };\nconst VIEW_CONFIG_FIELDS = [ 'form' ];\n\n/**\n * Bridges the legacy editor-panel visibility controls onto the DataForm summary,\n * returning the form with the hidden fields removed. The new inspector has no\n * concept of the Preferences → Panels switches or of `removeEditorPanel`, so we\n * reproduce their effect on the form.\n *\n * @param {Object} form The DataForm summary form configuration.\n * @return {Object} The form with the hidden fields removed.\n */\nfunction useInspectorPanelVisibility( form ) {\n\tconst {\n\t\tisPostStatusRemoved,\n\t\tfeaturedImageEnabled,\n\t\texcerptEnabled,\n\t\tdiscussionEnabled,\n\t\tpageAttributesEnabled,\n\t} = useSelect( ( select ) => {\n\t\tconst { isEditorPanelRemoved, isEditorPanelEnabled } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tisPostStatusRemoved: isEditorPanelRemoved( 'post-status' ),\n\t\t\tfeaturedImageEnabled: isEditorPanelEnabled( 'featured-image' ),\n\t\t\texcerptEnabled: isEditorPanelEnabled( 'post-excerpt' ),\n\t\t\tdiscussionEnabled: isEditorPanelEnabled( 'discussion-panel' ),\n\t\t\tpageAttributesEnabled: isEditorPanelEnabled( 'page-attributes' ),\n\t\t};\n\t}, [] );\n\n\tconst visibleForm = useMemo( () => {\n\t\tif ( ! form.fields?.length ) {\n\t\t\treturn form;\n\t\t}\n\t\t// `featured_media`/`excerpt` are their own top-level panels and\n\t\t// `post-content-info` is always shown, so they survive. Everything else\n\t\t// belongs to the `post-status` summary panel: `discussion`/`parent` honor\n\t\t// their own switch, but every one of them is hidden while the `post-status`\n\t\t// panel is removed.\n\t\tconst visibilityById = {\n\t\t\tfeatured_media: featuredImageEnabled,\n\t\t\texcerpt: excerptEnabled,\n\t\t\t'post-content-info': true,\n\t\t\tdiscussion: discussionEnabled && ! isPostStatusRemoved,\n\t\t\tparent: pageAttributesEnabled && ! isPostStatusRemoved,\n\t\t};\n\t\tconst isFieldVisible = ( id ) =>\n\t\t\tid in visibilityById ? visibilityById[ id ] : ! isPostStatusRemoved;\n\t\t// Recurse into `children` so a panel-tied field is dropped wherever it\n\t\t// sits in the form: the PHP view-config filter can nest such a field\n\t\t// inside another field's group.\n\t\tconst filterFields = ( fields ) =>\n\t\t\tfields.reduce( ( acc, field ) => {\n\t\t\t\tconst id = typeof field === 'string' ? field : field.id;\n\t\t\t\tif ( ! isFieldVisible( id ) ) {\n\t\t\t\t\treturn acc;\n\t\t\t\t}\n\t\t\t\tif (\n\t\t\t\t\ttypeof field !== 'string' &&\n\t\t\t\t\tArray.isArray( field.children )\n\t\t\t\t) {\n\t\t\t\t\tconst children = filterFields( field.children );\n\t\t\t\t\t// A group whose children were all removed would render as\n\t\t\t\t\t// an empty panel, so drop it too.\n\t\t\t\t\tif ( ! children.length ) {\n\t\t\t\t\t\treturn acc;\n\t\t\t\t\t}\n\t\t\t\t\tacc.push( { ...field, children } );\n\t\t\t\t\treturn acc;\n\t\t\t\t}\n\t\t\t\tacc.push( field );\n\t\t\t\treturn acc;\n\t\t\t}, [] );\n\t\treturn { ...form, fields: filterFields( form.fields ) };\n\t}, [\n\t\tform,\n\t\tisPostStatusRemoved,\n\t\tfeaturedImageEnabled,\n\t\texcerptEnabled,\n\t\tdiscussionEnabled,\n\t\tpageAttributesEnabled,\n\t] );\n\n\treturn visibleForm;\n}\n\n// Some post types expose summary fields that edit entities other than the one\n// being edited. Keyed by the post type that needs them, the related records are\n// merged into the form data under a `${ kind }_${ name }` namespace key so that\n// a single DataForm can read and write all of them, and edits to those keys are\n// routed back to their entity.\n//\n// The fields themselves are namespace-agnostic: they read and write a plain\n// record. The `fields` list ties each one to the entity it edits, and this\n// component overrides their `getValue`/`setValue`/`render` to operate on the\n// namespaced record, plus their `isVisible` to only show where that record is\n// present (e.g. the `home`/`index` template summary).\n//\n// Currently only `wp_template` uses this: `posts_per_page` and\n// `default_comment_status` target `root/site`, and `posts_page_title` targets\n// the posts page (the `page` assigned as `page_for_posts`).\nconst ENTITIES = {\n\twp_template: {\n\t\troot_site: {\n\t\t\tkind: 'root',\n\t\t\tname: 'site',\n\t\t\tfields: [ 'posts_per_page', 'default_comment_status' ],\n\t\t\tisVisible: ( item ) =>\n\t\t\t\t[ 'home', 'index' ].includes( item.slug ?? '' ),\n\t\t},\n\t\tposttype_page: {\n\t\t\tkind: 'postType',\n\t\t\tname: 'page',\n\t\t\tgetId: ( select ) =>\n\t\t\t\tselect( coreDataStore ).getEditedEntityRecord( 'root', 'site' )\n\t\t\t\t\t?.page_for_posts,\n\t\t\tfields: [ 'posts_page_title' ],\n\t\t\tisVisible: ( item ) =>\n\t\t\t\t[ 'home', 'index' ].includes( item.slug ?? '' ),\n\t\t},\n\t},\n};\n\n// Rebinds a namespace-agnostic field to the namespaced record it edits. Every\n// field callback that receives the form `item` is redirected to the\n// `item[ namespace ]` sub-record so the field operates on its own entity:\n// `getValue`/`setValue`/`render` here, and the rest indirectly because they all\n// funnel through the (remapped) `getValue` (default `render`, `getValueFormatted`\n// and `isValid` range/`custom` validation). Edits are wrapped back under the\n// namespace key. The caller-supplied `isVisible` encodes entity-specific\n// conditions (e.g. only for `home`/`index` templates); the generic guard\n// `!! item[ namespace ]` ensures the field is hidden when the sub-record\n// hasn't been fetched.\nfunction bindFieldToNamespace( field, namespace, isVisible = () => true ) {\n\tconst subItem = ( item ) => item?.[ namespace ] ?? {};\n\treturn {\n\t\t...field,\n\t\tgetValue: ( { item } ) =>\n\t\t\tfield.getValue\n\t\t\t\t? field.getValue( { item: subItem( item ) } )\n\t\t\t\t: subItem( item )[ field.id ],\n\t\tsetValue: ( { item, value } ) => ( {\n\t\t\t[ namespace ]: field.setValue( { item: subItem( item ), value } ),\n\t\t} ),\n\t\trender: field.render\n\t\t\t? ( props ) =>\n\t\t\t\t\tfield.render( { ...props, item: subItem( props.item ) } )\n\t\t\t: undefined,\n\t\tisVisible: ( item ) => isVisible( item ) && !! item[ namespace ],\n\t};\n}\n\nexport default function DataFormPostSummary( { onActionPerformed } ) {\n\tconst { postType, postId, isPostStatusRemoved, availableTemplates } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst {\n\t\t\t\tgetCurrentPostType,\n\t\t\t\tgetCurrentPostId,\n\t\t\t\tisEditorPanelRemoved,\n\t\t\t\tgetEditorSettings,\n\t\t\t} = select( editorStore );\n\t\t\tconst _availableTemplates = select(\n\t\t\t\tcoreDataStore\n\t\t\t).getCurrentTheme()?.is_block_theme\n\t\t\t\t? null\n\t\t\t\t: getEditorSettings().availableTemplates ?? null;\n\t\t\treturn {\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t\tpostId: getCurrentPostId(),\n\t\t\t\tisPostStatusRemoved: isEditorPanelRemoved( 'post-status' ),\n\t\t\t\tavailableTemplates: _availableTemplates,\n\t\t\t};\n\t\t}, [] );\n\tconst { form: formConfig } = useViewConfig( {\n\t\tkind: 'postType',\n\t\tname: postType,\n\t\tfields: VIEW_CONFIG_FIELDS,\n\t} );\n\t// Bridge the legacy editor-panel visibility (Preferences → Panels and\n\t// programmatic panel removal) onto the form by dropping hidden fields.\n\tconst form = useInspectorPanelVisibility( formConfig ?? EMPTY_FORM );\n\tconst record = useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! postType || ! postId ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\treturn select( coreDataStore ).getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId\n\t\t\t);\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tconst templatePanelMode = usePostTemplatePanelMode();\n\n\tconst entityRecords = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, canUser } = select( coreDataStore );\n\n\t\t\tconst records = {};\n\n\t\t\t// Other entities the current post type needs merged into its form.\n\t\t\tfor ( const [ namespace, entity ] of Object.entries(\n\t\t\t\tENTITIES[ postType ] ?? {}\n\t\t\t) ) {\n\t\t\t\tif (\n\t\t\t\t\t! canUser( 'read', {\n\t\t\t\t\t\tkind: entity.kind,\n\t\t\t\t\t\tname: entity.name,\n\t\t\t\t\t} )\n\t\t\t\t) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tconst id = entity.getId ? entity.getId( select ) : undefined;\n\t\t\t\t// Entities resolved through another record need a valid id.\n\t\t\t\tif ( entity.getId && ! id ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\trecords[ namespace ] = getEditedEntityRecord(\n\t\t\t\t\tentity.kind,\n\t\t\t\t\tentity.name,\n\t\t\t\t\tid\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn records;\n\t\t},\n\t\t[ postType ]\n\t);\n\n\t// Merge the supplementary data onto the record.\n\tconst data = useMemo( () => {\n\t\tif ( ! record ) {\n\t\t\treturn record;\n\t\t}\n\t\tconst extra = { ...entityRecords };\n\t\tif ( availableTemplates && Object.keys( availableTemplates ).length ) {\n\t\t\textra.available_templates = availableTemplates;\n\t\t}\n\t\treturn { ...record, ...extra };\n\t}, [ record, entityRecords, availableTemplates ] );\n\n\tconst { editEntityRecord } = useDispatch( coreDataStore );\n\tconst registry = useRegistry();\n\n\t// Map of namespaced field id to the namespace key its entity is merged under.\n\tconst fieldNamespaces = useMemo( () => {\n\t\tconst map = {};\n\t\tfor ( const [ namespace, entity ] of Object.entries(\n\t\t\tENTITIES[ postType ] ?? {}\n\t\t) ) {\n\t\t\tfor ( const id of entity.fields ?? [] ) {\n\t\t\t\tmap[ id ] = namespace;\n\t\t\t}\n\t\t}\n\t\treturn map;\n\t}, [ postType ] );\n\n\tconst _fields = usePostFields( { postType } );\n\tconst fields = useMemo(\n\t\t() =>\n\t\t\t_fields\n\t\t\t\t?.map( ( field ) => {\n\t\t\t\t\tconst namespace = fieldNamespaces[ field.id ];\n\t\t\t\t\tif ( namespace ) {\n\t\t\t\t\t\treturn bindFieldToNamespace(\n\t\t\t\t\t\t\tfield,\n\t\t\t\t\t\t\tnamespace,\n\t\t\t\t\t\t\tENTITIES[ postType ]?.[ namespace ]?.isVisible\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tif ( field.id === 'status' ) {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t...field,\n\t\t\t\t\t\t\telements: field.elements.filter(\n\t\t\t\t\t\t\t\t( element ) => element.value !== 'trash'\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\tif ( field.id === 'template' ) {\n\t\t\t\t\t\t// `usePostTemplatePanelMode` is reused in the Post Template panel to match\n\t\t\t\t\t\t// the existing behavior. If the panel rendered nothing we should exclude the\n\t\t\t\t\t\t// template field from the form.\n\t\t\t\t\t\tif ( ! templatePanelMode ) {\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// In classic themes without available templates we need to make the field read-only.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\ttemplatePanelMode === 'classic' &&\n\t\t\t\t\t\t\tObject.keys( availableTemplates ?? {} ).length === 0\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t...field,\n\t\t\t\t\t\t\t\treadOnly: true,\n\t\t\t\t\t\t\t\trender: () => __( 'Default template' ),\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn field;\n\t\t\t\t\t}\n\t\t\t\t\treturn field;\n\t\t\t\t} )\n\t\t\t\t.filter( Boolean )\n\t\t\t\t// Editor-only field, injected here rather than registered\n\t\t\t\t// so it never leaks into the site editor list / quick-edit fields.\n\t\t\t\t.concat( revisionsField ),\n\t\t[\n\t\t\t_fields,\n\t\t\ttemplatePanelMode,\n\t\t\tavailableTemplates,\n\t\t\tfieldNamespaces,\n\t\t\tpostType,\n\t\t]\n\t);\n\n\tconst onChange = ( edits ) => {\n\t\t// Route edits that target another entity (merged in under a namespace)\n\t\t// back to that entity; collect the rest for the post being edited.\n\t\tconst entities = ENTITIES[ postType ] ?? {};\n\t\tconst baseEdits = {};\n\t\tfor ( const [ key, value ] of Object.entries( edits ) ) {\n\t\t\tconst entity = entities[ key ];\n\t\t\tif ( entity ) {\n\t\t\t\t// Resolve the id the same way it was resolved to read the\n\t\t\t\t// record, so the save targets the right entity regardless of\n\t\t\t\t// its key field (`undefined` for the `root/site` singleton).\n\t\t\t\tconst id = entity.getId\n\t\t\t\t\t? entity.getId( registry.select )\n\t\t\t\t\t: undefined;\n\t\t\t\teditEntityRecord( entity.kind, entity.name, id, value );\n\t\t\t} else {\n\t\t\t\tbaseEdits[ key ] = value;\n\t\t\t}\n\t\t}\n\n\t\tif ( ! Object.keys( baseEdits ).length ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (\n\t\t\tbaseEdits.status &&\n\t\t\tbaseEdits.status !== 'future' &&\n\t\t\trecord?.status === 'future' &&\n\t\t\tnew Date( record.date ) > new Date()\n\t\t) {\n\t\t\tbaseEdits.date = null;\n\t\t}\n\t\tif (\n\t\t\tbaseEdits.status &&\n\t\t\tbaseEdits.status === 'private' &&\n\t\t\trecord?.password\n\t\t) {\n\t\t\tbaseEdits.password = '';\n\t\t}\n\n\t\teditEntityRecord( 'postType', postType, postId, baseEdits );\n\t};\n\treturn (\n\t\t<PostPanelSection className=\"editor-post-summary\">\n\t\t\t<Stack direction=\"column\" gap=\"lg\">\n\t\t\t\t<PostCardPanel\n\t\t\t\t\tpostType={ postType }\n\t\t\t\t\tpostId={ postId }\n\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t/>\n\t\t\t\t<DataForm\n\t\t\t\t\tdata={ data }\n\t\t\t\t\tfields={ fields }\n\t\t\t\t\tform={ form }\n\t\t\t\t\tonChange={ onChange }\n\t\t\t\t/>\n\t\t\t\t{ ! isPostStatusRemoved && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<PluginPostStatusInfo.Slot>\n\t\t\t\t\t\t\t{ ( fills ) =>\n\t\t\t\t\t\t\t\tfills.length > 0 && (\n\t\t\t\t\t\t\t\t\t<Stack direction=\"column\" gap=\"xs\">\n\t\t\t\t\t\t\t\t\t\t{ fills }\n\t\t\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</PluginPostStatusInfo.Slot>\n\t\t\t\t\t\t<PostTrash onActionPerformed={ onActionPerformed } />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</Stack>\n\t\t</PostPanelSection>\n\t);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAmB;AACnB,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,OAAO,MAAM,IAAI,KAAM;AAAA,MACvD,OAAO;AACN,kBAAW,GAAI,IAAI;AAAA,MACpB;AAAA,IACD;AAEA,QAAK,CAAE,OAAO,KAAM,SAAU,EAAE,QAAS;AACxC;AAAA,IACD;AAEA,QACC,UAAU,UACV,UAAU,WAAW,YACrB,QAAQ,WAAW,YACnB,IAAI,KAAM,OAAO,IAAK,IAAI,oBAAI,KAAK,GAClC;AACD,gBAAU,OAAO;AAAA,IAClB;AACA,QACC,UAAU,UACV,UAAU,WAAW,aACrB,QAAQ,UACP;AACD,gBAAU,WAAW;AAAA,IACtB;AAEA,qBAAkB,YAAY,UAAU,QAAQ,SAAU;AAAA,EAC3D;AACA,SACC,4CAAC,0BAAAC,SAAA,EAAiB,WAAU,uBAC3B,uDAAC,mBAAM,WAAU,UAAS,KAAI,MAC7B;AAAA;AAAA,MAAC,uBAAAC;AAAA,MAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD;AAAA,IACE,CAAE,uBACH,4EACC;AAAA,kDAAC,+BAAAC,QAAqB,MAArB,EACE,WAAE,UACH,MAAM,SAAS,KACd,4CAAC,mBAAM,WAAU,UAAS,KAAI,MAC3B,iBACH,GAGH;AAAA,MACA,4CAAC,kBAAAC,SAAA,EAAU,mBAAwC;AAAA,OACpD;AAAA,KAEF,GACD;AAEF;",
6
+ "names": ["editorStore", "coreDataStore", "usePostFields", "revisionsField", "PostPanelSection", "PostCardPanel", "PluginPostStatusInfo", "PostTrash"]
7
7
  }
@@ -45,6 +45,7 @@ var import_pattern_overrides_panel = __toESM(require("../pattern-overrides-panel
45
45
  var import_plugin_document_setting_panel = __toESM(require("../plugin-document-setting-panel/index.cjs"));
46
46
  var import_plugin_sidebar = __toESM(require("../plugin-sidebar/index.cjs"));
47
47
  var import_post_summary = __toESM(require("./post-summary.cjs"));
48
+ var import_dataform_post_summary = __toESM(require("./dataform-post-summary.cjs"));
48
49
  var import_post_revision_summary = __toESM(require("./post-revision-summary.cjs"));
49
50
  var import_panel = __toESM(require("../post-taxonomies/panel.cjs"));
50
51
  var import_post_transform_panel = __toESM(require("../post-transform-panel/index.cjs"));
@@ -57,7 +58,6 @@ var import_use_auto_switch_editor_sidebars = __toESM(require("../provider/use-au
57
58
  var import_constants = require("./constants.cjs");
58
59
  var import_lock_unlock = require("../../lock-unlock.cjs");
59
60
  var import_store = require("../../store/index.cjs");
60
- var import_constants2 = require("../../store/constants.cjs");
61
61
  var import_jsx_runtime = require("react/jsx-runtime");
62
62
  var { Tabs } = (0, import_lock_unlock.unlock)(import_components.privateApis);
63
63
  var SIDEBAR_ACTIVE_BY_DEFAULT = true;
@@ -65,8 +65,7 @@ var SidebarContent = ({
65
65
  tabName,
66
66
  keyboardShortcut,
67
67
  onActionPerformed,
68
- extraPanels,
69
- postType
68
+ extraPanels
70
69
  }) => {
71
70
  const tabListRef = (0, import_element.useRef)(null);
72
71
  const tabsContextValue = (0, import_element.useContext)(Tabs.Context);
@@ -95,11 +94,17 @@ var SidebarContent = ({
95
94
  if (isRevisionsMode) {
96
95
  tabContent = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_post_revision_summary.default, {});
97
96
  } else {
97
+ const isDataFormInspectorEnabled = window?.__experimentalDataFormInspector;
98
98
  tabContent = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
99
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_post_summary.default, { onActionPerformed }),
99
+ isDataFormInspectorEnabled ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
100
+ import_dataform_post_summary.default,
101
+ {
102
+ onActionPerformed
103
+ }
104
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_post_summary.default, { onActionPerformed }),
100
105
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_plugin_document_setting_panel.default.Slot, {}),
101
106
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_template_content_panel.default, {}),
102
- window?.__experimentalDataFormInspector && ["page", "post"].includes(postType) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_template_actions_panel.default, {}),
107
+ isDataFormInspectorEnabled && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_template_actions_panel.default, {}),
103
108
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_template_part_content_panel.default, {}),
104
109
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_post_transform_panel.default, {}),
105
110
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_panel.default, {}),
@@ -134,36 +139,24 @@ var SidebarContent = ({
134
139
  };
135
140
  var Sidebar = ({ extraPanels, onActionPerformed }) => {
136
141
  (0, import_use_auto_switch_editor_sidebars.default)();
137
- const { tabName, keyboardShortcut, showSummary, postType } = (0, import_data.useSelect)(
138
- (select) => {
139
- const shortcut = select(
140
- import_keyboard_shortcuts.store
141
- ).getShortcutRepresentation("core/editor/toggle-sidebar");
142
- const sidebar = select(import_interface.store).getActiveComplementaryArea("core");
143
- const _isEditorSidebarOpened = [
144
- import_constants.sidebars.block,
145
- import_constants.sidebars.document
146
- ].includes(sidebar);
147
- let _tabName = sidebar;
148
- if (!_isEditorSidebarOpened) {
149
- _tabName = !!select(
150
- import_block_editor.store
151
- ).getBlockSelectionStart() ? import_constants.sidebars.block : import_constants.sidebars.document;
152
- }
153
- const _postType = select(import_store.store).getCurrentPostType();
154
- return {
155
- tabName: _tabName,
156
- keyboardShortcut: shortcut,
157
- showSummary: ![
158
- import_constants2.TEMPLATE_POST_TYPE,
159
- import_constants2.TEMPLATE_PART_POST_TYPE,
160
- import_constants2.NAVIGATION_POST_TYPE
161
- ].includes(_postType),
162
- postType: _postType
163
- };
164
- },
165
- []
166
- );
142
+ const { tabName, keyboardShortcut } = (0, import_data.useSelect)((select) => {
143
+ const shortcut = select(
144
+ import_keyboard_shortcuts.store
145
+ ).getShortcutRepresentation("core/editor/toggle-sidebar");
146
+ const sidebar = select(import_interface.store).getActiveComplementaryArea("core");
147
+ const _isEditorSidebarOpened = [
148
+ import_constants.sidebars.block,
149
+ import_constants.sidebars.document
150
+ ].includes(sidebar);
151
+ let _tabName = sidebar;
152
+ if (!_isEditorSidebarOpened) {
153
+ _tabName = !!select(import_block_editor.store).getBlockSelectionStart() ? import_constants.sidebars.block : import_constants.sidebars.document;
154
+ }
155
+ return {
156
+ tabName: _tabName,
157
+ keyboardShortcut: shortcut
158
+ };
159
+ }, []);
167
160
  const { enableComplementaryArea } = (0, import_data.useDispatch)(import_interface.store);
168
161
  const onTabSelect = (0, import_element.useCallback)(
169
162
  (newSelectedTabId) => {
@@ -184,10 +177,8 @@ var Sidebar = ({ extraPanels, onActionPerformed }) => {
184
177
  {
185
178
  tabName,
186
179
  keyboardShortcut,
187
- showSummary,
188
180
  onActionPerformed,
189
- extraPanels,
190
- postType
181
+ extraPanels
191
182
  }
192
183
  )
193
184
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/sidebar/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tBlockInspector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useCallback, useContext, useEffect, useRef } from '@wordpress/element';\nimport { isRTL, __, _x } from '@wordpress/i18n';\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport PatternOverridesPanel from '../pattern-overrides-panel';\nimport PluginDocumentSettingPanel from '../plugin-document-setting-panel';\nimport PluginSidebar from '../plugin-sidebar';\nimport PostSummary from './post-summary';\nimport PostRevisionSummary from './post-revision-summary';\nimport PostTaxonomiesPanel from '../post-taxonomies/panel';\nimport PostTransformPanel from '../post-transform-panel';\nimport SidebarHeader from './header';\nimport TemplateActionsPanel from '../template-actions-panel';\nimport TemplateContentPanel from '../template-content-panel';\nimport TemplatePartContentPanel from '../template-part-content-panel';\nimport RevisionBlockDiffPanel from '../revision-block-diff';\nimport useAutoSwitchEditorSidebars from '../provider/use-auto-switch-editor-sidebars';\nimport { sidebars } from './constants';\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport {\n\tNAVIGATION_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n} from '../../store/constants';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nconst SIDEBAR_ACTIVE_BY_DEFAULT = true;\n\nconst SidebarContent = ( {\n\ttabName,\n\tkeyboardShortcut,\n\tonActionPerformed,\n\textraPanels,\n\tpostType,\n} ) => {\n\tconst tabListRef = useRef( null );\n\t// Because `PluginSidebar` renders a `ComplementaryArea`, we\n\t// need to forward the `Tabs` context so it can be passed through the\n\t// underlying slot/fill.\n\tconst tabsContextValue = useContext( Tabs.Context );\n\tconst isRevisionsMode = useSelect( ( select ) => {\n\t\treturn unlock( select( editorStore ) ).isRevisionsMode();\n\t} );\n\n\t// This effect addresses a race condition caused by tabbing from the last\n\t// block in the editor into the settings sidebar. Without this effect, the\n\t// selected tab and browser focus can become separated in an unexpected way\n\t// (e.g the \"block\" tab is focused, but the \"post\" tab is selected).\n\tuseEffect( () => {\n\t\tconst tabsElements = Array.from(\n\t\t\ttabListRef.current?.querySelectorAll( '[role=\"tab\"]' ) || []\n\t\t);\n\t\tconst selectedTabElement = tabsElements.find(\n\t\t\t// We are purposefully using a custom `data-tab-id` attribute here\n\t\t\t// because we don't want rely on any assumptions about `Tabs`\n\t\t\t// component internals.\n\t\t\t( element ) => element.getAttribute( 'data-tab-id' ) === tabName\n\t\t);\n\t\tconst activeElement = selectedTabElement?.ownerDocument.activeElement;\n\t\tconst tabsHasFocus = tabsElements.some( ( element ) => {\n\t\t\treturn activeElement && activeElement.id === element.id;\n\t\t} );\n\t\tif (\n\t\t\ttabsHasFocus &&\n\t\t\tselectedTabElement &&\n\t\t\tselectedTabElement.id !== activeElement?.id\n\t\t) {\n\t\t\tselectedTabElement?.focus();\n\t\t}\n\t}, [ tabName ] );\n\n\tlet tabContent;\n\tif ( isRevisionsMode ) {\n\t\ttabContent = <PostRevisionSummary />;\n\t} else {\n\t\ttabContent = (\n\t\t\t<>\n\t\t\t\t<PostSummary onActionPerformed={ onActionPerformed } />\n\t\t\t\t<PluginDocumentSettingPanel.Slot />\n\t\t\t\t<TemplateContentPanel />\n\t\t\t\t{ window?.__experimentalDataFormInspector &&\n\t\t\t\t\t[ 'page', 'post' ].includes( postType ) && (\n\t\t\t\t\t\t<TemplateActionsPanel />\n\t\t\t\t\t) }\n\t\t\t\t<TemplatePartContentPanel />\n\t\t\t\t<PostTransformPanel />\n\t\t\t\t<PostTaxonomiesPanel />\n\t\t\t\t<PatternOverridesPanel />\n\t\t\t\t{ extraPanels }\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn (\n\t\t<PluginSidebar\n\t\t\tidentifier={ tabName }\n\t\t\theader={\n\t\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t\t<SidebarHeader ref={ tabListRef } />\n\t\t\t\t</Tabs.Context.Provider>\n\t\t\t}\n\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\t// This classname is added so we can apply a corrective negative\n\t\t\t// margin to the panel.\n\t\t\t// see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049\n\t\t\tclassName=\"editor-sidebar__panel\"\n\t\t\theaderClassName=\"editor-sidebar__panel-tabs\"\n\t\t\ttitle={\n\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t_x( 'Settings', 'panel button label' )\n\t\t\t}\n\t\t\ttoggleShortcut={ keyboardShortcut }\n\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\tisActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }\n\t\t>\n\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.document } focusable={ false }>\n\t\t\t\t\t{ tabContent }\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.block } focusable={ false }>\n\t\t\t\t\t<BlockInspector />\n\t\t\t\t\t{ isRevisionsMode && <RevisionBlockDiffPanel /> }\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t</Tabs.Context.Provider>\n\t\t</PluginSidebar>\n\t);\n};\n\nconst Sidebar = ( { extraPanels, onActionPerformed } ) => {\n\tuseAutoSwitchEditorSidebars();\n\tconst { tabName, keyboardShortcut, showSummary, postType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst shortcut = select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getShortcutRepresentation( 'core/editor/toggle-sidebar' );\n\n\t\t\tconst sidebar =\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t\t\tconst _isEditorSidebarOpened = [\n\t\t\t\tsidebars.block,\n\t\t\t\tsidebars.document,\n\t\t\t].includes( sidebar );\n\t\t\tlet _tabName = sidebar;\n\t\t\tif ( ! _isEditorSidebarOpened ) {\n\t\t\t\t_tabName = !! select(\n\t\t\t\t\tblockEditorStore\n\t\t\t\t).getBlockSelectionStart()\n\t\t\t\t\t? sidebars.block\n\t\t\t\t\t: sidebars.document;\n\t\t\t}\n\n\t\t\tconst _postType = select( editorStore ).getCurrentPostType();\n\n\t\t\treturn {\n\t\t\t\ttabName: _tabName,\n\t\t\t\tkeyboardShortcut: shortcut,\n\t\t\t\tshowSummary: ! [\n\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t\t\tNAVIGATION_POST_TYPE,\n\t\t\t\t].includes( _postType ),\n\t\t\t\tpostType: _postType,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\n\tconst onTabSelect = useCallback(\n\t\t( newSelectedTabId ) => {\n\t\t\tif ( !! newSelectedTabId ) {\n\t\t\t\tenableComplementaryArea( 'core', newSelectedTabId );\n\t\t\t}\n\t\t},\n\t\t[ enableComplementaryArea ]\n\t);\n\n\treturn (\n\t\t<Tabs\n\t\t\tselectedTabId={ tabName }\n\t\t\tonSelect={ onTabSelect }\n\t\t\tselectOnMove={ false }\n\t\t>\n\t\t\t<SidebarContent\n\t\t\t\ttabName={ tabName }\n\t\t\t\tkeyboardShortcut={ keyboardShortcut }\n\t\t\t\tshowSummary={ showSummary }\n\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\textraPanels={ extraPanels }\n\t\t\t\tpostType={ postType }\n\t\t\t/>\n\t\t</Tabs>\n\t);\n};\n\nexport default Sidebar;\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAGO;AACP,kBAAuC;AACvC,qBAA2D;AAC3D,kBAA8B;AAC9B,mBAAwC;AACxC,gCAAgD;AAChD,wBAAqD;AACrD,uBAAwC;AAKxC,qCAAkC;AAClC,2CAAuC;AACvC,4BAA0B;AAC1B,0BAAwB;AACxB,mCAAgC;AAChC,mBAAgC;AAChC,kCAA+B;AAC/B,oBAA0B;AAC1B,oCAAiC;AACjC,oCAAiC;AACjC,yCAAqC;AACrC,iCAAmC;AACnC,6CAAwC;AACxC,uBAAyB;AACzB,yBAAuB;AACvB,mBAAqC;AACrC,IAAAA,oBAIO;AAmDQ;AAjDf,IAAM,EAAE,KAAK,QAAI,2BAAQ,kBAAAC,WAAsB;AAE/C,IAAM,4BAA4B;AAElC,IAAM,iBAAiB,CAAE;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,MAAO;AACN,QA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AAE3D,aAAO;AAAA,QACN,SAAS;AAAA,QACT,kBAAkB;AAAA,QAClB,aAAa,CAAE;AAAA,UACd;AAAA,UACA;AAAA,UACA;AAAA,QACD,EAAE,SAAU,SAAU;AAAA,QACtB,UAAU;AAAA,MACX;AAAA,IACD;AAAA,IACA,CAAC;AAAA,EACF;AAEA,QAAM,EAAE,wBAAwB,QAAI,yBAAa,iBAAAe,KAAe;AAEhE,QAAM,kBAAc;AAAA,IACnB,CAAE,qBAAsB;AACvB,UAAK,CAAC,CAAE,kBAAmB;AAC1B,gCAAyB,QAAQ,gBAAiB;AAAA,MACnD;AAAA,IACD;AAAA,IACA,CAAE,uBAAwB;AAAA,EAC3B;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,eAAgB;AAAA,MAChB,UAAW;AAAA,MACX,cAAe;AAAA,MAEf;AAAA,QAAC;AAAA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA;AAAA,MACD;AAAA;AAAA,EACD;AAEF;AAEA,IAAO,kBAAQ;",
6
- "names": ["import_constants", "componentsPrivateApis", "editorStore", "PostRevisionSummary", "PostSummary", "PluginDocumentSettingPanel", "TemplateContentPanel", "TemplateActionsPanel", "TemplatePartContentPanel", "PostTransformPanel", "PostTaxonomiesPanel", "PatternOverridesPanel", "PluginSidebar", "SidebarHeader", "RevisionBlockDiffPanel", "useAutoSwitchEditorSidebars", "keyboardShortcutsStore", "interfaceStore", "blockEditorStore"]
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tBlockInspector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useCallback, useContext, useEffect, useRef } from '@wordpress/element';\nimport { isRTL, __, _x } from '@wordpress/i18n';\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport PatternOverridesPanel from '../pattern-overrides-panel';\nimport PluginDocumentSettingPanel from '../plugin-document-setting-panel';\nimport PluginSidebar from '../plugin-sidebar';\nimport PostSummary from './post-summary';\nimport DataFormPostSummary from './dataform-post-summary';\nimport PostRevisionSummary from './post-revision-summary';\nimport PostTaxonomiesPanel from '../post-taxonomies/panel';\nimport PostTransformPanel from '../post-transform-panel';\nimport SidebarHeader from './header';\nimport TemplateActionsPanel from '../template-actions-panel';\nimport TemplateContentPanel from '../template-content-panel';\nimport TemplatePartContentPanel from '../template-part-content-panel';\nimport RevisionBlockDiffPanel from '../revision-block-diff';\nimport useAutoSwitchEditorSidebars from '../provider/use-auto-switch-editor-sidebars';\nimport { sidebars } from './constants';\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nconst SIDEBAR_ACTIVE_BY_DEFAULT = true;\n\nconst SidebarContent = ( {\n\ttabName,\n\tkeyboardShortcut,\n\tonActionPerformed,\n\textraPanels,\n} ) => {\n\tconst tabListRef = useRef( null );\n\t// Because `PluginSidebar` renders a `ComplementaryArea`, we\n\t// need to forward the `Tabs` context so it can be passed through the\n\t// underlying slot/fill.\n\tconst tabsContextValue = useContext( Tabs.Context );\n\tconst isRevisionsMode = useSelect( ( select ) => {\n\t\treturn unlock( select( editorStore ) ).isRevisionsMode();\n\t} );\n\n\t// This effect addresses a race condition caused by tabbing from the last\n\t// block in the editor into the settings sidebar. Without this effect, the\n\t// selected tab and browser focus can become separated in an unexpected way\n\t// (e.g the \"block\" tab is focused, but the \"post\" tab is selected).\n\tuseEffect( () => {\n\t\tconst tabsElements = Array.from(\n\t\t\ttabListRef.current?.querySelectorAll( '[role=\"tab\"]' ) || []\n\t\t);\n\t\tconst selectedTabElement = tabsElements.find(\n\t\t\t// We are purposefully using a custom `data-tab-id` attribute here\n\t\t\t// because we don't want rely on any assumptions about `Tabs`\n\t\t\t// component internals.\n\t\t\t( element ) => element.getAttribute( 'data-tab-id' ) === tabName\n\t\t);\n\t\tconst activeElement = selectedTabElement?.ownerDocument.activeElement;\n\t\tconst tabsHasFocus = tabsElements.some( ( element ) => {\n\t\t\treturn activeElement && activeElement.id === element.id;\n\t\t} );\n\t\tif (\n\t\t\ttabsHasFocus &&\n\t\t\tselectedTabElement &&\n\t\t\tselectedTabElement.id !== activeElement?.id\n\t\t) {\n\t\t\tselectedTabElement?.focus();\n\t\t}\n\t}, [ tabName ] );\n\n\tlet tabContent;\n\tif ( isRevisionsMode ) {\n\t\ttabContent = <PostRevisionSummary />;\n\t} else {\n\t\tconst isDataFormInspectorEnabled =\n\t\t\twindow?.__experimentalDataFormInspector;\n\t\ttabContent = (\n\t\t\t<>\n\t\t\t\t{ isDataFormInspectorEnabled ? (\n\t\t\t\t\t<DataFormPostSummary\n\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t/>\n\t\t\t\t) : (\n\t\t\t\t\t<PostSummary onActionPerformed={ onActionPerformed } />\n\t\t\t\t) }\n\t\t\t\t<PluginDocumentSettingPanel.Slot />\n\t\t\t\t<TemplateContentPanel />\n\t\t\t\t{ isDataFormInspectorEnabled && <TemplateActionsPanel /> }\n\t\t\t\t<TemplatePartContentPanel />\n\t\t\t\t<PostTransformPanel />\n\t\t\t\t<PostTaxonomiesPanel />\n\t\t\t\t<PatternOverridesPanel />\n\t\t\t\t{ extraPanels }\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn (\n\t\t<PluginSidebar\n\t\t\tidentifier={ tabName }\n\t\t\theader={\n\t\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t\t<SidebarHeader ref={ tabListRef } />\n\t\t\t\t</Tabs.Context.Provider>\n\t\t\t}\n\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\t// This classname is added so we can apply a corrective negative\n\t\t\t// margin to the panel.\n\t\t\t// see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049\n\t\t\tclassName=\"editor-sidebar__panel\"\n\t\t\theaderClassName=\"editor-sidebar__panel-tabs\"\n\t\t\ttitle={\n\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t_x( 'Settings', 'panel button label' )\n\t\t\t}\n\t\t\ttoggleShortcut={ keyboardShortcut }\n\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\tisActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }\n\t\t>\n\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.document } focusable={ false }>\n\t\t\t\t\t{ tabContent }\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.block } focusable={ false }>\n\t\t\t\t\t<BlockInspector />\n\t\t\t\t\t{ isRevisionsMode && <RevisionBlockDiffPanel /> }\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t</Tabs.Context.Provider>\n\t\t</PluginSidebar>\n\t);\n};\n\nconst Sidebar = ( { extraPanels, onActionPerformed } ) => {\n\tuseAutoSwitchEditorSidebars();\n\tconst { tabName, keyboardShortcut } = useSelect( ( select ) => {\n\t\tconst shortcut = select(\n\t\t\tkeyboardShortcutsStore\n\t\t).getShortcutRepresentation( 'core/editor/toggle-sidebar' );\n\n\t\tconst sidebar =\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t\tconst _isEditorSidebarOpened = [\n\t\t\tsidebars.block,\n\t\t\tsidebars.document,\n\t\t].includes( sidebar );\n\t\tlet _tabName = sidebar;\n\t\tif ( ! _isEditorSidebarOpened ) {\n\t\t\t_tabName = !! select( blockEditorStore ).getBlockSelectionStart()\n\t\t\t\t? sidebars.block\n\t\t\t\t: sidebars.document;\n\t\t}\n\n\t\treturn {\n\t\t\ttabName: _tabName,\n\t\t\tkeyboardShortcut: shortcut,\n\t\t};\n\t}, [] );\n\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\n\tconst onTabSelect = useCallback(\n\t\t( newSelectedTabId ) => {\n\t\t\tif ( !! newSelectedTabId ) {\n\t\t\t\tenableComplementaryArea( 'core', newSelectedTabId );\n\t\t\t}\n\t\t},\n\t\t[ enableComplementaryArea ]\n\t);\n\n\treturn (\n\t\t<Tabs\n\t\t\tselectedTabId={ tabName }\n\t\t\tonSelect={ onTabSelect }\n\t\t\tselectOnMove={ false }\n\t\t>\n\t\t\t<SidebarContent\n\t\t\t\ttabName={ tabName }\n\t\t\t\tkeyboardShortcut={ keyboardShortcut }\n\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\textraPanels={ extraPanels }\n\t\t\t/>\n\t\t</Tabs>\n\t);\n};\n\nexport default Sidebar;\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,0BAGO;AACP,kBAAuC;AACvC,qBAA2D;AAC3D,kBAA8B;AAC9B,mBAAwC;AACxC,gCAAgD;AAChD,wBAAqD;AACrD,uBAAwC;AAKxC,qCAAkC;AAClC,2CAAuC;AACvC,4BAA0B;AAC1B,0BAAwB;AACxB,mCAAgC;AAChC,mCAAgC;AAChC,mBAAgC;AAChC,kCAA+B;AAC/B,oBAA0B;AAC1B,oCAAiC;AACjC,oCAAiC;AACjC,yCAAqC;AACrC,iCAAmC;AACnC,6CAAwC;AACxC,uBAAyB;AACzB,yBAAuB;AACvB,mBAAqC;AAkDtB;AAhDf,IAAM,EAAE,KAAK,QAAI,2BAAQ,kBAAAA,WAAsB;AAE/C,IAAM,4BAA4B;AAElC,IAAM,iBAAiB,CAAE;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,MAAO;AACN,QAAM,iBAAa,uBAAQ,IAAK;AAIhC,QAAM,uBAAmB,2BAAY,KAAK,OAAQ;AAClD,QAAM,sBAAkB,uBAAW,CAAE,WAA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AAAD,KAAe;AAEhE,QAAM,kBAAc;AAAA,IACnB,CAAE,qBAAsB;AACvB,UAAK,CAAC,CAAE,kBAAmB;AAC1B,gCAAyB,QAAQ,gBAAiB;AAAA,MACnD;AAAA,IACD;AAAA,IACA,CAAE,uBAAwB;AAAA,EAC3B;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,eAAgB;AAAA,MAChB,UAAW;AAAA,MACX,cAAe;AAAA,MAEf;AAAA,QAAC;AAAA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA;AAAA,MACD;AAAA;AAAA,EACD;AAEF;AAEA,IAAO,kBAAQ;",
6
+ "names": ["componentsPrivateApis", "editorStore", "PostRevisionSummary", "DataFormPostSummary", "PostSummary", "PluginDocumentSettingPanel", "TemplateContentPanel", "TemplateActionsPanel", "TemplatePartContentPanel", "PostTransformPanel", "PostTaxonomiesPanel", "PatternOverridesPanel", "PluginSidebar", "SidebarHeader", "RevisionBlockDiffPanel", "useAutoSwitchEditorSidebars", "keyboardShortcutsStore", "interfaceStore", "blockEditorStore"]
7
7
  }
@@ -35,7 +35,6 @@ __export(post_summary_exports, {
35
35
  module.exports = __toCommonJS(post_summary_exports);
36
36
  var import_ui = require("@wordpress/ui");
37
37
  var import_data = require("@wordpress/data");
38
- var import_dataform_post_summary = __toESM(require("./dataform-post-summary.cjs"));
39
38
  var import_plugin_post_status_info = __toESM(require("../plugin-post-status-info/index.cjs"));
40
39
  var import_panel = __toESM(require("../post-author/panel.cjs"));
41
40
  var import_post_card_panel = __toESM(require("../post-card-panel/index.cjs"));
@@ -61,18 +60,6 @@ var import_post_trash = __toESM(require("../post-trash/index.cjs"));
61
60
  var import_jsx_runtime = require("react/jsx-runtime");
62
61
  var PANEL_NAME = "post-status";
63
62
  function PostSummary({ onActionPerformed }) {
64
- const postType = (0, import_data.useSelect)(
65
- (select) => select(import_store.store).getCurrentPostType(),
66
- []
67
- );
68
- if (window?.__experimentalDataFormInspector && ["page", "post", "wp_template", "wp_template_part"].includes(
69
- postType
70
- )) {
71
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dataform_post_summary.default, { onActionPerformed });
72
- }
73
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ClassicPostSummary, { onActionPerformed });
74
- }
75
- function ClassicPostSummary({ onActionPerformed }) {
76
63
  const { isRemovedPostStatusPanel, postType, postId } = (0, import_data.useSelect)(
77
64
  (select) => {
78
65
  const {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/sidebar/post-summary.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Stack } from '@wordpress/ui';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport DataFormPostSummary from './dataform-post-summary';\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 postType = useSelect(\n\t\t( select ) => select( editorStore ).getCurrentPostType(),\n\t\t[]\n\t);\n\tif (\n\t\twindow?.__experimentalDataFormInspector &&\n\t\t[ 'page', 'post', 'wp_template', 'wp_template_part' ].includes(\n\t\t\tpostType\n\t\t)\n\t) {\n\t\treturn <DataFormPostSummary onActionPerformed={ onActionPerformed } />;\n\t}\n\treturn <ClassicPostSummary onActionPerformed={ onActionPerformed } />;\n}\n\nfunction ClassicPostSummary( { 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\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<Stack direction=\"column\" gap=\"lg\">\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<Stack direction=\"column\" gap=\"xs\">\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</Stack>\n\t\t\t\t\t\t\t{ ! isRemovedPostStatusPanel && (\n\t\t\t\t\t\t\t\t<Stack direction=\"column\" gap=\"lg\">\n\t\t\t\t\t\t\t\t\t<Stack direction=\"column\" gap=\"xs\">\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</Stack>\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</Stack>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Stack>\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"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,gBAAsB;AACtB,kBAA0B;AAK1B,mCAAgC;AAChC,qCAAiC;AACjC,mBAA4B;AAC5B,6BAA0B;AAC1B,sCAAmC;AACnC,IAAAA,gBAAgC;AAChC,IAAAA,gBAAgC;AAChC,IAAAA,gBAA4D;AAC5D,IAAAA,gBAAmC;AAC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AAAA,IAChD,4CAAC,cAAAC,yBAAA,EAAiB;AAAA,IAClB,6CAAC,mBAAM,WAAU,UAAS,KAAI,MAC7B;AAAA,kDAAC,gCAAAC,SAAA,EAAuB;AAAA,MACxB,4CAAC,8BAAAC,SAAA,EAAoB;AAAA,OACtB;AAAA,IACE,CAAE,4BACH,6CAAC,mBAAM,WAAU,UAAS,KAAI,MAC7B;AAAA,mDAAC,mBAAM,WAAU,UAAS,KAAI,MAC7B;AAAA,oDAAC,mBAAAC,SAAA,EAAgB;AAAA,QACjB,4CAAC,cAAAC,SAAA,EAAkB;AAAA,QACnB,4CAAC,cAAAC,SAAA,EAAa;AAAA,QACd,4CAAC,aAAAC,SAAA,EAAgB;AAAA,QACjB,4CAAC,cAAAC,SAAA,EAAkB;AAAA,QACnB,4CAAC,cAAAC,SAAA,EAAoB;AAAA,QACrB,4CAAC,qDAAwB;AAAA,QACzB,4CAAC,cAAAC,SAAA,EAAoB;AAAA,QACrB,4CAAC,wBAAAC,SAAA,EAAe;AAAA,QAChB,4CAAC,kBAAAC,SAAA,EAAU;AAAA,QACX,4CAAC,sBAAAC,SAAA,EAAa;AAAA,QACd,4CAAC,uBAAAC,SAAA,EAAe;AAAA,QAChB,4CAAC,cAAAC,SAAA,EAAgB;AAAA,QACf;AAAA,SACH;AAAA,MACA;AAAA,QAAC,kBAAAC;AAAA,QAAA;AAAA,UACA;AAAA;AAAA,MACD;AAAA,OACD;AAAA,KAEF,GACD,GAEF,GACD;AAEF;",
6
- "names": ["import_panel", "editorStore", "DataFormPostSummary", "PostPanelSection", "PluginPostStatusInfo", "PostCardPanel", "PostFeaturedImagePanel", "PostExcerptPanel", "PostContentInformation", "PostLastEditedPanel", "PostStatusPanel", "PostSchedulePanel", "PostURLPanel", "PostAuthorPanel", "PostTemplatePanel", "PostDiscussionPanel", "PageAttributesPanel", "PostSyncStatus", "BlogTitle", "PostsPerPage", "SiteDiscussion", "PostFormatPanel", "PostTrash"]
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { Stack } from '@wordpress/ui';\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\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<Stack direction=\"column\" gap=\"lg\">\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<Stack direction=\"column\" gap=\"xs\">\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</Stack>\n\t\t\t\t\t\t\t{ ! isRemovedPostStatusPanel && (\n\t\t\t\t\t\t\t\t<Stack direction=\"column\" gap=\"lg\">\n\t\t\t\t\t\t\t\t\t<Stack direction=\"column\" gap=\"xs\">\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</Stack>\n\t\t\t\t\t\t\t\t\t<PostTrash\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,UAAS,KAAI,MAC7B;AAAA;AAAA,MAAC,uBAAAC;AAAA,MAAA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA;AAAA,IACD;AAAA,IACA,4CAAC,cAAAC,SAAA,EAAuB,eAAgB,OAAQ;AAAA,IAChD,4CAAC,cAAAC,yBAAA,EAAiB;AAAA,IAClB,6CAAC,mBAAM,WAAU,UAAS,KAAI,MAC7B;AAAA,kDAAC,gCAAAC,SAAA,EAAuB;AAAA,MACxB,4CAAC,8BAAAC,SAAA,EAAoB;AAAA,OACtB;AAAA,IACE,CAAE,4BACH,6CAAC,mBAAM,WAAU,UAAS,KAAI,MAC7B;AAAA,mDAAC,mBAAM,WAAU,UAAS,KAAI,MAC7B;AAAA,oDAAC,mBAAAC,SAAA,EAAgB;AAAA,QACjB,4CAAC,cAAAC,SAAA,EAAkB;AAAA,QACnB,4CAAC,cAAAC,SAAA,EAAa;AAAA,QACd,4CAAC,aAAAC,SAAA,EAAgB;AAAA,QACjB,4CAAC,cAAAC,SAAA,EAAkB;AAAA,QACnB,4CAAC,cAAAC,SAAA,EAAoB;AAAA,QACrB,4CAAC,qDAAwB;AAAA,QACzB,4CAAC,cAAAC,SAAA,EAAoB;AAAA,QACrB,4CAAC,wBAAAC,SAAA,EAAe;AAAA,QAChB,4CAAC,kBAAAC,SAAA,EAAU;AAAA,QACX,4CAAC,sBAAAC,SAAA,EAAa;AAAA,QACd,4CAAC,uBAAAC,SAAA,EAAe;AAAA,QAChB,4CAAC,cAAAC,SAAA,EAAgB;AAAA,QACf;AAAA,SACH;AAAA,MACA;AAAA,QAAC,kBAAAC;AAAA,QAAA;AAAA,UACA;AAAA;AAAA,MACD;AAAA,OACD;AAAA,KAEF,GACD,GAEF,GACD;AAEF;",
6
+ "names": ["import_panel", "editorStore", "PostPanelSection", "PluginPostStatusInfo", "PostCardPanel", "PostFeaturedImagePanel", "PostExcerptPanel", "PostContentInformation", "PostLastEditedPanel", "PostStatusPanel", "PostSchedulePanel", "PostURLPanel", "PostAuthorPanel", "PostTemplatePanel", "PostDiscussionPanel", "PageAttributesPanel", "PostSyncStatus", "BlogTitle", "PostsPerPage", "SiteDiscussion", "PostFormatPanel", "PostTrash"]
7
7
  }
@@ -157,37 +157,42 @@ var registerPostTypeSchema = (postType) => async ({ registry }) => {
157
157
  if (postType === import_constants.ATTACHMENT_POST_TYPE) {
158
158
  fields = ORDERED_MEDIA_FIELDS;
159
159
  } else {
160
+ const postTypeSlug = postTypeConfig.slug;
161
+ const isDesignPostType = import_constants.DESIGN_POST_TYPES.includes(postTypeSlug);
162
+ const isPattern = postTypeSlug === "wp_block";
160
163
  fields = [
161
164
  postTypeConfig.supports?.thumbnail && currentTheme?.theme_supports?.["post-thumbnails"] && import_fields.featuredImageField,
162
- !import_constants.DESIGN_POST_TYPES.includes(postTypeConfig.slug) && postTypeConfig.supports?.author && import_fields.authorField,
163
- postTypeConfig.slug === "wp_template" && import_fields.templateAuthorField,
164
- postTypeConfig.slug === "wp_template_part" && import_fields.templatePartAuthorField,
165
- !import_constants.DESIGN_POST_TYPES.includes(postTypeConfig.slug) && import_fields.statusField,
166
- !import_constants.DESIGN_POST_TYPES.includes(postTypeConfig.slug) && import_fields.dateField,
167
- !import_constants.DESIGN_POST_TYPES.includes(postTypeConfig.slug) && import_fields.scheduledDateField,
165
+ !isDesignPostType && postTypeConfig.supports?.author && import_fields.authorField,
166
+ postTypeSlug === "wp_template" && import_fields.templateAuthorField,
167
+ postTypeSlug === "wp_template_part" && import_fields.templatePartAuthorField,
168
+ !isDesignPostType && import_fields.statusField,
169
+ !isDesignPostType && import_fields.dateField,
170
+ !isDesignPostType && import_fields.scheduledDateField,
168
171
  import_fields.lastEditedDateField,
169
- !import_constants.DESIGN_POST_TYPES.includes(postTypeConfig.slug) && import_fields.slugField,
170
- !import_constants.DESIGN_POST_TYPES.includes(postTypeConfig.slug) && postTypeConfig.supports?.excerpt && import_fields.excerptField,
172
+ !isDesignPostType && import_fields.slugField,
173
+ !isDesignPostType && postTypeConfig.supports?.excerpt && import_fields.excerptField,
174
+ isPattern && postTypeConfig.supports?.excerpt && import_fields.patternDescriptionField,
171
175
  postTypeConfig.supports?.["page-attributes"] && import_fields.parentField,
172
176
  postTypeConfig.supports?.comments && import_fields.commentStatusField,
173
177
  postTypeConfig.supports?.trackbacks && import_fields.pingStatusField,
174
178
  (postTypeConfig.supports?.comments || postTypeConfig.supports?.trackbacks) && import_fields.discussionField,
175
- !import_constants.DESIGN_POST_TYPES.includes(postTypeConfig.slug) && import_fields.templateField,
179
+ !isDesignPostType && import_fields.templateField,
176
180
  postTypeConfig.supports?.["post-formats"] && !disablePostFormats && import_fields.formatField,
177
- !import_constants.DESIGN_POST_TYPES.includes(postTypeConfig.slug) && postTypeConfig.supports?.editor && import_fields.postContentInfoField,
178
- !import_constants.DESIGN_POST_TYPES.includes(postTypeConfig.slug) && import_fields.passwordField,
179
- postTypeConfig.slug === "post" && import_fields.stickyField,
180
- postTypeConfig.slug === "wp_template" && import_fields.descriptionField,
181
- postTypeConfig.slug === "wp_template" && import_fields.readOnlyDescriptionField,
181
+ (!isDesignPostType || isPattern) && postTypeConfig.supports?.editor && import_fields.postContentInfoField,
182
+ !isDesignPostType && import_fields.passwordField,
183
+ postTypeSlug === "post" && import_fields.stickyField,
184
+ postTypeSlug === "wp_template" && import_fields.descriptionField,
185
+ postTypeSlug === "wp_template" && import_fields.readOnlyDescriptionField,
182
186
  // The `home`/`index` template summary exposes a few fields that
183
187
  // target other entities (`root/site` and the posts page).
184
188
  // `DataFormPostSummary` overrides them to read/write the right
185
189
  // entity and to control their visibility.
186
- postTypeConfig.slug === "wp_template" && import_fields.postsPageTitleField,
187
- postTypeConfig.slug === "wp_template" && import_fields.postsPerPageField,
188
- postTypeConfig.slug === "wp_template" && import_fields.siteDiscussionField,
190
+ postTypeSlug === "wp_template" && import_fields.postsPageTitleField,
191
+ postTypeSlug === "wp_template" && import_fields.postsPerPageField,
192
+ postTypeSlug === "wp_template" && import_fields.siteDiscussionField,
189
193
  postTypeConfig.supports?.editor && postTypeConfig.viewable && import_content_preview.default,
190
- hasEditorNotesSupport(postTypeConfig.supports) && import_fields.notesField
194
+ hasEditorNotesSupport(postTypeConfig.supports) && import_fields.notesField,
195
+ isPattern && import_fields.patternSyncStatusField
191
196
  ].filter(Boolean);
192
197
  if (postTypeConfig.supports?.title) {
193
198
  let _titleField;
@@ -195,7 +200,7 @@ var registerPostTypeSchema = (postType) => async ({ registry }) => {
195
200
  _titleField = import_fields.pageTitleField;
196
201
  } else if (postType === "wp_template") {
197
202
  _titleField = import_fields.templateTitleField;
198
- } else if (postType === "wp_block") {
203
+ } else if (["wp_block", "wp_template_part"].includes(postType)) {
199
204
  _titleField = import_fields.patternTitleField;
200
205
  } else {
201
206
  _titleField = import_fields.titleField;