@wordpress/edit-site 5.30.0 → 5.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/components/block-editor/editor-canvas.js +24 -4
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/site-editor-canvas.js +15 -4
- package/build/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js +1 -1
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/editor/index.js +12 -3
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +1 -2
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/global-styles/background-panel.js +38 -0
- package/build/components/global-styles/background-panel.js.map +1 -0
- package/build/components/global-styles/color-palette-panel.js +0 -9
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/font-families.js +1 -1
- package/build/components/global-styles/font-families.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +53 -17
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +4 -3
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +3 -2
- package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js +44 -10
- package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/index.js +22 -4
- package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js +3 -0
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build/components/global-styles/header.js +1 -1
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/hooks.js +50 -1
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/palette.js +3 -1
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preview-colors.js +2 -2
- package/build/components/global-styles/preview-colors.js.map +1 -1
- package/build/components/global-styles/preview-iframe.js +0 -1
- package/build/components/global-styles/preview-iframe.js.map +1 -1
- package/build/components/global-styles/preview-styles.js +2 -2
- package/build/components/global-styles/preview-styles.js.map +1 -1
- package/build/components/global-styles/root-menu.js +8 -2
- package/build/components/global-styles/root-menu.js.map +1 -1
- package/build/components/global-styles/screen-background.js +34 -0
- package/build/components/global-styles/screen-background.js.map +1 -0
- package/build/components/global-styles/screen-color-palette.js +2 -2
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +5 -10
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js +3 -37
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +6 -11
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +5 -2
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/typography-elements.js +3 -1
- package/build/components/global-styles/typography-elements.js.map +1 -1
- package/build/components/global-styles/{preview-typography.js → typography-example.js} +4 -2
- package/build/components/global-styles/typography-example.js.map +1 -0
- package/build/components/global-styles/typography-preview.js +3 -1
- package/build/components/global-styles/typography-preview.js.map +1 -1
- package/build/components/global-styles/ui.js +4 -1
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/utils.js +1 -1
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/global-styles/variations/variations-color.js +13 -7
- package/build/components/global-styles/variations/variations-color.js.map +1 -1
- package/build/components/global-styles/variations/variations-typography.js +34 -37
- package/build/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build/components/header-edit-mode/index.js +2 -1
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +6 -0
- package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +3 -0
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/global.js +17 -3
- package/build/components/keyboard-shortcuts/global.js.map +1 -1
- package/build/components/layout/animation.js +129 -0
- package/build/components/layout/animation.js.map +1 -0
- package/build/components/layout/index.js +9 -17
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/router.js +22 -22
- package/build/components/layout/router.js.map +1 -1
- package/build/components/page-pages/index.js +24 -27
- package/build/components/page-pages/index.js.map +1 -1
- package/build/components/page-patterns/delete-category-menu-item.js +6 -1
- package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build/components/page-patterns/index.js +19 -32
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-patterns/search-items.js +16 -58
- package/build/components/page-patterns/search-items.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +9 -9
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-templates-template-parts/actions.js +54 -41
- package/build/components/page-templates-template-parts/actions.js.map +1 -1
- package/build/components/page-templates-template-parts/index.js +31 -69
- package/build/components/page-templates-template-parts/index.js.map +1 -1
- package/build/components/plugin-template-setting-panel/index.js +12 -1
- package/build/components/plugin-template-setting-panel/index.js.map +1 -1
- package/build/components/save-button/index.js +45 -16
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js +8 -112
- package/build/components/save-hub/index.js.map +1 -1
- package/build/components/save-panel/index.js +14 -9
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +3 -8
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-dataviews/custom-dataviews-list.js +2 -2
- package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build/components/sidebar-dataviews/dataview-item.js +2 -2
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +3 -3
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +5 -4
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +1 -2
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/index.js +7 -17
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-content.js +7 -5
- package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js +3 -1
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/index.js +32 -18
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js +5 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +18 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/{delete-modal.js → delete-confirm-dialog.js} +4 -5
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +6 -6
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +1 -5
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/index.js +5 -1
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.js +2 -2
- package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build/components/style-book/index.js +1 -1
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -3
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-path-with-url.js +1 -11
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build/components/template-actions/index.js +44 -27
- package/build/components/template-actions/index.js.map +1 -1
- package/build/components/welcome-guide/editor.js +11 -2
- package/build/components/welcome-guide/editor.js.map +1 -1
- package/build/hooks/index.js +0 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +15 -2
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build/store/selectors.js +1 -9
- package/build/store/selectors.js.map +1 -1
- package/build/utils/constants.js +5 -3
- package/build/utils/constants.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/utils/math.js +98 -0
- package/build/utils/math.js.map +1 -0
- package/build-module/components/block-editor/editor-canvas.js +24 -4
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/site-editor-canvas.js +15 -4
- package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/editor/index.js +13 -4
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +1 -2
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/global-styles/background-panel.js +31 -0
- package/build-module/components/global-styles/background-panel.js.map +1 -0
- package/build-module/components/global-styles/color-palette-panel.js +0 -8
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/font-families.js +1 -1
- package/build-module/components/global-styles/font-families.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +54 -18
- 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 +4 -3
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +4 -3
- package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js +44 -10
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/index.js +22 -4
- package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +3 -0
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build-module/components/global-styles/header.js +1 -1
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +48 -1
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/palette.js +3 -1
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preview-colors.js +2 -2
- package/build-module/components/global-styles/preview-colors.js.map +1 -1
- package/build-module/components/global-styles/preview-iframe.js +0 -1
- package/build-module/components/global-styles/preview-iframe.js.map +1 -1
- package/build-module/components/global-styles/preview-styles.js +2 -2
- package/build-module/components/global-styles/preview-styles.js.map +1 -1
- package/build-module/components/global-styles/root-menu.js +9 -3
- package/build-module/components/global-styles/root-menu.js.map +1 -1
- package/build-module/components/global-styles/screen-background.js +26 -0
- package/build-module/components/global-styles/screen-background.js.map +1 -0
- package/build-module/components/global-styles/screen-color-palette.js +2 -2
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +5 -10
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js +4 -38
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +6 -11
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +5 -2
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/typography-elements.js +3 -1
- package/build-module/components/global-styles/typography-elements.js.map +1 -1
- package/build-module/components/global-styles/{preview-typography.js → typography-example.js} +4 -2
- package/build-module/components/global-styles/typography-example.js.map +1 -0
- package/build-module/components/global-styles/typography-preview.js +3 -1
- package/build-module/components/global-styles/typography-preview.js.map +1 -1
- package/build-module/components/global-styles/ui.js +4 -1
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/utils.js +1 -1
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-color.js +13 -7
- package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-typography.js +35 -38
- package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +2 -1
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +6 -0
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +3 -0
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/global.js +17 -3
- package/build-module/components/keyboard-shortcuts/global.js.map +1 -1
- package/build-module/components/layout/animation.js +122 -0
- package/build-module/components/layout/animation.js.map +1 -0
- package/build-module/components/layout/index.js +9 -17
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/router.js +22 -22
- package/build-module/components/layout/router.js.map +1 -1
- package/build-module/components/page-pages/index.js +25 -28
- package/build-module/components/page-pages/index.js.map +1 -1
- package/build-module/components/page-patterns/delete-category-menu-item.js +6 -1
- package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/index.js +21 -34
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-patterns/search-items.js +14 -55
- package/build-module/components/page-patterns/search-items.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +9 -9
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-templates-template-parts/actions.js +54 -40
- package/build-module/components/page-templates-template-parts/actions.js.map +1 -1
- package/build-module/components/page-templates-template-parts/index.js +34 -72
- package/build-module/components/page-templates-template-parts/index.js.map +1 -1
- package/build-module/components/plugin-template-setting-panel/index.js +12 -1
- package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
- package/build-module/components/save-button/index.js +46 -17
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-hub/index.js +10 -114
- package/build-module/components/save-hub/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +14 -9
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +3 -8
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +2 -2
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js +2 -2
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +4 -4
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +5 -4
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +1 -2
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/index.js +10 -20
- package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +7 -5
- package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +4 -2
- 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 +33 -19
- 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 +5 -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 +19 -2
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/{delete-modal.js → delete-confirm-dialog.js} +3 -4
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +6 -6
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +1 -5
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js +5 -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 +2 -2
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build-module/components/style-book/index.js +1 -1
- 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 +3 -3
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +1 -11
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build-module/components/template-actions/index.js +44 -27
- package/build-module/components/template-actions/index.js.map +1 -1
- package/build-module/components/welcome-guide/editor.js +11 -2
- package/build-module/components/welcome-guide/editor.js.map +1 -1
- package/build-module/hooks/index.js +0 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +15 -2
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build-module/store/selectors.js +1 -9
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/constants.js +4 -2
- package/build-module/utils/constants.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-module/utils/math.js +92 -0
- package/build-module/utils/math.js.map +1 -0
- package/build-style/style-rtl.css +146 -130
- package/build-style/style.css +146 -130
- package/package.json +44 -44
- package/src/components/block-editor/editor-canvas.js +34 -9
- package/src/components/block-editor/site-editor-canvas.js +10 -7
- package/src/components/block-editor/use-site-editor-settings.js +0 -2
- package/src/components/editor/index.js +11 -4
- package/src/components/editor-canvas-container/index.js +0 -1
- package/src/components/global-styles/background-panel.js +34 -0
- package/src/components/global-styles/color-palette-panel.js +0 -11
- package/src/components/global-styles/font-families.js +1 -1
- package/src/components/global-styles/font-library-modal/context.js +77 -31
- package/src/components/global-styles/font-library-modal/font-collection.js +4 -3
- package/src/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +9 -2
- package/src/components/global-styles/font-library-modal/installed-fonts.js +1 -1
- package/src/components/global-styles/font-library-modal/style.scss +15 -6
- package/src/components/global-styles/font-library-modal/upload-fonts.js +53 -8
- package/src/components/global-styles/font-library-modal/utils/index.js +21 -8
- package/src/components/global-styles/font-library-modal/utils/preview-styles.js +4 -0
- package/src/components/global-styles/header.js +1 -1
- package/src/components/global-styles/hooks.js +68 -1
- package/src/components/global-styles/palette.js +3 -1
- package/src/components/global-styles/preview-colors.js +2 -2
- package/src/components/global-styles/preview-iframe.js +0 -1
- package/src/components/global-styles/preview-styles.js +2 -2
- package/src/components/global-styles/root-menu.js +12 -1
- package/src/components/global-styles/screen-background.js +29 -0
- package/src/components/global-styles/screen-color-palette.js +2 -2
- package/src/components/global-styles/screen-colors.js +4 -15
- package/src/components/global-styles/screen-style-variations.js +4 -36
- package/src/components/global-styles/screen-typography.js +6 -20
- package/src/components/global-styles/style-variations-container.js +2 -1
- package/src/components/global-styles/style.scss +15 -10
- package/src/components/global-styles/typography-elements.js +5 -1
- package/src/components/global-styles/{preview-typography.js → typography-example.js} +3 -1
- package/src/components/global-styles/typography-preview.js +3 -1
- package/src/components/global-styles/ui.js +5 -0
- package/src/components/global-styles/utils.js +1 -1
- package/src/components/global-styles/variations/style.scss +32 -23
- package/src/components/global-styles/variations/variations-color.js +12 -6
- package/src/components/global-styles/variations/variations-typography.js +41 -60
- package/src/components/header-edit-mode/index.js +1 -0
- package/src/components/header-edit-mode/style.scss +28 -17
- package/src/components/keyboard-shortcut-help-modal/config.js +4 -0
- package/src/components/keyboard-shortcut-help-modal/index.js +4 -0
- package/src/components/keyboard-shortcuts/global.js +16 -4
- package/src/components/layout/animation.js +122 -0
- package/src/components/layout/index.js +12 -27
- package/src/components/layout/router.js +26 -25
- package/src/components/layout/style.scss +2 -0
- package/src/components/page-pages/index.js +33 -54
- package/src/components/page-patterns/delete-category-menu-item.js +7 -0
- package/src/components/page-patterns/index.js +22 -31
- package/src/components/page-patterns/search-items.js +13 -58
- package/src/components/page-patterns/use-patterns.js +17 -10
- package/src/components/page-templates-template-parts/actions.js +106 -91
- package/src/components/page-templates-template-parts/index.js +41 -93
- package/src/components/page-templates-template-parts/style.scss +5 -0
- package/src/components/plugin-template-setting-panel/index.js +14 -1
- package/src/components/save-button/index.js +55 -26
- package/src/components/save-hub/index.js +20 -164
- package/src/components/save-panel/index.js +24 -17
- package/src/components/sidebar/index.js +2 -8
- package/src/components/sidebar-dataviews/custom-dataviews-list.js +2 -2
- package/src/components/sidebar-dataviews/dataview-item.js +2 -2
- package/src/components/sidebar-dataviews/default-views.js +12 -4
- package/src/components/sidebar-dataviews/index.js +5 -4
- package/src/components/sidebar-edit-mode/index.js +0 -2
- package/src/components/sidebar-edit-mode/page-panels/index.js +31 -62
- package/src/components/sidebar-edit-mode/page-panels/page-content.js +10 -10
- package/src/components/sidebar-edit-mode/page-panels/page-summary.js +2 -0
- package/src/components/sidebar-edit-mode/template-panel/index.js +33 -24
- package/src/components/sidebar-edit-mode/template-panel/style.scss +1 -29
- package/src/components/sidebar-navigation-screen/style.scss +21 -9
- package/src/components/sidebar-navigation-screen-details-footer/index.js +6 -2
- package/src/components/sidebar-navigation-screen-global-styles/index.js +29 -2
- package/src/components/sidebar-navigation-screen-navigation-menu/{delete-modal.js → delete-confirm-dialog.js} +2 -3
- package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +11 -9
- package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +6 -3
- package/src/components/sidebar-navigation-screen-patterns/index.js +0 -7
- package/src/components/sidebar-navigation-screen-template/index.js +6 -1
- package/src/components/sidebar-navigation-screen-templates-browse/content.js +2 -2
- package/src/components/style-book/index.js +1 -3
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -3
- package/src/components/sync-state-with-url/use-sync-path-with-url.js +3 -19
- package/src/components/template-actions/index.js +63 -46
- package/src/components/welcome-guide/editor.js +9 -6
- package/src/hooks/index.js +0 -1
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +21 -4
- package/src/store/selectors.js +3 -15
- package/src/style.scss +0 -2
- package/src/utils/constants.js +4 -2
- package/src/utils/get-is-list-page.js +1 -1
- package/src/utils/math.js +93 -0
- package/build/components/actions/index.js +0 -321
- package/build/components/actions/index.js.map +0 -1
- package/build/components/global-styles/preview-typography.js.map +0 -1
- package/build/components/sidebar-edit-mode/sidebar-card/index.js +0 -42
- package/build/components/sidebar-edit-mode/sidebar-card/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-panel/template-actions.js +0 -50
- package/build/components/sidebar-edit-mode/template-panel/template-actions.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-panel/template-areas.js +0 -70
- package/build/components/sidebar-edit-mode/template-panel/template-areas.js.map +0 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +0 -1
- package/build/components/sidebar-navigation-screen-pages/index.js +0 -175
- package/build/components/sidebar-navigation-screen-pages/index.js.map +0 -1
- package/build/components/sidebar-navigation-screen-templates/index.js +0 -132
- package/build/components/sidebar-navigation-screen-templates/index.js.map +0 -1
- package/build/hooks/template-part-edit.js +0 -82
- package/build/hooks/template-part-edit.js.map +0 -1
- package/build/store/utils.js +0 -71
- package/build/store/utils.js.map +0 -1
- package/build-module/components/actions/index.js +0 -310
- package/build-module/components/actions/index.js.map +0 -1
- package/build-module/components/global-styles/preview-typography.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/sidebar-card/index.js +0 -34
- package/build-module/components/sidebar-edit-mode/sidebar-card/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js +0 -42
- package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js +0 -63
- package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-pages/index.js +0 -167
- package/build-module/components/sidebar-navigation-screen-pages/index.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-templates/index.js +0 -124
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +0 -1
- package/build-module/hooks/template-part-edit.js +0 -75
- package/build-module/hooks/template-part-edit.js.map +0 -1
- package/build-module/store/utils.js +0 -64
- package/build-module/store/utils.js.map +0 -1
- package/src/components/actions/index.js +0 -411
- package/src/components/sidebar-edit-mode/sidebar-card/index.js +0 -34
- package/src/components/sidebar-edit-mode/sidebar-card/style.scss +0 -37
- package/src/components/sidebar-edit-mode/template-panel/template-actions.js +0 -49
- package/src/components/sidebar-edit-mode/template-panel/template-areas.js +0 -86
- package/src/components/sidebar-navigation-screen-pages/index.js +0 -238
- package/src/components/sidebar-navigation-screen-templates/index.js +0 -156
- package/src/components/sidebar-navigation-screen-templates/style.scss +0 -9
- package/src/hooks/template-part-edit.js +0 -89
- package/src/store/test/utils.js +0 -191
- package/src/store/utils.js +0 -69
package/build/store/utils.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.getFilteredTemplatePartBlocks = void 0;
|
|
8
|
-
var _memize = _interopRequireDefault(require("memize"));
|
|
9
|
-
var _blocks = require("@wordpress/blocks");
|
|
10
|
-
/**
|
|
11
|
-
* External dependencies
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* WordPress dependencies
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
const EMPTY_ARRAY = [];
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Get a flattened and filtered list of template parts and the matching block for that template part.
|
|
22
|
-
*
|
|
23
|
-
* Takes a list of blocks defined within a template, and a list of template parts, and returns a
|
|
24
|
-
* flattened list of template parts and the matching block for that template part.
|
|
25
|
-
*
|
|
26
|
-
* @param {Array} blocks Blocks to flatten.
|
|
27
|
-
* @param {?Array} templateParts Available template parts.
|
|
28
|
-
* @return {Array} An array of template parts and their blocks.
|
|
29
|
-
*/
|
|
30
|
-
function getFilteredTemplatePartBlocks(blocks = EMPTY_ARRAY, templateParts) {
|
|
31
|
-
const templatePartsById = templateParts ?
|
|
32
|
-
// Key template parts by their ID.
|
|
33
|
-
templateParts.reduce((newTemplateParts, part) => ({
|
|
34
|
-
...newTemplateParts,
|
|
35
|
-
[part.id]: part
|
|
36
|
-
}), {}) : {};
|
|
37
|
-
const result = [];
|
|
38
|
-
|
|
39
|
-
// Iterate over all blocks, recursing into inner blocks.
|
|
40
|
-
// Output will be based on a depth-first traversal.
|
|
41
|
-
const stack = [...blocks];
|
|
42
|
-
while (stack.length) {
|
|
43
|
-
const {
|
|
44
|
-
innerBlocks,
|
|
45
|
-
...block
|
|
46
|
-
} = stack.shift();
|
|
47
|
-
// Place inner blocks at the beginning of the stack to preserve order.
|
|
48
|
-
stack.unshift(...innerBlocks);
|
|
49
|
-
if ((0, _blocks.isTemplatePart)(block)) {
|
|
50
|
-
const {
|
|
51
|
-
attributes: {
|
|
52
|
-
theme,
|
|
53
|
-
slug
|
|
54
|
-
}
|
|
55
|
-
} = block;
|
|
56
|
-
const templatePartId = `${theme}//${slug}`;
|
|
57
|
-
const templatePart = templatePartsById[templatePartId];
|
|
58
|
-
|
|
59
|
-
// Only add to output if the found template part block is in the list of available template parts.
|
|
60
|
-
if (templatePart) {
|
|
61
|
-
result.push({
|
|
62
|
-
templatePart,
|
|
63
|
-
block
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return result;
|
|
69
|
-
}
|
|
70
|
-
const memoizedGetFilteredTemplatePartBlocks = exports.getFilteredTemplatePartBlocks = (0, _memize.default)(getFilteredTemplatePartBlocks);
|
|
71
|
-
//# sourceMappingURL=utils.js.map
|
package/build/store/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_memize","_interopRequireDefault","require","_blocks","EMPTY_ARRAY","getFilteredTemplatePartBlocks","blocks","templateParts","templatePartsById","reduce","newTemplateParts","part","id","result","stack","length","innerBlocks","block","shift","unshift","isTemplatePart","attributes","theme","slug","templatePartId","templatePart","push","memoizedGetFilteredTemplatePartBlocks","exports","memoize"],"sources":["@wordpress/edit-site/src/store/utils.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport memoize from 'memize';\n\n/**\n * WordPress dependencies\n */\nimport { isTemplatePart } from '@wordpress/blocks';\n\nconst EMPTY_ARRAY = [];\n\n/**\n * Get a flattened and filtered list of template parts and the matching block for that template part.\n *\n * Takes a list of blocks defined within a template, and a list of template parts, and returns a\n * flattened list of template parts and the matching block for that template part.\n *\n * @param {Array} blocks Blocks to flatten.\n * @param {?Array} templateParts Available template parts.\n * @return {Array} An array of template parts and their blocks.\n */\nfunction getFilteredTemplatePartBlocks( blocks = EMPTY_ARRAY, templateParts ) {\n\tconst templatePartsById = templateParts\n\t\t? // Key template parts by their ID.\n\t\t templateParts.reduce(\n\t\t\t\t( newTemplateParts, part ) => ( {\n\t\t\t\t\t...newTemplateParts,\n\t\t\t\t\t[ part.id ]: part,\n\t\t\t\t} ),\n\t\t\t\t{}\n\t\t )\n\t\t: {};\n\n\tconst result = [];\n\n\t// Iterate over all blocks, recursing into inner blocks.\n\t// Output will be based on a depth-first traversal.\n\tconst stack = [ ...blocks ];\n\twhile ( stack.length ) {\n\t\tconst { innerBlocks, ...block } = stack.shift();\n\t\t// Place inner blocks at the beginning of the stack to preserve order.\n\t\tstack.unshift( ...innerBlocks );\n\n\t\tif ( isTemplatePart( block ) ) {\n\t\t\tconst {\n\t\t\t\tattributes: { theme, slug },\n\t\t\t} = block;\n\t\t\tconst templatePartId = `${ theme }//${ slug }`;\n\t\t\tconst templatePart = templatePartsById[ templatePartId ];\n\n\t\t\t// Only add to output if the found template part block is in the list of available template parts.\n\t\t\tif ( templatePart ) {\n\t\t\t\tresult.push( {\n\t\t\t\t\ttemplatePart,\n\t\t\t\t\tblock,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t}\n\n\treturn result;\n}\n\nconst memoizedGetFilteredTemplatePartBlocks = memoize(\n\tgetFilteredTemplatePartBlocks\n);\n\nexport { memoized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GAAAC,OAAA,CAAAvB,6BAAA,GAAG,IAAAwB,eAAO,EACpDxB,6BACD,CAAC"}
|
|
@@ -1,310 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { external, trash, backup } from '@wordpress/icons';
|
|
6
|
-
import { addQueryArgs } from '@wordpress/url';
|
|
7
|
-
import { useDispatch } from '@wordpress/data';
|
|
8
|
-
import { decodeEntities } from '@wordpress/html-entities';
|
|
9
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
10
|
-
import { __, sprintf } from '@wordpress/i18n';
|
|
11
|
-
import { store as noticesStore } from '@wordpress/notices';
|
|
12
|
-
import { useMemo } from '@wordpress/element';
|
|
13
|
-
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
14
|
-
import { Button, __experimentalText as Text, __experimentalHStack as HStack, __experimentalVStack as VStack } from '@wordpress/components';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Internal dependencies
|
|
18
|
-
*/
|
|
19
|
-
import { unlock } from '../../lock-unlock';
|
|
20
|
-
const {
|
|
21
|
-
useHistory
|
|
22
|
-
} = unlock(routerPrivateApis);
|
|
23
|
-
export const trashPostAction = {
|
|
24
|
-
id: 'move-to-trash',
|
|
25
|
-
label: __('Move to Trash'),
|
|
26
|
-
isPrimary: true,
|
|
27
|
-
icon: trash,
|
|
28
|
-
isEligible({
|
|
29
|
-
status
|
|
30
|
-
}) {
|
|
31
|
-
return status !== 'trash';
|
|
32
|
-
},
|
|
33
|
-
supportsBulk: true,
|
|
34
|
-
hideModalHeader: true,
|
|
35
|
-
RenderModal: ({
|
|
36
|
-
items: posts,
|
|
37
|
-
closeModal,
|
|
38
|
-
onPerform
|
|
39
|
-
}) => {
|
|
40
|
-
const {
|
|
41
|
-
createSuccessNotice,
|
|
42
|
-
createErrorNotice
|
|
43
|
-
} = useDispatch(noticesStore);
|
|
44
|
-
const {
|
|
45
|
-
deleteEntityRecord
|
|
46
|
-
} = useDispatch(coreStore);
|
|
47
|
-
return createElement(VStack, {
|
|
48
|
-
spacing: "5"
|
|
49
|
-
}, createElement(Text, null, posts.length === 1 ? sprintf(
|
|
50
|
-
// translators: %s: The page's title.
|
|
51
|
-
__('Are you sure you want to delete "%s"?'), decodeEntities(posts[0].title.rendered)) : sprintf(
|
|
52
|
-
// translators: %d: The number of pages (2 or more).
|
|
53
|
-
__('Are you sure you want to delete %d pages?'), posts.length)), createElement(HStack, {
|
|
54
|
-
justify: "right"
|
|
55
|
-
}, createElement(Button, {
|
|
56
|
-
variant: "tertiary",
|
|
57
|
-
onClick: closeModal
|
|
58
|
-
}, __('Cancel')), createElement(Button, {
|
|
59
|
-
variant: "primary",
|
|
60
|
-
onClick: async () => {
|
|
61
|
-
const promiseResult = await Promise.allSettled(posts.map(post => {
|
|
62
|
-
return deleteEntityRecord('postType', post.type, post.id, {}, {
|
|
63
|
-
throwOnError: true
|
|
64
|
-
});
|
|
65
|
-
}));
|
|
66
|
-
// If all the promises were fulfilled with success.
|
|
67
|
-
if (promiseResult.every(({
|
|
68
|
-
status
|
|
69
|
-
}) => status === 'fulfilled')) {
|
|
70
|
-
let successMessage;
|
|
71
|
-
if (promiseResult.length === 1) {
|
|
72
|
-
successMessage = sprintf( /* translators: The posts's title. */
|
|
73
|
-
__('"%s" moved to the Trash.'), decodeEntities(posts[0].title.rendered));
|
|
74
|
-
} else {
|
|
75
|
-
successMessage = __('Pages moved to the Trash.');
|
|
76
|
-
}
|
|
77
|
-
createSuccessNotice(successMessage, {
|
|
78
|
-
type: 'snackbar',
|
|
79
|
-
id: 'edit-site-page-trashed'
|
|
80
|
-
});
|
|
81
|
-
} else {
|
|
82
|
-
// If there was at lease one failure.
|
|
83
|
-
let errorMessage;
|
|
84
|
-
// If we were trying to move a single post to the trash.
|
|
85
|
-
if (promiseResult.length === 1) {
|
|
86
|
-
if (promiseResult[0].reason?.message) {
|
|
87
|
-
errorMessage = promiseResult[0].reason.message;
|
|
88
|
-
} else {
|
|
89
|
-
errorMessage = __('An error occurred while moving the post to the trash.');
|
|
90
|
-
}
|
|
91
|
-
// If we were trying to move multiple posts to the trash
|
|
92
|
-
} else {
|
|
93
|
-
const errorMessages = new Set();
|
|
94
|
-
const failedPromises = promiseResult.filter(({
|
|
95
|
-
status
|
|
96
|
-
}) => status === 'rejected');
|
|
97
|
-
for (const failedPromise of failedPromises) {
|
|
98
|
-
if (failedPromise.reason?.message) {
|
|
99
|
-
errorMessages.add(failedPromise.reason.message);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
if (errorMessages.size === 0) {
|
|
103
|
-
errorMessage = __('An error occurred while moving the posts to the trash.');
|
|
104
|
-
} else if (errorMessages.size === 1) {
|
|
105
|
-
errorMessage = sprintf( /* translators: %s: an error message */
|
|
106
|
-
__('An error occurred while moving the posts to the trash: %s'), [...errorMessages][0]);
|
|
107
|
-
} else {
|
|
108
|
-
errorMessage = sprintf( /* translators: %s: a list of comma separated error messages */
|
|
109
|
-
__('Some errors occurred while moving the pages to the trash: %s'), [...errorMessages].join(','));
|
|
110
|
-
}
|
|
111
|
-
createErrorNotice(errorMessage, {
|
|
112
|
-
type: 'snackbar'
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
if (onPerform) {
|
|
117
|
-
onPerform();
|
|
118
|
-
}
|
|
119
|
-
closeModal();
|
|
120
|
-
}
|
|
121
|
-
}, __('Delete'))));
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
export function usePermanentlyDeletePostAction() {
|
|
125
|
-
const {
|
|
126
|
-
createSuccessNotice,
|
|
127
|
-
createErrorNotice
|
|
128
|
-
} = useDispatch(noticesStore);
|
|
129
|
-
const {
|
|
130
|
-
deleteEntityRecord
|
|
131
|
-
} = useDispatch(coreStore);
|
|
132
|
-
return useMemo(() => ({
|
|
133
|
-
id: 'permanently-delete',
|
|
134
|
-
label: __('Permanently delete'),
|
|
135
|
-
isPrimary: true,
|
|
136
|
-
icon: trash,
|
|
137
|
-
supportsBulk: true,
|
|
138
|
-
isEligible({
|
|
139
|
-
status
|
|
140
|
-
}) {
|
|
141
|
-
return status === 'trash';
|
|
142
|
-
},
|
|
143
|
-
async callback(posts) {
|
|
144
|
-
const promiseResult = await Promise.allSettled(posts.map(post => {
|
|
145
|
-
return deleteEntityRecord('postType', post.type, post.id, {
|
|
146
|
-
force: true
|
|
147
|
-
}, {
|
|
148
|
-
throwOnError: true
|
|
149
|
-
});
|
|
150
|
-
}));
|
|
151
|
-
// If all the promises were fulfilled with success.
|
|
152
|
-
if (promiseResult.every(({
|
|
153
|
-
status
|
|
154
|
-
}) => status === 'fulfilled')) {
|
|
155
|
-
let successMessage;
|
|
156
|
-
if (promiseResult.length === 1) {
|
|
157
|
-
successMessage = sprintf( /* translators: The posts's title. */
|
|
158
|
-
__('"%s" permanently deleted.'), decodeEntities(posts[0].title.rendered));
|
|
159
|
-
} else {
|
|
160
|
-
successMessage = __('The posts were permanently deleted.');
|
|
161
|
-
}
|
|
162
|
-
createSuccessNotice(successMessage, {
|
|
163
|
-
type: 'snackbar',
|
|
164
|
-
id: 'edit-site-post-permanently-deleted'
|
|
165
|
-
});
|
|
166
|
-
} else {
|
|
167
|
-
// If there was at lease one failure.
|
|
168
|
-
let errorMessage;
|
|
169
|
-
// If we were trying to permanently delete a single post.
|
|
170
|
-
if (promiseResult.length === 1) {
|
|
171
|
-
if (promiseResult[0].reason?.message) {
|
|
172
|
-
errorMessage = promiseResult[0].reason.message;
|
|
173
|
-
} else {
|
|
174
|
-
errorMessage = __('An error occurred while permanently deleting the post.');
|
|
175
|
-
}
|
|
176
|
-
// If we were trying to permanently delete multiple posts
|
|
177
|
-
} else {
|
|
178
|
-
const errorMessages = new Set();
|
|
179
|
-
const failedPromises = promiseResult.filter(({
|
|
180
|
-
status
|
|
181
|
-
}) => status === 'rejected');
|
|
182
|
-
for (const failedPromise of failedPromises) {
|
|
183
|
-
if (failedPromise.reason?.message) {
|
|
184
|
-
errorMessages.add(failedPromise.reason.message);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
if (errorMessages.size === 0) {
|
|
188
|
-
errorMessage = __('An error occurred while permanently deleting the posts.');
|
|
189
|
-
} else if (errorMessages.size === 1) {
|
|
190
|
-
errorMessage = sprintf( /* translators: %s: an error message */
|
|
191
|
-
__('An error occurred while permanently deleting the posts: %s'), [...errorMessages][0]);
|
|
192
|
-
} else {
|
|
193
|
-
errorMessage = sprintf( /* translators: %s: a list of comma separated error messages */
|
|
194
|
-
__('Some errors occurred while permanently deleting the posts: %s'), [...errorMessages].join(','));
|
|
195
|
-
}
|
|
196
|
-
createErrorNotice(errorMessage, {
|
|
197
|
-
type: 'snackbar'
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
}), [createSuccessNotice, createErrorNotice, deleteEntityRecord]);
|
|
203
|
-
}
|
|
204
|
-
export function useRestorePostAction() {
|
|
205
|
-
const {
|
|
206
|
-
createSuccessNotice,
|
|
207
|
-
createErrorNotice
|
|
208
|
-
} = useDispatch(noticesStore);
|
|
209
|
-
const {
|
|
210
|
-
editEntityRecord,
|
|
211
|
-
saveEditedEntityRecord
|
|
212
|
-
} = useDispatch(coreStore);
|
|
213
|
-
return useMemo(() => ({
|
|
214
|
-
id: 'restore',
|
|
215
|
-
label: __('Restore'),
|
|
216
|
-
isPrimary: true,
|
|
217
|
-
icon: backup,
|
|
218
|
-
supportsBulk: true,
|
|
219
|
-
isEligible({
|
|
220
|
-
status
|
|
221
|
-
}) {
|
|
222
|
-
return status === 'trash';
|
|
223
|
-
},
|
|
224
|
-
async callback(posts) {
|
|
225
|
-
try {
|
|
226
|
-
for (const post of posts) {
|
|
227
|
-
await editEntityRecord('postType', post.type, post.id, {
|
|
228
|
-
status: 'draft'
|
|
229
|
-
});
|
|
230
|
-
await saveEditedEntityRecord('postType', post.type, post.id, {
|
|
231
|
-
throwOnError: true
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
createSuccessNotice(posts.length > 1 ? sprintf( /* translators: The number of posts. */
|
|
235
|
-
__('%d posts have been restored.'), posts.length) : sprintf( /* translators: The number of posts. */
|
|
236
|
-
__('"%s" has been restored.'), decodeEntities(posts[0].title.rendered)), {
|
|
237
|
-
type: 'snackbar',
|
|
238
|
-
id: 'edit-site-post-restored'
|
|
239
|
-
});
|
|
240
|
-
} catch (error) {
|
|
241
|
-
let errorMessage;
|
|
242
|
-
if (error.message && error.code !== 'unknown_error' && error.message) {
|
|
243
|
-
errorMessage = error.message;
|
|
244
|
-
} else if (posts.length > 1) {
|
|
245
|
-
errorMessage = __('An error occurred while restoring the posts.');
|
|
246
|
-
} else {
|
|
247
|
-
errorMessage = __('An error occurred while restoring the post.');
|
|
248
|
-
}
|
|
249
|
-
createErrorNotice(errorMessage, {
|
|
250
|
-
type: 'snackbar'
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}), [createSuccessNotice, createErrorNotice, editEntityRecord, saveEditedEntityRecord]);
|
|
255
|
-
}
|
|
256
|
-
export const viewPostAction = {
|
|
257
|
-
id: 'view-post',
|
|
258
|
-
label: __('View'),
|
|
259
|
-
isPrimary: true,
|
|
260
|
-
icon: external,
|
|
261
|
-
isEligible(post) {
|
|
262
|
-
return post.status !== 'trash';
|
|
263
|
-
},
|
|
264
|
-
callback(posts) {
|
|
265
|
-
const post = posts[0];
|
|
266
|
-
window.open(post.link, '_blank');
|
|
267
|
-
}
|
|
268
|
-
};
|
|
269
|
-
export function useEditPostAction() {
|
|
270
|
-
const history = useHistory();
|
|
271
|
-
return useMemo(() => ({
|
|
272
|
-
id: 'edit-post',
|
|
273
|
-
label: __('Edit'),
|
|
274
|
-
isEligible({
|
|
275
|
-
status
|
|
276
|
-
}) {
|
|
277
|
-
return status !== 'trash';
|
|
278
|
-
},
|
|
279
|
-
callback(posts) {
|
|
280
|
-
const post = posts[0];
|
|
281
|
-
history.push({
|
|
282
|
-
postId: post.id,
|
|
283
|
-
postType: post.type,
|
|
284
|
-
canvas: 'edit'
|
|
285
|
-
});
|
|
286
|
-
}
|
|
287
|
-
}), [history]);
|
|
288
|
-
}
|
|
289
|
-
export const postRevisionsAction = {
|
|
290
|
-
id: 'view-post-revisions',
|
|
291
|
-
label: __('View revisions'),
|
|
292
|
-
isPrimary: false,
|
|
293
|
-
isEligible: post => {
|
|
294
|
-
var _post$_links$predeces, _post$_links$version;
|
|
295
|
-
if (post.status === 'trash') {
|
|
296
|
-
return false;
|
|
297
|
-
}
|
|
298
|
-
const lastRevisionId = (_post$_links$predeces = post?._links?.['predecessor-version']?.[0]?.id) !== null && _post$_links$predeces !== void 0 ? _post$_links$predeces : null;
|
|
299
|
-
const revisionsCount = (_post$_links$version = post?._links?.['version-history']?.[0]?.count) !== null && _post$_links$version !== void 0 ? _post$_links$version : 0;
|
|
300
|
-
return lastRevisionId && revisionsCount > 1;
|
|
301
|
-
},
|
|
302
|
-
callback(posts) {
|
|
303
|
-
const post = posts[0];
|
|
304
|
-
const href = addQueryArgs('revision.php', {
|
|
305
|
-
revision: post?._links?.['predecessor-version']?.[0]?.id
|
|
306
|
-
});
|
|
307
|
-
document.location.href = href;
|
|
308
|
-
}
|
|
309
|
-
};
|
|
310
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["external","trash","backup","addQueryArgs","useDispatch","decodeEntities","store","coreStore","__","sprintf","noticesStore","useMemo","privateApis","routerPrivateApis","Button","__experimentalText","Text","__experimentalHStack","HStack","__experimentalVStack","VStack","unlock","useHistory","trashPostAction","id","label","isPrimary","icon","isEligible","status","supportsBulk","hideModalHeader","RenderModal","items","posts","closeModal","onPerform","createSuccessNotice","createErrorNotice","deleteEntityRecord","createElement","spacing","length","title","rendered","justify","variant","onClick","promiseResult","Promise","allSettled","map","post","type","throwOnError","every","successMessage","errorMessage","reason","message","errorMessages","Set","failedPromises","filter","failedPromise","add","size","join","usePermanentlyDeletePostAction","callback","force","useRestorePostAction","editEntityRecord","saveEditedEntityRecord","error","code","viewPostAction","window","open","link","useEditPostAction","history","push","postId","postType","canvas","postRevisionsAction","_post$_links$predeces","_post$_links$version","lastRevisionId","_links","revisionsCount","count","href","revision","document","location"],"sources":["@wordpress/edit-site/src/components/actions/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { external, trash, backup } from '@wordpress/icons';\nimport { addQueryArgs } from '@wordpress/url';\nimport { useDispatch } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { useMemo } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport {\n\tButton,\n\t__experimentalText as Text,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nexport const trashPostAction = {\n\tid: 'move-to-trash',\n\tlabel: __( 'Move to Trash' ),\n\tisPrimary: true,\n\ticon: trash,\n\tisEligible( { status } ) {\n\t\treturn status !== 'trash';\n\t},\n\tsupportsBulk: true,\n\thideModalHeader: true,\n\tRenderModal: ( { items: posts, closeModal, onPerform } ) => {\n\t\tconst { createSuccessNotice, createErrorNotice } =\n\t\t\tuseDispatch( noticesStore );\n\t\tconst { deleteEntityRecord } = useDispatch( coreStore );\n\t\treturn (\n\t\t\t<VStack spacing=\"5\">\n\t\t\t\t<Text>\n\t\t\t\t\t{ posts.length === 1\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: The page's title.\n\t\t\t\t\t\t\t\t__( 'Are you sure you want to delete \"%s\"?' ),\n\t\t\t\t\t\t\t\tdecodeEntities( posts[ 0 ].title.rendered )\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t// translators: %d: The number of pages (2 or more).\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Are you sure you want to delete %d pages?'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tposts.length\n\t\t\t\t\t\t ) }\n\t\t\t\t</Text>\n\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t<Button variant=\"tertiary\" onClick={ closeModal }>\n\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tonClick={ async () => {\n\t\t\t\t\t\t\tconst promiseResult = await Promise.allSettled(\n\t\t\t\t\t\t\t\tposts.map( ( post ) => {\n\t\t\t\t\t\t\t\t\treturn deleteEntityRecord(\n\t\t\t\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\t\t\t\tpost.type,\n\t\t\t\t\t\t\t\t\t\tpost.id,\n\t\t\t\t\t\t\t\t\t\t{},\n\t\t\t\t\t\t\t\t\t\t{ throwOnError: true }\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// If all the promises were fulfilled with success.\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tpromiseResult.every(\n\t\t\t\t\t\t\t\t\t( { status } ) => status === 'fulfilled'\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\tlet successMessage;\n\t\t\t\t\t\t\t\tif ( promiseResult.length === 1 ) {\n\t\t\t\t\t\t\t\t\tsuccessMessage = sprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: The posts's title. */\n\t\t\t\t\t\t\t\t\t\t__( '\"%s\" moved to the Trash.' ),\n\t\t\t\t\t\t\t\t\t\tdecodeEntities(\n\t\t\t\t\t\t\t\t\t\t\tposts[ 0 ].title.rendered\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} else {\n\t\t\t\t\t\t\t\t\tsuccessMessage = __(\n\t\t\t\t\t\t\t\t\t\t'Pages moved to the Trash.'\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\tcreateSuccessNotice( successMessage, {\n\t\t\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\t\t\tid: 'edit-site-page-trashed',\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// If there was at lease one failure.\n\t\t\t\t\t\t\t\tlet errorMessage;\n\t\t\t\t\t\t\t\t// If we were trying to move a single post to the trash.\n\t\t\t\t\t\t\t\tif ( promiseResult.length === 1 ) {\n\t\t\t\t\t\t\t\t\tif ( promiseResult[ 0 ].reason?.message ) {\n\t\t\t\t\t\t\t\t\t\terrorMessage =\n\t\t\t\t\t\t\t\t\t\t\tpromiseResult[ 0 ].reason.message;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\terrorMessage = __(\n\t\t\t\t\t\t\t\t\t\t\t'An error occurred while moving the post to the trash.'\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\t// If we were trying to move multiple posts to the trash\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tconst errorMessages = new Set();\n\t\t\t\t\t\t\t\t\tconst failedPromises = promiseResult.filter(\n\t\t\t\t\t\t\t\t\t\t( { status } ) => status === 'rejected'\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\tfor ( const failedPromise of failedPromises ) {\n\t\t\t\t\t\t\t\t\t\tif ( failedPromise.reason?.message ) {\n\t\t\t\t\t\t\t\t\t\t\terrorMessages.add(\n\t\t\t\t\t\t\t\t\t\t\t\tfailedPromise.reason.message\n\t\t\t\t\t\t\t\t\t\t\t);\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\tif ( errorMessages.size === 0 ) {\n\t\t\t\t\t\t\t\t\t\terrorMessage = __(\n\t\t\t\t\t\t\t\t\t\t\t'An error occurred while moving the posts to the trash.'\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t} else if ( errorMessages.size === 1 ) {\n\t\t\t\t\t\t\t\t\t\terrorMessage = sprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: an error message */\n\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t'An error occurred while moving the posts to the trash: %s'\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t[ ...errorMessages ][ 0 ]\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\terrorMessage = sprintf(\n\t\t\t\t\t\t\t\t\t\t\t/* translators: %s: a list of comma separated error messages */\n\t\t\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t\t\t'Some errors occurred while moving the pages to the trash: %s'\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t[ ...errorMessages ].join( ',' )\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\tcreateErrorNotice( errorMessage, {\n\t\t\t\t\t\t\t\t\t\ttype: 'snackbar',\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\tif ( onPerform ) {\n\t\t\t\t\t\t\t\tonPerform();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcloseModal();\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Delete' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t</VStack>\n\t\t);\n\t},\n};\n\nexport function usePermanentlyDeletePostAction() {\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst { deleteEntityRecord } = useDispatch( coreStore );\n\n\treturn useMemo(\n\t\t() => ( {\n\t\t\tid: 'permanently-delete',\n\t\t\tlabel: __( 'Permanently delete' ),\n\t\t\tisPrimary: true,\n\t\t\ticon: trash,\n\t\t\tsupportsBulk: true,\n\t\t\tisEligible( { status } ) {\n\t\t\t\treturn status === 'trash';\n\t\t\t},\n\t\t\tasync callback( posts ) {\n\t\t\t\tconst promiseResult = await Promise.allSettled(\n\t\t\t\t\tposts.map( ( post ) => {\n\t\t\t\t\t\treturn deleteEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\tpost.type,\n\t\t\t\t\t\t\tpost.id,\n\t\t\t\t\t\t\t{ force: true },\n\t\t\t\t\t\t\t{ throwOnError: true }\n\t\t\t\t\t\t);\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t\t// If all the promises were fulfilled with success.\n\t\t\t\tif (\n\t\t\t\t\tpromiseResult.every(\n\t\t\t\t\t\t( { status } ) => status === 'fulfilled'\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tlet successMessage;\n\t\t\t\t\tif ( promiseResult.length === 1 ) {\n\t\t\t\t\t\tsuccessMessage = sprintf(\n\t\t\t\t\t\t\t/* translators: The posts's title. */\n\t\t\t\t\t\t\t__( '\"%s\" permanently deleted.' ),\n\t\t\t\t\t\t\tdecodeEntities( posts[ 0 ].title.rendered )\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsuccessMessage = __(\n\t\t\t\t\t\t\t'The posts were permanently deleted.'\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tcreateSuccessNotice( successMessage, {\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\tid: 'edit-site-post-permanently-deleted',\n\t\t\t\t\t} );\n\t\t\t\t} else {\n\t\t\t\t\t// If there was at lease one failure.\n\t\t\t\t\tlet errorMessage;\n\t\t\t\t\t// If we were trying to permanently delete a single post.\n\t\t\t\t\tif ( promiseResult.length === 1 ) {\n\t\t\t\t\t\tif ( promiseResult[ 0 ].reason?.message ) {\n\t\t\t\t\t\t\terrorMessage = promiseResult[ 0 ].reason.message;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\terrorMessage = __(\n\t\t\t\t\t\t\t\t'An error occurred while permanently deleting the post.'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// If we were trying to permanently delete multiple posts\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst errorMessages = new Set();\n\t\t\t\t\t\tconst failedPromises = promiseResult.filter(\n\t\t\t\t\t\t\t( { status } ) => status === 'rejected'\n\t\t\t\t\t\t);\n\t\t\t\t\t\tfor ( const failedPromise of failedPromises ) {\n\t\t\t\t\t\t\tif ( failedPromise.reason?.message ) {\n\t\t\t\t\t\t\t\terrorMessages.add(\n\t\t\t\t\t\t\t\t\tfailedPromise.reason.message\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\tif ( errorMessages.size === 0 ) {\n\t\t\t\t\t\t\terrorMessage = __(\n\t\t\t\t\t\t\t\t'An error occurred while permanently deleting the posts.'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else if ( errorMessages.size === 1 ) {\n\t\t\t\t\t\t\terrorMessage = sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: an error message */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'An error occurred while permanently deleting the posts: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ][ 0 ]\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\terrorMessage = sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: a list of comma separated error messages */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Some errors occurred while permanently deleting the posts: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ].join( ',' )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcreateErrorNotice( errorMessage, {\n\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t} ),\n\t\t[ createSuccessNotice, createErrorNotice, deleteEntityRecord ]\n\t);\n}\n\nexport function useRestorePostAction() {\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\tconst { editEntityRecord, saveEditedEntityRecord } =\n\t\tuseDispatch( coreStore );\n\n\treturn useMemo(\n\t\t() => ( {\n\t\t\tid: 'restore',\n\t\t\tlabel: __( 'Restore' ),\n\t\t\tisPrimary: true,\n\t\t\ticon: backup,\n\t\t\tsupportsBulk: true,\n\t\t\tisEligible( { status } ) {\n\t\t\t\treturn status === 'trash';\n\t\t\t},\n\t\t\tasync callback( posts ) {\n\t\t\t\ttry {\n\t\t\t\t\tfor ( const post of posts ) {\n\t\t\t\t\t\tawait editEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\tpost.type,\n\t\t\t\t\t\t\tpost.id,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tstatus: 'draft',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t\tawait saveEditedEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\tpost.type,\n\t\t\t\t\t\t\tpost.id,\n\t\t\t\t\t\t\t{ throwOnError: true }\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\tposts.length > 1\n\t\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t\t/* translators: The number of posts. */\n\t\t\t\t\t\t\t\t\t__( '%d posts have been restored.' ),\n\t\t\t\t\t\t\t\t\tposts.length\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t/* translators: The number of posts. */\n\t\t\t\t\t\t\t\t\t__( '\"%s\" has been restored.' ),\n\t\t\t\t\t\t\t\t\tdecodeEntities( posts[ 0 ].title.rendered )\n\t\t\t\t\t\t\t ),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\tid: 'edit-site-post-restored',\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t} catch ( error ) {\n\t\t\t\t\tlet errorMessage;\n\t\t\t\t\tif (\n\t\t\t\t\t\terror.message &&\n\t\t\t\t\t\terror.code !== 'unknown_error' &&\n\t\t\t\t\t\terror.message\n\t\t\t\t\t) {\n\t\t\t\t\t\terrorMessage = error.message;\n\t\t\t\t\t} else if ( posts.length > 1 ) {\n\t\t\t\t\t\terrorMessage = __(\n\t\t\t\t\t\t\t'An error occurred while restoring the posts.'\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\terrorMessage = __(\n\t\t\t\t\t\t\t'An error occurred while restoring the post.'\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tcreateErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t\t\t}\n\t\t\t},\n\t\t} ),\n\t\t[\n\t\t\tcreateSuccessNotice,\n\t\t\tcreateErrorNotice,\n\t\t\teditEntityRecord,\n\t\t\tsaveEditedEntityRecord,\n\t\t]\n\t);\n}\n\nexport const viewPostAction = {\n\tid: 'view-post',\n\tlabel: __( 'View' ),\n\tisPrimary: true,\n\ticon: external,\n\tisEligible( post ) {\n\t\treturn post.status !== 'trash';\n\t},\n\tcallback( posts ) {\n\t\tconst post = posts[ 0 ];\n\t\twindow.open( post.link, '_blank' );\n\t},\n};\n\nexport function useEditPostAction() {\n\tconst history = useHistory();\n\treturn useMemo(\n\t\t() => ( {\n\t\t\tid: 'edit-post',\n\t\t\tlabel: __( 'Edit' ),\n\t\t\tisEligible( { status } ) {\n\t\t\t\treturn status !== 'trash';\n\t\t\t},\n\t\t\tcallback( posts ) {\n\t\t\t\tconst post = posts[ 0 ];\n\t\t\t\thistory.push( {\n\t\t\t\t\tpostId: post.id,\n\t\t\t\t\tpostType: post.type,\n\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t} );\n\t\t\t},\n\t\t} ),\n\t\t[ history ]\n\t);\n}\nexport const postRevisionsAction = {\n\tid: 'view-post-revisions',\n\tlabel: __( 'View revisions' ),\n\tisPrimary: false,\n\tisEligible: ( post ) => {\n\t\tif ( post.status === 'trash' ) {\n\t\t\treturn false;\n\t\t}\n\t\tconst lastRevisionId =\n\t\t\tpost?._links?.[ 'predecessor-version' ]?.[ 0 ]?.id ?? null;\n\t\tconst revisionsCount =\n\t\t\tpost?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0;\n\t\treturn lastRevisionId && revisionsCount > 1;\n\t},\n\tcallback( posts ) {\n\t\tconst post = posts[ 0 ];\n\t\tconst href = addQueryArgs( 'revision.php', {\n\t\t\trevision: post?._links?.[ 'predecessor-version' ]?.[ 0 ]?.id,\n\t\t} );\n\t\tdocument.location.href = href;\n\t},\n};\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,EAAEC,KAAK,EAAEC,MAAM,QAAQ,kBAAkB;AAC1D,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASH,KAAK,IAAII,YAAY,QAAQ,oBAAoB;AAC1D,SAASC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","privateApis","blockEditorPrivateApis","mergeBaseAndUserConfigs","unlock","getFamilyPreviewStyle","getFontFamilies","GlobalStylesContext","PreviewTypography","fontSize","variation","base","config","bodyFontFamilies","headingFontFamilies","bodyPreviewStyle","headingPreviewStyle","createElement","div","className","animate","scale","opacity","initial","transition","delay","type","style"],"sources":["@wordpress/edit-site/src/components/global-styles/preview-typography.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\nimport { __unstableMotion as motion } from '@wordpress/components';\nimport { _x } from '@wordpress/i18n';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { mergeBaseAndUserConfigs } from './global-styles-provider';\nimport { unlock } from '../../lock-unlock';\nimport { getFamilyPreviewStyle } from './font-library-modal/utils/preview-styles';\nimport { getFontFamilies } from './utils';\n\nconst { GlobalStylesContext } = unlock( blockEditorPrivateApis );\n\nexport default function PreviewTypography( { fontSize, variation } ) {\n\tconst { base } = useContext( GlobalStylesContext );\n\tlet config = base;\n\tif ( variation ) {\n\t\tconfig = mergeBaseAndUserConfigs( base, variation );\n\t}\n\tconst [ bodyFontFamilies, headingFontFamilies ] = getFontFamilies( config );\n\tconst bodyPreviewStyle = bodyFontFamilies\n\t\t? getFamilyPreviewStyle( bodyFontFamilies )\n\t\t: {};\n\tconst headingPreviewStyle = headingFontFamilies\n\t\t? getFamilyPreviewStyle( headingFontFamilies )\n\t\t: {};\n\n\tif ( fontSize ) {\n\t\tbodyPreviewStyle.fontSize = fontSize;\n\t\theadingPreviewStyle.fontSize = fontSize;\n\t}\n\n\treturn (\n\t\t<motion.div\n\t\t\tclassName=\"edit-site-global-styles_preview-typography\"\n\t\t\tanimate={ {\n\t\t\t\tscale: 1,\n\t\t\t\topacity: 1,\n\t\t\t} }\n\t\t\tinitial={ {\n\t\t\t\tscale: 0.1,\n\t\t\t\topacity: 0,\n\t\t\t} }\n\t\t\ttransition={ {\n\t\t\t\tdelay: 0.3,\n\t\t\t\ttype: 'tween',\n\t\t\t} }\n\t\t>\n\t\t\t<span style={ headingPreviewStyle }>\n\t\t\t\t{ _x( 'A', 'Uppercase letter A' ) }\n\t\t\t</span>\n\t\t\t<span style={ bodyPreviewStyle }>\n\t\t\t\t{ _x( 'a', 'Lowercase letter A' ) }\n\t\t\t</span>\n\t\t</motion.div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,gBAAgB,IAAIC,MAAM,QAAQ,uBAAuB;AAClE,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAE/E;AACA;AACA;AACA,SAASC,uBAAuB,QAAQ,0BAA0B;AAClE,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,qBAAqB,QAAQ,2CAA2C;AACjF,SAASC,eAAe,QAAQ,SAAS;AAEzC,MAAM;EAAEC;AAAoB,CAAC,GAAGH,MAAM,CAAEF,sBAAuB,CAAC;AAEhE,eAAe,SAASM,iBAAiBA,CAAE;EAAEC,QAAQ;EAAEC;AAAU,CAAC,EAAG;EACpE,MAAM;IAAEC;EAAK,CAAC,GAAGd,UAAU,CAAEU,mBAAoB,CAAC;EAClD,IAAIK,MAAM,GAAGD,IAAI;EACjB,IAAKD,SAAS,EAAG;IAChBE,MAAM,GAAGT,uBAAuB,CAAEQ,IAAI,EAAED,SAAU,CAAC;EACpD;EACA,MAAM,CAAEG,gBAAgB,EAAEC,mBAAmB,CAAE,GAAGR,eAAe,CAAEM,MAAO,CAAC;EAC3E,MAAMG,gBAAgB,GAAGF,gBAAgB,GACtCR,qBAAqB,CAAEQ,gBAAiB,CAAC,GACzC,CAAC,CAAC;EACL,MAAMG,mBAAmB,GAAGF,mBAAmB,GAC5CT,qBAAqB,CAAES,mBAAoB,CAAC,GAC5C,CAAC,CAAC;EAEL,IAAKL,QAAQ,EAAG;IACfM,gBAAgB,CAACN,QAAQ,GAAGA,QAAQ;IACpCO,mBAAmB,CAACP,QAAQ,GAAGA,QAAQ;EACxC;EAEA,OACCQ,aAAA,CAAClB,MAAM,CAACmB,GAAG;IACVC,SAAS,EAAC,4CAA4C;IACtDC,OAAO,EAAG;MACTC,KAAK,EAAE,CAAC;MACRC,OAAO,EAAE;IACV,CAAG;IACHC,OAAO,EAAG;MACTF,KAAK,EAAE,GAAG;MACVC,OAAO,EAAE;IACV,CAAG;IACHE,UAAU,EAAG;MACZC,KAAK,EAAE,GAAG;MACVC,IAAI,EAAE;IACP;EAAG,GAEHT,aAAA;IAAMU,KAAK,EAAGX;EAAqB,GAChChB,EAAE,CAAE,GAAG,EAAE,oBAAqB,CAC3B,CAAC,EACPiB,aAAA;IAAMU,KAAK,EAAGZ;EAAkB,GAC7Bf,EAAE,CAAE,GAAG,EAAE,oBAAqB,CAC3B,CACK,CAAC;AAEf"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* External dependencies
|
|
4
|
-
*/
|
|
5
|
-
import classnames from 'classnames';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* WordPress dependencies
|
|
9
|
-
*/
|
|
10
|
-
import { Icon } from '@wordpress/components';
|
|
11
|
-
export default function SidebarCard({
|
|
12
|
-
className,
|
|
13
|
-
title,
|
|
14
|
-
icon,
|
|
15
|
-
description,
|
|
16
|
-
actions,
|
|
17
|
-
children
|
|
18
|
-
}) {
|
|
19
|
-
return createElement("div", {
|
|
20
|
-
className: classnames('edit-site-sidebar-card', className)
|
|
21
|
-
}, createElement(Icon, {
|
|
22
|
-
className: "edit-site-sidebar-card__icon",
|
|
23
|
-
icon: icon
|
|
24
|
-
}), createElement("div", {
|
|
25
|
-
className: "edit-site-sidebar-card__content"
|
|
26
|
-
}, createElement("div", {
|
|
27
|
-
className: "edit-site-sidebar-card__header"
|
|
28
|
-
}, createElement("h2", {
|
|
29
|
-
className: "edit-site-sidebar-card__title"
|
|
30
|
-
}, title), actions), createElement("div", {
|
|
31
|
-
className: "edit-site-sidebar-card__description"
|
|
32
|
-
}, description), children));
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["classnames","Icon","SidebarCard","className","title","icon","description","actions","children","createElement"],"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/sidebar-card/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Icon } from '@wordpress/components';\n\nexport default function SidebarCard( {\n\tclassName,\n\ttitle,\n\ticon,\n\tdescription,\n\tactions,\n\tchildren,\n} ) {\n\treturn (\n\t\t<div className={ classnames( 'edit-site-sidebar-card', className ) }>\n\t\t\t<Icon className=\"edit-site-sidebar-card__icon\" icon={ icon } />\n\t\t\t<div className=\"edit-site-sidebar-card__content\">\n\t\t\t\t<div className=\"edit-site-sidebar-card__header\">\n\t\t\t\t\t<h2 className=\"edit-site-sidebar-card__title\">{ title }</h2>\n\t\t\t\t\t{ actions }\n\t\t\t\t</div>\n\t\t\t\t<div className=\"edit-site-sidebar-card__description\">\n\t\t\t\t\t{ description }\n\t\t\t\t</div>\n\t\t\t\t{ children }\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,IAAI,QAAQ,uBAAuB;AAE5C,eAAe,SAASC,WAAWA,CAAE;EACpCC,SAAS;EACTC,KAAK;EACLC,IAAI;EACJC,WAAW;EACXC,OAAO;EACPC;AACD,CAAC,EAAG;EACH,OACCC,aAAA;IAAKN,SAAS,EAAGH,UAAU,CAAE,wBAAwB,EAAEG,SAAU;EAAG,GACnEM,aAAA,CAACR,IAAI;IAACE,SAAS,EAAC,8BAA8B;IAACE,IAAI,EAAGA;EAAM,CAAE,CAAC,EAC/DI,aAAA;IAAKN,SAAS,EAAC;EAAiC,GAC/CM,aAAA;IAAKN,SAAS,EAAC;EAAgC,GAC9CM,aAAA;IAAIN,SAAS,EAAC;EAA+B,GAAGC,KAAW,CAAC,EAC1DG,OACE,CAAC,EACNE,aAAA;IAAKN,SAAS,EAAC;EAAqC,GACjDG,WACE,CAAC,EACJE,QACE,CACD,CAAC;AAER"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { useDispatch } from '@wordpress/data';
|
|
6
|
-
import { __ } from '@wordpress/i18n';
|
|
7
|
-
import { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';
|
|
8
|
-
import { moreVertical } from '@wordpress/icons';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Internal dependencies
|
|
12
|
-
*/
|
|
13
|
-
import { store as editSiteStore } from '../../../store';
|
|
14
|
-
import isTemplateRevertable from '../../../utils/is-template-revertable';
|
|
15
|
-
export default function Actions({
|
|
16
|
-
template
|
|
17
|
-
}) {
|
|
18
|
-
const {
|
|
19
|
-
revertTemplate
|
|
20
|
-
} = useDispatch(editSiteStore);
|
|
21
|
-
const isRevertable = isTemplateRevertable(template);
|
|
22
|
-
if (!isRevertable) {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
return createElement(DropdownMenu, {
|
|
26
|
-
icon: moreVertical,
|
|
27
|
-
label: __('Actions'),
|
|
28
|
-
className: "edit-site-template-card__actions",
|
|
29
|
-
toggleProps: {
|
|
30
|
-
isSmall: true
|
|
31
|
-
}
|
|
32
|
-
}, ({
|
|
33
|
-
onClose
|
|
34
|
-
}) => createElement(MenuGroup, null, isRevertable && createElement(MenuItem, {
|
|
35
|
-
info: __('Use the template as supplied by the theme.'),
|
|
36
|
-
onClick: () => {
|
|
37
|
-
revertTemplate(template);
|
|
38
|
-
onClose();
|
|
39
|
-
}
|
|
40
|
-
}, __('Clear customizations'))));
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=template-actions.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useDispatch","__","DropdownMenu","MenuGroup","MenuItem","moreVertical","store","editSiteStore","isTemplateRevertable","Actions","template","revertTemplate","isRevertable","createElement","icon","label","className","toggleProps","isSmall","onClose","info","onClick"],"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/template-panel/template-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { DropdownMenu, MenuGroup, MenuItem } from '@wordpress/components';\nimport { moreVertical } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../../store';\nimport isTemplateRevertable from '../../../utils/is-template-revertable';\n\nexport default function Actions( { template } ) {\n\tconst { revertTemplate } = useDispatch( editSiteStore );\n\tconst isRevertable = isTemplateRevertable( template );\n\n\tif ( ! isRevertable ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\ticon={ moreVertical }\n\t\t\tlabel={ __( 'Actions' ) }\n\t\t\tclassName=\"edit-site-template-card__actions\"\n\t\t\ttoggleProps={ { isSmall: true } }\n\t\t>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<MenuGroup>\n\t\t\t\t\t{ isRevertable && (\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tinfo={ __(\n\t\t\t\t\t\t\t\t'Use the template as supplied by the theme.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\trevertTemplate( template );\n\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Clear customizations' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t) }\n\t\t\t\t</MenuGroup>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,YAAY,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,uBAAuB;AACzE,SAASC,YAAY,QAAQ,kBAAkB;;AAE/C;AACA;AACA;AACA,SAASC,KAAK,IAAIC,aAAa,QAAQ,gBAAgB;AACvD,OAAOC,oBAAoB,MAAM,uCAAuC;AAExE,eAAe,SAASC,OAAOA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAC/C,MAAM;IAAEC;EAAe,CAAC,GAAGX,WAAW,CAAEO,aAAc,CAAC;EACvD,MAAMK,YAAY,GAAGJ,oBAAoB,CAAEE,QAAS,CAAC;EAErD,IAAK,CAAEE,YAAY,EAAG;IACrB,OAAO,IAAI;EACZ;EAEA,OACCC,aAAA,CAACX,YAAY;IACZY,IAAI,EAAGT,YAAc;IACrBU,KAAK,EAAGd,EAAE,CAAE,SAAU,CAAG;IACzBe,SAAS,EAAC,kCAAkC;IAC5CC,WAAW,EAAG;MAAEC,OAAO,EAAE;IAAK;EAAG,GAE/B,CAAE;IAAEC;EAAQ,CAAC,KACdN,aAAA,CAACV,SAAS,QACPS,YAAY,IACbC,aAAA,CAACT,QAAQ;IACRgB,IAAI,EAAGnB,EAAE,CACR,4CACD,CAAG;IACHoB,OAAO,EAAGA,CAAA,KAAM;MACfV,cAAc,CAAED,QAAS,CAAC;MAC1BS,OAAO,CAAC,CAAC;IACV;EAAG,GAEDlB,EAAE,CAAE,sBAAuB,CACpB,CAED,CAEC,CAAC;AAEjB"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { useSelect, useDispatch } from '@wordpress/data';
|
|
6
|
-
import { Button, __experimentalHeading as Heading } from '@wordpress/components';
|
|
7
|
-
import { store as editorStore } from '@wordpress/editor';
|
|
8
|
-
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
9
|
-
import { __ } from '@wordpress/i18n';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Internal dependencies
|
|
13
|
-
*/
|
|
14
|
-
import { store as editSiteStore } from '../../../store';
|
|
15
|
-
function TemplateAreaItem({
|
|
16
|
-
area,
|
|
17
|
-
clientId
|
|
18
|
-
}) {
|
|
19
|
-
const {
|
|
20
|
-
selectBlock,
|
|
21
|
-
toggleBlockHighlight
|
|
22
|
-
} = useDispatch(blockEditorStore);
|
|
23
|
-
const templatePartArea = useSelect(select => {
|
|
24
|
-
const defaultAreas = select(editorStore).__experimentalGetDefaultTemplatePartAreas();
|
|
25
|
-
return defaultAreas.find(defaultArea => defaultArea.area === area);
|
|
26
|
-
}, [area]);
|
|
27
|
-
const highlightBlock = () => toggleBlockHighlight(clientId, true);
|
|
28
|
-
const cancelHighlightBlock = () => toggleBlockHighlight(clientId, false);
|
|
29
|
-
return createElement(Button, {
|
|
30
|
-
className: "edit-site-template-card__template-areas-item",
|
|
31
|
-
icon: templatePartArea?.icon,
|
|
32
|
-
onMouseOver: highlightBlock,
|
|
33
|
-
onMouseLeave: cancelHighlightBlock,
|
|
34
|
-
onFocus: highlightBlock,
|
|
35
|
-
onBlur: cancelHighlightBlock,
|
|
36
|
-
onClick: () => {
|
|
37
|
-
selectBlock(clientId);
|
|
38
|
-
}
|
|
39
|
-
}, templatePartArea?.label);
|
|
40
|
-
}
|
|
41
|
-
export default function TemplateAreas() {
|
|
42
|
-
const templateParts = useSelect(select => select(editSiteStore).getCurrentTemplateTemplateParts(), []);
|
|
43
|
-
if (!templateParts.length) {
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
return createElement("section", {
|
|
47
|
-
className: "edit-site-template-card__template-areas"
|
|
48
|
-
}, createElement(Heading, {
|
|
49
|
-
level: 3,
|
|
50
|
-
className: "edit-site-template-card__template-areas-title"
|
|
51
|
-
}, __('Areas')), createElement("ul", {
|
|
52
|
-
className: "edit-site-template-card__template-areas-list"
|
|
53
|
-
}, templateParts.map(({
|
|
54
|
-
templatePart,
|
|
55
|
-
block
|
|
56
|
-
}) => createElement("li", {
|
|
57
|
-
key: block.clientId
|
|
58
|
-
}, createElement(TemplateAreaItem, {
|
|
59
|
-
area: templatePart.area,
|
|
60
|
-
clientId: block.clientId
|
|
61
|
-
})))));
|
|
62
|
-
}
|
|
63
|
-
//# sourceMappingURL=template-areas.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","useDispatch","Button","__experimentalHeading","Heading","store","editorStore","blockEditorStore","__","editSiteStore","TemplateAreaItem","area","clientId","selectBlock","toggleBlockHighlight","templatePartArea","select","defaultAreas","__experimentalGetDefaultTemplatePartAreas","find","defaultArea","highlightBlock","cancelHighlightBlock","createElement","className","icon","onMouseOver","onMouseLeave","onFocus","onBlur","onClick","label","TemplateAreas","templateParts","getCurrentTemplateTemplateParts","length","level","map","templatePart","block","key"],"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/template-panel/template-areas.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__experimentalHeading as Heading,\n} from '@wordpress/components';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../../store';\n\nfunction TemplateAreaItem( { area, clientId } ) {\n\tconst { selectBlock, toggleBlockHighlight } =\n\t\tuseDispatch( blockEditorStore );\n\tconst templatePartArea = useSelect(\n\t\t( select ) => {\n\t\t\tconst defaultAreas =\n\t\t\t\tselect(\n\t\t\t\t\teditorStore\n\t\t\t\t).__experimentalGetDefaultTemplatePartAreas();\n\n\t\t\treturn defaultAreas.find(\n\t\t\t\t( defaultArea ) => defaultArea.area === area\n\t\t\t);\n\t\t},\n\t\t[ area ]\n\t);\n\n\tconst highlightBlock = () => toggleBlockHighlight( clientId, true );\n\tconst cancelHighlightBlock = () => toggleBlockHighlight( clientId, false );\n\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"edit-site-template-card__template-areas-item\"\n\t\t\ticon={ templatePartArea?.icon }\n\t\t\tonMouseOver={ highlightBlock }\n\t\t\tonMouseLeave={ cancelHighlightBlock }\n\t\t\tonFocus={ highlightBlock }\n\t\t\tonBlur={ cancelHighlightBlock }\n\t\t\tonClick={ () => {\n\t\t\t\tselectBlock( clientId );\n\t\t\t} }\n\t\t>\n\t\t\t{ templatePartArea?.label }\n\t\t</Button>\n\t);\n}\n\nexport default function TemplateAreas() {\n\tconst templateParts = useSelect(\n\t\t( select ) => select( editSiteStore ).getCurrentTemplateTemplateParts(),\n\t\t[]\n\t);\n\n\tif ( ! templateParts.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<section className=\"edit-site-template-card__template-areas\">\n\t\t\t<Heading\n\t\t\t\tlevel={ 3 }\n\t\t\t\tclassName=\"edit-site-template-card__template-areas-title\"\n\t\t\t>\n\t\t\t\t{ __( 'Areas' ) }\n\t\t\t</Heading>\n\n\t\t\t<ul className=\"edit-site-template-card__template-areas-list\">\n\t\t\t\t{ templateParts.map( ( { templatePart, block } ) => (\n\t\t\t\t\t<li key={ block.clientId }>\n\t\t\t\t\t\t<TemplateAreaItem\n\t\t\t\t\t\t\tarea={ templatePart.area }\n\t\t\t\t\t\t\tclientId={ block.clientId }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</li>\n\t\t\t\t) ) }\n\t\t\t</ul>\n\t\t</section>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,MAAM,EACNC,qBAAqB,IAAIC,OAAO,QAC1B,uBAAuB;AAC9B,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB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AAK,CAAED,aAAa,CAACE,MAAM,EAAG;IAC7B,OAAO,IAAI;EACZ;EAEA,OACCZ,aAAA;IAASC,SAAS,EAAC;EAAyC,GAC3DD,aAAA,CAACnB,OAAO;IACPgC,KAAK,EAAG,CAAG;IACXZ,SAAS,EAAC;EAA+C,GAEvDhB,EAAE,CAAE,OAAQ,CACN,CAAC,EAEVe,aAAA;IAAIC,SAAS,EAAC;EAA8C,GACzDS,aAAa,CAACI,GAAG,CAAE,CAAE;IAAEC,YAAY;IAAEC;EAAM,CAAC,KAC7ChB,aAAA;IAAIiB,GAAG,EAAGD,KAAK,CAAC3B;EAAU,GACzBW,aAAA,CAACb,gBAAgB;IAChBC,IAAI,EAAG2B,YAAY,CAAC3B,IAAM;IAC1BC,QAAQ,EAAG2B,KAAK,CAAC3B;EAAU,CAC3B,CACE,CACH,CACC,CACI,CAAC;AAEZ"}
|
package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__experimentalConfirmDialog","ConfirmDialog","__","RenameModal","onClose","onConfirm","createElement","isOpen","e","preventDefault","onCancel","confirmButtonText"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/delete-modal.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nexport default function RenameModal( { onClose, onConfirm } ) {\n\treturn (\n\t\t<ConfirmDialog\n\t\t\tisOpen\n\t\t\tonConfirm={ ( e ) => {\n\t\t\t\te.preventDefault();\n\t\t\t\tonConfirm();\n\n\t\t\t\t// Immediate close avoids ability to hit delete multiple times.\n\t\t\t\tonClose();\n\t\t\t} }\n\t\t\tonCancel={ onClose }\n\t\t\tconfirmButtonText={ __( 'Delete' ) }\n\t\t>\n\t\t\t{ __( 'Are you sure you want to delete this Navigation menu?' ) }\n\t\t</ConfirmDialog>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,2BAA2B,IAAIC,aAAa,QAAQ,uBAAuB;AACpF,SAASC,EAAE,QAAQ,iBAAiB;AAEpC,eAAe,SAASC,WAAWA,CAAE;EAAEC,OAAO;EAAEC;AAAU,CAAC,EAAG;EAC7D,OACCC,aAAA,CAACL,aAAa;IACbM,MAAM;IACNF,SAAS,EAAKG,CAAC,IAAM;MACpBA,CAAC,CAACC,cAAc,CAAC,CAAC;MAClBJ,SAAS,CAAC,CAAC;;MAEX;MACAD,OAAO,CAAC,CAAC;IACV,CAAG;IACHM,QAAQ,EAAGN,OAAS;IACpBO,iBAAiB,EAAGT,EAAE,CAAE,QAAS;EAAG,GAElCA,EAAE,CAAE,uDAAwD,CAChD,CAAC;AAElB"}
|