@wordpress/edit-site 5.9.0 → 5.11.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-template/{add-custom-generic-template-modal.js → add-custom-generic-template-modal-content.js} +7 -22
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -0
- package/build/components/add-new-template/{add-custom-template-modal.js → add-custom-template-modal-content.js} +32 -27
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -0
- package/build/components/add-new-template/new-template-part.js +8 -2
- package/build/components/add-new-template/new-template-part.js.map +1 -1
- package/build/components/add-new-template/new-template.js +104 -68
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/app/index.js +8 -2
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/back-button.js +10 -3
- package/build/components/block-editor/back-button.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +39 -6
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/index.js +1 -3
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +6 -7
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/editor/index.js +20 -11
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +27 -6
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/global-styles/block-preview-panel.js +1 -1
- package/build/components/global-styles/block-preview-panel.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +14 -3
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +17 -18
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +14 -3
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/root-menu.js +61 -0
- package/build/components/global-styles/root-menu.js.map +1 -0
- package/build/components/global-styles/screen-block-list.js +3 -1
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js +235 -7
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +9 -26
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-css.js +20 -15
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-layout.js +4 -17
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +141 -0
- package/build/components/global-styles/screen-revisions/index.js.map +1 -0
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +130 -0
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -0
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +121 -0
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -0
- package/build/components/global-styles/screen-root.js +6 -6
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-typography-element.js +0 -3
- package/build/components/global-styles/screen-typography-element.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +11 -39
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +9 -18
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +7 -11
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/ui.js +70 -117
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/variations-panel.js +4 -28
- package/build/components/global-styles/variations-panel.js.map +1 -1
- package/build/components/header-edit-mode/document-actions/index.js +28 -103
- package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +15 -2
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/register.js +1 -1
- package/build/components/keyboard-shortcuts/register.js.map +1 -1
- package/build/components/layout/hooks.js +54 -0
- package/build/components/layout/hooks.js.map +1 -0
- package/build/components/layout/index.js +57 -104
- package/build/components/layout/index.js.map +1 -1
- package/build/components/list/actions/index.js +5 -2
- package/build/components/list/actions/index.js.map +1 -1
- package/build/components/list/index.js +9 -3
- package/build/components/list/index.js.map +1 -1
- package/build/components/list/table.js +1 -1
- package/build/components/list/table.js.map +1 -1
- package/build/components/plugin-template-setting-panel/index.js +44 -0
- package/build/components/plugin-template-setting-panel/index.js.map +1 -0
- package/build/components/resizable-frame/index.js +242 -0
- package/build/components/resizable-frame/index.js.map +1 -0
- package/build/components/revisions/index.js +96 -0
- package/build/components/revisions/index.js.map +1 -0
- package/build/components/routes/link.js +17 -2
- package/build/components/routes/link.js.map +1 -1
- package/build/components/routes/use-title.js +8 -2
- package/build/components/routes/use-title.js.map +1 -1
- package/build/components/save-button/index.js +31 -6
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js +14 -31
- package/build/components/save-hub/index.js.map +1 -1
- package/build/components/save-panel/index.js +20 -7
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +6 -10
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/index.js +19 -5
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +9 -3
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +9 -2
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +40 -0
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -0
- package/build/components/sidebar-edit-mode/template-card/index.js +1 -8
- package/build/components/sidebar-edit-mode/template-card/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/{template-card/last-revision.js → template-revisions/index.js} +2 -2
- package/build/components/sidebar-edit-mode/template-revisions/index.js.map +1 -0
- package/build/components/sidebar-navigation-item/index.js +5 -7
- package/build/components/sidebar-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +14 -4
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +75 -11
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +31 -23
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
- package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js +162 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +17 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +55 -93
- 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 +87 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +14 -71
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +53 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +1 -0
- package/build/components/sidebar-navigation-screen-page/index.js +67 -0
- package/build/components/sidebar-navigation-screen-page/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-pages/index.js +74 -0
- package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-templates/index.js +39 -12
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/sidebar-navigation-subtitle/index.js +18 -0
- package/build/components/sidebar-navigation-subtitle/index.js.map +1 -0
- package/build/components/site-hub/index.js +34 -6
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/start-template-options/index.js +12 -16
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/style-book/index.js +93 -19
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +8 -2
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +9 -4
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-path-with-url.js +17 -3
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build/components/use-edited-entity-record/index.js +8 -4
- package/build/components/use-edited-entity-record/index.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +105 -0
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -0
- package/build/hooks/template-part-edit.js +8 -2
- package/build/hooks/template-part-edit.js.map +1 -1
- package/build/index.js +8 -0
- package/build/index.js.map +1 -1
- package/build/store/actions.js +5 -3
- package/build/store/actions.js.map +1 -1
- package/build/utils/is-previewing-theme.js +27 -0
- package/build/utils/is-previewing-theme.js.map +1 -0
- package/build/utils/use-activate-theme.js +46 -0
- package/build/utils/use-activate-theme.js.map +1 -0
- package/build-module/components/add-new-template/{add-custom-generic-template-modal.js → add-custom-generic-template-modal-content.js} +8 -20
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -0
- package/build-module/components/add-new-template/{add-custom-template-modal.js → add-custom-template-modal-content.js} +34 -28
- package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -0
- package/build-module/components/add-new-template/new-template-part.js +5 -1
- package/build-module/components/add-new-template/new-template-part.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +102 -68
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/app/index.js +6 -2
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/back-button.js +6 -1
- package/build-module/components/block-editor/back-button.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +37 -6
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/index.js +1 -3
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +7 -8
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/editor/index.js +18 -11
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +27 -8
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/global-styles/block-preview-panel.js +1 -1
- package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +13 -3
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +17 -18
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +13 -3
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/root-menu.js +47 -0
- package/build-module/components/global-styles/root-menu.js.map +1 -0
- package/build-module/components/global-styles/screen-block-list.js +4 -2
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +229 -7
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +9 -25
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js +20 -15
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-layout.js +4 -16
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +121 -0
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -0
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +118 -0
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -0
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +107 -0
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -0
- package/build-module/components/global-styles/screen-root.js +6 -6
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-typography-element.js +0 -3
- package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +11 -37
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +10 -18
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +7 -11
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/ui.js +71 -115
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/variations-panel.js +3 -22
- package/build-module/components/global-styles/variations-panel.js.map +1 -1
- package/build-module/components/header-edit-mode/document-actions/index.js +31 -107
- package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +16 -4
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/register.js +1 -1
- package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
- package/build-module/components/layout/hooks.js +41 -0
- package/build-module/components/layout/hooks.js.map +1 -0
- package/build-module/components/layout/index.js +53 -102
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/list/actions/index.js +6 -3
- package/build-module/components/list/actions/index.js.map +1 -1
- package/build-module/components/list/index.js +5 -1
- package/build-module/components/list/index.js.map +1 -1
- package/build-module/components/list/table.js +1 -1
- package/build-module/components/list/table.js.map +1 -1
- package/build-module/components/plugin-template-setting-panel/index.js +35 -0
- package/build-module/components/plugin-template-setting-panel/index.js.map +1 -0
- package/build-module/components/resizable-frame/index.js +228 -0
- package/build-module/components/resizable-frame/index.js.map +1 -0
- package/build-module/components/revisions/index.js +78 -0
- package/build-module/components/revisions/index.js.map +1 -0
- package/build-module/components/routes/link.js +13 -1
- package/build-module/components/routes/link.js.map +1 -1
- package/build-module/components/routes/use-title.js +5 -1
- package/build-module/components/routes/use-title.js.map +1 -1
- package/build-module/components/save-button/index.js +28 -6
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-hub/index.js +13 -32
- package/build-module/components/save-hub/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +19 -7
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +6 -11
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/index.js +14 -4
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +9 -3
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +10 -5
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +29 -0
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/template-card/index.js +2 -7
- package/build-module/components/sidebar-edit-mode/template-card/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/{template-card/last-revision.js → template-revisions/index.js} +2 -2
- package/build-module/components/sidebar-edit-mode/template-revisions/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-item/index.js +6 -8
- package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +13 -5
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +70 -14
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +30 -24
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +141 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +10 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +52 -93
- 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 +71 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +13 -72
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +40 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-page/index.js +48 -0
- package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-pages/index.js +57 -0
- package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-templates/index.js +38 -12
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-subtitle/index.js +10 -0
- package/build-module/components/sidebar-navigation-subtitle/index.js.map +1 -0
- package/build-module/components/site-hub/index.js +32 -6
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +13 -17
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/style-book/index.js +93 -20
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +5 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +5 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +13 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build-module/components/use-edited-entity-record/index.js +8 -4
- package/build-module/components/use-edited-entity-record/index.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +86 -0
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -0
- package/build-module/hooks/template-part-edit.js +5 -1
- package/build-module/hooks/template-part-edit.js.map +1 -1
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +5 -3
- package/build-module/store/actions.js.map +1 -1
- package/build-module/utils/is-previewing-theme.js +17 -0
- package/build-module/utils/is-previewing-theme.js.map +1 -0
- package/build-module/utils/use-activate-theme.js +36 -0
- package/build-module/utils/use-activate-theme.js.map +1 -0
- package/build-style/style-rtl.css +409 -265
- package/build-style/style.css +410 -265
- package/package.json +37 -35
- package/src/components/add-new-template/add-custom-generic-template-modal-content.js +82 -0
- package/src/components/add-new-template/{add-custom-template-modal.js → add-custom-template-modal-content.js} +44 -34
- package/src/components/add-new-template/new-template-part.js +4 -1
- package/src/components/add-new-template/new-template.js +142 -154
- package/src/components/add-new-template/style.scss +120 -103
- package/src/components/app/index.js +6 -3
- package/src/components/block-editor/back-button.js +4 -1
- package/src/components/block-editor/editor-canvas.js +36 -8
- package/src/components/block-editor/index.js +2 -3
- package/src/components/block-editor/style.scss +15 -8
- package/src/components/create-template-part-modal/index.js +19 -25
- package/src/components/editor/index.js +20 -8
- package/src/components/editor/style.scss +21 -6
- package/src/components/editor-canvas-container/index.js +43 -21
- package/src/components/global-styles/block-preview-panel.js +1 -1
- package/src/components/global-styles/color-palette-panel.js +9 -0
- package/src/components/global-styles/dimensions-panel.js +15 -15
- package/src/components/global-styles/gradients-palette-panel.js +8 -0
- package/src/components/global-styles/root-menu.js +66 -0
- package/src/components/global-styles/screen-block-list.js +2 -2
- package/src/components/global-styles/screen-block.js +255 -7
- package/src/components/global-styles/screen-colors.js +9 -16
- package/src/components/global-styles/screen-css.js +21 -21
- package/src/components/global-styles/screen-layout.js +5 -9
- package/src/components/global-styles/screen-revisions/index.js +169 -0
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +139 -0
- package/src/components/global-styles/screen-revisions/style.scss +100 -0
- package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +138 -0
- package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +99 -0
- package/src/components/global-styles/screen-root.js +7 -5
- package/src/components/global-styles/screen-typography-element.js +1 -3
- package/src/components/global-styles/screen-typography.js +44 -79
- package/src/components/global-styles/style-variations-container.js +17 -28
- package/src/components/global-styles/style.scss +4 -23
- package/src/components/global-styles/typography-panel.js +12 -13
- package/src/components/global-styles/ui.js +83 -110
- package/src/components/global-styles/variations-panel.js +3 -26
- package/src/components/header-edit-mode/document-actions/index.js +26 -129
- package/src/components/header-edit-mode/document-actions/style.scss +28 -59
- package/src/components/header-edit-mode/index.js +23 -2
- package/src/components/header-edit-mode/style.scss +1 -0
- package/src/components/keyboard-shortcuts/register.js +1 -1
- package/src/components/layout/hooks.js +46 -0
- package/src/components/layout/index.js +60 -125
- package/src/components/layout/style.scss +9 -5
- package/src/components/list/actions/index.js +12 -5
- package/src/components/list/index.js +4 -1
- package/src/components/list/style.scss +5 -0
- package/src/components/list/table.js +3 -1
- package/src/components/plugin-template-setting-panel/index.js +33 -0
- package/src/components/resizable-frame/index.js +253 -0
- package/src/components/resizable-frame/style.scss +69 -0
- package/src/components/revisions/index.js +105 -0
- package/src/components/routes/link.js +16 -1
- package/src/components/routes/use-title.js +4 -1
- package/src/components/save-button/index.js +27 -6
- package/src/components/save-hub/index.js +17 -35
- package/src/components/save-panel/index.js +15 -3
- package/src/components/secondary-sidebar/list-view-sidebar.js +4 -7
- package/src/components/sidebar/index.js +15 -4
- package/src/components/sidebar-edit-mode/global-styles-sidebar.js +9 -7
- package/src/components/sidebar-edit-mode/index.js +17 -6
- package/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js +26 -0
- package/src/components/sidebar-edit-mode/style.scss +10 -0
- package/src/components/sidebar-edit-mode/template-card/index.js +1 -9
- package/src/components/sidebar-edit-mode/{template-card/last-revision.js → template-revisions/index.js} +1 -2
- package/src/components/sidebar-navigation-item/index.js +13 -14
- package/src/components/sidebar-navigation-item/style.scss +17 -1
- package/src/components/sidebar-navigation-screen/index.js +26 -5
- package/src/components/sidebar-navigation-screen/style.scss +1 -2
- package/src/components/sidebar-navigation-screen-global-styles/index.js +106 -21
- package/src/components/sidebar-navigation-screen-main/index.js +39 -35
- package/src/components/sidebar-navigation-screen-navigation-item/index.js +3 -9
- package/src/components/sidebar-navigation-screen-navigation-menu/index.js +157 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/constants.js +9 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +63 -105
- package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +83 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +8 -74
- package/src/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +47 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +6 -20
- package/src/components/sidebar-navigation-screen-page/index.js +59 -0
- package/src/components/sidebar-navigation-screen-pages/index.js +82 -0
- package/src/components/sidebar-navigation-screen-pages/style.scss +4 -0
- package/src/components/sidebar-navigation-screen-templates/index.js +57 -14
- package/src/components/sidebar-navigation-subtitle/index.js +5 -0
- package/src/components/sidebar-navigation-subtitle/style.scss +7 -0
- package/src/components/site-hub/index.js +88 -58
- package/src/components/site-hub/style.scss +8 -0
- package/src/components/start-template-options/index.js +19 -27
- package/src/components/start-template-options/style.scss +28 -21
- package/src/components/style-book/index.js +132 -43
- package/src/components/style-book/style.scss +19 -0
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +4 -1
- package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +3 -1
- package/src/components/sync-state-with-url/use-sync-path-with-url.js +14 -1
- package/src/components/use-edited-entity-record/index.js +12 -3
- package/src/hooks/commands/use-edit-mode-commands.js +79 -0
- package/src/hooks/template-part-edit.js +4 -1
- package/src/index.js +1 -0
- package/src/store/actions.js +4 -5
- package/src/store/test/actions.js +6 -14
- package/src/store/test/utils.js +15 -5
- package/src/style.scss +5 -2
- package/src/utils/is-previewing-theme.js +18 -0
- package/src/utils/use-activate-theme.js +38 -0
- package/build/components/add-new-template/add-custom-generic-template-modal.js.map +0 -1
- package/build/components/add-new-template/add-custom-template-modal.js.map +0 -1
- package/build/components/global-styles/border-panel.js +0 -133
- package/build/components/global-styles/border-panel.js.map +0 -1
- package/build/components/global-styles/context-menu.js +0 -126
- package/build/components/global-styles/context-menu.js.map +0 -1
- package/build/components/global-styles/custom-css.js +0 -113
- package/build/components/global-styles/custom-css.js.map +0 -1
- package/build/components/global-styles/effects-panel.js +0 -53
- package/build/components/global-styles/effects-panel.js.map +0 -1
- package/build/components/global-styles/filters-panel.js +0 -50
- package/build/components/global-styles/filters-panel.js.map +0 -1
- package/build/components/global-styles/screen-border.js +0 -61
- package/build/components/global-styles/screen-border.js.map +0 -1
- package/build/components/global-styles/screen-effects.js +0 -61
- package/build/components/global-styles/screen-effects.js.map +0 -1
- package/build/components/global-styles/screen-filters.js +0 -46
- package/build/components/global-styles/screen-filters.js.map +0 -1
- package/build/components/global-styles/screen-variations.js +0 -71
- package/build/components/global-styles/screen-variations.js.map +0 -1
- package/build/components/navigate-to-link/index.js +0 -51
- package/build/components/navigate-to-link/index.js.map +0 -1
- package/build/components/routes/index.js +0 -60
- package/build/components/routes/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-card/last-revision.js.map +0 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/loader.js +0 -19
- package/build/components/sidebar-navigation-screen-navigation-menus/loader.js.map +0 -1
- package/build/components/template-details/edit-template-title.js +0 -42
- package/build/components/template-details/edit-template-title.js.map +0 -1
- package/build/components/template-details/index.js +0 -103
- package/build/components/template-details/index.js.map +0 -1
- package/build/components/template-details/template-areas.js +0 -160
- package/build/components/template-details/template-areas.js.map +0 -1
- package/build/components/template-details/template-part-area-selector.js +0 -48
- package/build/components/template-details/template-part-area-selector.js.map +0 -1
- package/build/hooks/commands/index.js +0 -19
- package/build/hooks/commands/index.js.map +0 -1
- package/build/hooks/commands/use-navigation-commands.js +0 -126
- package/build/hooks/commands/use-navigation-commands.js.map +0 -1
- package/build/hooks/commands/use-wp-admin-commands.js +0 -97
- package/build/hooks/commands/use-wp-admin-commands.js.map +0 -1
- package/build/utils/history.js +0 -41
- package/build/utils/history.js.map +0 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal.js.map +0 -1
- package/build-module/components/add-new-template/add-custom-template-modal.js.map +0 -1
- package/build-module/components/global-styles/border-panel.js +0 -123
- package/build-module/components/global-styles/border-panel.js.map +0 -1
- package/build-module/components/global-styles/context-menu.js +0 -107
- package/build-module/components/global-styles/context-menu.js.map +0 -1
- package/build-module/components/global-styles/custom-css.js +0 -98
- package/build-module/components/global-styles/custom-css.js.map +0 -1
- package/build-module/components/global-styles/effects-panel.js +0 -43
- package/build-module/components/global-styles/effects-panel.js.map +0 -1
- package/build-module/components/global-styles/filters-panel.js +0 -40
- package/build-module/components/global-styles/filters-panel.js.map +0 -1
- package/build-module/components/global-styles/screen-border.js +0 -44
- package/build-module/components/global-styles/screen-border.js.map +0 -1
- package/build-module/components/global-styles/screen-effects.js +0 -44
- package/build-module/components/global-styles/screen-effects.js.map +0 -1
- package/build-module/components/global-styles/screen-filters.js +0 -33
- package/build-module/components/global-styles/screen-filters.js.map +0 -1
- package/build-module/components/global-styles/screen-variations.js +0 -54
- package/build-module/components/global-styles/screen-variations.js.map +0 -1
- package/build-module/components/navigate-to-link/index.js +0 -39
- package/build-module/components/navigate-to-link/index.js.map +0 -1
- package/build-module/components/routes/index.js +0 -47
- package/build-module/components/routes/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-card/last-revision.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/loader.js +0 -11
- package/build-module/components/sidebar-navigation-screen-navigation-menus/loader.js.map +0 -1
- package/build-module/components/template-details/edit-template-title.js +0 -33
- package/build-module/components/template-details/edit-template-title.js.map +0 -1
- package/build-module/components/template-details/index.js +0 -83
- package/build-module/components/template-details/index.js.map +0 -1
- package/build-module/components/template-details/template-areas.js +0 -141
- package/build-module/components/template-details/template-areas.js.map +0 -1
- package/build-module/components/template-details/template-part-area-selector.js +0 -36
- package/build-module/components/template-details/template-part-area-selector.js.map +0 -1
- package/build-module/hooks/commands/index.js +0 -10
- package/build-module/hooks/commands/index.js.map +0 -1
- package/build-module/hooks/commands/use-navigation-commands.js +0 -109
- package/build-module/hooks/commands/use-navigation-commands.js.map +0 -1
- package/build-module/hooks/commands/use-wp-admin-commands.js +0 -81
- package/build-module/hooks/commands/use-wp-admin-commands.js.map +0 -1
- package/build-module/utils/history.js +0 -31
- package/build-module/utils/history.js.map +0 -1
- package/src/components/add-new-template/add-custom-generic-template-modal.js +0 -101
- package/src/components/global-styles/border-panel.js +0 -112
- package/src/components/global-styles/context-menu.js +0 -175
- package/src/components/global-styles/custom-css.js +0 -131
- package/src/components/global-styles/effects-panel.js +0 -40
- package/src/components/global-styles/filters-panel.js +0 -39
- package/src/components/global-styles/screen-border.js +0 -35
- package/src/components/global-styles/screen-effects.js +0 -35
- package/src/components/global-styles/screen-filters.js +0 -27
- package/src/components/global-styles/screen-variations.js +0 -46
- package/src/components/navigate-to-link/index.js +0 -46
- package/src/components/routes/index.js +0 -53
- package/src/components/sidebar-navigation-screen-navigation-menus/loader.js +0 -9
- package/src/components/template-details/edit-template-title.js +0 -41
- package/src/components/template-details/index.js +0 -113
- package/src/components/template-details/style.scss +0 -72
- package/src/components/template-details/template-areas.js +0 -164
- package/src/components/template-details/template-part-area-selector.js +0 -39
- package/src/hooks/commands/index.js +0 -10
- package/src/hooks/commands/use-navigation-commands.js +0 -112
- package/src/hooks/commands/use-wp-admin-commands.js +0 -79
- package/src/utils/history.js +0 -39
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import classnames from 'classnames';
|
|
5
|
-
import fastDeepEqual from 'fast-deep-equal/es6';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* WordPress dependencies
|
|
@@ -22,14 +21,9 @@ import { mergeBaseAndUserConfigs } from './global-styles-provider';
|
|
|
22
21
|
import StylesPreview from './preview';
|
|
23
22
|
import { unlock } from '../../private-apis';
|
|
24
23
|
|
|
25
|
-
const { GlobalStylesContext } = unlock(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
fastDeepEqual( a.styles, b.styles ) &&
|
|
30
|
-
fastDeepEqual( a.settings, b.settings )
|
|
31
|
-
);
|
|
32
|
-
}
|
|
24
|
+
const { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(
|
|
25
|
+
blockEditorPrivateApis
|
|
26
|
+
);
|
|
33
27
|
|
|
34
28
|
function Variation( { variation } ) {
|
|
35
29
|
const [ isFocused, setIsFocused ] = useState( false );
|
|
@@ -63,7 +57,7 @@ function Variation( { variation } ) {
|
|
|
63
57
|
};
|
|
64
58
|
|
|
65
59
|
const isActive = useMemo( () => {
|
|
66
|
-
return
|
|
60
|
+
return areGlobalStyleConfigsEqual( user, variation );
|
|
67
61
|
}, [ user, variation ] );
|
|
68
62
|
|
|
69
63
|
return (
|
|
@@ -97,13 +91,10 @@ function Variation( { variation } ) {
|
|
|
97
91
|
}
|
|
98
92
|
|
|
99
93
|
export default function StyleVariationsContainer() {
|
|
100
|
-
const
|
|
101
|
-
return
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
coreStore
|
|
105
|
-
).__experimentalGetCurrentThemeGlobalStylesVariations() || [],
|
|
106
|
-
};
|
|
94
|
+
const variations = useSelect( ( select ) => {
|
|
95
|
+
return select(
|
|
96
|
+
coreStore
|
|
97
|
+
).__experimentalGetCurrentThemeGlobalStylesVariations();
|
|
107
98
|
}, [] );
|
|
108
99
|
|
|
109
100
|
const withEmptyVariation = useMemo( () => {
|
|
@@ -113,7 +104,7 @@ export default function StyleVariationsContainer() {
|
|
|
113
104
|
settings: {},
|
|
114
105
|
styles: {},
|
|
115
106
|
},
|
|
116
|
-
...variations.map( ( variation ) => ( {
|
|
107
|
+
...( variations ?? [] ).map( ( variation ) => ( {
|
|
117
108
|
...variation,
|
|
118
109
|
settings: variation.settings ?? {},
|
|
119
110
|
styles: variation.styles ?? {},
|
|
@@ -122,15 +113,13 @@ export default function StyleVariationsContainer() {
|
|
|
122
113
|
}, [ variations ] );
|
|
123
114
|
|
|
124
115
|
return (
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
{
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
</Grid>
|
|
134
|
-
</>
|
|
116
|
+
<Grid
|
|
117
|
+
columns={ 2 }
|
|
118
|
+
className="edit-site-global-styles-style-variations-container"
|
|
119
|
+
>
|
|
120
|
+
{ withEmptyVariation.map( ( variation, index ) => (
|
|
121
|
+
<Variation key={ index } variation={ variation } />
|
|
122
|
+
) ) }
|
|
123
|
+
</Grid>
|
|
135
124
|
);
|
|
136
125
|
}
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
.components-v-stack {
|
|
132
132
|
flex: 1 1 auto;
|
|
133
133
|
|
|
134
|
-
.
|
|
134
|
+
.block-editor-global-styles-advanced-panel__custom-css-input {
|
|
135
135
|
flex: 1 1 auto;
|
|
136
136
|
display: flex;
|
|
137
137
|
flex-direction: column;
|
|
@@ -143,34 +143,15 @@
|
|
|
143
143
|
|
|
144
144
|
.components-textarea-control__input {
|
|
145
145
|
flex: 1 1 auto;
|
|
146
|
+
// CSS input is always LTR regardless of language.
|
|
147
|
+
/*rtl:ignore*/
|
|
148
|
+
direction: ltr;
|
|
146
149
|
}
|
|
147
150
|
}
|
|
148
151
|
}
|
|
149
152
|
}
|
|
150
153
|
}
|
|
151
154
|
|
|
152
|
-
.edit-site-global-styles__custom-css-input textarea {
|
|
153
|
-
font-family: $editor_html_font;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
.edit-site-global-styles__custom-css-validation-wrapper {
|
|
157
|
-
position: absolute;
|
|
158
|
-
bottom: $grid-unit-20;
|
|
159
|
-
right: $grid-unit * 3;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
.edit-site-global-styles__custom-css-validation-icon {
|
|
163
|
-
fill: $alert-red;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
.edit-site-global-styles__custom-css-theme-css {
|
|
167
|
-
width: 100%;
|
|
168
|
-
line-break: anywhere;
|
|
169
|
-
white-space: break-spaces;
|
|
170
|
-
max-height: 200px;
|
|
171
|
-
overflow-y: scroll;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
155
|
.edit-site-global-styles-screen-css-help-link {
|
|
175
156
|
display: block;
|
|
176
157
|
margin-top: $grid-unit-10;
|
|
@@ -15,32 +15,31 @@ const {
|
|
|
15
15
|
TypographyPanel: StylesTypographyPanel,
|
|
16
16
|
} = unlock( blockEditorPrivateApis );
|
|
17
17
|
|
|
18
|
-
export default function TypographyPanel( {
|
|
19
|
-
name,
|
|
20
|
-
element,
|
|
21
|
-
headingLevel,
|
|
22
|
-
variation = '',
|
|
23
|
-
} ) {
|
|
18
|
+
export default function TypographyPanel( { element, headingLevel } ) {
|
|
24
19
|
let prefixParts = [];
|
|
25
20
|
if ( element === 'heading' ) {
|
|
26
21
|
prefixParts = prefixParts.concat( [ 'elements', headingLevel ] );
|
|
27
22
|
} else if ( element && element !== 'text' ) {
|
|
28
23
|
prefixParts = prefixParts.concat( [ 'elements', element ] );
|
|
29
24
|
}
|
|
30
|
-
if ( variation ) {
|
|
31
|
-
prefixParts = [ 'variations', variation ].concat( prefixParts );
|
|
32
|
-
}
|
|
33
25
|
const prefix = prefixParts.join( '.' );
|
|
34
26
|
|
|
35
|
-
const [ style ] = useGlobalStyle( prefix,
|
|
36
|
-
const [ inheritedStyle, setStyle ] = useGlobalStyle( prefix, name, 'all', {
|
|
27
|
+
const [ style ] = useGlobalStyle( prefix, undefined, 'user', {
|
|
37
28
|
shouldDecodeEncode: false,
|
|
38
29
|
} );
|
|
39
|
-
const [
|
|
30
|
+
const [ inheritedStyle, setStyle ] = useGlobalStyle(
|
|
31
|
+
prefix,
|
|
32
|
+
undefined,
|
|
33
|
+
'all',
|
|
34
|
+
{
|
|
35
|
+
shouldDecodeEncode: false,
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
const [ rawSettings ] = useGlobalSetting( '' );
|
|
40
39
|
const usedElement = element === 'heading' ? headingLevel : element;
|
|
41
40
|
const settings = useSettingsForBlockElement(
|
|
42
41
|
rawSettings,
|
|
43
|
-
|
|
42
|
+
undefined,
|
|
44
43
|
usedElement
|
|
45
44
|
);
|
|
46
45
|
|
|
@@ -14,11 +14,11 @@ import {
|
|
|
14
14
|
privateApis as blockEditorPrivateApis,
|
|
15
15
|
store as blockEditorStore,
|
|
16
16
|
} from '@wordpress/block-editor';
|
|
17
|
-
import { __ } from '@wordpress/i18n';
|
|
17
|
+
import { __, sprintf, _n } from '@wordpress/i18n';
|
|
18
18
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
19
19
|
import { moreVertical } from '@wordpress/icons';
|
|
20
20
|
import { store as coreStore } from '@wordpress/core-data';
|
|
21
|
-
import { useEffect
|
|
21
|
+
import { useEffect } from '@wordpress/element';
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Internal dependencies
|
|
@@ -31,17 +31,14 @@ import {
|
|
|
31
31
|
import ScreenBlock from './screen-block';
|
|
32
32
|
import ScreenTypography from './screen-typography';
|
|
33
33
|
import ScreenTypographyElement from './screen-typography-element';
|
|
34
|
-
import ScreenFilters from './screen-filters';
|
|
35
34
|
import ScreenColors from './screen-colors';
|
|
36
35
|
import ScreenColorPalette from './screen-color-palette';
|
|
37
36
|
import ScreenLayout from './screen-layout';
|
|
38
37
|
import ScreenStyleVariations from './screen-style-variations';
|
|
39
|
-
import { ScreenVariation } from './screen-variations';
|
|
40
|
-
import ScreenBorder from './screen-border';
|
|
41
38
|
import StyleBook from '../style-book';
|
|
42
39
|
import ScreenCSS from './screen-css';
|
|
40
|
+
import ScreenRevisions from './screen-revisions';
|
|
43
41
|
import { unlock } from '../../private-apis';
|
|
44
|
-
import ScreenEffects from './screen-effects';
|
|
45
42
|
import { store as editSiteStore } from '../../store';
|
|
46
43
|
|
|
47
44
|
const SLOT_FILL_NAME = 'GlobalStylesMenu';
|
|
@@ -50,7 +47,7 @@ const { Slot: GlobalStylesMenuSlot, Fill: GlobalStylesMenuFill } =
|
|
|
50
47
|
|
|
51
48
|
function GlobalStylesActionMenu() {
|
|
52
49
|
const { toggle } = useDispatch( preferencesStore );
|
|
53
|
-
const { canEditCSS } = useSelect( ( select ) => {
|
|
50
|
+
const { canEditCSS, revisionsCount } = useSelect( ( select ) => {
|
|
54
51
|
const { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =
|
|
55
52
|
select( coreStore );
|
|
56
53
|
|
|
@@ -62,12 +59,23 @@ function GlobalStylesActionMenu() {
|
|
|
62
59
|
return {
|
|
63
60
|
canEditCSS:
|
|
64
61
|
!! globalStyles?._links?.[ 'wp:action-edit-css' ] ?? false,
|
|
62
|
+
revisionsCount:
|
|
63
|
+
globalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0,
|
|
65
64
|
};
|
|
66
65
|
}, [] );
|
|
67
66
|
const { useGlobalStylesReset } = unlock( blockEditorPrivateApis );
|
|
68
67
|
const [ canReset, onReset ] = useGlobalStylesReset();
|
|
69
68
|
const { goTo } = useNavigator();
|
|
69
|
+
const { setEditorCanvasContainerView } = unlock(
|
|
70
|
+
useDispatch( editSiteStore )
|
|
71
|
+
);
|
|
70
72
|
const loadCustomCSS = () => goTo( '/css' );
|
|
73
|
+
const loadRevisions = () => {
|
|
74
|
+
goTo( '/revisions' );
|
|
75
|
+
setEditorCanvasContainerView( 'global-styles-revisions' );
|
|
76
|
+
};
|
|
77
|
+
const hasRevisions = revisionsCount >= 2;
|
|
78
|
+
|
|
71
79
|
return (
|
|
72
80
|
<GlobalStylesMenuFill>
|
|
73
81
|
<DropdownMenu
|
|
@@ -92,6 +100,22 @@ function GlobalStylesActionMenu() {
|
|
|
92
100
|
},
|
|
93
101
|
]
|
|
94
102
|
: [] ),
|
|
103
|
+
...( hasRevisions
|
|
104
|
+
? [
|
|
105
|
+
{
|
|
106
|
+
title: sprintf(
|
|
107
|
+
/* translators: %d: number of revisions */
|
|
108
|
+
_n(
|
|
109
|
+
'%d Revision',
|
|
110
|
+
'%d Revisions',
|
|
111
|
+
revisionsCount
|
|
112
|
+
),
|
|
113
|
+
revisionsCount
|
|
114
|
+
),
|
|
115
|
+
onClick: loadRevisions,
|
|
116
|
+
},
|
|
117
|
+
]
|
|
118
|
+
: [] ),
|
|
95
119
|
] }
|
|
96
120
|
/>
|
|
97
121
|
</GlobalStylesMenuFill>
|
|
@@ -112,33 +136,6 @@ function GlobalStylesNavigationScreen( { className, ...props } ) {
|
|
|
112
136
|
);
|
|
113
137
|
}
|
|
114
138
|
|
|
115
|
-
function BlockStyleVariationsScreens( { name } ) {
|
|
116
|
-
const blockStyleVariations = useSelect(
|
|
117
|
-
( select ) => {
|
|
118
|
-
const { getBlockStyles } = select( blocksStore );
|
|
119
|
-
return getBlockStyles( name );
|
|
120
|
-
},
|
|
121
|
-
[ name ]
|
|
122
|
-
);
|
|
123
|
-
if ( ! blockStyleVariations?.length ) {
|
|
124
|
-
return null;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
return blockStyleVariations.map( ( variation ) => (
|
|
128
|
-
<ContextScreens
|
|
129
|
-
key={ variation.name + name }
|
|
130
|
-
name={ name }
|
|
131
|
-
parentMenu={
|
|
132
|
-
'/blocks/' +
|
|
133
|
-
encodeURIComponent( name ) +
|
|
134
|
-
'/variations/' +
|
|
135
|
-
encodeURIComponent( variation.name )
|
|
136
|
-
}
|
|
137
|
-
variation={ variation.name }
|
|
138
|
-
/>
|
|
139
|
-
) );
|
|
140
|
-
}
|
|
141
|
-
|
|
142
139
|
function BlockStylesNavigationScreens( {
|
|
143
140
|
parentMenu,
|
|
144
141
|
blockStyles,
|
|
@@ -149,12 +146,12 @@ function BlockStylesNavigationScreens( {
|
|
|
149
146
|
key={ index }
|
|
150
147
|
path={ parentMenu + '/variations/' + style.name }
|
|
151
148
|
>
|
|
152
|
-
<
|
|
149
|
+
<ScreenBlock name={ blockName } variation={ style.name } />
|
|
153
150
|
</GlobalStylesNavigationScreen>
|
|
154
151
|
) );
|
|
155
152
|
}
|
|
156
153
|
|
|
157
|
-
function ContextScreens( { name, parentMenu = ''
|
|
154
|
+
function ContextScreens( { name, parentMenu = '' } ) {
|
|
158
155
|
const blockStyleVariations = useSelect(
|
|
159
156
|
( select ) => {
|
|
160
157
|
const { getBlockStyles } = select( blocksStore );
|
|
@@ -165,70 +162,12 @@ function ContextScreens( { name, parentMenu = '', variation = '' } ) {
|
|
|
165
162
|
|
|
166
163
|
return (
|
|
167
164
|
<>
|
|
168
|
-
<GlobalStylesNavigationScreen path={ parentMenu + '/typography' }>
|
|
169
|
-
<ScreenTypography name={ name } variation={ variation } />
|
|
170
|
-
</GlobalStylesNavigationScreen>
|
|
171
|
-
|
|
172
|
-
<GlobalStylesNavigationScreen
|
|
173
|
-
path={ parentMenu + '/typography/text' }
|
|
174
|
-
>
|
|
175
|
-
<ScreenTypographyElement name={ name } element="text" />
|
|
176
|
-
</GlobalStylesNavigationScreen>
|
|
177
|
-
|
|
178
|
-
<GlobalStylesNavigationScreen
|
|
179
|
-
path={ parentMenu + '/typography/link' }
|
|
180
|
-
>
|
|
181
|
-
<ScreenTypographyElement name={ name } element="link" />
|
|
182
|
-
</GlobalStylesNavigationScreen>
|
|
183
|
-
|
|
184
|
-
<GlobalStylesNavigationScreen
|
|
185
|
-
path={ parentMenu + '/typography/heading' }
|
|
186
|
-
>
|
|
187
|
-
<ScreenTypographyElement name={ name } element="heading" />
|
|
188
|
-
</GlobalStylesNavigationScreen>
|
|
189
|
-
|
|
190
|
-
<GlobalStylesNavigationScreen
|
|
191
|
-
path={ parentMenu + '/typography/caption' }
|
|
192
|
-
>
|
|
193
|
-
<ScreenTypographyElement name={ name } element="caption" />
|
|
194
|
-
</GlobalStylesNavigationScreen>
|
|
195
|
-
|
|
196
|
-
<GlobalStylesNavigationScreen
|
|
197
|
-
path={ parentMenu + '/typography/button' }
|
|
198
|
-
>
|
|
199
|
-
<ScreenTypographyElement name={ name } element="button" />
|
|
200
|
-
</GlobalStylesNavigationScreen>
|
|
201
|
-
|
|
202
|
-
<GlobalStylesNavigationScreen path={ parentMenu + '/colors' }>
|
|
203
|
-
<ScreenColors name={ name } variation={ variation } />
|
|
204
|
-
</GlobalStylesNavigationScreen>
|
|
205
|
-
|
|
206
165
|
<GlobalStylesNavigationScreen
|
|
207
166
|
path={ parentMenu + '/colors/palette' }
|
|
208
167
|
>
|
|
209
168
|
<ScreenColorPalette name={ name } />
|
|
210
169
|
</GlobalStylesNavigationScreen>
|
|
211
170
|
|
|
212
|
-
<GlobalStylesNavigationScreen path={ parentMenu + '/filters' }>
|
|
213
|
-
<ScreenFilters name={ name } />
|
|
214
|
-
</GlobalStylesNavigationScreen>
|
|
215
|
-
|
|
216
|
-
<GlobalStylesNavigationScreen path={ parentMenu + '/border' }>
|
|
217
|
-
<ScreenBorder name={ name } variation={ variation } />
|
|
218
|
-
</GlobalStylesNavigationScreen>
|
|
219
|
-
|
|
220
|
-
<GlobalStylesNavigationScreen path={ parentMenu + '/effects' }>
|
|
221
|
-
<ScreenEffects name={ name } variation={ variation } />
|
|
222
|
-
</GlobalStylesNavigationScreen>
|
|
223
|
-
|
|
224
|
-
<GlobalStylesNavigationScreen path={ parentMenu + '/layout' }>
|
|
225
|
-
<ScreenLayout name={ name } variation={ variation } />
|
|
226
|
-
</GlobalStylesNavigationScreen>
|
|
227
|
-
|
|
228
|
-
<GlobalStylesNavigationScreen path={ parentMenu + '/css' }>
|
|
229
|
-
<ScreenCSS name={ name } />
|
|
230
|
-
</GlobalStylesNavigationScreen>
|
|
231
|
-
|
|
232
171
|
{ !! blockStyleVariations?.length && (
|
|
233
172
|
<BlockStylesNavigationScreens
|
|
234
173
|
parentMenu={ parentMenu }
|
|
@@ -264,7 +203,6 @@ function GlobalStylesStyleBook() {
|
|
|
264
203
|
|
|
265
204
|
function GlobalStylesBlockLink() {
|
|
266
205
|
const navigator = useNavigator();
|
|
267
|
-
const isMounted = useRef();
|
|
268
206
|
const { selectedBlockName, selectedBlockClientId } = useSelect(
|
|
269
207
|
( select ) => {
|
|
270
208
|
const { getSelectedBlockClientId, getBlockName } =
|
|
@@ -278,20 +216,23 @@ function GlobalStylesBlockLink() {
|
|
|
278
216
|
[]
|
|
279
217
|
);
|
|
280
218
|
const blockHasGlobalStyles = useBlockHasGlobalStyles( selectedBlockName );
|
|
219
|
+
// When we're in the `Blocks` screen enable deep linking to the selected block.
|
|
281
220
|
useEffect( () => {
|
|
282
|
-
|
|
283
|
-
if ( ! isMounted.current ) {
|
|
284
|
-
isMounted.current = true;
|
|
221
|
+
if ( ! selectedBlockClientId || ! blockHasGlobalStyles ) {
|
|
285
222
|
return;
|
|
286
223
|
}
|
|
287
|
-
|
|
224
|
+
const currentPath = navigator.location.path;
|
|
225
|
+
if (
|
|
226
|
+
currentPath !== '/blocks' &&
|
|
227
|
+
! currentPath.startsWith( '/blocks/' )
|
|
228
|
+
) {
|
|
288
229
|
return;
|
|
289
230
|
}
|
|
290
|
-
const
|
|
231
|
+
const newPath = '/blocks/' + encodeURIComponent( selectedBlockName );
|
|
291
232
|
// Avoid navigating to the same path. This can happen when selecting
|
|
292
233
|
// a new block of the same type.
|
|
293
|
-
if (
|
|
294
|
-
navigator.goTo(
|
|
234
|
+
if ( newPath !== currentPath ) {
|
|
235
|
+
navigator.goTo( newPath, { skipFocus: true } );
|
|
295
236
|
}
|
|
296
237
|
}, [ selectedBlockClientId, selectedBlockName, blockHasGlobalStyles ] );
|
|
297
238
|
}
|
|
@@ -320,6 +261,46 @@ function GlobalStylesUI() {
|
|
|
320
261
|
<ScreenBlockList />
|
|
321
262
|
</GlobalStylesNavigationScreen>
|
|
322
263
|
|
|
264
|
+
<GlobalStylesNavigationScreen path="/typography">
|
|
265
|
+
<ScreenTypography />
|
|
266
|
+
</GlobalStylesNavigationScreen>
|
|
267
|
+
|
|
268
|
+
<GlobalStylesNavigationScreen path="/typography/text">
|
|
269
|
+
<ScreenTypographyElement element="text" />
|
|
270
|
+
</GlobalStylesNavigationScreen>
|
|
271
|
+
|
|
272
|
+
<GlobalStylesNavigationScreen path="/typography/link">
|
|
273
|
+
<ScreenTypographyElement element="link" />
|
|
274
|
+
</GlobalStylesNavigationScreen>
|
|
275
|
+
|
|
276
|
+
<GlobalStylesNavigationScreen path="/typography/heading">
|
|
277
|
+
<ScreenTypographyElement element="heading" />
|
|
278
|
+
</GlobalStylesNavigationScreen>
|
|
279
|
+
|
|
280
|
+
<GlobalStylesNavigationScreen path="/typography/caption">
|
|
281
|
+
<ScreenTypographyElement element="caption" />
|
|
282
|
+
</GlobalStylesNavigationScreen>
|
|
283
|
+
|
|
284
|
+
<GlobalStylesNavigationScreen path="/typography/button">
|
|
285
|
+
<ScreenTypographyElement element="button" />
|
|
286
|
+
</GlobalStylesNavigationScreen>
|
|
287
|
+
|
|
288
|
+
<GlobalStylesNavigationScreen path="/colors">
|
|
289
|
+
<ScreenColors />
|
|
290
|
+
</GlobalStylesNavigationScreen>
|
|
291
|
+
|
|
292
|
+
<GlobalStylesNavigationScreen path="/layout">
|
|
293
|
+
<ScreenLayout />
|
|
294
|
+
</GlobalStylesNavigationScreen>
|
|
295
|
+
|
|
296
|
+
<GlobalStylesNavigationScreen path="/css">
|
|
297
|
+
<ScreenCSS />
|
|
298
|
+
</GlobalStylesNavigationScreen>
|
|
299
|
+
|
|
300
|
+
<GlobalStylesNavigationScreen path={ '/revisions' }>
|
|
301
|
+
<ScreenRevisions />
|
|
302
|
+
</GlobalStylesNavigationScreen>
|
|
303
|
+
|
|
323
304
|
{ blocks.map( ( block ) => (
|
|
324
305
|
<GlobalStylesNavigationScreen
|
|
325
306
|
key={ 'menu-block-' + block.name }
|
|
@@ -339,14 +320,6 @@ function GlobalStylesUI() {
|
|
|
339
320
|
/>
|
|
340
321
|
) ) }
|
|
341
322
|
|
|
342
|
-
{ blocks.map( ( block, index ) => {
|
|
343
|
-
return (
|
|
344
|
-
<BlockStyleVariationsScreens
|
|
345
|
-
key={ 'screens-block-styles-' + block.name + index }
|
|
346
|
-
name={ block.name }
|
|
347
|
-
/>
|
|
348
|
-
);
|
|
349
|
-
} ) }
|
|
350
323
|
{ 'style-book' === editorCanvasContainerView && (
|
|
351
324
|
<GlobalStylesStyleBook />
|
|
352
325
|
) }
|
|
@@ -9,14 +9,12 @@ import { __experimentalItemGroup as ItemGroup } from '@wordpress/components';
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { NavigationButtonAsItem } from './navigation-button';
|
|
12
|
-
import ContextMenu from './context-menu';
|
|
13
12
|
|
|
14
13
|
function getCoreBlockStyles( blockStyles ) {
|
|
15
14
|
return blockStyles?.filter( ( style ) => style.source === 'block' );
|
|
16
15
|
}
|
|
17
16
|
|
|
18
|
-
export function
|
|
19
|
-
const isInsideVariationsPanel = parentMenu.includes( 'variations' );
|
|
17
|
+
export function useBlockVariations( name ) {
|
|
20
18
|
const blockStyles = useSelect(
|
|
21
19
|
( select ) => {
|
|
22
20
|
const { getBlockStyles } = select( blocksStore );
|
|
@@ -25,18 +23,11 @@ export function useHasVariationsPanel( name, parentMenu = '' ) {
|
|
|
25
23
|
[ name ]
|
|
26
24
|
);
|
|
27
25
|
const coreBlockStyles = getCoreBlockStyles( blockStyles );
|
|
28
|
-
return
|
|
26
|
+
return coreBlockStyles;
|
|
29
27
|
}
|
|
30
28
|
|
|
31
29
|
export function VariationsPanel( { name } ) {
|
|
32
|
-
const
|
|
33
|
-
( select ) => {
|
|
34
|
-
const { getBlockStyles } = select( blocksStore );
|
|
35
|
-
return getBlockStyles( name );
|
|
36
|
-
},
|
|
37
|
-
[ name ]
|
|
38
|
-
);
|
|
39
|
-
const coreBlockStyles = getCoreBlockStyles( blockStyles );
|
|
30
|
+
const coreBlockStyles = useBlockVariations( name );
|
|
40
31
|
|
|
41
32
|
return (
|
|
42
33
|
<ItemGroup isBordered isSeparated>
|
|
@@ -62,17 +53,3 @@ export function VariationsPanel( { name } ) {
|
|
|
62
53
|
</ItemGroup>
|
|
63
54
|
);
|
|
64
55
|
}
|
|
65
|
-
|
|
66
|
-
export function VariationPanel( { blockName, styleName } ) {
|
|
67
|
-
return (
|
|
68
|
-
<ContextMenu
|
|
69
|
-
parentMenu={
|
|
70
|
-
'/blocks/' +
|
|
71
|
-
encodeURIComponent( blockName ) +
|
|
72
|
-
'/variations/' +
|
|
73
|
-
encodeURIComponent( styleName )
|
|
74
|
-
}
|
|
75
|
-
name={ blockName }
|
|
76
|
-
/>
|
|
77
|
-
);
|
|
78
|
-
}
|