@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
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
.edit-site-
|
|
1
|
+
.edit-site-post-list__featured-image {
|
|
2
2
|
height: 100%;
|
|
3
3
|
object-fit: cover;
|
|
4
4
|
width: 100%;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
.edit-site-
|
|
7
|
+
.edit-site-post-list__featured-image-wrapper {
|
|
8
8
|
height: 100%;
|
|
9
9
|
width: 100%;
|
|
10
10
|
border-radius: $grid-unit-05;
|
|
11
11
|
|
|
12
|
-
&.is-layout-table:not(:has(.
|
|
13
|
-
&.is-layout-table .
|
|
12
|
+
&.is-layout-table:not(:has(.edit-site-post-list__featured-image-button)),
|
|
13
|
+
&.is-layout-table .edit-site-post-list__featured-image-button {
|
|
14
14
|
width: $grid-unit-40;
|
|
15
15
|
height: $grid-unit-40;
|
|
16
16
|
display: block;
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
.
|
|
36
|
+
.edit-site-post-list__featured-image-button {
|
|
37
37
|
box-shadow: none;
|
|
38
38
|
border: none;
|
|
39
39
|
padding: 0;
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
overflow: hidden;
|
|
44
44
|
height: 100%;
|
|
45
45
|
width: 100%;
|
|
46
|
-
border-radius:
|
|
46
|
+
border-radius: $grid-unit-05;
|
|
47
47
|
|
|
48
48
|
&:focus-visible {
|
|
49
49
|
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
@@ -52,12 +52,19 @@
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
.
|
|
55
|
+
.dataviews-view-grid__card.is-selected {
|
|
56
|
+
.edit-site-post-list__featured-image-button::after {
|
|
57
|
+
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
58
|
+
background: rgba(var(--wp-admin-theme-color--rgb), 0.04);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.edit-site-post-list__title span {
|
|
56
63
|
text-overflow: ellipsis;
|
|
57
64
|
overflow: hidden;
|
|
58
65
|
}
|
|
59
66
|
|
|
60
|
-
.edit-site-
|
|
67
|
+
.edit-site-post-list__title-badge {
|
|
61
68
|
background: $gray-100;
|
|
62
69
|
color: $gray-700;
|
|
63
70
|
padding: 0 $grid-unit-05;
|
|
@@ -65,4 +72,14 @@
|
|
|
65
72
|
font-size: 12px;
|
|
66
73
|
font-weight: 400;
|
|
67
74
|
flex-shrink: 0;
|
|
75
|
+
line-height: $grid-unit-05 * 5;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.edit-site-post-list__status-icon {
|
|
79
|
+
height: $grid-unit-30;
|
|
80
|
+
width: $grid-unit-30;
|
|
81
|
+
svg {
|
|
82
|
+
fill: currentColor;
|
|
83
|
+
margin-left: -$grid-unit-05;
|
|
84
|
+
}
|
|
68
85
|
}
|
|
@@ -10,29 +10,27 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
|
10
10
|
/**
|
|
11
11
|
* Internal dependencies
|
|
12
12
|
*/
|
|
13
|
+
import useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-entity-from-url';
|
|
13
14
|
import Layout from '../layout';
|
|
14
|
-
import
|
|
15
|
+
import useLayoutAreas from './router';
|
|
15
16
|
import { unlock } from '../../lock-unlock';
|
|
16
17
|
|
|
17
18
|
const { RouterProvider } = unlock( routerPrivateApis );
|
|
18
19
|
const { GlobalStylesProvider } = unlock( editorPrivateApis );
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
mobile: <Page>Welcome to Posts</Page>,
|
|
27
|
-
},
|
|
28
|
-
};
|
|
21
|
+
function PostsLayout() {
|
|
22
|
+
// This ensures the edited entity id and type are initialized properly.
|
|
23
|
+
useInitEditedEntityFromURL();
|
|
24
|
+
const route = useLayoutAreas();
|
|
25
|
+
return <Layout route={ route } />;
|
|
26
|
+
}
|
|
29
27
|
|
|
30
28
|
export default function PostsApp() {
|
|
31
29
|
return (
|
|
32
30
|
<GlobalStylesProvider>
|
|
33
31
|
<UnsavedChangesWarning />
|
|
34
32
|
<RouterProvider>
|
|
35
|
-
<
|
|
33
|
+
<PostsLayout />
|
|
36
34
|
</RouterProvider>
|
|
37
35
|
</GlobalStylesProvider>
|
|
38
36
|
);
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
5
|
+
import { useSelect } from '@wordpress/data';
|
|
6
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
import { unlock } from '../../lock-unlock';
|
|
12
|
+
import Editor from '../editor';
|
|
13
|
+
import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
14
|
+
import SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';
|
|
15
|
+
import DataViewsSidebarContent from '../sidebar-dataviews';
|
|
16
|
+
import PostList from '../post-list';
|
|
17
|
+
|
|
18
|
+
const { useLocation } = unlock( routerPrivateApis );
|
|
19
|
+
|
|
20
|
+
export default function useLayoutAreas() {
|
|
21
|
+
const { params = {} } = useLocation();
|
|
22
|
+
const { postType, layout, canvas } = params;
|
|
23
|
+
const labels = useSelect(
|
|
24
|
+
( select ) => {
|
|
25
|
+
return select( coreStore ).getPostType( postType )?.labels;
|
|
26
|
+
},
|
|
27
|
+
[ postType ]
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
// Posts list.
|
|
31
|
+
if ( [ 'post' ].includes( postType ) ) {
|
|
32
|
+
const isListLayout = layout === 'list' || ! layout;
|
|
33
|
+
return {
|
|
34
|
+
key: 'posts-list',
|
|
35
|
+
areas: {
|
|
36
|
+
sidebar: (
|
|
37
|
+
<SidebarNavigationScreen
|
|
38
|
+
title={ labels?.name }
|
|
39
|
+
isRoot
|
|
40
|
+
content={ <DataViewsSidebarContent /> }
|
|
41
|
+
/>
|
|
42
|
+
),
|
|
43
|
+
content: <PostList postType={ postType } />,
|
|
44
|
+
preview: ( isListLayout || canvas === 'edit' ) && (
|
|
45
|
+
<Editor isPostsList />
|
|
46
|
+
),
|
|
47
|
+
mobile:
|
|
48
|
+
canvas === 'edit' ? (
|
|
49
|
+
<Editor isPostsList />
|
|
50
|
+
) : (
|
|
51
|
+
<PostList postType={ postType } />
|
|
52
|
+
),
|
|
53
|
+
},
|
|
54
|
+
widths: {
|
|
55
|
+
content: isListLayout ? 380 : undefined,
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Fallback shows the home page preview
|
|
61
|
+
return {
|
|
62
|
+
key: 'default',
|
|
63
|
+
areas: {
|
|
64
|
+
sidebar: <SidebarNavigationScreenMain />,
|
|
65
|
+
preview: <Editor isPostsList />,
|
|
66
|
+
mobile: canvas === 'edit' && <Editor isPostsList />,
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
}
|
|
@@ -25,6 +25,7 @@ const {
|
|
|
25
25
|
ExperimentalBlockEditorProvider,
|
|
26
26
|
GlobalStylesContext,
|
|
27
27
|
useGlobalStylesOutputWithConfig,
|
|
28
|
+
__unstableBlockStyleVariationOverridesWithConfig,
|
|
28
29
|
} = unlock( blockEditorPrivateApis );
|
|
29
30
|
const { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );
|
|
30
31
|
|
|
@@ -74,7 +75,6 @@ function Revisions( { userConfig, blocks } ) {
|
|
|
74
75
|
name="revisions"
|
|
75
76
|
tabIndex={ 0 }
|
|
76
77
|
>
|
|
77
|
-
<EditorStyles styles={ editorStyles } />
|
|
78
78
|
<style>
|
|
79
79
|
{
|
|
80
80
|
// Forming a "block formatting context" to prevent margin collapsing.
|
|
@@ -88,6 +88,14 @@ function Revisions( { userConfig, blocks } ) {
|
|
|
88
88
|
settings={ settings }
|
|
89
89
|
>
|
|
90
90
|
<BlockList renderAppender={ false } />
|
|
91
|
+
{ /*
|
|
92
|
+
* Styles are printed inside the block editor provider,
|
|
93
|
+
* so they can access any registered style overrides.
|
|
94
|
+
*/ }
|
|
95
|
+
<EditorStyles styles={ editorStyles } />
|
|
96
|
+
<__unstableBlockStyleVariationOverridesWithConfig
|
|
97
|
+
config={ mergedConfig }
|
|
98
|
+
/>
|
|
91
99
|
</ExperimentalBlockEditorProvider>
|
|
92
100
|
</Disabled>
|
|
93
101
|
</Iframe>
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
.edit-site-sidebar__content {
|
|
2
2
|
flex-grow: 1;
|
|
3
3
|
overflow-y: auto;
|
|
4
|
+
// Prevents horizontal overflow while animating screen transitions
|
|
5
|
+
overflow-x: hidden;
|
|
6
|
+
// Mark this section of the DOM as isolated, providing performance benefits
|
|
7
|
+
// by limiting calculations of layout, style and paint to a DOM subtree rather
|
|
8
|
+
// than the entire page.
|
|
9
|
+
contain: content;
|
|
4
10
|
}
|
|
5
11
|
|
|
6
12
|
@keyframes local--slide-from-right {
|
|
@@ -19,7 +19,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
|
19
19
|
* Internal dependencies
|
|
20
20
|
*/
|
|
21
21
|
import SidebarNavigationItem from '../sidebar-navigation-item';
|
|
22
|
-
import {
|
|
22
|
+
import { useDefaultViews } from './default-views';
|
|
23
23
|
import { unlock } from '../../lock-unlock';
|
|
24
24
|
|
|
25
25
|
const { useHistory } = unlock( routerPrivateApis );
|
|
@@ -29,6 +29,7 @@ function AddNewItemModalContent( { type, setIsAdding } ) {
|
|
|
29
29
|
const { saveEntityRecord } = useDispatch( coreStore );
|
|
30
30
|
const [ title, setTitle ] = useState( '' );
|
|
31
31
|
const [ isSaving, setIsSaving ] = useState( false );
|
|
32
|
+
const DEFAULT_VIEWS = useDefaultViews( { postType: type } );
|
|
32
33
|
return (
|
|
33
34
|
<form
|
|
34
35
|
onSubmit={ async ( event ) => {
|
|
@@ -61,6 +61,7 @@ function RenameItemModalContent( { dataviewId, currentTitle, setIsRenaming } ) {
|
|
|
61
61
|
<HStack justify="right">
|
|
62
62
|
<Button
|
|
63
63
|
variant="tertiary"
|
|
64
|
+
__next40pxDefaultSize
|
|
64
65
|
onClick={ () => {
|
|
65
66
|
setIsRenaming( false );
|
|
66
67
|
} }
|
|
@@ -71,8 +72,9 @@ function RenameItemModalContent( { dataviewId, currentTitle, setIsRenaming } ) {
|
|
|
71
72
|
variant="primary"
|
|
72
73
|
type="submit"
|
|
73
74
|
aria-disabled={ ! title }
|
|
75
|
+
__next40pxDefaultSize
|
|
74
76
|
>
|
|
75
|
-
{ __( '
|
|
77
|
+
{ __( 'Save' ) }
|
|
76
78
|
</Button>
|
|
77
79
|
</HStack>
|
|
78
80
|
</VStack>
|
|
@@ -160,10 +162,12 @@ function CustomDataViewItem( { dataviewId, isActive } ) {
|
|
|
160
162
|
/>
|
|
161
163
|
{ isRenaming && (
|
|
162
164
|
<Modal
|
|
163
|
-
title={ __( 'Rename
|
|
165
|
+
title={ __( 'Rename' ) }
|
|
164
166
|
onRequestClose={ () => {
|
|
165
167
|
setIsRenaming( false );
|
|
166
168
|
} }
|
|
169
|
+
focusOnMount="firstContentElement"
|
|
170
|
+
size="small"
|
|
167
171
|
>
|
|
168
172
|
<RenameItemModalContent
|
|
169
173
|
dataviewId={ dataviewId }
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
+
|
|
5
6
|
import {
|
|
6
7
|
trash,
|
|
7
8
|
pages,
|
|
@@ -11,6 +12,9 @@ import {
|
|
|
11
12
|
pending,
|
|
12
13
|
notAllowed,
|
|
13
14
|
} from '@wordpress/icons';
|
|
15
|
+
import { useSelect } from '@wordpress/data';
|
|
16
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
17
|
+
import { useMemo } from '@wordpress/element';
|
|
14
18
|
|
|
15
19
|
/**
|
|
16
20
|
* Internal dependencies
|
|
@@ -22,21 +26,35 @@ import {
|
|
|
22
26
|
OPERATOR_IS_ANY,
|
|
23
27
|
} from '../../utils/constants';
|
|
24
28
|
|
|
25
|
-
export const
|
|
29
|
+
export const defaultLayouts = {
|
|
26
30
|
[ LAYOUT_TABLE ]: {
|
|
27
|
-
|
|
31
|
+
layout: {
|
|
32
|
+
primaryField: 'title',
|
|
33
|
+
styles: {
|
|
34
|
+
'featured-image': {
|
|
35
|
+
width: '1%',
|
|
36
|
+
},
|
|
37
|
+
title: {
|
|
38
|
+
maxWidth: 300,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
28
42
|
},
|
|
29
43
|
[ LAYOUT_GRID ]: {
|
|
30
|
-
|
|
31
|
-
|
|
44
|
+
layout: {
|
|
45
|
+
mediaField: 'featured-image',
|
|
46
|
+
primaryField: 'title',
|
|
47
|
+
},
|
|
32
48
|
},
|
|
33
49
|
[ LAYOUT_LIST ]: {
|
|
34
|
-
|
|
35
|
-
|
|
50
|
+
layout: {
|
|
51
|
+
primaryField: 'title',
|
|
52
|
+
mediaField: 'featured-image',
|
|
53
|
+
},
|
|
36
54
|
},
|
|
37
55
|
};
|
|
38
56
|
|
|
39
|
-
const
|
|
57
|
+
const DEFAULT_POST_BASE = {
|
|
40
58
|
type: LAYOUT_LIST,
|
|
41
59
|
search: '',
|
|
42
60
|
filters: [],
|
|
@@ -46,111 +64,118 @@ const DEFAULT_PAGE_BASE = {
|
|
|
46
64
|
field: 'date',
|
|
47
65
|
direction: 'desc',
|
|
48
66
|
},
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
hiddenFields: [ 'date', 'featured-image' ],
|
|
52
|
-
layout: {
|
|
53
|
-
...DEFAULT_CONFIG_PER_VIEW_TYPE[ LAYOUT_LIST ],
|
|
54
|
-
},
|
|
67
|
+
fields: [ 'title', 'author', 'status' ],
|
|
68
|
+
layout: defaultLayouts[ LAYOUT_LIST ].layout,
|
|
55
69
|
};
|
|
56
70
|
|
|
57
|
-
export
|
|
58
|
-
|
|
59
|
-
{
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
icon: pages,
|
|
63
|
-
view: DEFAULT_PAGE_BASE,
|
|
71
|
+
export function useDefaultViews( { postType } ) {
|
|
72
|
+
const labels = useSelect(
|
|
73
|
+
( select ) => {
|
|
74
|
+
const { getPostType } = select( coreStore );
|
|
75
|
+
return getPostType( postType )?.labels;
|
|
64
76
|
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
77
|
+
[ postType ]
|
|
78
|
+
);
|
|
79
|
+
return useMemo( () => {
|
|
80
|
+
return {
|
|
81
|
+
[ postType ]: [
|
|
82
|
+
{
|
|
83
|
+
title: labels?.all_items || __( 'All items' ),
|
|
84
|
+
slug: 'all',
|
|
85
|
+
icon: pages,
|
|
86
|
+
view: DEFAULT_POST_BASE,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
title: __( 'Published' ),
|
|
90
|
+
slug: 'published',
|
|
91
|
+
icon: published,
|
|
92
|
+
view: {
|
|
93
|
+
...DEFAULT_POST_BASE,
|
|
94
|
+
filters: [
|
|
95
|
+
{
|
|
96
|
+
field: 'status',
|
|
97
|
+
operator: OPERATOR_IS_ANY,
|
|
98
|
+
value: 'publish',
|
|
99
|
+
},
|
|
100
|
+
],
|
|
76
101
|
},
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
title: __( 'Scheduled' ),
|
|
105
|
+
slug: 'future',
|
|
106
|
+
icon: scheduled,
|
|
107
|
+
view: {
|
|
108
|
+
...DEFAULT_POST_BASE,
|
|
109
|
+
filters: [
|
|
110
|
+
{
|
|
111
|
+
field: 'status',
|
|
112
|
+
operator: OPERATOR_IS_ANY,
|
|
113
|
+
value: 'future',
|
|
114
|
+
},
|
|
115
|
+
],
|
|
91
116
|
},
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
title: __( 'Drafts' ),
|
|
120
|
+
slug: 'drafts',
|
|
121
|
+
icon: drafts,
|
|
122
|
+
view: {
|
|
123
|
+
...DEFAULT_POST_BASE,
|
|
124
|
+
filters: [
|
|
125
|
+
{
|
|
126
|
+
field: 'status',
|
|
127
|
+
operator: OPERATOR_IS_ANY,
|
|
128
|
+
value: 'draft',
|
|
129
|
+
},
|
|
130
|
+
],
|
|
106
131
|
},
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
title: __( 'Pending' ),
|
|
135
|
+
slug: 'pending',
|
|
136
|
+
icon: pending,
|
|
137
|
+
view: {
|
|
138
|
+
...DEFAULT_POST_BASE,
|
|
139
|
+
filters: [
|
|
140
|
+
{
|
|
141
|
+
field: 'status',
|
|
142
|
+
operator: OPERATOR_IS_ANY,
|
|
143
|
+
value: 'pending',
|
|
144
|
+
},
|
|
145
|
+
],
|
|
121
146
|
},
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
title: __( 'Private' ),
|
|
150
|
+
slug: 'private',
|
|
151
|
+
icon: notAllowed,
|
|
152
|
+
view: {
|
|
153
|
+
...DEFAULT_POST_BASE,
|
|
154
|
+
filters: [
|
|
155
|
+
{
|
|
156
|
+
field: 'status',
|
|
157
|
+
operator: OPERATOR_IS_ANY,
|
|
158
|
+
value: 'private',
|
|
159
|
+
},
|
|
160
|
+
],
|
|
136
161
|
},
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
title: __( 'Trash' ),
|
|
165
|
+
slug: 'trash',
|
|
166
|
+
icon: trash,
|
|
167
|
+
view: {
|
|
168
|
+
...DEFAULT_POST_BASE,
|
|
169
|
+
filters: [
|
|
170
|
+
{
|
|
171
|
+
field: 'status',
|
|
172
|
+
operator: OPERATOR_IS_ANY,
|
|
173
|
+
value: 'trash',
|
|
174
|
+
},
|
|
175
|
+
],
|
|
151
176
|
},
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
]
|
|
156
|
-
}
|
|
177
|
+
},
|
|
178
|
+
],
|
|
179
|
+
};
|
|
180
|
+
}, [ labels, postType ] );
|
|
181
|
+
}
|
|
@@ -2,22 +2,57 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __experimentalItemGroup as ItemGroup } from '@wordpress/components';
|
|
5
|
-
|
|
6
5
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
6
|
+
import { useRef, useEffect } from '@wordpress/element';
|
|
7
|
+
import { usePrevious } from '@wordpress/compose';
|
|
8
|
+
|
|
7
9
|
/**
|
|
8
10
|
* Internal dependencies
|
|
9
11
|
*/
|
|
10
|
-
|
|
11
|
-
import { DEFAULT_VIEWS } from './default-views';
|
|
12
|
+
import { useDefaultViews } from './default-views';
|
|
12
13
|
import { unlock } from '../../lock-unlock';
|
|
13
|
-
const { useLocation } = unlock( routerPrivateApis );
|
|
14
14
|
import DataViewItem from './dataview-item';
|
|
15
15
|
import CustomDataViewsList from './custom-dataviews-list';
|
|
16
16
|
|
|
17
|
+
const { useLocation, useHistory } = unlock( routerPrivateApis );
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Hook to switch to table layout when switching to the trash view.
|
|
21
|
+
* When going out of the trash view, it switches back to the previous layout if
|
|
22
|
+
* there was an automatic switch to table layout.
|
|
23
|
+
*/
|
|
24
|
+
function useSwitchToTableOnTrash() {
|
|
25
|
+
const {
|
|
26
|
+
params: { activeView, layout, ...restParams },
|
|
27
|
+
} = useLocation();
|
|
28
|
+
const history = useHistory();
|
|
29
|
+
const viewToSwitchOutOfTrash = useRef( undefined );
|
|
30
|
+
const previousActiveView = usePrevious( activeView );
|
|
31
|
+
useEffect( () => {
|
|
32
|
+
if ( activeView === 'trash' && previousActiveView !== 'trash' ) {
|
|
33
|
+
viewToSwitchOutOfTrash.current = layout || 'list';
|
|
34
|
+
history.push( { ...restParams, layout: 'table', activeView } );
|
|
35
|
+
} else if (
|
|
36
|
+
previousActiveView === 'trash' &&
|
|
37
|
+
activeView !== 'trash' &&
|
|
38
|
+
viewToSwitchOutOfTrash.current
|
|
39
|
+
) {
|
|
40
|
+
history.push( {
|
|
41
|
+
...restParams,
|
|
42
|
+
layout: viewToSwitchOutOfTrash.current,
|
|
43
|
+
activeView,
|
|
44
|
+
} );
|
|
45
|
+
viewToSwitchOutOfTrash.current = undefined;
|
|
46
|
+
}
|
|
47
|
+
}, [ previousActiveView, activeView, layout, history, restParams ] );
|
|
48
|
+
}
|
|
49
|
+
|
|
17
50
|
export default function DataViewsSidebarContent() {
|
|
18
51
|
const {
|
|
19
52
|
params: { postType, activeView = 'all', isCustom = 'false' },
|
|
20
53
|
} = useLocation();
|
|
54
|
+
useSwitchToTableOnTrash();
|
|
55
|
+
const DEFAULT_VIEWS = useDefaultViews( { postType } );
|
|
21
56
|
if ( ! postType ) {
|
|
22
57
|
return null;
|
|
23
58
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
import { useSelect } from '@wordpress/data';
|
|
6
|
+
import { __experimentalVStack as VStack } from '@wordpress/components';
|
|
7
|
+
import { BlockEditorProvider } from '@wordpress/block-editor';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Internal dependencies
|
|
11
|
+
*/
|
|
12
|
+
import StyleVariationsContainer from '../global-styles/style-variations-container';
|
|
13
|
+
import { unlock } from '../../lock-unlock';
|
|
14
|
+
import { store as editSiteStore } from '../../store';
|
|
15
|
+
import ColorVariations from '../global-styles/variations/variations-color';
|
|
16
|
+
import TypographyVariations from '../global-styles/variations/variations-typography';
|
|
17
|
+
|
|
18
|
+
const noop = () => {};
|
|
19
|
+
|
|
20
|
+
export default function SidebarNavigationScreenGlobalStylesContent() {
|
|
21
|
+
const { storedSettings } = useSelect( ( select ) => {
|
|
22
|
+
const { getSettings } = unlock( select( editSiteStore ) );
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
storedSettings: getSettings(),
|
|
26
|
+
};
|
|
27
|
+
}, [] );
|
|
28
|
+
|
|
29
|
+
const gap = 3;
|
|
30
|
+
|
|
31
|
+
// Wrap in a BlockEditorProvider to ensure that the Iframe's dependencies are
|
|
32
|
+
// loaded. This is necessary because the Iframe component waits until
|
|
33
|
+
// the block editor store's `__internalIsInitialized` is true before
|
|
34
|
+
// rendering the iframe. Without this, the iframe previews will not render
|
|
35
|
+
// in mobile viewport sizes, where the editor canvas is hidden.
|
|
36
|
+
return (
|
|
37
|
+
<BlockEditorProvider
|
|
38
|
+
settings={ storedSettings }
|
|
39
|
+
onChange={ noop }
|
|
40
|
+
onInput={ noop }
|
|
41
|
+
>
|
|
42
|
+
<VStack
|
|
43
|
+
spacing={ 10 }
|
|
44
|
+
className="edit-site-global-styles-variation-container"
|
|
45
|
+
>
|
|
46
|
+
<StyleVariationsContainer gap={ gap } />
|
|
47
|
+
<ColorVariations title={ __( 'Palettes' ) } gap={ gap } />
|
|
48
|
+
<TypographyVariations
|
|
49
|
+
title={ __( 'Typography' ) }
|
|
50
|
+
gap={ gap }
|
|
51
|
+
/>
|
|
52
|
+
</VStack>
|
|
53
|
+
</BlockEditorProvider>
|
|
54
|
+
);
|
|
55
|
+
}
|