@wordpress/edit-site 6.12.1-next.082ed6819.0 → 6.13.1-next.a9f418477.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 +2 -0
- package/build/components/add-new-pattern/index.js +3 -16
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/add-new-post/index.js +1 -1
- package/build/components/add-new-post/index.js.map +1 -1
- package/build/components/add-new-template/index.js +1 -5
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/app/index.js +31 -29
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/use-editor-iframe-props.js +8 -8
- package/build/components/block-editor/use-editor-iframe-props.js.map +1 -1
- package/build/components/block-editor/use-navigate-to-entity-record.js +1 -5
- package/build/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js +4 -4
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/dataviews-actions/index.js +1 -5
- package/build/components/dataviews-actions/index.js.map +1 -1
- package/build/components/editor/index.js +38 -22
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor/use-editor-title.js +5 -0
- package/build/components/editor/use-editor-title.js.map +1 -1
- package/build/components/editor/use-resolve-edited-entity.js +19 -4
- package/build/components/editor/use-resolve-edited-entity.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +0 -1
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +36 -26
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +0 -1
- 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 +0 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build/components/global-styles/preview-colors.js +2 -2
- package/build/components/global-styles/preview-colors.js.map +1 -1
- package/build/components/global-styles/preview-styles.js +2 -2
- package/build/components/global-styles/preview-styles.js.map +1 -1
- package/build/components/global-styles/preview-typography.js +2 -2
- package/build/components/global-styles/preview-typography.js.map +1 -1
- package/build/components/global-styles/{preview-iframe.js → preview-wrapper.js} +10 -29
- package/build/components/global-styles/preview-wrapper.js.map +1 -0
- package/build/components/global-styles/typography-example.js +8 -1
- package/build/components/global-styles/typography-example.js.map +1 -1
- package/build/components/global-styles-sidebar/index.js +5 -5
- package/build/components/global-styles-sidebar/index.js.map +1 -1
- package/build/components/layout/index.js +44 -19
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page-patterns/delete-category-menu-item.js +1 -4
- package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build/components/page-patterns/fields.js +6 -57
- package/build/components/page-patterns/fields.js.map +1 -1
- package/build/components/page-patterns/index.js +31 -30
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-templates/fields.js +6 -34
- package/build/components/page-templates/fields.js.map +1 -1
- package/build/components/page-templates/index.js +34 -46
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/post-edit/header.js +83 -0
- package/build/components/post-edit/header.js.map +1 -0
- package/build/components/post-edit/index.js +42 -7
- package/build/components/post-edit/index.js.map +1 -1
- package/build/components/post-list/index.js +26 -40
- package/build/components/post-list/index.js.map +1 -1
- package/build/components/posts-app/index.js +10 -16
- package/build/components/posts-app/index.js.map +1 -1
- package/build/components/posts-app-routes/index.js +3 -7
- package/build/components/posts-app-routes/index.js.map +1 -1
- package/build/components/posts-app-routes/{posts-edit.js → post-item.js} +9 -13
- package/build/components/posts-app-routes/post-item.js.map +1 -0
- package/build/components/posts-app-routes/posts.js +89 -0
- package/build/components/posts-app-routes/posts.js.map +1 -0
- package/build/components/resizable-frame/index.js +6 -5
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/save-panel/index.js +9 -6
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar-dataviews/add-new-view.js +7 -8
- package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build/components/sidebar-dataviews/dataview-item.js +5 -8
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +7 -24
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +4 -3
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/sidebar-global-styles-wrapper/index.js +18 -18
- package/build/components/sidebar-global-styles-wrapper/index.js.map +1 -1
- package/build/components/sidebar-navigation-item/index.js +8 -5
- package/build/components/sidebar-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +2 -2
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/content.js +12 -38
- package/build/components/sidebar-navigation-screen-global-styles/content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +8 -19
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +6 -14
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -5
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -7
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +1 -6
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +14 -20
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/category-item.js +5 -7
- package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +4 -5
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.js +25 -16
- package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +1 -14
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/site-editor-routes/{home-view.js → home.js} +7 -8
- package/build/components/site-editor-routes/home.js.map +1 -0
- package/build/components/site-editor-routes/index.js +12 -18
- package/build/components/site-editor-routes/index.js.map +1 -1
- package/build/components/site-editor-routes/navigation-item.js +49 -0
- package/build/components/site-editor-routes/navigation-item.js.map +1 -0
- package/build/components/{posts-app-routes/home.js → site-editor-routes/navigation.js} +16 -18
- package/build/components/site-editor-routes/navigation.js.map +1 -0
- package/build/components/site-editor-routes/{pages-edit.js → page-item.js} +10 -17
- package/build/components/site-editor-routes/page-item.js.map +1 -0
- package/build/components/site-editor-routes/pages.js +87 -0
- package/build/components/site-editor-routes/pages.js.map +1 -0
- package/build/components/site-editor-routes/{home-edit.js → pattern-item.js} +11 -11
- package/build/components/site-editor-routes/pattern-item.js.map +1 -0
- package/build/components/site-editor-routes/{patterns-view.js → patterns.js} +6 -9
- package/build/components/site-editor-routes/patterns.js.map +1 -0
- package/build/components/site-editor-routes/{styles-view.js → styles.js} +28 -9
- package/build/components/site-editor-routes/styles.js.map +1 -0
- package/build/components/site-editor-routes/{templates-edit.js → template-item.js} +6 -11
- package/build/components/site-editor-routes/template-item.js.map +1 -0
- package/build/components/site-editor-routes/{patterns-edit.js → template-part-item.js} +6 -11
- package/build/components/site-editor-routes/template-part-item.js.map +1 -0
- package/build/components/site-editor-routes/{templates-list-view.js → templates.js} +20 -13
- package/build/components/site-editor-routes/templates.js.map +1 -0
- package/build/components/site-hub/index.js +3 -3
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/style-book/constants.js +8 -19
- package/build/components/style-book/constants.js.map +1 -1
- package/build/components/style-book/examples.js +42 -27
- package/build/components/style-book/examples.js.map +1 -1
- package/build/components/style-book/index.js +21 -5
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/style-book/types.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +12 -48
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/commands/use-set-command-context.js +2 -2
- package/build/hooks/commands/use-set-command-context.js.map +1 -1
- package/build/store/private-actions.js +7 -0
- package/build/store/private-actions.js.map +1 -1
- package/build/store/reducer.js +2 -0
- package/build/store/reducer.js.map +1 -1
- package/build/utils/is-previewing-theme.js +1 -1
- package/build/utils/is-previewing-theme.js.map +1 -1
- package/build/utils/use-activate-theme.js +9 -8
- package/build/utils/use-activate-theme.js.map +1 -1
- package/build-module/components/add-new-pattern/index.js +3 -16
- package/build-module/components/add-new-pattern/index.js.map +1 -1
- package/build-module/components/add-new-post/index.js +1 -1
- package/build-module/components/add-new-post/index.js.map +1 -1
- package/build-module/components/add-new-template/index.js +1 -5
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/app/index.js +33 -31
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/use-editor-iframe-props.js +8 -8
- package/build-module/components/block-editor/use-editor-iframe-props.js.map +1 -1
- package/build-module/components/block-editor/use-navigate-to-entity-record.js +1 -5
- package/build-module/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +4 -4
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/dataviews-actions/index.js +1 -5
- package/build-module/components/dataviews-actions/index.js.map +1 -1
- package/build-module/components/editor/index.js +38 -22
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor/use-editor-title.js +5 -0
- package/build-module/components/editor/use-editor-title.js.map +1 -1
- package/build-module/components/editor/use-resolve-edited-entity.js +19 -4
- package/build-module/components/editor/use-resolve-edited-entity.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +0 -1
- 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 +37 -27
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +0 -1
- 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 +0 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build-module/components/global-styles/preview-colors.js +2 -2
- package/build-module/components/global-styles/preview-colors.js.map +1 -1
- package/build-module/components/global-styles/preview-styles.js +2 -2
- package/build-module/components/global-styles/preview-styles.js.map +1 -1
- package/build-module/components/global-styles/preview-typography.js +2 -2
- package/build-module/components/global-styles/preview-typography.js.map +1 -1
- package/build-module/components/global-styles/{preview-iframe.js → preview-wrapper.js} +12 -31
- package/build-module/components/global-styles/preview-wrapper.js.map +1 -0
- package/build-module/components/global-styles/typography-example.js +8 -1
- package/build-module/components/global-styles/typography-example.js.map +1 -1
- package/build-module/components/global-styles-sidebar/index.js +5 -5
- package/build-module/components/global-styles-sidebar/index.js.map +1 -1
- package/build-module/components/layout/index.js +45 -20
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page-patterns/delete-category-menu-item.js +1 -4
- package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/fields.js +7 -58
- package/build-module/components/page-patterns/fields.js.map +1 -1
- package/build-module/components/page-patterns/index.js +29 -28
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-templates/fields.js +5 -31
- package/build-module/components/page-templates/fields.js.map +1 -1
- package/build-module/components/page-templates/index.js +33 -45
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/post-edit/header.js +76 -0
- package/build-module/components/post-edit/header.js.map +1 -0
- package/build-module/components/post-edit/index.js +42 -7
- package/build-module/components/post-edit/index.js.map +1 -1
- package/build-module/components/post-list/index.js +26 -40
- package/build-module/components/post-list/index.js.map +1 -1
- 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-routes/index.js +3 -7
- package/build-module/components/posts-app-routes/index.js.map +1 -1
- package/build-module/components/posts-app-routes/{posts-edit.js → post-item.js} +8 -12
- package/build-module/components/posts-app-routes/post-item.js.map +1 -0
- package/build-module/components/posts-app-routes/posts.js +81 -0
- package/build-module/components/posts-app-routes/posts.js.map +1 -0
- package/build-module/components/resizable-frame/index.js +6 -5
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +9 -6
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js +7 -8
- package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js +5 -8
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +7 -24
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +4 -3
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-global-styles-wrapper/index.js +18 -18
- package/build-module/components/sidebar-global-styles-wrapper/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-item/index.js +8 -5
- package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +2 -2
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/content.js +12 -38
- package/build-module/components/sidebar-navigation-screen-global-styles/content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +9 -20
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +6 -14
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -5
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -7
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +1 -6
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +14 -20
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +5 -7
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +4 -5
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +25 -16
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +1 -14
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/site-editor-routes/{home-edit.js → home.js} +5 -7
- package/build-module/components/site-editor-routes/home.js.map +1 -0
- package/build-module/components/site-editor-routes/index.js +12 -18
- package/build-module/components/site-editor-routes/index.js.map +1 -1
- package/build-module/components/site-editor-routes/navigation-item.js +41 -0
- package/build-module/components/site-editor-routes/navigation-item.js.map +1 -0
- package/build-module/components/site-editor-routes/navigation.js +38 -0
- package/build-module/components/site-editor-routes/navigation.js.map +1 -0
- package/build-module/components/site-editor-routes/{pages-edit.js → page-item.js} +9 -16
- package/build-module/components/site-editor-routes/page-item.js.map +1 -0
- package/build-module/components/site-editor-routes/pages.js +79 -0
- package/build-module/components/site-editor-routes/pages.js.map +1 -0
- package/build-module/components/site-editor-routes/pattern-item.js +18 -0
- package/build-module/components/site-editor-routes/pattern-item.js.map +1 -0
- package/build-module/components/site-editor-routes/{patterns-view.js → patterns.js} +5 -8
- package/build-module/components/site-editor-routes/patterns.js.map +1 -0
- package/build-module/components/site-editor-routes/styles.js +44 -0
- package/build-module/components/site-editor-routes/styles.js.map +1 -0
- package/build-module/components/site-editor-routes/{templates-edit.js → template-item.js} +5 -10
- package/build-module/components/site-editor-routes/template-item.js.map +1 -0
- package/build-module/components/site-editor-routes/template-part-item.js +18 -0
- package/build-module/components/site-editor-routes/template-part-item.js.map +1 -0
- package/build-module/components/site-editor-routes/templates.js +33 -0
- package/build-module/components/site-editor-routes/templates.js.map +1 -0
- package/build-module/components/site-hub/index.js +3 -3
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/style-book/constants.js +8 -19
- package/build-module/components/style-book/constants.js.map +1 -1
- package/build-module/components/style-book/examples.js +42 -27
- package/build-module/components/style-book/examples.js.map +1 -1
- package/build-module/components/style-book/index.js +21 -5
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/style-book/types.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +12 -48
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/commands/use-set-command-context.js +2 -2
- package/build-module/hooks/commands/use-set-command-context.js.map +1 -1
- package/build-module/store/private-actions.js +6 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/reducer.js +2 -0
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/utils/is-previewing-theme.js +1 -1
- package/build-module/utils/is-previewing-theme.js.map +1 -1
- package/build-module/utils/use-activate-theme.js +9 -8
- package/build-module/utils/use-activate-theme.js.map +1 -1
- package/build-style/posts-rtl.css +73 -107
- package/build-style/posts.css +73 -107
- package/build-style/style-rtl.css +201 -142
- package/build-style/style.css +201 -142
- package/package.json +40 -40
- package/src/components/add-new-pattern/index.js +9 -17
- package/src/components/add-new-post/index.js +1 -1
- package/src/components/add-new-template/index.js +3 -5
- package/src/components/app/index.js +34 -35
- package/src/components/block-editor/use-editor-iframe-props.js +5 -4
- package/src/components/block-editor/use-navigate-to-entity-record.js +3 -1
- package/src/components/block-editor/use-site-editor-settings.js +6 -6
- package/src/components/dataviews-actions/index.js +1 -5
- package/src/components/editor/index.js +64 -29
- package/src/components/editor/use-editor-title.js +4 -0
- package/src/components/editor/use-resolve-edited-entity.js +17 -2
- package/src/components/global-styles/font-library-modal/font-collection.js +40 -27
- package/src/components/global-styles/font-library-modal/style.scss +12 -5
- package/src/components/global-styles/preview-colors.js +3 -3
- package/src/components/global-styles/preview-styles.js +3 -3
- package/src/components/global-styles/preview-typography.js +3 -3
- package/src/components/global-styles/{preview-iframe.js → preview-wrapper.js} +9 -35
- package/src/components/global-styles/style.scss +5 -1
- package/src/components/global-styles/typography-example.js +12 -1
- package/src/components/global-styles-sidebar/index.js +4 -4
- package/src/components/layout/index.js +43 -11
- package/src/components/page-patterns/delete-category-menu-item.js +3 -4
- package/src/components/page-patterns/fields.js +9 -65
- package/src/components/page-patterns/index.js +39 -25
- package/src/components/page-patterns/style.scss +0 -28
- package/src/components/page-templates/fields.js +3 -31
- package/src/components/page-templates/index.js +34 -51
- package/src/components/post-edit/header.js +88 -0
- package/src/components/post-edit/index.js +39 -7
- package/src/components/post-edit/style.scss +10 -0
- package/src/components/post-list/index.js +44 -40
- package/src/components/post-list/style.scss +0 -36
- package/src/components/posts-app/index.js +9 -18
- package/src/components/posts-app-routes/index.js +3 -14
- package/src/components/posts-app-routes/{posts-edit.js → post-item.js} +5 -9
- package/src/components/posts-app-routes/posts.js +66 -0
- package/src/components/resizable-frame/index.js +6 -7
- package/src/components/save-panel/index.js +11 -5
- package/src/components/sidebar-dataviews/add-new-view.js +9 -9
- package/src/components/sidebar-dataviews/dataview-item.js +5 -8
- package/src/components/sidebar-dataviews/default-views.js +7 -24
- package/src/components/sidebar-dataviews/index.js +2 -2
- package/src/components/sidebar-dataviews/style.scss +2 -2
- package/src/components/sidebar-global-styles-wrapper/index.js +24 -30
- package/src/components/sidebar-navigation-item/index.js +7 -5
- package/src/components/sidebar-navigation-item/style.scss +1 -2
- package/src/components/sidebar-navigation-screen/index.js +2 -2
- package/src/components/sidebar-navigation-screen/style.scss +2 -2
- package/src/components/sidebar-navigation-screen-global-styles/content.js +7 -35
- package/src/components/sidebar-navigation-screen-global-styles/index.js +13 -34
- package/src/components/sidebar-navigation-screen-main/index.js +6 -10
- package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +3 -5
- package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -2
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +6 -6
- package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +9 -21
- package/src/components/sidebar-navigation-screen-patterns/category-item.js +5 -20
- package/src/components/sidebar-navigation-screen-patterns/index.js +3 -4
- package/src/components/sidebar-navigation-screen-templates-browse/content.js +24 -18
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +1 -14
- package/src/components/site-editor-routes/{home-view.js → home.js} +4 -5
- package/src/components/site-editor-routes/index.js +22 -34
- package/src/components/site-editor-routes/navigation-item.js +39 -0
- package/src/components/site-editor-routes/navigation.js +34 -0
- package/src/components/site-editor-routes/{pages-edit.js → page-item.js} +6 -14
- package/src/components/site-editor-routes/pages.js +66 -0
- package/src/components/site-editor-routes/pattern-item.js +15 -0
- package/src/components/site-editor-routes/patterns.js +15 -0
- package/src/components/site-editor-routes/styles.js +39 -0
- package/src/components/site-editor-routes/template-item.js +15 -0
- package/src/components/site-editor-routes/template-part-item.js +15 -0
- package/src/components/site-editor-routes/templates.js +26 -0
- package/src/components/site-hub/index.js +3 -6
- package/src/components/style-book/constants.ts +8 -19
- package/src/components/style-book/examples.tsx +47 -28
- package/src/components/style-book/index.js +28 -5
- package/src/components/style-book/types.ts +1 -1
- package/src/hooks/commands/use-common-commands.js +14 -72
- package/src/hooks/commands/use-set-command-context.js +2 -2
- package/src/store/private-actions.js +7 -0
- package/src/store/reducer.js +2 -0
- package/src/style.scss +1 -0
- package/src/utils/is-previewing-theme.js +1 -3
- package/src/utils/use-activate-theme.js +4 -3
- package/build/components/error-boundary/index.js +0 -47
- package/build/components/error-boundary/index.js.map +0 -1
- package/build/components/error-boundary/warning.js +0 -42
- package/build/components/error-boundary/warning.js.map +0 -1
- package/build/components/global-styles/preview-iframe.js.map +0 -1
- package/build/components/layout/router.js +0 -92
- package/build/components/layout/router.js.map +0 -1
- package/build/components/posts-app-routes/home.js.map +0 -1
- package/build/components/posts-app-routes/posts-edit.js.map +0 -1
- package/build/components/posts-app-routes/posts-list-view-quick-edit.js +0 -63
- package/build/components/posts-app-routes/posts-list-view-quick-edit.js.map +0 -1
- package/build/components/posts-app-routes/posts-list-view.js +0 -48
- package/build/components/posts-app-routes/posts-list-view.js.map +0 -1
- package/build/components/posts-app-routes/posts-view-quick-edit.js +0 -60
- package/build/components/posts-app-routes/posts-view-quick-edit.js.map +0 -1
- package/build/components/posts-app-routes/posts-view.js +0 -41
- package/build/components/posts-app-routes/posts-view.js.map +0 -1
- package/build/components/routes/link.js +0 -69
- package/build/components/routes/link.js.map +0 -1
- package/build/components/site-editor-routes/home-edit.js.map +0 -1
- package/build/components/site-editor-routes/home-view.js.map +0 -1
- package/build/components/site-editor-routes/navigation-edit.js +0 -29
- package/build/components/site-editor-routes/navigation-edit.js.map +0 -1
- package/build/components/site-editor-routes/navigation-item-edit.js +0 -31
- package/build/components/site-editor-routes/navigation-item-edit.js.map +0 -1
- package/build/components/site-editor-routes/navigation-item-view.js +0 -30
- package/build/components/site-editor-routes/navigation-item-view.js.map +0 -1
- package/build/components/site-editor-routes/navigation-view.js +0 -28
- package/build/components/site-editor-routes/navigation-view.js.map +0 -1
- package/build/components/site-editor-routes/pages-edit.js.map +0 -1
- package/build/components/site-editor-routes/pages-list-view-quick-edit.js +0 -64
- package/build/components/site-editor-routes/pages-list-view-quick-edit.js.map +0 -1
- package/build/components/site-editor-routes/pages-list-view.js +0 -47
- package/build/components/site-editor-routes/pages-list-view.js.map +0 -1
- package/build/components/site-editor-routes/pages-view-quick-edit.js +0 -61
- package/build/components/site-editor-routes/pages-view-quick-edit.js.map +0 -1
- package/build/components/site-editor-routes/pages-view.js +0 -42
- package/build/components/site-editor-routes/pages-view.js.map +0 -1
- package/build/components/site-editor-routes/patterns-edit.js.map +0 -1
- package/build/components/site-editor-routes/patterns-view.js.map +0 -1
- package/build/components/site-editor-routes/styles-view.js.map +0 -1
- package/build/components/site-editor-routes/templates-edit.js.map +0 -1
- package/build/components/site-editor-routes/templates-list-view.js.map +0 -1
- package/build/components/site-editor-routes/templates-view.js +0 -29
- package/build/components/site-editor-routes/templates-view.js.map +0 -1
- package/build-module/components/error-boundary/index.js +0 -38
- package/build-module/components/error-boundary/index.js.map +0 -1
- package/build-module/components/error-boundary/warning.js +0 -35
- package/build-module/components/error-boundary/warning.js.map +0 -1
- package/build-module/components/global-styles/preview-iframe.js.map +0 -1
- package/build-module/components/layout/router.js +0 -84
- package/build-module/components/layout/router.js.map +0 -1
- package/build-module/components/posts-app-routes/home.js +0 -40
- package/build-module/components/posts-app-routes/home.js.map +0 -1
- package/build-module/components/posts-app-routes/posts-edit.js.map +0 -1
- package/build-module/components/posts-app-routes/posts-list-view-quick-edit.js +0 -55
- package/build-module/components/posts-app-routes/posts-list-view-quick-edit.js.map +0 -1
- package/build-module/components/posts-app-routes/posts-list-view.js +0 -40
- package/build-module/components/posts-app-routes/posts-list-view.js.map +0 -1
- package/build-module/components/posts-app-routes/posts-view-quick-edit.js +0 -52
- package/build-module/components/posts-app-routes/posts-view-quick-edit.js.map +0 -1
- package/build-module/components/posts-app-routes/posts-view.js +0 -33
- package/build-module/components/posts-app-routes/posts-view.js.map +0 -1
- package/build-module/components/routes/link.js +0 -61
- package/build-module/components/routes/link.js.map +0 -1
- package/build-module/components/site-editor-routes/home-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/home-view.js +0 -17
- package/build-module/components/site-editor-routes/home-view.js.map +0 -1
- package/build-module/components/site-editor-routes/navigation-edit.js +0 -21
- package/build-module/components/site-editor-routes/navigation-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/navigation-item-edit.js +0 -23
- package/build-module/components/site-editor-routes/navigation-item-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/navigation-item-view.js +0 -22
- package/build-module/components/site-editor-routes/navigation-item-view.js.map +0 -1
- package/build-module/components/site-editor-routes/navigation-view.js +0 -20
- package/build-module/components/site-editor-routes/navigation-view.js.map +0 -1
- package/build-module/components/site-editor-routes/pages-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js +0 -56
- package/build-module/components/site-editor-routes/pages-list-view-quick-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/pages-list-view.js +0 -39
- package/build-module/components/site-editor-routes/pages-list-view.js.map +0 -1
- package/build-module/components/site-editor-routes/pages-view-quick-edit.js +0 -53
- package/build-module/components/site-editor-routes/pages-view-quick-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/pages-view.js +0 -34
- package/build-module/components/site-editor-routes/pages-view.js.map +0 -1
- package/build-module/components/site-editor-routes/patterns-edit.js +0 -23
- package/build-module/components/site-editor-routes/patterns-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/patterns-view.js.map +0 -1
- package/build-module/components/site-editor-routes/styles-view.js +0 -25
- package/build-module/components/site-editor-routes/styles-view.js.map +0 -1
- package/build-module/components/site-editor-routes/templates-edit.js.map +0 -1
- package/build-module/components/site-editor-routes/templates-list-view.js +0 -26
- package/build-module/components/site-editor-routes/templates-list-view.js.map +0 -1
- package/build-module/components/site-editor-routes/templates-view.js +0 -21
- package/build-module/components/site-editor-routes/templates-view.js.map +0 -1
- package/src/components/error-boundary/index.js +0 -44
- package/src/components/error-boundary/test/error-boundary.js +0 -40
- package/src/components/error-boundary/warning.js +0 -30
- package/src/components/layout/router.js +0 -86
- package/src/components/posts-app-routes/home.js +0 -36
- package/src/components/posts-app-routes/posts-list-view-quick-edit.js +0 -52
- package/src/components/posts-app-routes/posts-list-view.js +0 -40
- package/src/components/posts-app-routes/posts-view-quick-edit.js +0 -49
- package/src/components/posts-app-routes/posts-view.js +0 -35
- package/src/components/routes/link.js +0 -68
- package/src/components/site-editor-routes/home-edit.js +0 -17
- package/src/components/site-editor-routes/navigation-edit.js +0 -22
- package/src/components/site-editor-routes/navigation-item-edit.js +0 -26
- package/src/components/site-editor-routes/navigation-item-view.js +0 -25
- package/src/components/site-editor-routes/navigation-view.js +0 -21
- package/src/components/site-editor-routes/pages-list-view-quick-edit.js +0 -56
- package/src/components/site-editor-routes/pages-list-view.js +0 -44
- package/src/components/site-editor-routes/pages-view-quick-edit.js +0 -53
- package/src/components/site-editor-routes/pages-view.js +0 -39
- package/src/components/site-editor-routes/patterns-edit.js +0 -24
- package/src/components/site-editor-routes/patterns-view.js +0 -22
- package/src/components/site-editor-routes/styles-view.js +0 -26
- package/src/components/site-editor-routes/templates-edit.js +0 -22
- package/src/components/site-editor-routes/templates-list-view.js +0 -28
- package/src/components/site-editor-routes/templates-view.js +0 -22
|
@@ -1,27 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
__unstableIframe as Iframe,
|
|
6
|
-
__unstableEditorStyles as EditorStyles,
|
|
7
|
-
privateApis as blockEditorPrivateApis,
|
|
8
|
-
} from '@wordpress/block-editor';
|
|
4
|
+
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
9
5
|
import { __unstableMotion as motion } from '@wordpress/components';
|
|
10
6
|
import {
|
|
11
7
|
useThrottle,
|
|
12
8
|
useReducedMotion,
|
|
13
9
|
useResizeObserver,
|
|
14
10
|
} from '@wordpress/compose';
|
|
15
|
-
import { useLayoutEffect, useState
|
|
11
|
+
import { useLayoutEffect, useState } from '@wordpress/element';
|
|
16
12
|
|
|
17
13
|
/**
|
|
18
14
|
* Internal dependencies
|
|
19
15
|
*/
|
|
20
16
|
import { unlock } from '../../lock-unlock';
|
|
21
17
|
|
|
22
|
-
const { useGlobalStyle
|
|
23
|
-
blockEditorPrivateApis
|
|
24
|
-
);
|
|
18
|
+
const { useGlobalStyle } = unlock( blockEditorPrivateApis );
|
|
25
19
|
|
|
26
20
|
const normalizedWidth = 248;
|
|
27
21
|
const normalizedHeight = 152;
|
|
@@ -33,7 +27,7 @@ const THROTTLE_OPTIONS = {
|
|
|
33
27
|
trailing: true,
|
|
34
28
|
};
|
|
35
29
|
|
|
36
|
-
export default function
|
|
30
|
+
export default function PreviewWrapper( {
|
|
37
31
|
children,
|
|
38
32
|
label,
|
|
39
33
|
isFocused,
|
|
@@ -41,7 +35,6 @@ export default function PreviewIframe( {
|
|
|
41
35
|
} ) {
|
|
42
36
|
const [ backgroundColor = 'white' ] = useGlobalStyle( 'color.background' );
|
|
43
37
|
const [ gradientValue ] = useGlobalStyle( 'color.gradient' );
|
|
44
|
-
const [ styles ] = useGlobalStylesOutput();
|
|
45
38
|
const disableMotion = useReducedMotion();
|
|
46
39
|
const [ isHovered, setIsHovered ] = useState( false );
|
|
47
40
|
const [ containerResizeListener, { width } ] = useResizeObserver();
|
|
@@ -54,7 +47,7 @@ export default function PreviewIframe( {
|
|
|
54
47
|
THROTTLE_OPTIONS
|
|
55
48
|
);
|
|
56
49
|
|
|
57
|
-
// Must use useLayoutEffect to avoid a flash of the
|
|
50
|
+
// Must use useLayoutEffect to avoid a flash of the container at the wrong
|
|
58
51
|
// size before the width is set.
|
|
59
52
|
useLayoutEffect( () => {
|
|
60
53
|
if ( width ) {
|
|
@@ -62,7 +55,7 @@ export default function PreviewIframe( {
|
|
|
62
55
|
}
|
|
63
56
|
}, [ width, setThrottledWidth ] );
|
|
64
57
|
|
|
65
|
-
// Must use useLayoutEffect to avoid a flash of the
|
|
58
|
+
// Must use useLayoutEffect to avoid a flash of the container at the wrong
|
|
66
59
|
// size before the width is set.
|
|
67
60
|
useLayoutEffect( () => {
|
|
68
61
|
const newRatio = throttledWidth ? throttledWidth / normalizedWidth : 1;
|
|
@@ -89,24 +82,6 @@ export default function PreviewIframe( {
|
|
|
89
82
|
*/
|
|
90
83
|
const ratio = ratioState ? ratioState : fallbackRatio;
|
|
91
84
|
|
|
92
|
-
/*
|
|
93
|
-
* Reset leaked styles from WP common.css and remove main content layout padding and border.
|
|
94
|
-
* Add pointer cursor to the body to indicate the iframe is interactive,
|
|
95
|
-
* similar to Typography variation previews.
|
|
96
|
-
*/
|
|
97
|
-
const editorStyles = useMemo( () => {
|
|
98
|
-
if ( styles ) {
|
|
99
|
-
return [
|
|
100
|
-
...styles,
|
|
101
|
-
{
|
|
102
|
-
css: 'html{overflow:hidden}body{min-width: 0;padding: 0;border: none;cursor: pointer;}',
|
|
103
|
-
isGlobalStyles: true,
|
|
104
|
-
},
|
|
105
|
-
];
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
return styles;
|
|
109
|
-
}, [ styles ] );
|
|
110
85
|
const isReady = !! width;
|
|
111
86
|
|
|
112
87
|
return (
|
|
@@ -115,8 +90,8 @@ export default function PreviewIframe( {
|
|
|
115
90
|
{ containerResizeListener }
|
|
116
91
|
</div>
|
|
117
92
|
{ isReady && (
|
|
118
|
-
<
|
|
119
|
-
className="edit-site-global-styles-
|
|
93
|
+
<div
|
|
94
|
+
className="edit-site-global-styles-preview__wrapper"
|
|
120
95
|
style={ {
|
|
121
96
|
height: normalizedHeight * ratio,
|
|
122
97
|
} }
|
|
@@ -124,7 +99,6 @@ export default function PreviewIframe( {
|
|
|
124
99
|
onMouseLeave={ () => setIsHovered( false ) }
|
|
125
100
|
tabIndex={ -1 }
|
|
126
101
|
>
|
|
127
|
-
<EditorStyles styles={ editorStyles } />
|
|
128
102
|
<motion.div
|
|
129
103
|
style={ {
|
|
130
104
|
height: normalizedHeight * ratio,
|
|
@@ -145,7 +119,7 @@ export default function PreviewIframe( {
|
|
|
145
119
|
.concat( children ) // This makes sure children is always an array.
|
|
146
120
|
.map( ( child, key ) => child( { ratio, key } ) ) }
|
|
147
121
|
</motion.div>
|
|
148
|
-
</
|
|
122
|
+
</div>
|
|
149
123
|
) }
|
|
150
124
|
</>
|
|
151
125
|
);
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
cursor: pointer;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
.edit-site-global-styles-
|
|
9
|
+
.edit-site-global-styles-preview__wrapper {
|
|
10
10
|
max-width: 100%;
|
|
11
11
|
display: block;
|
|
12
12
|
width: 100%;
|
|
@@ -211,6 +211,10 @@
|
|
|
211
211
|
flex-direction: column;
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
+
.edit-site-global-styles-sidebar__navigator-screen .single-column {
|
|
215
|
+
grid-column: span 1;
|
|
216
|
+
}
|
|
217
|
+
|
|
214
218
|
.edit-site-global-styles-screen-root.edit-site-global-styles-screen-root,
|
|
215
219
|
.edit-site-global-styles-screen-style-variations.edit-site-global-styles-screen-style-variations {
|
|
216
220
|
background: unset;
|
|
@@ -14,7 +14,9 @@ import { unlock } from '../../lock-unlock';
|
|
|
14
14
|
import { getFamilyPreviewStyle } from './font-library-modal/utils/preview-styles';
|
|
15
15
|
import { getFontFamilies } from './utils';
|
|
16
16
|
|
|
17
|
-
const { GlobalStylesContext } = unlock(
|
|
17
|
+
const { useGlobalStyle, GlobalStylesContext } = unlock(
|
|
18
|
+
blockEditorPrivateApis
|
|
19
|
+
);
|
|
18
20
|
const { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );
|
|
19
21
|
|
|
20
22
|
export default function PreviewTypography( { fontSize, variation } ) {
|
|
@@ -23,6 +25,9 @@ export default function PreviewTypography( { fontSize, variation } ) {
|
|
|
23
25
|
if ( variation ) {
|
|
24
26
|
config = mergeBaseAndUserConfigs( base, variation );
|
|
25
27
|
}
|
|
28
|
+
|
|
29
|
+
const [ textColor ] = useGlobalStyle( 'color.text' );
|
|
30
|
+
|
|
26
31
|
const [ bodyFontFamilies, headingFontFamilies ] = getFontFamilies( config );
|
|
27
32
|
const bodyPreviewStyle = bodyFontFamilies
|
|
28
33
|
? getFamilyPreviewStyle( bodyFontFamilies )
|
|
@@ -31,6 +36,11 @@ export default function PreviewTypography( { fontSize, variation } ) {
|
|
|
31
36
|
? getFamilyPreviewStyle( headingFontFamilies )
|
|
32
37
|
: {};
|
|
33
38
|
|
|
39
|
+
if ( textColor ) {
|
|
40
|
+
bodyPreviewStyle.color = textColor;
|
|
41
|
+
headingPreviewStyle.color = textColor;
|
|
42
|
+
}
|
|
43
|
+
|
|
34
44
|
if ( fontSize ) {
|
|
35
45
|
bodyPreviewStyle.fontSize = fontSize;
|
|
36
46
|
headingPreviewStyle.fontSize = fontSize;
|
|
@@ -52,6 +62,7 @@ export default function PreviewTypography( { fontSize, variation } ) {
|
|
|
52
62
|
} }
|
|
53
63
|
style={ {
|
|
54
64
|
textAlign: 'center',
|
|
65
|
+
lineHeight: 1,
|
|
55
66
|
} }
|
|
56
67
|
>
|
|
57
68
|
<span style={ headingPreviewStyle }>
|
|
@@ -28,8 +28,8 @@ const { interfaceStore } = unlock( editorPrivateApis );
|
|
|
28
28
|
const { useLocation } = unlock( routerPrivateApis );
|
|
29
29
|
|
|
30
30
|
export default function GlobalStylesSidebar() {
|
|
31
|
-
const {
|
|
32
|
-
const { canvas = 'view',
|
|
31
|
+
const { query } = useLocation();
|
|
32
|
+
const { canvas = 'view', name } = query;
|
|
33
33
|
const {
|
|
34
34
|
shouldClearCanvasContainerView,
|
|
35
35
|
isStyleBookOpened,
|
|
@@ -133,14 +133,14 @@ export default function GlobalStylesSidebar() {
|
|
|
133
133
|
const previousActiveAreaRef = useRef( null );
|
|
134
134
|
|
|
135
135
|
useEffect( () => {
|
|
136
|
-
if (
|
|
136
|
+
if ( name === 'styles' && canvas === 'edit' ) {
|
|
137
137
|
previousActiveAreaRef.current =
|
|
138
138
|
getActiveComplementaryArea( 'core' );
|
|
139
139
|
enableComplementaryArea( 'core', 'edit-site/global-styles' );
|
|
140
140
|
} else if ( previousActiveAreaRef.current ) {
|
|
141
141
|
enableComplementaryArea( 'core', previousActiveAreaRef.current );
|
|
142
142
|
}
|
|
143
|
-
}, [
|
|
143
|
+
}, [ name, enableComplementaryArea, canvas, getActiveComplementaryArea ] );
|
|
144
144
|
|
|
145
145
|
return (
|
|
146
146
|
<DefaultSidebar
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
__unstableMotion as motion,
|
|
11
11
|
__unstableAnimatePresence as AnimatePresence,
|
|
12
12
|
__unstableUseNavigateRegions as useNavigateRegions,
|
|
13
|
+
SlotFillProvider,
|
|
13
14
|
} from '@wordpress/components';
|
|
14
15
|
import {
|
|
15
16
|
useReducedMotion,
|
|
@@ -17,21 +18,25 @@ import {
|
|
|
17
18
|
useResizeObserver,
|
|
18
19
|
usePrevious,
|
|
19
20
|
} from '@wordpress/compose';
|
|
20
|
-
import { __ } from '@wordpress/i18n';
|
|
21
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
21
22
|
import { useState, useRef, useEffect } from '@wordpress/element';
|
|
22
23
|
import { CommandMenu } from '@wordpress/commands';
|
|
23
24
|
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
24
25
|
import {
|
|
25
26
|
EditorSnackbars,
|
|
27
|
+
UnsavedChangesWarning,
|
|
28
|
+
ErrorBoundary,
|
|
26
29
|
privateApis as editorPrivateApis,
|
|
27
30
|
} from '@wordpress/editor';
|
|
28
31
|
import { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';
|
|
29
32
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
33
|
+
import { PluginArea } from '@wordpress/plugins';
|
|
34
|
+
import { store as noticesStore } from '@wordpress/notices';
|
|
35
|
+
import { useDispatch } from '@wordpress/data';
|
|
30
36
|
|
|
31
37
|
/**
|
|
32
38
|
* Internal dependencies
|
|
33
39
|
*/
|
|
34
|
-
import ErrorBoundary from '../error-boundary';
|
|
35
40
|
import { default as SiteHub, SiteHubMobile } from '../site-hub';
|
|
36
41
|
import ResizableFrame from '../resizable-frame';
|
|
37
42
|
import { unlock } from '../../lock-unlock';
|
|
@@ -44,14 +49,14 @@ import SavePanel from '../save-panel';
|
|
|
44
49
|
|
|
45
50
|
const { useCommands } = unlock( coreCommandsPrivateApis );
|
|
46
51
|
const { useGlobalStyle } = unlock( blockEditorPrivateApis );
|
|
47
|
-
const { NavigableRegion } = unlock( editorPrivateApis );
|
|
52
|
+
const { NavigableRegion, GlobalStylesProvider } = unlock( editorPrivateApis );
|
|
48
53
|
const { useLocation } = unlock( routerPrivateApis );
|
|
49
54
|
|
|
50
55
|
const ANIMATION_DURATION = 0.3;
|
|
51
56
|
|
|
52
|
-
|
|
53
|
-
const {
|
|
54
|
-
const { canvas = 'view' } =
|
|
57
|
+
function Layout() {
|
|
58
|
+
const { query, name: routeKey, areas, widths } = useLocation();
|
|
59
|
+
const { canvas = 'view' } = query;
|
|
55
60
|
useCommands();
|
|
56
61
|
const isMobileViewport = useViewportMatch( 'medium', '<' );
|
|
57
62
|
const toggleRef = useRef();
|
|
@@ -61,7 +66,6 @@ export default function Layout( { route } ) {
|
|
|
61
66
|
const isEditorLoading = useIsSiteEditorLoading();
|
|
62
67
|
const [ isResizableFrameOversized, setIsResizableFrameOversized ] =
|
|
63
68
|
useState( false );
|
|
64
|
-
const { name: routeKey, areas, widths } = route;
|
|
65
69
|
const animationRef = useMovingAnimation( {
|
|
66
70
|
triggerAnimationOnChange: routeKey + '-' + canvas,
|
|
67
71
|
} );
|
|
@@ -78,6 +82,7 @@ export default function Layout( { route } ) {
|
|
|
78
82
|
|
|
79
83
|
return (
|
|
80
84
|
<>
|
|
85
|
+
<UnsavedChangesWarning />
|
|
81
86
|
<CommandMenu />
|
|
82
87
|
{ canvas === 'view' && <SaveKeyboardShortcut /> }
|
|
83
88
|
<div
|
|
@@ -131,7 +136,9 @@ export default function Layout( { route } ) {
|
|
|
131
136
|
}
|
|
132
137
|
routeKey={ routeKey }
|
|
133
138
|
>
|
|
134
|
-
|
|
139
|
+
<ErrorBoundary>
|
|
140
|
+
{ areas.sidebar }
|
|
141
|
+
</ErrorBoundary>
|
|
135
142
|
</SidebarContent>
|
|
136
143
|
<SaveHub />
|
|
137
144
|
<SavePanel />
|
|
@@ -155,7 +162,7 @@ export default function Layout( { route } ) {
|
|
|
155
162
|
/>
|
|
156
163
|
</SidebarContent>
|
|
157
164
|
) }
|
|
158
|
-
{ areas.mobile }
|
|
165
|
+
<ErrorBoundary>{ areas.mobile }</ErrorBoundary>
|
|
159
166
|
</div>
|
|
160
167
|
) }
|
|
161
168
|
|
|
@@ -168,7 +175,7 @@ export default function Layout( { route } ) {
|
|
|
168
175
|
maxWidth: widths?.content,
|
|
169
176
|
} }
|
|
170
177
|
>
|
|
171
|
-
{ areas.content }
|
|
178
|
+
<ErrorBoundary>{ areas.content }</ErrorBoundary>
|
|
172
179
|
</div>
|
|
173
180
|
) }
|
|
174
181
|
|
|
@@ -179,7 +186,7 @@ export default function Layout( { route } ) {
|
|
|
179
186
|
maxWidth: widths?.edit,
|
|
180
187
|
} }
|
|
181
188
|
>
|
|
182
|
-
{ areas.edit }
|
|
189
|
+
<ErrorBoundary>{ areas.edit }</ErrorBoundary>
|
|
183
190
|
</div>
|
|
184
191
|
) }
|
|
185
192
|
|
|
@@ -231,3 +238,28 @@ export default function Layout( { route } ) {
|
|
|
231
238
|
</>
|
|
232
239
|
);
|
|
233
240
|
}
|
|
241
|
+
|
|
242
|
+
export default function LayoutWithGlobalStylesProvider( props ) {
|
|
243
|
+
const { createErrorNotice } = useDispatch( noticesStore );
|
|
244
|
+
function onPluginAreaError( name ) {
|
|
245
|
+
createErrorNotice(
|
|
246
|
+
sprintf(
|
|
247
|
+
/* translators: %s: plugin name */
|
|
248
|
+
__(
|
|
249
|
+
'The "%s" plugin has encountered an error and cannot be rendered.'
|
|
250
|
+
),
|
|
251
|
+
name
|
|
252
|
+
)
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
return (
|
|
257
|
+
<SlotFillProvider>
|
|
258
|
+
<GlobalStylesProvider>
|
|
259
|
+
{ /** This needs to be within the SlotFillProvider */ }
|
|
260
|
+
<PluginArea onError={ onPluginAreaError } />
|
|
261
|
+
<Layout { ...props } />
|
|
262
|
+
</GlobalStylesProvider>
|
|
263
|
+
</SlotFillProvider>
|
|
264
|
+
);
|
|
265
|
+
}
|
|
@@ -59,10 +59,9 @@ export default function DeleteCategoryMenuItem( { category, onClose } ) {
|
|
|
59
59
|
);
|
|
60
60
|
|
|
61
61
|
onClose?.();
|
|
62
|
-
history.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
} );
|
|
62
|
+
history.navigate(
|
|
63
|
+
`/pattern?categoryId=${ PATTERN_DEFAULT_CATEGORY }`
|
|
64
|
+
);
|
|
66
65
|
} catch ( error ) {
|
|
67
66
|
const errorMessage =
|
|
68
67
|
error.message && error.code !== 'unknown_error'
|
|
@@ -6,21 +6,16 @@ import clsx from 'clsx';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
10
|
-
__experimentalHStack as HStack,
|
|
11
|
-
Button,
|
|
12
|
-
Tooltip,
|
|
13
|
-
FlexBlock,
|
|
14
|
-
} from '@wordpress/components';
|
|
9
|
+
import { __experimentalHStack as HStack } from '@wordpress/components';
|
|
15
10
|
import { __, _x } from '@wordpress/i18n';
|
|
16
11
|
import { useState, useMemo, useId } from '@wordpress/element';
|
|
17
12
|
import {
|
|
18
13
|
BlockPreview,
|
|
19
14
|
privateApis as blockEditorPrivateApis,
|
|
20
15
|
} from '@wordpress/block-editor';
|
|
21
|
-
import { Icon
|
|
16
|
+
import { Icon } from '@wordpress/icons';
|
|
22
17
|
import { parse } from '@wordpress/blocks';
|
|
23
|
-
import {
|
|
18
|
+
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
24
19
|
|
|
25
20
|
/**
|
|
26
21
|
* Internal dependencies
|
|
@@ -32,10 +27,10 @@ import {
|
|
|
32
27
|
OPERATOR_IS,
|
|
33
28
|
} from '../../utils/constants';
|
|
34
29
|
import { unlock } from '../../lock-unlock';
|
|
35
|
-
import { useLink } from '../routes/link';
|
|
36
30
|
import { useAddedBy } from '../page-templates/hooks';
|
|
37
31
|
import { defaultGetTitle } from './search-items';
|
|
38
32
|
|
|
33
|
+
const { useLink } = unlock( routerPrivateApis );
|
|
39
34
|
const { useGlobalStyle } = unlock( blockEditorPrivateApis );
|
|
40
35
|
|
|
41
36
|
function PreviewWrapper( { item, onClick, ariaDescribedBy, children } ) {
|
|
@@ -59,11 +54,11 @@ function PreviewField( { item } ) {
|
|
|
59
54
|
const isUserPattern = item.type === PATTERN_TYPES.user;
|
|
60
55
|
const isTemplatePart = item.type === TEMPLATE_PART_POST_TYPE;
|
|
61
56
|
const [ backgroundColor ] = useGlobalStyle( 'color.background' );
|
|
62
|
-
const { onClick } = useLink(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
canvas
|
|
66
|
-
|
|
57
|
+
const { onClick } = useLink(
|
|
58
|
+
`/${ item.type }/${
|
|
59
|
+
isUserPattern || isTemplatePart ? item.id : item.name
|
|
60
|
+
}?canvas=edit`
|
|
61
|
+
);
|
|
67
62
|
const blocks = useMemo( () => {
|
|
68
63
|
return (
|
|
69
64
|
item.blocks ??
|
|
@@ -111,57 +106,6 @@ export const previewField = {
|
|
|
111
106
|
enableSorting: false,
|
|
112
107
|
};
|
|
113
108
|
|
|
114
|
-
function TitleField( { item } ) {
|
|
115
|
-
const isUserPattern = item.type === PATTERN_TYPES.user;
|
|
116
|
-
const isTemplatePart = item.type === TEMPLATE_PART_POST_TYPE;
|
|
117
|
-
const { onClick } = useLink( {
|
|
118
|
-
postType: item.type,
|
|
119
|
-
postId: isUserPattern || isTemplatePart ? item.id : item.name,
|
|
120
|
-
canvas: 'edit',
|
|
121
|
-
} );
|
|
122
|
-
const title = decodeEntities( defaultGetTitle( item ) );
|
|
123
|
-
return (
|
|
124
|
-
<HStack alignment="center" justify="flex-start" spacing={ 2 }>
|
|
125
|
-
<FlexBlock className="edit-site-patterns__pattern-title">
|
|
126
|
-
{ item.type === PATTERN_TYPES.theme ? (
|
|
127
|
-
title
|
|
128
|
-
) : (
|
|
129
|
-
<Button
|
|
130
|
-
__next40pxDefaultSize
|
|
131
|
-
variant="link"
|
|
132
|
-
onClick={ onClick }
|
|
133
|
-
// Required for the grid's roving tab index system.
|
|
134
|
-
// See https://github.com/WordPress/gutenberg/pull/51898#discussion_r1243399243.
|
|
135
|
-
tabIndex="-1"
|
|
136
|
-
>
|
|
137
|
-
{ title }
|
|
138
|
-
</Button>
|
|
139
|
-
) }
|
|
140
|
-
</FlexBlock>
|
|
141
|
-
{ item.type === PATTERN_TYPES.theme && (
|
|
142
|
-
<Tooltip
|
|
143
|
-
placement="top"
|
|
144
|
-
text={ __( 'This pattern cannot be edited.' ) }
|
|
145
|
-
>
|
|
146
|
-
<Icon
|
|
147
|
-
className="edit-site-patterns__pattern-lock-icon"
|
|
148
|
-
icon={ lockSmall }
|
|
149
|
-
size={ 24 }
|
|
150
|
-
/>
|
|
151
|
-
</Tooltip>
|
|
152
|
-
) }
|
|
153
|
-
</HStack>
|
|
154
|
-
);
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
export const titleField = {
|
|
158
|
-
label: __( 'Title' ),
|
|
159
|
-
id: 'title',
|
|
160
|
-
getValue: ( { item } ) => item.title?.raw || item.title,
|
|
161
|
-
render: TitleField,
|
|
162
|
-
enableHiding: false,
|
|
163
|
-
};
|
|
164
|
-
|
|
165
109
|
const SYNC_FILTERS = [
|
|
166
110
|
{
|
|
167
111
|
value: PATTERN_SYNC_TYPES.full,
|
|
@@ -9,6 +9,7 @@ import { usePrevious } from '@wordpress/compose';
|
|
|
9
9
|
import { useEntityRecords } from '@wordpress/core-data';
|
|
10
10
|
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
11
11
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
12
|
+
import { patternTitleField } from '@wordpress/fields';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Internal dependencies
|
|
@@ -29,23 +30,18 @@ import { useEditPostAction } from '../dataviews-actions';
|
|
|
29
30
|
import {
|
|
30
31
|
patternStatusField,
|
|
31
32
|
previewField,
|
|
32
|
-
titleField,
|
|
33
33
|
templatePartAuthorField,
|
|
34
34
|
} from './fields';
|
|
35
35
|
|
|
36
36
|
const { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );
|
|
37
37
|
const { usePostActions } = unlock( editorPrivateApis );
|
|
38
|
-
const { useLocation } = unlock( routerPrivateApis );
|
|
38
|
+
const { useLocation, useHistory } = unlock( routerPrivateApis );
|
|
39
39
|
|
|
40
40
|
const EMPTY_ARRAY = [];
|
|
41
41
|
const defaultLayouts = {
|
|
42
42
|
[ LAYOUT_TABLE ]: {
|
|
43
43
|
layout: {
|
|
44
|
-
primaryField: 'title',
|
|
45
44
|
styles: {
|
|
46
|
-
preview: {
|
|
47
|
-
width: '1%',
|
|
48
|
-
},
|
|
49
45
|
author: {
|
|
50
46
|
width: '1%',
|
|
51
47
|
},
|
|
@@ -54,8 +50,6 @@ const defaultLayouts = {
|
|
|
54
50
|
},
|
|
55
51
|
[ LAYOUT_GRID ]: {
|
|
56
52
|
layout: {
|
|
57
|
-
mediaField: 'preview',
|
|
58
|
-
primaryField: 'title',
|
|
59
53
|
badgeFields: [ 'sync-status' ],
|
|
60
54
|
},
|
|
61
55
|
},
|
|
@@ -65,24 +59,26 @@ const DEFAULT_VIEW = {
|
|
|
65
59
|
search: '',
|
|
66
60
|
page: 1,
|
|
67
61
|
perPage: 20,
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
titleField: 'title',
|
|
63
|
+
mediaField: 'preview',
|
|
64
|
+
fields: [ 'sync-status' ],
|
|
70
65
|
filters: [],
|
|
66
|
+
...defaultLayouts[ LAYOUT_GRID ],
|
|
71
67
|
};
|
|
72
68
|
|
|
73
69
|
export default function DataviewsPatterns() {
|
|
74
70
|
const {
|
|
75
|
-
|
|
71
|
+
query: { postType = 'wp_block', categoryId: categoryIdFromURL },
|
|
76
72
|
} = useLocation();
|
|
77
|
-
const
|
|
73
|
+
const history = useHistory();
|
|
78
74
|
const categoryId = categoryIdFromURL || PATTERN_DEFAULT_CATEGORY;
|
|
79
75
|
const [ view, setView ] = useState( DEFAULT_VIEW );
|
|
80
76
|
const previousCategoryId = usePrevious( categoryId );
|
|
81
|
-
const previousPostType = usePrevious(
|
|
77
|
+
const previousPostType = usePrevious( postType );
|
|
82
78
|
const viewSyncStatus = view.filters?.find(
|
|
83
79
|
( { field } ) => field === 'sync-status'
|
|
84
80
|
)?.value;
|
|
85
|
-
const { patterns, isResolving } = usePatterns(
|
|
81
|
+
const { patterns, isResolving } = usePatterns( postType, categoryId, {
|
|
86
82
|
search: view.search,
|
|
87
83
|
syncStatus: viewSyncStatus,
|
|
88
84
|
} );
|
|
@@ -106,11 +102,11 @@ export default function DataviewsPatterns() {
|
|
|
106
102
|
}, [ records ] );
|
|
107
103
|
|
|
108
104
|
const fields = useMemo( () => {
|
|
109
|
-
const _fields = [ previewField,
|
|
105
|
+
const _fields = [ previewField, patternTitleField ];
|
|
110
106
|
|
|
111
|
-
if (
|
|
107
|
+
if ( postType === PATTERN_TYPES.user ) {
|
|
112
108
|
_fields.push( patternStatusField );
|
|
113
|
-
} else if (
|
|
109
|
+
} else if ( postType === TEMPLATE_PART_POST_TYPE ) {
|
|
114
110
|
_fields.push( {
|
|
115
111
|
...templatePartAuthorField,
|
|
116
112
|
elements: authors,
|
|
@@ -118,24 +114,27 @@ export default function DataviewsPatterns() {
|
|
|
118
114
|
}
|
|
119
115
|
|
|
120
116
|
return _fields;
|
|
121
|
-
}, [
|
|
117
|
+
}, [ postType, authors ] );
|
|
122
118
|
|
|
123
119
|
// Reset the page number when the category changes.
|
|
124
120
|
useEffect( () => {
|
|
125
|
-
if (
|
|
121
|
+
if (
|
|
122
|
+
previousCategoryId !== categoryId ||
|
|
123
|
+
previousPostType !== postType
|
|
124
|
+
) {
|
|
126
125
|
setView( ( prevView ) => ( { ...prevView, page: 1 } ) );
|
|
127
126
|
}
|
|
128
|
-
}, [ categoryId, previousCategoryId, previousPostType,
|
|
127
|
+
}, [ categoryId, previousCategoryId, previousPostType, postType ] );
|
|
129
128
|
const { data, paginationInfo } = useMemo( () => {
|
|
130
129
|
// Search is managed server-side as well as filters for patterns.
|
|
131
130
|
// However, the author filter in template parts is done client-side.
|
|
132
131
|
const viewWithoutFilters = { ...view };
|
|
133
132
|
delete viewWithoutFilters.search;
|
|
134
|
-
if (
|
|
133
|
+
if ( postType !== TEMPLATE_PART_POST_TYPE ) {
|
|
135
134
|
viewWithoutFilters.filters = [];
|
|
136
135
|
}
|
|
137
136
|
return filterSortAndPaginate( patterns, viewWithoutFilters, fields );
|
|
138
|
-
}, [ patterns, view, fields,
|
|
137
|
+
}, [ patterns, view, fields, postType ] );
|
|
139
138
|
|
|
140
139
|
const dataWithPermissions = useAugmentPatternsWithPermissions( data );
|
|
141
140
|
|
|
@@ -150,11 +149,11 @@ export default function DataviewsPatterns() {
|
|
|
150
149
|
const editAction = useEditPostAction();
|
|
151
150
|
|
|
152
151
|
const actions = useMemo( () => {
|
|
153
|
-
if (
|
|
152
|
+
if ( postType === TEMPLATE_PART_POST_TYPE ) {
|
|
154
153
|
return [ editAction, ...templatePartActions ].filter( Boolean );
|
|
155
154
|
}
|
|
156
155
|
return [ editAction, ...patternActions ].filter( Boolean );
|
|
157
|
-
}, [ editAction,
|
|
156
|
+
}, [ editAction, postType, templatePartActions, patternActions ] );
|
|
158
157
|
const id = useId();
|
|
159
158
|
const settings = usePatternSettings();
|
|
160
159
|
// Wrap everything in a block editor provider.
|
|
@@ -169,7 +168,7 @@ export default function DataviewsPatterns() {
|
|
|
169
168
|
>
|
|
170
169
|
<PatternsHeader
|
|
171
170
|
categoryId={ categoryId }
|
|
172
|
-
type={
|
|
171
|
+
type={ postType }
|
|
173
172
|
titleId={ `${ id }-title` }
|
|
174
173
|
descriptionId={ `${ id }-description` }
|
|
175
174
|
/>
|
|
@@ -181,6 +180,21 @@ export default function DataviewsPatterns() {
|
|
|
181
180
|
data={ dataWithPermissions || EMPTY_ARRAY }
|
|
182
181
|
getItemId={ ( item ) => item.name ?? item.id }
|
|
183
182
|
isLoading={ isResolving }
|
|
183
|
+
isItemClickable={ ( item ) =>
|
|
184
|
+
item.type !== PATTERN_TYPES.theme
|
|
185
|
+
}
|
|
186
|
+
onClickItem={ ( item ) => {
|
|
187
|
+
history.navigate(
|
|
188
|
+
`/${ item.type }/${
|
|
189
|
+
[
|
|
190
|
+
PATTERN_TYPES.user,
|
|
191
|
+
TEMPLATE_PART_POST_TYPE,
|
|
192
|
+
].includes( item.type )
|
|
193
|
+
? item.id
|
|
194
|
+
: item.name
|
|
195
|
+
}?canvas=edit`
|
|
196
|
+
);
|
|
197
|
+
} }
|
|
184
198
|
view={ view }
|
|
185
199
|
onChangeView={ setView }
|
|
186
200
|
defaultLayouts={ defaultLayouts }
|
|
@@ -71,34 +71,6 @@
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
.edit-site-patterns__pattern-title {
|
|
75
|
-
display: block;
|
|
76
|
-
white-space: nowrap;
|
|
77
|
-
overflow: hidden;
|
|
78
|
-
text-overflow: ellipsis;
|
|
79
|
-
color: inherit;
|
|
80
|
-
|
|
81
|
-
.is-link {
|
|
82
|
-
text-decoration: none;
|
|
83
|
-
color: $gray-200;
|
|
84
|
-
|
|
85
|
-
&:hover,
|
|
86
|
-
&:focus {
|
|
87
|
-
color: $white;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.edit-site-patterns__pattern-icon {
|
|
92
|
-
border-radius: $grid-unit-05;
|
|
93
|
-
background: var(--wp-block-synced-color);
|
|
94
|
-
fill: $white;
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
.edit-site-patterns__pattern-lock-icon {
|
|
98
|
-
fill: currentcolor;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
74
|
.edit-site-page-patterns-dataviews {
|
|
103
75
|
.dataviews-view-grid__badge-fields {
|
|
104
76
|
.dataviews-view-grid__field-value:has(.edit-site-patterns__field-sync-status-fully) {
|