@wordpress/edit-site 5.25.0 → 5.25.1-next.79a6196f.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/LICENSE.md +1 -1
- package/build/components/block-editor/back-button.js +3 -2
- package/build/components/block-editor/back-button.js.map +1 -1
- package/build/components/block-editor/resizable-editor.js +2 -2
- package/build/components/block-editor/resizable-editor.js.map +1 -1
- package/build/components/block-editor/use-post-link-props.js +27 -0
- package/build/components/block-editor/use-post-link-props.js.map +1 -0
- package/build/components/block-editor/use-site-editor-settings.js +7 -24
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +15 -7
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/editor/index.js +15 -16
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +9 -7
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/collection-font-variant.js +5 -2
- package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js +3 -3
- package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +5 -5
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +8 -4
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/index.js +38 -21
- package/build/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +2 -2
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-variant.js +5 -2
- package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/local-fonts.js +26 -10
- package/build/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/resolvers.js +6 -6
- package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
- package/build/components/global-styles/font-library-modal/{tab-layout.js → tab-panel-layout.js} +4 -4
- package/build/components/global-styles/font-library-modal/tab-panel-layout.js.map +1 -0
- package/build/components/global-styles/font-library-modal/utils/index.js +35 -38
- package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build/components/global-styles/preview.js +43 -1
- package/build/components/global-styles/preview.js.map +1 -1
- package/build/components/global-styles/screen-color-palette.js +16 -12
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +52 -52
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +26 -35
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +40 -22
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build/components/global-styles/ui.js +13 -62
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/header-edit-mode/document-tools/index.js +8 -106
- package/build/components/header-edit-mode/document-tools/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +7 -11
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/mode-switcher/index.js +0 -2
- package/build/components/header-edit-mode/mode-switcher/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/index.js +10 -7
- package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/edit-mode.js +0 -23
- package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build/components/keyboard-shortcuts/register.js +0 -36
- package/build/components/keyboard-shortcuts/register.js.map +1 -1
- package/build/components/layout/index.js +6 -13
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page-main/index.js +4 -4
- package/build/components/page-main/index.js.map +1 -1
- package/build/components/page-pages/index.js +84 -37
- package/build/components/page-pages/index.js.map +1 -1
- package/build/components/page-patterns/dataviews-pattern-actions.js +305 -0
- package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -0
- package/build/components/page-patterns/dataviews-patterns.js +307 -0
- package/build/components/page-patterns/dataviews-patterns.js.map +1 -0
- package/build/components/page-patterns/duplicate-menu-item.js +1 -1
- package/build/components/page-patterns/duplicate-menu-item.js.map +1 -1
- package/build/components/page-patterns/grid-item.js +4 -3
- package/build/components/page-patterns/grid-item.js.map +1 -1
- package/build/components/page-patterns/patterns-list.js +2 -1
- package/build/components/page-patterns/patterns-list.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +23 -13
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-templates/index.js +312 -36
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/{page-patterns/pagination.js → pagination/index.js} +25 -12
- package/build/components/pagination/index.js.map +1 -0
- package/build/components/{page-pages/side-editor.js → post-preview/index.js} +8 -4
- package/build/components/post-preview/index.js.map +1 -0
- package/build/components/preferences-modal/enable-feature.js +3 -2
- package/build/components/preferences-modal/enable-feature.js.map +1 -1
- package/build/components/preferences-modal/enable-panel-option.js +33 -0
- package/build/components/preferences-modal/enable-panel-option.js.map +1 -0
- package/build/components/preferences-modal/index.js +57 -9
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/revisions/index.js +3 -7
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/routes/link.js +6 -2
- package/build/components/routes/link.js.map +1 -1
- package/build/components/save-button/index.js +6 -3
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/sidebar/index.js +3 -11
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-dataviews/add-new-view.js +2 -2
- package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +18 -5
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +3 -3
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/default-sidebar.js +1 -5
- package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +62 -10
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/index.js +1 -1
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -4
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/index.js +4 -13
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +5 -2
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/index.js +4 -1
- package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pages-dataviews/index.js +69 -0
- package/build/components/sidebar-navigation-screen-pages-dataviews/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-templates/index.js +63 -8
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/style-book/index.js +38 -8
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +11 -6
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/index.js +12 -7
- package/build/index.js.map +1 -1
- package/build/store/actions.js +39 -44
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +6 -2
- package/build/store/private-actions.js.map +1 -1
- package/build/store/reducer.js +0 -46
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +32 -41
- package/build/store/selectors.js.map +1 -1
- package/build/utils/get-is-list-page.js +1 -1
- package/build/utils/get-is-list-page.js.map +1 -1
- package/build-module/components/block-editor/back-button.js +4 -3
- package/build-module/components/block-editor/back-button.js.map +1 -1
- package/build-module/components/block-editor/resizable-editor.js +2 -2
- package/build-module/components/block-editor/resizable-editor.js.map +1 -1
- package/build-module/components/block-editor/use-post-link-props.js +20 -0
- package/build-module/components/block-editor/use-post-link-props.js.map +1 -0
- package/build-module/components/block-editor/use-site-editor-settings.js +8 -25
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +14 -7
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/editor/index.js +16 -17
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +9 -7
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +5 -2
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js +3 -3
- package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +7 -7
- 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 +8 -4
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/index.js +39 -22
- package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +2 -2
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js +5 -2
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/local-fonts.js +27 -11
- package/build-module/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/resolvers.js +5 -5
- package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/{tab-layout.js → tab-panel-layout.js} +4 -4
- package/build-module/components/global-styles/font-library-modal/tab-panel-layout.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/utils/index.js +34 -36
- package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build-module/components/global-styles/preview.js +45 -3
- package/build-module/components/global-styles/preview.js.map +1 -1
- package/build-module/components/global-styles/screen-color-palette.js +17 -13
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +53 -53
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +27 -36
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +40 -22
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build-module/components/global-styles/ui.js +15 -64
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/header-edit-mode/document-tools/index.js +13 -110
- package/build-module/components/header-edit-mode/document-tools/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +7 -11
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/header-edit-mode/mode-switcher/index.js +0 -2
- package/build-module/components/header-edit-mode/mode-switcher/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +10 -7
- package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/edit-mode.js +0 -23
- package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/register.js +0 -36
- package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
- package/build-module/components/layout/index.js +6 -13
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page-main/index.js +4 -4
- package/build-module/components/page-main/index.js.map +1 -1
- package/build-module/components/page-pages/index.js +83 -36
- package/build-module/components/page-pages/index.js.map +1 -1
- package/build-module/components/page-patterns/dataviews-pattern-actions.js +292 -0
- package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -0
- package/build-module/components/page-patterns/dataviews-patterns.js +299 -0
- package/build-module/components/page-patterns/dataviews-patterns.js.map +1 -0
- package/build-module/components/page-patterns/duplicate-menu-item.js +1 -1
- package/build-module/components/page-patterns/duplicate-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/grid-item.js +4 -3
- package/build-module/components/page-patterns/grid-item.js.map +1 -1
- package/build-module/components/page-patterns/patterns-list.js +2 -1
- package/build-module/components/page-patterns/patterns-list.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +23 -13
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-templates/index.js +314 -38
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/{page-patterns/pagination.js → pagination/index.js} +24 -12
- package/build-module/components/pagination/index.js.map +1 -0
- package/build-module/components/{page-pages/side-editor.js → post-preview/index.js} +7 -3
- package/build-module/components/post-preview/index.js.map +1 -0
- package/build-module/components/preferences-modal/enable-feature.js +3 -2
- package/build-module/components/preferences-modal/enable-feature.js.map +1 -1
- package/build-module/components/preferences-modal/enable-panel-option.js +26 -0
- package/build-module/components/preferences-modal/enable-panel-option.js.map +1 -0
- package/build-module/components/preferences-modal/index.js +57 -9
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/revisions/index.js +4 -8
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/routes/link.js +5 -2
- package/build-module/components/routes/link.js.map +1 -1
- package/build-module/components/save-button/index.js +6 -3
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +3 -11
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +17 -5
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +2 -2
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/default-sidebar.js +1 -5
- package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +64 -12
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/index.js +2 -2
- package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -4
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/index.js +6 -15
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +5 -2
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/index.js +4 -1
- package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js +61 -0
- package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-templates/index.js +64 -9
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/style-book/index.js +40 -10
- 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 +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +11 -6
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/index.js +12 -7
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +36 -41
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +6 -2
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/reducer.js +0 -44
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +30 -38
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/get-is-list-page.js +1 -1
- package/build-module/utils/get-is-list-page.js.map +1 -1
- package/build-style/style-rtl.css +366 -268
- package/build-style/style.css +366 -268
- package/package.json +42 -42
- package/src/components/add-new-template/style.scss +2 -1
- package/src/components/block-editor/back-button.js +4 -2
- package/src/components/block-editor/resizable-editor.js +1 -1
- package/src/components/block-editor/style.scss +1 -2
- package/src/components/block-editor/use-post-link-props.js +20 -0
- package/src/components/block-editor/use-site-editor-settings.js +10 -41
- package/src/components/code-editor/style.scss +0 -4
- package/src/components/create-template-part-modal/index.js +83 -82
- package/src/components/editor/index.js +24 -31
- package/src/components/editor-canvas-container/index.js +8 -6
- package/src/components/global-styles/font-library-modal/collection-font-variant.js +7 -2
- package/src/components/global-styles/font-library-modal/confirm-delete-dialog.js +3 -3
- package/src/components/global-styles/font-library-modal/context.js +7 -7
- package/src/components/global-styles/font-library-modal/font-collection.js +10 -5
- package/src/components/global-styles/font-library-modal/index.js +44 -24
- package/src/components/global-styles/font-library-modal/installed-fonts.js +3 -3
- package/src/components/global-styles/font-library-modal/library-font-variant.js +7 -2
- package/src/components/global-styles/font-library-modal/local-fonts.js +53 -26
- package/src/components/global-styles/font-library-modal/resolvers.js +5 -5
- package/src/components/global-styles/font-library-modal/style.scss +5 -2
- package/src/components/global-styles/font-library-modal/{tab-layout.js → tab-panel-layout.js} +9 -3
- package/src/components/global-styles/font-library-modal/utils/index.js +21 -23
- package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamily.spec.js +58 -0
- package/src/components/global-styles/preview.js +55 -3
- package/src/components/global-styles/screen-color-palette.js +16 -26
- package/src/components/global-styles/screen-revisions/index.js +91 -92
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +37 -38
- package/src/components/global-styles/screen-revisions/style.scss +77 -20
- package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +67 -0
- package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +73 -46
- package/src/components/global-styles/ui.js +13 -74
- package/src/components/header-edit-mode/document-tools/index.js +33 -165
- package/src/components/header-edit-mode/index.js +6 -17
- package/src/components/header-edit-mode/mode-switcher/index.js +0 -4
- package/src/components/header-edit-mode/more-menu/index.js +9 -7
- package/src/components/header-edit-mode/style.scss +0 -47
- package/src/components/keyboard-shortcuts/edit-mode.js +1 -26
- package/src/components/keyboard-shortcuts/register.js +0 -43
- package/src/components/layout/index.js +8 -27
- package/src/components/layout/style.scss +10 -3
- package/src/components/list/style.scss +0 -5
- package/src/components/page/style.scss +1 -1
- package/src/components/page-main/index.js +8 -8
- package/src/components/page-pages/index.js +112 -41
- package/src/components/page-pages/style.scss +3 -2
- package/src/components/page-patterns/dataviews-pattern-actions.js +329 -0
- package/src/components/page-patterns/dataviews-patterns.js +380 -0
- package/src/components/page-patterns/duplicate-menu-item.js +1 -1
- package/src/components/page-patterns/grid-item.js +3 -2
- package/src/components/page-patterns/patterns-list.js +2 -1
- package/src/components/page-patterns/style.scss +89 -26
- package/src/components/page-patterns/use-patterns.js +24 -15
- package/src/components/page-templates/index.js +399 -64
- package/src/components/{page-patterns/pagination.js → pagination/index.js} +21 -10
- package/src/components/pagination/style.scss +5 -0
- package/src/components/post-preview/index.js +16 -0
- package/src/components/preferences-modal/enable-feature.js +9 -5
- package/src/components/preferences-modal/enable-panel-option.js +23 -0
- package/src/components/preferences-modal/index.js +107 -22
- package/src/components/revisions/index.js +8 -15
- package/src/components/routes/link.js +11 -3
- package/src/components/save-button/index.js +16 -3
- package/src/components/sidebar/index.js +6 -13
- package/src/components/sidebar-dataviews/add-new-view.js +1 -1
- package/src/components/sidebar-dataviews/default-views.js +23 -6
- package/src/components/sidebar-dataviews/index.js +2 -2
- package/src/components/sidebar-edit-mode/default-sidebar.js +0 -12
- package/src/components/sidebar-edit-mode/global-styles-sidebar.js +85 -14
- package/src/components/sidebar-edit-mode/page-panels/index.js +15 -1
- package/src/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -12
- package/src/components/sidebar-edit-mode/style.scss +0 -10
- package/src/components/sidebar-edit-mode/template-panel/index.js +44 -40
- package/src/components/sidebar-edit-mode/template-panel/style.scss +0 -4
- package/src/components/sidebar-navigation-screen-details-footer/index.js +1 -1
- package/src/components/sidebar-navigation-screen-global-styles/index.js +3 -2
- package/src/components/sidebar-navigation-screen-page/index.js +2 -1
- package/src/components/sidebar-navigation-screen-pages-dataviews/index.js +77 -0
- package/src/components/sidebar-navigation-screen-templates/index.js +85 -28
- package/src/components/sidebar-navigation-screen-templates/style.scss +9 -0
- package/src/components/site-hub/style.scss +5 -2
- package/src/components/style-book/index.js +65 -21
- package/src/components/style-book/style.scss +3 -3
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +4 -1
- package/src/hooks/commands/use-edit-mode-commands.js +8 -12
- package/src/index.js +11 -5
- package/src/store/actions.js +35 -45
- package/src/store/private-actions.js +7 -3
- package/src/store/reducer.js +0 -44
- package/src/store/selectors.js +32 -38
- package/src/store/test/actions.js +11 -39
- package/src/store/test/reducer.js +1 -82
- package/src/store/test/selectors.js +0 -24
- package/src/style.scss +2 -1
- package/src/utils/get-is-list-page.js +2 -3
- package/build/components/global-styles/font-library-modal/tab-layout.js.map +0 -1
- package/build/components/global-styles/screen-revisions/get-revision-changes.js +0 -146
- package/build/components/global-styles/screen-revisions/get-revision-changes.js.map +0 -1
- package/build/components/header-edit-mode/undo-redo/redo.js +0 -41
- package/build/components/header-edit-mode/undo-redo/redo.js.map +0 -1
- package/build/components/header-edit-mode/undo-redo/undo.js +0 -40
- package/build/components/header-edit-mode/undo-redo/undo.js.map +0 -1
- package/build/components/page-pages/side-editor.js.map +0 -1
- package/build/components/page-patterns/pagination.js.map +0 -1
- package/build/components/page-templates/dataviews-templates.js +0 -317
- package/build/components/page-templates/dataviews-templates.js.map +0 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +0 -60
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +0 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +0 -109
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +0 -1
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -35
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-panel/last-revision.js +0 -73
- package/build/components/sidebar-edit-mode/template-panel/last-revision.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -219
- package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +0 -1
- package/build-module/components/global-styles/font-library-modal/tab-layout.js.map +0 -1
- package/build-module/components/global-styles/screen-revisions/get-revision-changes.js +0 -139
- package/build-module/components/global-styles/screen-revisions/get-revision-changes.js.map +0 -1
- package/build-module/components/header-edit-mode/undo-redo/redo.js +0 -33
- package/build-module/components/header-edit-mode/undo-redo/redo.js.map +0 -1
- package/build-module/components/header-edit-mode/undo-redo/undo.js +0 -32
- package/build-module/components/header-edit-mode/undo-redo/undo.js.map +0 -1
- package/build-module/components/page-pages/side-editor.js.map +0 -1
- package/build-module/components/page-patterns/pagination.js.map +0 -1
- package/build-module/components/page-templates/dataviews-templates.js +0 -309
- package/build-module/components/page-templates/dataviews-templates.js.map +0 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +0 -53
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +0 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +0 -102
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -27
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js +0 -65
- package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -209
- package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +0 -1
- package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamilies.spec.js +0 -62
- package/src/components/global-styles/font-library-modal/utils/test/wpKebabCase.spec.js +0 -28
- package/src/components/global-styles/screen-revisions/get-revision-changes.js +0 -171
- package/src/components/global-styles/screen-revisions/test/get-revision-changes.js +0 -191
- package/src/components/header-edit-mode/undo-redo/redo.js +0 -38
- package/src/components/header-edit-mode/undo-redo/undo.js +0 -34
- package/src/components/page-pages/side-editor.js +0 -14
- package/src/components/page-templates/dataviews-templates.js +0 -360
- package/src/components/secondary-sidebar/inserter-sidebar.js +0 -66
- package/src/components/secondary-sidebar/list-view-sidebar.js +0 -123
- package/src/components/secondary-sidebar/style.scss +0 -65
- package/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -26
- package/src/components/sidebar-edit-mode/template-panel/last-revision.js +0 -82
- package/src/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -279
|
@@ -37,11 +37,10 @@ var _constants = require("../../utils/constants");
|
|
|
37
37
|
*/
|
|
38
38
|
|
|
39
39
|
const {
|
|
40
|
+
PostViewLink,
|
|
40
41
|
PreviewDropdown
|
|
41
42
|
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
42
|
-
function HeaderEditMode({
|
|
43
|
-
setListViewToggleElement
|
|
44
|
-
}) {
|
|
43
|
+
function HeaderEditMode() {
|
|
45
44
|
const {
|
|
46
45
|
templateType,
|
|
47
46
|
isDistractionFree,
|
|
@@ -70,10 +69,10 @@ function HeaderEditMode({
|
|
|
70
69
|
templateType: getEditedPostType(),
|
|
71
70
|
blockEditorMode: __unstableGetEditorMode(),
|
|
72
71
|
blockSelectionStart: getBlockSelectionStart(),
|
|
73
|
-
showIconLabels: getPreference(
|
|
72
|
+
showIconLabels: getPreference('core', 'showIconLabels'),
|
|
74
73
|
editorCanvasView: (0, _lockUnlock.unlock)(select(_store.store)).getEditorCanvasContainerView(),
|
|
75
|
-
hasFixedToolbar: getPreference(
|
|
76
|
-
isDistractionFree: getPreference(
|
|
74
|
+
hasFixedToolbar: getPreference('core', 'fixedToolbar'),
|
|
75
|
+
isDistractionFree: getPreference('core', 'distractionFree'),
|
|
77
76
|
isZoomOutMode: __unstableGetEditorMode() === 'zoom-out'
|
|
78
77
|
};
|
|
79
78
|
}, []);
|
|
@@ -121,9 +120,7 @@ function HeaderEditMode({
|
|
|
121
120
|
transition: toolbarTransition
|
|
122
121
|
}, (0, _react.createElement)(_documentTools.default, {
|
|
123
122
|
blockEditorMode: blockEditorMode,
|
|
124
|
-
isDistractionFree: isDistractionFree
|
|
125
|
-
showIconLabels: showIconLabels,
|
|
126
|
-
setListViewToggleElement: setListViewToggleElement
|
|
123
|
+
isDistractionFree: isDistractionFree
|
|
127
124
|
}), isTopToolbar && (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)("div", {
|
|
128
125
|
className: (0, _classnames.default)('selected-block-tools-wrapper', {
|
|
129
126
|
'is-collapsed': isBlockToolsCollapsed
|
|
@@ -155,9 +152,8 @@ function HeaderEditMode({
|
|
|
155
152
|
'is-zoomed-out': isZoomedOutView
|
|
156
153
|
})
|
|
157
154
|
}, (0, _react.createElement)(PreviewDropdown, {
|
|
158
|
-
showIconLabels: showIconLabels,
|
|
159
155
|
disabled: isFocusMode || !hasDefaultEditorCanvasView
|
|
160
|
-
})), (0, _react.createElement)(_saveButton.default, null), !isDistractionFree && (0, _react.createElement)(_interface.PinnedItems.Slot, {
|
|
156
|
+
})), (0, _react.createElement)(PostViewLink, null), (0, _react.createElement)(_saveButton.default, null), !isDistractionFree && (0, _react.createElement)(_interface.PinnedItems.Slot, {
|
|
161
157
|
scope: "core/edit-site"
|
|
162
158
|
}), (0, _react.createElement)(_moreMenu.default, {
|
|
163
159
|
showIconLabels: showIconLabels
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_compose","_blockEditor","_data","_element","_interface","_i18n","_icons","_components","_preferences","_editor","_moreMenu","_saveButton","_documentTools","_store","_editorCanvasContainer","_lockUnlock","_constants","PreviewDropdown","unlock","editorPrivateApis","HeaderEditMode","setListViewToggleElement","templateType","isDistractionFree","blockEditorMode","blockSelectionStart","showIconLabels","editorCanvasView","hasFixedToolbar","isZoomOutMode","useSelect","select","getEditedPostType","editSiteStore","getBlockSelectionStart","__unstableGetEditorMode","blockEditorStore","get","getPreference","preferencesStore","getDeviceType","editorStore","deviceType","name","getEditorCanvasContainerView","isLargeViewport","useViewportMatch","isTopToolbar","blockToolbarRef","useRef","disableMotion","useReducedMotion","hasDefaultEditorCanvasView","useHasEditorCanvasContainer","isFocusMode","FOCUSABLE_ENTITIES","includes","isZoomedOutView","isBlockToolsCollapsed","setIsBlockToolsCollapsed","useState","hasBlockSelected","useEffect","toolbarVariants","y","isDistractionFreeHovering","view","edit","toolbarTransition","type","duration","ease","_react","createElement","className","classnames","__unstableMotion","div","variants","transition","default","Fragment","BlockToolbar","hideDragHandle","Popover","Slot","ref","Button","icon","next","previous","onClick","collapsed","label","__","getEditorCanvasContainerTitle","DocumentBar","disabled","PinnedItems","scope"],"sources":["@wordpress/edit-site/src/components/header-edit-mode/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useViewportMatch, useReducedMotion } from '@wordpress/compose';\nimport {\n\tBlockToolbar,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport { PinnedItems } from '@wordpress/interface';\nimport { __ } from '@wordpress/i18n';\nimport { next, previous } from '@wordpress/icons';\nimport {\n\tButton,\n\t__unstableMotion as motion,\n\tPopover,\n} from '@wordpress/components';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tDocumentBar,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport MoreMenu from './more-menu';\nimport SaveButton from '../save-button';\nimport DocumentTools from './document-tools';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tgetEditorCanvasContainerTitle,\n\tuseHasEditorCanvasContainer,\n} from '../editor-canvas-container';\nimport { unlock } from '../../lock-unlock';\nimport { FOCUSABLE_ENTITIES } from '../../utils/constants';\n\nconst { PreviewDropdown } = unlock( editorPrivateApis );\n\nexport default function HeaderEditMode( { setListViewToggleElement } ) {\n\tconst {\n\t\ttemplateType,\n\t\tisDistractionFree,\n\t\tblockEditorMode,\n\t\tblockSelectionStart,\n\t\tshowIconLabels,\n\t\teditorCanvasView,\n\t\thasFixedToolbar,\n\t\tisZoomOutMode,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditedPostType } = select( editSiteStore );\n\t\tconst { getBlockSelectionStart, __unstableGetEditorMode } =\n\t\t\tselect( blockEditorStore );\n\t\tconst { get: getPreference } = select( preferencesStore );\n\t\tconst { getDeviceType } = select( editorStore );\n\n\t\treturn {\n\t\t\tdeviceType: getDeviceType(),\n\t\t\ttemplateType: getEditedPostType(),\n\t\t\tblockEditorMode: __unstableGetEditorMode(),\n\t\t\tblockSelectionStart: getBlockSelectionStart(),\n\t\t\tshowIconLabels: getPreference(\n\t\t\t\teditSiteStore.name,\n\t\t\t\t'showIconLabels'\n\t\t\t),\n\t\t\teditorCanvasView: unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t).getEditorCanvasContainerView(),\n\t\t\thasFixedToolbar: getPreference(\n\t\t\t\teditSiteStore.name,\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tisDistractionFree: getPreference(\n\t\t\t\teditSiteStore.name,\n\t\t\t\t'distractionFree'\n\t\t\t),\n\t\t\tisZoomOutMode: __unstableGetEditorMode() === 'zoom-out',\n\t\t};\n\t}, [] );\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isTopToolbar = ! isZoomOutMode && hasFixedToolbar && isLargeViewport;\n\tconst blockToolbarRef = useRef();\n\tconst disableMotion = useReducedMotion();\n\n\tconst hasDefaultEditorCanvasView = ! useHasEditorCanvasContainer();\n\n\tconst isFocusMode = FOCUSABLE_ENTITIES.includes( templateType );\n\n\tconst isZoomedOutView = blockEditorMode === 'zoom-out';\n\n\tconst [ isBlockToolsCollapsed, setIsBlockToolsCollapsed ] =\n\t\tuseState( true );\n\n\tconst hasBlockSelected = !! blockSelectionStart;\n\n\tuseEffect( () => {\n\t\t// If we have a new block selection, show the block tools\n\t\tif ( blockSelectionStart ) {\n\t\t\tsetIsBlockToolsCollapsed( false );\n\t\t}\n\t}, [ blockSelectionStart ] );\n\n\tconst toolbarVariants = {\n\t\tisDistractionFree: { y: '-50px' },\n\t\tisDistractionFreeHovering: { y: 0 },\n\t\tview: { y: 0 },\n\t\tedit: { y: 0 },\n\t};\n\n\tconst toolbarTransition = {\n\t\ttype: 'tween',\n\t\tduration: disableMotion ? 0 : 0.2,\n\t\tease: 'easeOut',\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames( 'edit-site-header-edit-mode', {\n\t\t\t\t'show-icon-labels': showIconLabels,\n\t\t\t} ) }\n\t\t>\n\t\t\t{ hasDefaultEditorCanvasView && (\n\t\t\t\t<motion.div\n\t\t\t\t\tclassName=\"edit-site-header-edit-mode__start\"\n\t\t\t\t\tvariants={ toolbarVariants }\n\t\t\t\t\ttransition={ toolbarTransition }\n\t\t\t\t>\n\t\t\t\t\t<DocumentTools\n\t\t\t\t\t\tblockEditorMode={ blockEditorMode }\n\t\t\t\t\t\tisDistractionFree={ isDistractionFree }\n\t\t\t\t\t\tshowIconLabels={ showIconLabels }\n\t\t\t\t\t\tsetListViewToggleElement={ setListViewToggleElement }\n\t\t\t\t\t/>\n\t\t\t\t\t{ isTopToolbar && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\t'selected-block-tools-wrapper',\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t'is-collapsed': isBlockToolsCollapsed,\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<Popover.Slot\n\t\t\t\t\t\t\t\tref={ blockToolbarRef }\n\t\t\t\t\t\t\t\tname=\"block-toolbar\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ hasBlockSelected && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-header-edit-mode__block-tools-toggle\"\n\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\tisBlockToolsCollapsed ? next : previous\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tsetIsBlockToolsCollapsed(\n\t\t\t\t\t\t\t\t\t\t\t( collapsed ) => ! collapsed\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\t\tisBlockToolsCollapsed\n\t\t\t\t\t\t\t\t\t\t\t? __( 'Show block tools' )\n\t\t\t\t\t\t\t\t\t\t\t: __( 'Hide block tools' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</motion.div>\n\t\t\t) }\n\n\t\t\t{ ! isDistractionFree && (\n\t\t\t\t<div\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'edit-site-header-edit-mode__center',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-collapsed':\n\t\t\t\t\t\t\t\t! isBlockToolsCollapsed && isLargeViewport,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t{ ! hasDefaultEditorCanvasView ? (\n\t\t\t\t\t\tgetEditorCanvasContainerTitle( editorCanvasView )\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<DocumentBar />\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t) }\n\n\t\t\t<div className=\"edit-site-header-edit-mode__end\">\n\t\t\t\t<motion.div\n\t\t\t\t\tclassName=\"edit-site-header-edit-mode__actions\"\n\t\t\t\t\tvariants={ toolbarVariants }\n\t\t\t\t\ttransition={ toolbarTransition }\n\t\t\t\t>\n\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'edit-site-header-edit-mode__preview-options',\n\t\t\t\t\t\t\t\t{ 'is-zoomed-out': isZoomedOutView }\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PreviewDropdown\n\t\t\t\t\t\t\t\tshowIconLabels={ showIconLabels }\n\t\t\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t\t\tisFocusMode || ! hasDefaultEditorCanvasView\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t<SaveButton />\n\t\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t\t<PinnedItems.Slot scope=\"core/edit-site\" />\n\t\t\t\t\t) }\n\t\t\t\t\t<MoreMenu showIconLabels={ showIconLabels } />\n\t\t\t\t</motion.div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;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pC;EAAG,GAEH,IAAAe,MAAA,CAAAC,aAAA,EAACxD,eAAe;IACfS,cAAc,EAAGA,cAAgB;IACjCuE,QAAQ,EACP3C,WAAW,IAAI,CAAEF;EACjB,CACD,CACG,CACL,EACD,IAAAoB,MAAA,CAAAC,aAAA,EAAC9D,WAAA,CAAAqE,OAAU,MAAE,CAAC,EACZ,CAAEzD,iBAAiB,IACpB,IAAAiD,MAAA,CAAAC,aAAA,EAACrE,UAAA,CAAA8F,WAAW,CAACb,IAAI;IAACc,KAAK,EAAC;EAAgB,CAAE,CAC1C,EACD,IAAA3B,MAAA,CAAAC,aAAA,EAAC/D,SAAA,CAAAsE,OAAQ;IAACtD,cAAc,EAAGA;EAAgB,CAAE,CAClC,CACR,CACD,CAAC;AAER"}
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_compose","_blockEditor","_data","_element","_interface","_i18n","_icons","_components","_preferences","_editor","_moreMenu","_saveButton","_documentTools","_store","_editorCanvasContainer","_lockUnlock","_constants","PostViewLink","PreviewDropdown","unlock","editorPrivateApis","HeaderEditMode","templateType","isDistractionFree","blockEditorMode","blockSelectionStart","showIconLabels","editorCanvasView","hasFixedToolbar","isZoomOutMode","useSelect","select","getEditedPostType","editSiteStore","getBlockSelectionStart","__unstableGetEditorMode","blockEditorStore","get","getPreference","preferencesStore","getDeviceType","editorStore","deviceType","getEditorCanvasContainerView","isLargeViewport","useViewportMatch","isTopToolbar","blockToolbarRef","useRef","disableMotion","useReducedMotion","hasDefaultEditorCanvasView","useHasEditorCanvasContainer","isFocusMode","FOCUSABLE_ENTITIES","includes","isZoomedOutView","isBlockToolsCollapsed","setIsBlockToolsCollapsed","useState","hasBlockSelected","useEffect","toolbarVariants","y","isDistractionFreeHovering","view","edit","toolbarTransition","type","duration","ease","_react","createElement","className","classnames","__unstableMotion","div","variants","transition","default","Fragment","BlockToolbar","hideDragHandle","Popover","Slot","ref","name","Button","icon","next","previous","onClick","collapsed","label","__","getEditorCanvasContainerTitle","DocumentBar","disabled","PinnedItems","scope"],"sources":["@wordpress/edit-site/src/components/header-edit-mode/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useViewportMatch, useReducedMotion } from '@wordpress/compose';\nimport {\n\tBlockToolbar,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useEffect, useRef, useState } from '@wordpress/element';\nimport { PinnedItems } from '@wordpress/interface';\nimport { __ } from '@wordpress/i18n';\nimport { next, previous } from '@wordpress/icons';\nimport {\n\tButton,\n\t__unstableMotion as motion,\n\tPopover,\n} from '@wordpress/components';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tDocumentBar,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport MoreMenu from './more-menu';\nimport SaveButton from '../save-button';\nimport DocumentTools from './document-tools';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tgetEditorCanvasContainerTitle,\n\tuseHasEditorCanvasContainer,\n} from '../editor-canvas-container';\nimport { unlock } from '../../lock-unlock';\nimport { FOCUSABLE_ENTITIES } from '../../utils/constants';\n\nconst { PostViewLink, PreviewDropdown } = unlock( editorPrivateApis );\n\nexport default function HeaderEditMode() {\n\tconst {\n\t\ttemplateType,\n\t\tisDistractionFree,\n\t\tblockEditorMode,\n\t\tblockSelectionStart,\n\t\tshowIconLabels,\n\t\teditorCanvasView,\n\t\thasFixedToolbar,\n\t\tisZoomOutMode,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditedPostType } = select( editSiteStore );\n\t\tconst { getBlockSelectionStart, __unstableGetEditorMode } =\n\t\t\tselect( blockEditorStore );\n\t\tconst { get: getPreference } = select( preferencesStore );\n\t\tconst { getDeviceType } = select( editorStore );\n\n\t\treturn {\n\t\t\tdeviceType: getDeviceType(),\n\t\t\ttemplateType: getEditedPostType(),\n\t\t\tblockEditorMode: __unstableGetEditorMode(),\n\t\t\tblockSelectionStart: getBlockSelectionStart(),\n\t\t\tshowIconLabels: getPreference( 'core', 'showIconLabels' ),\n\t\t\teditorCanvasView: unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t).getEditorCanvasContainerView(),\n\t\t\thasFixedToolbar: getPreference( 'core', 'fixedToolbar' ),\n\t\t\tisDistractionFree: getPreference( 'core', 'distractionFree' ),\n\t\t\tisZoomOutMode: __unstableGetEditorMode() === 'zoom-out',\n\t\t};\n\t}, [] );\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isTopToolbar = ! isZoomOutMode && hasFixedToolbar && isLargeViewport;\n\tconst blockToolbarRef = useRef();\n\tconst disableMotion = useReducedMotion();\n\n\tconst hasDefaultEditorCanvasView = ! useHasEditorCanvasContainer();\n\n\tconst isFocusMode = FOCUSABLE_ENTITIES.includes( templateType );\n\n\tconst isZoomedOutView = blockEditorMode === 'zoom-out';\n\n\tconst [ isBlockToolsCollapsed, setIsBlockToolsCollapsed ] =\n\t\tuseState( true );\n\n\tconst hasBlockSelected = !! blockSelectionStart;\n\n\tuseEffect( () => {\n\t\t// If we have a new block selection, show the block tools\n\t\tif ( blockSelectionStart ) {\n\t\t\tsetIsBlockToolsCollapsed( false );\n\t\t}\n\t}, [ blockSelectionStart ] );\n\n\tconst toolbarVariants = {\n\t\tisDistractionFree: { y: '-50px' },\n\t\tisDistractionFreeHovering: { y: 0 },\n\t\tview: { y: 0 },\n\t\tedit: { y: 0 },\n\t};\n\n\tconst toolbarTransition = {\n\t\ttype: 'tween',\n\t\tduration: disableMotion ? 0 : 0.2,\n\t\tease: 'easeOut',\n\t};\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames( 'edit-site-header-edit-mode', {\n\t\t\t\t'show-icon-labels': showIconLabels,\n\t\t\t} ) }\n\t\t>\n\t\t\t{ hasDefaultEditorCanvasView && (\n\t\t\t\t<motion.div\n\t\t\t\t\tclassName=\"edit-site-header-edit-mode__start\"\n\t\t\t\t\tvariants={ toolbarVariants }\n\t\t\t\t\ttransition={ toolbarTransition }\n\t\t\t\t>\n\t\t\t\t\t<DocumentTools\n\t\t\t\t\t\tblockEditorMode={ blockEditorMode }\n\t\t\t\t\t\tisDistractionFree={ isDistractionFree }\n\t\t\t\t\t/>\n\t\t\t\t\t{ isTopToolbar && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t\t'selected-block-tools-wrapper',\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t'is-collapsed': isBlockToolsCollapsed,\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<Popover.Slot\n\t\t\t\t\t\t\t\tref={ blockToolbarRef }\n\t\t\t\t\t\t\t\tname=\"block-toolbar\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{ hasBlockSelected && (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-header-edit-mode__block-tools-toggle\"\n\t\t\t\t\t\t\t\t\ticon={\n\t\t\t\t\t\t\t\t\t\tisBlockToolsCollapsed ? next : previous\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tsetIsBlockToolsCollapsed(\n\t\t\t\t\t\t\t\t\t\t\t( collapsed ) => ! collapsed\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\t\t\tisBlockToolsCollapsed\n\t\t\t\t\t\t\t\t\t\t\t? __( 'Show block tools' )\n\t\t\t\t\t\t\t\t\t\t\t: __( 'Hide block tools' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</motion.div>\n\t\t\t) }\n\n\t\t\t{ ! isDistractionFree && (\n\t\t\t\t<div\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'edit-site-header-edit-mode__center',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-collapsed':\n\t\t\t\t\t\t\t\t! isBlockToolsCollapsed && isLargeViewport,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t{ ! hasDefaultEditorCanvasView ? (\n\t\t\t\t\t\tgetEditorCanvasContainerTitle( editorCanvasView )\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<DocumentBar />\n\t\t\t\t\t) }\n\t\t\t\t</div>\n\t\t\t) }\n\n\t\t\t<div className=\"edit-site-header-edit-mode__end\">\n\t\t\t\t<motion.div\n\t\t\t\t\tclassName=\"edit-site-header-edit-mode__actions\"\n\t\t\t\t\tvariants={ toolbarVariants }\n\t\t\t\t\ttransition={ toolbarTransition }\n\t\t\t\t>\n\t\t\t\t\t{ isLargeViewport && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t\t\t'edit-site-header-edit-mode__preview-options',\n\t\t\t\t\t\t\t\t{ 'is-zoomed-out': isZoomedOutView }\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PreviewDropdown\n\t\t\t\t\t\t\t\tdisabled={\n\t\t\t\t\t\t\t\t\tisFocusMode || ! hasDefaultEditorCanvasView\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t<PostViewLink />\n\t\t\t\t\t<SaveButton />\n\t\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t\t<PinnedItems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U,EACrB,6CAA6C,EAC7C;MAAE,eAAe,EAAElB;IAAgB,CACpC;EAAG,GAEH,IAAAe,MAAA,CAAAC,aAAA,EAACtD,eAAe;IACf+E,QAAQ,EACP5C,WAAW,IAAI,CAAEF;EACjB,CACD,CACG,CACL,EACD,IAAAoB,MAAA,CAAAC,aAAA,EAACvD,YAAY,MAAE,CAAC,EAChB,IAAAsD,MAAA,CAAAC,aAAA,EAAC7D,WAAA,CAAAoE,OAAU,MAAE,CAAC,EACZ,CAAExD,iBAAiB,IACpB,IAAAgD,MAAA,CAAAC,aAAA,EAACpE,UAAA,CAAA8F,WAAW,CAACd,IAAI;IAACe,KAAK,EAAC;EAAgB,CAAE,CAC1C,EACD,IAAA5B,MAAA,CAAAC,aAAA,EAAC9D,SAAA,CAAAqE,OAAQ;IAACrD,cAAc,EAAGA;EAAgB,CAAE,CAClC,CACR,CACD,CAAC;AAER"}
|
|
@@ -36,8 +36,6 @@ function ModeSwitcher() {
|
|
|
36
36
|
mode
|
|
37
37
|
} = (0, _data.useSelect)(select => ({
|
|
38
38
|
shortcut: select(_keyboardShortcuts.store).getShortcutRepresentation('core/edit-site/toggle-mode'),
|
|
39
|
-
isRichEditingEnabled: select(_store.store).getSettings().richEditingEnabled,
|
|
40
|
-
isCodeEditingEnabled: select(_store.store).getSettings().codeEditingEnabled,
|
|
41
39
|
mode: select(_store.store).getEditorMode()
|
|
42
40
|
}), []);
|
|
43
41
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_data","_keyboardShortcuts","_store","MODES","value","label","__","ModeSwitcher","shortcut","mode","useSelect","select","keyboardShortcutsStore","getShortcutRepresentation","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_data","_keyboardShortcuts","_store","MODES","value","label","__","ModeSwitcher","shortcut","mode","useSelect","select","keyboardShortcutsStore","getShortcutRepresentation","editSiteStore","getEditorMode","switchEditorMode","useDispatch","choices","map","choice","_react","createElement","MenuGroup","MenuItemsChoice","onSelect","_default","exports","default"],"sources":["@wordpress/edit-site/src/components/header-edit-mode/mode-switcher/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { MenuItemsChoice, MenuGroup } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../../store';\n\n/**\n * Set of available mode options.\n *\n * @type {Array}\n */\nconst MODES = [\n\t{\n\t\tvalue: 'visual',\n\t\tlabel: __( 'Visual editor' ),\n\t},\n\t{\n\t\tvalue: 'text',\n\t\tlabel: __( 'Code editor' ),\n\t},\n];\n\nfunction ModeSwitcher() {\n\tconst { shortcut, mode } = useSelect(\n\t\t( select ) => ( {\n\t\t\tshortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getShortcutRepresentation( 'core/edit-site/toggle-mode' ),\n\t\t\tmode: select( editSiteStore ).getEditorMode(),\n\t\t} ),\n\t\t[]\n\t);\n\tconst { switchEditorMode } = useDispatch( editSiteStore );\n\n\tconst choices = MODES.map( ( choice ) => {\n\t\tif ( choice.value !== mode ) {\n\t\t\treturn { ...choice, shortcut };\n\t\t}\n\t\treturn choice;\n\t} );\n\n\treturn (\n\t\t<MenuGroup label={ __( 'Editor' ) }>\n\t\t\t<MenuItemsChoice\n\t\t\t\tchoices={ choices }\n\t\t\t\tvalue={ mode }\n\t\t\t\tonSelect={ switchEditorMode }\n\t\t\t/>\n\t\t</MenuGroup>\n\t);\n}\n\nexport default ModeSwitcher;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAJ,OAAA;AAXA;AACA;AACA;;AAMA;AACA;AACA;;AAGA;AACA;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
|
14
14
|
var _interface = require("@wordpress/interface");
|
|
15
15
|
var _preferences = require("@wordpress/preferences");
|
|
16
|
+
var _editor = require("@wordpress/editor");
|
|
16
17
|
var _keyboardShortcutHelpModal = _interopRequireWildcard(require("../../keyboard-shortcut-help-modal"));
|
|
17
18
|
var _preferencesModal = _interopRequireWildcard(require("../../preferences-modal"));
|
|
18
19
|
var _toolsMoreMenuGroup = _interopRequireDefault(require("../tools-more-menu-group"));
|
|
@@ -36,10 +37,12 @@ function MoreMenu({
|
|
|
36
37
|
}) {
|
|
37
38
|
const registry = (0, _data.useRegistry)();
|
|
38
39
|
const {
|
|
39
|
-
setIsInserterOpened,
|
|
40
|
-
setIsListViewOpened,
|
|
41
40
|
closeGeneralSidebar
|
|
42
41
|
} = (0, _data.useDispatch)(_store.store);
|
|
42
|
+
const {
|
|
43
|
+
setIsInserterOpened,
|
|
44
|
+
setIsListViewOpened
|
|
45
|
+
} = (0, _data.useDispatch)(_editor.store);
|
|
43
46
|
const {
|
|
44
47
|
openModal
|
|
45
48
|
} = (0, _data.useDispatch)(_interface.store);
|
|
@@ -48,14 +51,14 @@ function MoreMenu({
|
|
|
48
51
|
} = (0, _data.useDispatch)(_preferences.store);
|
|
49
52
|
const toggleDistractionFree = () => {
|
|
50
53
|
registry.batch(() => {
|
|
51
|
-
setPreference('core
|
|
54
|
+
setPreference('core', 'fixedToolbar', true);
|
|
52
55
|
setIsInserterOpened(false);
|
|
53
56
|
setIsListViewOpened(false);
|
|
54
57
|
closeGeneralSidebar();
|
|
55
58
|
});
|
|
56
59
|
};
|
|
57
60
|
const turnOffDistractionFree = () => {
|
|
58
|
-
setPreference('core
|
|
61
|
+
setPreference('core', 'distractionFree', false);
|
|
59
62
|
};
|
|
60
63
|
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_interface.MoreMenuDropdown, {
|
|
61
64
|
toggleProps: {
|
|
@@ -69,7 +72,7 @@ function MoreMenu({
|
|
|
69
72
|
}) => (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_components.MenuGroup, {
|
|
70
73
|
label: (0, _i18n._x)('View', 'noun')
|
|
71
74
|
}, (0, _react.createElement)(_preferences.PreferenceToggleMenuItem, {
|
|
72
|
-
scope: "core
|
|
75
|
+
scope: "core",
|
|
73
76
|
name: "fixedToolbar",
|
|
74
77
|
onToggle: turnOffDistractionFree,
|
|
75
78
|
label: (0, _i18n.__)('Top toolbar'),
|
|
@@ -77,7 +80,7 @@ function MoreMenu({
|
|
|
77
80
|
messageActivated: (0, _i18n.__)('Top toolbar activated'),
|
|
78
81
|
messageDeactivated: (0, _i18n.__)('Top toolbar deactivated')
|
|
79
82
|
}), (0, _react.createElement)(_preferences.PreferenceToggleMenuItem, {
|
|
80
|
-
scope: "core
|
|
83
|
+
scope: "core",
|
|
81
84
|
name: "distractionFree",
|
|
82
85
|
onToggle: toggleDistractionFree,
|
|
83
86
|
label: (0, _i18n.__)('Distraction free'),
|
|
@@ -86,7 +89,7 @@ function MoreMenu({
|
|
|
86
89
|
messageDeactivated: (0, _i18n.__)('Distraction free mode deactivated'),
|
|
87
90
|
shortcut: _keycodes.displayShortcut.primaryShift('\\')
|
|
88
91
|
}), (0, _react.createElement)(_preferences.PreferenceToggleMenuItem, {
|
|
89
|
-
scope: "core
|
|
92
|
+
scope: "core",
|
|
90
93
|
name: "focusMode",
|
|
91
94
|
label: (0, _i18n.__)('Spotlight mode'),
|
|
92
95
|
info: (0, _i18n.__)('Focus on one block at a time'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_data","_keycodes","_icons","_components","_interface","_preferences","_keyboardShortcutHelpModal","_interopRequireWildcard","_preferencesModal","_toolsMoreMenuGroup","_interopRequireDefault","_siteExport","_welcomeGuideMenuItem","_copyContentMenuItem","_modeSwitcher","_store","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","MoreMenu","showIconLabels","registry","useRegistry","setIsInserterOpened","setIsListViewOpened","closeGeneralSidebar","useDispatch","siteEditorStore","openModal","interfaceStore","setPreference","preferencesStore","toggleDistractionFree","batch","turnOffDistractionFree","_react","createElement","Fragment","MoreMenuDropdown","toggleProps","showTooltip","variant","onClose","MenuGroup","label","_x","PreferenceToggleMenuItem","scope","name","onToggle","__","info","messageActivated","messageDeactivated","shortcut","displayShortcut","primaryShift","ActionItem","Slot","as","fillProps","onClick","MenuItem","KEYBOARD_SHORTCUT_HELP_MODAL_NAME","access","icon","external","role","href","target","rel","VisuallyHidden","PREFERENCES_MODAL_NAME"],"sources":["@wordpress/edit-site/src/components/header-edit-mode/more-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { useDispatch, useRegistry } from '@wordpress/data';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { external } from '@wordpress/icons';\nimport { MenuGroup, MenuItem, VisuallyHidden } from '@wordpress/components';\nimport {\n\tActionItem,\n\tMoreMenuDropdown,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport {\n\tPreferenceToggleMenuItem,\n\tstore as preferencesStore,\n} from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport {\n\tKEYBOARD_SHORTCUT_HELP_MODAL_NAME,\n\tdefault as KeyboardShortcutHelpModal,\n} from '../../keyboard-shortcut-help-modal';\nimport {\n\tPREFERENCES_MODAL_NAME,\n\tdefault as EditSitePreferencesModal,\n} from '../../preferences-modal';\nimport ToolsMoreMenuGroup from '../tools-more-menu-group';\nimport SiteExport from './site-export';\nimport WelcomeGuideMenuItem from './welcome-guide-menu-item';\nimport CopyContentMenuItem from './copy-content-menu-item';\nimport ModeSwitcher from '../mode-switcher';\nimport { store as siteEditorStore } from '../../../store';\n\nexport default function MoreMenu( { showIconLabels } ) {\n\tconst registry = useRegistry();\n\n\tconst { setIsInserterOpened, setIsListViewOpened, closeGeneralSidebar } =\n\t\tuseDispatch( siteEditorStore );\n\tconst { openModal } = useDispatch( interfaceStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst toggleDistractionFree = () => {\n\t\tregistry.batch( () => {\n\t\t\tsetPreference( 'core/edit-site', 'fixedToolbar', true );\n\t\t\tsetIsInserterOpened( false );\n\t\t\tsetIsListViewOpened( false );\n\t\t\tcloseGeneralSidebar();\n\t\t} );\n\t};\n\n\tconst turnOffDistractionFree = () => {\n\t\tsetPreference( 'core/edit-site', 'distractionFree', false );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<MoreMenuDropdown\n\t\t\t\ttoggleProps={ {\n\t\t\t\t\tshowTooltip: ! showIconLabels,\n\t\t\t\t\t...( showIconLabels && { variant: 'tertiary' } ),\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core/edit-site\"\n\t\t\t\t\t\t\t\tname=\"fixedToolbar\"\n\t\t\t\t\t\t\t\tonToggle={ turnOffDistractionFree }\n\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Top toolbar activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Top toolbar deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core/edit-site\"\n\t\t\t\t\t\t\t\tname=\"distractionFree\"\n\t\t\t\t\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t\t\tinfo={ __( 'Write with calmness' ) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Distraction free mode activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Distraction free mode deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.primaryShift(\n\t\t\t\t\t\t\t\t\t'\\\\'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core/edit-site\"\n\t\t\t\t\t\t\t\tname=\"focusMode\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t\tinfo={ __( 'Focus on one block at a time' ) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Spotlight mode activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Spotlight mode deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<ModeSwitcher />\n\t\t\t\t\t\t<ActionItem.Slot\n\t\t\t\t\t\t\tname=\"core/edit-site/plugin-more-menu\"\n\t\t\t\t\t\t\tlabel={ __( 'Plugins' ) }\n\t\t\t\t\t\t\tas={ MenuGroup }\n\t\t\t\t\t\t\tfillProps={ { onClick: onClose } }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>\n\t\t\t\t\t\t\t<SiteExport />\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\topenModal(\n\t\t\t\t\t\t\t\t\t\tKEYBOARD_SHORTCUT_HELP_MODAL_NAME\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<WelcomeGuideMenuItem />\n\t\t\t\t\t\t\t<CopyContentMenuItem />\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/site-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<ToolsMoreMenuGroup.Slot\n\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\topenModal( PREFERENCES_MODAL_NAME )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\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","_preferences","_editor","_keyboardShortcutHelpModal","_interopRequireWildcard","_preferencesModal","_toolsMoreMenuGroup","_interopRequireDefault","_siteExport","_welcomeGuideMenuItem","_copyContentMenuItem","_modeSwitcher","_store","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","MoreMenu","showIconLabels","registry","useRegistry","closeGeneralSidebar","useDispatch","siteEditorStore","setIsInserterOpened","setIsListViewOpened","editorStore","openModal","interfaceStore","setPreference","preferencesStore","toggleDistractionFree","batch","turnOffDistractionFree","_react","createElement","Fragment","MoreMenuDropdown","toggleProps","showTooltip","variant","onClose","MenuGroup","label","_x","PreferenceToggleMenuItem","scope","name","onToggle","__","info","messageActivated","messageDeactivated","shortcut","displayShortcut","primaryShift","ActionItem","Slot","as","fillProps","onClick","MenuItem","KEYBOARD_SHORTCUT_HELP_MODAL_NAME","access","icon","external","role","href","target","rel","VisuallyHidden","PREFERENCES_MODAL_NAME"],"sources":["@wordpress/edit-site/src/components/header-edit-mode/more-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { useDispatch, useRegistry } from '@wordpress/data';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { external } from '@wordpress/icons';\nimport { MenuGroup, MenuItem, VisuallyHidden } from '@wordpress/components';\nimport {\n\tActionItem,\n\tMoreMenuDropdown,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport {\n\tPreferenceToggleMenuItem,\n\tstore as preferencesStore,\n} from '@wordpress/preferences';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport {\n\tKEYBOARD_SHORTCUT_HELP_MODAL_NAME,\n\tdefault as KeyboardShortcutHelpModal,\n} from '../../keyboard-shortcut-help-modal';\nimport {\n\tPREFERENCES_MODAL_NAME,\n\tdefault as EditSitePreferencesModal,\n} from '../../preferences-modal';\nimport ToolsMoreMenuGroup from '../tools-more-menu-group';\nimport SiteExport from './site-export';\nimport WelcomeGuideMenuItem from './welcome-guide-menu-item';\nimport CopyContentMenuItem from './copy-content-menu-item';\nimport ModeSwitcher from '../mode-switcher';\nimport { store as siteEditorStore } from '../../../store';\n\nexport default function MoreMenu( { showIconLabels } ) {\n\tconst registry = useRegistry();\n\n\tconst { closeGeneralSidebar } = useDispatch( siteEditorStore );\n\tconst { setIsInserterOpened, setIsListViewOpened } =\n\t\tuseDispatch( editorStore );\n\tconst { openModal } = useDispatch( interfaceStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst toggleDistractionFree = () => {\n\t\tregistry.batch( () => {\n\t\t\tsetPreference( 'core', 'fixedToolbar', true );\n\t\t\tsetIsInserterOpened( false );\n\t\t\tsetIsListViewOpened( false );\n\t\t\tcloseGeneralSidebar();\n\t\t} );\n\t};\n\n\tconst turnOffDistractionFree = () => {\n\t\tsetPreference( 'core', 'distractionFree', false );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<MoreMenuDropdown\n\t\t\t\ttoggleProps={ {\n\t\t\t\t\tshowTooltip: ! showIconLabels,\n\t\t\t\t\t...( showIconLabels && { variant: 'tertiary' } ),\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<MenuGroup label={ _x( 'View', 'noun' ) }>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tname=\"fixedToolbar\"\n\t\t\t\t\t\t\t\tonToggle={ turnOffDistractionFree }\n\t\t\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t\t'Access all block and document tools in a single place'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Top toolbar activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Top toolbar deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tname=\"distractionFree\"\n\t\t\t\t\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t\t\tinfo={ __( 'Write with calmness' ) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Distraction free mode activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Distraction free mode deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.primaryShift(\n\t\t\t\t\t\t\t\t\t'\\\\'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<PreferenceToggleMenuItem\n\t\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\t\tname=\"focusMode\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t\t\t\tinfo={ __( 'Focus on one block at a time' ) }\n\t\t\t\t\t\t\t\tmessageActivated={ __(\n\t\t\t\t\t\t\t\t\t'Spotlight mode activated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tmessageDeactivated={ __(\n\t\t\t\t\t\t\t\t\t'Spotlight mode deactivated'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<ModeSwitcher />\n\t\t\t\t\t\t<ActionItem.Slot\n\t\t\t\t\t\t\tname=\"core/edit-site/plugin-more-menu\"\n\t\t\t\t\t\t\tlabel={ __( 'Plugins' ) }\n\t\t\t\t\t\t\tas={ MenuGroup }\n\t\t\t\t\t\t\tfillProps={ { onClick: onClose } }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<MenuGroup label={ __( 'Tools' ) }>\n\t\t\t\t\t\t\t<SiteExport />\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\topenModal(\n\t\t\t\t\t\t\t\t\t\tKEYBOARD_SHORTCUT_HELP_MODAL_NAME\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<WelcomeGuideMenuItem />\n\t\t\t\t\t\t\t<CopyContentMenuItem />\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/site-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<ToolsMoreMenuGroup.Slot\n\t\t\t\t\t\t\t\tfillProps={ { onClose } }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\topenModal( PREFERENCES_MODAL_NAME )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Preferences' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</MoreMenuDropdown>\n\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t<EditSitePreferencesModal />\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AAKA,IAAAM,YAAA,GAAAN,OAAA;AAIA,IAAAO,OAAA,GAAAP,OAAA;AAKA,IAAAQ,0BAAA,GAAAC,uBAAA,CAAAT,OAAA;AAIA,IAAAU,iBAAA,GAAAD,uBAAA,CAAAT,OAAA;AAIA,IAAAW,mBAAA,GAAAC,sBAAA,CAAAZ,OAAA;AACA,IAAAa,WAAA,GAAAD,sBAAA,CAAAZ,OAAA;AACA,IAAAc,qBAAA,GAAAF,sBAAA,CAAAZ,OAAA;AACA,IAAAe,oBAAA,GAAAH,sBAAA,CAAAZ,OAAA;AACA,IAAAgB,aAAA,GAAAJ,sBAAA,CAAAZ,OAAA;AACA,IAAAiB,MAAA,GAAAjB,OAAA;AAA0D,SAAAkB,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,O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CAAAgF,QAAQ;IACRD,OAAO,EAAGA,CAAA,KACTjC,SAAS,CAAE4C,wCAAuB;EAClC,GAEC,IAAAtB,QAAE,EAAE,aAAc,CACX,CACA,CACV,CAEc,CAAC,EACnB,IAAAf,MAAA,CAAAC,aAAA,EAAClD,0BAAA,CAAAiB,OAAyB,MAAE,CAAC,EAC7B,IAAAgC,MAAA,CAAAC,aAAA,EAAChD,iBAAA,CAAAe,OAAwB,MAAE,CAC1B,CAAC;AAEL"}
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
|
|
8
8
|
var _data = require("@wordpress/data");
|
|
9
|
-
var _coreData = require("@wordpress/core-data");
|
|
10
9
|
var _blockEditor = require("@wordpress/block-editor");
|
|
11
10
|
var _interface = require("@wordpress/interface");
|
|
12
11
|
var _blocks = require("@wordpress/blocks");
|
|
@@ -25,14 +24,8 @@ function KeyboardShortcutsEditMode() {
|
|
|
25
24
|
const {
|
|
26
25
|
getEditorMode
|
|
27
26
|
} = (0, _data.useSelect)(_store.store);
|
|
28
|
-
const isListViewOpen = (0, _data.useSelect)(select => select(_store.store).isListViewOpened(), []);
|
|
29
27
|
const isBlockInspectorOpen = (0, _data.useSelect)(select => select(_interface.store).getActiveComplementaryArea(_store.store.name) === _constants.SIDEBAR_BLOCK, []);
|
|
30
28
|
const {
|
|
31
|
-
redo,
|
|
32
|
-
undo
|
|
33
|
-
} = (0, _data.useDispatch)(_coreData.store);
|
|
34
|
-
const {
|
|
35
|
-
setIsListViewOpened,
|
|
36
29
|
switchEditorMode,
|
|
37
30
|
toggleDistractionFree
|
|
38
31
|
} = (0, _data.useDispatch)(_store.store);
|
|
@@ -70,22 +63,6 @@ function KeyboardShortcutsEditMode() {
|
|
|
70
63
|
}
|
|
71
64
|
}));
|
|
72
65
|
};
|
|
73
|
-
(0, _keyboardShortcuts.useShortcut)('core/edit-site/undo', event => {
|
|
74
|
-
undo();
|
|
75
|
-
event.preventDefault();
|
|
76
|
-
});
|
|
77
|
-
(0, _keyboardShortcuts.useShortcut)('core/edit-site/redo', event => {
|
|
78
|
-
redo();
|
|
79
|
-
event.preventDefault();
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
// Only opens the list view. Other functionality for this shortcut happens in the rendered sidebar.
|
|
83
|
-
(0, _keyboardShortcuts.useShortcut)('core/edit-site/toggle-list-view', () => {
|
|
84
|
-
if (isListViewOpen) {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
setIsListViewOpened(true);
|
|
88
|
-
});
|
|
89
66
|
(0, _keyboardShortcuts.useShortcut)('core/edit-site/toggle-block-settings-sidebar', event => {
|
|
90
67
|
// This shortcut has no known clashes, but use preventDefault to prevent any
|
|
91
68
|
// obscure shortcuts from triggering.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_keyboardShortcuts","require","_data","
|
|
1
|
+
{"version":3,"names":["_keyboardShortcuts","require","_data","_blockEditor","_interface","_blocks","_store","_constants","_constants2","KeyboardShortcutsEditMode","getEditorMode","useSelect","editSiteStore","isBlockInspectorOpen","select","interfaceStore","getActiveComplementaryArea","name","SIDEBAR_BLOCK","switchEditorMode","toggleDistractionFree","useDispatch","enableComplementaryArea","disableComplementaryArea","replaceBlocks","blockEditorStore","getBlockName","getSelectedBlockClientId","getBlockAttributes","handleTextLevelShortcut","event","level","preventDefault","destinationBlockName","currentClientId","blockName","attributes","textAlign","destinationTextAlign","createBlock","content","useShortcut","STORE_NAME","forEach","_default","exports","default"],"sources":["@wordpress/edit-site/src/components/keyboard-shortcuts/edit-mode.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { SIDEBAR_BLOCK } from '../sidebar-edit-mode/constants';\nimport { STORE_NAME } from '../../store/constants';\n\nfunction KeyboardShortcutsEditMode() {\n\tconst { getEditorMode } = useSelect( editSiteStore );\n\tconst isBlockInspectorOpen = useSelect(\n\t\t( select ) =>\n\t\t\tselect( interfaceStore ).getActiveComplementaryArea(\n\t\t\t\teditSiteStore.name\n\t\t\t) === SIDEBAR_BLOCK,\n\t\t[]\n\t);\n\tconst { switchEditorMode, toggleDistractionFree } =\n\t\tuseDispatch( editSiteStore );\n\tconst { enableComplementaryArea, disableComplementaryArea } =\n\t\tuseDispatch( interfaceStore );\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\tconst { getBlockName, getSelectedBlockClientId, getBlockAttributes } =\n\t\tuseSelect( blockEditorStore );\n\n\tconst handleTextLevelShortcut = ( event, level ) => {\n\t\tevent.preventDefault();\n\t\tconst destinationBlockName =\n\t\t\tlevel === 0 ? 'core/paragraph' : 'core/heading';\n\t\tconst currentClientId = getSelectedBlockClientId();\n\t\tif ( currentClientId === null ) {\n\t\t\treturn;\n\t\t}\n\t\tconst blockName = getBlockName( currentClientId );\n\t\tif ( blockName !== 'core/paragraph' && blockName !== 'core/heading' ) {\n\t\t\treturn;\n\t\t}\n\t\tconst attributes = getBlockAttributes( currentClientId );\n\t\tconst textAlign =\n\t\t\tblockName === 'core/paragraph' ? 'align' : 'textAlign';\n\t\tconst destinationTextAlign =\n\t\t\tdestinationBlockName === 'core/paragraph' ? 'align' : 'textAlign';\n\n\t\treplaceBlocks(\n\t\t\tcurrentClientId,\n\t\t\tcreateBlock( destinationBlockName, {\n\t\t\t\tlevel,\n\t\t\t\tcontent: attributes.content,\n\t\t\t\t...{ [ destinationTextAlign ]: attributes[ textAlign ] },\n\t\t\t} )\n\t\t);\n\t};\n\n\tuseShortcut( 'core/edit-site/toggle-block-settings-sidebar', ( event ) => {\n\t\t// This shortcut has no known clashes, but use preventDefault to prevent any\n\t\t// obscure shortcuts from triggering.\n\t\tevent.preventDefault();\n\n\t\tif ( isBlockInspectorOpen ) {\n\t\t\tdisableComplementaryArea( STORE_NAME );\n\t\t} else {\n\t\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_BLOCK );\n\t\t}\n\t} );\n\n\tuseShortcut( 'core/edit-site/toggle-mode', () => {\n\t\tswitchEditorMode( getEditorMode() === 'visual' ? 'text' : 'visual' );\n\t} );\n\n\tuseShortcut( 'core/edit-site/transform-heading-to-paragraph', ( event ) =>\n\t\thandleTextLevelShortcut( event, 0 )\n\t);\n\n\t[ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {\n\t\t//the loop is based off on a constant therefore\n\t\t//the hook will execute the same way every time\n\t\t//eslint-disable-next-line react-hooks/rules-of-hooks\n\t\tuseShortcut(\n\t\t\t`core/edit-site/transform-paragraph-to-heading-${ level }`,\n\t\t\t( event ) => handleTextLevelShortcut( event, level )\n\t\t);\n\t} );\n\n\tuseShortcut( 'core/edit-site/toggle-distraction-free', () => {\n\t\ttoggleDistractionFree();\n\t} );\n\n\treturn null;\n}\n\nexport default KeyboardShortcutsEditMode;\n"],"mappings":";;;;;;AAGA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AAdA;AACA;AACA;;AAOA;AACA;AACA;;AAKA,SAASQ,yBAAyBA,CAAA,EAAG;EACpC,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAC,eAAS,EAAEC,YAAc,CAAC;EACpD,MAAMC,oBAAoB,GAAG,IAAAF,eAAS,EACnCG,MAAM,IACPA,MAAM,CAAEC,gBAAe,CAAC,CAAC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EACF,CAAC;EAED,IAAAI,8BAAW,EAAE,8CAA8C,EAAIX,KAAK,IAAM;IACzE;IACA;IACAA,KAAK,CAACE,cAAc,CAAC,CAAC;IAEtB,IAAKnB,oBAAoB,EAAG;MAC3BU,wBAAwB,CAAEmB,sBAAW,CAAC;IACvC,CAAC,MAAM;MACNpB,uBAAuB,CAAEoB,sBAAU,EAAExB,wBAAc,CAAC;IACrD;EACD,CAAE,CAAC;EAEH,IAAAuB,8BAAW,EAAE,4BAA4B,EAAE,MAAM;IAChDtB,gBAAgB,CAAET,aAAa,CAAC,CAAC,KAAK,QAAQ,GAAG,MAAM,GAAG,QAAS,CAAC;EACrE,CAAE,CAAC;EAEH,IAAA+B,8BAAW,EAAE,+CAA+C,EAAIX,KAAK,IACpED,uBAAuB,CAAEC,KAAK,EAAE,CAAE,CACnC,CAAC;EAED,CAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAE,CAACa,OAAO,CAAIZ,KAAK,IAAM;IAC1C;IACA;IACA;IACA,IAAAU,8BAAW,EACT,iDAAiDV,KAAO,EAAC,EACxDD,KAAK,IAAMD,uBAAuB,CAAEC,KAAK,EAAEC,KAAM,CACpD,CAAC;EACF,CAAE,CAAC;EAEH,IAAAU,8BAAW,EAAE,wCAAwC,EAAE,MAAM;IAC5DrB,qBAAqB,CAAC,CAAC;EACxB,CAAE,CAAC;EAEH,OAAO,IAAI;AACZ;AAAC,IAAAwB,QAAA,GAEcnC,yBAAyB;AAAAoC,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _element = require("@wordpress/element");
|
|
8
8
|
var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
|
|
9
|
-
var _keycodes = require("@wordpress/keycodes");
|
|
10
9
|
var _data = require("@wordpress/data");
|
|
11
10
|
var _i18n = require("@wordpress/i18n");
|
|
12
11
|
/**
|
|
@@ -28,41 +27,6 @@ function KeyboardShortcutsRegister() {
|
|
|
28
27
|
character: 's'
|
|
29
28
|
}
|
|
30
29
|
});
|
|
31
|
-
registerShortcut({
|
|
32
|
-
name: 'core/edit-site/undo',
|
|
33
|
-
category: 'global',
|
|
34
|
-
description: (0, _i18n.__)('Undo your last changes.'),
|
|
35
|
-
keyCombination: {
|
|
36
|
-
modifier: 'primary',
|
|
37
|
-
character: 'z'
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
registerShortcut({
|
|
41
|
-
name: 'core/edit-site/redo',
|
|
42
|
-
category: 'global',
|
|
43
|
-
description: (0, _i18n.__)('Redo your last undo.'),
|
|
44
|
-
keyCombination: {
|
|
45
|
-
modifier: 'primaryShift',
|
|
46
|
-
character: 'z'
|
|
47
|
-
},
|
|
48
|
-
// Disable on Apple OS because it conflicts with the browser's
|
|
49
|
-
// history shortcut. It's a fine alias for both Windows and Linux.
|
|
50
|
-
// Since there's no conflict for Ctrl+Shift+Z on both Windows and
|
|
51
|
-
// Linux, we keep it as the default for consistency.
|
|
52
|
-
aliases: (0, _keycodes.isAppleOS)() ? [] : [{
|
|
53
|
-
modifier: 'primary',
|
|
54
|
-
character: 'y'
|
|
55
|
-
}]
|
|
56
|
-
});
|
|
57
|
-
registerShortcut({
|
|
58
|
-
name: 'core/edit-site/toggle-list-view',
|
|
59
|
-
category: 'global',
|
|
60
|
-
description: (0, _i18n.__)('Open the block list view.'),
|
|
61
|
-
keyCombination: {
|
|
62
|
-
modifier: 'access',
|
|
63
|
-
character: 'o'
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
30
|
registerShortcut({
|
|
67
31
|
name: 'core/edit-site/toggle-block-settings-sidebar',
|
|
68
32
|
category: 'global',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_element","require","_keyboardShortcuts","
|
|
1
|
+
{"version":3,"names":["_element","require","_keyboardShortcuts","_data","_i18n","KeyboardShortcutsRegister","registerShortcut","useDispatch","keyboardShortcutsStore","useEffect","name","category","description","__","keyCombination","modifier","character","aliases","forEach","level","_default","exports","default"],"sources":["@wordpress/edit-site/src/components/keyboard-shortcuts/register.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\n\nfunction KeyboardShortcutsRegister() {\n\t// Registering the shortcuts.\n\tconst { registerShortcut } = useDispatch( keyboardShortcutsStore );\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/save',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Save your changes.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primary',\n\t\t\t\tcharacter: 's',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/toggle-block-settings-sidebar',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Show or hide the Settings sidebar.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: ',',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/keyboard-shortcuts',\n\t\t\tcategory: 'main',\n\t\t\tdescription: __( 'Display these keyboard shortcuts.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: 'h',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/next-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the next part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrl',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'n',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/previous-region',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Navigate to the previous part of the editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\tcharacter: '`',\n\t\t\t},\n\t\t\taliases: [\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: 'p',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmodifier: 'ctrlShift',\n\t\t\t\t\tcharacter: '~',\n\t\t\t\t},\n\t\t\t],\n\t\t} );\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/toggle-mode',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Switch between visual editor and code editor.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'secondary',\n\t\t\t\tcharacter: 'm',\n\t\t\t},\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/transform-heading-to-paragraph',\n\t\t\tcategory: 'block-library',\n\t\t\tdescription: __( 'Transform heading to paragraph.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'access',\n\t\t\t\tcharacter: `0`,\n\t\t\t},\n\t\t} );\n\n\t\t[ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {\n\t\t\tregisterShortcut( {\n\t\t\t\tname: `core/edit-site/transform-paragraph-to-heading-${ level }`,\n\t\t\t\tcategory: 'block-library',\n\t\t\t\tdescription: __( 'Transform paragraph to heading.' ),\n\t\t\t\tkeyCombination: {\n\t\t\t\t\tmodifier: 'access',\n\t\t\t\t\tcharacter: `${ level }`,\n\t\t\t\t},\n\t\t\t} );\n\t\t} );\n\n\t\tregisterShortcut( {\n\t\t\tname: 'core/edit-site/toggle-distraction-free',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Toggle distraction free mode.' ),\n\t\t\tkeyCombination: {\n\t\t\t\tmodifier: 'primaryShift',\n\t\t\t\tcharacter: '\\\\',\n\t\t\t},\n\t\t} );\n\t}, [ registerShortcut ] );\n\n\treturn null;\n}\n\nexport default KeyboardShortcutsRegister;\n"],"mappings":";;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMA,SAASI,yBAAyBA,CAAA,EAAG;EACpC;EACA,MAAM;IAAEC;EAAiB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,wBAAuB,CAAC;EAClE,IAAAC,kBAAS,EAAE,MAAM;IAChBH,gBAAgB,CAAE;MACjBI,IAAI,EAAE,qBAAqB;MAC3BC,QAAQ,EAAE,QAAQ;MAClBC,WAAW,EAAE,IAAAC,QAAE,EAAE,oBAAqB,CAAC;MACvCC,cAAc,EAAE;QACfC,QAAQ,EAAE,SAAS;QACnBC,SAAS,EAAE;MACZ;IACD,CAAE,CAAC;IAEHV,gBAAgB,CAAE;MACjBI,IAAI,EAAE,8CAA8C;MACpDC,QAAQ,EAAE,QAAQ;MAClBC,WAAW,EAAE,IAAAC,QAAE,EAAE,oCAAqC,CAAC;MACvDC,cAAc,EAAE;QACfC,QAAQ,EAAE,cAAc;QACxBC,SAAS,EAAE;MACZ;IACD,CAAE,CAAC;IAEHV,gBAAgB,CAAE;MACjBI,IAAI,EAAE,mCAAmC;MACzCC,QAAQ,EAAE,MAAM;MAChBC,WAAW,EAAE,IAAAC,QAAE,EAAE,mCAAoC,CAAC;MACtDC,cAAc,EAAE;QACfC,QAAQ,EAAE,QAAQ;QAClBC,SAAS,EAAE;MACZ;IACD,CAAE,CAAC;IAEHV,gBAAgB,CAAE;MACjBI,IAAI,EAAE,4BAA4B;MAClCC,QAAQ,EAAE,QAAQ;MAClBC,WAAW,EAAE,IAAAC,QAAE,EAAE,0CAA2C,CAAC;MAC7D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cAAc,EAAE;UACfC,QAAQ,EAAE,QAAQ;UAClBC,SAAS,EAAG,GAAGG,KAAO;QACvB;MACD,CAAE,CAAC;IACJ,CAAE,CAAC;IAEHb,gBAAgB,CAAE;MACjBI,IAAI,EAAE,wCAAwC;MAC9CC,QAAQ,EAAE,QAAQ;MAClBC,WAAW,EAAE,IAAAC,QAAE,EAAE,+BAAgC,CAAC;MAClDC,cAAc,EAAE;QACfC,QAAQ,EAAE,cAAc;QACxBC,SAAS,EAAE;MACZ;IACD,CAAE,CAAC;EACJ,CAAC,EAAE,CAAEV,gBAAgB,CAAG,CAAC;EAEzB,OAAO,IAAI;AACZ;AAAC,IAAAc,QAAA,GAEcf,yBAAyB;AAAAgB,OAAA,CAAAC,OAAA,GAAAF,QAAA"}
|
|
@@ -94,8 +94,8 @@ function Layout() {
|
|
|
94
94
|
canvasMode: getCanvasMode(),
|
|
95
95
|
previousShortcut: getAllShortcutKeyCombinations('core/edit-site/previous-region'),
|
|
96
96
|
nextShortcut: getAllShortcutKeyCombinations('core/edit-site/next-region'),
|
|
97
|
-
hasFixedToolbar: select(_preferences.store).get('core
|
|
98
|
-
isDistractionFree: select(_preferences.store).get('core
|
|
97
|
+
hasFixedToolbar: select(_preferences.store).get('core', 'fixedToolbar'),
|
|
98
|
+
isDistractionFree: select(_preferences.store).get('core', 'distractionFree'),
|
|
99
99
|
hasBlockSelected: select(_blockEditor.store).getBlockSelectionStart()
|
|
100
100
|
};
|
|
101
101
|
}, []);
|
|
@@ -110,10 +110,8 @@ function Layout() {
|
|
|
110
110
|
const isFullCanvas = isMobileViewport && isListPage || isEditorPage && isEditing;
|
|
111
111
|
const [canvasResizer, canvasSize] = (0, _compose.useResizeObserver)();
|
|
112
112
|
const [fullResizer] = (0, _compose.useResizeObserver)();
|
|
113
|
-
const [isResizing] = (0, _element.useState)(false);
|
|
114
113
|
const isEditorLoading = (0, _hooks.useIsSiteEditorLoading)();
|
|
115
114
|
const [isResizableFrameOversized, setIsResizableFrameOversized] = (0, _element.useState)(false);
|
|
116
|
-
const [listViewToggleElement, setListViewToggleElement] = (0, _element.useState)(null);
|
|
117
115
|
|
|
118
116
|
// This determines which animation variant should apply to the header.
|
|
119
117
|
// There is also a `isDistractionFreeHovering` state that gets priority
|
|
@@ -233,9 +231,7 @@ function Layout() {
|
|
|
233
231
|
duration: disableMotion ? 0 : 0.2,
|
|
234
232
|
ease: 'easeOut'
|
|
235
233
|
}
|
|
236
|
-
}, (0, _react.createElement)(_headerEditMode.default, {
|
|
237
|
-
setListViewToggleElement: setListViewToggleElement
|
|
238
|
-
})))), (0, _react.createElement)("div", {
|
|
234
|
+
}, (0, _react.createElement)(_headerEditMode.default, null)))), (0, _react.createElement)("div", {
|
|
239
235
|
className: "edit-site-layout__content"
|
|
240
236
|
}, (0, _react.createElement)(_interface.NavigableRegion, {
|
|
241
237
|
ariaLabel: (0, _i18n.__)('Navigation'),
|
|
@@ -259,14 +255,12 @@ function Layout() {
|
|
|
259
255
|
},
|
|
260
256
|
className: "edit-site-layout__sidebar"
|
|
261
257
|
}, (0, _react.createElement)(_sidebar.default, null)))), (0, _react.createElement)(_savePanel.default, null), showCanvas && (0, _react.createElement)(_react.Fragment, null, isListPage && (0, _react.createElement)(_pageMain.default, null), isEditorPage && (0, _react.createElement)("div", {
|
|
262
|
-
className:
|
|
263
|
-
'is-resizing': isResizing
|
|
264
|
-
})
|
|
258
|
+
className: "edit-site-layout__canvas-container"
|
|
265
259
|
}, canvasResizer, !!canvasSize.width && (0, _react.createElement)(_components.__unstableMotion.div, {
|
|
266
260
|
whileHover: isEditorPage && canvasMode === 'view' ? {
|
|
267
261
|
scale: 1.005,
|
|
268
262
|
transition: {
|
|
269
|
-
duration: disableMotion
|
|
263
|
+
duration: disableMotion ? 0 : 0.5,
|
|
270
264
|
ease: 'easeOut'
|
|
271
265
|
}
|
|
272
266
|
} : {},
|
|
@@ -277,7 +271,7 @@ function Layout() {
|
|
|
277
271
|
}),
|
|
278
272
|
transition: {
|
|
279
273
|
type: 'tween',
|
|
280
|
-
duration: disableMotion
|
|
274
|
+
duration: disableMotion ? 0 : ANIMATION_DURATION,
|
|
281
275
|
ease: 'easeOut'
|
|
282
276
|
}
|
|
283
277
|
}, (0, _react.createElement)(_errorBoundary.default, null, (0, _react.createElement)(_resizableFrame.default, {
|
|
@@ -293,7 +287,6 @@ function Layout() {
|
|
|
293
287
|
background: gradientValue !== null && gradientValue !== void 0 ? gradientValue : backgroundColor
|
|
294
288
|
}
|
|
295
289
|
}, (0, _react.createElement)(_editor.default, {
|
|
296
|
-
listViewToggleElement: listViewToggleElement,
|
|
297
290
|
isLoading: isEditorLoading
|
|
298
291
|
})))))))));
|
|
299
292
|
}
|