@wordpress/edit-site 5.33.0 → 5.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/add-new-page/index.js +3 -0
- package/build/components/add-new-page/index.js.map +1 -1
- package/build/components/add-new-pattern/index.js +8 -7
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js +3 -0
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/add-custom-template-modal-content.js +3 -1
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build/components/block-editor/resize-handle.js +20 -5
- package/build/components/block-editor/resize-handle.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +3 -0
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/editor/index.js +28 -5
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +9 -3
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +7 -2
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +22 -20
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
- package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +8 -2
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/header-edit-mode/index.js +33 -49
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/index.js +3 -97
- package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/register.js +0 -49
- package/build/components/keyboard-shortcuts/register.js.map +1 -1
- package/build/components/layout/index.js +7 -4
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/router.js +9 -38
- package/build/components/layout/router.js.map +1 -1
- package/build/components/page-pages/index.js +4 -3
- package/build/components/page-pages/index.js.map +1 -1
- package/build/components/page-patterns/dataviews-pattern-actions.js +11 -7
- package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
- package/build/components/page-patterns/header.js +3 -1
- package/build/components/page-patterns/header.js.map +1 -1
- package/build/components/page-patterns/index.js +20 -49
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +1 -0
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-templates/hooks.js.map +1 -0
- package/build/components/{page-templates-template-parts → page-templates}/index.js +67 -80
- package/build/components/page-templates/index.js.map +1 -0
- package/build/components/pattern-modal/duplicate.js +7 -5
- package/build/components/pattern-modal/duplicate.js.map +1 -1
- package/build/components/plugin-template-setting-panel/index.js +9 -0
- package/build/components/plugin-template-setting-panel/index.js.map +1 -1
- package/build/components/resizable-frame/index.js +9 -6
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +3 -2
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/index.js +40 -9
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js +24 -17
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/index.js +2 -5
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/index.js +39 -8
- package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/index.js +6 -13
- package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/category-item.js +3 -2
- package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +34 -28
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/index.js +1 -1
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
- package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +5 -35
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +0 -8
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/template-actions/index.js +1 -1
- package/build/components/template-actions/index.js.map +1 -1
- package/build/deprecated.js +55 -0
- package/build/deprecated.js.map +1 -0
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +35 -4
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build/index.js +18 -18
- package/build/index.js.map +1 -1
- package/build/utils/constants.js +1 -2
- package/build/utils/constants.js.map +1 -1
- package/build-module/components/add-new-page/index.js +3 -0
- package/build-module/components/add-new-page/index.js.map +1 -1
- package/build-module/components/add-new-pattern/index.js +8 -7
- package/build-module/components/add-new-pattern/index.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +3 -0
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js +3 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build-module/components/block-editor/resize-handle.js +21 -6
- package/build-module/components/block-editor/resize-handle.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +3 -0
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/editor/index.js +28 -5
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +9 -3
- 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 +7 -2
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +22 -20
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
- package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +8 -2
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +39 -55
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +5 -99
- package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/register.js +0 -49
- package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
- package/build-module/components/layout/index.js +7 -4
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/router.js +9 -38
- package/build-module/components/layout/router.js.map +1 -1
- package/build-module/components/page-pages/index.js +5 -4
- package/build-module/components/page-pages/index.js.map +1 -1
- package/build-module/components/page-patterns/dataviews-pattern-actions.js +11 -7
- package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
- package/build-module/components/page-patterns/header.js +3 -1
- package/build-module/components/page-patterns/header.js.map +1 -1
- package/build-module/components/page-patterns/index.js +22 -51
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +1 -0
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-templates/hooks.js.map +1 -0
- package/build-module/components/{page-templates-template-parts → page-templates}/index.js +67 -80
- package/build-module/components/page-templates/index.js.map +1 -0
- package/build-module/components/pattern-modal/duplicate.js +7 -5
- package/build-module/components/pattern-modal/duplicate.js.map +1 -1
- package/build-module/components/plugin-template-setting-panel/index.js +8 -0
- package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
- package/build-module/components/resizable-frame/index.js +9 -6
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +4 -3
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/index.js +43 -12
- package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +25 -17
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/index.js +3 -6
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/index.js +40 -9
- package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/index.js +6 -13
- package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +3 -2
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +35 -29
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +5 -35
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +0 -8
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/template-actions/index.js +1 -1
- package/build-module/components/template-actions/index.js.map +1 -1
- package/build-module/deprecated.js +45 -0
- package/build-module/deprecated.js.map +1 -0
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +34 -4
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build-module/index.js +2 -4
- package/build-module/index.js.map +1 -1
- package/build-module/utils/constants.js +0 -1
- package/build-module/utils/constants.js.map +1 -1
- package/build-style/style-rtl.css +79 -125
- package/build-style/style.css +79 -125
- package/package.json +42 -42
- package/src/components/add-new-page/index.js +7 -1
- package/src/components/add-new-pattern/index.js +15 -12
- package/src/components/add-new-template/add-custom-generic-template-modal-content.js +3 -0
- package/src/components/add-new-template/add-custom-template-modal-content.js +3 -1
- package/src/components/block-editor/resize-handle.js +30 -11
- package/src/components/block-editor/style.scss +10 -15
- package/src/components/create-template-part-modal/index.js +3 -0
- package/src/components/editor/index.js +42 -3
- package/src/components/editor/style.scss +6 -1
- package/src/components/global-styles/font-library-modal/context.js +9 -3
- package/src/components/global-styles/font-library-modal/font-collection.js +31 -12
- package/src/components/global-styles/font-library-modal/installed-fonts.js +82 -54
- package/src/components/global-styles/font-library-modal/style.scss +17 -0
- package/src/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
- package/src/components/global-styles/style-variations-container.js +11 -2
- package/src/components/header-edit-mode/index.js +56 -76
- package/src/components/header-edit-mode/more-menu/index.js +8 -145
- package/src/components/header-edit-mode/style.scss +13 -85
- package/src/components/keyboard-shortcuts/register.js +0 -58
- package/src/components/layout/index.js +11 -2
- package/src/components/layout/router.js +9 -49
- package/src/components/page-pages/index.js +14 -4
- package/src/components/page-pages/style.scss +11 -0
- package/src/components/page-patterns/dataviews-pattern-actions.js +8 -9
- package/src/components/page-patterns/header.js +3 -1
- package/src/components/page-patterns/index.js +17 -76
- package/src/components/page-patterns/style.scss +14 -1
- package/src/components/page-patterns/use-patterns.js +1 -0
- package/src/components/{page-templates-template-parts → page-templates}/index.js +23 -46
- package/src/components/{page-templates-template-parts → page-templates}/style.scss +2 -2
- package/src/components/pattern-modal/duplicate.js +4 -3
- package/src/components/plugin-template-setting-panel/index.js +8 -0
- package/src/components/resizable-frame/index.js +4 -3
- package/src/components/sidebar-edit-mode/index.js +13 -2
- package/src/components/sidebar-edit-mode/page-panels/index.js +49 -21
- package/src/components/sidebar-edit-mode/page-panels/page-summary.js +31 -19
- package/src/components/sidebar-edit-mode/template-panel/index.js +2 -12
- package/src/components/sidebar-navigation-screen-page/index.js +48 -9
- package/src/components/sidebar-navigation-screen-pattern/index.js +6 -11
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -1
- package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
- package/src/components/sidebar-navigation-screen-patterns/category-item.js +2 -1
- package/src/components/sidebar-navigation-screen-patterns/index.js +30 -38
- package/src/components/sidebar-navigation-screen-template/index.js +1 -1
- package/src/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +7 -39
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +0 -4
- package/src/components/template-actions/index.js +1 -1
- package/src/deprecated.js +42 -0
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +69 -16
- package/src/index.js +2 -9
- package/src/style.scss +1 -5
- package/src/utils/constants.js +1 -1
- package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js +0 -59
- package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +0 -1
- package/build/components/header-edit-mode/tools-more-menu-group/index.js +0 -23
- package/build/components/header-edit-mode/tools-more-menu-group/index.js.map +0 -1
- package/build/components/keyboard-shortcuts/edit-mode.js +0 -56
- package/build/components/keyboard-shortcuts/edit-mode.js.map +0 -1
- package/build/components/page-templates-template-parts/add-new-template-part.js +0 -65
- package/build/components/page-templates-template-parts/add-new-template-part.js.map +0 -1
- package/build/components/page-templates-template-parts/hooks.js.map +0 -1
- package/build/components/page-templates-template-parts/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/page-panels/page-status.js +0 -188
- package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +0 -1
- package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js +0 -52
- package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +0 -1
- package/build-module/components/header-edit-mode/tools-more-menu-group/index.js +0 -16
- package/build-module/components/header-edit-mode/tools-more-menu-group/index.js.map +0 -1
- package/build-module/components/keyboard-shortcuts/edit-mode.js +0 -49
- package/build-module/components/keyboard-shortcuts/edit-mode.js.map +0 -1
- package/build-module/components/page-templates-template-parts/add-new-template-part.js +0 -57
- package/build-module/components/page-templates-template-parts/add-new-template-part.js.map +0 -1
- package/build-module/components/page-templates-template-parts/hooks.js.map +0 -1
- package/build-module/components/page-templates-template-parts/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +0 -180
- package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +0 -1
- package/src/components/header-edit-mode/more-menu/copy-content-menu-item.js +0 -51
- package/src/components/header-edit-mode/tools-more-menu-group/index.js +0 -16
- package/src/components/keyboard-shortcuts/edit-mode.js +0 -59
- package/src/components/page-templates-template-parts/add-new-template-part.js +0 -62
- package/src/components/sidebar-edit-mode/page-panels/page-status.js +0 -249
- package/src/components/sidebar-edit-mode/page-panels/style.scss +0 -34
- /package/build/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
- /package/build-module/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
- /package/src/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["store","coreStore","useSelect","useMemo","__experimentalGrid","Grid","__","PreviewStyles","Variation","StyleVariationsContainer","gap","variations","select","__experimentalGetCurrentThemeGlobalStylesVariations","withEmptyVariation","title","settings","styles","map","
|
|
1
|
+
{"version":3,"names":["store","coreStore","useSelect","useMemo","__experimentalGrid","Grid","__","PreviewStyles","Variation","isVariationWithSingleProperty","StyleVariationsContainer","gap","variations","select","__experimentalGetCurrentThemeGlobalStylesVariations","multiplePropertyVariations","filter","variation","withEmptyVariation","title","settings","styles","map","_variation$settings","_variation$styles","createElement","columns","className","index","key","isFocused","label","withHoverView"],"sources":["@wordpress/edit-site/src/components/global-styles/style-variations-container.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { __experimentalGrid as Grid } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport PreviewStyles from './preview-styles';\nimport Variation from './variations/variation';\nimport { isVariationWithSingleProperty } from '../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';\n\nexport default function StyleVariationsContainer( { gap = 2 } ) {\n\tconst variations = useSelect( ( select ) => {\n\t\treturn select(\n\t\t\tcoreStore\n\t\t).__experimentalGetCurrentThemeGlobalStylesVariations();\n\t}, [] );\n\n\t// Filter out variations that are of single property type, i.e. color or typography variations.\n\tconst multiplePropertyVariations = variations?.filter( ( variation ) => {\n\t\treturn (\n\t\t\t! isVariationWithSingleProperty( variation, 'color' ) &&\n\t\t\t! isVariationWithSingleProperty( variation, 'typography' )\n\t\t);\n\t} );\n\n\tconst withEmptyVariation = useMemo( () => {\n\t\treturn [\n\t\t\t{\n\t\t\t\ttitle: __( 'Default' ),\n\t\t\t\tsettings: {},\n\t\t\t\tstyles: {},\n\t\t\t},\n\t\t\t...( multiplePropertyVariations ?? [] ).map( ( variation ) => ( {\n\t\t\t\t...variation,\n\t\t\t\tsettings: variation.settings ?? {},\n\t\t\t\tstyles: variation.styles ?? {},\n\t\t\t} ) ),\n\t\t];\n\t}, [ multiplePropertyVariations ] );\n\n\treturn (\n\t\t<Grid\n\t\t\tcolumns={ 2 }\n\t\t\tclassName=\"edit-site-global-styles-style-variations-container\"\n\t\t\tgap={ gap }\n\t\t>\n\t\t\t{ withEmptyVariation.map( ( variation, index ) => (\n\t\t\t\t<Variation key={ index } variation={ variation }>\n\t\t\t\t\t{ ( isFocused ) => (\n\t\t\t\t\t\t<PreviewStyles\n\t\t\t\t\t\t\tlabel={ variation?.title }\n\t\t\t\t\t\t\twithHoverView\n\t\t\t\t\t\t\tisFocused={ isFocused }\n\t\t\t\t\t\t\tvariation={ variation }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</Variation>\n\t\t\t) ) }\n\t\t</Grid>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,kBAAkB,IAAIC,IAAI,QAAQ,uBAAuB;AAClE,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,OAAOC,SAAS,MAAM,wBAAwB;AAC9C,SAASC,6BAA6B,QAAQ,+EAA+E;AAE7H,eAAe,SAASC,wBAAwBA,CAAE;EAAEC,GAAG,GAAG;AAAE,CAAC,EAAG;EAC/D,MAAMC,UAAU,GAAGV,SAAS,CAAIW,MAAM,IAAM;IAC3C,OAAOA,MAAM,CACZZ,SACD,CAAC,CAACa,mDAAmD,CAAC,CAAC;EACxD,CAAC,EAAE,EAAG,CAAC;;EAEP;EACA,MAAMC,0BAA0B,GAAGH,UAAU,EAAEI,MAAM,CAAIC,SAAS,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
|
-
import { createElement
|
|
1
|
+
import { createElement } from "react";
|
|
2
2
|
/**
|
|
3
3
|
* External dependencies
|
|
4
4
|
*/
|
|
@@ -8,47 +8,48 @@ import classnames from 'classnames';
|
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
10
|
import { useViewportMatch, useReducedMotion } from '@wordpress/compose';
|
|
11
|
-
import {
|
|
11
|
+
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
12
12
|
import { useSelect } from '@wordpress/data';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { next, previous } from '@wordpress/icons';
|
|
16
|
-
import { Button, __unstableMotion as motion, Popover } from '@wordpress/components';
|
|
13
|
+
import { useState } from '@wordpress/element';
|
|
14
|
+
import { __unstableMotion as motion } from '@wordpress/components';
|
|
17
15
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
18
|
-
import { DocumentBar, store as editorStore, privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
16
|
+
import { DocumentBar, PostSavedState, store as editorStore, privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
19
17
|
|
|
20
18
|
/**
|
|
21
19
|
* Internal dependencies
|
|
22
20
|
*/
|
|
23
|
-
import
|
|
21
|
+
import SiteEditorMoreMenuItems from './more-menu';
|
|
24
22
|
import SaveButton from '../save-button';
|
|
25
23
|
import DocumentTools from './document-tools';
|
|
26
24
|
import { store as editSiteStore } from '../../store';
|
|
27
25
|
import { getEditorCanvasContainerTitle, useHasEditorCanvasContainer } from '../editor-canvas-container';
|
|
28
26
|
import { unlock } from '../../lock-unlock';
|
|
29
27
|
import { FOCUSABLE_ENTITIES } from '../../utils/constants';
|
|
28
|
+
import { isPreviewingTheme } from '../../utils/is-previewing-theme';
|
|
30
29
|
const {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const {
|
|
30
|
+
CollapsableBlockToolbar,
|
|
31
|
+
MoreMenu,
|
|
34
32
|
PostViewLink,
|
|
35
33
|
PreviewDropdown,
|
|
36
|
-
PinnedItems
|
|
34
|
+
PinnedItems,
|
|
35
|
+
PostPublishButtonOrToggle
|
|
37
36
|
} = unlock(editorPrivateApis);
|
|
38
|
-
export default function HeaderEditMode(
|
|
37
|
+
export default function HeaderEditMode({
|
|
38
|
+
setEntitiesSavedStatesCallback
|
|
39
|
+
}) {
|
|
39
40
|
const {
|
|
40
41
|
templateType,
|
|
41
42
|
isDistractionFree,
|
|
42
43
|
blockEditorMode,
|
|
43
|
-
blockSelectionStart,
|
|
44
44
|
showIconLabels,
|
|
45
|
-
editorCanvasView
|
|
45
|
+
editorCanvasView,
|
|
46
|
+
isFixedToolbar,
|
|
47
|
+
isPublishSidebarOpened
|
|
46
48
|
} = useSelect(select => {
|
|
47
49
|
const {
|
|
48
50
|
getEditedPostType
|
|
49
51
|
} = select(editSiteStore);
|
|
50
52
|
const {
|
|
51
|
-
getBlockSelectionStart,
|
|
52
53
|
__unstableGetEditorMode
|
|
53
54
|
} = select(blockEditorStore);
|
|
54
55
|
const {
|
|
@@ -61,29 +62,20 @@ export default function HeaderEditMode() {
|
|
|
61
62
|
deviceType: getDeviceType(),
|
|
62
63
|
templateType: getEditedPostType(),
|
|
63
64
|
blockEditorMode: __unstableGetEditorMode(),
|
|
64
|
-
blockSelectionStart: getBlockSelectionStart(),
|
|
65
65
|
showIconLabels: getPreference('core', 'showIconLabels'),
|
|
66
66
|
editorCanvasView: unlock(select(editSiteStore)).getEditorCanvasContainerView(),
|
|
67
|
-
isDistractionFree: getPreference('core', 'distractionFree')
|
|
67
|
+
isDistractionFree: getPreference('core', 'distractionFree'),
|
|
68
|
+
isFixedToolbar: getPreference('core', 'fixedToolbar'),
|
|
69
|
+
isPublishSidebarOpened: select(editorStore).isPublishSidebarOpened()
|
|
68
70
|
};
|
|
69
71
|
}, []);
|
|
70
72
|
const isLargeViewport = useViewportMatch('medium');
|
|
71
|
-
const
|
|
72
|
-
showFixedToolbar
|
|
73
|
-
} = useShowBlockTools();
|
|
74
|
-
const showTopToolbar = isLargeViewport && showFixedToolbar;
|
|
75
|
-
const blockToolbarRef = useRef();
|
|
73
|
+
const showTopToolbar = isLargeViewport && isFixedToolbar && blockEditorMode !== 'zoom-out';
|
|
76
74
|
const disableMotion = useReducedMotion();
|
|
77
75
|
const hasDefaultEditorCanvasView = !useHasEditorCanvasContainer();
|
|
78
76
|
const isFocusMode = FOCUSABLE_ENTITIES.includes(templateType);
|
|
79
77
|
const isZoomedOutView = blockEditorMode === 'zoom-out';
|
|
80
78
|
const [isBlockToolsCollapsed, setIsBlockToolsCollapsed] = useState(true);
|
|
81
|
-
useEffect(() => {
|
|
82
|
-
// If we have a new block selection, show the block tools
|
|
83
|
-
if (blockSelectionStart) {
|
|
84
|
-
setIsBlockToolsCollapsed(false);
|
|
85
|
-
}
|
|
86
|
-
}, [blockSelectionStart]);
|
|
87
79
|
const toolbarVariants = {
|
|
88
80
|
isDistractionFree: {
|
|
89
81
|
y: '-50px'
|
|
@@ -103,9 +95,11 @@ export default function HeaderEditMode() {
|
|
|
103
95
|
duration: disableMotion ? 0 : 0.2,
|
|
104
96
|
ease: 'easeOut'
|
|
105
97
|
};
|
|
98
|
+
const _isPreviewingTheme = isPreviewingTheme();
|
|
106
99
|
return createElement("div", {
|
|
107
100
|
className: classnames('edit-site-header-edit-mode', {
|
|
108
|
-
'show-icon-labels': showIconLabels
|
|
101
|
+
'show-icon-labels': showIconLabels,
|
|
102
|
+
'show-block-toolbar': !isBlockToolsCollapsed && showTopToolbar
|
|
109
103
|
})
|
|
110
104
|
}, hasDefaultEditorCanvasView && createElement(motion.div, {
|
|
111
105
|
className: "edit-site-header-edit-mode__start",
|
|
@@ -114,27 +108,11 @@ export default function HeaderEditMode() {
|
|
|
114
108
|
}, createElement(DocumentTools, {
|
|
115
109
|
blockEditorMode: blockEditorMode,
|
|
116
110
|
isDistractionFree: isDistractionFree
|
|
117
|
-
}), showTopToolbar && createElement(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
hideDragHandle: true
|
|
123
|
-
})), createElement(Popover.Slot, {
|
|
124
|
-
ref: blockToolbarRef,
|
|
125
|
-
name: "block-toolbar"
|
|
126
|
-
}), createElement(Button, {
|
|
127
|
-
className: "edit-site-header-edit-mode__block-tools-toggle",
|
|
128
|
-
icon: isBlockToolsCollapsed ? next : previous,
|
|
129
|
-
onClick: () => {
|
|
130
|
-
setIsBlockToolsCollapsed(collapsed => !collapsed);
|
|
131
|
-
},
|
|
132
|
-
label: isBlockToolsCollapsed ? __('Show block tools') : __('Hide block tools'),
|
|
133
|
-
size: "compact"
|
|
134
|
-
}))), !isDistractionFree && createElement("div", {
|
|
135
|
-
className: classnames('edit-site-header-edit-mode__center', {
|
|
136
|
-
'is-collapsed': !isBlockToolsCollapsed && showTopToolbar
|
|
137
|
-
})
|
|
111
|
+
}), showTopToolbar && createElement(CollapsableBlockToolbar, {
|
|
112
|
+
isCollapsed: isBlockToolsCollapsed,
|
|
113
|
+
onToggle: setIsBlockToolsCollapsed
|
|
114
|
+
})), !isDistractionFree && createElement("div", {
|
|
115
|
+
className: "edit-site-header-edit-mode__center"
|
|
138
116
|
}, !hasDefaultEditorCanvasView ? getEditorCanvasContainerTitle(editorCanvasView) : createElement(DocumentBar, null)), createElement("div", {
|
|
139
117
|
className: "edit-site-header-edit-mode__end"
|
|
140
118
|
}, createElement(motion.div, {
|
|
@@ -147,12 +125,18 @@ export default function HeaderEditMode() {
|
|
|
147
125
|
})
|
|
148
126
|
}, createElement(PreviewDropdown, {
|
|
149
127
|
disabled: isFocusMode || !hasDefaultEditorCanvasView
|
|
150
|
-
})), createElement(PostViewLink, null),
|
|
128
|
+
})), createElement(PostViewLink, null), !_isPreviewingTheme && !isPublishSidebarOpened &&
|
|
129
|
+
// This button isn't completely hidden by the publish sidebar.
|
|
130
|
+
// We can't hide the whole toolbar when the publish sidebar is open because
|
|
131
|
+
// we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.
|
|
132
|
+
// We track that DOM node to return focus to the PostPublishButtonOrToggle
|
|
133
|
+
// when the publish sidebar has been closed.
|
|
134
|
+
createElement(PostSavedState, null), !_isPreviewingTheme && createElement(PostPublishButtonOrToggle, {
|
|
135
|
+
setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback
|
|
136
|
+
}), _isPreviewingTheme && createElement(SaveButton, {
|
|
151
137
|
size: "compact"
|
|
152
138
|
}), !isDistractionFree && createElement(PinnedItems.Slot, {
|
|
153
139
|
scope: "core"
|
|
154
|
-
}), createElement(MoreMenu,
|
|
155
|
-
showIconLabels: showIconLabels
|
|
156
|
-
}))));
|
|
140
|
+
}), createElement(MoreMenu, null), createElement(SiteEditorMoreMenuItems, null))));
|
|
157
141
|
}
|
|
158
142
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["classnames","useViewportMatch","useReducedMotion","BlockToolbar","privateApis","blockEditorPrivateApis","store","blockEditorStore","useSelect","useEffect","useRef","useState","__","next","previous","Button","__unstableMotion","motion","Popover","preferencesStore","DocumentBar","editorStore","editorPrivateApis","MoreMenu","SaveButton","DocumentTools","editSiteStore","getEditorCanvasContainerTitle","useHasEditorCanvasContainer","unlock","FOCUSABLE_ENTITIES","useShowBlockTools","PostViewLink","PreviewDropdown","PinnedItems","HeaderEditMode","templateType","isDistractionFree","blockEditorMode","blockSelectionStart","showIconLabels","editorCanvasView","select","getEditedPostType","getBlockSelectionStart","__unstableGetEditorMode","get","getPreference","getDeviceType","deviceType","getEditorCanvasContainerView","isLargeViewport","showFixedToolbar","showTopToolbar","blockToolbarRef","disableMotion","hasDefaultEditorCanvasView","isFocusMode","includes","isZoomedOutView","isBlockToolsCollapsed","setIsBlockToolsCollapsed","toolbarVariants","y","isDistractionFreeHovering","view","edit","toolbarTransition","type","duration","ease","createElement","className","div","variants","transition","Fragment","hideDragHandle","Slot","ref","name","icon","onClick","collapsed","label","size","disabled","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\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useEffect, useRef, useState } from '@wordpress/element';\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 { useShowBlockTools } = unlock( blockEditorPrivateApis );\nconst { PostViewLink, PreviewDropdown, PinnedItems } =\n\tunlock( 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} = 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\tisDistractionFree: getPreference( 'core', 'distractionFree' ),\n\t\t};\n\t}, [] );\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst { showFixedToolbar } = useShowBlockTools();\n\tconst showTopToolbar = isLargeViewport && showFixedToolbar;\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\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{ showTopToolbar && (\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<Button\n\t\t\t\t\t\t\t\tclassName=\"edit-site-header-edit-mode__block-tools-toggle\"\n\t\t\t\t\t\t\t\ticon={ isBlockToolsCollapsed ? next : previous }\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tsetIsBlockToolsCollapsed(\n\t\t\t\t\t\t\t\t\t\t( collapsed ) => ! collapsed\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\tlabel={\n\t\t\t\t\t\t\t\t\tisBlockToolsCollapsed\n\t\t\t\t\t\t\t\t\t\t? __( 'Show block tools' )\n\t\t\t\t\t\t\t\t\t\t: __( 'Hide block tools' )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsize=\"compact\"\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 && showTopToolbar,\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 size=\"compact\" />\n\t\t\t\t\t{ ! isDistractionFree && <PinnedItems.Slot scope=\"core\" /> }\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":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,gBAAgB,EAAEC,gBAAgB,QAAQ,oBAAoB;AACvE,SACCC,YAAY,EACZC,WAAW,IAA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SACpB,CAAC;IACF,CAAG;IACHC,KAAK,EACJxB,qBAAqB,GAClBhD,EAAE,CAAE,kBAAmB,CAAC,GACxBA,EAAE,CAAE,kBAAmB,CAC1B;IACDyE,IAAI,EAAC;EAAS,CACd,CACA,CAEQ,CACZ,EAEC,CAAEhD,iBAAiB,IACpBkC,aAAA;IACCC,SAAS,EAAGxE,UAAU,CACrB,oCAAoC,EACpC;MACC,cAAc,EACb,CAAE4D,qBAAqB,IAAIP;IAC7B,CACD;EAAG,GAED,CAAEG,0BAA0B,GAC7B7B,6BAA6B,CAAEc,gBAAiB,CAAC,GAEjD8B,aAAA,CAACnD,WAAW,MAAE,CAEX,CACL,EAEDmD,aAAA;IAAKC,SAAS,EAAC;EAAiC,GAC/CD,aAAA,CAACtD,MAAM,CAACwD,GAAG;IACVD,SAAS,EAAC,qCAAqC;IAC/CE,QAAQ,EAAGZ,eAAiB;IAC5Ba,UAAU,EAAGR;EAAmB,GAE9BhB,eAAe,IAChBoB,aAAA;IACCC,SAAS,EAAGxE,UAAU,CACrB,6CAA6C,EAC7C;MAAE,eAAe,EAAE2D;IAAgB,CACpC;EAAG,GAEHY,aAAA,CAACtC,eAAe;IACfqD,QAAQ,EACP7B,WAAW,IAAI,CAAED;EACjB,CACD,CACG,CACL,EACDe,aAAA,CAACvC,YAAY,MAAE,CAAC,EAChBuC,aAAA,CAAC/C,UAAU;IAAC6D,IAAI,EAAC;EAAS,CAAE,CAAC,EAC3B,CAAEhD,iBAAiB,IAAIkC,aAAA,CAACrC,WAAW,CAAC4C,IAAI;IAACS,KAAK,EAAC;EAAM,CAAE,CAAC,EAC1DhB,aAAA,CAAChD,QAAQ;IAACiB,cAAc,EAAGA;EAAgB,CAAE,CAClC,CACR,CACD,CAAC;AAER","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["classnames","useViewportMatch","useReducedMotion","store","blockEditorStore","useSelect","useState","__unstableMotion","motion","preferencesStore","DocumentBar","PostSavedState","editorStore","privateApis","editorPrivateApis","SiteEditorMoreMenuItems","SaveButton","DocumentTools","editSiteStore","getEditorCanvasContainerTitle","useHasEditorCanvasContainer","unlock","FOCUSABLE_ENTITIES","isPreviewingTheme","CollapsableBlockToolbar","MoreMenu","PostViewLink","PreviewDropdown","PinnedItems","PostPublishButtonOrToggle","HeaderEditMode","setEntitiesSavedStatesCallback","templateType","isDistractionFree","blockEditorMode","showIconLabels","editorCanvasView","isFixedToolbar","isPublishSidebarOpened","select","getEditedPostType","__unstableGetEditorMode","get","getPreference","getDeviceType","deviceType","getEditorCanvasContainerView","isLargeViewport","showTopToolbar","disableMotion","hasDefaultEditorCanvasView","isFocusMode","includes","isZoomedOutView","isBlockToolsCollapsed","setIsBlockToolsCollapsed","toolbarVariants","y","isDistractionFreeHovering","view","edit","toolbarTransition","type","duration","ease","_isPreviewingTheme","createElement","className","div","variants","transition","isCollapsed","onToggle","disabled","size","Slot","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 { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __unstableMotion as motion } from '@wordpress/components';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tDocumentBar,\n\tPostSavedState,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport SiteEditorMoreMenuItems 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';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nconst {\n\tCollapsableBlockToolbar,\n\tMoreMenu,\n\tPostViewLink,\n\tPreviewDropdown,\n\tPinnedItems,\n\tPostPublishButtonOrToggle,\n} = unlock( editorPrivateApis );\n\nexport default function HeaderEditMode( { setEntitiesSavedStatesCallback } ) {\n\tconst {\n\t\ttemplateType,\n\t\tisDistractionFree,\n\t\tblockEditorMode,\n\t\tshowIconLabels,\n\t\teditorCanvasView,\n\t\tisFixedToolbar,\n\t\tisPublishSidebarOpened,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditedPostType } = select( editSiteStore );\n\t\tconst { __unstableGetEditorMode } = select( 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\tshowIconLabels: getPreference( 'core', 'showIconLabels' ),\n\t\t\teditorCanvasView: unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t).getEditorCanvasContainerView(),\n\t\t\tisDistractionFree: getPreference( 'core', 'distractionFree' ),\n\t\t\tisFixedToolbar: getPreference( 'core', 'fixedToolbar' ),\n\t\t\tisPublishSidebarOpened:\n\t\t\t\tselect( editorStore ).isPublishSidebarOpened(),\n\t\t};\n\t}, [] );\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst showTopToolbar =\n\t\tisLargeViewport && isFixedToolbar && blockEditorMode !== 'zoom-out';\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 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\tconst _isPreviewingTheme = isPreviewingTheme();\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\t'show-block-toolbar': ! isBlockToolsCollapsed && showTopToolbar,\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{ showTopToolbar && (\n\t\t\t\t\t\t<CollapsableBlockToolbar\n\t\t\t\t\t\t\tisCollapsed={ isBlockToolsCollapsed }\n\t\t\t\t\t\t\tonToggle={ setIsBlockToolsCollapsed }\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 className=\"edit-site-header-edit-mode__center\">\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{\n\t\t\t\t\t\t// TODO: For now we conditionally render the Save/Publish buttons based on\n\t\t\t\t\t\t// some specific site editor extra handling. Examples are when we're previewing\n\t\t\t\t\t\t// a theme, handling of global styles changes or when we're in 'view' mode,\n\t\t\t\t\t\t// which opens the save panel in a Modal.\n\t\t\t\t\t }\n\t\t\t\t\t{ ! _isPreviewingTheme && ! isPublishSidebarOpened && (\n\t\t\t\t\t\t// This button isn't completely hidden by the publish sidebar.\n\t\t\t\t\t\t// We can't hide the whole toolbar when the publish sidebar is open because\n\t\t\t\t\t\t// we want to prevent mounting/unmounting the PostPublishButtonOrToggle DOM node.\n\t\t\t\t\t\t// We track that DOM node to return focus to the PostPublishButtonOrToggle\n\t\t\t\t\t\t// when the publish sidebar has been closed.\n\t\t\t\t\t\t<PostSavedState />\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! _isPreviewingTheme && (\n\t\t\t\t\t\t<PostPublishButtonOrToggle\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\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\t{ _isPreviewingTheme && <SaveButton size=\"compact\" /> }\n\t\t\t\t\t{ ! isDistract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,GAAG;IACVD,SAAS,EAAC,qCAAqC;IAC/CE,QAAQ,EAAGb,eAAiB;IAC5Bc,UAAU,EAAGT;EAAmB,GAE9Bd,eAAe,IAChBmB,aAAA;IACCC,SAAS,EAAGnE,UAAU,CACrB,6CAA6C,EAC7C;MAAE,eAAe,EAAEqD;IAAgB,CACpC;EAAG,GAEHa,aAAA,CAACvC,eAAe;IACf8C,QAAQ,EACPtB,WAAW,IAAI,CAAED;EACjB,CACD,CACG,CACL,EACDgB,aAAA,CAACxC,YAAY,MAAE,CAAC,EAOd,CAAEuC,kBAAkB,IAAI,CAAE3B,sBAAsB;EACjD;EACA;EACA;EACA;EACA;EACA4B,aAAA,CAACvD,cAAc,MAAE,CACjB,EACC,CAAEsD,kBAAkB,IACrBC,aAAA,CAACrC,yBAAyB;IACzBE,8BAA8B,EAC7BA;EACA,CACD,CACD,EACCkC,kBAAkB,IAAIC,aAAA,CAAClD,UAAU;IAAC0D,IAAI,EAAC;EAAS,CAAE,CAAC,EACnD,CAAEzC,iBAAiB,IAAIiC,aAAA,CAACtC,WAAW,CAAC+C,IAAI;IAACC,KAAK,EAAC;EAAM,CAAE,CAAC,EAC1DV,aAAA,CAACzC,QAAQ,MAAE,CAAC,EACZyC,aAAA,CAACnD,uBAAuB,MAAE,CACf,CACR,CACD,CAAC;AAER","ignoreList":[]}
|
|
@@ -2,118 +2,24 @@ import { createElement, Fragment } from "react";
|
|
|
2
2
|
/**
|
|
3
3
|
* WordPress dependencies
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
6
|
-
import { useSelect, useDispatch } from '@wordpress/data';
|
|
7
|
-
import { displayShortcut } from '@wordpress/keycodes';
|
|
8
|
-
import { external, moreVertical } from '@wordpress/icons';
|
|
9
|
-
import { MenuGroup, MenuItem, VisuallyHidden, DropdownMenu } from '@wordpress/components';
|
|
10
|
-
import { PreferenceToggleMenuItem, store as preferencesStore } from '@wordpress/preferences';
|
|
5
|
+
import { useSelect } from '@wordpress/data';
|
|
11
6
|
import { store as coreStore } from '@wordpress/core-data';
|
|
12
|
-
import {
|
|
7
|
+
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
13
8
|
|
|
14
9
|
/**
|
|
15
10
|
* Internal dependencies
|
|
16
11
|
*/
|
|
17
|
-
import ToolsMoreMenuGroup from '../tools-more-menu-group';
|
|
18
12
|
import SiteExport from './site-export';
|
|
19
13
|
import WelcomeGuideMenuItem from './welcome-guide-menu-item';
|
|
20
|
-
import CopyContentMenuItem from './copy-content-menu-item';
|
|
21
14
|
import { unlock } from '../../../lock-unlock';
|
|
22
15
|
const {
|
|
23
|
-
|
|
24
|
-
ActionItem,
|
|
25
|
-
interfaceStore,
|
|
16
|
+
ToolsMoreMenuGroup,
|
|
26
17
|
PreferencesModal
|
|
27
18
|
} = unlock(editorPrivateApis);
|
|
28
|
-
export default function MoreMenu({
|
|
29
|
-
showIconLabels
|
|
30
|
-
}) {
|
|
31
|
-
const {
|
|
32
|
-
openModal
|
|
33
|
-
} = useDispatch(interfaceStore);
|
|
34
|
-
const {
|
|
35
|
-
set: setPreference
|
|
36
|
-
} = useDispatch(preferencesStore);
|
|
19
|
+
export default function MoreMenu() {
|
|
37
20
|
const isBlockBasedTheme = useSelect(select => {
|
|
38
21
|
return select(coreStore).getCurrentTheme().is_block_theme;
|
|
39
22
|
}, []);
|
|
40
|
-
|
|
41
|
-
toggleDistractionFree
|
|
42
|
-
} = useDispatch(editorStore);
|
|
43
|
-
const turnOffDistractionFree = () => {
|
|
44
|
-
setPreference('core', 'distractionFree', false);
|
|
45
|
-
};
|
|
46
|
-
return createElement(Fragment, null, createElement(DropdownMenu, {
|
|
47
|
-
icon: moreVertical,
|
|
48
|
-
label: __('Options'),
|
|
49
|
-
popoverProps: {
|
|
50
|
-
placement: 'bottom-end',
|
|
51
|
-
className: 'more-menu-dropdown__content'
|
|
52
|
-
},
|
|
53
|
-
toggleProps: {
|
|
54
|
-
showTooltip: !showIconLabels,
|
|
55
|
-
...(showIconLabels && {
|
|
56
|
-
variant: 'tertiary'
|
|
57
|
-
}),
|
|
58
|
-
tooltipPosition: 'bottom',
|
|
59
|
-
size: 'compact'
|
|
60
|
-
}
|
|
61
|
-
}, ({
|
|
62
|
-
onClose
|
|
63
|
-
}) => createElement(Fragment, null, createElement(MenuGroup, {
|
|
64
|
-
label: _x('View', 'noun')
|
|
65
|
-
}, createElement(PreferenceToggleMenuItem, {
|
|
66
|
-
scope: "core",
|
|
67
|
-
name: "fixedToolbar",
|
|
68
|
-
onToggle: turnOffDistractionFree,
|
|
69
|
-
label: __('Top toolbar'),
|
|
70
|
-
info: __('Access all block and document tools in a single place'),
|
|
71
|
-
messageActivated: __('Top toolbar activated'),
|
|
72
|
-
messageDeactivated: __('Top toolbar deactivated')
|
|
73
|
-
}), createElement(PreferenceToggleMenuItem, {
|
|
74
|
-
scope: "core",
|
|
75
|
-
name: "distractionFree",
|
|
76
|
-
label: __('Distraction free'),
|
|
77
|
-
info: __('Write with calmness'),
|
|
78
|
-
handleToggling: false,
|
|
79
|
-
onToggle: toggleDistractionFree,
|
|
80
|
-
messageActivated: __('Distraction free mode activated'),
|
|
81
|
-
messageDeactivated: __('Distraction free mode deactivated'),
|
|
82
|
-
shortcut: displayShortcut.primaryShift('\\')
|
|
83
|
-
}), createElement(PreferenceToggleMenuItem, {
|
|
84
|
-
scope: "core",
|
|
85
|
-
name: "focusMode",
|
|
86
|
-
label: __('Spotlight mode'),
|
|
87
|
-
info: __('Focus on one block at a time'),
|
|
88
|
-
messageActivated: __('Spotlight mode activated'),
|
|
89
|
-
messageDeactivated: __('Spotlight mode deactivated')
|
|
90
|
-
})), createElement(ModeSwitcher, null), createElement(ActionItem.Slot, {
|
|
91
|
-
name: "core/plugin-more-menu",
|
|
92
|
-
label: __('Plugins'),
|
|
93
|
-
as: MenuGroup,
|
|
94
|
-
fillProps: {
|
|
95
|
-
onClick: onClose
|
|
96
|
-
}
|
|
97
|
-
}), createElement(MenuGroup, {
|
|
98
|
-
label: __('Tools')
|
|
99
|
-
}, isBlockBasedTheme && createElement(SiteExport, null), createElement(MenuItem, {
|
|
100
|
-
onClick: () => openModal('editor/keyboard-shortcut-help'),
|
|
101
|
-
shortcut: displayShortcut.access('h')
|
|
102
|
-
}, __('Keyboard shortcuts')), createElement(WelcomeGuideMenuItem, null), createElement(CopyContentMenuItem, null), createElement(MenuItem, {
|
|
103
|
-
icon: external,
|
|
104
|
-
role: "menuitem",
|
|
105
|
-
href: __('https://wordpress.org/documentation/article/site-editor/'),
|
|
106
|
-
target: "_blank",
|
|
107
|
-
rel: "noopener noreferrer"
|
|
108
|
-
}, __('Help'), createElement(VisuallyHidden, {
|
|
109
|
-
as: "span"
|
|
110
|
-
}, /* translators: accessibility text */
|
|
111
|
-
__('(opens in a new tab)'))), createElement(ToolsMoreMenuGroup.Slot, {
|
|
112
|
-
fillProps: {
|
|
113
|
-
onClose
|
|
114
|
-
}
|
|
115
|
-
})), createElement(MenuGroup, null, createElement(MenuItem, {
|
|
116
|
-
onClick: () => openModal('editor/preferences')
|
|
117
|
-
}, __('Preferences'))))), createElement(PreferencesModal, null));
|
|
23
|
+
return createElement(Fragment, null, createElement(ToolsMoreMenuGroup, null, isBlockBasedTheme && createElement(SiteExport, null), createElement(WelcomeGuideMenuItem, null)), createElement(PreferencesModal, null));
|
|
118
24
|
}
|
|
119
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","_x","useSelect","useDispatch","displayShortcut","external","moreVertical","MenuGroup","MenuItem","VisuallyHidden","DropdownMenu","PreferenceToggleMenuItem","store","preferencesStore","coreStore","editorStore","privateApis","editorPrivateApis","ToolsMoreMenuGroup","SiteExport","WelcomeGuideMenuItem","CopyContentMenuItem","unlock","ModeSwitcher","ActionItem","interfaceStore","PreferencesModal","MoreMenu","showIconLabels","openModal","set","setPreference","isBlockBasedTheme","select","getCurrentTheme","is_block_theme","toggleDistractionFree","turnOffDistractionFree","createElement","Fragment","icon","label","popoverProps","placement","className","toggleProps","showTooltip","variant","tooltipPosition","size","onClose","scope","name","onToggle","info","messageActivated","messageDeactivated","handleToggling","shortcut","primaryShift","Slot","as","fillProps","onClick","access","role","href","target","rel"],"sources":["@wordpress/edit-site/src/components/header-edit-mode/more-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { external, moreVertical } from '@wordpress/icons';\nimport {\n\tMenuGroup,\n\tMenuItem,\n\tVisuallyHidden,\n\tDropdownMenu,\n} from '@wordpress/components';\nimport {\n\tPreferenceToggleMenuItem,\n\tstore as preferencesStore,\n} from '@wordpress/preferences';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\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 { unlock } from '../../../lock-unlock';\n\nconst { ModeSwitcher, ActionItem, interfaceStore, PreferencesModal } =\n\tunlock( editorPrivateApis );\n\nexport default function MoreMenu( { showIconLabels } ) {\n\tconst { openModal } = useDispatch( interfaceStore );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\tconst isBlockBasedTheme = useSelect( ( select ) => {\n\t\treturn select( coreStore ).getCurrentTheme().is_block_theme;\n\t}, [] );\n\n\tconst { toggleDistractionFree } = useDispatch( editorStore );\n\n\tconst turnOffDistractionFree = () => {\n\t\tsetPreference( 'core', 'distractionFree', false );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<DropdownMenu\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tlabel={ __( 'Options' ) }\n\t\t\t\tpopoverProps={ {\n\t\t\t\t\tplacement: 'bottom-end',\n\t\t\t\t\tclassName: 'more-menu-dropdown__content',\n\t\t\t\t} }\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\ttooltipPosition: 'bottom',\n\t\t\t\t\tsize: 'compact',\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\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t\t\t\tinfo={ __( 'Write with calmness' ) }\n\t\t\t\t\t\t\t\thandleToggling={ false }\n\t\t\t\t\t\t\t\tonToggle={ toggleDistractionFree }\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/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{ isBlockBasedTheme && <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( 'editor/keyboard-shortcut-help' )\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( 'editor/preferences' )\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</DropdownMenu>\n\t\t\t<PreferencesModal />\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,QAAQ,EAAEC,YAAY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Z;IAAQ;EAAG,CACzB,CACS,CAAC,EACZZ,aAAA,CAAC/B,SAAS,QACT+B,aAAA,CAAC9B,QAAQ;IACRuD,OAAO,EAAGA,CAAA,KACTlC,SAAS,CAAE,oBAAqB;EAChC,GAEC7B,EAAE,CAAE,aAAc,CACX,CACA,CACV,CAEU,CAAC,EACfsC,aAAA,CAACZ,gBAAgB,MAAE,CAClB,CAAC;AAEL","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["useSelect","store","coreStore","privateApis","editorPrivateApis","SiteExport","WelcomeGuideMenuItem","unlock","ToolsMoreMenuGroup","PreferencesModal","MoreMenu","isBlockBasedTheme","select","getCurrentTheme","is_block_theme","createElement","Fragment"],"sources":["@wordpress/edit-site/src/components/header-edit-mode/more-menu/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport SiteExport from './site-export';\nimport WelcomeGuideMenuItem from './welcome-guide-menu-item';\nimport { unlock } from '../../../lock-unlock';\n\nconst { ToolsMoreMenuGroup, PreferencesModal } = unlock( editorPrivateApis );\n\nexport default function MoreMenu() {\n\tconst isBlockBasedTheme = useSelect( ( select ) => {\n\t\treturn select( coreStore ).getCurrentTheme().is_block_theme;\n\t}, [] );\n\n\treturn (\n\t\t<>\n\t\t\t<ToolsMoreMenuGroup>\n\t\t\t\t{ isBlockBasedTheme && <SiteExport /> }\n\t\t\t\t<WelcomeGuideMenuItem />\n\t\t\t</ToolsMoreMenuGroup>\n\t\t\t<PreferencesModal />\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,OAAOC,UAAU,MAAM,eAAe;AACtC,OAAOC,oBAAoB,MAAM,2BAA2B;AAC5D,SAASC,MAAM,QAAQ,sBAAsB;AAE7C,MAAM;EAAEC,kBAAkB;EAAEC;AAAiB,CAAC,GAAGF,MAAM,CAAEH,iBAAkB,CAAC;AAE5E,eAAe,SAASM,QAAQA,CAAA,EAAG;EAClC,MAAMC,iBAAiB,GAAGX,SAAS,CAAIY,MAAM,IAAM;IAClD,OAAOA,MAAM,CAAEV,SAAU,CAAC,CAACW,eAAe,CAAC,CAAC,CAACC,cAAc;EAC5D,CAAC,EAAE,EAAG,CAAC;EAEP,OACCC,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACP,kBAAkB,QAChBG,iBAAiB,IAAII,aAAA,CAACV,UAAU,MAAE,CAAC,EACrCU,aAAA,CAACT,oBAAoB,MAAE,CACJ,CAAC,EACrBS,aAAA,CAACN,gBAAgB,MAAE,CAClB,CAAC;AAEL","ignoreList":[]}
|
|
@@ -20,55 +20,6 @@ function KeyboardShortcutsRegister() {
|
|
|
20
20
|
character: 's'
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
|
-
registerShortcut({
|
|
24
|
-
name: 'core/edit-site/next-region',
|
|
25
|
-
category: 'global',
|
|
26
|
-
description: __('Navigate to the next part of the editor.'),
|
|
27
|
-
keyCombination: {
|
|
28
|
-
modifier: 'ctrl',
|
|
29
|
-
character: '`'
|
|
30
|
-
},
|
|
31
|
-
aliases: [{
|
|
32
|
-
modifier: 'access',
|
|
33
|
-
character: 'n'
|
|
34
|
-
}]
|
|
35
|
-
});
|
|
36
|
-
registerShortcut({
|
|
37
|
-
name: 'core/edit-site/previous-region',
|
|
38
|
-
category: 'global',
|
|
39
|
-
description: __('Navigate to the previous part of the editor.'),
|
|
40
|
-
keyCombination: {
|
|
41
|
-
modifier: 'ctrlShift',
|
|
42
|
-
character: '`'
|
|
43
|
-
},
|
|
44
|
-
aliases: [{
|
|
45
|
-
modifier: 'access',
|
|
46
|
-
character: 'p'
|
|
47
|
-
}, {
|
|
48
|
-
modifier: 'ctrlShift',
|
|
49
|
-
character: '~'
|
|
50
|
-
}]
|
|
51
|
-
});
|
|
52
|
-
registerShortcut({
|
|
53
|
-
name: 'core/edit-site/transform-heading-to-paragraph',
|
|
54
|
-
category: 'block-library',
|
|
55
|
-
description: __('Transform heading to paragraph.'),
|
|
56
|
-
keyCombination: {
|
|
57
|
-
modifier: 'access',
|
|
58
|
-
character: `0`
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
[1, 2, 3, 4, 5, 6].forEach(level => {
|
|
62
|
-
registerShortcut({
|
|
63
|
-
name: `core/edit-site/transform-paragraph-to-heading-${level}`,
|
|
64
|
-
category: 'block-library',
|
|
65
|
-
description: __('Transform paragraph to heading.'),
|
|
66
|
-
keyCombination: {
|
|
67
|
-
modifier: 'access',
|
|
68
|
-
character: `${level}`
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
23
|
}, [registerShortcut]);
|
|
73
24
|
return null;
|
|
74
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEffect","store","keyboardShortcutsStore","useDispatch","__","KeyboardShortcutsRegister","registerShortcut","name","category","description","keyCombination","modifier","character"
|
|
1
|
+
{"version":3,"names":["useEffect","store","keyboardShortcutsStore","useDispatch","__","KeyboardShortcutsRegister","registerShortcut","name","category","description","keyCombination","modifier","character"],"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\t}, [ registerShortcut ] );\n\n\treturn null;\n}\n\nexport default KeyboardShortcutsRegister;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,KAAK,IAAIC,sBAAsB,QAAQ,+BAA+B;AAC/E,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AAEpC,SAASC,yBAAyBA,CAAA,EAAG;EACpC;EACA,MAAM;IAAEC;EAAiB,CAAC,GAAGH,WAAW,CAAED,sBAAuB,CAAC;EAClEF,SAAS,CAAE,MAAM;IAChBM,gBAAgB,CAAE;MACjBC,IAAI,EAAE,qBAAqB;MAC3BC,QAAQ,EAAE,QAAQ;MAClBC,WAAW,EAAEL,EAAE,CAAE,oBAAqB,CAAC;MACvCM,cAAc,EAAE;QACfC,QAAQ,EAAE,SAAS;QACnBC,SAAS,EAAE;MACZ;IACD,CAAE,CAAC;EACJ,CAAC,EAAE,CAAEN,gBAAgB,CAAG,CAAC;EAEzB,OAAO,IAAI;AACZ;AAEA,eAAeD,yBAAyB","ignoreList":[]}
|
|
@@ -67,7 +67,8 @@ export default function Layout() {
|
|
|
67
67
|
hasBlockSelected,
|
|
68
68
|
canvasMode,
|
|
69
69
|
previousShortcut,
|
|
70
|
-
nextShortcut
|
|
70
|
+
nextShortcut,
|
|
71
|
+
hasBlockBreadcrumbs
|
|
71
72
|
} = useSelect(select => {
|
|
72
73
|
const {
|
|
73
74
|
getAllShortcutKeyCombinations
|
|
@@ -77,10 +78,11 @@ export default function Layout() {
|
|
|
77
78
|
} = unlock(select(editSiteStore));
|
|
78
79
|
return {
|
|
79
80
|
canvasMode: getCanvasMode(),
|
|
80
|
-
previousShortcut: getAllShortcutKeyCombinations('core/
|
|
81
|
-
nextShortcut: getAllShortcutKeyCombinations('core/
|
|
81
|
+
previousShortcut: getAllShortcutKeyCombinations('core/editor/previous-region'),
|
|
82
|
+
nextShortcut: getAllShortcutKeyCombinations('core/editor/next-region'),
|
|
82
83
|
hasFixedToolbar: select(preferencesStore).get('core', 'fixedToolbar'),
|
|
83
84
|
isDistractionFree: select(preferencesStore).get('core', 'distractionFree'),
|
|
85
|
+
hasBlockBreadcrumbs: select(preferencesStore).get('core', 'showBlockBreadcrumbs'),
|
|
84
86
|
isZoomOutMode: select(blockEditorStore).__unstableGetEditorMode() === 'zoom-out',
|
|
85
87
|
hasBlockSelected: select(blockEditorStore).getBlockSelectionStart()
|
|
86
88
|
};
|
|
@@ -149,7 +151,8 @@ export default function Layout() {
|
|
|
149
151
|
'is-full-canvas': canvasMode === 'edit',
|
|
150
152
|
'has-fixed-toolbar': hasFixedToolbar,
|
|
151
153
|
'is-block-toolbar-visible': hasBlockSelected,
|
|
152
|
-
'is-zoom-out': isZoomOutMode
|
|
154
|
+
'is-zoom-out': isZoomOutMode,
|
|
155
|
+
'has-block-breadcrumbs': hasBlockBreadcrumbs && !isDistractionFree && canvasMode === 'edit'
|
|
153
156
|
})
|
|
154
157
|
}, createElement(motion.div, {
|
|
155
158
|
className: "edit-site-layout__header-container",
|