@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
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __experimentalHStack as HStack } from '@wordpress/components';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import TypographyExample from './typography-example';
|
|
10
|
+
import PreviewIframe from './preview-iframe';
|
|
11
|
+
|
|
12
|
+
const StylesPreviewTypography = ( { variation, isFocused, withHoverView } ) => {
|
|
13
|
+
return (
|
|
14
|
+
<PreviewIframe
|
|
15
|
+
label={ variation.title }
|
|
16
|
+
isFocused={ isFocused }
|
|
17
|
+
withHoverView={ withHoverView }
|
|
18
|
+
>
|
|
19
|
+
{ ( { ratio, key } ) => (
|
|
20
|
+
<HStack
|
|
21
|
+
key={ key }
|
|
22
|
+
spacing={ 10 * ratio }
|
|
23
|
+
justify="center"
|
|
24
|
+
style={ {
|
|
25
|
+
height: '100%',
|
|
26
|
+
overflow: 'hidden',
|
|
27
|
+
} }
|
|
28
|
+
>
|
|
29
|
+
<TypographyExample
|
|
30
|
+
variation={ variation }
|
|
31
|
+
fontSize={ 85 * ratio }
|
|
32
|
+
/>
|
|
33
|
+
</HStack>
|
|
34
|
+
) }
|
|
35
|
+
</PreviewIframe>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export default StylesPreviewTypography;
|
|
@@ -25,6 +25,11 @@ import {
|
|
|
25
25
|
VariationsPanel,
|
|
26
26
|
} from './variations/variations-panel';
|
|
27
27
|
|
|
28
|
+
// Initial control values where no block style is set.
|
|
29
|
+
const BACKGROUND_BLOCK_DEFAULT_VALUES = {
|
|
30
|
+
backgroundSize: 'cover',
|
|
31
|
+
};
|
|
32
|
+
|
|
28
33
|
function applyFallbackStyle( border ) {
|
|
29
34
|
if ( ! border ) {
|
|
30
35
|
return border;
|
|
@@ -70,6 +75,8 @@ const {
|
|
|
70
75
|
useHasFiltersPanel,
|
|
71
76
|
useHasImageSettingsPanel,
|
|
72
77
|
useGlobalStyle,
|
|
78
|
+
useHasBackgroundPanel,
|
|
79
|
+
BackgroundPanel: StylesBackgroundPanel,
|
|
73
80
|
BorderPanel: StylesBorderPanel,
|
|
74
81
|
ColorPanel: StylesColorPanel,
|
|
75
82
|
TypographyPanel: StylesTypographyPanel,
|
|
@@ -77,6 +84,7 @@ const {
|
|
|
77
84
|
FiltersPanel: StylesFiltersPanel,
|
|
78
85
|
ImageSettingsPanel,
|
|
79
86
|
AdvancedPanel: StylesAdvancedPanel,
|
|
87
|
+
useGlobalStyleLinks,
|
|
80
88
|
} = unlock( blockEditorPrivateApis );
|
|
81
89
|
|
|
82
90
|
function ScreenBlock( { name, variation } ) {
|
|
@@ -96,6 +104,7 @@ function ScreenBlock( { name, variation } ) {
|
|
|
96
104
|
const [ rawSettings, setSettings ] = useGlobalSetting( '', name );
|
|
97
105
|
const settings = useSettingsForBlockElement( rawSettings, name );
|
|
98
106
|
const blockType = getBlockType( name );
|
|
107
|
+
const _links = useGlobalStyleLinks();
|
|
99
108
|
|
|
100
109
|
// Only allow `blockGap` support if serialization has not been skipped, to be sure global spacing can be applied.
|
|
101
110
|
if (
|
|
@@ -121,6 +130,7 @@ function ScreenBlock( { name, variation } ) {
|
|
|
121
130
|
}
|
|
122
131
|
|
|
123
132
|
const blockVariations = useBlockVariations( name );
|
|
133
|
+
const hasBackgroundPanel = useHasBackgroundPanel( settings );
|
|
124
134
|
const hasTypographyPanel = useHasTypographyPanel( settings );
|
|
125
135
|
const hasColorPanel = useHasColorPanel( settings );
|
|
126
136
|
const hasBorderPanel = useHasBorderPanel( settings );
|
|
@@ -254,6 +264,16 @@ function ScreenBlock( { name, variation } ) {
|
|
|
254
264
|
settings={ settings }
|
|
255
265
|
/>
|
|
256
266
|
) }
|
|
267
|
+
{ hasBackgroundPanel && (
|
|
268
|
+
<StylesBackgroundPanel
|
|
269
|
+
inheritedValue={ inheritedStyle }
|
|
270
|
+
value={ style }
|
|
271
|
+
onChange={ setStyle }
|
|
272
|
+
settings={ settings }
|
|
273
|
+
defaultValues={ BACKGROUND_BLOCK_DEFAULT_VALUES }
|
|
274
|
+
themeFileURIs={ _links?.[ 'wp:theme-file' ] }
|
|
275
|
+
/>
|
|
276
|
+
) }
|
|
257
277
|
{ hasTypographyPanel && (
|
|
258
278
|
<StylesTypographyPanel
|
|
259
279
|
inheritedValue={ inheritedStyle }
|
|
@@ -23,7 +23,11 @@ function ScreenLayout() {
|
|
|
23
23
|
const [ rawSettings ] = useGlobalSetting( '' );
|
|
24
24
|
const settings = useSettingsForBlockElement( rawSettings );
|
|
25
25
|
const hasDimensionsPanel = useHasDimensionsPanel( settings );
|
|
26
|
-
|
|
26
|
+
/*
|
|
27
|
+
* Use the raw settings to determine if the background panel should be displayed,
|
|
28
|
+
* as the background panel is not dependent on the block element settings.
|
|
29
|
+
*/
|
|
30
|
+
const hasBackgroundPanel = useHasBackgroundPanel( rawSettings );
|
|
27
31
|
return (
|
|
28
32
|
<>
|
|
29
33
|
<ScreenHeader title={ __( 'Layout' ) } />
|
|
@@ -163,7 +163,7 @@ function RevisionsButtons( {
|
|
|
163
163
|
>
|
|
164
164
|
<Button
|
|
165
165
|
className="edit-site-global-styles-screen-revisions__revision-button"
|
|
166
|
-
|
|
166
|
+
accessibleWhenDisabled
|
|
167
167
|
disabled={ isSelected }
|
|
168
168
|
onClick={ () => {
|
|
169
169
|
onChange( revision );
|
|
@@ -9,7 +9,7 @@ import { useZoomOut } from '@wordpress/block-editor';
|
|
|
9
9
|
* Internal dependencies
|
|
10
10
|
*/
|
|
11
11
|
import ScreenHeader from './header';
|
|
12
|
-
import
|
|
12
|
+
import SidebarNavigationScreenGlobalStylesContent from '../sidebar-navigation-screen-global-styles/content';
|
|
13
13
|
|
|
14
14
|
function ScreenStyleVariations() {
|
|
15
15
|
// Move to zoom out mode when this component is mounted
|
|
@@ -31,7 +31,7 @@ function ScreenStyleVariations() {
|
|
|
31
31
|
className="edit-site-global-styles-screen-style-variations"
|
|
32
32
|
>
|
|
33
33
|
<CardBody>
|
|
34
|
-
<
|
|
34
|
+
<SidebarNavigationScreenGlobalStylesContent />
|
|
35
35
|
</CardBody>
|
|
36
36
|
</Card>
|
|
37
37
|
</>
|
|
@@ -13,6 +13,7 @@ import TypographyElements from './typography-elements';
|
|
|
13
13
|
import TypographyVariations from './variations/variations-typography';
|
|
14
14
|
import FontFamilies from './font-families';
|
|
15
15
|
import ScreenHeader from './header';
|
|
16
|
+
import FontSizesCount from './font-sizes/font-sizes-count';
|
|
16
17
|
|
|
17
18
|
function ScreenTypography() {
|
|
18
19
|
const fontLibraryEnabled = useSelect(
|
|
@@ -31,10 +32,10 @@ function ScreenTypography() {
|
|
|
31
32
|
/>
|
|
32
33
|
<div className="edit-site-global-styles-screen">
|
|
33
34
|
<VStack spacing={ 7 }>
|
|
34
|
-
{
|
|
35
|
-
fontLibraryEnabled && <FontFamilies /> }
|
|
35
|
+
{ fontLibraryEnabled && <FontFamilies /> }
|
|
36
36
|
<TypographyElements />
|
|
37
37
|
<TypographyVariations title={ __( 'Presets' ) } />
|
|
38
|
+
<FontSizesCount />
|
|
38
39
|
</VStack>
|
|
39
40
|
</div>
|
|
40
41
|
</>
|
|
@@ -371,8 +371,7 @@ function ShadowItem( { shadow, onChange, canRemove, onRemove } ) {
|
|
|
371
371
|
'edit-site-global-styles__shadow-editor__remove-button',
|
|
372
372
|
{ 'is-open': isOpen }
|
|
373
373
|
),
|
|
374
|
-
|
|
375
|
-
tooltip: __( 'Remove shadow' ),
|
|
374
|
+
label: __( 'Remove shadow' ),
|
|
376
375
|
};
|
|
377
376
|
|
|
378
377
|
return (
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import {
|
|
10
|
+
BaseControl,
|
|
11
|
+
RangeControl,
|
|
12
|
+
Flex,
|
|
13
|
+
FlexItem,
|
|
14
|
+
useBaseControlProps,
|
|
15
|
+
__experimentalUseCustomUnits as useCustomUnits,
|
|
16
|
+
__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,
|
|
17
|
+
__experimentalUnitControl as UnitControl,
|
|
18
|
+
__experimentalSpacer as Spacer,
|
|
19
|
+
} from '@wordpress/components';
|
|
20
|
+
|
|
21
|
+
const DEFAULT_UNITS = [ 'px', 'em', 'rem', 'vw', 'vh' ];
|
|
22
|
+
|
|
23
|
+
function SizeControl( props ) {
|
|
24
|
+
const { baseControlProps } = useBaseControlProps( props );
|
|
25
|
+
const { value, onChange, fallbackValue, disabled } = props;
|
|
26
|
+
|
|
27
|
+
const units = useCustomUnits( {
|
|
28
|
+
availableUnits: DEFAULT_UNITS,
|
|
29
|
+
} );
|
|
30
|
+
|
|
31
|
+
const [ valueQuantity, valueUnit = 'px' ] =
|
|
32
|
+
parseQuantityAndUnitFromRawValue( value, units );
|
|
33
|
+
|
|
34
|
+
const isValueUnitRelative =
|
|
35
|
+
!! valueUnit && [ 'em', 'rem', 'vw', 'vh' ].includes( valueUnit );
|
|
36
|
+
|
|
37
|
+
// Receives the new value from the UnitControl component as a string containing the value and unit.
|
|
38
|
+
const handleUnitControlChange = ( newValue ) => {
|
|
39
|
+
onChange( newValue );
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// Receives the new value from the RangeControl component as a number.
|
|
43
|
+
const handleRangeControlChange = ( newValue ) => {
|
|
44
|
+
onChange?.( newValue + valueUnit );
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<BaseControl { ...baseControlProps }>
|
|
49
|
+
<Flex>
|
|
50
|
+
<FlexItem isBlock>
|
|
51
|
+
<UnitControl
|
|
52
|
+
__next40pxDefaultSize
|
|
53
|
+
__nextHasNoMarginBottom
|
|
54
|
+
label={ __( 'Custom' ) }
|
|
55
|
+
hideLabelFromVision
|
|
56
|
+
value={ value }
|
|
57
|
+
onChange={ handleUnitControlChange }
|
|
58
|
+
units={ units }
|
|
59
|
+
min={ 0 }
|
|
60
|
+
disabled={ disabled }
|
|
61
|
+
/>
|
|
62
|
+
</FlexItem>
|
|
63
|
+
<FlexItem isBlock>
|
|
64
|
+
<Spacer marginX={ 2 } marginBottom={ 0 }>
|
|
65
|
+
<RangeControl
|
|
66
|
+
__next40pxDefaultSize
|
|
67
|
+
__nextHasNoMarginBottom
|
|
68
|
+
label={ __( 'Custom Size' ) }
|
|
69
|
+
hideLabelFromVision
|
|
70
|
+
value={ valueQuantity }
|
|
71
|
+
initialPosition={ fallbackValue }
|
|
72
|
+
withInputField={ false }
|
|
73
|
+
onChange={ handleRangeControlChange }
|
|
74
|
+
min={ 0 }
|
|
75
|
+
max={ isValueUnitRelative ? 10 : 100 }
|
|
76
|
+
step={ isValueUnitRelative ? 0.1 : 1 }
|
|
77
|
+
disabled={ disabled }
|
|
78
|
+
/>
|
|
79
|
+
</Spacer>
|
|
80
|
+
</FlexItem>
|
|
81
|
+
</Flex>
|
|
82
|
+
</BaseControl>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export default SizeControl;
|
|
@@ -13,7 +13,7 @@ import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
|
13
13
|
*/
|
|
14
14
|
import PreviewStyles from './preview-styles';
|
|
15
15
|
import Variation from './variations/variation';
|
|
16
|
-
import {
|
|
16
|
+
import { isVariationWithProperties } from '../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';
|
|
17
17
|
import { unlock } from '../../lock-unlock';
|
|
18
18
|
|
|
19
19
|
const { GlobalStylesContext } = unlock( blockEditorPrivateApis );
|
|
@@ -33,11 +33,14 @@ export default function StyleVariationsContainer( { gap = 2 } ) {
|
|
|
33
33
|
).__experimentalGetCurrentThemeGlobalStylesVariations();
|
|
34
34
|
}, [] );
|
|
35
35
|
|
|
36
|
-
// Filter out variations that are
|
|
37
|
-
const
|
|
36
|
+
// Filter out variations that are color or typography variations.
|
|
37
|
+
const fullStyleVariations = variations?.filter( ( variation ) => {
|
|
38
38
|
return (
|
|
39
|
-
!
|
|
40
|
-
!
|
|
39
|
+
! isVariationWithProperties( variation, [ 'color' ] ) &&
|
|
40
|
+
! isVariationWithProperties( variation, [
|
|
41
|
+
'typography',
|
|
42
|
+
'spacing',
|
|
43
|
+
] )
|
|
41
44
|
);
|
|
42
45
|
} );
|
|
43
46
|
|
|
@@ -48,7 +51,7 @@ export default function StyleVariationsContainer( { gap = 2 } ) {
|
|
|
48
51
|
settings: {},
|
|
49
52
|
styles: {},
|
|
50
53
|
},
|
|
51
|
-
...(
|
|
54
|
+
...( fullStyleVariations ?? [] ),
|
|
52
55
|
];
|
|
53
56
|
return [
|
|
54
57
|
...withEmptyVariation.map( ( variation ) => {
|
|
@@ -105,7 +108,11 @@ export default function StyleVariationsContainer( { gap = 2 } ) {
|
|
|
105
108
|
};
|
|
106
109
|
} ),
|
|
107
110
|
];
|
|
108
|
-
}, [
|
|
111
|
+
}, [ fullStyleVariations, userStyles?.blocks, userStyles?.css ] );
|
|
112
|
+
|
|
113
|
+
if ( ! fullStyleVariations || fullStyleVariations?.length < 1 ) {
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
109
116
|
|
|
110
117
|
return (
|
|
111
118
|
<Grid
|
|
@@ -23,6 +23,17 @@
|
|
|
23
23
|
overflow: hidden;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
.edit-site-font-size__item {
|
|
27
|
+
white-space: nowrap;
|
|
28
|
+
text-overflow: ellipsis;
|
|
29
|
+
overflow: hidden;
|
|
30
|
+
line-break: anywhere;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.edit-site-font-size__item-value {
|
|
34
|
+
color: $gray-700;
|
|
35
|
+
}
|
|
36
|
+
|
|
26
37
|
.edit-site-global-styles-screen {
|
|
27
38
|
margin: $grid-unit-15 $grid-unit-20 $grid-unit-20;
|
|
28
39
|
}
|
|
@@ -41,7 +52,6 @@
|
|
|
41
52
|
color: $gray-700;
|
|
42
53
|
}
|
|
43
54
|
|
|
44
|
-
.edit-site-global-styles-font-families__add-fonts,
|
|
45
55
|
.edit-site-global-styles-font-families__manage-fonts {
|
|
46
56
|
justify-content: center;
|
|
47
57
|
}
|
|
@@ -102,13 +112,13 @@
|
|
|
102
112
|
.edit-site-global-styles__block-preview-panel {
|
|
103
113
|
position: relative;
|
|
104
114
|
width: 100%;
|
|
105
|
-
overflow: auto;
|
|
106
115
|
border: $gray-200 $border-width solid;
|
|
107
116
|
border-radius: $radius-block-ui;
|
|
117
|
+
overflow: hidden;
|
|
108
118
|
}
|
|
109
119
|
|
|
110
120
|
.edit-site-global-styles__shadow-preview-panel {
|
|
111
|
-
height:
|
|
121
|
+
height: $grid-unit-60 * 3;
|
|
112
122
|
border: $gray-200 $border-width solid;
|
|
113
123
|
border-radius: $radius-block-ui;
|
|
114
124
|
overflow: auto;
|
|
@@ -31,9 +31,6 @@ function ElementItem( { parentMenu, element, label } ) {
|
|
|
31
31
|
const [ fontFamily ] = useGlobalStyle( prefix + 'typography.fontFamily' );
|
|
32
32
|
const [ fontStyle ] = useGlobalStyle( prefix + 'typography.fontStyle' );
|
|
33
33
|
const [ fontWeight ] = useGlobalStyle( prefix + 'typography.fontWeight' );
|
|
34
|
-
const [ letterSpacing ] = useGlobalStyle(
|
|
35
|
-
prefix + 'typography.letterSpacing'
|
|
36
|
-
);
|
|
37
34
|
const [ backgroundColor ] = useGlobalStyle( prefix + 'color.background' );
|
|
38
35
|
const [ fallbackBackgroundColor ] = useGlobalStyle( 'color.background' );
|
|
39
36
|
const [ gradientValue ] = useGlobalStyle( prefix + 'color.gradient' );
|
|
@@ -62,7 +59,6 @@ function ElementItem( { parentMenu, element, label } ) {
|
|
|
62
59
|
color,
|
|
63
60
|
fontStyle,
|
|
64
61
|
fontWeight,
|
|
65
|
-
letterSpacing,
|
|
66
62
|
...extraStyles,
|
|
67
63
|
} }
|
|
68
64
|
>
|
|
@@ -33,6 +33,8 @@ import {
|
|
|
33
33
|
import ScreenBlock from './screen-block';
|
|
34
34
|
import ScreenTypography from './screen-typography';
|
|
35
35
|
import ScreenTypographyElement from './screen-typography-element';
|
|
36
|
+
import FontSize from './font-sizes/font-size';
|
|
37
|
+
import FontSizes from './font-sizes/font-sizes';
|
|
36
38
|
import ScreenColors from './screen-colors';
|
|
37
39
|
import ScreenColorPalette from './screen-color-palette';
|
|
38
40
|
import { ScreenShadows, ScreenShadowsEdit } from './screen-shadows';
|
|
@@ -313,6 +315,14 @@ function GlobalStylesUI() {
|
|
|
313
315
|
<ScreenTypography />
|
|
314
316
|
</GlobalStylesNavigationScreen>
|
|
315
317
|
|
|
318
|
+
<GlobalStylesNavigationScreen path="/typography/font-sizes/">
|
|
319
|
+
<FontSizes />
|
|
320
|
+
</GlobalStylesNavigationScreen>
|
|
321
|
+
|
|
322
|
+
<GlobalStylesNavigationScreen path="/typography/font-sizes/:origin/:slug">
|
|
323
|
+
<FontSize />
|
|
324
|
+
</GlobalStylesNavigationScreen>
|
|
325
|
+
|
|
316
326
|
<GlobalStylesNavigationScreen path="/typography/text">
|
|
317
327
|
<ScreenTypographyElement element="text" />
|
|
318
328
|
</GlobalStylesNavigationScreen>
|
|
@@ -16,7 +16,7 @@ import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
|
16
16
|
/**
|
|
17
17
|
* Internal dependencies
|
|
18
18
|
*/
|
|
19
|
-
import {
|
|
19
|
+
import { filterObjectByProperties } from '../../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';
|
|
20
20
|
import { unlock } from '../../../lock-unlock';
|
|
21
21
|
|
|
22
22
|
const { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );
|
|
@@ -28,7 +28,7 @@ export default function Variation( {
|
|
|
28
28
|
variation,
|
|
29
29
|
children,
|
|
30
30
|
isPill,
|
|
31
|
-
|
|
31
|
+
properties,
|
|
32
32
|
showTooltip,
|
|
33
33
|
} ) {
|
|
34
34
|
const [ isFocused, setIsFocused ] = useState( false );
|
|
@@ -36,8 +36,8 @@ export default function Variation( {
|
|
|
36
36
|
|
|
37
37
|
const context = useMemo( () => {
|
|
38
38
|
let merged = mergeBaseAndUserConfigs( base, variation );
|
|
39
|
-
if (
|
|
40
|
-
merged =
|
|
39
|
+
if ( properties ) {
|
|
40
|
+
merged = filterObjectByProperties( merged, properties );
|
|
41
41
|
}
|
|
42
42
|
return {
|
|
43
43
|
user: variation,
|
|
@@ -45,7 +45,7 @@ export default function Variation( {
|
|
|
45
45
|
merged,
|
|
46
46
|
setUserConfig: () => {},
|
|
47
47
|
};
|
|
48
|
-
}, [ variation, base,
|
|
48
|
+
}, [ variation, base, properties ] );
|
|
49
49
|
|
|
50
50
|
const selectVariation = () => setUserConfig( variation );
|
|
51
51
|
|
|
@@ -2,20 +2,22 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
|
-
__experimentalVStack as VStack,
|
|
6
5
|
__experimentalGrid as Grid,
|
|
6
|
+
__experimentalVStack as VStack,
|
|
7
7
|
} from '@wordpress/components';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Internal dependencies
|
|
11
11
|
*/
|
|
12
12
|
import StylesPreviewColors from '../preview-colors';
|
|
13
|
-
import {
|
|
13
|
+
import { useCurrentMergeThemeStyleVariationsWithUserConfig } from '../../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';
|
|
14
14
|
import Subtitle from '../subtitle';
|
|
15
15
|
import Variation from './variation';
|
|
16
16
|
|
|
17
17
|
export default function ColorVariations( { title, gap = 2 } ) {
|
|
18
|
-
const
|
|
18
|
+
const propertiesToFilter = [ 'color' ];
|
|
19
|
+
const colorVariations =
|
|
20
|
+
useCurrentMergeThemeStyleVariationsWithUserConfig( propertiesToFilter );
|
|
19
21
|
|
|
20
22
|
// Return null if there is only one variation (the default).
|
|
21
23
|
if ( colorVariations?.length <= 1 ) {
|
|
@@ -31,7 +33,7 @@ export default function ColorVariations( { title, gap = 2 } ) {
|
|
|
31
33
|
key={ index }
|
|
32
34
|
variation={ variation }
|
|
33
35
|
isPill
|
|
34
|
-
|
|
36
|
+
properties={ propertiesToFilter }
|
|
35
37
|
showTooltip
|
|
36
38
|
>
|
|
37
39
|
{ () => <StylesPreviewColors /> }
|
|
@@ -3,21 +3,21 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
5
|
__experimentalGrid as Grid,
|
|
6
|
-
__experimentalVStack as HStack,
|
|
7
6
|
__experimentalVStack as VStack,
|
|
8
7
|
} from '@wordpress/components';
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* Internal dependencies
|
|
12
11
|
*/
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import PreviewIframe from '../preview-iframe';
|
|
16
|
-
import Variation from './variation';
|
|
12
|
+
import StylesPreviewTypography from '../preview-typography';
|
|
13
|
+
import { useCurrentMergeThemeStyleVariationsWithUserConfig } from '../../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';
|
|
17
14
|
import Subtitle from '../subtitle';
|
|
15
|
+
import Variation from './variation';
|
|
18
16
|
|
|
19
17
|
export default function TypographyVariations( { title, gap = 2 } ) {
|
|
20
|
-
const
|
|
18
|
+
const propertiesToFilter = [ 'typography' ];
|
|
19
|
+
const typographyVariations =
|
|
20
|
+
useCurrentMergeThemeStyleVariationsWithUserConfig( propertiesToFilter );
|
|
21
21
|
|
|
22
22
|
// Return null if there is only one variation (the default).
|
|
23
23
|
if ( typographyVariations?.length <= 1 ) {
|
|
@@ -32,40 +32,22 @@ export default function TypographyVariations( { title, gap = 2 } ) {
|
|
|
32
32
|
gap={ gap }
|
|
33
33
|
className="edit-site-global-styles-style-variations-container"
|
|
34
34
|
>
|
|
35
|
-
{ typographyVariations
|
|
36
|
-
|
|
37
|
-
typographyVariations.map( ( variation, index ) => (
|
|
35
|
+
{ typographyVariations.map( ( variation, index ) => {
|
|
36
|
+
return (
|
|
38
37
|
<Variation
|
|
39
38
|
key={ index }
|
|
40
39
|
variation={ variation }
|
|
41
|
-
|
|
40
|
+
properties={ propertiesToFilter }
|
|
42
41
|
showTooltip
|
|
43
42
|
>
|
|
44
|
-
{ (
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
>
|
|
49
|
-
{ ( { ratio, key } ) => (
|
|
50
|
-
<HStack
|
|
51
|
-
key={ key }
|
|
52
|
-
spacing={ 10 * ratio }
|
|
53
|
-
justify="center"
|
|
54
|
-
style={ {
|
|
55
|
-
height: '100%',
|
|
56
|
-
overflow: 'hidden',
|
|
57
|
-
} }
|
|
58
|
-
>
|
|
59
|
-
<TypographyExample
|
|
60
|
-
variation={ variation }
|
|
61
|
-
fontSize={ 85 * ratio }
|
|
62
|
-
/>
|
|
63
|
-
</HStack>
|
|
64
|
-
) }
|
|
65
|
-
</PreviewIframe>
|
|
43
|
+
{ () => (
|
|
44
|
+
<StylesPreviewTypography
|
|
45
|
+
variation={ variation }
|
|
46
|
+
/>
|
|
66
47
|
) }
|
|
67
48
|
</Variation>
|
|
68
|
-
)
|
|
49
|
+
);
|
|
50
|
+
} ) }
|
|
69
51
|
</Grid>
|
|
70
52
|
</VStack>
|
|
71
53
|
);
|
|
@@ -152,7 +152,7 @@ export default function GlobalStylesSidebar() {
|
|
|
152
152
|
isPressed={
|
|
153
153
|
isStyleBookOpened || isRevisionsStyleBookOpened
|
|
154
154
|
}
|
|
155
|
-
|
|
155
|
+
accessibleWhenDisabled
|
|
156
156
|
disabled={ shouldClearCanvasContainerView }
|
|
157
157
|
onClick={ toggleStyleBook }
|
|
158
158
|
size="compact"
|
|
@@ -163,7 +163,7 @@ export default function GlobalStylesSidebar() {
|
|
|
163
163
|
label={ __( 'Revisions' ) }
|
|
164
164
|
icon={ backup }
|
|
165
165
|
onClick={ toggleRevisions }
|
|
166
|
-
|
|
166
|
+
accessibleWhenDisabled
|
|
167
167
|
disabled={ ! hasRevisions }
|
|
168
168
|
isPressed={
|
|
169
169
|
isRevisionsOpened || isRevisionsStyleBookOpened
|
|
@@ -34,16 +34,16 @@ import { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands
|
|
|
34
34
|
*/
|
|
35
35
|
import ErrorBoundary from '../error-boundary';
|
|
36
36
|
import { store as editSiteStore } from '../../store';
|
|
37
|
-
import SiteHub from '../site-hub';
|
|
37
|
+
import { default as SiteHub, SiteHubMobile } from '../site-hub';
|
|
38
38
|
import ResizableFrame from '../resizable-frame';
|
|
39
39
|
import { unlock } from '../../lock-unlock';
|
|
40
|
-
import SavePanel from '../save-panel';
|
|
41
40
|
import KeyboardShortcutsRegister from '../keyboard-shortcuts/register';
|
|
42
41
|
import KeyboardShortcutsGlobal from '../keyboard-shortcuts/global';
|
|
43
42
|
import { useIsSiteEditorLoading } from './hooks';
|
|
44
43
|
import useMovingAnimation from './animation';
|
|
45
44
|
import SidebarContent from '../sidebar';
|
|
46
45
|
import SaveHub from '../save-hub';
|
|
46
|
+
import SavePanel from '../save-panel';
|
|
47
47
|
import useSyncCanvasModeWithURL from '../sync-state-with-url/use-sync-canvas-mode-with-url';
|
|
48
48
|
|
|
49
49
|
const { useCommands } = unlock( coreCommandsPrivateApis );
|
|
@@ -163,6 +163,7 @@ export default function Layout( { route } ) {
|
|
|
163
163
|
{ areas.sidebar }
|
|
164
164
|
</SidebarContent>
|
|
165
165
|
<SaveHub />
|
|
166
|
+
<SavePanel />
|
|
166
167
|
</motion.div>
|
|
167
168
|
) }
|
|
168
169
|
</AnimatePresence>
|
|
@@ -173,6 +174,16 @@ export default function Layout( { route } ) {
|
|
|
173
174
|
|
|
174
175
|
{ isMobileViewport && areas.mobile && (
|
|
175
176
|
<div className="edit-site-layout__mobile">
|
|
177
|
+
{ canvasMode !== 'edit' && (
|
|
178
|
+
<SidebarContent routeKey={ routeKey }>
|
|
179
|
+
<SiteHubMobile
|
|
180
|
+
ref={ toggleRef }
|
|
181
|
+
isTransparent={
|
|
182
|
+
isResizableFrameOversized
|
|
183
|
+
}
|
|
184
|
+
/>
|
|
185
|
+
</SidebarContent>
|
|
186
|
+
) }
|
|
176
187
|
{ areas.mobile }
|
|
177
188
|
</div>
|
|
178
189
|
) }
|
|
@@ -190,6 +201,17 @@ export default function Layout( { route } ) {
|
|
|
190
201
|
</div>
|
|
191
202
|
) }
|
|
192
203
|
|
|
204
|
+
{ ! isMobileViewport && areas.edit && (
|
|
205
|
+
<div
|
|
206
|
+
className="edit-site-layout__area"
|
|
207
|
+
style={ {
|
|
208
|
+
maxWidth: widths?.edit,
|
|
209
|
+
} }
|
|
210
|
+
>
|
|
211
|
+
{ areas.edit }
|
|
212
|
+
</div>
|
|
213
|
+
) }
|
|
214
|
+
|
|
193
215
|
{ ! isMobileViewport && areas.preview && (
|
|
194
216
|
<div className="edit-site-layout__canvas-container">
|
|
195
217
|
{ canvasResizer }
|
|
@@ -236,8 +258,6 @@ export default function Layout( { route } ) {
|
|
|
236
258
|
</div>
|
|
237
259
|
) }
|
|
238
260
|
</div>
|
|
239
|
-
|
|
240
|
-
<SavePanel />
|
|
241
261
|
</div>
|
|
242
262
|
</>
|
|
243
263
|
);
|