@wordpress/edit-site 6.2.0 → 6.4.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.
- package/CHANGELOG.md +4 -0
- package/build/components/add-new-pattern/index.js +8 -2
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/{add-new-page → add-new-post}/index.js +21 -17
- package/build/components/add-new-post/index.js.map +1 -0
- package/build/components/add-new-template/index.js +3 -1
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js +6 -85
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/editor/index.js +21 -3
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/background-panel.js +0 -5
- package/build/components/global-styles/background-panel.js.map +1 -1
- package/build/components/global-styles/block-preview-panel.js +14 -5
- package/build/components/global-styles/block-preview-panel.js.map +1 -1
- package/build/components/global-styles/font-families.js +42 -23
- package/build/components/global-styles/font-families.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +13 -30
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/index.js +4 -4
- package/build/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +60 -12
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +39 -0
- package/build/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +1 -0
- package/build/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +39 -0
- package/build/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js.map +1 -0
- package/build/components/global-styles/font-sizes/font-size-preview.js +44 -0
- package/build/components/global-styles/font-sizes/font-size-preview.js.map +1 -0
- package/build/components/global-styles/font-sizes/font-size.js +213 -0
- package/build/components/global-styles/font-sizes/font-size.js.map +1 -0
- package/build/components/global-styles/font-sizes/font-sizes-count.js +50 -0
- package/build/components/global-styles/font-sizes/font-sizes-count.js.map +1 -0
- package/build/components/global-styles/font-sizes/font-sizes.js +163 -0
- package/build/components/global-styles/font-sizes/font-sizes.js.map +1 -0
- package/build/components/global-styles/font-sizes/rename-font-size-dialog.js +67 -0
- package/build/components/global-styles/font-sizes/rename-font-size-dialog.js.map +1 -0
- package/build/components/global-styles/hooks.js +0 -40
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/preview-typography.js +47 -0
- package/build/components/global-styles/preview-typography.js.map +1 -0
- package/build/components/global-styles/screen-block.js +17 -1
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-layout.js +5 -1
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js +2 -2
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +3 -2
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/shadows-edit-panel.js +1 -2
- package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build/components/global-styles/size-control/index.js +85 -0
- package/build/components/global-styles/size-control/index.js.map +1 -0
- package/build/components/global-styles/style-variations-container.js +8 -5
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/typography-elements.js +0 -2
- package/build/components/global-styles/typography-elements.js.map +1 -1
- package/build/components/global-styles/ui.js +8 -0
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/variations/variation.js +4 -4
- package/build/components/global-styles/variations/variation.js.map +1 -1
- package/build/components/global-styles/variations/variations-color.js +4 -3
- package/build/components/global-styles/variations/variations-color.js.map +1 -1
- package/build/components/global-styles/variations/variations-typography.js +15 -29
- package/build/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build/components/global-styles-sidebar/index.js +2 -2
- package/build/components/global-styles-sidebar/index.js.map +1 -1
- package/build/components/layout/index.js +22 -8
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/router.js +30 -43
- package/build/components/layout/router.js.map +1 -1
- package/build/components/page-patterns/header.js +1 -1
- package/build/components/page-patterns/header.js.map +1 -1
- package/build/components/page-patterns/index.js +65 -49
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-patterns/search-items.js +29 -4
- package/build/components/page-patterns/search-items.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +22 -55
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-templates/index.js +56 -50
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/pagination/index.js +4 -4
- package/build/components/pagination/index.js.map +1 -1
- package/build/components/post-edit/index.js +105 -0
- package/build/components/post-edit/index.js.map +1 -0
- package/build/components/post-fields/index.js +314 -0
- package/build/components/post-fields/index.js.map +1 -0
- package/build/components/post-list/index.js +281 -0
- package/build/components/post-list/index.js.map +1 -0
- package/build/components/posts-app/index.js +11 -17
- package/build/components/posts-app/index.js.map +1 -1
- package/build/components/posts-app/router.js +85 -0
- package/build/components/posts-app/router.js.map +1 -0
- package/build/components/revisions/index.js +10 -7
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/save-panel/index.js +1 -1
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar-dataviews/add-new-view.js +4 -1
- package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build/components/sidebar-dataviews/custom-dataviews-list.js +6 -2
- package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +119 -93
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +44 -2
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/content.js +64 -0
- package/build/components/sidebar-navigation-screen-global-styles/content.js.map +1 -0
- package/build/components/sidebar-navigation-screen-global-styles/index.js +2 -47
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +3 -2
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +3 -2
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build/components/site-hub/index.js +81 -1
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js +2 -2
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +65 -42
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build/index.js +10 -0
- package/build/index.js.map +1 -1
- package/build/posts.js +57 -2
- package/build/posts.js.map +1 -1
- package/build/store/private-actions.js +7 -2
- package/build/store/private-actions.js.map +1 -1
- package/build/store/selectors.js +34 -6
- package/build/store/selectors.js.map +1 -1
- package/build/utils/get-filtered-template-parts.js +64 -0
- package/build/utils/get-filtered-template-parts.js.map +1 -0
- package/build-module/components/add-new-pattern/index.js +8 -2
- package/build-module/components/add-new-pattern/index.js.map +1 -1
- package/build-module/components/{add-new-page → add-new-post}/index.js +21 -17
- package/build-module/components/add-new-post/index.js.map +1 -0
- package/build-module/components/add-new-template/index.js +3 -1
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +6 -85
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/editor/index.js +21 -3
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/background-panel.js +0 -5
- package/build-module/components/global-styles/background-panel.js.map +1 -1
- package/build-module/components/global-styles/block-preview-panel.js +14 -5
- package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
- package/build-module/components/global-styles/font-families.js +44 -25
- package/build-module/components/global-styles/font-families.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +14 -31
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/index.js +4 -4
- package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +63 -15
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +32 -0
- package/build-module/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js.map +1 -0
- package/build-module/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +32 -0
- package/build-module/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js.map +1 -0
- package/build-module/components/global-styles/font-sizes/font-size-preview.js +37 -0
- package/build-module/components/global-styles/font-sizes/font-size-preview.js.map +1 -0
- package/build-module/components/global-styles/font-sizes/font-size.js +207 -0
- package/build-module/components/global-styles/font-sizes/font-size.js.map +1 -0
- package/build-module/components/global-styles/font-sizes/font-sizes-count.js +43 -0
- package/build-module/components/global-styles/font-sizes/font-sizes-count.js.map +1 -0
- package/build-module/components/global-styles/font-sizes/font-sizes.js +157 -0
- package/build-module/components/global-styles/font-sizes/font-sizes.js.map +1 -0
- package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js +61 -0
- package/build-module/components/global-styles/font-sizes/rename-font-size-dialog.js.map +1 -0
- package/build-module/components/global-styles/hooks.js +0 -38
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/preview-typography.js +39 -0
- package/build-module/components/global-styles/preview-typography.js.map +1 -0
- package/build-module/components/global-styles/screen-block.js +18 -1
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-layout.js +5 -1
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js +2 -2
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +3 -2
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/shadows-edit-panel.js +1 -2
- package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build-module/components/global-styles/size-control/index.js +79 -0
- package/build-module/components/global-styles/size-control/index.js.map +1 -0
- package/build-module/components/global-styles/style-variations-container.js +9 -6
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/typography-elements.js +0 -2
- package/build-module/components/global-styles/typography-elements.js.map +1 -1
- package/build-module/components/global-styles/ui.js +8 -0
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/variations/variation.js +5 -5
- package/build-module/components/global-styles/variations/variation.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-color.js +5 -4
- package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-typography.js +16 -30
- package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build-module/components/global-styles-sidebar/index.js +2 -2
- package/build-module/components/global-styles-sidebar/index.js.map +1 -1
- package/build-module/components/layout/index.js +20 -8
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/router.js +30 -43
- package/build-module/components/layout/router.js.map +1 -1
- package/build-module/components/page-patterns/header.js +1 -1
- package/build-module/components/page-patterns/header.js.map +1 -1
- package/build-module/components/page-patterns/index.js +66 -50
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-patterns/search-items.js +28 -4
- package/build-module/components/page-patterns/search-items.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +23 -56
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-templates/index.js +58 -53
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/pagination/index.js +4 -4
- package/build-module/components/pagination/index.js.map +1 -1
- package/build-module/components/post-edit/index.js +98 -0
- package/build-module/components/post-edit/index.js.map +1 -0
- package/build-module/components/post-fields/index.js +306 -0
- package/build-module/components/post-fields/index.js.map +1 -0
- package/build-module/components/post-list/index.js +275 -0
- package/build-module/components/post-list/index.js.map +1 -0
- package/build-module/components/posts-app/index.js +11 -17
- package/build-module/components/posts-app/index.js.map +1 -1
- package/build-module/components/posts-app/router.js +77 -0
- package/build-module/components/posts-app/router.js.map +1 -0
- package/build-module/components/revisions/index.js +10 -7
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +1 -1
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js +4 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +6 -2
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +117 -92
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +47 -5
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/content.js +57 -0
- package/build-module/components/sidebar-navigation-screen-global-styles/content.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +2 -47
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +3 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +3 -2
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build-module/components/site-hub/index.js +81 -1
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +2 -2
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +61 -38
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build-module/index.js +11 -2
- package/build-module/index.js.map +1 -1
- package/build-module/posts.js +57 -2
- package/build-module/posts.js.map +1 -1
- package/build-module/store/private-actions.js +7 -2
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/selectors.js +35 -7
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/get-filtered-template-parts.js +57 -0
- package/build-module/utils/get-filtered-template-parts.js.map +1 -0
- package/build-style/posts-rtl.css +668 -510
- package/build-style/posts.css +668 -510
- package/build-style/style-rtl.css +772 -702
- package/build-style/style.css +772 -702
- package/package.json +41 -41
- package/src/components/add-new-pattern/index.js +8 -2
- package/src/components/{add-new-page → add-new-post}/index.js +28 -22
- package/src/components/add-new-template/index.js +4 -1
- package/src/components/add-new-template/style.scss +4 -6
- package/src/components/block-editor/use-site-editor-settings.js +10 -101
- package/src/components/editor/index.js +21 -5
- package/src/components/global-styles/background-panel.js +0 -8
- package/src/components/global-styles/block-preview-panel.js +22 -9
- package/src/components/global-styles/font-families.js +66 -31
- package/src/components/global-styles/font-library-modal/font-collection.js +17 -32
- package/src/components/global-styles/font-library-modal/index.js +4 -2
- package/src/components/global-styles/font-library-modal/installed-fonts.js +94 -13
- package/src/components/global-styles/font-library-modal/style.scss +26 -10
- package/src/components/global-styles/font-sizes/confirm-delete-font-size-dialog.js +43 -0
- package/src/components/global-styles/font-sizes/confirm-reset-font-sizes-dialog.js +37 -0
- package/src/components/global-styles/font-sizes/font-size-preview.js +43 -0
- package/src/components/global-styles/font-sizes/font-size.js +250 -0
- package/src/components/global-styles/font-sizes/font-sizes-count.js +40 -0
- package/src/components/global-styles/font-sizes/font-sizes.js +263 -0
- package/src/components/global-styles/font-sizes/rename-font-size-dialog.js +70 -0
- package/src/components/global-styles/hooks.js +0 -41
- package/src/components/global-styles/preview-typography.js +39 -0
- package/src/components/global-styles/screen-block.js +20 -0
- package/src/components/global-styles/screen-layout.js +5 -1
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +1 -1
- package/src/components/global-styles/screen-style-variations.js +2 -2
- package/src/components/global-styles/screen-typography.js +3 -2
- package/src/components/global-styles/shadows-edit-panel.js +1 -2
- package/src/components/global-styles/size-control/index.js +86 -0
- package/src/components/global-styles/style-variations-container.js +14 -7
- package/src/components/global-styles/style.scss +13 -3
- package/src/components/global-styles/typography-elements.js +0 -4
- package/src/components/global-styles/ui.js +10 -0
- package/src/components/global-styles/variations/variation.js +5 -5
- package/src/components/global-styles/variations/variations-color.js +6 -4
- package/src/components/global-styles/variations/variations-typography.js +15 -33
- package/src/components/global-styles-sidebar/index.js +2 -2
- package/src/components/layout/index.js +24 -4
- package/src/components/layout/router.js +29 -37
- package/src/components/layout/style.scss +38 -8
- package/src/components/page-patterns/header.js +1 -1
- package/src/components/page-patterns/index.js +62 -64
- package/src/components/page-patterns/search-items.js +37 -3
- package/src/components/page-patterns/style.scss +1 -8
- package/src/components/page-patterns/use-patterns.js +43 -82
- package/src/components/page-templates/index.js +67 -64
- package/src/components/page-templates/style.scss +6 -9
- package/src/components/pagination/index.js +4 -4
- package/src/components/post-edit/index.js +96 -0
- package/src/components/post-edit/style.scss +9 -0
- package/src/components/post-fields/index.js +345 -0
- package/src/components/post-list/index.js +326 -0
- package/src/components/{page-pages → post-list}/style.scss +25 -8
- package/src/components/posts-app/index.js +9 -11
- package/src/components/posts-app/router.js +69 -0
- package/src/components/revisions/index.js +9 -1
- package/src/components/save-panel/index.js +1 -1
- package/src/components/sidebar/style.scss +6 -0
- package/src/components/sidebar-dataviews/add-new-view.js +2 -1
- package/src/components/sidebar-dataviews/custom-dataviews-list.js +6 -2
- package/src/components/sidebar-dataviews/default-views.js +131 -106
- package/src/components/sidebar-dataviews/index.js +39 -4
- package/src/components/sidebar-navigation-screen-global-styles/content.js +55 -0
- package/src/components/sidebar-navigation-screen-global-styles/index.js +1 -54
- package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +2 -1
- package/src/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +10 -2
- package/src/components/site-hub/index.js +84 -1
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -2
- package/src/hooks/push-changes-to-global-styles/index.js +2 -2
- package/src/hooks/use-theme-style-variations/test/use-theme-style-variations-by-property.js +28 -24
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +72 -47
- package/src/index.js +14 -1
- package/src/posts.js +63 -2
- package/src/posts.scss +9 -0
- package/src/store/private-actions.js +7 -3
- package/src/store/selectors.js +53 -14
- package/src/store/test/selectors.js +1 -26
- package/src/style.scss +2 -2
- package/src/utils/get-filtered-template-parts.js +61 -0
- package/src/utils/test/get-filtered-template-parts.js +127 -0
- package/build/components/add-new-page/index.js.map +0 -1
- package/build/components/global-styles/screen-background.js +0 -36
- package/build/components/global-styles/screen-background.js.map +0 -1
- package/build/components/page-pages/index.js +0 -473
- package/build/components/page-pages/index.js.map +0 -1
- package/build/components/table/index.js +0 -35
- package/build/components/table/index.js.map +0 -1
- package/build-module/components/add-new-page/index.js.map +0 -1
- package/build-module/components/global-styles/screen-background.js +0 -30
- package/build-module/components/global-styles/screen-background.js.map +0 -1
- package/build-module/components/page-pages/index.js +0 -465
- package/build-module/components/page-pages/index.js.map +0 -1
- package/build-module/components/table/index.js +0 -30
- package/build-module/components/table/index.js.map +0 -1
- package/src/components/global-styles/screen-background.js +0 -29
- package/src/components/page-pages/index.js +0 -564
- package/src/components/table/index.js +0 -33
- package/src/components/table/style.scss +0 -38
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-site",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.4.0",
|
|
4
4
|
"description": "Edit Site Page module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -29,45 +29,45 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@babel/runtime": "^7.16.0",
|
|
31
31
|
"@react-spring/web": "^9.4.5",
|
|
32
|
-
"@wordpress/a11y": "^4.
|
|
33
|
-
"@wordpress/api-fetch": "^7.
|
|
34
|
-
"@wordpress/blob": "^4.
|
|
35
|
-
"@wordpress/block-editor": "^13.
|
|
36
|
-
"@wordpress/block-library": "^9.
|
|
37
|
-
"@wordpress/blocks": "^13.
|
|
38
|
-
"@wordpress/commands": "^1.
|
|
39
|
-
"@wordpress/components": "^28.
|
|
40
|
-
"@wordpress/compose": "^7.
|
|
41
|
-
"@wordpress/core-commands": "^1.
|
|
42
|
-
"@wordpress/core-data": "^7.
|
|
43
|
-
"@wordpress/data": "^10.
|
|
44
|
-
"@wordpress/dataviews": "^
|
|
45
|
-
"@wordpress/date": "^5.
|
|
46
|
-
"@wordpress/deprecated": "^4.
|
|
47
|
-
"@wordpress/dom": "^4.
|
|
48
|
-
"@wordpress/editor": "^14.
|
|
49
|
-
"@wordpress/element": "^6.
|
|
50
|
-
"@wordpress/escape-html": "^3.
|
|
51
|
-
"@wordpress/hooks": "^4.
|
|
52
|
-
"@wordpress/html-entities": "^4.
|
|
53
|
-
"@wordpress/i18n": "^5.
|
|
54
|
-
"@wordpress/icons": "^10.
|
|
55
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
56
|
-
"@wordpress/keycodes": "^4.
|
|
57
|
-
"@wordpress/notices": "^5.
|
|
58
|
-
"@wordpress/patterns": "^2.
|
|
59
|
-
"@wordpress/plugins": "^7.
|
|
60
|
-
"@wordpress/preferences": "^4.
|
|
61
|
-
"@wordpress/primitives": "^4.
|
|
62
|
-
"@wordpress/priority-queue": "^3.
|
|
63
|
-
"@wordpress/private-apis": "^1.
|
|
64
|
-
"@wordpress/reusable-blocks": "^5.
|
|
65
|
-
"@wordpress/router": "^1.
|
|
66
|
-
"@wordpress/style-engine": "^2.
|
|
67
|
-
"@wordpress/url": "^4.
|
|
68
|
-
"@wordpress/viewport": "^6.
|
|
69
|
-
"@wordpress/widgets": "^4.
|
|
70
|
-
"@wordpress/wordcount": "^4.
|
|
32
|
+
"@wordpress/a11y": "^4.4.0",
|
|
33
|
+
"@wordpress/api-fetch": "^7.4.0",
|
|
34
|
+
"@wordpress/blob": "^4.4.0",
|
|
35
|
+
"@wordpress/block-editor": "^13.4.0",
|
|
36
|
+
"@wordpress/block-library": "^9.4.0",
|
|
37
|
+
"@wordpress/blocks": "^13.4.0",
|
|
38
|
+
"@wordpress/commands": "^1.4.0",
|
|
39
|
+
"@wordpress/components": "^28.4.0",
|
|
40
|
+
"@wordpress/compose": "^7.4.0",
|
|
41
|
+
"@wordpress/core-commands": "^1.4.0",
|
|
42
|
+
"@wordpress/core-data": "^7.4.0",
|
|
43
|
+
"@wordpress/data": "^10.4.0",
|
|
44
|
+
"@wordpress/dataviews": "^4.0.0",
|
|
45
|
+
"@wordpress/date": "^5.4.0",
|
|
46
|
+
"@wordpress/deprecated": "^4.4.0",
|
|
47
|
+
"@wordpress/dom": "^4.4.0",
|
|
48
|
+
"@wordpress/editor": "^14.4.0",
|
|
49
|
+
"@wordpress/element": "^6.4.0",
|
|
50
|
+
"@wordpress/escape-html": "^3.4.0",
|
|
51
|
+
"@wordpress/hooks": "^4.4.0",
|
|
52
|
+
"@wordpress/html-entities": "^4.4.0",
|
|
53
|
+
"@wordpress/i18n": "^5.4.0",
|
|
54
|
+
"@wordpress/icons": "^10.4.0",
|
|
55
|
+
"@wordpress/keyboard-shortcuts": "^5.4.0",
|
|
56
|
+
"@wordpress/keycodes": "^4.4.0",
|
|
57
|
+
"@wordpress/notices": "^5.4.0",
|
|
58
|
+
"@wordpress/patterns": "^2.4.0",
|
|
59
|
+
"@wordpress/plugins": "^7.4.0",
|
|
60
|
+
"@wordpress/preferences": "^4.4.0",
|
|
61
|
+
"@wordpress/primitives": "^4.4.0",
|
|
62
|
+
"@wordpress/priority-queue": "^3.4.0",
|
|
63
|
+
"@wordpress/private-apis": "^1.4.0",
|
|
64
|
+
"@wordpress/reusable-blocks": "^5.4.0",
|
|
65
|
+
"@wordpress/router": "^1.4.0",
|
|
66
|
+
"@wordpress/style-engine": "^2.4.0",
|
|
67
|
+
"@wordpress/url": "^4.4.0",
|
|
68
|
+
"@wordpress/viewport": "^6.4.0",
|
|
69
|
+
"@wordpress/widgets": "^4.4.0",
|
|
70
|
+
"@wordpress/wordcount": "^4.4.0",
|
|
71
71
|
"change-case": "^4.1.2",
|
|
72
72
|
"clsx": "^2.1.1",
|
|
73
73
|
"colord": "^2.9.2",
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"publishConfig": {
|
|
83
83
|
"access": "public"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "363edb39b8dda8727f652e42cbb8497732693ed2"
|
|
86
86
|
}
|
|
@@ -56,8 +56,14 @@ export default function AddNewPattern() {
|
|
|
56
56
|
addNewTemplatePartLabel: getPostType( TEMPLATE_PART_POST_TYPE )
|
|
57
57
|
?.labels?.add_new_item,
|
|
58
58
|
// Blocks refers to the wp_block post type, this checks the ability to create a post of that type.
|
|
59
|
-
canCreatePattern: canUser( 'create',
|
|
60
|
-
|
|
59
|
+
canCreatePattern: canUser( 'create', {
|
|
60
|
+
kind: 'postType',
|
|
61
|
+
name: PATTERN_TYPES.user,
|
|
62
|
+
} ),
|
|
63
|
+
canCreateTemplatePart: canUser( 'create', {
|
|
64
|
+
kind: 'postType',
|
|
65
|
+
name: TEMPLATE_PART_POST_TYPE,
|
|
66
|
+
} ),
|
|
61
67
|
};
|
|
62
68
|
}, [] );
|
|
63
69
|
|
|
@@ -9,15 +9,19 @@ import {
|
|
|
9
9
|
TextControl,
|
|
10
10
|
} from '@wordpress/components';
|
|
11
11
|
import { __, sprintf } from '@wordpress/i18n';
|
|
12
|
-
import { useDispatch, useRegistry } from '@wordpress/data';
|
|
12
|
+
import { useDispatch, useRegistry, useSelect } from '@wordpress/data';
|
|
13
13
|
import { useState } from '@wordpress/element';
|
|
14
14
|
import { store as coreStore } from '@wordpress/core-data';
|
|
15
15
|
import { store as noticesStore } from '@wordpress/notices';
|
|
16
16
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
17
17
|
import { serialize, synchronizeBlocksWithTemplate } from '@wordpress/blocks';
|
|
18
18
|
|
|
19
|
-
export default function
|
|
20
|
-
const
|
|
19
|
+
export default function AddNewPostModal( { postType, onSave, onClose } ) {
|
|
20
|
+
const labels = useSelect(
|
|
21
|
+
( select ) => select( coreStore ).getPostType( postType )?.labels,
|
|
22
|
+
[ postType ]
|
|
23
|
+
);
|
|
24
|
+
const [ isCreatingPost, setIsCreatingPost ] = useState( false );
|
|
21
25
|
const [ title, setTitle ] = useState( '' );
|
|
22
26
|
|
|
23
27
|
const { saveEntityRecord } = useDispatch( coreStore );
|
|
@@ -25,29 +29,30 @@ export default function AddNewPageModal( { onSave, onClose } ) {
|
|
|
25
29
|
useDispatch( noticesStore );
|
|
26
30
|
const { resolveSelect } = useRegistry();
|
|
27
31
|
|
|
28
|
-
async function
|
|
32
|
+
async function createPost( event ) {
|
|
29
33
|
event.preventDefault();
|
|
30
34
|
|
|
31
|
-
if (
|
|
35
|
+
if ( isCreatingPost ) {
|
|
32
36
|
return;
|
|
33
37
|
}
|
|
34
|
-
|
|
38
|
+
setIsCreatingPost( true );
|
|
35
39
|
try {
|
|
36
|
-
const
|
|
37
|
-
await resolveSelect( coreStore ).getPostType(
|
|
40
|
+
const postTypeObject =
|
|
41
|
+
await resolveSelect( coreStore ).getPostType( postType );
|
|
38
42
|
const newPage = await saveEntityRecord(
|
|
39
43
|
'postType',
|
|
40
|
-
|
|
44
|
+
postType,
|
|
41
45
|
{
|
|
42
46
|
status: 'draft',
|
|
43
47
|
title,
|
|
44
48
|
slug: title || __( 'No title' ),
|
|
45
49
|
content:
|
|
46
|
-
!!
|
|
50
|
+
!! postTypeObject.template &&
|
|
51
|
+
postTypeObject.template.length
|
|
47
52
|
? serialize(
|
|
48
53
|
synchronizeBlocksWithTemplate(
|
|
49
54
|
[],
|
|
50
|
-
|
|
55
|
+
postTypeObject.template
|
|
51
56
|
)
|
|
52
57
|
)
|
|
53
58
|
: undefined,
|
|
@@ -59,40 +64,41 @@ export default function AddNewPageModal( { onSave, onClose } ) {
|
|
|
59
64
|
|
|
60
65
|
createSuccessNotice(
|
|
61
66
|
sprintf(
|
|
62
|
-
// translators: %s: Title of the created
|
|
67
|
+
// translators: %s: Title of the created post e.g: "Hello world".
|
|
63
68
|
__( '"%s" successfully created.' ),
|
|
64
69
|
decodeEntities( newPage.title?.rendered || title )
|
|
65
70
|
),
|
|
66
|
-
{
|
|
67
|
-
type: 'snackbar',
|
|
68
|
-
}
|
|
71
|
+
{ type: 'snackbar' }
|
|
69
72
|
);
|
|
70
73
|
} catch ( error ) {
|
|
71
74
|
const errorMessage =
|
|
72
75
|
error.message && error.code !== 'unknown_error'
|
|
73
76
|
? error.message
|
|
74
|
-
: __( 'An error occurred while creating the
|
|
77
|
+
: __( 'An error occurred while creating the item.' );
|
|
75
78
|
|
|
76
79
|
createErrorNotice( errorMessage, {
|
|
77
80
|
type: 'snackbar',
|
|
78
81
|
} );
|
|
79
82
|
} finally {
|
|
80
|
-
|
|
83
|
+
setIsCreatingPost( false );
|
|
81
84
|
}
|
|
82
85
|
}
|
|
83
86
|
|
|
84
87
|
return (
|
|
85
88
|
<Modal
|
|
86
|
-
title={
|
|
89
|
+
title={
|
|
90
|
+
// translators: %s: post type singular_name label e.g: "Page".
|
|
91
|
+
sprintf( __( 'Draft new: %s' ), labels?.singular_name )
|
|
92
|
+
}
|
|
87
93
|
onRequestClose={ onClose }
|
|
88
94
|
focusOnMount="firstContentElement"
|
|
89
95
|
size="small"
|
|
90
96
|
>
|
|
91
|
-
<form onSubmit={
|
|
97
|
+
<form onSubmit={ createPost }>
|
|
92
98
|
<VStack spacing={ 3 }>
|
|
93
99
|
<TextControl
|
|
94
100
|
__next40pxDefaultSize
|
|
95
|
-
label={ __( '
|
|
101
|
+
label={ __( 'Title' ) }
|
|
96
102
|
onChange={ setTitle }
|
|
97
103
|
placeholder={ __( 'No title' ) }
|
|
98
104
|
value={ title }
|
|
@@ -109,8 +115,8 @@ export default function AddNewPageModal( { onSave, onClose } ) {
|
|
|
109
115
|
__next40pxDefaultSize
|
|
110
116
|
variant="primary"
|
|
111
117
|
type="submit"
|
|
112
|
-
isBusy={
|
|
113
|
-
aria-disabled={
|
|
118
|
+
isBusy={ isCreatingPost }
|
|
119
|
+
aria-disabled={ isCreatingPost }
|
|
114
120
|
>
|
|
115
121
|
{ __( 'Create draft' ) }
|
|
116
122
|
</Button>
|
|
@@ -19,6 +19,7 @@ import { decodeEntities } from '@wordpress/html-entities';
|
|
|
19
19
|
import { useState, memo } from '@wordpress/element';
|
|
20
20
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
21
21
|
import { store as coreStore } from '@wordpress/core-data';
|
|
22
|
+
import { useViewportMatch } from '@wordpress/compose';
|
|
22
23
|
import {
|
|
23
24
|
archive,
|
|
24
25
|
blockMeta,
|
|
@@ -161,6 +162,8 @@ function NewTemplateModal( { onClose } ) {
|
|
|
161
162
|
const { createErrorNotice, createSuccessNotice } =
|
|
162
163
|
useDispatch( noticesStore );
|
|
163
164
|
|
|
165
|
+
const isMobile = useViewportMatch( 'medium', '<' );
|
|
166
|
+
|
|
164
167
|
const { homeUrl } = useSelect( ( select ) => {
|
|
165
168
|
const {
|
|
166
169
|
getUnstableBase, // Site index.
|
|
@@ -266,7 +269,7 @@ function NewTemplateModal( { onClose } ) {
|
|
|
266
269
|
>
|
|
267
270
|
{ modalContent === modalContentMap.templatesList && (
|
|
268
271
|
<Grid
|
|
269
|
-
columns={ 3 }
|
|
272
|
+
columns={ isMobile ? 2 : 3 }
|
|
270
273
|
gap={ 4 }
|
|
271
274
|
align="flex-start"
|
|
272
275
|
justify="center"
|
|
@@ -97,13 +97,12 @@
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
.edit-site-add-new-template__modal {
|
|
100
|
-
max-width: $grid-unit-80 * 13;
|
|
101
|
-
width: calc(100% - #{$grid-unit-80});
|
|
102
|
-
margin-top: $grid-unit-80;
|
|
103
|
-
max-height: calc(100% - #{$grid-unit-80 * 2});
|
|
104
100
|
|
|
105
101
|
@include break-large() {
|
|
102
|
+
max-width: $grid-unit-80 * 13;
|
|
103
|
+
margin-top: $grid-unit-80;
|
|
106
104
|
width: calc(100% - #{$grid-unit-80 * 2});
|
|
105
|
+
max-height: calc(100% - #{$grid-unit-80 * 2});
|
|
107
106
|
}
|
|
108
107
|
|
|
109
108
|
.edit-site-add-new-template__template-button,
|
|
@@ -175,8 +174,7 @@
|
|
|
175
174
|
|
|
176
175
|
.edit-site-add-new-template__custom-template-button,
|
|
177
176
|
.edit-site-add-new-template__template-list__prompt {
|
|
178
|
-
grid-column
|
|
179
|
-
grid-column-end: 4;
|
|
177
|
+
grid-column: 1 / -1;
|
|
180
178
|
}
|
|
181
179
|
}
|
|
182
180
|
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { useSelect } from '@wordpress/data';
|
|
5
5
|
import { useMemo } from '@wordpress/element';
|
|
6
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
7
6
|
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
8
7
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
9
8
|
import { usePrevious } from '@wordpress/compose';
|
|
@@ -19,78 +18,6 @@ import { FOCUSABLE_ENTITIES } from '../../utils/constants';
|
|
|
19
18
|
const { useBlockEditorSettings } = unlock( editorPrivateApis );
|
|
20
19
|
const { useLocation, useHistory } = unlock( routerPrivateApis );
|
|
21
20
|
|
|
22
|
-
function useArchiveLabel( templateSlug ) {
|
|
23
|
-
const taxonomyMatches = templateSlug?.match(
|
|
24
|
-
/^(category|tag|taxonomy-([^-]+))$|^(((category|tag)|taxonomy-([^-]+))-(.+))$/
|
|
25
|
-
);
|
|
26
|
-
let taxonomy;
|
|
27
|
-
let term;
|
|
28
|
-
let isAuthor = false;
|
|
29
|
-
let authorSlug;
|
|
30
|
-
if ( taxonomyMatches ) {
|
|
31
|
-
// If is for a all taxonomies of a type
|
|
32
|
-
if ( taxonomyMatches[ 1 ] ) {
|
|
33
|
-
taxonomy = taxonomyMatches[ 2 ]
|
|
34
|
-
? taxonomyMatches[ 2 ]
|
|
35
|
-
: taxonomyMatches[ 1 ];
|
|
36
|
-
}
|
|
37
|
-
// If is for a all taxonomies of a type
|
|
38
|
-
else if ( taxonomyMatches[ 3 ] ) {
|
|
39
|
-
taxonomy = taxonomyMatches[ 6 ]
|
|
40
|
-
? taxonomyMatches[ 6 ]
|
|
41
|
-
: taxonomyMatches[ 4 ];
|
|
42
|
-
term = taxonomyMatches[ 7 ];
|
|
43
|
-
}
|
|
44
|
-
taxonomy = taxonomy === 'tag' ? 'post_tag' : taxonomy;
|
|
45
|
-
|
|
46
|
-
//getTaxonomy( 'category' );
|
|
47
|
-
//wp.data.select('core').getEntityRecords( 'taxonomy', 'category', {slug: 'newcat'} );
|
|
48
|
-
} else {
|
|
49
|
-
const authorMatches = templateSlug?.match( /^(author)$|^author-(.+)$/ );
|
|
50
|
-
if ( authorMatches ) {
|
|
51
|
-
isAuthor = true;
|
|
52
|
-
if ( authorMatches[ 2 ] ) {
|
|
53
|
-
authorSlug = authorMatches[ 2 ];
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return useSelect(
|
|
58
|
-
( select ) => {
|
|
59
|
-
const { getEntityRecords, getTaxonomy, getAuthors } =
|
|
60
|
-
select( coreStore );
|
|
61
|
-
let archiveTypeLabel;
|
|
62
|
-
let archiveNameLabel;
|
|
63
|
-
if ( taxonomy ) {
|
|
64
|
-
archiveTypeLabel =
|
|
65
|
-
getTaxonomy( taxonomy )?.labels?.singular_name;
|
|
66
|
-
}
|
|
67
|
-
if ( term ) {
|
|
68
|
-
const records = getEntityRecords( 'taxonomy', taxonomy, {
|
|
69
|
-
slug: term,
|
|
70
|
-
per_page: 1,
|
|
71
|
-
} );
|
|
72
|
-
if ( records && records[ 0 ] ) {
|
|
73
|
-
archiveNameLabel = records[ 0 ].name;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
if ( isAuthor ) {
|
|
77
|
-
archiveTypeLabel = 'Author';
|
|
78
|
-
if ( authorSlug ) {
|
|
79
|
-
const authorRecords = getAuthors( { slug: authorSlug } );
|
|
80
|
-
if ( authorRecords && authorRecords[ 0 ] ) {
|
|
81
|
-
archiveNameLabel = authorRecords[ 0 ].name;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return {
|
|
86
|
-
archiveTypeLabel,
|
|
87
|
-
archiveNameLabel,
|
|
88
|
-
};
|
|
89
|
-
},
|
|
90
|
-
[ authorSlug, isAuthor, taxonomy, term ]
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
21
|
function useNavigateToPreviousEntityRecord() {
|
|
95
22
|
const location = useLocation();
|
|
96
23
|
const previousLocation = usePrevious( location );
|
|
@@ -114,35 +41,22 @@ function useNavigateToPreviousEntityRecord() {
|
|
|
114
41
|
|
|
115
42
|
export function useSpecificEditorSettings() {
|
|
116
43
|
const onNavigateToEntityRecord = useNavigateToEntityRecord();
|
|
117
|
-
const {
|
|
118
|
-
( select ) => {
|
|
119
|
-
const {
|
|
120
|
-
|
|
121
|
-
getEditedPostId,
|
|
122
|
-
getEditedPostContext,
|
|
123
|
-
getCanvasMode,
|
|
124
|
-
getSettings,
|
|
125
|
-
} = unlock( select( editSiteStore ) );
|
|
126
|
-
const { getEditedEntityRecord } = select( coreStore );
|
|
127
|
-
const usedPostType = getEditedPostType();
|
|
128
|
-
const usedPostId = getEditedPostId();
|
|
129
|
-
const _record = getEditedEntityRecord(
|
|
130
|
-
'postType',
|
|
131
|
-
usedPostType,
|
|
132
|
-
usedPostId
|
|
44
|
+
const { canvasMode, settings, shouldUseTemplateAsDefaultRenderingMode } =
|
|
45
|
+
useSelect( ( select ) => {
|
|
46
|
+
const { getEditedPostContext, getCanvasMode, getSettings } = unlock(
|
|
47
|
+
select( editSiteStore )
|
|
133
48
|
);
|
|
134
49
|
const _context = getEditedPostContext();
|
|
135
50
|
return {
|
|
136
|
-
templateSlug: _record.slug,
|
|
137
51
|
canvasMode: getCanvasMode(),
|
|
138
52
|
settings: getSettings(),
|
|
139
|
-
|
|
53
|
+
// TODO: The `postType` check should be removed when the default rendering mode per post type is merged.
|
|
54
|
+
// @see https://github.com/WordPress/gutenberg/pull/62304/
|
|
55
|
+
shouldUseTemplateAsDefaultRenderingMode:
|
|
56
|
+
_context?.postId && _context?.postType !== 'post',
|
|
140
57
|
};
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
);
|
|
144
|
-
const archiveLabels = useArchiveLabel( templateSlug );
|
|
145
|
-
const defaultRenderingMode = postWithTemplate
|
|
58
|
+
}, [] );
|
|
59
|
+
const defaultRenderingMode = shouldUseTemplateAsDefaultRenderingMode
|
|
146
60
|
? 'template-locked'
|
|
147
61
|
: 'post-only';
|
|
148
62
|
const onNavigateToPreviousEntityRecord =
|
|
@@ -157,9 +71,6 @@ export function useSpecificEditorSettings() {
|
|
|
157
71
|
defaultRenderingMode,
|
|
158
72
|
onNavigateToEntityRecord,
|
|
159
73
|
onNavigateToPreviousEntityRecord,
|
|
160
|
-
// I wonder if they should be set in the post editor too
|
|
161
|
-
__experimentalArchiveTitleTypeLabel: archiveLabels.archiveTypeLabel,
|
|
162
|
-
__experimentalArchiveTitleNameLabel: archiveLabels.archiveNameLabel,
|
|
163
74
|
__unstableIsPreviewMode: canvasMode === 'view',
|
|
164
75
|
};
|
|
165
76
|
}, [
|
|
@@ -168,8 +79,6 @@ export function useSpecificEditorSettings() {
|
|
|
168
79
|
defaultRenderingMode,
|
|
169
80
|
onNavigateToEntityRecord,
|
|
170
81
|
onNavigateToPreviousEntityRecord,
|
|
171
|
-
archiveLabels.archiveTypeLabel,
|
|
172
|
-
archiveLabels.archiveNameLabel,
|
|
173
82
|
] );
|
|
174
83
|
|
|
175
84
|
return defaultEditorSettings;
|
|
@@ -40,16 +40,20 @@ import {
|
|
|
40
40
|
useHasEditorCanvasContainer,
|
|
41
41
|
} from '../editor-canvas-container';
|
|
42
42
|
import SaveButton from '../save-button';
|
|
43
|
+
import SavePanel from '../save-panel';
|
|
43
44
|
import SiteEditorMoreMenu from '../more-menu';
|
|
44
45
|
import SiteIcon from '../site-icon';
|
|
45
46
|
import useEditorIframeProps from '../block-editor/use-editor-iframe-props';
|
|
46
47
|
import useEditorTitle from './use-editor-title';
|
|
48
|
+
import { useIsSiteEditorLoading } from '../layout/hooks';
|
|
47
49
|
|
|
48
50
|
const { Editor, BackButton } = unlock( editorPrivateApis );
|
|
49
|
-
const { useHistory } = unlock( routerPrivateApis );
|
|
51
|
+
const { useHistory, useLocation } = unlock( routerPrivateApis );
|
|
50
52
|
const { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );
|
|
51
53
|
|
|
52
|
-
export default function EditSiteEditor( {
|
|
54
|
+
export default function EditSiteEditor( { isPostsList = false } ) {
|
|
55
|
+
const { params } = useLocation();
|
|
56
|
+
const isLoading = useIsSiteEditorLoading();
|
|
53
57
|
const {
|
|
54
58
|
editedPostType,
|
|
55
59
|
editedPostId,
|
|
@@ -199,6 +203,7 @@ export default function EditSiteEditor( { isLoading } ) {
|
|
|
199
203
|
customSaveButton={
|
|
200
204
|
_isPreviewingTheme && <SaveButton size="compact" />
|
|
201
205
|
}
|
|
206
|
+
customSavePanel={ _isPreviewingTheme && <SavePanel /> }
|
|
202
207
|
forceDisableBlockTools={ ! hasDefaultEditorCanvasView }
|
|
203
208
|
title={ title }
|
|
204
209
|
icon={ icon }
|
|
@@ -215,9 +220,20 @@ export default function EditSiteEditor( { isLoading } ) {
|
|
|
215
220
|
<Button
|
|
216
221
|
label={ __( 'Open Navigation' ) }
|
|
217
222
|
className="edit-site-layout__view-mode-toggle"
|
|
218
|
-
onClick={ () =>
|
|
219
|
-
setCanvasMode( 'view' )
|
|
220
|
-
|
|
223
|
+
onClick={ () => {
|
|
224
|
+
setCanvasMode( 'view' );
|
|
225
|
+
// TODO: this is a temporary solution to navigate to the posts list if we are
|
|
226
|
+
// come here through `posts list` and are in focus mode editing a template, template part etc..
|
|
227
|
+
if (
|
|
228
|
+
isPostsList &&
|
|
229
|
+
params?.focusMode
|
|
230
|
+
) {
|
|
231
|
+
history.push( {
|
|
232
|
+
page: 'gutenberg-posts-dashboard',
|
|
233
|
+
postType: 'post',
|
|
234
|
+
} );
|
|
235
|
+
}
|
|
236
|
+
} }
|
|
221
237
|
>
|
|
222
238
|
<SiteIcon className="edit-site-layout__view-mode-toggle-icon" />
|
|
223
239
|
</Button>
|
|
@@ -45,13 +45,6 @@ export default function BackgroundPanel() {
|
|
|
45
45
|
const _links = useGlobalStyleLinks();
|
|
46
46
|
const [ settings ] = useGlobalSetting( '' );
|
|
47
47
|
|
|
48
|
-
const defaultControls = {
|
|
49
|
-
backgroundImage: true,
|
|
50
|
-
backgroundSize:
|
|
51
|
-
hasBackgroundImageValue( style ) ||
|
|
52
|
-
hasBackgroundImageValue( inheritedStyle ),
|
|
53
|
-
};
|
|
54
|
-
|
|
55
48
|
return (
|
|
56
49
|
<StylesBackgroundPanel
|
|
57
50
|
inheritedValue={ inheritedStyle }
|
|
@@ -59,7 +52,6 @@ export default function BackgroundPanel() {
|
|
|
59
52
|
onChange={ setStyle }
|
|
60
53
|
settings={ settings }
|
|
61
54
|
defaultValues={ BACKGROUND_DEFAULT_VALUES }
|
|
62
|
-
defaultControls={ defaultControls }
|
|
63
55
|
themeFileURIs={ _links?.[ 'wp:theme-file' ] }
|
|
64
56
|
/>
|
|
65
57
|
);
|
|
@@ -32,8 +32,15 @@ const BlockPreviewPanel = ( { name, variation = '' } ) => {
|
|
|
32
32
|
return getBlockFromExample( name, example );
|
|
33
33
|
}, [ name, blockExample, variation ] );
|
|
34
34
|
|
|
35
|
-
const viewportWidth = blockExample?.viewportWidth ??
|
|
36
|
-
|
|
35
|
+
const viewportWidth = blockExample?.viewportWidth ?? 500;
|
|
36
|
+
// Same as height of InserterPreviewPanel.
|
|
37
|
+
const previewHeight = 144;
|
|
38
|
+
const sidebarWidth = 235;
|
|
39
|
+
const scale = sidebarWidth / viewportWidth;
|
|
40
|
+
const minHeight =
|
|
41
|
+
scale !== 0 && scale < 1 && previewHeight
|
|
42
|
+
? previewHeight / scale
|
|
43
|
+
: previewHeight;
|
|
37
44
|
|
|
38
45
|
if ( ! blockExample ) {
|
|
39
46
|
return null;
|
|
@@ -49,16 +56,22 @@ const BlockPreviewPanel = ( { name, variation = '' } ) => {
|
|
|
49
56
|
blocks={ blocks }
|
|
50
57
|
viewportWidth={ viewportWidth }
|
|
51
58
|
minHeight={ previewHeight }
|
|
52
|
-
additionalStyles={
|
|
53
|
-
|
|
54
|
-
|
|
59
|
+
additionalStyles={
|
|
60
|
+
//We want this CSS to be in sync with the one in InserterPreviewPanel.
|
|
61
|
+
[
|
|
62
|
+
{
|
|
63
|
+
css: `
|
|
55
64
|
body{
|
|
56
|
-
|
|
57
|
-
|
|
65
|
+
padding: 24px;
|
|
66
|
+
min-height:${ Math.round( minHeight ) }px;
|
|
67
|
+
display:flex;
|
|
68
|
+
align-items:center;
|
|
58
69
|
}
|
|
70
|
+
.is-root-container { width: 100%; }
|
|
59
71
|
`,
|
|
60
|
-
|
|
61
|
-
|
|
72
|
+
},
|
|
73
|
+
]
|
|
74
|
+
}
|
|
62
75
|
/>
|
|
63
76
|
</div>
|
|
64
77
|
</Spacer>
|