@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","_x","sprintf","__experimentalTruncate","Truncate","count","wordCount","useSelect","decodeEntities","store","coreStore","useEntityRecord","safeDecodeURIComponent","StatusLabel","unlock","editSiteStore","SidebarNavigationScreenDetailsPanel","SidebarNavigationScreenDetailsPanelRow","SidebarNavigationScreenDetailsPanelLabel","SidebarNavigationScreenDetailsPanelValue","AVERAGE_READING_RATE","getPageDetails","page","details","label","value","createElement","status","password","date","short","numberOfLines","slug","templateTitle","push","parentTitle","wordCountType","wordsCounted","content","rendered","readingTime","Math","round","isPostsPage","toLocaleString","PageDetails","id","record","select","getEditedPostContext","postContext","templates","getEntityRecords","per_page","templateSlug","postType","_templateTitle","find","template","title","_parentTitle","parent","getEntityRecord","_fields","siteSettings","page_for_posts","spacing","map","key"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-page/page-details.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { __experimentalTruncate as Truncate } from '@wordpress/components';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport { useSelect } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as coreStore, useEntityRecord } from '@wordpress/core-data';\nimport { safeDecodeURIComponent } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport StatusLabel from './status-label';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tSidebarNavigationScreenDetailsPanel,\n\tSidebarNavigationScreenDetailsPanelRow,\n\tSidebarNavigationScreenDetailsPanelLabel,\n\tSidebarNavigationScreenDetailsPanelValue,\n} from '../sidebar-navigation-screen-details-panel';\n\n// Taken from packages/editor/src/components/time-to-read/index.js.\nconst AVERAGE_READING_RATE = 189;\n\nfunction getPageDetails( page ) {\n\tif ( ! page ) {\n\t\treturn [];\n\t}\n\n\tconst details = [\n\t\t{\n\t\t\tlabel: __( 'Status' ),\n\t\t\tvalue: (\n\t\t\t\t<StatusLabel\n\t\t\t\t\tstatus={ page?.password ? 'protected' : page.status }\n\t\t\t\t\tdate={ page?.date }\n\t\t\t\t\tshort\n\t\t\t\t/>\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tlabel: __( 'Slug' ),\n\t\t\tvalue: (\n\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t{ safeDecodeURIComponent( page.slug ) }\n\t\t\t\t</Truncate>\n\t\t\t),\n\t\t},\n\t];\n\n\tif ( page?.templateTitle ) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Template' ),\n\t\t\tvalue: decodeEntities( page.templateTitle ),\n\t\t} );\n\t}\n\n\tif ( page?.parentTitle ) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Parent' ),\n\t\t\tvalue: decodeEntities( page.parentTitle || __( '(no title)' ) ),\n\t\t} );\n\t}\n\n\t/*\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\tconst wordsCounted = page?.content?.rendered\n\t\t? wordCount( page.content.rendered, wordCountType )\n\t\t: 0;\n\tconst readingTime = Math.round( wordsCounted / AVERAGE_READING_RATE );\n\n\tif ( wordsCounted && ! page?.isPostsPage ) {\n\t\tdetails.push(\n\t\t\t{\n\t\t\t\tlabel: __( 'Words' ),\n\t\t\t\tvalue: wordsCounted.toLocaleString() || __( 'Unknown' ),\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: __( 'Time to read' ),\n\t\t\t\tvalue:\n\t\t\t\t\treadingTime > 1\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: is the number of minutes. */\n\t\t\t\t\t\t\t\t__( '%s mins' ),\n\t\t\t\t\t\t\t\treadingTime.toLocaleString()\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( '< 1 min' ),\n\t\t\t}\n\t\t);\n\t}\n\treturn details;\n}\n\nexport default function PageDetails( { id } ) {\n\tconst { record } = useEntityRecord( 'postType', 'page', id );\n\tconst { parentTitle, templateTitle, isPostsPage } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedPostContext } = unlock( select( editSiteStore ) );\n\t\t\tconst postContext = getEditedPostContext();\n\t\t\tconst templates = select( coreStore ).getEntityRecords(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template',\n\t\t\t\t{ per_page: -1 }\n\t\t\t);\n\t\t\t// Template title.\n\t\t\tconst templateSlug =\n\t\t\t\t// Checks that the post type matches the current theme's post type, otherwise\n\t\t\t\t// the templateSlug returns 'home'.\n\t\t\t\tpostContext?.postType === 'page'\n\t\t\t\t\t? postContext?.templateSlug\n\t\t\t\t\t: null;\n\t\t\tconst _templateTitle =\n\t\t\t\ttemplates && templateSlug\n\t\t\t\t\t? templates.find(\n\t\t\t\t\t\t\t( template ) => template.slug === templateSlug\n\t\t\t\t\t )?.title?.rendered\n\t\t\t\t\t: null;\n\n\t\t\t// Parent page title.\n\t\t\tconst _parentTitle = record?.parent\n\t\t\t\t? select( coreStore ).getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'page',\n\t\t\t\t\t\trecord.parent,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_fields: [ 'title' ],\n\t\t\t\t\t\t}\n\t\t\t\t )?.title?.rendered\n\t\t\t\t: null;\n\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\tconst siteSettings = getEntityRecord( 'root', 'site' );\n\n\t\t\treturn {\n\t\t\t\tparentTitle: _parentTitle,\n\t\t\t\ttemplateTitle: _templateTitle,\n\t\t\t\tisPostsPage: record?.id === siteSettings?.page_for_posts,\n\t\t\t};\n\t\t},\n\t\t[ record?.parent, record?.id ]\n\t);\n\treturn (\n\t\t<SidebarNavigationScreenDetailsPanel\n\t\t\tspacing={ 5 }\n\t\t\ttitle={ __( 'Details' ) }\n\t\t>\n\t\t\t{ getPageDetails( {\n\t\t\t\tparentTitle,\n\t\t\t\ttemplateTitle,\n\t\t\t\tisPostsPage,\n\t\t\t\t...record,\n\t\t\t} ).map( ( { label, value } ) => (\n\t\t\t\t<SidebarNavigationScreenDetailsPanelRow key={ label }>\n\t\t\t\t\t<SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t<SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t\t{ value }\n\t\t\t\t\t</SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t) ) }\n\t\t</SidebarNavigationScreenDetailsPanel>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,sBAAsB,IAAIC,QAAQ,QAAQ,uBAAuB;AAC1E,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,KAAK,IAAIC,SAAS,EAAEC,eAAe,QAAQ,sBAAsB;AAC1E,SAASC,sBAAsB,QAAQ,gBAAgB;;AAEvD;AACA;AACA;AACA,OAAOC,WAAW,MAAM,gBAAgB;AACxC,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASL,KAAK,IAAIM,aAAa,QAAQ,aAAa;AACpD,SACCC,mCAAmC,EACnCC,sCAAsC,EACtCC,wCAAwC,EACxCC,wCA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ate","Truncate","count","wordCount","useSelect","decodeEntities","store","coreStore","useEntityRecord","safeDecodeURIComponent","StatusLabel","unlock","editSiteStore","SidebarNavigationScreenDetailsPanel","SidebarNavigationScreenDetailsPanelRow","SidebarNavigationScreenDetailsPanelLabel","SidebarNavigationScreenDetailsPanelValue","TEMPLATE_POST_TYPE","AVERAGE_READING_RATE","getPageDetails","page","details","label","value","createElement","status","password","date","short","numberOfLines","slug","templateTitle","push","parentTitle","wordCountType","wordsCounted","content","rendered","readingTime","Math","round","isPostsPage","toLocaleString","PageDetails","id","record","select","getEditedPostContext","postContext","templates","getEntityRecords","per_page","templateSlug","postType","_templateTitle","find","template","title","_parentTitle","parent","getEntityRecord","_fields","siteSettings","page_for_posts","spacing","map","key"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-page/page-details.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { __experimentalTruncate as Truncate } from '@wordpress/components';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport { useSelect } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as coreStore, useEntityRecord } from '@wordpress/core-data';\nimport { safeDecodeURIComponent } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport StatusLabel from './status-label';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tSidebarNavigationScreenDetailsPanel,\n\tSidebarNavigationScreenDetailsPanelRow,\n\tSidebarNavigationScreenDetailsPanelLabel,\n\tSidebarNavigationScreenDetailsPanelValue,\n} from '../sidebar-navigation-screen-details-panel';\nimport { TEMPLATE_POST_TYPE } from '../../utils/constants';\n\n// Taken from packages/editor/src/components/time-to-read/index.js.\nconst AVERAGE_READING_RATE = 189;\n\nfunction getPageDetails( page ) {\n\tif ( ! page ) {\n\t\treturn [];\n\t}\n\n\tconst details = [\n\t\t{\n\t\t\tlabel: __( 'Status' ),\n\t\t\tvalue: (\n\t\t\t\t<StatusLabel\n\t\t\t\t\tstatus={ page?.password ? 'protected' : page.status }\n\t\t\t\t\tdate={ page?.date }\n\t\t\t\t\tshort\n\t\t\t\t/>\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tlabel: __( 'Slug' ),\n\t\t\tvalue: (\n\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t{ safeDecodeURIComponent( page.slug ) }\n\t\t\t\t</Truncate>\n\t\t\t),\n\t\t},\n\t];\n\n\tif ( page?.templateTitle ) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Template' ),\n\t\t\tvalue: decodeEntities( page.templateTitle ),\n\t\t} );\n\t}\n\n\tif ( page?.parentTitle ) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Parent' ),\n\t\t\tvalue: decodeEntities( page.parentTitle || __( '(no title)' ) ),\n\t\t} );\n\t}\n\n\t/*\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\tconst wordsCounted = page?.content?.rendered\n\t\t? wordCount( page.content.rendered, wordCountType )\n\t\t: 0;\n\tconst readingTime = Math.round( wordsCounted / AVERAGE_READING_RATE );\n\n\tif ( wordsCounted && ! page?.isPostsPage ) {\n\t\tdetails.push(\n\t\t\t{\n\t\t\t\tlabel: __( 'Words' ),\n\t\t\t\tvalue: wordsCounted.toLocaleString() || __( 'Unknown' ),\n\t\t\t},\n\t\t\t{\n\t\t\t\tlabel: __( 'Time to read' ),\n\t\t\t\tvalue:\n\t\t\t\t\treadingTime > 1\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: is the number of minutes. */\n\t\t\t\t\t\t\t\t__( '%s mins' ),\n\t\t\t\t\t\t\t\treadingTime.toLocaleString()\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( '< 1 min' ),\n\t\t\t}\n\t\t);\n\t}\n\treturn details;\n}\n\nexport default function PageDetails( { id } ) {\n\tconst { record } = useEntityRecord( 'postType', 'page', id );\n\tconst { parentTitle, templateTitle, isPostsPage } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedPostContext } = unlock( select( editSiteStore ) );\n\t\t\tconst postContext = getEditedPostContext();\n\t\t\tconst templates = select( coreStore ).getEntityRecords(\n\t\t\t\t'postType',\n\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t{ per_page: -1 }\n\t\t\t);\n\t\t\t// Template title.\n\t\t\tconst templateSlug =\n\t\t\t\t// Checks that the post type matches the current theme's post type, otherwise\n\t\t\t\t// the templateSlug returns 'home'.\n\t\t\t\tpostContext?.postType === 'page'\n\t\t\t\t\t? postContext?.templateSlug\n\t\t\t\t\t: null;\n\t\t\tconst _templateTitle =\n\t\t\t\ttemplates && templateSlug\n\t\t\t\t\t? templates.find(\n\t\t\t\t\t\t\t( template ) => template.slug === templateSlug\n\t\t\t\t\t )?.title?.rendered\n\t\t\t\t\t: null;\n\n\t\t\t// Parent page title.\n\t\t\tconst _parentTitle = record?.parent\n\t\t\t\t? select( coreStore ).getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'page',\n\t\t\t\t\t\trecord.parent,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t_fields: [ 'title' ],\n\t\t\t\t\t\t}\n\t\t\t\t )?.title?.rendered\n\t\t\t\t: null;\n\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\tconst siteSettings = getEntityRecord( 'root', 'site' );\n\n\t\t\treturn {\n\t\t\t\tparentTitle: _parentTitle,\n\t\t\t\ttemplateTitle: _templateTitle,\n\t\t\t\tisPostsPage: record?.id === siteSettings?.page_for_posts,\n\t\t\t};\n\t\t},\n\t\t[ record?.parent, record?.id ]\n\t);\n\treturn (\n\t\t<SidebarNavigationScreenDetailsPanel\n\t\t\tspacing={ 5 }\n\t\t\ttitle={ __( 'Details' ) }\n\t\t>\n\t\t\t{ getPageDetails( {\n\t\t\t\tparentTitle,\n\t\t\t\ttemplateTitle,\n\t\t\t\tisPostsPage,\n\t\t\t\t...record,\n\t\t\t} ).map( ( { label, value } ) => (\n\t\t\t\t<SidebarNavigationScreenDetailsPanelRow key={ label }>\n\t\t\t\t\t<SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t<SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t\t{ value }\n\t\t\t\t\t</SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t) ) }\n\t\t</SidebarNavigationScreenDetailsPanel>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,sBAAsB,IAAIC,QAAQ,QAAQ,uBAAuB;AAC1E,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,KAAK,IAAIC,SAAS,EAAEC,eAAe,QAAQ,sBAAsB;AAC1E,SAASC,sBAAsB,QAAQ,gBAAgB;;AAEvD;AACA;AACA;AACA,OAAOC,WAAW,MAAM,gBAAgB;AACxC,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASL,KAAK,IAAIM,aAAa,QAAQ,aAAa;AACpD,SACCC,mCAAmC,EACnCC,sCAAsC,EACtCC,wCAAwC,EACxCC,wCAAwC,QAClC,4CAA4C;AACnD,SAASC,kBAAkB,QAAQ,uBAAuB;;AAE1D;AACA,MAAMC,oBAAoB,GAAG,GAAG;AAEhC,SAASC,cAAcA,CAAEC,IAAI,EAAG;EAC/B,IAAK,CAAEA,IAAI,EAAG;IACb,OAAO,EAAE;EACV;EA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,QAAQ,GAClB,IAAI;;IAER;IACA,MAAMqB,YAAY,GAAGb,MAAM,EAAEc,MAAM,GAChCb,MAAM,CAAEvC,SAAU,CAAC,CAACqD,eAAe,CACnC,UAAU,EACV,MAAM,EACNf,MAAM,CAACc,MAAM,EACb;MACCE,OAAO,EAAE,CAAE,OAAO;IACnB,CACA,CAAC,EAAEJ,KAAK,EAAEpB,QAAQ,GAClB,IAAI;IAEP,MAAM;MAAEuB;IAAgB,CAAC,GAAGd,MAAM,CAAEvC,SAAU,CAAC;IAC/C,MAAMuD,YAAY,GAAGF,eAAe,CAAE,MAAM,EAAE,MAAO,CAAC;IAEtD,OAAO;MACN3B,WAAW,EAAEyB,YAAY;MACzB3B,aAAa,EAAEuB,cAAc;MAC7Bb,WAAW,EAAEI,MAAM,EAAED,EAAE,KAAKkB,YAAY,EAAEC;IAC3C,CAAC;EACF,CAAC,EACD,CAAElB,MAAM,EAAEc,MAAM,EAAEd,MAAM,EAAED,EAAE,CAC7B,CAAC;EACD,OACCpB,aAAA,CAACX,mCAAmC;IACnCmD,OAAO,EAAG,CAAG;IACbP,KAAK,EAAG5D,EAAE,CAAE,SAAU;EAAG,GAEvBsB,cAAc,CAAE;IACjBc,WAAW;IACXF,aAAa;IACbU,WAAW;IACX,GAAGI;EACJ,CAAE,CAAC,CAACoB,GAAG,CAAE,CAAE;IAAE3C,KAAK;IAAEC;EAAM,CAAC,KAC1BC,aAAA,CAACV,sCAAsC;IAACoD,GAAG,EAAG5C;EAAO,GACpDE,aAAA,CAACT,wCAAwC,QACtCO,KACuC,CAAC,EAC3CE,aAAA,CAACR,wCAAwC,QACtCO,KACuC,CACH,CACvC,CACkC,CAAC;AAExC"}
|
|
@@ -20,6 +20,7 @@ import SidebarNavigationItem from '../sidebar-navigation-item';
|
|
|
20
20
|
import SidebarButton from '../sidebar-button';
|
|
21
21
|
import AddNewPageModal from '../add-new-page';
|
|
22
22
|
import { unlock } from '../../lock-unlock';
|
|
23
|
+
import { TEMPLATE_POST_TYPE } from '../../utils/constants';
|
|
23
24
|
const {
|
|
24
25
|
useHistory
|
|
25
26
|
} = unlock(routerPrivateApis);
|
|
@@ -50,7 +51,7 @@ export default function SidebarNavigationScreenPages() {
|
|
|
50
51
|
const {
|
|
51
52
|
records: templates,
|
|
52
53
|
isResolving: isLoadingTemplates
|
|
53
|
-
} = useEntityRecords('postType',
|
|
54
|
+
} = useEntityRecords('postType', TEMPLATE_POST_TYPE, {
|
|
54
55
|
per_page: -1
|
|
55
56
|
});
|
|
56
57
|
const dynamicPageTemplates = templates?.filter(({
|
|
@@ -109,7 +110,7 @@ export default function SidebarNavigationScreenPages() {
|
|
|
109
110
|
}
|
|
110
111
|
return {
|
|
111
112
|
icon: itemIcon,
|
|
112
|
-
postType: postsPageTemplateId ?
|
|
113
|
+
postType: postsPageTemplateId ? TEMPLATE_POST_TYPE : 'page',
|
|
113
114
|
postId: postsPageTemplateId || id
|
|
114
115
|
};
|
|
115
116
|
};
|
|
@@ -125,7 +126,7 @@ export default function SidebarNavigationScreenPages() {
|
|
|
125
126
|
onClick: () => setShowAddPage(true)
|
|
126
127
|
}),
|
|
127
128
|
content: createElement(Fragment, null, (isLoadingPages || isLoadingTemplates) && createElement(ItemGroup, null, createElement(Item, null, __('Loading pages…'))), !(isLoadingPages || isLoadingTemplates) && createElement(ItemGroup, null, !pagesAndTemplates?.length && createElement(Item, null, __('No page found')), isHomePageBlog && homeTemplate && createElement(PageItem, {
|
|
128
|
-
postType:
|
|
129
|
+
postType: TEMPLATE_POST_TYPE,
|
|
129
130
|
postId: homeTemplate.id,
|
|
130
131
|
key: homeTemplate.id,
|
|
131
132
|
icon: home,
|
|
@@ -145,7 +146,7 @@ export default function SidebarNavigationScreenPages() {
|
|
|
145
146
|
footer: createElement(VStack, {
|
|
146
147
|
spacing: 0
|
|
147
148
|
}, dynamicPageTemplates?.map(item => createElement(PageItem, {
|
|
148
|
-
postType:
|
|
149
|
+
postType: TEMPLATE_POST_TYPE,
|
|
149
150
|
postId: item.id,
|
|
150
151
|
key: item.id,
|
|
151
152
|
icon: layout,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__experimentalItemGroup","ItemGroup","__experimentalItem","Item","__experimentalTruncate","Truncate","__experimentalVStack","VStack","useState","__","useEntityRecords","store","coreStore","decodeEntities","privateApis","routerPrivateApis","layout","page","home","verse","plus","useSelect","SidebarNavigationScreen","useLink","SidebarNavigationItem","SidebarButton","AddNewPageModal","unlock","useHistory","PageItem","postType","postId","props","linkInfo","backPath","createElement","SidebarNavigationScreenPages","records","pages","isResolving","isLoadingPages","status","per_page","templates","isLoadingTemplates","dynamicPageTemplates","filter","slug","includes","homeTemplate","find","template","getPostsPageTemplate","pagesAndTemplates","concat","frontPage","postsPage","select","getEntityRecord","siteSettings","page_on_front","page_for_posts","isHomePageBlog","reorderedPages","length","homePageIndex","findIndex","item","id","homePage","splice","postsPageIndex","blogPage","showAddPage","setShowAddPage","history","handleNewPage","type","push","canvas","getPageProps","itemIcon","postsPageTemplateId","icon","Fragment","onSave","onClose","title","description","actions","label","onClick","content","key","withChevron","numberOfLines","rendered","map","footer","spacing","className","href","document","location"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pages/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n\t__experimentalTruncate as Truncate,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { useEntityRecords, store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { layout, page, home, verse, plus } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { useLink } from '../routes/link';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport SidebarButton from '../sidebar-button';\nimport AddNewPageModal from '../add-new-page';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nconst PageItem = ( { postType = 'page', postId, ...props } ) => {\n\tconst linkInfo = useLink(\n\t\t{\n\t\t\tpostType,\n\t\t\tpostId,\n\t\t},\n\t\t{\n\t\t\tbackPath: '/page',\n\t\t}\n\t);\n\treturn <SidebarNavigationItem { ...linkInfo } { ...props } />;\n};\n\nexport default function SidebarNavigationScreenPages() {\n\tconst { records: pages, isResolving: isLoadingPages } = useEntityRecords(\n\t\t'postType',\n\t\t'page',\n\t\t{\n\t\t\tstatus: 'any',\n\t\t\tper_page: -1,\n\t\t}\n\t);\n\tconst { records: templates, isResolving: isLoadingTemplates } =\n\t\tuseEntityRecords( 'postType', 'wp_template', {\n\t\t\tper_page: -1,\n\t\t} );\n\n\tconst dynamicPageTemplates = templates?.filter( ( { slug } ) =>\n\t\t[ '404', 'search' ].includes( slug )\n\t);\n\n\tconst homeTemplate =\n\t\ttemplates?.find( ( template ) => template.slug === 'front-page' ) ||\n\t\ttemplates?.find( ( template ) => template.slug === 'home' ) ||\n\t\ttemplates?.find( ( template ) => template.slug === 'index' );\n\n\tconst getPostsPageTemplate = () =>\n\t\ttemplates?.find( ( template ) => template.slug === 'home' ) ||\n\t\ttemplates?.find( ( template ) => template.slug === 'index' );\n\n\tconst pagesAndTemplates = pages?.concat( dynamicPageTemplates, [\n\t\thomeTemplate,\n\t] );\n\n\tconst { frontPage, postsPage } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord } = select( coreStore );\n\t\tconst siteSettings = getEntityRecord( 'root', 'site' );\n\t\treturn {\n\t\t\tfrontPage: siteSettings?.page_on_front,\n\t\t\tpostsPage: siteSettings?.page_for_posts,\n\t\t};\n\t}, [] );\n\n\tconst isHomePageBlog = frontPage === postsPage;\n\n\tconst reorderedPages = pages && [ ...pages ];\n\n\tif ( ! isHomePageBlog && reorderedPages?.length ) {\n\t\tconst homePageIndex = reorderedPages.findIndex(\n\t\t\t( item ) => item.id === frontPage\n\t\t);\n\t\tconst homePage = reorderedPages.splice( homePageIndex, 1 );\n\t\treorderedPages?.splice( 0, 0, ...homePage );\n\n\t\tconst postsPageIndex = reorderedPages.findIndex(\n\t\t\t( item ) => item.id === postsPage\n\t\t);\n\n\t\tconst blogPage = reorderedPages.splice( postsPageIndex, 1 );\n\n\t\treorderedPages.splice( 1, 0, ...blogPage );\n\t}\n\n\tconst [ showAddPage, setShowAddPage ] = useState( false );\n\n\tconst history = useHistory();\n\n\tconst handleNewPage = ( { type, id } ) => {\n\t\t// Navigate to the created template editor.\n\t\thistory.push( {\n\t\t\tpostId: id,\n\t\t\tpostType: type,\n\t\t\tcanvas: 'edit',\n\t\t} );\n\t\tsetShowAddPage( false );\n\t};\n\n\tconst getPageProps = ( id ) => {\n\t\tlet itemIcon = page;\n\t\tconst postsPageTemplateId =\n\t\t\tpostsPage && postsPage === id ? getPostsPageTemplate()?.id : null;\n\n\t\tswitch ( id ) {\n\t\t\tcase frontPage:\n\t\t\t\titemIcon = home;\n\t\t\t\tbreak;\n\t\t\tcase postsPage:\n\t\t\t\titemIcon = verse;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn {\n\t\t\ticon: itemIcon,\n\t\t\tpostType: postsPageTemplateId ? 'wp_template' : 'page',\n\t\t\tpostId: postsPageTemplateId || id,\n\t\t};\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t{ showAddPage && (\n\t\t\t\t<AddNewPageModal\n\t\t\t\t\tonSave={ handleNewPage }\n\t\t\t\t\tonClose={ () => setShowAddPage( false ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<SidebarNavigationScreen\n\t\t\t\ttitle={ __( 'Pages' ) }\n\t\t\t\tdescription={ __( 'Browse and edit pages on your site.' ) }\n\t\t\t\tactions={\n\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\tlabel={ __( 'Draft a new page' ) }\n\t\t\t\t\t\tonClick={ () => setShowAddPage( true ) }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tcontent={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ( isLoadingPages || isLoadingTemplates ) && (\n\t\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t\t<Item>{ __( 'Loading pages…' ) }</Item>\n\t\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! ( isLoadingPages || isLoadingTemplates ) && (\n\t\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t\t{ ! pagesAndTemplates?.length && (\n\t\t\t\t\t\t\t\t\t<Item>{ __( 'No page found' ) }</Item>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ isHomePageBlog && homeTemplate && (\n\t\t\t\t\t\t\t\t\t<PageItem\n\t\t\t\t\t\t\t\t\t\tpostType=\"wp_template\"\n\t\t\t\t\t\t\t\t\t\tpostId={ homeTemplate.id }\n\t\t\t\t\t\t\t\t\t\tkey={ homeTemplate.id }\n\t\t\t\t\t\t\t\t\t\ticon={ home }\n\t\t\t\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t\t\t\t\t\t\t{ decodeEntities(\n\t\t\t\t\t\t\t\t\t\t\t\thomeTemplate.title?.rendered ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t__( '(no title)' )\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t\t\t</PageItem>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ reorderedPages?.map( ( { id, title } ) => (\n\t\t\t\t\t\t\t\t\t<PageItem\n\t\t\t\t\t\t\t\t\t\t{ ...getPageProps( id ) }\n\t\t\t\t\t\t\t\t\t\tkey={ id }\n\t\t\t\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t\t\t\t\t\t\t{ decodeEntities(\n\t\t\t\t\t\t\t\t\t\t\t\ttitle?.rendered ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t__( '(no title)' )\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t\t\t</PageItem>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\tfooter={\n\t\t\t\t\t<VStack spacing={ 0 }>\n\t\t\t\t\t\t{ dynamicPageTemplates?.map( ( item ) => (\n\t\t\t\t\t\t\t<PageItem\n\t\t\t\t\t\t\t\tpostType=\"wp_template\"\n\t\t\t\t\t\t\t\tpostId={ item.id }\n\t\t\t\t\t\t\t\tkey={ item.id }\n\t\t\t\t\t\t\t\ticon={ layout }\n\t\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t\t\t\t\t{ decodeEntities(\n\t\t\t\t\t\t\t\t\t\titem.title?.rendered ||\n\t\t\t\t\t\t\t\t\t\t\t__( '(no title)' )\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t</PageItem>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t<SidebarNavigationItem\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-pages__see-all\"\n\t\t\t\t\t\t\thref=\"edit.php?post_type=page\"\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tdocument.location = 'edit.php?post_type=page';\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t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AACoB,KAAK,EAAES,QAAQ,IACnBvF,EAAE,CAAE,YAAa,CACnB,CACS,CACD,CACT,CAAC,EACH0B,aAAA,CAACX,qBAAqB;MACrB4E,SAAS,EAAC,oDAAoD;MAC9DC,IAAI,EAAC,yBAAyB;MAC9BV,OAAO,EAAGA,CAAA,KAAM;QACfW,QAAQ,CAACC,QAAQ,GAAG,yBAAyB;MAC9C;IAAG,GAED9F,EAAE,CAAE,kBAAmB,CACH,CAChB;EACR,CACD,CACA,CAAC;AAEL"}
|
|
1
|
+
{"version":3,"names":["__experimentalItemGroup","ItemGroup","__experimentalItem","Item","__experimentalTruncate","Truncate","__experimentalVStack","VStack","useState","__","useEntityRecords","store","coreStore","decodeEntities","privateApis","routerPrivateApis","layout","page","home","verse","plus","useSelect","SidebarNavigationScreen","useLink","SidebarNavigationItem","SidebarButton","AddNewPageModal","unlock","TEMPLATE_POST_TYPE","useHistory","PageItem","postType","postId","props","linkInfo","backPath","createElement","SidebarNavigationScreenPages","records","pages","isResolving","isLoadingPages","status","per_page","templates","isLoadingTemplates","dynamicPageTemplates","filter","slug","includes","homeTemplate","find","template","getPostsPageTemplate","pagesAndTemplates","concat","frontPage","postsPage","select","getEntityRecord","siteSettings","page_on_front","page_for_posts","isHomePageBlog","reorderedPages","length","homePageIndex","findIndex","item","id","homePage","splice","postsPageIndex","blogPage","showAddPage","setShowAddPage","history","handleNewPage","type","push","canvas","getPageProps","itemIcon","postsPageTemplateId","icon","Fragment","onSave","onClose","title","description","actions","label","onClick","content","key","withChevron","numberOfLines","rendered","map","footer","spacing","className","href","document","location"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pages/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalItem as Item,\n\t__experimentalTruncate as Truncate,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { useEntityRecords, store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { layout, page, home, verse, plus } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { useLink } from '../routes/link';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport SidebarButton from '../sidebar-button';\nimport AddNewPageModal from '../add-new-page';\nimport { unlock } from '../../lock-unlock';\nimport { TEMPLATE_POST_TYPE } from '../../utils/constants';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nconst PageItem = ( { postType = 'page', postId, ...props } ) => {\n\tconst linkInfo = useLink(\n\t\t{\n\t\t\tpostType,\n\t\t\tpostId,\n\t\t},\n\t\t{\n\t\t\tbackPath: '/page',\n\t\t}\n\t);\n\treturn <SidebarNavigationItem { ...linkInfo } { ...props } />;\n};\n\nexport default function SidebarNavigationScreenPages() {\n\tconst { records: pages, isResolving: isLoadingPages } = useEntityRecords(\n\t\t'postType',\n\t\t'page',\n\t\t{\n\t\t\tstatus: 'any',\n\t\t\tper_page: -1,\n\t\t}\n\t);\n\tconst { records: templates, isResolving: isLoadingTemplates } =\n\t\tuseEntityRecords( 'postType', TEMPLATE_POST_TYPE, {\n\t\t\tper_page: -1,\n\t\t} );\n\n\tconst dynamicPageTemplates = templates?.filter( ( { slug } ) =>\n\t\t[ '404', 'search' ].includes( slug )\n\t);\n\n\tconst homeTemplate =\n\t\ttemplates?.find( ( template ) => template.slug === 'front-page' ) ||\n\t\ttemplates?.find( ( template ) => template.slug === 'home' ) ||\n\t\ttemplates?.find( ( template ) => template.slug === 'index' );\n\n\tconst getPostsPageTemplate = () =>\n\t\ttemplates?.find( ( template ) => template.slug === 'home' ) ||\n\t\ttemplates?.find( ( template ) => template.slug === 'index' );\n\n\tconst pagesAndTemplates = pages?.concat( dynamicPageTemplates, [\n\t\thomeTemplate,\n\t] );\n\n\tconst { frontPage, postsPage } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord } = select( coreStore );\n\t\tconst siteSettings = getEntityRecord( 'root', 'site' );\n\t\treturn {\n\t\t\tfrontPage: siteSettings?.page_on_front,\n\t\t\tpostsPage: siteSettings?.page_for_posts,\n\t\t};\n\t}, [] );\n\n\tconst isHomePageBlog = frontPage === postsPage;\n\n\tconst reorderedPages = pages && [ ...pages ];\n\n\tif ( ! isHomePageBlog && reorderedPages?.length ) {\n\t\tconst homePageIndex = reorderedPages.findIndex(\n\t\t\t( item ) => item.id === frontPage\n\t\t);\n\t\tconst homePage = reorderedPages.splice( homePageIndex, 1 );\n\t\treorderedPages?.splice( 0, 0, ...homePage );\n\n\t\tconst postsPageIndex = reorderedPages.findIndex(\n\t\t\t( item ) => item.id === postsPage\n\t\t);\n\n\t\tconst blogPage = reorderedPages.splice( postsPageIndex, 1 );\n\n\t\treorderedPages.splice( 1, 0, ...blogPage );\n\t}\n\n\tconst [ showAddPage, setShowAddPage ] = useState( false );\n\n\tconst history = useHistory();\n\n\tconst handleNewPage = ( { type, id } ) => {\n\t\t// Navigate to the created template editor.\n\t\thistory.push( {\n\t\t\tpostId: id,\n\t\t\tpostType: type,\n\t\t\tcanvas: 'edit',\n\t\t} );\n\t\tsetShowAddPage( false );\n\t};\n\n\tconst getPageProps = ( id ) => {\n\t\tlet itemIcon = page;\n\t\tconst postsPageTemplateId =\n\t\t\tpostsPage && postsPage === id ? getPostsPageTemplate()?.id : null;\n\n\t\tswitch ( id ) {\n\t\t\tcase frontPage:\n\t\t\t\titemIcon = home;\n\t\t\t\tbreak;\n\t\t\tcase postsPage:\n\t\t\t\titemIcon = verse;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn {\n\t\t\ticon: itemIcon,\n\t\t\tpostType: postsPageTemplateId ? TEMPLATE_POST_TYPE : 'page',\n\t\t\tpostId: postsPageTemplateId || id,\n\t\t};\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t{ showAddPage && (\n\t\t\t\t<AddNewPageModal\n\t\t\t\t\tonSave={ handleNewPage }\n\t\t\t\t\tonClose={ () => setShowAddPage( false ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<SidebarNavigationScreen\n\t\t\t\ttitle={ __( 'Pages' ) }\n\t\t\t\tdescription={ __( 'Browse and edit pages on your site.' ) }\n\t\t\t\tactions={\n\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\tlabel={ __( 'Draft a new page' ) }\n\t\t\t\t\t\tonClick={ () => setShowAddPage( true ) }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\tcontent={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ( isLoadingPages || isLoadingTemplates ) && (\n\t\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t\t<Item>{ __( 'Loading pages…' ) }</Item>\n\t\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ ! ( isLoadingPages || isLoadingTemplates ) && (\n\t\t\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t\t\t{ ! pagesAndTemplates?.length && (\n\t\t\t\t\t\t\t\t\t<Item>{ __( 'No page found' ) }</Item>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ isHomePageBlog && homeTemplate && (\n\t\t\t\t\t\t\t\t\t<PageItem\n\t\t\t\t\t\t\t\t\t\tpostType={ TEMPLATE_POST_TYPE }\n\t\t\t\t\t\t\t\t\t\tpostId={ homeTemplate.id }\n\t\t\t\t\t\t\t\t\t\tkey={ homeTemplate.id }\n\t\t\t\t\t\t\t\t\t\ticon={ home }\n\t\t\t\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t\t\t\t\t\t\t{ decodeEntities(\n\t\t\t\t\t\t\t\t\t\t\t\thomeTemplate.title?.rendered ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t__( '(no title)' )\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t\t\t</PageItem>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t{ reorderedPages?.map( ( { id, title } ) => (\n\t\t\t\t\t\t\t\t\t<PageItem\n\t\t\t\t\t\t\t\t\t\t{ ...getPageProps( id ) }\n\t\t\t\t\t\t\t\t\t\tkey={ id }\n\t\t\t\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t\t\t\t\t\t\t{ decodeEntities(\n\t\t\t\t\t\t\t\t\t\t\t\ttitle?.rendered ||\n\t\t\t\t\t\t\t\t\t\t\t\t\t__( '(no title)' )\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t\t\t</PageItem>\n\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\tfooter={\n\t\t\t\t\t<VStack spacing={ 0 }>\n\t\t\t\t\t\t{ dynamicPageTemplates?.map( ( item ) => (\n\t\t\t\t\t\t\t<PageItem\n\t\t\t\t\t\t\t\tpostType={ TEMPLATE_POST_TYPE }\n\t\t\t\t\t\t\t\tpostId={ item.id }\n\t\t\t\t\t\t\t\tkey={ item.id }\n\t\t\t\t\t\t\t\ticon={ layout }\n\t\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Truncate numberOfLines={ 1 }>\n\t\t\t\t\t\t\t\t\t{ decodeEntities(\n\t\t\t\t\t\t\t\t\t\titem.title?.rendered ||\n\t\t\t\t\t\t\t\t\t\t\t__( '(no title)' )\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t\t\t</PageItem>\n\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t<SidebarNavigationItem\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-pages__see-all\"\n\t\t\t\t\t\t\thref=\"edit.php?post_type=page\"\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tdocument.location = 'edit.php?post_type=page';\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Manage all pages' ) }\n\t\t\t\t\t\t</SidebarNavigationItem>\n\t\t\t\t\t</VStack>\n\t\t\t\t}\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,uBAAuB,IAAIC,SAAS,EACpCC,kBAAkB,IAAIC,IAAI,EAC1BC,sBAAsB,IAAIC,QAAQ,EAClCC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,gBAAgB,EAAEC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AAC3E,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;AACpE,SAASC,MAAM,EAAEC,IAAI,EAAEC,IAAI,EAAEC,KAAK,EAAEC,IAAI,QAAQ,kBAAkB;AAClE,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,SAASC,OAAO,QAAQ,gBAAgB;AACxC,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,OAAOC,eAAe,MAAM,iBAAiB;AAC7C,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,kBAAkB,QAAQ,uBAAuB;AAE1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T,CACQ,CAEX,CACF;IACD0F,MAAM,EACL/D,aAAA,CAAC7B,MAAM;MAAC6F,OAAO,EAAG;IAAG,GAClBtD,oBAAoB,EAAEoD,GAAG,CAAI9B,IAAI,IAClChC,aAAA,CAACN,QAAQ;MACRC,QAAQ,EAAGH,kBAAoB;MAC/BI,MAAM,EAAGoC,IAAI,CAACC,EAAI;MAClByB,GAAG,EAAG1B,IAAI,CAACC,EAAI;MACfe,IAAI,EAAGpE,MAAQ;MACf+E,WAAW;IAAA,GAEX3D,aAAA,CAAC/B,QAAQ;MAAC2F,aAAa,EAAG;IAAG,GAC1BnF,cAAc,CACfuD,IAAI,CAACoB,KAAK,EAAES,QAAQ,IACnBxF,EAAE,CAAE,YAAa,CACnB,CACS,CACD,CACT,CAAC,EACH2B,aAAA,CAACZ,qBAAqB;MACrB6E,SAAS,EAAC,oDAAoD;MAC9DC,IAAI,EAAC,yBAAyB;MAC9BV,OAAO,EAAGA,CAAA,KAAM;QACfW,QAAQ,CAACC,QAAQ,GAAG,yBAAyB;MAC9C;IAAG,GAED/F,EAAE,CAAE,kBAAmB,CACH,CAChB;EACR,CACD,CACA,CAAC;AAEL"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createElement } from "@wordpress/element";
|
|
1
|
+
import { createElement, Fragment } from "@wordpress/element";
|
|
2
2
|
/**
|
|
3
3
|
* WordPress dependencies
|
|
4
4
|
*/
|
|
@@ -17,17 +17,19 @@ import useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-e
|
|
|
17
17
|
import usePatternDetails from './use-pattern-details';
|
|
18
18
|
import { store as editSiteStore } from '../../store';
|
|
19
19
|
import { unlock } from '../../lock-unlock';
|
|
20
|
+
import TemplateActions from '../template-actions';
|
|
21
|
+
import { TEMPLATE_PART_POST_TYPE } from '../../utils/constants';
|
|
20
22
|
export default function SidebarNavigationScreenPattern() {
|
|
23
|
+
const navigator = useNavigator();
|
|
21
24
|
const {
|
|
22
|
-
params
|
|
23
|
-
|
|
25
|
+
params: {
|
|
26
|
+
postType,
|
|
27
|
+
postId
|
|
28
|
+
}
|
|
29
|
+
} = navigator;
|
|
24
30
|
const {
|
|
25
31
|
categoryType
|
|
26
32
|
} = getQueryArgs(window.location.href);
|
|
27
|
-
const {
|
|
28
|
-
postType,
|
|
29
|
-
postId
|
|
30
|
-
} = params;
|
|
31
33
|
const {
|
|
32
34
|
setCanvasMode
|
|
33
35
|
} = unlock(useDispatch(editSiteStore));
|
|
@@ -37,13 +39,22 @@ export default function SidebarNavigationScreenPattern() {
|
|
|
37
39
|
// The absence of a category type in the query params for template parts
|
|
38
40
|
// indicates the user has arrived at the template part via the "manage all"
|
|
39
41
|
// page and the back button should return them to that list page.
|
|
40
|
-
const backPath = !categoryType && postType ===
|
|
42
|
+
const backPath = !categoryType && postType === TEMPLATE_PART_POST_TYPE ? '/wp_template_part/all' : '/patterns';
|
|
41
43
|
return createElement(SidebarNavigationScreen, {
|
|
42
|
-
actions: createElement(
|
|
44
|
+
actions: createElement(Fragment, null, createElement(TemplateActions, {
|
|
45
|
+
postType: postType,
|
|
46
|
+
postId: postId,
|
|
47
|
+
toggleProps: {
|
|
48
|
+
as: SidebarButton
|
|
49
|
+
},
|
|
50
|
+
onRemove: () => {
|
|
51
|
+
navigator.goTo(backPath);
|
|
52
|
+
}
|
|
53
|
+
}), createElement(SidebarButton, {
|
|
43
54
|
onClick: () => setCanvasMode('edit'),
|
|
44
55
|
label: __('Edit'),
|
|
45
56
|
icon: pencil
|
|
46
|
-
}),
|
|
57
|
+
})),
|
|
47
58
|
backPath: backPath,
|
|
48
59
|
...patternDetails
|
|
49
60
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__experimentalUseNavigator","useNavigator","useDispatch","__","pencil","getQueryArgs","SidebarButton","SidebarNavigationScreen","useInitEditedEntityFromURL","usePatternDetails","store","editSiteStore","unlock","SidebarNavigationScreenPattern","params","
|
|
1
|
+
{"version":3,"names":["__experimentalUseNavigator","useNavigator","useDispatch","__","pencil","getQueryArgs","SidebarButton","SidebarNavigationScreen","useInitEditedEntityFromURL","usePatternDetails","store","editSiteStore","unlock","TemplateActions","TEMPLATE_PART_POST_TYPE","SidebarNavigationScreenPattern","navigator","params","postType","postId","categoryType","window","location","href","setCanvasMode","patternDetails","backPath","createElement","actions","Fragment","toggleProps","as","onRemove","goTo","onClick","label","icon"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalUseNavigator as useNavigator } from '@wordpress/components';\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { pencil } from '@wordpress/icons';\nimport { getQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport SidebarButton from '../sidebar-button';\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-entity-from-url';\nimport usePatternDetails from './use-pattern-details';\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport TemplateActions from '../template-actions';\nimport { TEMPLATE_PART_POST_TYPE } from '../../utils/constants';\n\nexport default function SidebarNavigationScreenPattern() {\n\tconst navigator = useNavigator();\n\tconst {\n\t\tparams: { postType, postId },\n\t} = navigator;\n\tconst { categoryType } = getQueryArgs( window.location.href );\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\n\tuseInitEditedEntityFromURL();\n\n\tconst patternDetails = usePatternDetails( postType, postId );\n\n\t// The absence of a category type in the query params for template parts\n\t// indicates the user has arrived at the template part via the \"manage all\"\n\t// page and the back button should return them to that list page.\n\tconst backPath =\n\t\t! categoryType && postType === TEMPLATE_PART_POST_TYPE\n\t\t\t? '/wp_template_part/all'\n\t\t\t: '/patterns';\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tactions={\n\t\t\t\t<>\n\t\t\t\t\t<TemplateActions\n\t\t\t\t\t\tpostType={ postType }\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( backPath );\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\tbackPath={ backPath }\n\t\t\t{ ...patternDetails }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,0BAA0B,IAAIC,YAAY,QAAQ,uBAAuB;AAClF,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASC,YAAY,QAAQ,gBAAgB;;AAE7C;AACA;AACA;AACA,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,OAAOC,0BAA0B,MAAM,wDAAwD;AAC/F,OAAOC,iBAAiB,MAAM,uBAAuB;AACrD,SAASC,KAAK,IAAIC,aAAa,QAAQ,aAAa;AACpD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,eAAe,MAAM,qBAAqB;AACjD,SAASC,uBAAuB,QAAQ,uBAAuB;AAE/D,eAAe,SAASC,8BAA8BA,CAAA,EAAG;EACxD,MAAMC,SAAS,GAAGf,YAAY,CAAC,CAAC;EAChC,MAAM;IACLgB,MAAM,EAAE;MAAEC,QAAQ;MAAEC;IAAO;EAC5B,CAAC,GAAGH,SAAS;EACb,MAAM;IAAEI;EAAa,CAAC,GAAGf,YAAY,CAAEgB,MAAM,CAACC,QAAQ,CAACC,IAAK,CAAC;EAC7D,MAAM;IAAEC;EAAc,CAAC,GAAGZ,MAAM,CAAEV,WAAW,CAAES,aAAc,CAAE,CAAC;EAEhEH,0BAA0B,CAAC,CAAC;EAE5B,MAAMiB,cAAc,GAAGhB,iBAAiB,CAAES,QAAQ,EAAEC,MAAO,CAAC;;EAE5D;EACA;EACA;EACA,MAAMO,QAAQ,GACb,CAAEN,YAAY,IAAIF,QAAQ,KAAKJ,uBAAuB,GACnD,uBAAuB,GACvB,WAAW;EAEf,OACCa,aAAA,CAACpB,uBAAuB;IACvBqB,OAAO,EACND,aAAA,CAAAE,QAAA,QACCF,aAAA,CAACd,eAAe;MACfK,QAAQ,EAAGA,QAAU;MACrBC,MAAM,EAAGA,MAAQ;MACjBW,WAAW,EAAG;QAAEC,EAAE,EAAEzB;MAAc,CAAG;MACrC0B,QAAQ,EAAGA,CAAA,KAAM;QAChBhB,SAAS,CAACiB,IAAI,CAAEP,QAAS,CAAC;MAC3B;IAAG,CACH,CAAC,EACFC,aAAA,CAACrB,aAAa;MACb4B,OAAO,EAAGA,CAAA,KAAMV,aAAa,CAAE,MAAO,CAAG;MACzCW,KAAK,EAAGhC,EAAE,CAAE,MAAO,CAAG;MACtBiC,IAAI,EAAGhC;IAAQ,CACf,CACA,CACF;IACDsB,QAAQ,EAAGA,QAAU;IAAA,GAChBD;EAAc,CACnB,CAAC;AAEJ"}
|
|
@@ -10,13 +10,14 @@ import { __ } from '@wordpress/i18n';
|
|
|
10
10
|
*/
|
|
11
11
|
import SidebarNavigationItem from '../sidebar-navigation-item';
|
|
12
12
|
import { useLink } from '../routes/link';
|
|
13
|
+
import { NAVIGATION_POST_TYPE } from '../../utils/constants';
|
|
13
14
|
export default function TemplatePartNavigationMenuListItem({
|
|
14
15
|
id
|
|
15
16
|
}) {
|
|
16
|
-
const [title] = useEntityProp('postType',
|
|
17
|
+
const [title] = useEntityProp('postType', NAVIGATION_POST_TYPE, 'title', id);
|
|
17
18
|
const linkInfo = useLink({
|
|
18
19
|
postId: id,
|
|
19
|
-
postType:
|
|
20
|
+
postType: NAVIGATION_POST_TYPE
|
|
20
21
|
});
|
|
21
22
|
if (!id) return null;
|
|
22
23
|
return createElement(SidebarNavigationItem, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useEntityProp","__","SidebarNavigationItem","useLink","TemplatePartNavigationMenuListItem","id","title","linkInfo","postId","postType","createElement","withChevron"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEntityProp } from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { useLink } from '../routes/link';\n\nexport default function TemplatePartNavigationMenuListItem( { id } ) {\n\tconst [ title ] = useEntityProp(
|
|
1
|
+
{"version":3,"names":["useEntityProp","__","SidebarNavigationItem","useLink","NAVIGATION_POST_TYPE","TemplatePartNavigationMenuListItem","id","title","linkInfo","postId","postType","createElement","withChevron"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEntityProp } from '@wordpress/core-data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { useLink } from '../routes/link';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\n\nexport default function TemplatePartNavigationMenuListItem( { id } ) {\n\tconst [ title ] = useEntityProp(\n\t\t'postType',\n\t\tNAVIGATION_POST_TYPE,\n\t\t'title',\n\t\tid\n\t);\n\n\tconst linkInfo = useLink( {\n\t\tpostId: id,\n\t\tpostType: NAVIGATION_POST_TYPE,\n\t} );\n\n\tif ( ! id ) return null;\n\n\treturn (\n\t\t<SidebarNavigationItem withChevron { ...linkInfo }>\n\t\t\t{ title || __( '(no title)' ) }\n\t\t</SidebarNavigationItem>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,aAAa,QAAQ,sBAAsB;AACpD,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,SAASC,OAAO,QAAQ,gBAAgB;AACxC,SAASC,oBAAoB,QAAQ,uBAAuB;AAE5D,eAAe,SAASC,kCAAkCA,CAAE;EAAEC;AAAG,CAAC,EAAG;EACpE,MAAM,CAAEC,KAAK,CAAE,GAAGP,aAAa,CAC9B,UAAU,EACVI,oBAAoB,EACpB,OAAO,EACPE,EACD,CAAC;EAED,MAAME,QAAQ,GAAGL,OAAO,CAAE;IACzBM,MAAM,EAAEH,EAAE;IACVI,QAAQ,EAAEN;EACX,CAAE,CAAC;EAEH,IAAK,CAAEE,EAAE,EAAG,OAAO,IAAI;EAEvB,OACCK,aAAA,CAACT,qBAAqB;IAACU,WAAW;IAAA,GAAMJ;EAAQ,GAC7CD,KAAK,IAAIN,EAAE,CAAE,YAAa,CACN,CAAC;AAE1B"}
|
package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js
CHANGED
|
@@ -10,10 +10,11 @@ import { useEntityProp } from '@wordpress/core-data';
|
|
|
10
10
|
* Internal dependencies
|
|
11
11
|
*/
|
|
12
12
|
import NavigationMenuEditor from '../sidebar-navigation-screen-navigation-menu/navigation-menu-editor';
|
|
13
|
+
import { NAVIGATION_POST_TYPE } from '../../utils/constants';
|
|
13
14
|
export default function TemplatePartNavigationMenu({
|
|
14
15
|
id
|
|
15
16
|
}) {
|
|
16
|
-
const [title] = useEntityProp('postType',
|
|
17
|
+
const [title] = useEntityProp('postType', NAVIGATION_POST_TYPE, 'title', id);
|
|
17
18
|
if (!id) return null;
|
|
18
19
|
return createElement(Fragment, null, createElement(Heading, {
|
|
19
20
|
className: "edit-site-sidebar-navigation-screen-template-part-navigation-menu__title",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","__experimentalHeading","Heading","useEntityProp","NavigationMenuEditor","TemplatePartNavigationMenu","id","title","createElement","Fragment","className","size","upperCase","weight","navigationMenuId"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalHeading as Heading } from '@wordpress/components';\nimport { useEntityProp } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport NavigationMenuEditor from '../sidebar-navigation-screen-navigation-menu/navigation-menu-editor';\n\nexport default function TemplatePartNavigationMenu( { id } ) {\n\tconst [ title ] = useEntityProp(
|
|
1
|
+
{"version":3,"names":["__","__experimentalHeading","Heading","useEntityProp","NavigationMenuEditor","NAVIGATION_POST_TYPE","TemplatePartNavigationMenu","id","title","createElement","Fragment","className","size","upperCase","weight","navigationMenuId"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalHeading as Heading } from '@wordpress/components';\nimport { useEntityProp } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport NavigationMenuEditor from '../sidebar-navigation-screen-navigation-menu/navigation-menu-editor';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\n\nexport default function TemplatePartNavigationMenu( { id } ) {\n\tconst [ title ] = useEntityProp(\n\t\t'postType',\n\t\tNAVIGATION_POST_TYPE,\n\t\t'title',\n\t\tid\n\t);\n\n\tif ( ! id ) return null;\n\n\treturn (\n\t\t<>\n\t\t\t<Heading\n\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-template-part-navigation-menu__title\"\n\t\t\t\tsize=\"11\"\n\t\t\t\tupperCase={ true }\n\t\t\t\tweight={ 500 }\n\t\t\t>\n\t\t\t\t{ title || __( 'Navigation' ) }\n\t\t\t</Heading>\n\t\t\t<NavigationMenuEditor navigationMenuId={ id } />\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,qBAAqB,IAAIC,OAAO,QAAQ,uBAAuB;AACxE,SAASC,aAAa,QAAQ,sBAAsB;;AAEpD;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,qEAAqE;AACtG,SAASC,oBAAoB,QAAQ,uBAAuB;AAE5D,eAAe,SAASC,0BAA0BA,CAAE;EAAEC;AAAG,CAAC,EAAG;EAC5D,MAAM,CAAEC,KAAK,CAAE,GAAGL,aAAa,CAC9B,UAAU,EACVE,oBAAoB,EACpB,OAAO,EACPE,EACD,CAAC;EAED,IAAK,CAAEA,EAAE,EAAG,OAAO,IAAI;EAEvB,OACCE,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACP,OAAO;IACPS,SAAS,EAAC,0EAA0E;IACpFC,IAAI,EAAC,IAAI;IACTC,SAAS,EAAG,IAAM;IAClBC,MAAM,EAAG;EAAK,GAEZN,KAAK,IAAIR,EAAE,CAAE,YAAa,CACpB,CAAC,EACVS,aAAA,CAACL,oBAAoB;IAACW,gBAAgB,EAAGR;EAAI,CAAE,CAC9C,CAAC;AAEL"}
|
package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js
CHANGED
|
@@ -9,6 +9,7 @@ import { parse } from '@wordpress/blocks';
|
|
|
9
9
|
*/
|
|
10
10
|
import TemplatePartNavigationMenus from './template-part-navigation-menus';
|
|
11
11
|
import useEditedEntityRecord from '../use-edited-entity-record';
|
|
12
|
+
import { TEMPLATE_PART_POST_TYPE } from '../../utils/constants';
|
|
12
13
|
|
|
13
14
|
/**
|
|
14
15
|
* Retrieves a list of specific blocks from a given tree of blocks.
|
|
@@ -50,7 +51,7 @@ export default function useNavigationMenuContent(postType, postId) {
|
|
|
50
51
|
// Only managing navigation menus in template parts is supported
|
|
51
52
|
// to match previous behaviour. This could potentially be expanded
|
|
52
53
|
// to patterns as well.
|
|
53
|
-
if (postType !==
|
|
54
|
+
if (postType !== TEMPLATE_PART_POST_TYPE) {
|
|
54
55
|
return;
|
|
55
56
|
}
|
|
56
57
|
const blocks = record?.content && typeof record.content !== 'function' ? parse(record.content) : [];
|
package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["parse","TemplatePartNavigationMenus","useEditedEntityRecord","getBlocksOfTypeFromBlocks","targetBlockType","blocks","length","findInBlocks","_blocks","navigationBlocks","block","name","push","innerBlocks","innerNavigationBlocks","useNavigationMenuContent","postType","postId","record","content","navigationMenuIds","map","attributes","ref","uniqueNavigationMenuIds","Set","filter","menuId","createElement","menus"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { parse } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport TemplatePartNavigationMenus from './template-part-navigation-menus';\nimport useEditedEntityRecord from '../use-edited-entity-record';\n\n/**\n * Retrieves a list of specific blocks from a given tree of blocks.\n *\n * @param {string} targetBlockType The name of the block type to find.\n * @param {Array} blocks A list of blocks from a template part entity.\n *\n * @return {Array} A list of any navigation blocks found in the blocks.\n */\nfunction getBlocksOfTypeFromBlocks( targetBlockType, blocks ) {\n\tif ( ! targetBlockType || ! blocks?.length ) {\n\t\treturn [];\n\t}\n\n\tconst findInBlocks = ( _blocks ) => {\n\t\tif ( ! _blocks ) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst navigationBlocks = [];\n\n\t\tfor ( const block of _blocks ) {\n\t\t\tif ( block.name === targetBlockType ) {\n\t\t\t\tnavigationBlocks.push( block );\n\t\t\t}\n\n\t\t\tif ( block?.innerBlocks ) {\n\t\t\t\tconst innerNavigationBlocks = findInBlocks( block.innerBlocks );\n\n\t\t\t\tif ( innerNavigationBlocks.length ) {\n\t\t\t\t\tnavigationBlocks.push( ...innerNavigationBlocks );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn navigationBlocks;\n\t};\n\n\treturn findInBlocks( blocks );\n}\n\nexport default function useNavigationMenuContent( postType, postId ) {\n\tconst { record } = useEditedEntityRecord( postType, postId );\n\n\t// Only managing navigation menus in template parts is supported\n\t// to match previous behaviour. This could potentially be expanded\n\t// to patterns as well.\n\tif ( postType !==
|
|
1
|
+
{"version":3,"names":["parse","TemplatePartNavigationMenus","useEditedEntityRecord","TEMPLATE_PART_POST_TYPE","getBlocksOfTypeFromBlocks","targetBlockType","blocks","length","findInBlocks","_blocks","navigationBlocks","block","name","push","innerBlocks","innerNavigationBlocks","useNavigationMenuContent","postType","postId","record","content","navigationMenuIds","map","attributes","ref","uniqueNavigationMenuIds","Set","filter","menuId","createElement","menus"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { parse } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport TemplatePartNavigationMenus from './template-part-navigation-menus';\nimport useEditedEntityRecord from '../use-edited-entity-record';\nimport { TEMPLATE_PART_POST_TYPE } from '../../utils/constants';\n\n/**\n * Retrieves a list of specific blocks from a given tree of blocks.\n *\n * @param {string} targetBlockType The name of the block type to find.\n * @param {Array} blocks A list of blocks from a template part entity.\n *\n * @return {Array} A list of any navigation blocks found in the blocks.\n */\nfunction getBlocksOfTypeFromBlocks( targetBlockType, blocks ) {\n\tif ( ! targetBlockType || ! blocks?.length ) {\n\t\treturn [];\n\t}\n\n\tconst findInBlocks = ( _blocks ) => {\n\t\tif ( ! _blocks ) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst navigationBlocks = [];\n\n\t\tfor ( const block of _blocks ) {\n\t\t\tif ( block.name === targetBlockType ) {\n\t\t\t\tnavigationBlocks.push( block );\n\t\t\t}\n\n\t\t\tif ( block?.innerBlocks ) {\n\t\t\t\tconst innerNavigationBlocks = findInBlocks( block.innerBlocks );\n\n\t\t\t\tif ( innerNavigationBlocks.length ) {\n\t\t\t\t\tnavigationBlocks.push( ...innerNavigationBlocks );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn navigationBlocks;\n\t};\n\n\treturn findInBlocks( blocks );\n}\n\nexport default function useNavigationMenuContent( postType, postId ) {\n\tconst { record } = useEditedEntityRecord( postType, postId );\n\n\t// Only managing navigation menus in template parts is supported\n\t// to match previous behaviour. This could potentially be expanded\n\t// to patterns as well.\n\tif ( postType !== TEMPLATE_PART_POST_TYPE ) {\n\t\treturn;\n\t}\n\n\tconst blocks =\n\t\trecord?.content && typeof record.content !== 'function'\n\t\t\t? parse( record.content )\n\t\t\t: [];\n\n\tconst navigationBlocks = getBlocksOfTypeFromBlocks(\n\t\t'core/navigation',\n\t\tblocks\n\t);\n\n\tif ( ! navigationBlocks.length ) {\n\t\treturn;\n\t}\n\n\tconst navigationMenuIds = navigationBlocks?.map(\n\t\t( block ) => block.attributes.ref\n\t);\n\n\t// Dedupe the Navigation blocks, as you can have multiple navigation blocks in the template.\n\t// Also, filter out undefined values, as blocks don't have an id when initially added.\n\tconst uniqueNavigationMenuIds = [ ...new Set( navigationMenuIds ) ].filter(\n\t\t( menuId ) => menuId\n\t);\n\n\tif ( ! uniqueNavigationMenuIds?.length ) {\n\t\treturn;\n\t}\n\n\treturn <TemplatePartNavigationMenus menus={ uniqueNavigationMenuIds } />;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,KAAK,QAAQ,mBAAmB;;AAEzC;AACA;AACA;AACA,OAAOC,2BAA2B,MAAM,kCAAkC;AAC1E,OAAOC,qBAAqB,MAAM,6BAA6B;AAC/D,SAASC,uBAAuB,QAAQ,uBAAuB;;AAE/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASC,yBAAyBA,CAAEC,eAAe,EAAEC,MAAM,EAAG;EAC7D,IAAK,CAAED,eAAe,IAAI,CAAEC,MAAM,EAAEC,MAAM,EAAG;IAC5C,OAAO,EAAE;EACV;EAEA,MAAMC,YAAY,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C,CAAE,CAACM,MAAM,CACvEC,MAAM,IAAMA,MACf,CAAC;EAED,IAAK,CAAEH,uBAAuB,EAAElB,MAAM,EAAG;IACxC;EACD;EAEA,OAAOsB,aAAA,CAAC5B,2BAA2B;IAAC6B,KAAK,EAAGL;EAAyB,CAAE,CAAC;AACzE"}
|
|
@@ -20,6 +20,7 @@ import useEditedEntityRecord from '../use-edited-entity-record';
|
|
|
20
20
|
import useNavigationMenuContent from './use-navigation-menu-content';
|
|
21
21
|
import SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';
|
|
22
22
|
import { SidebarNavigationScreenDetailsPanel, SidebarNavigationScreenDetailsPanelRow, SidebarNavigationScreenDetailsPanelLabel, SidebarNavigationScreenDetailsPanelValue } from '../sidebar-navigation-screen-details-panel';
|
|
23
|
+
import { PATTERN_TYPES, TEMPLATE_PART_POST_TYPE, PATTERN_SYNC_TYPES, TEMPLATE_ORIGINS } from '../../utils/constants';
|
|
23
24
|
export default function usePatternDetails(postType, postId) {
|
|
24
25
|
const {
|
|
25
26
|
getDescription,
|
|
@@ -27,32 +28,61 @@ export default function usePatternDetails(postType, postId) {
|
|
|
27
28
|
record
|
|
28
29
|
} = useEditedEntityRecord(postType, postId);
|
|
29
30
|
const templatePartAreas = useSelect(select => select(editorStore).__experimentalGetDefaultTemplatePartAreas(), []);
|
|
30
|
-
const
|
|
31
|
+
const {
|
|
32
|
+
currentTheme,
|
|
33
|
+
userPatternCategories
|
|
34
|
+
} = useSelect(select => {
|
|
35
|
+
const {
|
|
36
|
+
getCurrentTheme,
|
|
37
|
+
getUserPatternCategories
|
|
38
|
+
} = select(coreStore);
|
|
39
|
+
return {
|
|
40
|
+
currentTheme: getCurrentTheme(),
|
|
41
|
+
userPatternCategories: getUserPatternCategories()
|
|
42
|
+
};
|
|
43
|
+
}, []);
|
|
31
44
|
const addedBy = useAddedBy(postType, postId);
|
|
32
45
|
const isAddedByActiveTheme = addedBy.type === 'theme' && record.theme === currentTheme?.stylesheet;
|
|
33
46
|
const title = getTitle();
|
|
34
47
|
let description = getDescription();
|
|
35
48
|
if (!description && addedBy.text) {
|
|
36
|
-
description = sprintf(
|
|
49
|
+
description = postType === PATTERN_TYPES.user ? sprintf(
|
|
37
50
|
// translators: %s: pattern title e.g: "Header".
|
|
38
|
-
__('This is the %s pattern.'), getTitle())
|
|
51
|
+
__('This is the %s pattern.'), getTitle()) : sprintf(
|
|
52
|
+
// translators: %s: template part title e.g: "Header".
|
|
53
|
+
__('This is the %s template part.'), getTitle());
|
|
39
54
|
}
|
|
40
|
-
if (!description && postType ===
|
|
55
|
+
if (!description && postType === PATTERN_TYPES.user && record?.title) {
|
|
41
56
|
description = sprintf(
|
|
42
57
|
// translators: %s: user created pattern title e.g. "Footer".
|
|
43
58
|
__('This is the %s pattern.'), record.title);
|
|
44
59
|
}
|
|
45
|
-
const footer =
|
|
46
|
-
|
|
60
|
+
const footer = record?.modified ? createElement(SidebarNavigationScreenDetailsFooter, {
|
|
61
|
+
record: record
|
|
47
62
|
}) : null;
|
|
48
63
|
const details = [];
|
|
49
|
-
if (postType ===
|
|
64
|
+
if (postType === PATTERN_TYPES.user || postType === TEMPLATE_PART_POST_TYPE) {
|
|
50
65
|
details.push({
|
|
51
66
|
label: __('Syncing'),
|
|
52
|
-
value: record.wp_pattern_sync_status ===
|
|
67
|
+
value: record.wp_pattern_sync_status === PATTERN_SYNC_TYPES.unsynced ? __('Not synced') : __('Fully synced')
|
|
53
68
|
});
|
|
69
|
+
if (record.wp_pattern_category?.length === 0) {
|
|
70
|
+
details.push({
|
|
71
|
+
label: __('Categories'),
|
|
72
|
+
value: __('Uncategorized')
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
if (record.wp_pattern_category?.length > 0) {
|
|
76
|
+
const patternCategories = new Map();
|
|
77
|
+
userPatternCategories.forEach(userCategory => patternCategories.set(userCategory.id, userCategory));
|
|
78
|
+
const categories = record.wp_pattern_category.filter(category => patternCategories.get(category)).map(category => patternCategories.get(category).label);
|
|
79
|
+
details.push({
|
|
80
|
+
label: __('Categories'),
|
|
81
|
+
value: categories.length > 0 ? categories.join(', ') : ''
|
|
82
|
+
});
|
|
83
|
+
}
|
|
54
84
|
}
|
|
55
|
-
if (postType ===
|
|
85
|
+
if (postType === TEMPLATE_PART_POST_TYPE) {
|
|
56
86
|
const templatePartArea = templatePartAreas.find(area => area.area === record.area);
|
|
57
87
|
let areaDetailValue = templatePartArea?.label;
|
|
58
88
|
if (!areaDetailValue) {
|
|
@@ -65,7 +95,7 @@ export default function usePatternDetails(postType, postId) {
|
|
|
65
95
|
value: areaDetailValue
|
|
66
96
|
});
|
|
67
97
|
}
|
|
68
|
-
if (postType ===
|
|
98
|
+
if (postType === TEMPLATE_PART_POST_TYPE && addedBy.text && !isAddedByActiveTheme) {
|
|
69
99
|
details.push({
|
|
70
100
|
label: __('Added by'),
|
|
71
101
|
value: createElement("span", {
|
|
@@ -73,7 +103,7 @@ export default function usePatternDetails(postType, postId) {
|
|
|
73
103
|
}, addedBy.text)
|
|
74
104
|
});
|
|
75
105
|
}
|
|
76
|
-
if (postType ===
|
|
106
|
+
if (postType === TEMPLATE_PART_POST_TYPE && addedBy.text && (record.origin === TEMPLATE_ORIGINS.plugin || record.has_theme_file === true)) {
|
|
77
107
|
details.push({
|
|
78
108
|
label: __('Customized'),
|
|
79
109
|
value: createElement("span", {
|
package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["sentenceCase","__","sprintf","store","coreStore","editorStore","useSelect","useAddedBy","useEditedEntityRecord","useNavigationMenuContent","SidebarNavigationScreenDetailsFooter","SidebarNavigationScreenDetailsPanel","SidebarNavigationScreenDetailsPanelRow","SidebarNavigationScreenDetailsPanelLabel","SidebarNavigationScreenDetailsPanelValue","usePatternDetails","postType","postId","getDescription","getTitle","record","templatePartAreas","select","__experimentalGetDefaultTemplatePartAreas","currentTheme","getCurrentTheme","addedBy","isAddedByActiveTheme","type","theme","stylesheet","title","description","text","footer","modified","createElement","lastModifiedDateTime","details","push","label","value","wp_pattern_sync_status","templatePartArea","find","area","areaDetailValue","className","origin","has_theme_file","isCustomized","content","Fragment","length","spacing","map","key"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { sentenceCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useAddedBy } from '../list/added-by';\nimport useEditedEntityRecord from '../use-edited-entity-record';\nimport useNavigationMenuContent from './use-navigation-menu-content';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\nimport {\n\tSidebarNavigationScreenDetailsPanel,\n\tSidebarNavigationScreenDetailsPanelRow,\n\tSidebarNavigationScreenDetailsPanelLabel,\n\tSidebarNavigationScreenDetailsPanelValue,\n} from '../sidebar-navigation-screen-details-panel';\n\nexport default function usePatternDetails( postType, postId ) {\n\tconst { getDescription, getTitle, record } = useEditedEntityRecord(\n\t\tpostType,\n\t\tpostId\n\t);\n\tconst templatePartAreas = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).__experimentalGetDefaultTemplatePartAreas(),\n\t\t[]\n\t);\n\tconst currentTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme(),\n\t\t[]\n\t);\n\tconst addedBy = useAddedBy( postType, postId );\n\tconst isAddedByActiveTheme =\n\t\taddedBy.type === 'theme' && record.theme === currentTheme?.stylesheet;\n\tconst title = getTitle();\n\tlet description = getDescription();\n\n\tif ( ! description && addedBy.text ) {\n\t\tdescription = sprintf(\n\t\t\t// translators: %s: pattern title e.g: \"Header\".\n\t\t\t__( 'This is the %s pattern.' ),\n\t\t\tgetTitle()\n\t\t);\n\t}\n\n\tif ( ! description && postType === 'wp_block' && record?.title ) {\n\t\tdescription = sprintf(\n\t\t\t// translators: %s: user created pattern title e.g. \"Footer\".\n\t\t\t__( 'This is the %s pattern.' ),\n\t\t\trecord.title\n\t\t);\n\t}\n\n\tconst footer = !! record?.modified ? (\n\t\t<SidebarNavigationScreenDetailsFooter\n\t\t\tlastModifiedDateTime={ record.modified }\n\t\t/>\n\t) : null;\n\n\tconst details = [];\n\n\tif ( postType === 'wp_block' || 'wp_template_part' ) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Syncing' ),\n\t\t\tvalue:\n\t\t\t\trecord.wp_pattern_sync_status === 'unsynced'\n\t\t\t\t\t? __( 'Not synced' )\n\t\t\t\t\t: __( 'Fully synced' ),\n\t\t} );\n\t}\n\n\tif ( postType === 'wp_template_part' ) {\n\t\tconst templatePartArea = templatePartAreas.find(\n\t\t\t( area ) => area.area === record.area\n\t\t);\n\n\t\tlet areaDetailValue = templatePartArea?.label;\n\n\t\tif ( ! areaDetailValue ) {\n\t\t\tareaDetailValue = record.area\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t// translators: %s: Sentenced cased template part area e.g: \"My custom area\".\n\t\t\t\t\t\t__( '%s (removed)' ),\n\t\t\t\t\t\tsentenceCase( record.area )\n\t\t\t\t )\n\t\t\t\t: __( 'None' );\n\t\t}\n\n\t\tdetails.push( { label: __( 'Area' ), value: areaDetailValue } );\n\t}\n\n\tif (\n\t\tpostType === 'wp_template_part' &&\n\t\taddedBy.text &&\n\t\t! isAddedByActiveTheme\n\t) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Added by' ),\n\t\t\tvalue: (\n\t\t\t\t<span className=\"edit-site-sidebar-navigation-screen-pattern__added-by-description-author\">\n\t\t\t\t\t{ addedBy.text }\n\t\t\t\t</span>\n\t\t\t),\n\t\t} );\n\t}\n\n\tif (\n\t\tpostType === 'wp_template_part' &&\n\t\taddedBy.text &&\n\t\t( record.origin === 'plugin' || record.has_theme_file === true )\n\t) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Customized' ),\n\t\t\tvalue: (\n\t\t\t\t<span className=\"edit-site-sidebar-navigation-screen-pattern__added-by-description-customized\">\n\t\t\t\t\t{ addedBy.isCustomized ? __( 'Yes' ) : __( 'No' ) }\n\t\t\t\t</span>\n\t\t\t),\n\t\t} );\n\t}\n\n\tconst content = (\n\t\t<>\n\t\t\t{ useNavigationMenuContent( postType, postId ) }\n\t\t\t{ !! details.length && (\n\t\t\t\t<SidebarNavigationScreenDetailsPanel\n\t\t\t\t\tspacing={ 5 }\n\t\t\t\t\ttitle={ __( 'Details' ) }\n\t\t\t\t>\n\t\t\t\t\t{ details.map( ( { label, value } ) => (\n\t\t\t\t\t\t<SidebarNavigationScreenDetailsPanelRow key={ label }>\n\t\t\t\t\t\t\t<SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t</SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t\t\t<SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t\t\t\t{ value }\n\t\t\t\t\t\t\t</SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t\t\t) ) }\n\t\t\t\t</SidebarNavigationScreenDetailsPanel>\n\t\t\t) }\n\t\t</>\n\t);\n\n\treturn { title, description, content, footer };\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,aAAa;;AAE1C;AACA;AACA;AACA,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASD,KAAK,IAAIE,WAAW,QAAQ,mBAAmB;AACxD,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,OAAOC,qBAAqB,MAAM,6BAA6B;AAC/D,OAAO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jB,QAAQ,KAAK,kBAAkB,IAC/BU,OAAO,CAACO,IAAI,KACVb,MAAM,CAAC4B,MAAM,KAAK,QAAQ,IAAI5B,MAAM,CAAC6B,cAAc,KAAK,IAAI,CAAE,EAC/D;IACDX,OAAO,CAACC,IAAI,CAAE;MACbC,KAAK,EAAEvC,EAAE,CAAE,YAAa,CAAC;MACzBwC,KAAK,EACJL,aAAA;QAAMW,SAAS,EAAC;MAA8E,GAC3FrB,OAAO,CAACwB,YAAY,GAAGjD,EAAE,CAAE,KAAM,CAAC,GAAGA,EAAE,CAAE,IAAK,CAC3C;IAER,CAAE,CAAC;EACJ;EAEA,MAAMkD,OAAO,GACZf,aAAA,CAAAgB,QAAA,QACG3C,wBAAwB,CAAEO,QAAQ,EAAEC,MAAO,CAAC,EAC5C,CAAC,CAAEqB,OAAO,CAACe,MAAM,IAClBjB,aAAA,CAACzB,mCAAmC;IACnC2C,OAAO,EAAG,CAAG;IACbvB,KAAK,EAAG9B,EAAE,CAAE,SAAU;EAAG,GAEvBqC,OAAO,CAACiB,GAAG,CAAE,CAAE;IAAEf,KAAK;IAAEC;EAAM,CAAC,KAChCL,aAAA,CAACxB,sCAAsC;IAAC4C,GAAG,EAAGhB;EAAO,GACpDJ,aAAA,CAACvB,wCAAwC,QACtC2B,KACuC,CAAC,EAC3CJ,aAAA,CAACtB,wCAAwC,QACtC2B,KACuC,CACH,CACvC,CACkC,CAErC,CACF;EAED,OAAO;IAAEV,KAAK;IAAEC,WAAW;IAAEmB,OAAO;IAAEjB;EAAO,CAAC;AAC/C"}
|
|
1
|
+
{"version":3,"names":["sentenceCase","__","sprintf","store","coreStore","editorStore","useSelect","useAddedBy","useEditedEntityRecord","useNavigationMenuContent","SidebarNavigationScreenDetailsFooter","SidebarNavigationScreenDetailsPanel","SidebarNavigationScreenDetailsPanelRow","SidebarNavigationScreenDetailsPanelLabel","SidebarNavigationScreenDetailsPanelValue","PATTERN_TYPES","TEMPLATE_PART_POST_TYPE","PATTERN_SYNC_TYPES","TEMPLATE_ORIGINS","usePatternDetails","postType","postId","getDescription","getTitle","record","templatePartAreas","select","__experimentalGetDefaultTemplatePartAreas","currentTheme","userPatternCategories","getCurrentTheme","getUserPatternCategories","addedBy","isAddedByActiveTheme","type","theme","stylesheet","title","description","text","user","footer","modified","createElement","details","push","label","value","wp_pattern_sync_status","unsynced","wp_pattern_category","length","patternCategories","Map","forEach","userCategory","set","id","categories","filter","category","get","map","join","templatePartArea","find","area","areaDetailValue","className","origin","plugin","has_theme_file","isCustomized","content","Fragment","spacing","key"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { sentenceCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useAddedBy } from '../list/added-by';\nimport useEditedEntityRecord from '../use-edited-entity-record';\nimport useNavigationMenuContent from './use-navigation-menu-content';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\nimport {\n\tSidebarNavigationScreenDetailsPanel,\n\tSidebarNavigationScreenDetailsPanelRow,\n\tSidebarNavigationScreenDetailsPanelLabel,\n\tSidebarNavigationScreenDetailsPanelValue,\n} from '../sidebar-navigation-screen-details-panel';\nimport {\n\tPATTERN_TYPES,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_SYNC_TYPES,\n\tTEMPLATE_ORIGINS,\n} from '../../utils/constants';\n\nexport default function usePatternDetails( postType, postId ) {\n\tconst { getDescription, getTitle, record } = useEditedEntityRecord(\n\t\tpostType,\n\t\tpostId\n\t);\n\tconst templatePartAreas = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).__experimentalGetDefaultTemplatePartAreas(),\n\t\t[]\n\t);\n\tconst { currentTheme, userPatternCategories } = useSelect( ( select ) => {\n\t\tconst { getCurrentTheme, getUserPatternCategories } =\n\t\t\tselect( coreStore );\n\n\t\treturn {\n\t\t\tcurrentTheme: getCurrentTheme(),\n\t\t\tuserPatternCategories: getUserPatternCategories(),\n\t\t};\n\t}, [] );\n\n\tconst addedBy = useAddedBy( postType, postId );\n\tconst isAddedByActiveTheme =\n\t\taddedBy.type === 'theme' && record.theme === currentTheme?.stylesheet;\n\tconst title = getTitle();\n\tlet description = getDescription();\n\n\tif ( ! description && addedBy.text ) {\n\t\tdescription =\n\t\t\tpostType === PATTERN_TYPES.user\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t// translators: %s: pattern title e.g: \"Header\".\n\t\t\t\t\t\t__( 'This is the %s pattern.' ),\n\t\t\t\t\t\tgetTitle()\n\t\t\t\t )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t// translators: %s: template part title e.g: \"Header\".\n\t\t\t\t\t\t__( 'This is the %s template part.' ),\n\t\t\t\t\t\tgetTitle()\n\t\t\t\t );\n\t}\n\n\tif ( ! description && postType === PATTERN_TYPES.user && record?.title ) {\n\t\tdescription = sprintf(\n\t\t\t// translators: %s: user created pattern title e.g. \"Footer\".\n\t\t\t__( 'This is the %s pattern.' ),\n\t\t\trecord.title\n\t\t);\n\t}\n\n\tconst footer = record?.modified ? (\n\t\t<SidebarNavigationScreenDetailsFooter record={ record } />\n\t) : null;\n\n\tconst details = [];\n\n\tif (\n\t\tpostType === PATTERN_TYPES.user ||\n\t\tpostType === TEMPLATE_PART_POST_TYPE\n\t) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Syncing' ),\n\t\t\tvalue:\n\t\t\t\trecord.wp_pattern_sync_status === PATTERN_SYNC_TYPES.unsynced\n\t\t\t\t\t? __( 'Not synced' )\n\t\t\t\t\t: __( 'Fully synced' ),\n\t\t} );\n\n\t\tif ( record.wp_pattern_category?.length === 0 ) {\n\t\t\tdetails.push( {\n\t\t\t\tlabel: __( 'Categories' ),\n\t\t\t\tvalue: __( 'Uncategorized' ),\n\t\t\t} );\n\t\t}\n\t\tif ( record.wp_pattern_category?.length > 0 ) {\n\t\t\tconst patternCategories = new Map();\n\t\t\tuserPatternCategories.forEach( ( userCategory ) =>\n\t\t\t\tpatternCategories.set( userCategory.id, userCategory )\n\t\t\t);\n\n\t\t\tconst categories = record.wp_pattern_category\n\t\t\t\t.filter( ( category ) => patternCategories.get( category ) )\n\t\t\t\t.map( ( category ) => patternCategories.get( category ).label );\n\n\t\t\tdetails.push( {\n\t\t\t\tlabel: __( 'Categories' ),\n\t\t\t\tvalue: categories.length > 0 ? categories.join( ', ' ) : '',\n\t\t\t} );\n\t\t}\n\t}\n\n\tif ( postType === TEMPLATE_PART_POST_TYPE ) {\n\t\tconst templatePartArea = templatePartAreas.find(\n\t\t\t( area ) => area.area === record.area\n\t\t);\n\n\t\tlet areaDetailValue = templatePartArea?.label;\n\n\t\tif ( ! areaDetailValue ) {\n\t\t\tareaDetailValue = record.area\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t// translators: %s: Sentenced cased template part area e.g: \"My custom area\".\n\t\t\t\t\t\t__( '%s (removed)' ),\n\t\t\t\t\t\tsentenceCase( record.area )\n\t\t\t\t )\n\t\t\t\t: __( 'None' );\n\t\t}\n\n\t\tdetails.push( { label: __( 'Area' ), value: areaDetailValue } );\n\t}\n\n\tif (\n\t\tpostType === TEMPLATE_PART_POST_TYPE &&\n\t\taddedBy.text &&\n\t\t! isAddedByActiveTheme\n\t) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Added by' ),\n\t\t\tvalue: (\n\t\t\t\t<span className=\"edit-site-sidebar-navigation-screen-pattern__added-by-description-author\">\n\t\t\t\t\t{ addedBy.text }\n\t\t\t\t</span>\n\t\t\t),\n\t\t} );\n\t}\n\n\tif (\n\t\tpostType === TEMPLATE_PART_POST_TYPE &&\n\t\taddedBy.text &&\n\t\t( record.origin === TEMPLATE_ORIGINS.plugin ||\n\t\t\trecord.has_theme_file === true )\n\t) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Customized' ),\n\t\t\tvalue: (\n\t\t\t\t<span className=\"edit-site-sidebar-navigation-screen-pattern__added-by-description-customized\">\n\t\t\t\t\t{ addedBy.isCustomized ? __( 'Yes' ) : __( 'No' ) }\n\t\t\t\t</span>\n\t\t\t),\n\t\t} );\n\t}\n\n\tconst content = (\n\t\t<>\n\t\t\t{ useNavigationMenuContent( postType, postId ) }\n\t\t\t{ !! details.length && (\n\t\t\t\t<SidebarNavigationScreenDetailsPanel\n\t\t\t\t\tspacing={ 5 }\n\t\t\t\t\ttitle={ __( 'Details' ) }\n\t\t\t\t>\n\t\t\t\t\t{ details.map( ( { label, value } ) => (\n\t\t\t\t\t\t<SidebarNavigationScreenDetailsPanelRow key={ label }>\n\t\t\t\t\t\t\t<SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t</SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t\t\t<SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t\t\t\t{ value }\n\t\t\t\t\t\t\t</SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t\t\t) ) }\n\t\t\t\t</SidebarNavigationScreenDetailsPanel>\n\t\t\t) }\n\t\t</>\n\t);\n\n\treturn { title, description, content, footer };\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,aAAa;;AAE1C;AACA;AACA;AACA,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASD,KAAK,IAAIE,WAAW,QAAQ,mBAAmB;AACxD,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,OAAOC,qBAAqB,MAAM,6BAA6B;AAC/D,OAAOC,wBAAwB,M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