@wordpress/edit-site 6.3.0 → 6.5.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 +14 -3
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/add-new-post/index.js +2 -1
- package/build/components/add-new-post/index.js.map +1 -1
- package/build/components/add-new-template/index.js +3 -1
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/add-new-template/utils.js +2 -2
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js +1 -82
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/editor/index.js +71 -20
- package/build/components/editor/index.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 +40 -22
- package/build/components/global-styles/font-families.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +0 -5
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +25 -5
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/index.js +5 -12
- package/build/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +78 -15
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js +2 -3
- package/build/components/global-styles/font-library-modal/upload-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/screen-block.js +10 -8
- package/build/components/global-styles/screen-block.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-typeset.js +40 -0
- package/build/components/global-styles/screen-typeset.js.map +1 -0
- package/build/components/global-styles/screen-typography-element.js +14 -0
- package/build/components/global-styles/screen-typography-element.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +5 -6
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/shadows-edit-panel.js +50 -59
- 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 +3 -0
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/typeset-button.js +97 -0
- package/build/components/global-styles/typeset-button.js.map +1 -0
- package/build/components/global-styles/typeset.js +80 -0
- package/build/components/global-styles/typeset.js.map +1 -0
- package/build/components/global-styles/ui.js +12 -0
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/utils.js +10 -1
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/global-styles/variations/variations-color.js.map +1 -1
- package/build/components/global-styles/variations/variations-typography.js +1 -1
- package/build/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build/components/layout/index.js +6 -0
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/router.js +14 -6
- package/build/components/layout/router.js.map +1 -1
- package/build/components/page-patterns/fields.js +230 -0
- package/build/components/page-patterns/fields.js.map +1 -0
- 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 +21 -227
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +26 -1
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-templates/fields.js +169 -0
- package/build/components/page-templates/fields.js.map +1 -0
- package/build/components/page-templates/index.js +38 -198
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/post-edit/index.js +117 -0
- package/build/components/post-edit/index.js.map +1 -0
- package/build/components/post-fields/index.js +318 -0
- package/build/components/post-fields/index.js.map +1 -0
- package/build/components/post-list/index.js +339 -0
- package/build/components/post-list/index.js.map +1 -0
- package/build/components/posts-app/router.js +3 -3
- package/build/components/posts-app/router.js.map +1 -1
- package/build/components/sidebar-dataviews/add-new-view.js +2 -2
- package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build/components/sidebar-dataviews/dataview-item.js +2 -3
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +103 -91
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +2 -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/site-hub/index.js +6 -3
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/style-book/index.js +22 -25
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +5 -0
- 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 +3 -4
- 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 +2 -4
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build/index.js +4 -2
- package/build/index.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 +14 -3
- package/build-module/components/add-new-pattern/index.js.map +1 -1
- package/build-module/components/add-new-post/index.js +2 -1
- package/build-module/components/add-new-post/index.js.map +1 -1
- 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/add-new-template/utils.js +2 -2
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +1 -82
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/editor/index.js +73 -22
- package/build-module/components/editor/index.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 +42 -24
- package/build-module/components/global-styles/font-families.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +0 -5
- package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +26 -6
- 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 +5 -12
- 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 +81 -18
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js +2 -3
- package/build-module/components/global-styles/font-library-modal/upload-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/screen-block.js +10 -8
- package/build-module/components/global-styles/screen-block.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-typeset.js +34 -0
- package/build-module/components/global-styles/screen-typeset.js.map +1 -0
- package/build-module/components/global-styles/screen-typography-element.js +14 -0
- package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +5 -6
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/shadows-edit-panel.js +51 -60
- 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 +3 -0
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/typeset-button.js +89 -0
- package/build-module/components/global-styles/typeset-button.js.map +1 -0
- package/build-module/components/global-styles/typeset.js +71 -0
- package/build-module/components/global-styles/typeset.js.map +1 -0
- package/build-module/components/global-styles/ui.js +12 -0
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/utils.js +10 -1
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-color.js +1 -1
- package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-typography.js +1 -2
- package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build-module/components/layout/index.js +6 -0
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/router.js +14 -6
- package/build-module/components/layout/router.js.map +1 -1
- package/build-module/components/page-patterns/fields.js +223 -0
- package/build-module/components/page-patterns/fields.js.map +1 -0
- 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 +24 -230
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +26 -1
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-templates/fields.js +160 -0
- package/build-module/components/page-templates/fields.js.map +1 -0
- package/build-module/components/page-templates/index.js +39 -199
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/post-edit/index.js +110 -0
- package/build-module/components/post-edit/index.js.map +1 -0
- package/build-module/components/post-fields/index.js +310 -0
- package/build-module/components/post-fields/index.js.map +1 -0
- package/build-module/components/post-list/index.js +333 -0
- package/build-module/components/post-list/index.js.map +1 -0
- package/build-module/components/posts-app/router.js +3 -3
- package/build-module/components/posts-app/router.js.map +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js +2 -2
- package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js +2 -3
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +102 -90
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +5 -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/site-hub/index.js +7 -4
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/style-book/index.js +23 -26
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +5 -0
- 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 +3 -4
- 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 +2 -3
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build-module/index.js +4 -2
- package/build-module/index.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 +749 -492
- package/build-style/posts.css +749 -492
- package/build-style/style-rtl.css +956 -613
- package/build-style/style.css +956 -613
- package/package.json +41 -41
- package/src/components/add-new-pattern/index.js +16 -5
- package/src/components/add-new-post/index.js +2 -1
- package/src/components/add-new-template/index.js +4 -1
- package/src/components/add-new-template/style.scss +4 -6
- package/src/components/add-new-template/utils.js +10 -6
- package/src/components/block-editor/use-site-editor-settings.js +15 -111
- package/src/components/editor/index.js +80 -22
- package/src/components/editor/style.scss +59 -1
- package/src/components/global-styles/block-preview-panel.js +22 -9
- package/src/components/global-styles/font-families.js +65 -32
- package/src/components/global-styles/font-library-modal/context.js +0 -5
- package/src/components/global-styles/font-library-modal/font-collection.js +34 -10
- package/src/components/global-styles/font-library-modal/index.js +6 -9
- package/src/components/global-styles/font-library-modal/installed-fonts.js +115 -16
- package/src/components/global-styles/font-library-modal/style.scss +9 -0
- package/src/components/global-styles/font-library-modal/upload-fonts.js +2 -2
- 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/screen-block.js +12 -14
- package/src/components/global-styles/screen-style-variations.js +2 -2
- package/src/components/global-styles/screen-typeset.js +42 -0
- package/src/components/global-styles/screen-typography-element.js +14 -0
- package/src/components/global-styles/screen-typography.js +7 -6
- package/src/components/global-styles/shadows-edit-panel.js +66 -73
- package/src/components/global-styles/size-control/index.js +86 -0
- package/src/components/global-styles/style-variations-container.js +4 -0
- package/src/components/global-styles/style.scss +17 -10
- package/src/components/global-styles/typeset-button.js +93 -0
- package/src/components/global-styles/typeset.js +73 -0
- package/src/components/global-styles/ui.js +15 -0
- package/src/components/global-styles/utils.js +13 -1
- package/src/components/global-styles/variations/variations-color.js +1 -1
- package/src/components/global-styles/variations/variations-typography.js +1 -2
- package/src/components/layout/index.js +11 -0
- package/src/components/layout/router.js +13 -5
- package/src/components/layout/style.scss +34 -8
- package/src/components/page-patterns/fields.js +251 -0
- package/src/components/page-patterns/header.js +1 -1
- package/src/components/page-patterns/index.js +24 -246
- package/src/components/page-patterns/style.scss +82 -85
- package/src/components/page-patterns/use-patterns.js +31 -1
- package/src/components/page-templates/fields.js +157 -0
- package/src/components/page-templates/index.js +46 -192
- package/src/components/page-templates/style.scss +19 -8
- package/src/components/post-edit/index.js +115 -0
- package/src/components/post-edit/style.scss +9 -0
- package/src/components/post-fields/index.js +357 -0
- package/src/components/post-list/index.js +386 -0
- package/src/components/{posts-app → post-list}/style.scss +12 -9
- package/src/components/posts-app/router.js +3 -3
- package/src/components/sidebar-dataviews/add-new-view.js +2 -4
- package/src/components/sidebar-dataviews/dataview-item.js +2 -2
- package/src/components/sidebar-dataviews/default-views.js +116 -104
- package/src/components/sidebar-dataviews/index.js +4 -3
- package/src/components/sidebar-navigation-screen-global-styles/content.js +55 -0
- package/src/components/sidebar-navigation-screen-global-styles/index.js +1 -55
- package/src/components/site-hub/index.js +11 -2
- package/src/components/site-icon/style.scss +4 -1
- package/src/components/style-book/index.js +27 -32
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +5 -0
- package/src/hooks/push-changes-to-global-styles/index.js +3 -4
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +2 -3
- package/src/index.js +6 -2
- package/src/posts.scss +1 -1
- package/src/store/selectors.js +53 -14
- package/src/store/test/selectors.js +1 -26
- package/src/style.scss +2 -1
- package/src/utils/get-filtered-template-parts.js +61 -0
- package/src/utils/test/get-filtered-template-parts.js +127 -0
- package/build/components/global-styles/screen-background.js +0 -36
- package/build/components/global-styles/screen-background.js.map +0 -1
- package/build/components/posts-app/posts-list.js +0 -568
- package/build/components/posts-app/posts-list.js.map +0 -1
- package/build/utils/clone-deep.js +0 -15
- package/build/utils/clone-deep.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/posts-app/posts-list.js +0 -560
- package/build-module/components/posts-app/posts-list.js.map +0 -1
- package/build-module/utils/clone-deep.js +0 -9
- package/build-module/utils/clone-deep.js.map +0 -1
- package/src/components/global-styles/screen-background.js +0 -29
- package/src/components/posts-app/posts-list.js +0 -651
- package/src/utils/clone-deep.js +0 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-site",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.5.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": "^
|
|
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.5.0",
|
|
33
|
+
"@wordpress/api-fetch": "^7.5.0",
|
|
34
|
+
"@wordpress/blob": "^4.5.0",
|
|
35
|
+
"@wordpress/block-editor": "^14.0.0",
|
|
36
|
+
"@wordpress/block-library": "^9.5.0",
|
|
37
|
+
"@wordpress/blocks": "^13.5.0",
|
|
38
|
+
"@wordpress/commands": "^1.5.0",
|
|
39
|
+
"@wordpress/components": "^28.5.0",
|
|
40
|
+
"@wordpress/compose": "^7.5.0",
|
|
41
|
+
"@wordpress/core-commands": "^1.5.0",
|
|
42
|
+
"@wordpress/core-data": "^7.5.0",
|
|
43
|
+
"@wordpress/data": "^10.5.0",
|
|
44
|
+
"@wordpress/dataviews": "^4.1.0",
|
|
45
|
+
"@wordpress/date": "^5.5.0",
|
|
46
|
+
"@wordpress/deprecated": "^4.5.0",
|
|
47
|
+
"@wordpress/dom": "^4.5.0",
|
|
48
|
+
"@wordpress/editor": "^14.5.0",
|
|
49
|
+
"@wordpress/element": "^6.5.0",
|
|
50
|
+
"@wordpress/escape-html": "^3.5.0",
|
|
51
|
+
"@wordpress/hooks": "^4.5.0",
|
|
52
|
+
"@wordpress/html-entities": "^4.5.0",
|
|
53
|
+
"@wordpress/i18n": "^5.5.0",
|
|
54
|
+
"@wordpress/icons": "^10.5.0",
|
|
55
|
+
"@wordpress/keyboard-shortcuts": "^5.5.0",
|
|
56
|
+
"@wordpress/keycodes": "^4.5.0",
|
|
57
|
+
"@wordpress/notices": "^5.5.0",
|
|
58
|
+
"@wordpress/patterns": "^2.5.0",
|
|
59
|
+
"@wordpress/plugins": "^7.5.0",
|
|
60
|
+
"@wordpress/preferences": "^4.5.0",
|
|
61
|
+
"@wordpress/primitives": "^4.5.0",
|
|
62
|
+
"@wordpress/priority-queue": "^3.5.0",
|
|
63
|
+
"@wordpress/private-apis": "^1.5.0",
|
|
64
|
+
"@wordpress/reusable-blocks": "^5.5.0",
|
|
65
|
+
"@wordpress/router": "^1.5.0",
|
|
66
|
+
"@wordpress/style-engine": "^2.5.0",
|
|
67
|
+
"@wordpress/url": "^4.5.0",
|
|
68
|
+
"@wordpress/viewport": "^6.5.0",
|
|
69
|
+
"@wordpress/widgets": "^4.5.0",
|
|
70
|
+
"@wordpress/wordcount": "^4.5.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": "c3101ab024e2bfc85d525c6d247e0d57cafc9fd9"
|
|
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
|
|
|
@@ -167,9 +173,14 @@ export default function AddNewPattern() {
|
|
|
167
173
|
// When we're not handling template parts, we should
|
|
168
174
|
// add or create the proper pattern category.
|
|
169
175
|
if ( postType !== TEMPLATE_PART_POST_TYPE ) {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
176
|
+
/*
|
|
177
|
+
* categoryMap.values() returns an iterator.
|
|
178
|
+
* Iterator.prototype.find() is not yet widely supported.
|
|
179
|
+
* Convert to array to use the Array.prototype.find method.
|
|
180
|
+
*/
|
|
181
|
+
const currentCategory = Array.from(
|
|
182
|
+
categoryMap.values()
|
|
183
|
+
).find( ( term ) => term.name === categoryId );
|
|
173
184
|
if ( currentCategory ) {
|
|
174
185
|
currentCategoryId =
|
|
175
186
|
currentCategory.id ||
|
|
@@ -95,9 +95,10 @@ export default function AddNewPostModal( { postType, onSave, onClose } ) {
|
|
|
95
95
|
size="small"
|
|
96
96
|
>
|
|
97
97
|
<form onSubmit={ createPost }>
|
|
98
|
-
<VStack spacing={
|
|
98
|
+
<VStack spacing={ 4 }>
|
|
99
99
|
<TextControl
|
|
100
100
|
__next40pxDefaultSize
|
|
101
|
+
__nextHasNoMarginBottom
|
|
101
102
|
label={ __( 'Title' ) }
|
|
102
103
|
onChange={ setTitle }
|
|
103
104
|
placeholder={ __( 'No title' ) }
|
|
@@ -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
|
|
|
@@ -166,9 +166,11 @@ export function usePostTypeArchiveMenuItems() {
|
|
|
166
166
|
// `icon` is the `menu_icon` property of a post type. We
|
|
167
167
|
// only handle `dashicons` for now, even if the `menu_icon`
|
|
168
168
|
// also supports urls and svg as values.
|
|
169
|
-
icon:
|
|
170
|
-
|
|
171
|
-
|
|
169
|
+
icon:
|
|
170
|
+
typeof postType.icon === 'string' &&
|
|
171
|
+
postType.icon.startsWith( 'dashicons-' )
|
|
172
|
+
? postType.icon.slice( 10 )
|
|
173
|
+
: archive,
|
|
172
174
|
templatePrefix: 'archive',
|
|
173
175
|
};
|
|
174
176
|
} ) || [],
|
|
@@ -272,9 +274,11 @@ export const usePostTypeMenuItems = ( onClickMenuItem ) => {
|
|
|
272
274
|
// `icon` is the `menu_icon` property of a post type. We
|
|
273
275
|
// only handle `dashicons` for now, even if the `menu_icon`
|
|
274
276
|
// also supports urls and svg as values.
|
|
275
|
-
icon:
|
|
276
|
-
|
|
277
|
-
|
|
277
|
+
icon:
|
|
278
|
+
typeof icon === 'string' &&
|
|
279
|
+
icon.startsWith( 'dashicons-' )
|
|
280
|
+
? icon.slice( 10 )
|
|
281
|
+
: post,
|
|
278
282
|
templatePrefix: templatePrefixes[ slug ],
|
|
279
283
|
};
|
|
280
284
|
const hasEntities = postTypesInfo?.[ slug ]?.hasEntities;
|
|
@@ -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,39 +41,21 @@ function useNavigateToPreviousEntityRecord() {
|
|
|
114
41
|
|
|
115
42
|
export function useSpecificEditorSettings() {
|
|
116
43
|
const onNavigateToEntityRecord = useNavigateToEntityRecord();
|
|
117
|
-
const {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
const usedPostId = getEditedPostId();
|
|
133
|
-
const _record = getEditedEntityRecord(
|
|
134
|
-
'postType',
|
|
135
|
-
usedPostType,
|
|
136
|
-
usedPostId
|
|
137
|
-
);
|
|
138
|
-
const _context = getEditedPostContext();
|
|
139
|
-
return {
|
|
140
|
-
templateSlug: _record.slug,
|
|
141
|
-
canvasMode: getCanvasMode(),
|
|
142
|
-
settings: getSettings(),
|
|
143
|
-
// TODO: The `postType` check should be removed when the default rendering mode per post type is merged.
|
|
144
|
-
// @see https://github.com/WordPress/gutenberg/pull/62304/
|
|
145
|
-
shouldUseTemplateAsDefaultRenderingMode:
|
|
146
|
-
_context?.postId && _context?.postType !== 'post',
|
|
147
|
-
};
|
|
148
|
-
}, [] );
|
|
149
|
-
const archiveLabels = useArchiveLabel( templateSlug );
|
|
44
|
+
const { canvasMode, settings, shouldUseTemplateAsDefaultRenderingMode } =
|
|
45
|
+
useSelect( ( select ) => {
|
|
46
|
+
const { getEditedPostContext, getCanvasMode, getSettings } = unlock(
|
|
47
|
+
select( editSiteStore )
|
|
48
|
+
);
|
|
49
|
+
const _context = getEditedPostContext();
|
|
50
|
+
return {
|
|
51
|
+
canvasMode: getCanvasMode(),
|
|
52
|
+
settings: getSettings(),
|
|
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',
|
|
57
|
+
};
|
|
58
|
+
}, [] );
|
|
150
59
|
const defaultRenderingMode = shouldUseTemplateAsDefaultRenderingMode
|
|
151
60
|
? 'template-locked'
|
|
152
61
|
: 'post-only';
|
|
@@ -162,9 +71,6 @@ export function useSpecificEditorSettings() {
|
|
|
162
71
|
defaultRenderingMode,
|
|
163
72
|
onNavigateToEntityRecord,
|
|
164
73
|
onNavigateToPreviousEntityRecord,
|
|
165
|
-
// I wonder if they should be set in the post editor too
|
|
166
|
-
__experimentalArchiveTitleTypeLabel: archiveLabels.archiveTypeLabel,
|
|
167
|
-
__experimentalArchiveTitleNameLabel: archiveLabels.archiveNameLabel,
|
|
168
74
|
__unstableIsPreviewMode: canvasMode === 'view',
|
|
169
75
|
};
|
|
170
76
|
}, [
|
|
@@ -173,8 +79,6 @@ export function useSpecificEditorSettings() {
|
|
|
173
79
|
defaultRenderingMode,
|
|
174
80
|
onNavigateToEntityRecord,
|
|
175
81
|
onNavigateToPreviousEntityRecord,
|
|
176
|
-
archiveLabels.archiveTypeLabel,
|
|
177
|
-
archiveLabels.archiveNameLabel,
|
|
178
82
|
] );
|
|
179
83
|
|
|
180
84
|
return defaultEditorSettings;
|
|
@@ -7,8 +7,8 @@ import clsx from 'clsx';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
10
|
-
import { Button } from '@wordpress/components';
|
|
11
|
-
import { useInstanceId } from '@wordpress/compose';
|
|
10
|
+
import { Button, __unstableMotion as motion } from '@wordpress/components';
|
|
11
|
+
import { useInstanceId, useReducedMotion } from '@wordpress/compose';
|
|
12
12
|
import {
|
|
13
13
|
EditorKeyboardShortcutsRegister,
|
|
14
14
|
privateApis as editorPrivateApis,
|
|
@@ -22,6 +22,7 @@ import { store as noticesStore } from '@wordpress/notices';
|
|
|
22
22
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
23
23
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
24
24
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
25
|
+
import { Icon, homeButton } from '@wordpress/icons';
|
|
25
26
|
|
|
26
27
|
/**
|
|
27
28
|
* Internal dependencies
|
|
@@ -51,7 +52,32 @@ const { Editor, BackButton } = unlock( editorPrivateApis );
|
|
|
51
52
|
const { useHistory, useLocation } = unlock( routerPrivateApis );
|
|
52
53
|
const { BlockKeyboardShortcuts } = unlock( blockLibraryPrivateApis );
|
|
53
54
|
|
|
55
|
+
const toggleHomeIconVariants = {
|
|
56
|
+
edit: {
|
|
57
|
+
opacity: 0,
|
|
58
|
+
scale: 0.2,
|
|
59
|
+
},
|
|
60
|
+
hover: {
|
|
61
|
+
opacity: 1,
|
|
62
|
+
scale: 1,
|
|
63
|
+
clipPath: 'inset( 22% round 2px )',
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const siteIconVariants = {
|
|
68
|
+
edit: {
|
|
69
|
+
clipPath: 'inset(0% round 0)',
|
|
70
|
+
},
|
|
71
|
+
hover: {
|
|
72
|
+
clipPath: 'inset( 22% round 2px )',
|
|
73
|
+
},
|
|
74
|
+
tap: {
|
|
75
|
+
clipPath: 'inset(0% round 0)',
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
|
|
54
79
|
export default function EditSiteEditor( { isPostsList = false } ) {
|
|
80
|
+
const disableMotion = useReducedMotion();
|
|
55
81
|
const { params } = useLocation();
|
|
56
82
|
const isLoading = useIsSiteEditorLoading();
|
|
57
83
|
const {
|
|
@@ -65,6 +91,7 @@ export default function EditSiteEditor( { isPostsList = false } ) {
|
|
|
65
91
|
showIconLabels,
|
|
66
92
|
editorCanvasView,
|
|
67
93
|
currentPostIsTrashed,
|
|
94
|
+
hasSiteIcon,
|
|
68
95
|
} = useSelect( ( select ) => {
|
|
69
96
|
const {
|
|
70
97
|
getEditorCanvasContainerView,
|
|
@@ -75,8 +102,9 @@ export default function EditSiteEditor( { isPostsList = false } ) {
|
|
|
75
102
|
getEditedPostId,
|
|
76
103
|
} = unlock( select( editSiteStore ) );
|
|
77
104
|
const { get } = select( preferencesStore );
|
|
78
|
-
const { getCurrentTheme } = select( coreDataStore );
|
|
105
|
+
const { getCurrentTheme, getEntityRecord } = select( coreDataStore );
|
|
79
106
|
const _context = getEditedPostContext();
|
|
107
|
+
const siteData = getEntityRecord( 'root', '__unstableBase', undefined );
|
|
80
108
|
|
|
81
109
|
// The currently selected entity to display.
|
|
82
110
|
// Typically template or template part in the site editor.
|
|
@@ -93,6 +121,7 @@ export default function EditSiteEditor( { isPostsList = false } ) {
|
|
|
93
121
|
currentPostIsTrashed:
|
|
94
122
|
select( editorStore ).getCurrentPostAttribute( 'status' ) ===
|
|
95
123
|
'trash',
|
|
124
|
+
hasSiteIcon: !! siteData?.site_icon_url,
|
|
96
125
|
};
|
|
97
126
|
}, [] );
|
|
98
127
|
useEditorTitle();
|
|
@@ -179,6 +208,9 @@ export default function EditSiteEditor( { isPostsList = false } ) {
|
|
|
179
208
|
getEditorCanvasContainerTitleAndIcon( editorCanvasView );
|
|
180
209
|
|
|
181
210
|
const isReady = ! isLoading;
|
|
211
|
+
const transition = {
|
|
212
|
+
duration: disableMotion ? 0 : 0.2,
|
|
213
|
+
};
|
|
182
214
|
|
|
183
215
|
return (
|
|
184
216
|
<>
|
|
@@ -217,26 +249,52 @@ export default function EditSiteEditor( { isPostsList = false } ) {
|
|
|
217
249
|
<BackButton>
|
|
218
250
|
{ ( { length } ) =>
|
|
219
251
|
length <= 1 && (
|
|
220
|
-
<
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
if (
|
|
228
|
-
isPostsList &&
|
|
229
|
-
params?.focusMode
|
|
230
|
-
) {
|
|
231
|
-
history.push( {
|
|
232
|
-
page: 'gutenberg-posts-dashboard',
|
|
233
|
-
postType: 'post',
|
|
234
|
-
} );
|
|
235
|
-
}
|
|
236
|
-
} }
|
|
252
|
+
<motion.div
|
|
253
|
+
className="edit-site-editor__view-mode-toggle"
|
|
254
|
+
transition={ transition }
|
|
255
|
+
animate="edit"
|
|
256
|
+
initial="edit"
|
|
257
|
+
whileHover="hover"
|
|
258
|
+
whileTap="tap"
|
|
237
259
|
>
|
|
238
|
-
<
|
|
239
|
-
|
|
260
|
+
<Button
|
|
261
|
+
label={ __( 'Open Navigation' ) }
|
|
262
|
+
showTooltip
|
|
263
|
+
tooltipPosition="middle right"
|
|
264
|
+
onClick={ () => {
|
|
265
|
+
setCanvasMode( 'view' );
|
|
266
|
+
// TODO: this is a temporary solution to navigate to the posts list if we are
|
|
267
|
+
// come here through `posts list` and are in focus mode editing a template, template part etc..
|
|
268
|
+
if (
|
|
269
|
+
isPostsList &&
|
|
270
|
+
params?.focusMode
|
|
271
|
+
) {
|
|
272
|
+
history.push( {
|
|
273
|
+
page: 'gutenberg-posts-dashboard',
|
|
274
|
+
postType: 'post',
|
|
275
|
+
} );
|
|
276
|
+
}
|
|
277
|
+
} }
|
|
278
|
+
>
|
|
279
|
+
<motion.div
|
|
280
|
+
variants={ siteIconVariants }
|
|
281
|
+
>
|
|
282
|
+
<SiteIcon className="edit-site-editor__view-mode-toggle-icon" />
|
|
283
|
+
</motion.div>
|
|
284
|
+
</Button>
|
|
285
|
+
<motion.div
|
|
286
|
+
className={ clsx(
|
|
287
|
+
'edit-site-editor__back-icon',
|
|
288
|
+
{
|
|
289
|
+
'has-site-icon':
|
|
290
|
+
hasSiteIcon,
|
|
291
|
+
}
|
|
292
|
+
) }
|
|
293
|
+
variants={ toggleHomeIconVariants }
|
|
294
|
+
>
|
|
295
|
+
<Icon icon={ homeButton } />
|
|
296
|
+
</motion.div>
|
|
297
|
+
</motion.div>
|
|
240
298
|
)
|
|
241
299
|
}
|
|
242
300
|
</BackButton>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
.edit-site-editor__editor-interface {
|
|
2
2
|
opacity: 1;
|
|
3
3
|
transition: opacity 0.1s ease-out;
|
|
4
|
-
@include reduce-motion("transition");
|
|
4
|
+
@include reduce-motion( "transition" );
|
|
5
5
|
|
|
6
6
|
&.is-loading {
|
|
7
7
|
opacity: 0;
|
|
@@ -17,3 +17,61 @@
|
|
|
17
17
|
display: flex;
|
|
18
18
|
justify-content: center;
|
|
19
19
|
}
|
|
20
|
+
|
|
21
|
+
.edit-site-editor__view-mode-toggle {
|
|
22
|
+
/* stylelint-disable -- Disable reason: View Transitions not supported properly by stylelint. */
|
|
23
|
+
view-transition-name: toggle;
|
|
24
|
+
/* stylelint-enable */
|
|
25
|
+
top: 0;
|
|
26
|
+
left: 0;
|
|
27
|
+
height: $header-height;
|
|
28
|
+
width: $header-height;
|
|
29
|
+
z-index: 100;
|
|
30
|
+
|
|
31
|
+
.components-button {
|
|
32
|
+
color: $white;
|
|
33
|
+
height: 100%;
|
|
34
|
+
width: 100%;
|
|
35
|
+
border-radius: 0;
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
padding: 0;
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
&:hover,
|
|
42
|
+
&:active {
|
|
43
|
+
color: $white;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&:focus {
|
|
47
|
+
box-shadow: none;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.edit-site-editor__view-mode-toggle-icon {
|
|
52
|
+
svg,
|
|
53
|
+
img {
|
|
54
|
+
background: $gray-900;
|
|
55
|
+
display: block;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.edit-site-editor__back-icon {
|
|
61
|
+
position: absolute;
|
|
62
|
+
top: 0;
|
|
63
|
+
left: 0;
|
|
64
|
+
width: 60px;
|
|
65
|
+
height: 60px;
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
justify-content: center;
|
|
69
|
+
background-color: hsla(0, 0%, 80%);
|
|
70
|
+
pointer-events: none;
|
|
71
|
+
|
|
72
|
+
&.has-site-icon {
|
|
73
|
+
background-color: hsla(0, 0%, 100%, 0.6);
|
|
74
|
+
-webkit-backdrop-filter: saturate(180%) blur(15px);
|
|
75
|
+
backdrop-filter: saturate(180%) blur(15px);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -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>
|