@wordpress/edit-site 5.18.1-next.5a1d1283.0 → 5.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/add-new-pattern/index.js +65 -4
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/add-new-template/index.js +3 -2
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/add-new-template/new-template.js +6 -1
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/add-new-template/utils.js +6 -1
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/app/index.js +2 -7
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/back-button.js +3 -2
- package/build/components/block-editor/back-button.js.map +1 -1
- package/build/components/block-editor/block-editor-provider/default-block-editor-provider.js +73 -0
- package/build/components/block-editor/block-editor-provider/default-block-editor-provider.js.map +1 -0
- package/build/components/block-editor/block-editor-provider/index.js +31 -0
- package/build/components/block-editor/block-editor-provider/index.js.map +1 -0
- package/build/components/block-editor/{providers → block-editor-provider}/navigation-block-editor-provider.js +2 -1
- package/build/components/block-editor/block-editor-provider/navigation-block-editor-provider.js.map +1 -0
- package/build/components/block-editor/block-editor-provider/use-page-content-blocks.js +76 -0
- package/build/components/block-editor/block-editor-provider/use-page-content-blocks.js.map +1 -0
- package/build/components/block-editor/editor-canvas.js +20 -16
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/index.js +2 -9
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/block-editor/site-editor-canvas.js +2 -4
- package/build/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js +8 -4
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/canvas-loader/index.js +18 -1
- package/build/components/canvas-loader/index.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +8 -12
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/editor/index.js +7 -9
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +5 -4
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/font-families.js +68 -0
- package/build/components/global-styles/font-families.js.map +1 -0
- package/build/components/global-styles/font-family-item.js +47 -0
- package/build/components/global-styles/font-family-item.js.map +1 -0
- package/build/components/global-styles/font-library-modal/collection-font-details.js +49 -0
- package/build/components/global-styles/font-library-modal/collection-font-details.js.map +1 -0
- package/build/components/global-styles/font-library-modal/collection-font-variant.js +55 -0
- package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -0
- package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js +31 -0
- package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -0
- package/build/components/global-styles/font-library-modal/context.js +309 -0
- package/build/components/global-styles/font-library-modal/context.js.map +1 -0
- package/build/components/global-styles/font-library-modal/font-card.js +61 -0
- package/build/components/global-styles/font-library-modal/font-card.js.map +1 -0
- package/build/components/global-styles/font-library-modal/font-collection.js +172 -0
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -0
- package/build/components/global-styles/font-library-modal/font-demo.js +86 -0
- package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -0
- package/build/components/global-styles/font-library-modal/font-variant.js +51 -0
- package/build/components/global-styles/font-library-modal/font-variant.js.map +1 -0
- package/build/components/global-styles/font-library-modal/fonts-grid.js +54 -0
- package/build/components/global-styles/font-library-modal/fonts-grid.js.map +1 -0
- package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +41 -0
- package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -0
- package/build/components/global-styles/font-library-modal/index.js +65 -0
- package/build/components/global-styles/font-library-modal/index.js.map +1 -0
- package/build/components/global-styles/font-library-modal/installed-fonts.js +128 -0
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -0
- package/build/components/global-styles/font-library-modal/library-font-card.js +39 -0
- package/build/components/global-styles/font-library-modal/library-font-card.js.map +1 -0
- package/build/components/global-styles/font-library-modal/library-font-details.js +44 -0
- package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -0
- package/build/components/global-styles/font-library-modal/library-font-variant.js +59 -0
- package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -0
- package/build/components/global-styles/font-library-modal/local-fonts.js +143 -0
- package/build/components/global-styles/font-library-modal/local-fonts.js.map +1 -0
- package/build/components/global-styles/font-library-modal/resolvers.js +53 -0
- package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -0
- package/build/components/global-styles/font-library-modal/tab-layout.js +45 -0
- package/build/components/global-styles/font-library-modal/tab-layout.js.map +1 -0
- package/build/components/global-styles/font-library-modal/utils/constants.js +31 -0
- package/build/components/global-styles/font-library-modal/utils/constants.js.map +1 -0
- package/build/components/global-styles/font-library-modal/utils/filter-fonts.js +21 -0
- package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -0
- package/build/components/global-styles/font-library-modal/utils/fonts-outline.js +20 -0
- package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -0
- package/build/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +58 -0
- package/build/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js.map +1 -0
- package/build/components/global-styles/font-library-modal/utils/index.js +155 -0
- package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -0
- package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js +22 -0
- package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -0
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js +76 -0
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -0
- package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js +36 -0
- package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -0
- package/build/components/global-styles/font-library-modal/utils/toggleFont.js +92 -0
- package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -0
- package/build/components/global-styles/global-styles-provider.js +7 -12
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/screen-block.js +34 -21
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +1 -3
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +4 -72
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +3 -5
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/typogrphy-elements.js +96 -0
- package/build/components/global-styles/typogrphy-elements.js.map +1 -0
- package/build/components/header-edit-mode/document-actions/index.js +9 -8
- package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +4 -1
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/layout/index.js +5 -1
- package/build/components/layout/index.js.map +1 -1
- package/build/components/list/added-by.js +13 -8
- package/build/components/list/added-by.js.map +1 -1
- package/build/components/list/index.js +2 -1
- package/build/components/list/index.js.map +1 -1
- package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js +2 -3
- package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
- package/build/components/page-patterns/duplicate-menu-item.js +56 -20
- package/build/components/page-patterns/duplicate-menu-item.js.map +1 -1
- package/build/components/page-patterns/grid-item.js +48 -22
- package/build/components/page-patterns/grid-item.js.map +1 -1
- package/build/components/page-patterns/header.js +3 -7
- package/build/components/page-patterns/header.js.map +1 -1
- package/build/components/page-patterns/index.js +3 -3
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-patterns/patterns-list.js +7 -7
- package/build/components/page-patterns/patterns-list.js.map +1 -1
- package/build/components/page-patterns/rename-menu-item.js +6 -5
- package/build/components/page-patterns/rename-menu-item.js.map +1 -1
- package/build/components/page-patterns/search-items.js +8 -2
- package/build/components/page-patterns/search-items.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +71 -51
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-patterns/utils.js +1 -20
- package/build/components/page-patterns/utils.js.map +1 -1
- package/build/components/page-template-parts/add-new-template-part.js +3 -2
- package/build/components/page-template-parts/add-new-template-part.js.map +1 -1
- package/build/components/page-template-parts/index.js +2 -1
- package/build/components/page-template-parts/index.js.map +1 -1
- package/build/components/page-templates/index.js +3 -2
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/save-hub/index.js +2 -1
- package/build/components/save-hub/index.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +24 -17
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/edit-template.js +53 -26
- package/build/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/hooks.js +65 -0
- package/build/components/sidebar-edit-mode/page-panels/hooks.js.map +1 -0
- package/build/components/sidebar-edit-mode/page-panels/index.js +1 -4
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js +2 -1
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js +56 -0
- package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +1 -0
- package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js +91 -0
- package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js.map +1 -0
- package/build/components/sidebar-edit-mode/settings-header/index.js +2 -6
- package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/index.js +11 -9
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/last-revision.js +6 -4
- package/build/components/sidebar-edit-mode/template-panel/last-revision.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js +218 -0
- package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +1 -0
- package/build/components/sidebar-navigation-screen/index.js +6 -4
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js +32 -4
- package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +4 -2
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +4 -31
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +2 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +2 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +3 -2
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/index.js +3 -3
- package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/page-details.js +2 -1
- package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pages/index.js +5 -4
- package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/index.js +20 -9
- package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +3 -2
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +2 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +2 -1
- package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +41 -11
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +9 -37
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +44 -5
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +7 -2
- package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +2 -1
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/home-template-details.js +2 -1
- package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/index.js +2 -2
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates/index.js +5 -4
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +3 -2
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/start-template-options/index.js +20 -2
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +5 -4
- 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 +4 -3
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build/components/template-actions/index.js +8 -4
- package/build/components/template-actions/index.js.map +1 -1
- package/build/components/template-actions/rename-menu-item.js +9 -3
- package/build/components/template-actions/rename-menu-item.js.map +1 -1
- package/build/components/welcome-guide/styles.js +2 -2
- package/build/components/welcome-guide/styles.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +4 -3
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/hooks/navigation-menu-edit.js +2 -1
- package/build/hooks/navigation-menu-edit.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js +5 -37
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/hooks/template-part-edit.js +2 -1
- package/build/hooks/template-part-edit.js.map +1 -1
- package/build/store/actions.js +38 -14
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +1 -9
- package/build/store/constants.js.map +1 -1
- package/build/store/private-actions.js +21 -1
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +23 -0
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +19 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +3 -2
- package/build/store/selectors.js.map +1 -1
- package/build/utils/constants.js +64 -2
- package/build/utils/constants.js.map +1 -1
- package/build/utils/is-template-removable.js +6 -1
- package/build/utils/is-template-removable.js.map +1 -1
- package/build/utils/is-template-revertable.js +6 -1
- package/build/utils/is-template-revertable.js.map +1 -1
- package/build/utils/template-part-create.js +6 -1
- package/build/utils/template-part-create.js.map +1 -1
- package/build-module/components/add-new-pattern/index.js +69 -8
- package/build-module/components/add-new-pattern/index.js.map +1 -1
- package/build-module/components/add-new-template/index.js +3 -2
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +6 -1
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +6 -1
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/app/index.js +2 -7
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/back-button.js +3 -2
- package/build-module/components/block-editor/back-button.js.map +1 -1
- package/build-module/components/block-editor/block-editor-provider/default-block-editor-provider.js +65 -0
- package/build-module/components/block-editor/block-editor-provider/default-block-editor-provider.js.map +1 -0
- package/build-module/components/block-editor/block-editor-provider/index.js +23 -0
- package/build-module/components/block-editor/block-editor-provider/index.js.map +1 -0
- package/build-module/components/block-editor/{providers → block-editor-provider}/navigation-block-editor-provider.js +2 -1
- package/build-module/components/block-editor/block-editor-provider/navigation-block-editor-provider.js.map +1 -0
- package/build-module/components/block-editor/block-editor-provider/use-page-content-blocks.js +70 -0
- package/build-module/components/block-editor/block-editor-provider/use-page-content-blocks.js.map +1 -0
- package/build-module/components/block-editor/editor-canvas.js +21 -17
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/index.js +1 -8
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/block-editor/site-editor-canvas.js +5 -7
- package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +8 -4
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/canvas-loader/index.js +18 -1
- package/build-module/components/canvas-loader/index.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +8 -12
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/editor/index.js +7 -9
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +5 -4
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/font-families.js +58 -0
- package/build-module/components/global-styles/font-families.js.map +1 -0
- package/build-module/components/global-styles/font-family-item.js +40 -0
- package/build-module/components/global-styles/font-family-item.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/collection-font-details.js +40 -0
- package/build-module/components/global-styles/font-library-modal/collection-font-details.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +45 -0
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js +23 -0
- package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/context.js +300 -0
- package/build-module/components/global-styles/font-library-modal/context.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/font-card.js +52 -0
- package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/font-collection.js +164 -0
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/font-demo.js +79 -0
- package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/font-variant.js +42 -0
- package/build-module/components/global-styles/font-library-modal/font-variant.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/fonts-grid.js +47 -0
- package/build-module/components/global-styles/font-library-modal/fonts-grid.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +33 -0
- package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/index.js +57 -0
- package/build-module/components/global-styles/font-library-modal/index.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +120 -0
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/library-font-card.js +31 -0
- package/build-module/components/global-styles/font-library-modal/library-font-card.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/library-font-details.js +35 -0
- package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js +50 -0
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/local-fonts.js +135 -0
- package/build-module/components/global-styles/font-library-modal/local-fonts.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/resolvers.js +42 -0
- package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/tab-layout.js +37 -0
- package/build-module/components/global-styles/font-library-modal/tab-layout.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/utils/constants.js +21 -0
- package/build-module/components/global-styles/font-library-modal/utils/constants.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js +15 -0
- package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js +13 -0
- package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +52 -0
- package/build-module/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/utils/index.js +141 -0
- package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js +16 -0
- package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +68 -0
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js +30 -0
- package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js +86 -0
- package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -0
- package/build-module/components/global-styles/global-styles-provider.js +7 -12
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +34 -21
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +1 -3
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +6 -74
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +3 -5
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/typogrphy-elements.js +87 -0
- package/build-module/components/global-styles/typogrphy-elements.js.map +1 -0
- package/build-module/components/header-edit-mode/document-actions/index.js +9 -8
- package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +4 -1
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/layout/index.js +5 -1
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/list/added-by.js +13 -8
- package/build-module/components/list/added-by.js.map +1 -1
- package/build-module/components/list/index.js +2 -1
- package/build-module/components/list/index.js.map +1 -1
- package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js +2 -3
- package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
- package/build-module/components/page-patterns/duplicate-menu-item.js +55 -20
- package/build-module/components/page-patterns/duplicate-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/grid-item.js +49 -23
- package/build-module/components/page-patterns/grid-item.js.map +1 -1
- package/build-module/components/page-patterns/header.js +3 -7
- package/build-module/components/page-patterns/header.js.map +1 -1
- package/build-module/components/page-patterns/index.js +3 -3
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-patterns/patterns-list.js +7 -7
- package/build-module/components/page-patterns/patterns-list.js.map +1 -1
- package/build-module/components/page-patterns/rename-menu-item.js +6 -5
- package/build-module/components/page-patterns/rename-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/search-items.js +8 -2
- package/build-module/components/page-patterns/search-items.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +71 -52
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-patterns/utils.js +0 -11
- package/build-module/components/page-patterns/utils.js.map +1 -1
- package/build-module/components/page-template-parts/add-new-template-part.js +3 -2
- package/build-module/components/page-template-parts/add-new-template-part.js.map +1 -1
- package/build-module/components/page-template-parts/index.js +2 -1
- package/build-module/components/page-template-parts/index.js.map +1 -1
- package/build-module/components/page-templates/index.js +3 -2
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/save-hub/index.js +2 -1
- package/build-module/components/save-hub/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +26 -19
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js +54 -29
- package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/hooks.js +55 -0
- package/build-module/components/sidebar-edit-mode/page-panels/hooks.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/page-panels/index.js +1 -4
- 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 +2 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js +49 -0
- package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/page-panels/swap-template-button.js +85 -0
- package/build-module/components/sidebar-edit-mode/page-panels/swap-template-button.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/settings-header/index.js +2 -6
- package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/index.js +12 -10
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js +8 -6
- package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js +209 -0
- package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen/index.js +6 -4
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js +32 -5
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +4 -2
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +6 -33
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +2 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +3 -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-navigation-menus/index.js +3 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/index.js +3 -3
- package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/page-details.js +2 -1
- package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pages/index.js +5 -4
- package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/index.js +21 -10
- package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +3 -2
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +2 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +2 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +41 -11
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +12 -40
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +44 -5
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +7 -2
- package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +3 -2
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/home-template-details.js +2 -1
- package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js +2 -2
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates/index.js +5 -4
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +3 -2
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +20 -2
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +5 -4
- 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 +4 -3
- 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 +8 -4
- package/build-module/components/template-actions/index.js.map +1 -1
- package/build-module/components/template-actions/rename-menu-item.js +9 -3
- package/build-module/components/template-actions/rename-menu-item.js.map +1 -1
- package/build-module/components/welcome-guide/styles.js +2 -2
- package/build-module/components/welcome-guide/styles.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +4 -3
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/hooks/navigation-menu-edit.js +2 -1
- package/build-module/hooks/navigation-menu-edit.js.map +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +5 -37
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/hooks/template-part-edit.js +2 -1
- package/build-module/hooks/template-part-edit.js.map +1 -1
- package/build-module/store/actions.js +39 -16
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js +0 -4
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/private-actions.js +19 -0
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +22 -0
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +18 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +3 -3
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/constants.js +51 -1
- package/build-module/utils/constants.js.map +1 -1
- package/build-module/utils/is-template-removable.js +6 -1
- package/build-module/utils/is-template-removable.js.map +1 -1
- package/build-module/utils/is-template-revertable.js +6 -1
- package/build-module/utils/is-template-revertable.js.map +1 -1
- package/build-module/utils/template-part-create.js +6 -1
- package/build-module/utils/template-part-create.js.map +1 -1
- package/build-style/style-rtl.css +267 -37
- package/build-style/style.css +267 -37
- package/lib/inflate.js +4082 -0
- package/lib/lib-font.browser.js +3831 -0
- package/lib/unbrotli.js +2679 -0
- package/package.json +40 -40
- package/src/components/add-new-pattern/index.js +86 -8
- package/src/components/add-new-template/index.js +3 -2
- package/src/components/add-new-template/new-template.js +6 -1
- package/src/components/add-new-template/utils.js +12 -3
- package/src/components/app/index.js +9 -12
- package/src/components/block-editor/back-button.js +6 -2
- package/src/components/block-editor/block-editor-provider/default-block-editor-provider.js +70 -0
- package/src/components/block-editor/block-editor-provider/index.js +29 -0
- package/src/components/block-editor/{providers → block-editor-provider}/navigation-block-editor-provider.js +2 -1
- package/src/components/block-editor/block-editor-provider/test/use-page-content-blocks.js +87 -0
- package/src/components/block-editor/block-editor-provider/use-page-content-blocks.js +77 -0
- package/src/components/block-editor/editor-canvas.js +31 -19
- package/src/components/block-editor/index.js +1 -14
- package/src/components/block-editor/site-editor-canvas.js +7 -12
- package/src/components/block-editor/style.scss +88 -1
- package/src/components/block-editor/use-site-editor-settings.js +26 -19
- package/src/components/canvas-loader/index.js +12 -1
- package/src/components/canvas-loader/style.scss +1 -1
- package/src/components/create-template-part-modal/index.js +11 -12
- package/src/components/editor/index.js +9 -10
- package/src/components/global-styles/dimensions-panel.js +8 -4
- package/src/components/global-styles/font-families.js +71 -0
- package/src/components/global-styles/font-family-item.js +44 -0
- package/src/components/global-styles/font-library-modal/collection-font-details.js +56 -0
- package/src/components/global-styles/font-library-modal/collection-font-variant.js +45 -0
- package/src/components/global-styles/font-library-modal/confirm-delete-dialog.js +33 -0
- package/src/components/global-styles/font-library-modal/context.js +378 -0
- package/src/components/global-styles/font-library-modal/font-card.js +75 -0
- package/src/components/global-styles/font-library-modal/font-collection.js +257 -0
- package/src/components/global-styles/font-library-modal/font-demo.js +83 -0
- package/src/components/global-styles/font-library-modal/font-variant.js +53 -0
- package/src/components/global-styles/font-library-modal/fonts-grid.js +55 -0
- package/src/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +50 -0
- package/src/components/global-styles/font-library-modal/index.js +67 -0
- package/src/components/global-styles/font-library-modal/installed-fonts.js +174 -0
- package/src/components/global-styles/font-library-modal/library-font-card.js +33 -0
- package/src/components/global-styles/font-library-modal/library-font-details.js +45 -0
- package/src/components/global-styles/font-library-modal/library-font-variant.js +54 -0
- package/src/components/global-styles/font-library-modal/local-fonts.js +160 -0
- package/src/components/global-styles/font-library-modal/resolvers.js +45 -0
- package/src/components/global-styles/font-library-modal/style.scss +139 -0
- package/src/components/global-styles/font-library-modal/tab-layout.js +50 -0
- package/src/components/global-styles/font-library-modal/utils/constants.js +23 -0
- package/src/components/global-styles/font-library-modal/utils/filter-fonts.js +18 -0
- package/src/components/global-styles/font-library-modal/utils/fonts-outline.js +21 -0
- package/src/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +58 -0
- package/src/components/global-styles/font-library-modal/utils/index.js +153 -0
- package/src/components/global-styles/font-library-modal/utils/make-families-from-faces.js +15 -0
- package/src/components/global-styles/font-library-modal/utils/preview-styles.js +86 -0
- package/src/components/global-styles/font-library-modal/utils/sort-font-faces.js +33 -0
- package/src/components/global-styles/font-library-modal/utils/test/filter-fonts.spec.js +69 -0
- package/src/components/global-styles/font-library-modal/utils/test/fonts-outline.spec.js +109 -0
- package/src/components/global-styles/font-library-modal/utils/test/getDisplaySrcFromFontFace.spec.js +53 -0
- package/src/components/global-styles/font-library-modal/utils/test/getFontFaceVariantName.spec.js +30 -0
- package/src/components/global-styles/font-library-modal/utils/test/getIntersectingFontFaces.spec.js +240 -0
- package/src/components/global-styles/font-library-modal/utils/test/isUrlEncoded.spec.js +31 -0
- package/src/components/global-styles/font-library-modal/utils/test/makeFamiliesFromFaces.spec.js +57 -0
- package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamilies.spec.js +62 -0
- package/src/components/global-styles/font-library-modal/utils/test/mergeFontFaces.spec.js +56 -0
- package/src/components/global-styles/font-library-modal/utils/test/mergeFontFamilies.spec.js +108 -0
- package/src/components/global-styles/font-library-modal/utils/test/preview-styles.spec.js +161 -0
- package/src/components/global-styles/font-library-modal/utils/test/setUIValuesNeeded.spec.js +41 -0
- package/src/components/global-styles/font-library-modal/utils/test/sort-font-faces.js +74 -0
- package/src/components/global-styles/font-library-modal/utils/test/toggleFont.spec.js +141 -0
- package/src/components/global-styles/font-library-modal/utils/toggleFont.js +90 -0
- package/src/components/global-styles/global-styles-provider.js +2 -7
- package/src/components/global-styles/screen-block.js +42 -20
- package/src/components/global-styles/screen-revisions/index.js +0 -2
- package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +0 -1
- package/src/components/global-styles/screen-typography.js +9 -95
- package/src/components/global-styles/style-variations-container.js +0 -2
- package/src/components/global-styles/typogrphy-elements.js +110 -0
- package/src/components/header-edit-mode/document-actions/index.js +17 -8
- package/src/components/header-edit-mode/index.js +2 -1
- package/src/components/layout/index.js +10 -1
- package/src/components/list/added-by.js +29 -11
- package/src/components/list/index.js +7 -1
- package/src/components/list/style.scss +2 -0
- package/src/components/page-content-focus-manager/disable-non-page-content-blocks.js +2 -8
- package/src/components/page-patterns/duplicate-menu-item.js +67 -24
- package/src/components/page-patterns/grid-item.js +80 -33
- package/src/components/page-patterns/header.js +3 -12
- package/src/components/page-patterns/index.js +3 -3
- package/src/components/page-patterns/patterns-list.js +7 -7
- package/src/components/page-patterns/rename-menu-item.js +18 -7
- package/src/components/page-patterns/search-items.js +20 -2
- package/src/components/page-patterns/style.scss +1 -5
- package/src/components/page-patterns/use-patterns.js +217 -127
- package/src/components/page-patterns/utils.js +0 -19
- package/src/components/page-template-parts/add-new-template-part.js +5 -2
- package/src/components/page-template-parts/index.js +2 -1
- package/src/components/page-templates/index.js +3 -2
- package/src/components/save-hub/index.js +2 -1
- package/src/components/secondary-sidebar/list-view-sidebar.js +31 -26
- package/src/components/sidebar-edit-mode/page-panels/edit-template.js +94 -52
- package/src/components/sidebar-edit-mode/page-panels/hooks.js +88 -0
- package/src/components/sidebar-edit-mode/page-panels/index.js +0 -4
- package/src/components/sidebar-edit-mode/page-panels/page-summary.js +2 -0
- package/src/components/sidebar-edit-mode/page-panels/reset-default-template.js +44 -0
- package/src/components/sidebar-edit-mode/page-panels/style.scss +46 -9
- package/src/components/sidebar-edit-mode/page-panels/swap-template-button.js +82 -0
- package/src/components/sidebar-edit-mode/settings-header/index.js +4 -7
- package/src/components/sidebar-edit-mode/template-panel/index.js +28 -24
- package/src/components/sidebar-edit-mode/template-panel/last-revision.js +19 -15
- package/src/components/sidebar-edit-mode/template-panel/pattern-categories.js +277 -0
- package/src/components/sidebar-navigation-screen/index.js +4 -9
- package/src/components/sidebar-navigation-screen/style.scss +7 -1
- package/src/components/sidebar-navigation-screen-details-footer/index.js +38 -10
- package/src/components/sidebar-navigation-screen-details-footer/style.scss +10 -3
- package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -0
- package/src/components/sidebar-navigation-screen-global-styles/index.js +6 -44
- package/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js +2 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +3 -1
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +3 -2
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +0 -4
- package/src/components/sidebar-navigation-screen-page/index.js +3 -3
- package/src/components/sidebar-navigation-screen-page/page-details.js +2 -1
- package/src/components/sidebar-navigation-screen-pages/index.js +5 -4
- package/src/components/sidebar-navigation-screen-pattern/index.js +22 -8
- package/src/components/sidebar-navigation-screen-pattern/style.scss +0 -3
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +8 -2
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +7 -1
- package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +2 -1
- package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +63 -20
- package/src/components/sidebar-navigation-screen-patterns/index.js +20 -51
- package/src/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +61 -6
- package/src/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +12 -2
- package/src/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +3 -5
- package/src/components/sidebar-navigation-screen-template/home-template-details.js +2 -1
- package/src/components/sidebar-navigation-screen-template/index.js +2 -4
- package/src/components/sidebar-navigation-screen-templates/index.js +5 -4
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +6 -2
- package/src/components/start-template-options/index.js +39 -2
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +10 -4
- package/src/components/sync-state-with-url/use-sync-path-with-url.js +8 -3
- package/src/components/template-actions/index.js +15 -8
- package/src/components/template-actions/rename-menu-item.js +21 -5
- package/src/components/welcome-guide/styles.js +2 -2
- package/src/hooks/commands/use-edit-mode-commands.js +4 -3
- package/src/hooks/navigation-menu-edit.js +2 -1
- package/src/hooks/push-changes-to-global-styles/index.js +6 -49
- package/src/hooks/template-part-edit.js +2 -1
- package/src/store/actions.js +56 -22
- package/src/store/constants.js +0 -5
- package/src/store/private-actions.js +19 -0
- package/src/store/private-selectors.js +22 -0
- package/src/store/reducer.js +18 -0
- package/src/store/selectors.js +6 -3
- package/src/store/test/reducer.js +18 -0
- package/src/style.scss +1 -1
- package/src/utils/constants.js +54 -3
- package/src/utils/is-template-removable.js +8 -1
- package/src/utils/is-template-revertable.js +8 -1
- package/src/utils/template-part-create.js +6 -1
- package/build/components/block-editor/get-block-editor-provider.js +0 -35
- package/build/components/block-editor/get-block-editor-provider.js.map +0 -1
- package/build/components/block-editor/providers/default-block-editor-provider.js +0 -49
- package/build/components/block-editor/providers/default-block-editor-provider.js.map +0 -1
- package/build/components/block-editor/providers/navigation-block-editor-provider.js.map +0 -1
- package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js +0 -30
- package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +0 -1
- package/build-module/components/block-editor/get-block-editor-provider.js +0 -28
- package/build-module/components/block-editor/get-block-editor-provider.js.map +0 -1
- package/build-module/components/block-editor/providers/default-block-editor-provider.js +0 -41
- package/build-module/components/block-editor/providers/default-block-editor-provider.js.map +0 -1
- package/build-module/components/block-editor/providers/navigation-block-editor-provider.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js +0 -23
- package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +0 -1
- package/src/components/block-editor/get-block-editor-provider.js +0 -29
- package/src/components/block-editor/providers/default-block-editor-provider.js +0 -44
- package/src/components/sidebar-navigation-screen-global-styles/style.scss +0 -12
- package/src/components/sidebar-navigation-screen-patterns/use-my-patterns.js +0 -24
|
@@ -35,13 +35,15 @@ export default function SidebarNavigationScreen({
|
|
|
35
35
|
backPath: backPathProp
|
|
36
36
|
}) {
|
|
37
37
|
const {
|
|
38
|
-
dashboardLink
|
|
38
|
+
dashboardLink,
|
|
39
|
+
dashboardLinkText
|
|
39
40
|
} = useSelect(select => {
|
|
40
41
|
const {
|
|
41
42
|
getSettings
|
|
42
43
|
} = unlock(select(editSiteStore));
|
|
43
44
|
return {
|
|
44
|
-
dashboardLink: getSettings().__experimentalDashboardLink
|
|
45
|
+
dashboardLink: getSettings().__experimentalDashboardLink,
|
|
46
|
+
dashboardLinkText: getSettings().__experimentalDashboardLinkText
|
|
45
47
|
};
|
|
46
48
|
}, []);
|
|
47
49
|
const {
|
|
@@ -77,8 +79,8 @@ export default function SidebarNavigationScreen({
|
|
|
77
79
|
showTooltip: false
|
|
78
80
|
}), isRoot && createElement(SidebarButton, {
|
|
79
81
|
icon: icon,
|
|
80
|
-
label:
|
|
81
|
-
href:
|
|
82
|
+
label: dashboardLinkText || __('Go to the Dashboard'),
|
|
83
|
+
href: dashboardLink || 'index.php'
|
|
82
84
|
}), createElement(Heading, {
|
|
83
85
|
className: "edit-site-sidebar-navigation-screen__title",
|
|
84
86
|
color: '#e0e0e0' /* $gray-200 */,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["classnames","__experimentalHStack","HStack","__experimentalHeading","Heading","__experimentalUseNavigator","useNavigator","__experimentalVStack","VStack","isRTL","__","sprintf","chevronRight","chevronLeft","store","coreStore","useSelect","privateApis","routerPrivateApis","editSiteStore","unlock","SidebarButton","isPreviewingTheme","currentlyPreviewingTheme","useLocation","SidebarNavigationScreen","isRoot","title","actions","meta","content","footer","description","backPath","backPathProp","dashboardLink","select","getSettings","__experimentalDashboardLink","getTheme","location","navigator","theme","icon","createElement","Fragment","className","spacing","justify","alignment","onClick","state","goTo","isBack","goToParent","label","showTooltip","href","color","level","size","name","rendered"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalHeading as Heading,\n\t__experimentalUseNavigator as useNavigator,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { isRTL, __, sprintf } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport SidebarButton from '../sidebar-button';\nimport {\n\tisPreviewingTheme,\n\tcurrentlyPreviewingTheme,\n} from '../../utils/is-previewing-theme';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationScreen( {\n\tisRoot,\n\ttitle,\n\tactions,\n\tmeta,\n\tcontent,\n\tfooter,\n\tdescription,\n\tbackPath: backPathProp,\n} ) {\n\tconst { dashboardLink } = useSelect( ( select ) => {\n\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\t\treturn {\n\t\t\tdashboardLink: getSettings().__experimentalDashboardLink,\n\t\t};\n\t}, [] );\n\tconst { getTheme } = useSelect( coreStore );\n\tconst location = useLocation();\n\tconst navigator = useNavigator();\n\tconst theme = getTheme( currentlyPreviewingTheme() );\n\tconst icon = isRTL() ? chevronRight : chevronLeft;\n\n\treturn (\n\t\t<>\n\t\t\t<VStack\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'edit-site-sidebar-navigation-screen__main',\n\t\t\t\t\t{\n\t\t\t\t\t\t'has-footer': !! footer,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t\tspacing={ 0 }\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\talignment=\"flex-start\"\n\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title-icon\"\n\t\t\t\t>\n\t\t\t\t\t{ ! isRoot && (\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tconst backPath =\n\t\t\t\t\t\t\t\t\tbackPathProp ?? location.state?.backPath;\n\t\t\t\t\t\t\t\tif ( backPath ) {\n\t\t\t\t\t\t\t\t\tnavigator.goTo( backPath, {\n\t\t\t\t\t\t\t\t\t\tisBack: true,\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\tnavigator.goToParent();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tlabel={ __( 'Back' ) }\n\t\t\t\t\t\t\tshowTooltip={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isRoot && (\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\
|
|
1
|
+
{"version":3,"names":["classnames","__experimentalHStack","HStack","__experimentalHeading","Heading","__experimentalUseNavigator","useNavigator","__experimentalVStack","VStack","isRTL","__","sprintf","chevronRight","chevronLeft","store","coreStore","useSelect","privateApis","routerPrivateApis","editSiteStore","unlock","SidebarButton","isPreviewingTheme","currentlyPreviewingTheme","useLocation","SidebarNavigationScreen","isRoot","title","actions","meta","content","footer","description","backPath","backPathProp","dashboardLink","dashboardLinkText","select","getSettings","__experimentalDashboardLink","__experimentalDashboardLinkText","getTheme","location","navigator","theme","icon","createElement","Fragment","className","spacing","justify","alignment","onClick","state","goTo","isBack","goToParent","label","showTooltip","href","color","level","size","name","rendered"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalHeading as Heading,\n\t__experimentalUseNavigator as useNavigator,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { isRTL, __, sprintf } from '@wordpress/i18n';\nimport { chevronRight, chevronLeft } from '@wordpress/icons';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport SidebarButton from '../sidebar-button';\nimport {\n\tisPreviewingTheme,\n\tcurrentlyPreviewingTheme,\n} from '../../utils/is-previewing-theme';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationScreen( {\n\tisRoot,\n\ttitle,\n\tactions,\n\tmeta,\n\tcontent,\n\tfooter,\n\tdescription,\n\tbackPath: backPathProp,\n} ) {\n\tconst { dashboardLink, dashboardLinkText } = useSelect( ( select ) => {\n\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\t\treturn {\n\t\t\tdashboardLink: getSettings().__experimentalDashboardLink,\n\t\t\tdashboardLinkText: getSettings().__experimentalDashboardLinkText,\n\t\t};\n\t}, [] );\n\tconst { getTheme } = useSelect( coreStore );\n\tconst location = useLocation();\n\tconst navigator = useNavigator();\n\tconst theme = getTheme( currentlyPreviewingTheme() );\n\tconst icon = isRTL() ? chevronRight : chevronLeft;\n\n\treturn (\n\t\t<>\n\t\t\t<VStack\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'edit-site-sidebar-navigation-screen__main',\n\t\t\t\t\t{\n\t\t\t\t\t\t'has-footer': !! footer,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t\tspacing={ 0 }\n\t\t\t\tjustify=\"flex-start\"\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tspacing={ 4 }\n\t\t\t\t\talignment=\"flex-start\"\n\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title-icon\"\n\t\t\t\t>\n\t\t\t\t\t{ ! isRoot && (\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tconst backPath =\n\t\t\t\t\t\t\t\t\tbackPathProp ?? location.state?.backPath;\n\t\t\t\t\t\t\t\tif ( backPath ) {\n\t\t\t\t\t\t\t\t\tnavigator.goTo( backPath, {\n\t\t\t\t\t\t\t\t\t\tisBack: true,\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\tnavigator.goToParent();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tlabel={ __( 'Back' ) }\n\t\t\t\t\t\t\tshowTooltip={ false }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ isRoot && (\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t\t\tlabel={\n\t\t\t\t\t\t\t\tdashboardLinkText || __( 'Go to the Dashboard' )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\thref={ dashboardLink || 'index.php' }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t<Heading\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__title\"\n\t\t\t\t\t\tcolor={ '#e0e0e0' /* $gray-200 */ }\n\t\t\t\t\t\tlevel={ 1 }\n\t\t\t\t\t\tsize={ 20 }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ ! isPreviewingTheme()\n\t\t\t\t\t\t\t? title\n\t\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t\t'Previewing %1$s: %2$s',\n\t\t\t\t\t\t\t\t\ttheme?.name?.rendered,\n\t\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t\t ) }\n\t\t\t\t\t</Heading>\n\t\t\t\t\t{ actions && (\n\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__actions\">\n\t\t\t\t\t\t\t{ actions }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</HStack>\n\t\t\t\t{ meta && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__meta\">\n\t\t\t\t\t\t\t{ meta }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\n\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen__content\">\n\t\t\t\t\t{ description && (\n\t\t\t\t\t\t<p className=\"edit-site-sidebar-navigation-screen__description\">\n\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t) }\n\t\t\t\t\t{ content }\n\t\t\t\t</div>\n\t\t\t</VStack>\n\t\t\t{ footer && (\n\t\t\t\t<footer className=\"edit-site-sidebar-navigation-screen__footer\">\n\t\t\t\t\t{ footer }\n\t\t\t\t</footer>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,oBAAoB,IAAIC,MAAM,EAC9BC,qBAAqB,IAAIC,OAAO,EAChCC,0BAA0B,IAAIC,YAAY,EAC1CC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,KAAK,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACpD,SAASC,YAAY,EAAEC,WAAW,QAAQ,kBAAkB;AAC5D,SAASC,KAAK,IAAIC,SAAS,QAAQ,sB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AAAC,QAAA,QACCD,aAAA;IAAKE,SAAS,EAAC;EAA2C,GACvDnB,IACE,CACJ,CACF,EAEDiB,aAAA;IAAKE,SAAS,EAAC;EAA8C,GAC1DhB,WAAW,IACZc,aAAA;IAAGE,SAAS,EAAC;EAAkD,GAC5DhB,WACA,CACH,EACCF,OACE,CACE,CAAC,EACPC,MAAM,IACPe,aAAA;IAAQE,SAAS,EAAC;EAA6C,GAC5DjB,MACK,CAER,CAAC;AAEL"}
|
|
@@ -1,25 +1,52 @@
|
|
|
1
|
-
import { createElement
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
2
|
/**
|
|
3
3
|
* WordPress dependencies
|
|
4
4
|
*/
|
|
5
5
|
import { __, sprintf } from '@wordpress/i18n';
|
|
6
6
|
import { humanTimeDiff } from '@wordpress/date';
|
|
7
7
|
import { createInterpolateElement } from '@wordpress/element';
|
|
8
|
+
import { addQueryArgs } from '@wordpress/url';
|
|
9
|
+
import { Icon, __experimentalItemGroup as ItemGroup } from '@wordpress/components';
|
|
10
|
+
import { backup } from '@wordpress/icons';
|
|
8
11
|
|
|
9
12
|
/**
|
|
10
13
|
* Internal dependencies
|
|
11
14
|
*/
|
|
12
15
|
import { SidebarNavigationScreenDetailsPanelRow, SidebarNavigationScreenDetailsPanelLabel, SidebarNavigationScreenDetailsPanelValue } from '../sidebar-navigation-screen-details-panel';
|
|
16
|
+
import SidebarNavigationItem from '../sidebar-navigation-item';
|
|
13
17
|
export default function SidebarNavigationScreenDetailsFooter({
|
|
14
|
-
|
|
18
|
+
record,
|
|
19
|
+
...otherProps
|
|
15
20
|
}) {
|
|
16
|
-
|
|
21
|
+
/*
|
|
22
|
+
* There might be other items in the future,
|
|
23
|
+
* but for now it's just modified date.
|
|
24
|
+
* Later we might render a list of items and isolate
|
|
25
|
+
* the following logic.
|
|
26
|
+
*/
|
|
27
|
+
const hrefProps = {};
|
|
28
|
+
if (record?._links?.['predecessor-version']?.[0]?.id) {
|
|
29
|
+
hrefProps.href = addQueryArgs('revision.php', {
|
|
30
|
+
revision: record?._links['predecessor-version'][0].id
|
|
31
|
+
});
|
|
32
|
+
hrefProps.as = 'a';
|
|
33
|
+
}
|
|
34
|
+
return createElement(ItemGroup, {
|
|
17
35
|
className: "edit-site-sidebar-navigation-screen-details-footer"
|
|
36
|
+
}, createElement(SidebarNavigationItem, {
|
|
37
|
+
label: __('Revisions'),
|
|
38
|
+
...hrefProps,
|
|
39
|
+
...otherProps
|
|
40
|
+
}, createElement(SidebarNavigationScreenDetailsPanelRow, {
|
|
41
|
+
justify: "space-between"
|
|
18
42
|
}, createElement(SidebarNavigationScreenDetailsPanelLabel, null, __('Last modified')), createElement(SidebarNavigationScreenDetailsPanelValue, null, createInterpolateElement(sprintf( /* translators: %s: is the relative time when the post was last modified. */
|
|
19
|
-
__('<time>%s</time>'), humanTimeDiff(
|
|
43
|
+
__('<time>%s</time>'), humanTimeDiff(record.modified)), {
|
|
20
44
|
time: createElement("time", {
|
|
21
|
-
dateTime:
|
|
45
|
+
dateTime: record.modified
|
|
22
46
|
})
|
|
47
|
+
})), createElement(Icon, {
|
|
48
|
+
className: "edit-site-sidebar-navigation-screen-details-footer__icon",
|
|
49
|
+
icon: backup
|
|
23
50
|
}))));
|
|
24
51
|
}
|
|
25
52
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","sprintf","humanTimeDiff","createInterpolateElement","SidebarNavigationScreenDetailsPanelRow","SidebarNavigationScreenDetailsPanelLabel","SidebarNavigationScreenDetailsPanelValue","SidebarNavigationScreenDetailsFooter","
|
|
1
|
+
{"version":3,"names":["__","sprintf","humanTimeDiff","createInterpolateElement","addQueryArgs","Icon","__experimentalItemGroup","ItemGroup","backup","SidebarNavigationScreenDetailsPanelRow","SidebarNavigationScreenDetailsPanelLabel","SidebarNavigationScreenDetailsPanelValue","SidebarNavigationItem","SidebarNavigationScreenDetailsFooter","record","otherProps","hrefProps","_links","id","href","revision","as","createElement","className","label","justify","modified","time","dateTime","icon"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-details-footer/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { humanTimeDiff } from '@wordpress/date';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { addQueryArgs } from '@wordpress/url';\nimport {\n\tIcon,\n\t__experimentalItemGroup as ItemGroup,\n} from '@wordpress/components';\nimport { backup } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport {\n\tSidebarNavigationScreenDetailsPanelRow,\n\tSidebarNavigationScreenDetailsPanelLabel,\n\tSidebarNavigationScreenDetailsPanelValue,\n} from '../sidebar-navigation-screen-details-panel';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\n\nexport default function SidebarNavigationScreenDetailsFooter( {\n\trecord,\n\t...otherProps\n} ) {\n\t/*\n\t * There might be other items in the future,\n\t * but for now it's just modified date.\n\t * Later we might render a list of items and isolate\n\t * the following logic.\n\t */\n\tconst hrefProps = {};\n\tif ( record?._links?.[ 'predecessor-version' ]?.[ 0 ]?.id ) {\n\t\threfProps.href = addQueryArgs( 'revision.php', {\n\t\t\trevision: record?._links[ 'predecessor-version' ][ 0 ].id,\n\t\t} );\n\t\threfProps.as = 'a';\n\t}\n\n\treturn (\n\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-details-footer\">\n\t\t\t<SidebarNavigationItem\n\t\t\t\tlabel={ __( 'Revisions' ) }\n\t\t\t\t{ ...hrefProps }\n\t\t\t\t{ ...otherProps }\n\t\t\t>\n\t\t\t\t<SidebarNavigationScreenDetailsPanelRow justify=\"space-between\">\n\t\t\t\t\t<SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t\t{ __( 'Last modified' ) }\n\t\t\t\t\t</SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t<SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: is the relative time when the post was last modified. */\n\t\t\t\t\t\t\t\t__( '<time>%s</time>' ),\n\t\t\t\t\t\t\t\thumanTimeDiff( record.modified )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttime: <time dateTime={ record.modified } />,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t</SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-details-footer__icon\"\n\t\t\t\t\t\ticon={ backup }\n\t\t\t\t\t/>\n\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t</SidebarNavigationItem>\n\t\t</ItemGroup>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,wBAAwB,QAAQ,oBAAoB;AAC7D,SAASC,YAAY,QAAQ,gBAAgB;AAC7C,SACCC,IAAI,EACJC,uBAAuB,IAAIC,SAAS,QAC9B,uBAAuB;AAC9B,SAASC,MAAM,QAAQ,kBAAkB;;AAEzC;AACA;AACA;AACA,SACCC,sCAAsC,EACtCC,wCAAwC,EACxCC,wCAAwC,QAClC,4CAA4C;AACnD,OAAOC,qBAAqB,MAAM,4BAA4B;AAE9D,eAAe,SAASC,oCAAoCA,CAAE;EAC7DC,MAAM;EACN,GAAGC;AACJ,CAAC,EAAG;EACH;AACD;AACA;AACA;AACA;AACA;EACC,MAAMC,SAAS,GAAG,CAAC,CAAC;EACpB,IAAKF,MAAM,EAAEG,MAAM,GAAI,qBAAqB,CAAE,GAAI,CAAC,CAAE,EAAEC,EAAE,EAAG;IAC3DF,SAAS,CAACG,IAAI,GAAGf,YAAY,CAAE,cAAc,EAAE;MAC9CgB,QAAQ,EAAEN,MAAM,EAAEG,MAAM,CAAE,qBAAqB,CAAE,CAAE,CAAC,CAAE,CAACC;IACxD,CAAE,CAAC;IACHF,SAAS,CAACK,EAAE,GAAG,GAAG;EACnB;EAEA,OACCC,aAAA,CAACf,SAAS;IAACgB,SAAS,EAAC;EAAoD,GACxED,aAAA,CAACV,qBAAqB;IACrBY,KAAK,EAAGxB,EAAE,CAAE,WAAY,CAAG;IAAA,GACtBgB,SAAS;IAAA,GACTD;EAAU,GAEfO,aAAA,CAACb,sCAAsC;IAACgB,OAAO,EAAC;EAAe,GAC9DH,aAAA,CAACZ,wCAAwC,QACtCV,EAAE,CAAE,eAAgB,CACmB,CAAC,EAC3CsB,aAAA,CAACX,wCAAwC,QACtCR,wBAAwB,CACzBF,OAAO,EACN;EACAD,EAAE,CAAE,iBAAkB,CAAC,EACvBE,aAAa,CAAEY,MAAM,CAACY,QAAS,CAChC,CAAC,EACD;IACCC,IAAI,EAAEL,aAAA;MAAMM,QAAQ,EAAGd,MAAM,CAACY;IAAU,CAAE;EAC3C,CACD,CACyC,CAAC,EAC3CJ,aAAA,CAACjB,IAAI;IACJkB,SAAS,EAAC,0DAA0D;IACpEM,IAAI,EAAGrB;EAAQ,CACf,CACsC,CAClB,CACb,CAAC;AAEd"}
|
|
@@ -11,13 +11,15 @@ import { __experimentalHStack as HStack } from '@wordpress/components';
|
|
|
11
11
|
export default function SidebarNavigationScreenDetailsPanelRow({
|
|
12
12
|
label,
|
|
13
13
|
children,
|
|
14
|
-
className
|
|
14
|
+
className,
|
|
15
|
+
...extraProps
|
|
15
16
|
}) {
|
|
16
17
|
return createElement(HStack, {
|
|
17
18
|
key: label,
|
|
18
19
|
spacing: 5,
|
|
19
20
|
alignment: "left",
|
|
20
|
-
className: classnames('edit-site-sidebar-navigation-details-screen-panel__row', className)
|
|
21
|
+
className: classnames('edit-site-sidebar-navigation-details-screen-panel__row', className),
|
|
22
|
+
...extraProps
|
|
21
23
|
}, children);
|
|
22
24
|
}
|
|
23
25
|
//# sourceMappingURL=sidebar-navigation-screen-details-panel-row.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["classnames","__experimentalHStack","HStack","SidebarNavigationScreenDetailsPanelRow","label","children","className","createElement","key","spacing","alignment"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __experimentalHStack as HStack } from '@wordpress/components';\n\nexport default function SidebarNavigationScreenDetailsPanelRow( {\n\tlabel,\n\tchildren,\n\tclassName,\n} ) {\n\treturn (\n\t\t<HStack\n\t\t\tkey={ label }\n\t\t\tspacing={ 5 }\n\t\t\talignment=\"left\"\n\t\t\tclassName={ classnames(\n\t\t\t\t'edit-site-sidebar-navigation-details-screen-panel__row',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t>\n\t\t\t{ children }\n\t\t</HStack>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,oBAAoB,IAAIC,MAAM,QAAQ,uBAAuB;AAEtE,eAAe,SAASC,sCAAsCA,CAAE;EAC/DC,KAAK;EACLC,QAAQ;EACRC;
|
|
1
|
+
{"version":3,"names":["classnames","__experimentalHStack","HStack","SidebarNavigationScreenDetailsPanelRow","label","children","className","extraProps","createElement","key","spacing","alignment"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __experimentalHStack as HStack } from '@wordpress/components';\n\nexport default function SidebarNavigationScreenDetailsPanelRow( {\n\tlabel,\n\tchildren,\n\tclassName,\n\t...extraProps\n} ) {\n\treturn (\n\t\t<HStack\n\t\t\tkey={ label }\n\t\t\tspacing={ 5 }\n\t\t\talignment=\"left\"\n\t\t\tclassName={ classnames(\n\t\t\t\t'edit-site-sidebar-navigation-details-screen-panel__row',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\t{ ...extraProps }\n\t\t>\n\t\t\t{ children }\n\t\t</HStack>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,oBAAoB,IAAIC,MAAM,QAAQ,uBAAuB;AAEtE,eAAe,SAASC,sCAAsCA,CAAE;EAC/DC,KAAK;EACLC,QAAQ;EACRC,SAAS;EACT,GAAGC;AACJ,CAAC,EAAG;EACH,OACCC,aAAA,CAACN,MAAM;IACNO,GAAG,EAAGL,KAAO;IACbM,OAAO,EAAG,CAAG;IACbC,SAAS,EAAC,MAAM;IAChBL,SAAS,EAAGN,UAAU,CACrB,wDAAwD,EACxDM,SACD,CAAG;IAAA,GACEC;EAAU,GAEbF,QACK,CAAC;AAEX"}
|
|
@@ -3,13 +3,12 @@ import { createElement, Fragment } from "@wordpress/element";
|
|
|
3
3
|
* WordPress dependencies
|
|
4
4
|
*/
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
|
-
import {
|
|
6
|
+
import { edit, seen } from '@wordpress/icons';
|
|
7
7
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
8
8
|
import { store as coreStore } from '@wordpress/core-data';
|
|
9
|
-
import {
|
|
9
|
+
import { __experimentalNavigatorButton as NavigatorButton } from '@wordpress/components';
|
|
10
10
|
import { useViewportMatch } from '@wordpress/compose';
|
|
11
11
|
import { BlockEditorProvider } from '@wordpress/block-editor';
|
|
12
|
-
import { humanTimeDiff } from '@wordpress/date';
|
|
13
12
|
import { useCallback } from '@wordpress/element';
|
|
14
13
|
|
|
15
14
|
/**
|
|
@@ -23,6 +22,7 @@ import SidebarButton from '../sidebar-button';
|
|
|
23
22
|
import SidebarNavigationItem from '../sidebar-navigation-item';
|
|
24
23
|
import StyleBook from '../style-book';
|
|
25
24
|
import useGlobalStylesRevisions from '../global-styles/screen-revisions/use-global-styles-revisions';
|
|
25
|
+
import SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';
|
|
26
26
|
const noop = () => {};
|
|
27
27
|
export function SidebarNavigationItemGlobalStyles(props) {
|
|
28
28
|
const {
|
|
@@ -72,33 +72,6 @@ function SidebarNavigationScreenGlobalStylesContent() {
|
|
|
72
72
|
onInput: noop
|
|
73
73
|
}, createElement(StyleVariationsContainer, null));
|
|
74
74
|
}
|
|
75
|
-
function SidebarNavigationScreenGlobalStylesFooter({
|
|
76
|
-
modifiedDateTime,
|
|
77
|
-
onClickRevisions
|
|
78
|
-
}) {
|
|
79
|
-
return createElement(VStack, {
|
|
80
|
-
className: "edit-site-sidebar-navigation-screen-global-styles__footer"
|
|
81
|
-
}, createElement(SidebarNavigationItem, {
|
|
82
|
-
className: "edit-site-sidebar-navigation-screen-global-styles__revisions",
|
|
83
|
-
label: __('Revisions'),
|
|
84
|
-
onClick: onClickRevisions
|
|
85
|
-
}, createElement(HStack, {
|
|
86
|
-
as: "span",
|
|
87
|
-
alignment: "center",
|
|
88
|
-
spacing: 5,
|
|
89
|
-
direction: "row",
|
|
90
|
-
justify: "space-between"
|
|
91
|
-
}, createElement("span", {
|
|
92
|
-
className: "edit-site-sidebar-navigation-screen-global-styles__revisions__label"
|
|
93
|
-
}, __('Last modified')), createElement("span", null, createElement("time", {
|
|
94
|
-
dateTime: modifiedDateTime
|
|
95
|
-
}, humanTimeDiff(modifiedDateTime))), createElement(Icon, {
|
|
96
|
-
icon: backup,
|
|
97
|
-
style: {
|
|
98
|
-
fill: 'currentcolor'
|
|
99
|
-
}
|
|
100
|
-
}))));
|
|
101
|
-
}
|
|
102
75
|
export default function SidebarNavigationScreenGlobalStyles() {
|
|
103
76
|
const {
|
|
104
77
|
revisions,
|
|
@@ -163,9 +136,9 @@ export default function SidebarNavigationScreenGlobalStyles() {
|
|
|
163
136
|
title: __('Styles'),
|
|
164
137
|
description: __('Choose a different style combination for the theme styles.'),
|
|
165
138
|
content: createElement(SidebarNavigationScreenGlobalStylesContent, null),
|
|
166
|
-
footer: shouldShowGlobalStylesFooter && createElement(
|
|
167
|
-
|
|
168
|
-
|
|
139
|
+
footer: shouldShowGlobalStylesFooter && createElement(SidebarNavigationScreenDetailsFooter, {
|
|
140
|
+
record: revisions?.[0],
|
|
141
|
+
onClick: openRevisions
|
|
169
142
|
}),
|
|
170
143
|
actions: createElement(Fragment, null, !isMobileViewport && createElement(SidebarButton, {
|
|
171
144
|
icon: seen,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","backup","edit","seen","useSelect","useDispatch","store","coreStore","Icon","__experimentalNavigatorButton","NavigatorButton","__experimentalVStack","HStack","VStack","useViewportMatch","BlockEditorProvider","humanTimeDiff","useCallback","SidebarNavigationScreen","StyleVariationsContainer","unlock","editSiteStore","SidebarButton","SidebarNavigationItem","StyleBook","useGlobalStylesRevisions","noop","SidebarNavigationItemGlobalStyles","props","openGeneralSidebar","setCanvasMode","hasGlobalStyleVariations","select","__experimentalGetCurrentThemeGlobalStylesVariations","length","createElement","as","path","onClick","SidebarNavigationScreenGlobalStylesContent","storedSettings","getSettings","settings","onChange","onInput","SidebarNavigationScreenGlobalStylesFooter","modifiedDateTime","onClickRevisions","className","label","alignment","spacing","direction","justify","dateTime","icon","style","fill","SidebarNavigationScreenGlobalStyles","revisions","isLoading","isLoadingRevisions","setIsListViewOpened","isMobileViewport","setEditorCanvasContainerView","isViewMode","isStyleBookOpened","revisionsCount","_globalStyles$_links$","getCanvasMode","getEditorCanvasContainerView","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","count","openGlobalStyles","Promise","all","openStyleBook","openRevisions","hasRevisions","modified","shouldShowGlobalStylesFooter","Fragment","title","description","content","footer","actions","isPressed","enableResizing","isSelected","onSelect","showCloseButton","showTabs"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { backup, edit, seen } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tIcon,\n\t__experimentalNavigatorButton as NavigatorButton,\n\t__experimentalVStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { BlockEditorProvider } from '@wordpress/block-editor';\nimport { humanTimeDiff } from '@wordpress/date';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport StyleVariationsContainer from '../global-styles/style-variations-container';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport SidebarButton from '../sidebar-button';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport StyleBook from '../style-book';\nimport useGlobalStylesRevisions from '../global-styles/screen-revisions/use-global-styles-revisions';\n\nconst noop = () => {};\n\nexport function SidebarNavigationItemGlobalStyles( props ) {\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\n\tconst hasGlobalStyleVariations = useSelect(\n\t\t( select ) =>\n\t\t\t!! select(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations()?.length,\n\t\t[]\n\t);\n\tif ( hasGlobalStyleVariations ) {\n\t\treturn (\n\t\t\t<NavigatorButton\n\t\t\t\t{ ...props }\n\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\tpath=\"/wp_global_styles\"\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<SidebarNavigationItem\n\t\t\t{ ...props }\n\t\t\tonClick={ () => {\n\t\t\t\t// Switch to edit mode.\n\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t\t// Open global styles sidebar.\n\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction SidebarNavigationScreenGlobalStylesContent() {\n\tconst { storedSettings } = useSelect( ( select ) => {\n\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\n\t\treturn {\n\t\t\tstoredSettings: getSettings( false ),\n\t\t};\n\t}, [] );\n\n\t// Wrap in a BlockEditorProvider to ensure that the Iframe's dependencies are\n\t// loaded. This is necessary because the Iframe component waits until\n\t// the block editor store's `__internalIsInitialized` is true before\n\t// rendering the iframe. Without this, the iframe previews will not render\n\t// in mobile viewport sizes, where the editor canvas is hidden.\n\treturn (\n\t\t<BlockEditorProvider\n\t\t\tsettings={ storedSettings }\n\t\t\tonChange={ noop }\n\t\t\tonInput={ noop }\n\t\t>\n\t\t\t<StyleVariationsContainer />\n\t\t</BlockEditorProvider>\n\t);\n}\n\nfunction SidebarNavigationScreenGlobalStylesFooter( {\n\tmodifiedDateTime,\n\tonClickRevisions,\n} ) {\n\treturn (\n\t\t<VStack className=\"edit-site-sidebar-navigation-screen-global-styles__footer\">\n\t\t\t<SidebarNavigationItem\n\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-global-styles__revisions\"\n\t\t\t\tlabel={ __( 'Revisions' ) }\n\t\t\t\tonClick={ onClickRevisions }\n\t\t\t>\n\t\t\t\t<HStack\n\t\t\t\t\tas=\"span\"\n\t\t\t\t\talignment=\"center\"\n\t\t\t\t\tspacing={ 5 }\n\t\t\t\t\tdirection=\"row\"\n\t\t\t\t\tjustify=\"space-between\"\n\t\t\t\t>\n\t\t\t\t\t<span className=\"edit-site-sidebar-navigation-screen-global-styles__revisions__label\">\n\t\t\t\t\t\t{ __( 'Last modified' ) }\n\t\t\t\t\t</span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<time dateTime={ modifiedDateTime }>\n\t\t\t\t\t\t\t{ humanTimeDiff( modifiedDateTime ) }\n\t\t\t\t\t\t</time>\n\t\t\t\t\t</span>\n\t\t\t\t\t<Icon icon={ backup } style={ { fill: 'currentcolor' } } />\n\t\t\t\t</HStack>\n\t\t\t</SidebarNavigationItem>\n\t\t</VStack>\n\t);\n}\n\nexport default function SidebarNavigationScreenGlobalStyles() {\n\tconst { revisions, isLoading: isLoadingRevisions } =\n\t\tuseGlobalStylesRevisions();\n\tconst { openGeneralSidebar, setIsListViewOpened } =\n\t\tuseDispatch( editSiteStore );\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst { setCanvasMode, setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { isViewMode, isStyleBookOpened, revisionsCount } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCanvasMode, getEditorCanvasContainerView } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\t\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\t\tconst globalStyles = globalStylesId\n\t\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t\t: undefined;\n\t\t\treturn {\n\t\t\t\tisViewMode: 'view' === getCanvasMode(),\n\t\t\t\tisStyleBookOpened:\n\t\t\t\t\t'style-book' === getEditorCanvasContainerView(),\n\t\t\t\trevisionsCount:\n\t\t\t\t\tglobalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ??\n\t\t\t\t\t0,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst openGlobalStyles = useCallback( async () => {\n\t\treturn Promise.all( [\n\t\t\tsetCanvasMode( 'edit' ),\n\t\t\topenGeneralSidebar( 'edit-site/global-styles' ),\n\t\t] );\n\t}, [ setCanvasMode, openGeneralSidebar ] );\n\n\tconst openStyleBook = useCallback( async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the Style Book once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. This ensures that\n\t\t// the Style Book is not prematurely closed.\n\t\tsetEditorCanvasContainerView( 'style-book' );\n\t\tsetIsListViewOpened( false );\n\t}, [\n\t\topenGlobalStyles,\n\t\tsetEditorCanvasContainerView,\n\t\tsetIsListViewOpened,\n\t] );\n\n\tconst openRevisions = useCallback( async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the global styles revisions once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. The global styles UI is responsible\n\t\t// for redirecting to the revisions screen once the editor canvas container\n\t\t// has been set to 'global-styles-revisions'.\n\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t}, [ openGlobalStyles, setEditorCanvasContainerView ] );\n\n\t// If there are no revisions, do not render a footer.\n\tconst hasRevisions = revisionsCount > 0;\n\tconst modifiedDateTime = revisions?.[ 0 ]?.modified;\n\tconst shouldShowGlobalStylesFooter =\n\t\thasRevisions && ! isLoadingRevisions && modifiedDateTime;\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationScreen\n\t\t\t\ttitle={ __( 'Styles' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Choose a different style combination for the theme styles.'\n\t\t\t\t) }\n\t\t\t\tcontent={ <SidebarNavigationScreenGlobalStylesContent /> }\n\t\t\t\tfooter={\n\t\t\t\t\tshouldShowGlobalStylesFooter && (\n\t\t\t\t\t\t<SidebarNavigationScreenGlobalStylesFooter\n\t\t\t\t\t\t\tmodifiedDateTime={ modifiedDateTime }\n\t\t\t\t\t\t\tonClickRevisions={ openRevisions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isMobileViewport && (\n\t\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t\t\t\t\t\t\t! isStyleBookOpened\n\t\t\t\t\t\t\t\t\t\t\t? 'style-book'\n\t\t\t\t\t\t\t\t\t\t\t: undefined\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\tisPressed={ isStyleBookOpened }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\ticon={ edit }\n\t\t\t\t\t\t\tlabel={ __( 'Edit styles' ) }\n\t\t\t\t\t\t\tonClick={ async () => await openGlobalStyles() }\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\t{ isStyleBookOpened && ! isMobileViewport && isViewMode && (\n\t\t\t\t<StyleBook\n\t\t\t\t\tenableResizing={ false }\n\t\t\t\t\tisSelected={ () => false }\n\t\t\t\t\tonClick={ openStyleBook }\n\t\t\t\t\tonSelect={ openStyleBook }\n\t\t\t\t\tshowCloseButton={ false }\n\t\t\t\t\tshowTabs={ false }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,EAAEC,IAAI,EAAEC,IAAI,QAAQ,kBAAkB;AACrD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SACCC,IAAI,EACJC,6BAA6B,IAAIC,eAAe,EAChDC,oBAAoB,IAAIC,MAAM,EAC9BD,oBAAoB,IAAIE,MAAM,QACxB,uBAAuB;AAC9B,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,mBAAmB,QAAQ,yBAAyB;AAC7D,SAASC,aAAa,QAAQ,iBAAiB;AAC/C,SAASC,WAAW,QAAQ,oBAAoB;;AAEhD;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,OAAOC,wBAAwB,MAAM,6CAA6C;A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AC7BsC,OAAO,EAAG,MAAAA,CAAA,KAAY,MAAMwC,gBAAgB,CAAC;IAAG,CAChD,CACA;EACF,CACD,CAAC,EACAZ,iBAAiB,IAAI,CAAEH,gBAAgB,IAAIE,UAAU,IACtD9B,aAAA,CAACX,SAAS;IACTqE,cAAc,EAAG,KAAO;IACxBC,UAAU,EAAGA,CAAA,KAAM,KAAO;IAC1BxD,OAAO,EAAG2C,aAAe;IACzBc,QAAQ,EAAGd,aAAe;IAC1Be,eAAe,EAAG,KAAO;IACzBC,QAAQ,EAAG;EAAO,CAClB,CAED,CAAC;AAEL"}
|
|
1
|
+
{"version":3,"names":["__","edit","seen","useSelect","useDispatch","store","coreStore","__experimentalNavigatorButton","NavigatorButton","useViewportMatch","BlockEditorProvider","useCallback","SidebarNavigationScreen","StyleVariationsContainer","unlock","editSiteStore","SidebarButton","SidebarNavigationItem","StyleBook","useGlobalStylesRevisions","SidebarNavigationScreenDetailsFooter","noop","SidebarNavigationItemGlobalStyles","props","openGeneralSidebar","setCanvasMode","hasGlobalStyleVariations","select","__experimentalGetCurrentThemeGlobalStylesVariations","length","createElement","as","path","onClick","SidebarNavigationScreenGlobalStylesContent","storedSettings","getSettings","settings","onChange","onInput","SidebarNavigationScreenGlobalStyles","revisions","isLoading","isLoadingRevisions","setIsListViewOpened","isMobileViewport","setEditorCanvasContainerView","isViewMode","isStyleBookOpened","revisionsCount","_globalStyles$_links$","getCanvasMode","getEditorCanvasContainerView","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","count","openGlobalStyles","Promise","all","openStyleBook","openRevisions","hasRevisions","modifiedDateTime","modified","shouldShowGlobalStylesFooter","Fragment","title","description","content","footer","record","actions","icon","label","isPressed","enableResizing","isSelected","onSelect","showCloseButton","showTabs"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { edit, seen } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __experimentalNavigatorButton as NavigatorButton } from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { BlockEditorProvider } from '@wordpress/block-editor';\nimport { useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport StyleVariationsContainer from '../global-styles/style-variations-container';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport SidebarButton from '../sidebar-button';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport StyleBook from '../style-book';\nimport useGlobalStylesRevisions from '../global-styles/screen-revisions/use-global-styles-revisions';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\n\nconst noop = () => {};\n\nexport function SidebarNavigationItemGlobalStyles( props ) {\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\n\tconst hasGlobalStyleVariations = useSelect(\n\t\t( select ) =>\n\t\t\t!! select(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations()?.length,\n\t\t[]\n\t);\n\tif ( hasGlobalStyleVariations ) {\n\t\treturn (\n\t\t\t<NavigatorButton\n\t\t\t\t{ ...props }\n\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\tpath=\"/wp_global_styles\"\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<SidebarNavigationItem\n\t\t\t{ ...props }\n\t\t\tonClick={ () => {\n\t\t\t\t// Switch to edit mode.\n\t\t\t\tsetCanvasMode( 'edit' );\n\t\t\t\t// Open global styles sidebar.\n\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nfunction SidebarNavigationScreenGlobalStylesContent() {\n\tconst { storedSettings } = useSelect( ( select ) => {\n\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\n\t\treturn {\n\t\t\tstoredSettings: getSettings( false ),\n\t\t};\n\t}, [] );\n\n\t// Wrap in a BlockEditorProvider to ensure that the Iframe's dependencies are\n\t// loaded. This is necessary because the Iframe component waits until\n\t// the block editor store's `__internalIsInitialized` is true before\n\t// rendering the iframe. Without this, the iframe previews will not render\n\t// in mobile viewport sizes, where the editor canvas is hidden.\n\treturn (\n\t\t<BlockEditorProvider\n\t\t\tsettings={ storedSettings }\n\t\t\tonChange={ noop }\n\t\t\tonInput={ noop }\n\t\t>\n\t\t\t<StyleVariationsContainer />\n\t\t</BlockEditorProvider>\n\t);\n}\n\nexport default function SidebarNavigationScreenGlobalStyles() {\n\tconst { revisions, isLoading: isLoadingRevisions } =\n\t\tuseGlobalStylesRevisions();\n\tconst { openGeneralSidebar, setIsListViewOpened } =\n\t\tuseDispatch( editSiteStore );\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst { setCanvasMode, setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { isViewMode, isStyleBookOpened, revisionsCount } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getCanvasMode, getEditorCanvasContainerView } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\t\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\t\tconst globalStyles = globalStylesId\n\t\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t\t: undefined;\n\t\t\treturn {\n\t\t\t\tisViewMode: 'view' === getCanvasMode(),\n\t\t\t\tisStyleBookOpened:\n\t\t\t\t\t'style-book' === getEditorCanvasContainerView(),\n\t\t\t\trevisionsCount:\n\t\t\t\t\tglobalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ??\n\t\t\t\t\t0,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst openGlobalStyles = useCallback( async () => {\n\t\treturn Promise.all( [\n\t\t\tsetCanvasMode( 'edit' ),\n\t\t\topenGeneralSidebar( 'edit-site/global-styles' ),\n\t\t] );\n\t}, [ setCanvasMode, openGeneralSidebar ] );\n\n\tconst openStyleBook = useCallback( async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the Style Book once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. This ensures that\n\t\t// the Style Book is not prematurely closed.\n\t\tsetEditorCanvasContainerView( 'style-book' );\n\t\tsetIsListViewOpened( false );\n\t}, [\n\t\topenGlobalStyles,\n\t\tsetEditorCanvasContainerView,\n\t\tsetIsListViewOpened,\n\t] );\n\n\tconst openRevisions = useCallback( async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the global styles revisions once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. The global styles UI is responsible\n\t\t// for redirecting to the revisions screen once the editor canvas container\n\t\t// has been set to 'global-styles-revisions'.\n\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t}, [ openGlobalStyles, setEditorCanvasContainerView ] );\n\n\t// If there are no revisions, do not render a footer.\n\tconst hasRevisions = revisionsCount > 0;\n\tconst modifiedDateTime = revisions?.[ 0 ]?.modified;\n\tconst shouldShowGlobalStylesFooter =\n\t\thasRevisions && ! isLoadingRevisions && modifiedDateTime;\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationScreen\n\t\t\t\ttitle={ __( 'Styles' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Choose a different style combination for the theme styles.'\n\t\t\t\t) }\n\t\t\t\tcontent={ <SidebarNavigationScreenGlobalStylesContent /> }\n\t\t\t\tfooter={\n\t\t\t\t\tshouldShowGlobalStylesFooter && (\n\t\t\t\t\t\t<SidebarNavigationScreenDetailsFooter\n\t\t\t\t\t\t\trecord={ revisions?.[ 0 ] }\n\t\t\t\t\t\t\tonClick={ openRevisions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isMobileViewport && (\n\t\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t\t\t\t\t\t\t! isStyleBookOpened\n\t\t\t\t\t\t\t\t\t\t\t? 'style-book'\n\t\t\t\t\t\t\t\t\t\t\t: undefined\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\tisPressed={ isStyleBookOpened }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\ticon={ edit }\n\t\t\t\t\t\t\tlabel={ __( 'Edit styles' ) }\n\t\t\t\t\t\t\tonClick={ async () => await openGlobalStyles() }\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\t{ isStyleBookOpened && ! isMobileViewport && isViewMode && (\n\t\t\t\t<StyleBook\n\t\t\t\t\tenableResizing={ false }\n\t\t\t\t\tisSelected={ () => false }\n\t\t\t\t\tonClick={ openStyleBook }\n\t\t\t\t\tonSelect={ openStyleBook }\n\t\t\t\t\tshowCloseButton={ false }\n\t\t\t\t\tshowTabs={ false }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,IAAI,EAAEC,IAAI,QAAQ,kBAAkB;AAC7C,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,6BAA6B,IAAIC,eAAe,QAAQ,uBAA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AA,CAAAuC,QAAA,QACCvC,aAAA,CAAClB,uBAAuB;IACvB0D,KAAK,EAAGtE,EAAE,CAAE,QAAS,CAAG;IACxBuE,WAAW,EAAGvE,EAAE,CACf,4DACD,CAAG;IACHwE,OAAO,EAAG1C,aAAA,CAACI,0CAA0C,MAAE,CAAG;IAC1DuC,MAAM,EACLL,4BAA4B,IAC3BtC,aAAA,CAACV,oCAAoC;MACpCsD,MAAM,EAAGjC,SAAS,GAAI,CAAC,CAAI;MAC3BR,OAAO,EAAG+B;IAAe,CACzB,CAEF;IACDW,OAAO,EACN7C,aAAA,CAAAuC,QAAA,QACG,CAAExB,gBAAgB,IACnBf,aAAA,CAACd,aAAa;MACb4D,IAAI,EAAG1E,IAAM;MACb2E,KAAK,EAAG7E,EAAE,CAAE,YAAa,CAAG;MAC5BiC,OAAO,EAAGA,CAAA,KACTa,4BAA4B,CAC3B,CAAEE,iBAAiB,GAChB,YAAY,GACZS,SACJ,CACA;MACDqB,SAAS,EAAG9B;IAAmB,CAC/B,CACD,EACDlB,aAAA,CAACd,aAAa;MACb4D,IAAI,EAAG3E,IAAM;MACb4E,KAAK,EAAG7E,EAAE,CAAE,aAAc,CAAG;MAC7BiC,OAAO,EAAG,MAAAA,CAAA,KAAY,MAAM2B,gBAAgB,CAAC;IAAG,CAChD,CACA;EACF,CACD,CAAC,EACAZ,iBAAiB,IAAI,CAAEH,gBAAgB,IAAIE,UAAU,IACtDjB,aAAA,CAACZ,SAAS;IACT6D,cAAc,EAAG,KAAO;IACxBC,UAAU,EAAGA,CAAA,KAAM,KAAO;IAC1B/C,OAAO,EAAG8B,aAAe;IACzBkB,QAAQ,EAAGlB,aAAe;IAC1BmB,eAAe,EAAG,KAAO;IACzBC,QAAQ,EAAG;EAAO,CAClB,CAED,CAAC;AAEL"}
|
|
@@ -9,12 +9,13 @@ import { pencil } from '@wordpress/icons';
|
|
|
9
9
|
*/
|
|
10
10
|
import SidebarButton from '../sidebar-button';
|
|
11
11
|
import { useLink } from '../routes/link';
|
|
12
|
+
import { NAVIGATION_POST_TYPE } from '../../utils/constants';
|
|
12
13
|
export default function EditButton({
|
|
13
14
|
postId
|
|
14
15
|
}) {
|
|
15
16
|
const linkInfo = useLink({
|
|
16
17
|
postId,
|
|
17
|
-
postType:
|
|
18
|
+
postType: NAVIGATION_POST_TYPE,
|
|
18
19
|
canvas: 'edit'
|
|
19
20
|
});
|
|
20
21
|
return createElement(SidebarButton, {
|
package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","pencil","SidebarButton","useLink","EditButton","postId","linkInfo","postType","canvas","createElement","label","icon"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { pencil } from '@wordpress/icons';\n/**\n * Internal dependencies\n */\nimport SidebarButton from '../sidebar-button';\nimport { useLink } from '../routes/link';\n\nexport default function EditButton( { postId } ) {\n\tconst linkInfo = useLink( {\n\t\tpostId,\n\t\tpostType:
|
|
1
|
+
{"version":3,"names":["__","pencil","SidebarButton","useLink","NAVIGATION_POST_TYPE","EditButton","postId","linkInfo","postType","canvas","createElement","label","icon"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { pencil } from '@wordpress/icons';\n/**\n * Internal dependencies\n */\nimport SidebarButton from '../sidebar-button';\nimport { useLink } from '../routes/link';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\n\nexport default function EditButton( { postId } ) {\n\tconst linkInfo = useLink( {\n\t\tpostId,\n\t\tpostType: NAVIGATION_POST_TYPE,\n\t\tcanvas: 'edit',\n\t} );\n\treturn (\n\t\t<SidebarButton { ...linkInfo } label={ __( 'Edit' ) } icon={ pencil } />\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,QAAQ,kBAAkB;AACzC;AACA;AACA;AACA,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,SAASC,OAAO,QAAQ,gBAAgB;AACxC,SAASC,oBAAoB,QAAQ,uBAAuB;AAE5D,eAAe,SAASC,UAAUA,CAAE;EAAEC;AAAO,CAAC,EAAG;EAChD,MAAMC,QAAQ,GAAGJ,OAAO,CAAE;IACzBG,MAAM;IACNE,QAAQ,EAAEJ,oBAAoB;IAC9BK,MAAM,EAAE;EACT,CAAE,CAAC;EACH,OACCC,aAAA,CAACR,aAAa;IAAA,GAAMK,QAAQ;IAAGI,KAAK,EAAGX,EAAE,CAAE,MAAO,CAAG;IAACY,IAAI,EAAGX;EAAQ,CAAE,CAAC;AAE1E"}
|
|
@@ -6,10 +6,12 @@ import { __experimentalUseNavigator as useNavigator } from '@wordpress/component
|
|
|
6
6
|
import { __, sprintf } from '@wordpress/i18n';
|
|
7
7
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
8
8
|
import { store as noticesStore } from '@wordpress/notices';
|
|
9
|
+
|
|
9
10
|
/**
|
|
10
11
|
* Internal dependencies
|
|
11
12
|
*/
|
|
12
13
|
import { postType } from '.';
|
|
14
|
+
import { NAVIGATION_POST_TYPE } from '../../utils/constants';
|
|
13
15
|
function useDeleteNavigationMenu() {
|
|
14
16
|
const {
|
|
15
17
|
goTo
|
|
@@ -67,7 +69,7 @@ function useSaveNavigationMenu() {
|
|
|
67
69
|
}
|
|
68
70
|
const postId = navigationMenu?.id;
|
|
69
71
|
// Prepare for revert in case of error.
|
|
70
|
-
const originalRecord = getEditedEntityRecord('postType',
|
|
72
|
+
const originalRecord = getEditedEntityRecord('postType', NAVIGATION_POST_TYPE, postId);
|
|
71
73
|
|
|
72
74
|
// Apply the edits.
|
|
73
75
|
editEntityRecord('postType', postType, postId, edits);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["store","coreStore","__experimentalUseNavigator","useNavigator","__","sprintf","useSelect","useDispatch","noticesStore","postType","useDeleteNavigationMenu","goTo","deleteEntityRecord","createSuccessNotice","createErrorNotice","handleDelete","navigationMenu","postId","id","force","throwOnError","type","error","message","useSaveNavigationMenu","getEditedEntityRecord","select","getEditedEntityRecordSelector","editEntityRecord","__experimentalSaveSpecifiedEntityEdits","saveSpecifiedEntityEdits","handleSave","edits","originalRecord","recordPropertiesToSave","Object","keys","useDuplicateNavigationMenu","saveEntityRecord","handleDuplicate","menuTitle","title","rendered","slug","savedRecord","content","raw","status","useNavigationMenuHandlers"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __experimentalUseNavigator as useNavigator } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\n/**\n * Internal dependencies\n */\nimport { postType } from '.';\n\nfunction useDeleteNavigationMenu() {\n\tconst { goTo } = useNavigator();\n\n\tconst { deleteEntityRecord } = useDispatch( coreStore );\n\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst handleDelete = async ( navigationMenu ) => {\n\t\tconst postId = navigationMenu?.id;\n\t\ttry {\n\t\t\tawait deleteEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId,\n\t\t\t\t{\n\t\t\t\t\tforce: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\t\t\tcreateSuccessNotice( __( 'Deleted Navigation menu' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t\tgoTo( '/navigation' );\n\t\t} catch ( error ) {\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be deleted. */\n\t\t\t\t\t__( `Unable to delete Navigation menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleDelete;\n}\n\nfunction useSaveNavigationMenu() {\n\tconst { getEditedEntityRecord } = useSelect( ( select ) => {\n\t\tconst { getEditedEntityRecord: getEditedEntityRecordSelector } =\n\t\t\tselect( coreStore );\n\n\t\treturn {\n\t\t\tgetEditedEntityRecord: getEditedEntityRecordSelector,\n\t\t};\n\t}, [] );\n\n\tconst {\n\t\teditEntityRecord,\n\t\t__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits,\n\t} = useDispatch( coreStore );\n\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst handleSave = async ( navigationMenu, edits ) => {\n\t\tif ( ! edits ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst postId = navigationMenu?.id;\n\t\t// Prepare for revert in case of error.\n\t\tconst originalRecord = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\
|
|
1
|
+
{"version":3,"names":["store","coreStore","__experimentalUseNavigator","useNavigator","__","sprintf","useSelect","useDispatch","noticesStore","postType","NAVIGATION_POST_TYPE","useDeleteNavigationMenu","goTo","deleteEntityRecord","createSuccessNotice","createErrorNotice","handleDelete","navigationMenu","postId","id","force","throwOnError","type","error","message","useSaveNavigationMenu","getEditedEntityRecord","select","getEditedEntityRecordSelector","editEntityRecord","__experimentalSaveSpecifiedEntityEdits","saveSpecifiedEntityEdits","handleSave","edits","originalRecord","recordPropertiesToSave","Object","keys","useDuplicateNavigationMenu","saveEntityRecord","handleDuplicate","menuTitle","title","rendered","slug","savedRecord","content","raw","status","useNavigationMenuHandlers"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __experimentalUseNavigator as useNavigator } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { postType } from '.';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\n\nfunction useDeleteNavigationMenu() {\n\tconst { goTo } = useNavigator();\n\n\tconst { deleteEntityRecord } = useDispatch( coreStore );\n\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst handleDelete = async ( navigationMenu ) => {\n\t\tconst postId = navigationMenu?.id;\n\t\ttry {\n\t\t\tawait deleteEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId,\n\t\t\t\t{\n\t\t\t\t\tforce: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\t\t\tcreateSuccessNotice( __( 'Deleted Navigation menu' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t\tgoTo( '/navigation' );\n\t\t} catch ( error ) {\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be deleted. */\n\t\t\t\t\t__( `Unable to delete Navigation menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleDelete;\n}\n\nfunction useSaveNavigationMenu() {\n\tconst { getEditedEntityRecord } = useSelect( ( select ) => {\n\t\tconst { getEditedEntityRecord: getEditedEntityRecordSelector } =\n\t\t\tselect( coreStore );\n\n\t\treturn {\n\t\t\tgetEditedEntityRecord: getEditedEntityRecordSelector,\n\t\t};\n\t}, [] );\n\n\tconst {\n\t\teditEntityRecord,\n\t\t__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits,\n\t} = useDispatch( coreStore );\n\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst handleSave = async ( navigationMenu, edits ) => {\n\t\tif ( ! edits ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst postId = navigationMenu?.id;\n\t\t// Prepare for revert in case of error.\n\t\tconst originalRecord = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\tNAVIGATION_POST_TYPE,\n\t\t\tpostId\n\t\t);\n\n\t\t// Apply the edits.\n\t\teditEntityRecord( 'postType', postType, postId, edits );\n\n\t\tconst recordPropertiesToSave = Object.keys( edits );\n\n\t\t// Attempt to persist.\n\t\ttry {\n\t\t\tawait saveSpecifiedEntityEdits(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId,\n\t\t\t\trecordPropertiesToSave,\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\t\t\tcreateSuccessNotice( __( 'Renamed Navigation menu' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\t// Revert to original in case of error.\n\t\t\teditEntityRecord( 'postType', postType, postId, originalRecord );\n\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be renamed. */\n\t\t\t\t\t__( `Unable to rename Navigation menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleSave;\n}\n\nfunction useDuplicateNavigationMenu() {\n\tconst { goTo } = useNavigator();\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst handleDuplicate = async ( navigationMenu ) => {\n\t\tconst menuTitle =\n\t\t\tnavigationMenu?.title?.rendered || navigationMenu?.slug;\n\n\t\ttry {\n\t\t\tconst savedRecord = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\t{\n\t\t\t\t\ttitle: sprintf(\n\t\t\t\t\t\t/* translators: %s: Navigation menu title */\n\t\t\t\t\t\t__( '%s (Copy)' ),\n\t\t\t\t\t\tmenuTitle\n\t\t\t\t\t),\n\t\t\t\t\tcontent: navigationMenu?.content?.raw,\n\t\t\t\t\tstatus: 'publish',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( savedRecord ) {\n\t\t\t\tcreateSuccessNotice( __( 'Duplicated Navigation menu' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\t\tgoTo( `/navigation/${ postType }/${ savedRecord.id }` );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be deleted. */\n\t\t\t\t\t__( `Unable to duplicate Navigation menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleDuplicate;\n}\n\nexport default function useNavigationMenuHandlers() {\n\treturn {\n\t\thandleDelete: useDeleteNavigationMenu(),\n\t\thandleSave: useSaveNavigationMenu(),\n\t\thandleDuplicate: useDuplicateNavigationMenu(),\n\t};\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,0BAA0B,IAAIC,YAAY,QAAQ,uBAAuB;AAClF,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7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CAAC,GAAGhC,WAAW,CAAEN,SAAU,CAAC;EAErD,MAAM;IAAEa,mBAAmB;IAAEC;EAAkB,CAAC,GAC/CR,WAAW,CAAEC,YAAa,CAAC;EAE5B,MAAMgC,eAAe,GAAG,MAAQvB,cAAc,IAAM;IACnD,MAAMwB,SAAS,GACdxB,cAAc,EAAEyB,KAAK,EAAEC,QAAQ,IAAI1B,cAAc,EAAE2B,IAAI;IAExD,IAAI;MACH,MAAMC,WAAW,GAAG,MAAMN,gBAAgB,CACzC,UAAU,EACV9B,QAAQ,EACR;QACCiC,KAAK,EAAErC,OAAO,EACb;QACAD,EAAE,CAAE,WAAY,CAAC,EACjBqC,SACD,CAAC;QACDK,OAAO,EAAE7B,cAAc,EAAE6B,OAAO,EAAEC,GAAG;QACrCC,MAAM,EAAE;MACT,CAAC,EACD;QACC3B,YAAY,EAAE;MACf,CACD,CAAC;MAED,IAAKwB,WAAW,EAAG;QAClB/B,mBAAmB,CAAEV,EAAE,CAAE,4BAA6B,CAAC,EAAE;UACxDkB,IAAI,EAAE;QACP,CAAE,CAAC;QACHV,IAAI,CAAG,eAAeH,QAAU,IAAIoC,WAAW,CAAC1B,EAAI,EAAE,CAAC;MACxD;IACD,CAAC,CAAC,OAAQI,KAAK,EAAG;MACjBR,iBAAiB,CAChBV,OAAO,EACN;MACAD,EAAE,CAAG,2CAA2C,CAAC,EACjDmB,KAAK,EAAEC,OACR,CAAC,EAED;QACCF,IAAI,EAAE;MACP,CACD,CAAC;IACF;EACD,CAAC;EAED,OAAOkB,eAAe;AACvB;AAEA,eAAe,SAASS,yBAAyBA,CAAA,EAAG;EACnD,OAAO;IACNjC,YAAY,EAAEL,uBAAuB,CAAC,CAAC;IACvCqB,UAAU,EAAEP,qBAAqB,CAAC,CAAC;IACnCe,eAAe,EAAEF,0BAA0B,CAAC;EAC7C,CAAC;AACF"}
|
|
@@ -19,6 +19,7 @@ import { useLink } from '../routes/link';
|
|
|
19
19
|
import SingleNavigationMenu from '../sidebar-navigation-screen-navigation-menu/single-navigation-menu';
|
|
20
20
|
import useNavigationMenuHandlers from '../sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers';
|
|
21
21
|
import { unlock } from '../../lock-unlock';
|
|
22
|
+
import { NAVIGATION_POST_TYPE } from '../../utils/constants';
|
|
22
23
|
|
|
23
24
|
// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.
|
|
24
25
|
function buildMenuLabel(title, id, status) {
|
|
@@ -41,7 +42,7 @@ export default function SidebarNavigationScreenNavigationMenus() {
|
|
|
41
42
|
records: navigationMenus,
|
|
42
43
|
isResolving: isResolvingNavigationMenus,
|
|
43
44
|
hasResolved: hasResolvedNavigationMenus
|
|
44
|
-
} = useEntityRecords('postType',
|
|
45
|
+
} = useEntityRecords('postType', NAVIGATION_POST_TYPE, PRELOADED_NAVIGATION_MENUS_QUERY);
|
|
45
46
|
const isLoading = isResolvingNavigationMenus && !hasResolvedNavigationMenus;
|
|
46
47
|
const {
|
|
47
48
|
getNavigationFallbackId
|
|
@@ -114,7 +115,7 @@ const NavMenuItem = ({
|
|
|
114
115
|
}) => {
|
|
115
116
|
const linkInfo = useLink({
|
|
116
117
|
postId,
|
|
117
|
-
postType:
|
|
118
|
+
postType: NAVIGATION_POST_TYPE
|
|
118
119
|
});
|
|
119
120
|
return createElement(SidebarNavigationItem, {
|
|
120
121
|
...linkInfo,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","sprintf","useEntityRecords","store","coreStore","useSelect","decodeEntities","__experimentalItemGroup","ItemGroup","Spinner","navigation","SidebarNavigationScreen","SidebarNavigationItem","PRELOADED_NAVIGATION_MENUS_QUERY","useLink","SingleNavigationMenu","useNavigationMenuHandlers","unlock","buildMenuLabel","title","id","status","hasCreatedFallback","SidebarNavigationScreenNavigationMenus","records","navigationMenus","isResolving","isResolvingNavigationMenus","hasResolved","hasResolvedNavigationMenus","isLoading","getNavigationFallbackId","firstNavigationMenu","handleSave","handleDelete","handleDuplicate","hasNavigationMenus","length","createElement","SidebarNavigationScreenWrapper","className","description","navigationMenu","edits","map","index","NavMenuItem","postId","key","withChevron","icon","rendered","children","actions","content","props","linkInfo","postType"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useEntityRecords, store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\nimport { decodeEntities } from '@wordpress/html-entities';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\tSpinner,\n} from '@wordpress/components';\nimport { navigation } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { PRELOADED_NAVIGATION_MENUS_QUERY } from './constants';\nimport { useLink } from '../routes/link';\nimport SingleNavigationMenu from '../sidebar-navigation-screen-navigation-menu/single-navigation-menu';\nimport useNavigationMenuHandlers from '../sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers';\nimport { unlock } from '../../lock-unlock';\n\n// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.\nfunction buildMenuLabel( title, id, status ) {\n\tif ( ! title ) {\n\t\t/* translators: %s is the index of the menu in the list of menus. */\n\t\treturn sprintf( __( '(no title %s)' ), id );\n\t}\n\n\tif ( status === 'publish' ) {\n\t\treturn decodeEntities( title );\n\t}\n\n\treturn sprintf(\n\t\t// translators: %1s: title of the menu; %2s: status of the menu (draft, pending, etc.).\n\t\t__( '%1$s (%2$s)' ),\n\t\tdecodeEntities( title ),\n\t\tstatus\n\t);\n}\n\n// Save a boolean to prevent us creating a fallback more than once per session.\nlet hasCreatedFallback = false;\n\nexport default function SidebarNavigationScreenNavigationMenus() {\n\tconst {\n\t\trecords: navigationMenus,\n\t\tisResolving: isResolvingNavigationMenus,\n\t\thasResolved: hasResolvedNavigationMenus,\n\t} = useEntityRecords(\n\t\t'postType',\n\t\
|
|
1
|
+
{"version":3,"names":["__","sprintf","useEntityRecords","store","coreStore","useSelect","decodeEntities","__experimentalItemGroup","ItemGroup","Spinner","navigation","SidebarNavigationScreen","SidebarNavigationItem","PRELOADED_NAVIGATION_MENUS_QUERY","useLink","SingleNavigationMenu","useNavigationMenuHandlers","unlock","NAVIGATION_POST_TYPE","buildMenuLabel","title","id","status","hasCreatedFallback","SidebarNavigationScreenNavigationMenus","records","navigationMenus","isResolving","isResolvingNavigationMenus","hasResolved","hasResolvedNavigationMenus","isLoading","getNavigationFallbackId","firstNavigationMenu","handleSave","handleDelete","handleDuplicate","hasNavigationMenus","length","createElement","SidebarNavigationScreenWrapper","className","description","navigationMenu","edits","map","index","NavMenuItem","postId","key","withChevron","icon","rendered","children","actions","content","props","linkInfo","postType"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useEntityRecords, store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\nimport { decodeEntities } from '@wordpress/html-entities';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\tSpinner,\n} from '@wordpress/components';\nimport { navigation } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { PRELOADED_NAVIGATION_MENUS_QUERY } from './constants';\nimport { useLink } from '../routes/link';\nimport SingleNavigationMenu from '../sidebar-navigation-screen-navigation-menu/single-navigation-menu';\nimport useNavigationMenuHandlers from '../sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers';\nimport { unlock } from '../../lock-unlock';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\n\n// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.\nfunction buildMenuLabel( title, id, status ) {\n\tif ( ! title ) {\n\t\t/* translators: %s is the index of the menu in the list of menus. */\n\t\treturn sprintf( __( '(no title %s)' ), id );\n\t}\n\n\tif ( status === 'publish' ) {\n\t\treturn decodeEntities( title );\n\t}\n\n\treturn sprintf(\n\t\t// translators: %1s: title of the menu; %2s: status of the menu (draft, pending, etc.).\n\t\t__( '%1$s (%2$s)' ),\n\t\tdecodeEntities( title ),\n\t\tstatus\n\t);\n}\n\n// Save a boolean to prevent us creating a fallback more than once per session.\nlet hasCreatedFallback = false;\n\nexport default function SidebarNavigationScreenNavigationMenus() {\n\tconst {\n\t\trecords: navigationMenus,\n\t\tisResolving: isResolvingNavigationMenus,\n\t\thasResolved: hasResolvedNavigationMenus,\n\t} = useEntityRecords(\n\t\t'postType',\n\t\tNAVIGATION_POST_TYPE,\n\t\tPRELOADED_NAVIGATION_MENUS_QUERY\n\t);\n\n\tconst isLoading =\n\t\tisResolvingNavigationMenus && ! hasResolvedNavigationMenus;\n\n\tconst { getNavigationFallbackId } = unlock( useSelect( coreStore ) );\n\n\tconst firstNavigationMenu = navigationMenus?.[ 0 ];\n\n\t// Save a boolean to prevent us creating a fallback more than once per session.\n\tif ( firstNavigationMenu ) {\n\t\thasCreatedFallback = true;\n\t}\n\n\t// If there is no navigation menu found\n\t// then trigger fallback algorithm to create one.\n\tif (\n\t\t! firstNavigationMenu &&\n\t\t! isResolvingNavigationMenus &&\n\t\thasResolvedNavigationMenus &&\n\t\t! hasCreatedFallback\n\t) {\n\t\tgetNavigationFallbackId();\n\t}\n\n\tconst { handleSave, handleDelete, handleDuplicate } =\n\t\tuseNavigationMenuHandlers();\n\n\tconst hasNavigationMenus = !! navigationMenus?.length;\n\n\tif ( isLoading ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper>\n\t\t\t\t<Spinner className=\"edit-site-sidebar-navigation-screen-navigation-menus__loading\" />\n\t\t\t</SidebarNavigationScreenWrapper>\n\t\t);\n\t}\n\n\tif ( ! isLoading && ! hasNavigationMenus ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tdescription={ __( 'No Navigation Menus found.' ) }\n\t\t\t/>\n\t\t);\n\t}\n\n\t// if single menu then render it\n\tif ( navigationMenus?.length === 1 ) {\n\t\treturn (\n\t\t\t<SingleNavigationMenu\n\t\t\t\tnavigationMenu={ firstNavigationMenu }\n\t\t\t\thandleDelete={ () => handleDelete( firstNavigationMenu ) }\n\t\t\t\thandleDuplicate={ () => handleDuplicate( firstNavigationMenu ) }\n\t\t\t\thandleSave={ ( edits ) =>\n\t\t\t\t\thandleSave( firstNavigationMenu, edits )\n\t\t\t\t}\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<SidebarNavigationScreenWrapper>\n\t\t\t<ItemGroup>\n\t\t\t\t{ navigationMenus?.map( ( { id, title, status }, index ) => (\n\t\t\t\t\t<NavMenuItem\n\t\t\t\t\t\tpostId={ id }\n\t\t\t\t\t\tkey={ id }\n\t\t\t\t\t\twithChevron\n\t\t\t\t\t\ticon={ navigation }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ buildMenuLabel( title?.rendered, index + 1, status ) }\n\t\t\t\t\t</NavMenuItem>\n\t\t\t\t) ) }\n\t\t\t</ItemGroup>\n\t\t</SidebarNavigationScreenWrapper>\n\t);\n}\n\nexport function SidebarNavigationScreenWrapper( {\n\tchildren,\n\tactions,\n\ttitle,\n\tdescription,\n} ) {\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\ttitle={ title || __( 'Navigation' ) }\n\t\t\tactions={ actions }\n\t\t\tdescription={ description || __( 'Manage your Navigation menus.' ) }\n\t\t\tcontent={ children }\n\t\t/>\n\t);\n}\n\nconst NavMenuItem = ( { postId, ...props } ) => {\n\tconst linkInfo = useLink( {\n\t\tpostId,\n\t\tpostType: NAVIGATION_POST_TYPE,\n\t} );\n\treturn <SidebarNavigationItem { ...linkInfo } { ...props } />;\n};\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC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;IAAEE;EAAO,CAAC,EAAEwB,KAAK,KACrDP,aAAA,CAACQ,WAAW;IACXC,MAAM,EAAG3B,EAAI;IACb4B,GAAG,EAAG5B,EAAI;IACV6B,WAAW;IACXC,IAAI,EAAGzC;EAAY,GAEjBS,cAAc,CAAEC,KAAK,EAAEgC,QAAQ,EAAEN,KAAK,GAAG,CAAC,EAAExB,MAAO,CACzC,CACZ,CACQ,CACoB,CAAC;AAEnC;AAEA,OAAO,SAASkB,8BAA8BA,CAAE;EAC/Ca,QAAQ;EACRC,OAAO;EACPlC,KAAK;EACLsB;AACD,CAAC,EAAG;EACH,OACCH,aAAA,CAAC5B,uBAAuB;IACvBS,KAAK,EAAGA,KAAK,IAAIpB,EAAE,CAAE,YAAa,CAAG;IACrCsD,OAAO,EAAGA,OAAS;IACnBZ,WAAW,EAAGA,WAAW,IAAI1C,EAAE,CAAE,+BAAgC,CAAG;IACpEuD,OAAO,EAAGF;EAAU,CACpB,CAAC;AAEJ;AAEA,MAAMN,WAAW,GAAGA,CAAE;EAAEC,MAAM;EAAE,GAAGQ;AAAM,CAAC,KAAM;EAC/C,MAAMC,QAAQ,GAAG3C,OAAO,CAAE;IACzBkC,MAAM;IACNU,QAAQ,EAAExC;EACX,CAAE,CAAC;EACH,OAAOqB,aAAA,CAAC3B,qBAAqB;IAAA,GAAM6C,QAAQ;IAAA,GAAQD;EAAK,CAAI,CAAC;AAC9D,CAAC"}
|
|
@@ -84,9 +84,9 @@ export default function SidebarNavigationScreenPage() {
|
|
|
84
84
|
}, stripHTML(record.excerpt.rendered)), createElement(PageDetails, {
|
|
85
85
|
id: postId
|
|
86
86
|
})),
|
|
87
|
-
footer: createElement(SidebarNavigationScreenDetailsFooter, {
|
|
88
|
-
|
|
89
|
-
})
|
|
87
|
+
footer: record?.modified ? createElement(SidebarNavigationScreenDetailsFooter, {
|
|
88
|
+
record: record
|
|
89
|
+
}) : null
|
|
90
90
|
}) : null;
|
|
91
91
|
}
|
|
92
92
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","useDispatch","useSelect","__experimentalUseNavigator","useNavigator","__experimentalVStack","VStack","ExternalLink","__experimentalTruncate","Truncate","store","coreStore","useEntityRecord","decodeEntities","pencil","__unstableStripHTML","stripHTML","escapeAttribute","safeDecodeURIComponent","filterURLForDisplay","SidebarNavigationScreen","unlock","editSiteStore","SidebarButton","PageDetails","PageActions","SidebarNavigationScreenDetailsFooter","SidebarNavigationScreenPage","navigator","setCanvasMode","params","postId","record","featuredMediaAltText","featuredMediaSourceUrl","select","getEntityRecord","attachedMedia","featured_media","media_details","sizes","medium","source_url","alt_text","description","raw","featureImageAltText","title","rendered","createElement","actions","Fragment","toggleProps","as","onRemove","goTo","onClick","label","icon","meta","className","href","link","content","alignment","spacing","alt","src","excerpt","numberOfLines","id","footer","
|
|
1
|
+
{"version":3,"names":["__","useDispatch","useSelect","__experimentalUseNavigator","useNavigator","__experimentalVStack","VStack","ExternalLink","__experimentalTruncate","Truncate","store","coreStore","useEntityRecord","decodeEntities","pencil","__unstableStripHTML","stripHTML","escapeAttribute","safeDecodeURIComponent","filterURLForDisplay","SidebarNavigationScreen","unlock","editSiteStore","SidebarButton","PageDetails","PageActions","SidebarNavigationScreenDetailsFooter","SidebarNavigationScreenPage","navigator","setCanvasMode","params","postId","record","featuredMediaAltText","featuredMediaSourceUrl","select","getEntityRecord","attachedMedia","featured_media","media_details","sizes","medium","source_url","alt_text","description","raw","featureImageAltText","title","rendered","createElement","actions","Fragment","toggleProps","as","onRemove","goTo","onClick","label","icon","meta","className","href","link","content","alignment","spacing","alt","src","excerpt","numberOfLines","id","footer","modified"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-page/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\t__experimentalUseNavigator as useNavigator,\n\t__experimentalVStack as VStack,\n\tExternalLink,\n\t__experimentalTruncate as Truncate,\n} from '@wordpress/components';\nimport { store as coreStore, useEntityRecord } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { pencil } from '@wordpress/icons';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport { escapeAttribute } from '@wordpress/escape-html';\nimport { safeDecodeURIComponent, filterURLForDisplay } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport SidebarButton from '../sidebar-button';\nimport PageDetails from './page-details';\nimport PageActions from '../page-actions';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\n\nexport default function SidebarNavigationScreenPage() {\n\tconst navigator = useNavigator();\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\tconst {\n\t\tparams: { postId },\n\t} = useNavigator();\n\tconst { record } = useEntityRecord( 'postType', 'page', postId );\n\n\tconst { featuredMediaAltText, featuredMediaSourceUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\t// Featured image.\n\t\t\tconst attachedMedia = record?.featured_media\n\t\t\t\t? getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'attachment',\n\t\t\t\t\t\trecord?.featured_media\n\t\t\t\t )\n\t\t\t\t: null;\n\n\t\t\treturn {\n\t\t\t\tfeaturedMediaSourceUrl:\n\t\t\t\t\tattachedMedia?.media_details.sizes?.medium?.source_url ||\n\t\t\t\t\tattachedMedia?.source_url,\n\t\t\t\tfeaturedMediaAltText: escapeAttribute(\n\t\t\t\t\tattachedMedia?.alt_text ||\n\t\t\t\t\t\tattachedMedia?.description?.raw ||\n\t\t\t\t\t\t''\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ record ]\n\t);\n\n\tconst featureImageAltText = featuredMediaAltText\n\t\t? decodeEntities( featuredMediaAltText )\n\t\t: decodeEntities( record?.title?.rendered || __( 'Featured image' ) );\n\n\treturn record ? (\n\t\t<SidebarNavigationScreen\n\t\t\ttitle={ decodeEntities(\n\t\t\t\trecord?.title?.rendered || __( '(no title)' )\n\t\t\t) }\n\t\t\tactions={\n\t\t\t\t<>\n\t\t\t\t\t<PageActions\n\t\t\t\t\t\tpostId={ postId }\n\t\t\t\t\t\ttoggleProps={ { as: SidebarButton } }\n\t\t\t\t\t\tonRemove={ () => {\n\t\t\t\t\t\t\tnavigator.goTo( '/page' );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\tonClick={ () => setCanvasMode( 'edit' ) }\n\t\t\t\t\t\tlabel={ __( 'Edit' ) }\n\t\t\t\t\t\ticon={ pencil }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tmeta={\n\t\t\t\t<ExternalLink\n\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__page-link\"\n\t\t\t\t\thref={ record.link }\n\t\t\t\t>\n\t\t\t\t\t{ filterURLForDisplay(\n\t\t\t\t\t\tsafeDecodeURIComponent( record.link )\n\t\t\t\t\t) }\n\t\t\t\t</ExternalLink>\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ !! featuredMediaSourceUrl && (\n\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-page__featured-image-wrapper\"\n\t\t\t\t\t\t\talignment=\"left\"\n\t\t\t\t\t\t\tspacing={ 2 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen-page__featured-image has-image\">\n\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\talt={ featureImageAltText }\n\t\t\t\t\t\t\t\t\tsrc={ featuredMediaSourceUrl }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t) }\n\t\t\t\t\t{ !! record?.excerpt?.rendered && (\n\t\t\t\t\t\t<Truncate\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-page__excerpt\"\n\t\t\t\t\t\t\tnumberOfLines={ 3 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ stripHTML( record.excerpt.rendered ) }\n\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t) }\n\t\t\t\t\t<PageDetails id={ postId } />\n\t\t\t\t</>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\trecord?.modified ? (\n\t\t\t\t\t<SidebarNavigationScreenDetailsFooter record={ record } />\n\t\t\t\t) : null\n\t\t\t}\n\t\t/>\n\t) : null;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SACCC,0BAA0B,IAAIC,YAAY,EAC1CC,oBAAoB,IAAIC,MAAM,EAC9BC,YAAY,EACZC,sBAAsB,IAAIC,QAAQ,QAC5B,uBAAuB;AAC9B,SAASC,KAAK,IAAIC,SAAS,EAAEC,eAAe,QAAQ,sBAAsB;AAC1E,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,mBAAmB,IAAIC,SAAS,QAAQ,gBAAgB;AACjE,SAASC,eAAe,QAAQ,wBAAwB;AACxD,SAASC,sBAAsB,EAAEC,mBAAmB,QAAQ,gBAAgB;;AAE5E;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASX,KAAK,IAAIY,aAAa,QAAQ,aAAa;AACpD,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,OAAOC,WAAW,MAAM,gBAAgB;AACxC,OAAOC,WAAW,MAAM,iBAAiB;AACzC,OAAOC,oCAAoC,MAAM,6CAA6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LvC,MAAM,EAAEwC,QAAQ,GACfvB,aAAA,CAACvB,oCAAoC;MAACM,MAAM,EAAGA;IAAQ,CAAE,CAAC,GACvD;EACJ,CACD,CAAC,GACC,IAAI;AACT"}
|
|
@@ -17,6 +17,7 @@ import StatusLabel from './status-label';
|
|
|
17
17
|
import { unlock } from '../../lock-unlock';
|
|
18
18
|
import { store as editSiteStore } from '../../store';
|
|
19
19
|
import { SidebarNavigationScreenDetailsPanel, SidebarNavigationScreenDetailsPanelRow, SidebarNavigationScreenDetailsPanelLabel, SidebarNavigationScreenDetailsPanelValue } from '../sidebar-navigation-screen-details-panel';
|
|
20
|
+
import { TEMPLATE_POST_TYPE } from '../../utils/constants';
|
|
20
21
|
|
|
21
22
|
// Taken from packages/editor/src/components/time-to-read/index.js.
|
|
22
23
|
const AVERAGE_READING_RATE = 189;
|
|
@@ -85,7 +86,7 @@ export default function PageDetails({
|
|
|
85
86
|
getEditedPostContext
|
|
86
87
|
} = unlock(select(editSiteStore));
|
|
87
88
|
const postContext = getEditedPostContext();
|
|
88
|
-
const templates = select(coreStore).getEntityRecords('postType',
|
|
89
|
+
const templates = select(coreStore).getEntityRecords('postType', TEMPLATE_POST_TYPE, {
|
|
89
90
|
per_page: -1
|
|
90
91
|
});
|
|
91
92
|
// Template title.
|