@wordpress/edit-site 5.32.0 → 5.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/components/add-new-page/index.js +3 -0
- package/build/components/add-new-page/index.js.map +1 -1
- package/build/components/add-new-pattern/index.js +8 -7
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js +3 -0
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/add-custom-template-modal-content.js +3 -1
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/index.js +282 -13
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/add-new-template/utils.js +22 -11
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/app/index.js.map +1 -1
- package/build/components/async/index.js +51 -0
- package/build/components/async/index.js.map +1 -0
- package/build/components/block-editor/block-inspector-button.js +10 -9
- package/build/components/block-editor/block-inspector-button.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +15 -6
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/inserter-media-categories.js.map +1 -1
- package/build/components/block-editor/resizable-editor.js.map +1 -1
- package/build/components/block-editor/resize-handle.js +20 -5
- package/build/components/block-editor/resize-handle.js.map +1 -1
- package/build/components/block-editor/site-editor-canvas.js +5 -1
- package/build/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/canvas-loader/index.js.map +1 -1
- package/build/components/code-editor/index.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +3 -0
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/editor/index.js +61 -11
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/error-boundary/warning.js.map +1 -1
- package/build/components/global-styles/background-panel.js +13 -1
- package/build/components/global-styles/background-panel.js.map +1 -1
- package/build/components/global-styles/block-preview-panel.js +6 -1
- package/build/components/global-styles/block-preview-panel.js.map +1 -1
- package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/font-families.js +1 -1
- package/build/components/global-styles/font-families.js.map +1 -1
- package/build/components/global-styles/font-family-item.js.map +1 -1
- package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +69 -35
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-card.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +18 -6
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -1
- package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
- package/build/components/global-styles/font-library-modal/index.js +1 -1
- package/build/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +31 -28
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/constants.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
- package/build/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/highlighted-colors.js +1 -1
- package/build/components/global-styles/highlighted-colors.js.map +1 -1
- package/build/components/global-styles/hooks.js +11 -3
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build/components/global-styles/index.js.map +1 -1
- package/build/components/global-styles/navigation-button.js.map +1 -1
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preview-colors.js.map +1 -1
- package/build/components/global-styles/preview-iframe.js.map +1 -1
- package/build/components/global-styles/preview-styles.js.map +1 -1
- package/build/components/global-styles/root-menu.js +2 -2
- package/build/components/global-styles/root-menu.js.map +1 -1
- package/build/components/global-styles/screen-background.js +1 -1
- package/build/components/global-styles/screen-background.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +1 -1
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/global-styles/screen-typography-element.js.map +1 -1
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +8 -2
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/subtitle.js.map +1 -1
- package/build/components/global-styles/typography-elements.js.map +1 -1
- package/build/components/global-styles/typography-example.js.map +1 -1
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-preview.js.map +1 -1
- package/build/components/global-styles/ui.js +1 -1
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/global-styles/variations/variation.js.map +1 -1
- package/build/components/global-styles/variations/variations-color.js.map +1 -1
- package/build/components/global-styles/variations/variations-panel.js.map +1 -1
- package/build/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build/components/global-styles-renderer/index.js.map +1 -1
- package/build/components/header-edit-mode/document-tools/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +36 -52
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/index.js +4 -100
- package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/site-export.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/welcome-guide-menu-item.js.map +1 -1
- package/build/components/keyboard-shortcuts/global.js.map +1 -1
- package/build/components/keyboard-shortcuts/register.js +0 -67
- package/build/components/keyboard-shortcuts/register.js.map +1 -1
- package/build/components/layout/animation.js +3 -2
- package/build/components/layout/animation.js.map +1 -1
- package/build/components/layout/hooks.js.map +1 -1
- package/build/components/layout/index.js +20 -52
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/router.js +70 -33
- package/build/components/layout/router.js.map +1 -1
- package/build/components/media/index.js.map +1 -1
- package/build/components/page/header.js.map +1 -1
- package/build/components/page/index.js +5 -2
- package/build/components/page/index.js.map +1 -1
- package/build/components/page-pages/index.js +18 -19
- package/build/components/page-pages/index.js.map +1 -1
- package/build/components/page-patterns/dataviews-pattern-actions.js +16 -11
- package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
- package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build/components/page-patterns/header.js +5 -3
- package/build/components/page-patterns/header.js.map +1 -1
- package/build/components/page-patterns/index.js +140 -62
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-patterns/rename-category-menu-item.js.map +1 -1
- package/build/components/page-patterns/search-items.js +2 -1
- package/build/components/page-patterns/search-items.js.map +1 -1
- package/build/components/page-patterns/use-pattern-settings.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +6 -10
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-patterns/utils.js.map +1 -1
- package/build/components/page-templates/hooks.js.map +1 -0
- package/build/components/{page-templates-template-parts → page-templates}/index.js +78 -103
- package/build/components/page-templates/index.js.map +1 -0
- package/build/components/pagination/index.js.map +1 -1
- package/build/components/pattern-modal/duplicate.js +13 -8
- package/build/components/pattern-modal/duplicate.js.map +1 -1
- package/build/components/pattern-modal/index.js.map +1 -1
- package/build/components/pattern-modal/rename.js +6 -3
- package/build/components/pattern-modal/rename.js.map +1 -1
- package/build/components/plugin-template-setting-panel/index.js +9 -0
- package/build/components/plugin-template-setting-panel/index.js.map +1 -1
- package/build/components/{template-actions/rename-menu-item.js → rename-post-menu-item/index.js} +18 -16
- package/build/components/rename-post-menu-item/index.js.map +1 -0
- package/build/components/resizable-frame/index.js +10 -11
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/routes/link.js.map +1 -1
- package/build/components/routes/use-title.js.map +1 -1
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js.map +1 -1
- package/build/components/save-panel/index.js +3 -3
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +41 -75
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-button/index.js.map +1 -1
- package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +1 -1
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +1 -1
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/default-sidebar.js +18 -7
- package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +5 -3
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +31 -55
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/index.js +55 -3
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js +23 -16
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build/components/sidebar-edit-mode/settings-header/index.js +4 -5
- package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/index.js +3 -6
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build/components/sidebar-navigation-item/index.js +31 -0
- package/build/components/sidebar-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +36 -9
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +1 -2
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +6 -15
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js +7 -2
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +20 -15
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +6 -5
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/index.js +53 -12
- package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/index.js +17 -15
- 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.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/category-item.js +3 -2
- package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +64 -52
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -1
- 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.map +1 -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.map +1 -1
- package/build/components/sidebar-navigation-screen-template/index.js +11 -8
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/template-areas.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
- package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +4 -36
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/site-hub/index.js +22 -21
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/site-icon/index.js.map +1 -1
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +14 -13
- 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-canvas-mode-with-url.js.map +1 -1
- package/build/components/table/index.js.map +1 -1
- package/build/components/template-actions/index.js +7 -8
- package/build/components/template-actions/index.js.map +1 -1
- package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build/components/template-part-converter/index.js.map +1 -1
- package/build/components/use-edited-entity-record/index.js.map +1 -1
- package/build/components/welcome-guide/editor.js.map +1 -1
- package/build/components/welcome-guide/image.js.map +1 -1
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/page.js.map +1 -1
- package/build/components/welcome-guide/styles.js +6 -3
- package/build/components/welcome-guide/styles.js.map +1 -1
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/deprecated.js +55 -0
- package/build/deprecated.js.map +1 -0
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +10 -28
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/hooks/components.js.map +1 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js +3 -40
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +36 -5
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build/index.js +18 -23
- package/build/index.js.map +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/store/actions.js +21 -96
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js.map +1 -1
- package/build/store/index.js +1 -1
- package/build/store/index.js.map +1 -1
- package/build/store/private-actions.js +1 -85
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js.map +1 -1
- package/build/utils/clone-deep.js.map +1 -1
- package/build/utils/constants.js +2 -2
- package/build/utils/constants.js.map +1 -1
- package/build/utils/get-is-list-page.js.map +1 -1
- package/build/utils/is-previewing-theme.js.map +1 -1
- package/build/utils/is-template-removable.js.map +1 -1
- package/build/utils/is-template-revertable.js.map +1 -1
- package/build/utils/math.js.map +1 -1
- package/build/utils/set-nested-value.js +44 -0
- package/build/utils/set-nested-value.js.map +1 -0
- package/build/utils/template-part-create.js.map +1 -1
- package/build/utils/use-activate-theme.js.map +1 -1
- package/build/utils/use-actual-current-theme.js.map +1 -1
- package/build-module/components/add-new-page/index.js +3 -0
- package/build-module/components/add-new-page/index.js.map +1 -1
- package/build-module/components/add-new-pattern/index.js +8 -7
- package/build-module/components/add-new-pattern/index.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +3 -0
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js +3 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/index.js +283 -14
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +21 -11
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/async/index.js +44 -0
- package/build-module/components/async/index.js.map +1 -0
- package/build-module/components/block-editor/block-inspector-button.js +9 -8
- package/build-module/components/block-editor/block-inspector-button.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +16 -7
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/inserter-media-categories.js.map +1 -1
- package/build-module/components/block-editor/resizable-editor.js.map +1 -1
- package/build-module/components/block-editor/resize-handle.js +21 -6
- package/build-module/components/block-editor/resize-handle.js.map +1 -1
- package/build-module/components/block-editor/site-editor-canvas.js +5 -1
- package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/use-navigate-to-entity-record.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/canvas-loader/index.js.map +1 -1
- package/build-module/components/code-editor/index.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +3 -0
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/editor/index.js +61 -11
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/error-boundary/warning.js.map +1 -1
- package/build-module/components/global-styles/background-panel.js +14 -1
- package/build-module/components/global-styles/background-panel.js.map +1 -1
- package/build-module/components/global-styles/block-preview-panel.js +6 -1
- package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
- package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/font-families.js.map +1 -1
- package/build-module/components/global-styles/font-family-item.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +68 -35
- package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +19 -7
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/index.js +2 -2
- package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +32 -29
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/constants.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/filter-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/fonts-outline.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/make-families-from-faces.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
- package/build-module/components/global-styles/font-library-modal/utils/sort-font-faces.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/toggleFont.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/highlighted-colors.js +1 -1
- package/build-module/components/global-styles/highlighted-colors.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +11 -3
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build-module/components/global-styles/index.js.map +1 -1
- package/build-module/components/global-styles/navigation-button.js.map +1 -1
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preview-colors.js.map +1 -1
- package/build-module/components/global-styles/preview-iframe.js.map +1 -1
- package/build-module/components/global-styles/preview-styles.js.map +1 -1
- package/build-module/components/global-styles/root-menu.js +2 -2
- package/build-module/components/global-styles/root-menu.js.map +1 -1
- package/build-module/components/global-styles/screen-background.js +1 -1
- package/build-module/components/global-styles/screen-background.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
- package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +8 -2
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/subtitle.js.map +1 -1
- package/build-module/components/global-styles/typography-elements.js.map +1 -1
- package/build-module/components/global-styles/typography-example.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-preview.js.map +1 -1
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/global-styles/variations/variation.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-panel.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build-module/components/global-styles-renderer/index.js.map +1 -1
- package/build-module/components/header-edit-mode/document-tools/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +41 -57
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +6 -100
- package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/site-export.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/welcome-guide-menu-item.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/global.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/register.js +0 -67
- package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
- package/build-module/components/layout/animation.js +4 -3
- package/build-module/components/layout/animation.js.map +1 -1
- package/build-module/components/layout/hooks.js.map +1 -1
- package/build-module/components/layout/index.js +20 -52
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/router.js +70 -33
- package/build-module/components/layout/router.js.map +1 -1
- package/build-module/components/media/index.js.map +1 -1
- package/build-module/components/page/header.js.map +1 -1
- package/build-module/components/page/index.js +5 -2
- package/build-module/components/page/index.js.map +1 -1
- package/build-module/components/page-pages/index.js +18 -19
- package/build-module/components/page-pages/index.js.map +1 -1
- package/build-module/components/page-patterns/dataviews-pattern-actions.js +16 -11
- package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
- package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/header.js +5 -3
- package/build-module/components/page-patterns/header.js.map +1 -1
- package/build-module/components/page-patterns/index.js +143 -65
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-patterns/rename-category-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/search-items.js +3 -2
- package/build-module/components/page-patterns/search-items.js.map +1 -1
- package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +3 -6
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-patterns/utils.js.map +1 -1
- package/build-module/components/page-templates/hooks.js.map +1 -0
- package/build-module/components/{page-templates-template-parts → page-templates}/index.js +77 -102
- package/build-module/components/page-templates/index.js.map +1 -0
- package/build-module/components/pagination/index.js.map +1 -1
- package/build-module/components/pattern-modal/duplicate.js +11 -6
- package/build-module/components/pattern-modal/duplicate.js.map +1 -1
- package/build-module/components/pattern-modal/index.js.map +1 -1
- package/build-module/components/pattern-modal/rename.js +4 -1
- package/build-module/components/pattern-modal/rename.js.map +1 -1
- package/build-module/components/plugin-template-setting-panel/index.js +8 -0
- package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
- package/build-module/components/{template-actions/rename-menu-item.js → rename-post-menu-item/index.js} +17 -15
- package/build-module/components/rename-post-menu-item/index.js.map +1 -0
- package/build-module/components/resizable-frame/index.js +10 -11
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/routes/link.js.map +1 -1
- package/build-module/components/routes/use-title.js.map +1 -1
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-hub/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +2 -2
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +42 -75
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-button/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +1 -1
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/default-sidebar.js +16 -5
- package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +5 -3
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +30 -54
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/index.js +58 -6
- package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +25 -17
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/settings-header/index.js +4 -5
- package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/index.js +4 -7
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-item/index.js +31 -0
- package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +37 -10
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -1
- 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-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +2 -3
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +7 -16
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +8 -3
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +20 -15
- 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/build-navigation-label.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +6 -5
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/index.js +56 -15
- package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/index.js +17 -15
- 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.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -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/template-part-navigation-menus.js +3 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +3 -2
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +66 -54
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -1
- 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.map +1 -1
- 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.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js +13 -9
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/template-areas.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +4 -36
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +22 -21
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/site-icon/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +14 -13
- 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-canvas-mode-with-url.js.map +1 -1
- package/build-module/components/table/index.js.map +1 -1
- package/build-module/components/template-actions/index.js +7 -8
- package/build-module/components/template-actions/index.js.map +1 -1
- package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build-module/components/template-part-converter/index.js.map +1 -1
- package/build-module/components/use-edited-entity-record/index.js.map +1 -1
- package/build-module/components/welcome-guide/editor.js.map +1 -1
- package/build-module/components/welcome-guide/image.js.map +1 -1
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/page.js.map +1 -1
- package/build-module/components/welcome-guide/styles.js +6 -3
- package/build-module/components/welcome-guide/styles.js.map +1 -1
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/deprecated.js +45 -0
- package/build-module/deprecated.js.map +1 -0
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +11 -29
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/hooks/components.js.map +1 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +1 -38
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +35 -5
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build-module/index.js +1 -5
- package/build-module/index.js.map +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/store/actions.js +16 -92
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/constants.js.map +1 -1
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/private-actions.js +0 -83
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/clone-deep.js.map +1 -1
- package/build-module/utils/constants.js +1 -1
- package/build-module/utils/constants.js.map +1 -1
- package/build-module/utils/get-is-list-page.js.map +1 -1
- package/build-module/utils/is-previewing-theme.js.map +1 -1
- package/build-module/utils/is-template-removable.js.map +1 -1
- package/build-module/utils/is-template-revertable.js.map +1 -1
- package/build-module/utils/math.js.map +1 -1
- package/build-module/utils/set-nested-value.js +38 -0
- package/build-module/utils/set-nested-value.js.map +1 -0
- package/build-module/utils/template-part-create.js.map +1 -1
- package/build-module/utils/use-activate-theme.js.map +1 -1
- package/build-module/utils/use-actual-current-theme.js.map +1 -1
- package/build-style/style-rtl.css +261 -720
- package/build-style/style.css +261 -720
- package/package.json +43 -44
- package/src/components/add-new-page/index.js +7 -1
- package/src/components/add-new-pattern/index.js +15 -12
- package/src/components/add-new-template/add-custom-generic-template-modal-content.js +3 -0
- package/src/components/add-new-template/add-custom-template-modal-content.js +3 -1
- package/src/components/add-new-template/index.js +412 -12
- package/src/components/add-new-template/style.scss +0 -22
- package/src/components/add-new-template/utils.js +44 -24
- package/src/components/async/index.js +43 -0
- package/src/components/block-editor/block-inspector-button.js +9 -11
- package/src/components/block-editor/editor-canvas.js +45 -21
- package/src/components/block-editor/resize-handle.js +30 -11
- package/src/components/block-editor/site-editor-canvas.js +6 -1
- package/src/components/block-editor/style.scss +10 -15
- package/src/components/create-template-part-modal/index.js +3 -0
- package/src/components/editor/index.js +91 -15
- package/src/components/editor/style.scss +6 -1
- package/src/components/global-styles/background-panel.js +16 -0
- package/src/components/global-styles/block-preview-panel.js +6 -1
- package/src/components/global-styles/font-library-modal/context.js +85 -54
- package/src/components/global-styles/font-library-modal/font-collection.js +265 -222
- package/src/components/global-styles/font-library-modal/index.js +2 -2
- package/src/components/global-styles/font-library-modal/installed-fonts.js +184 -147
- package/src/components/global-styles/font-library-modal/style.scss +48 -13
- package/src/components/global-styles/font-library-modal/utils/sort-font-faces.js +6 -2
- package/src/components/global-styles/highlighted-colors.js +1 -1
- package/src/components/global-styles/hooks.js +20 -3
- package/src/components/global-styles/root-menu.js +2 -2
- package/src/components/global-styles/screen-background.js +1 -1
- package/src/components/global-styles/screen-revisions/index.js +1 -1
- package/src/components/global-styles/style-variations-container.js +11 -2
- package/src/components/header-edit-mode/index.js +56 -78
- package/src/components/header-edit-mode/more-menu/index.js +9 -157
- package/src/components/header-edit-mode/style.scss +14 -86
- package/src/components/keyboard-shortcuts/register.js +0 -78
- package/src/components/layout/animation.js +6 -3
- package/src/components/layout/index.js +23 -52
- package/src/components/layout/router.js +73 -50
- package/src/components/layout/style.scss +15 -37
- package/src/components/page/index.js +7 -2
- package/src/components/page-pages/index.js +46 -26
- package/src/components/page-pages/style.scss +40 -22
- package/src/components/page-patterns/dataviews-pattern-actions.js +13 -15
- package/src/components/page-patterns/header.js +7 -3
- package/src/components/page-patterns/index.js +162 -109
- package/src/components/page-patterns/search-items.js +3 -0
- package/src/components/page-patterns/style.scss +21 -7
- package/src/components/page-patterns/use-patterns.js +3 -6
- package/src/components/{page-templates-template-parts → page-templates}/index.js +46 -84
- package/src/components/{page-templates-template-parts → page-templates}/style.scss +2 -2
- package/src/components/pattern-modal/duplicate.js +6 -4
- package/src/components/pattern-modal/rename.js +2 -1
- package/src/components/plugin-template-setting-panel/index.js +8 -0
- package/src/components/{template-actions/rename-menu-item.js → rename-post-menu-item/index.js} +20 -24
- package/src/components/resizable-frame/index.js +6 -9
- package/src/components/save-panel/index.js +2 -2
- package/src/components/sidebar/index.js +52 -100
- package/src/components/sidebar/style.scss +41 -6
- package/src/components/sidebar-dataviews/default-views.js +1 -1
- package/src/components/sidebar-dataviews/index.js +1 -1
- package/src/components/sidebar-edit-mode/default-sidebar.js +13 -6
- package/src/components/sidebar-edit-mode/global-styles-sidebar.js +7 -3
- package/src/components/sidebar-edit-mode/index.js +50 -75
- package/src/components/sidebar-edit-mode/page-panels/index.js +65 -14
- package/src/components/sidebar-edit-mode/page-panels/page-summary.js +40 -20
- package/src/components/sidebar-edit-mode/settings-header/index.js +4 -5
- package/src/components/sidebar-edit-mode/style.scss +1 -1
- package/src/components/sidebar-edit-mode/template-panel/index.js +3 -13
- package/src/components/sidebar-navigation-item/index.js +29 -0
- package/src/components/sidebar-navigation-screen/index.js +29 -12
- package/src/components/sidebar-navigation-screen/style.scss +1 -21
- package/src/components/sidebar-navigation-screen-global-styles/index.js +2 -11
- package/src/components/sidebar-navigation-screen-main/index.js +11 -23
- package/src/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/index.js +7 -6
- package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +14 -14
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +1 -1
- package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +4 -5
- package/src/components/sidebar-navigation-screen-page/index.js +63 -14
- package/src/components/sidebar-navigation-screen-page/style.scss +8 -2
- package/src/components/sidebar-navigation-screen-pattern/index.js +13 -15
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -1
- package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
- package/src/components/sidebar-navigation-screen-patterns/category-item.js +2 -1
- package/src/components/sidebar-navigation-screen-patterns/index.js +97 -95
- package/src/components/sidebar-navigation-screen-patterns/style.scss +5 -0
- package/src/components/sidebar-navigation-screen-template/index.js +9 -13
- package/src/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +6 -43
- package/src/components/site-hub/index.js +80 -90
- package/src/components/site-hub/style.scss +14 -34
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +50 -39
- package/src/components/template-actions/index.js +8 -11
- package/src/components/welcome-guide/style.scss +1 -1
- package/src/components/welcome-guide/styles.js +6 -5
- package/src/deprecated.js +42 -0
- package/src/hooks/commands/use-edit-mode-commands.js +12 -33
- package/src/hooks/push-changes-to-global-styles/index.js +1 -40
- package/src/hooks/use-theme-style-variations/test/use-theme-style-variations-by-property.js +4 -0
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +74 -17
- package/src/index.js +1 -9
- package/src/store/actions.js +25 -141
- package/src/store/private-actions.js +0 -133
- package/src/store/test/actions.js +7 -2
- package/src/style.scss +1 -7
- package/src/utils/constants.js +2 -1
- package/src/utils/set-nested-value.js +39 -0
- package/build/components/add-new-template/new-template.js +0 -298
- package/build/components/add-new-template/new-template.js.map +0 -1
- package/build/components/add-new-template/template-actions-loading-screen.js +0 -27
- package/build/components/add-new-template/template-actions-loading-screen.js.map +0 -1
- package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js +0 -59
- package/build/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +0 -1
- package/build/components/header-edit-mode/plugin-more-menu-item/index.js +0 -78
- package/build/components/header-edit-mode/plugin-more-menu-item/index.js.map +0 -1
- package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +0 -71
- package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +0 -1
- package/build/components/header-edit-mode/tools-more-menu-group/index.js +0 -23
- package/build/components/header-edit-mode/tools-more-menu-group/index.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/config.js +0 -78
- package/build/components/keyboard-shortcut-help-modal/config.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -48
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +0 -119
- package/build/components/keyboard-shortcut-help-modal/index.js.map +0 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +0 -54
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
- package/build/components/keyboard-shortcuts/edit-mode.js +0 -79
- package/build/components/keyboard-shortcuts/edit-mode.js.map +0 -1
- package/build/components/page-actions/index.js +0 -35
- package/build/components/page-actions/index.js.map +0 -1
- package/build/components/page-actions/trash-page-menu-item.js +0 -54
- package/build/components/page-actions/trash-page-menu-item.js.map +0 -1
- package/build/components/page-templates-template-parts/actions.js +0 -207
- package/build/components/page-templates-template-parts/actions.js.map +0 -1
- package/build/components/page-templates-template-parts/add-new-template-part.js +0 -64
- package/build/components/page-templates-template-parts/add-new-template-part.js.map +0 -1
- package/build/components/page-templates-template-parts/hooks.js.map +0 -1
- package/build/components/page-templates-template-parts/index.js.map +0 -1
- package/build/components/preferences-modal/index.js +0 -38
- package/build/components/preferences-modal/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/constants.js +0 -9
- package/build/components/sidebar-edit-mode/constants.js.map +0 -1
- package/build/components/sidebar-edit-mode/page-panels/page-status.js +0 -188
- package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +0 -1
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -89
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +0 -1
- package/build/components/sidebar-navigation-screen-navigation-item/index.js +0 -54
- package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +0 -1
- package/build/components/sync-state-with-url/use-sync-path-with-url.js +0 -132
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +0 -1
- package/build/components/template-actions/rename-menu-item.js.map +0 -1
- package/build-module/components/add-new-template/new-template.js +0 -290
- package/build-module/components/add-new-template/new-template.js.map +0 -1
- package/build-module/components/add-new-template/template-actions-loading-screen.js +0 -20
- package/build-module/components/add-new-template/template-actions-loading-screen.js.map +0 -1
- package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js +0 -52
- package/build-module/components/header-edit-mode/more-menu/copy-content-menu-item.js.map +0 -1
- package/build-module/components/header-edit-mode/plugin-more-menu-item/index.js +0 -73
- package/build-module/components/header-edit-mode/plugin-more-menu-item/index.js.map +0 -1
- package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +0 -65
- package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +0 -1
- package/build-module/components/header-edit-mode/tools-more-menu-group/index.js +0 -16
- package/build-module/components/header-edit-mode/tools-more-menu-group/index.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/config.js +0 -71
- package/build-module/components/keyboard-shortcut-help-modal/config.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -40
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -110
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +0 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -47
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
- package/build-module/components/keyboard-shortcuts/edit-mode.js +0 -72
- package/build-module/components/keyboard-shortcuts/edit-mode.js.map +0 -1
- package/build-module/components/page-actions/index.js +0 -27
- package/build-module/components/page-actions/index.js.map +0 -1
- package/build-module/components/page-actions/trash-page-menu-item.js +0 -47
- package/build-module/components/page-actions/trash-page-menu-item.js.map +0 -1
- package/build-module/components/page-templates-template-parts/actions.js +0 -199
- package/build-module/components/page-templates-template-parts/actions.js.map +0 -1
- package/build-module/components/page-templates-template-parts/add-new-template-part.js +0 -56
- package/build-module/components/page-templates-template-parts/add-new-template-part.js.map +0 -1
- package/build-module/components/page-templates-template-parts/hooks.js.map +0 -1
- package/build-module/components/page-templates-template-parts/index.js.map +0 -1
- package/build-module/components/preferences-modal/index.js +0 -30
- package/build-module/components/preferences-modal/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/constants.js +0 -3
- package/build-module/components/sidebar-edit-mode/constants.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +0 -180
- package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -83
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +0 -46
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +0 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +0 -124
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +0 -1
- package/build-module/components/template-actions/rename-menu-item.js.map +0 -1
- package/src/components/add-new-template/new-template.js +0 -429
- package/src/components/add-new-template/template-actions-loading-screen.js +0 -23
- package/src/components/header-edit-mode/more-menu/copy-content-menu-item.js +0 -51
- package/src/components/header-edit-mode/plugin-more-menu-item/index.js +0 -73
- package/src/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +0 -64
- package/src/components/header-edit-mode/tools-more-menu-group/index.js +0 -16
- package/src/components/keyboard-shortcut-help-modal/config.js +0 -53
- package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -41
- package/src/components/keyboard-shortcut-help-modal/index.js +0 -151
- package/src/components/keyboard-shortcut-help-modal/shortcut.js +0 -70
- package/src/components/keyboard-shortcut-help-modal/style.scss +0 -61
- package/src/components/keyboard-shortcuts/edit-mode.js +0 -88
- package/src/components/page-actions/index.js +0 -30
- package/src/components/page-actions/trash-page-menu-item.js +0 -63
- package/src/components/page-templates-template-parts/actions.js +0 -277
- package/src/components/page-templates-template-parts/add-new-template-part.js +0 -60
- package/src/components/preferences-modal/index.js +0 -29
- package/src/components/sidebar-edit-mode/constants.js +0 -2
- package/src/components/sidebar-edit-mode/page-panels/page-status.js +0 -249
- package/src/components/sidebar-edit-mode/page-panels/style.scss +0 -40
- package/src/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -80
- package/src/components/sidebar-navigation-screen-navigation-item/index.js +0 -59
- package/src/components/sync-state-with-url/use-sync-path-with-url.js +0 -147
- /package/build/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
- /package/build-module/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
- /package/src/components/{page-templates-template-parts → page-templates}/hooks.js +0 -0
|
@@ -17,12 +17,13 @@ var _escapeHtml = require("@wordpress/escape-html");
|
|
|
17
17
|
var _url = require("@wordpress/url");
|
|
18
18
|
var _element = require("@wordpress/element");
|
|
19
19
|
var _router = require("@wordpress/router");
|
|
20
|
+
var _editor = require("@wordpress/editor");
|
|
21
|
+
var _notices = require("@wordpress/notices");
|
|
20
22
|
var _sidebarNavigationScreen = _interopRequireDefault(require("../sidebar-navigation-screen"));
|
|
21
23
|
var _lockUnlock = require("../../lock-unlock");
|
|
22
24
|
var _store = require("../../store");
|
|
23
25
|
var _sidebarButton = _interopRequireDefault(require("../sidebar-button"));
|
|
24
26
|
var _pageDetails = _interopRequireDefault(require("./page-details"));
|
|
25
|
-
var _pageActions = _interopRequireDefault(require("../page-actions"));
|
|
26
27
|
var _sidebarNavigationScreenDetailsFooter = _interopRequireDefault(require("../sidebar-navigation-screen-details-footer"));
|
|
27
28
|
/**
|
|
28
29
|
* WordPress dependencies
|
|
@@ -33,8 +34,12 @@ var _sidebarNavigationScreenDetailsFooter = _interopRequireDefault(require("../s
|
|
|
33
34
|
*/
|
|
34
35
|
|
|
35
36
|
const {
|
|
37
|
+
useLocation,
|
|
36
38
|
useHistory
|
|
37
39
|
} = (0, _lockUnlock.unlock)(_router.privateApis);
|
|
40
|
+
const {
|
|
41
|
+
PostActions
|
|
42
|
+
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
38
43
|
function SidebarNavigationScreenPage({
|
|
39
44
|
backPath
|
|
40
45
|
}) {
|
|
@@ -42,12 +47,14 @@ function SidebarNavigationScreenPage({
|
|
|
42
47
|
setCanvasMode
|
|
43
48
|
} = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
|
|
44
49
|
const history = useHistory();
|
|
50
|
+
const {
|
|
51
|
+
createSuccessNotice
|
|
52
|
+
} = (0, _data.useDispatch)(_notices.store);
|
|
45
53
|
const {
|
|
46
54
|
params: {
|
|
47
55
|
postId
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
} = (0, _components.__experimentalUseNavigator)();
|
|
56
|
+
}
|
|
57
|
+
} = useLocation();
|
|
51
58
|
const {
|
|
52
59
|
record,
|
|
53
60
|
hasResolved
|
|
@@ -77,18 +84,52 @@ function SidebarNavigationScreenPage({
|
|
|
77
84
|
canvas: 'view'
|
|
78
85
|
});
|
|
79
86
|
}
|
|
80
|
-
}, [hasResolved, history]);
|
|
87
|
+
}, [hasResolved, record, history]);
|
|
88
|
+
const onActionPerformed = (0, _element.useCallback)((actionId, items) => {
|
|
89
|
+
switch (actionId) {
|
|
90
|
+
case 'move-to-trash':
|
|
91
|
+
{
|
|
92
|
+
history.push({
|
|
93
|
+
path: '/' + items[0].type,
|
|
94
|
+
postId: undefined,
|
|
95
|
+
postType: undefined,
|
|
96
|
+
canvas: 'view'
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
break;
|
|
100
|
+
case 'duplicate-post':
|
|
101
|
+
{
|
|
102
|
+
const newItem = items[0];
|
|
103
|
+
const title = typeof newItem.title === 'string' ? newItem.title : newItem.title?.rendered;
|
|
104
|
+
createSuccessNotice((0, _i18n.sprintf)(
|
|
105
|
+
// translators: %s: Title of the created post e.g: "Post 1".
|
|
106
|
+
(0, _i18n.__)('"%s" successfully created.'), title), {
|
|
107
|
+
type: 'snackbar',
|
|
108
|
+
id: 'duplicate-post-action',
|
|
109
|
+
actions: [{
|
|
110
|
+
label: (0, _i18n.__)('Edit'),
|
|
111
|
+
onClick: () => {
|
|
112
|
+
history.push({
|
|
113
|
+
path: undefined,
|
|
114
|
+
postId: newItem.id,
|
|
115
|
+
postType: newItem.type,
|
|
116
|
+
canvas: 'edit'
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}]
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
}, [history, createSuccessNotice]);
|
|
81
125
|
const featureImageAltText = featuredMediaAltText ? (0, _htmlEntities.decodeEntities)(featuredMediaAltText) : (0, _htmlEntities.decodeEntities)(record?.title?.rendered || (0, _i18n.__)('Featured image'));
|
|
82
126
|
return record ? (0, _react.createElement)(_sidebarNavigationScreen.default, {
|
|
83
127
|
backPath: backPath,
|
|
84
128
|
title: (0, _htmlEntities.decodeEntities)(record?.title?.rendered || (0, _i18n.__)('(no title)')),
|
|
85
|
-
actions: (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
onRemove: () => {
|
|
91
|
-
goTo('/page');
|
|
129
|
+
actions: (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(PostActions, {
|
|
130
|
+
onActionPerformed: onActionPerformed,
|
|
131
|
+
buttonProps: {
|
|
132
|
+
size: 'default'
|
|
92
133
|
}
|
|
93
134
|
}), (0, _react.createElement)(_sidebarButton.default, {
|
|
94
135
|
onClick: () => setCanvasMode('edit'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_data","_components","_coreData","_htmlEntities","_icons","_dom","_escapeHtml","_url","_element","_router","_sidebarNavigationScreen","_interopRequireDefault","_lockUnlock","_store","_sidebarButton","_pageDetails","_pageActions","_sidebarNavigationScreenDetailsFooter","useHistory","unlock","routerPrivateApis","SidebarNavigationScreenPage","backPath","setCanvasMode","useDispatch","editSiteStore","history","params","postId","goTo","useNavigator","record","hasResolved","useEntityRecord","featuredMediaAltText","featuredMediaSourceUrl","useSelect","select","getEntityRecord","coreStore","attachedMedia","featured_media","media_details","sizes","medium","source_url","escapeAttribute","alt_text","description","raw","useEffect","push","path","undefined","postType","canvas","featureImageAltText","decodeEntities","title","rendered","__","_react","createElement","default","actions","Fragment","toggleProps","as","SidebarButton","onRemove","onClick","label","icon","pencil","meta","ExternalLink","className","href","link","filterURLForDisplay","safeDecodeURIComponent","content","__experimentalVStack","alignment","spacing","alt","src","excerpt","__experimentalTruncate","numberOfLines","stripHTML","id","footer","modified"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-page/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\t__experimentalUseNavigator as useNavigator,\n\t__experimentalVStack as VStack,\n\tExternalLink,\n\t__experimentalTruncate as Truncate,\n} from '@wordpress/components';\nimport { store as coreStore, useEntityRecord } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { pencil } from '@wordpress/icons';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport { escapeAttribute } from '@wordpress/escape-html';\nimport { safeDecodeURIComponent, filterURLForDisplay } from '@wordpress/url';\nimport { useEffect } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport SidebarButton from '../sidebar-button';\nimport PageDetails from './page-details';\nimport PageActions from '../page-actions';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationScreenPage( { backPath } ) {\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\tconst history = useHistory();\n\tconst {\n\t\tparams: { postId },\n\t\tgoTo,\n\t} = useNavigator();\n\tconst { record, hasResolved } = useEntityRecord(\n\t\t'postType',\n\t\t'page',\n\t\tpostId\n\t);\n\n\tconst { featuredMediaAltText, featuredMediaSourceUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\t// Featured image.\n\t\t\tconst attachedMedia = record?.featured_media\n\t\t\t\t? getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'attachment',\n\t\t\t\t\t\trecord?.featured_media\n\t\t\t\t )\n\t\t\t\t: null;\n\n\t\t\treturn {\n\t\t\t\tfeaturedMediaSourceUrl:\n\t\t\t\t\tattachedMedia?.media_details.sizes?.medium?.source_url ||\n\t\t\t\t\tattachedMedia?.source_url,\n\t\t\t\tfeaturedMediaAltText: escapeAttribute(\n\t\t\t\t\tattachedMedia?.alt_text ||\n\t\t\t\t\t\tattachedMedia?.description?.raw ||\n\t\t\t\t\t\t''\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ record ]\n\t);\n\n\t// Redirect to the main pages navigation screen if the page is not found or has been deleted.\n\tuseEffect( () => {\n\t\tif ( hasResolved && ! record ) {\n\t\t\thistory.push( {\n\t\t\t\tpath: '/page',\n\t\t\t\tpostId: undefined,\n\t\t\t\tpostType: undefined,\n\t\t\t\tcanvas: 'view',\n\t\t\t} );\n\t\t}\n\t}, [ hasResolved, history ] );\n\n\tconst featureImageAltText = featuredMediaAltText\n\t\t? decodeEntities( featuredMediaAltText )\n\t\t: decodeEntities( record?.title?.rendered || __( 'Featured image' ) );\n\n\treturn record ? (\n\t\t<SidebarNavigationScreen\n\t\t\tbackPath={ backPath }\n\t\t\ttitle={ decodeEntities(\n\t\t\t\trecord?.title?.rendered || __( '(no title)' )\n\t\t\t) }\n\t\t\tactions={\n\t\t\t\t<>\n\t\t\t\t\t<PageActions\n\t\t\t\t\t\tpostId={ postId }\n\t\t\t\t\t\ttoggleProps={ { as: SidebarButton } }\n\t\t\t\t\t\tonRemove={ () => {\n\t\t\t\t\t\t\tgoTo( '/page' );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\tonClick={ () => setCanvasMode( 'edit' ) }\n\t\t\t\t\t\tlabel={ __( 'Edit' ) }\n\t\t\t\t\t\ticon={ pencil }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tmeta={\n\t\t\t\t<ExternalLink\n\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__page-link\"\n\t\t\t\t\thref={ record.link }\n\t\t\t\t>\n\t\t\t\t\t{ filterURLForDisplay(\n\t\t\t\t\t\tsafeDecodeURIComponent( record.link )\n\t\t\t\t\t) }\n\t\t\t\t</ExternalLink>\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ !! featuredMediaSourceUrl && (\n\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-page__featured-image-wrapper\"\n\t\t\t\t\t\t\talignment=\"left\"\n\t\t\t\t\t\t\tspacing={ 2 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen-page__featured-image has-image\">\n\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\talt={ featureImageAltText }\n\t\t\t\t\t\t\t\t\tsrc={ featuredMediaSourceUrl }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t) }\n\t\t\t\t\t{ !! record?.excerpt?.rendered && (\n\t\t\t\t\t\t<Truncate\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-page__excerpt\"\n\t\t\t\t\t\t\tnumberOfLines={ 3 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ stripHTML( record.excerpt.rendered ) }\n\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t) }\n\t\t\t\t\t<PageDetails id={ postId } />\n\t\t\t\t</>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\trecord?.modified ? (\n\t\t\t\t\t<SidebarNavigationScreenDetailsFooter record={ record } />\n\t\t\t\t) : null\n\t\t\t}\n\t\t/>\n\t) : null;\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAMA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,IAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,IAAA,GAAAR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ACF;IACDgE,MAAM,EACL7D,MAAM,EAAE8D,QAAQ,GACf,IAAAhC,MAAA,CAAAC,aAAA,EAAC7C,qCAAA,CAAA8C,OAAoC;MAAChC,MAAM,EAAGA;IAAQ,CAAE,CAAC,GACvD;EACJ,CACD,CAAC,GACC,IAAI;AACT"}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_data","_components","_coreData","_htmlEntities","_icons","_dom","_escapeHtml","_url","_element","_router","_editor","_notices","_sidebarNavigationScreen","_interopRequireDefault","_lockUnlock","_store","_sidebarButton","_pageDetails","_sidebarNavigationScreenDetailsFooter","useLocation","useHistory","unlock","routerPrivateApis","PostActions","editorPrivateApis","SidebarNavigationScreenPage","backPath","setCanvasMode","useDispatch","editSiteStore","history","createSuccessNotice","noticesStore","params","postId","record","hasResolved","useEntityRecord","featuredMediaAltText","featuredMediaSourceUrl","useSelect","select","getEntityRecord","coreStore","attachedMedia","featured_media","media_details","sizes","medium","source_url","escapeAttribute","alt_text","description","raw","useEffect","push","path","undefined","postType","canvas","onActionPerformed","useCallback","actionId","items","type","newItem","title","rendered","sprintf","__","id","actions","label","onClick","featureImageAltText","decodeEntities","_react","createElement","default","Fragment","buttonProps","size","icon","pencil","meta","ExternalLink","className","href","link","filterURLForDisplay","safeDecodeURIComponent","content","__experimentalVStack","alignment","spacing","alt","src","excerpt","__experimentalTruncate","numberOfLines","stripHTML","footer","modified"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-page/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport {\n\t__experimentalVStack as VStack,\n\tExternalLink,\n\t__experimentalTruncate as Truncate,\n} from '@wordpress/components';\nimport { store as coreStore, useEntityRecord } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { pencil } from '@wordpress/icons';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport { escapeAttribute } from '@wordpress/escape-html';\nimport { safeDecodeURIComponent, filterURLForDisplay } from '@wordpress/url';\nimport { useEffect, useCallback } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport SidebarButton from '../sidebar-button';\nimport PageDetails from './page-details';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\nconst { PostActions } = unlock( editorPrivateApis );\n\nexport default function SidebarNavigationScreenPage( { backPath } ) {\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\tconst history = useHistory();\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\tconst {\n\t\tparams: { postId },\n\t} = useLocation();\n\tconst { record, hasResolved } = useEntityRecord(\n\t\t'postType',\n\t\t'page',\n\t\tpostId\n\t);\n\n\tconst { featuredMediaAltText, featuredMediaSourceUrl } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord } = select( coreStore );\n\t\t\t// Featured image.\n\t\t\tconst attachedMedia = record?.featured_media\n\t\t\t\t? getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'attachment',\n\t\t\t\t\t\trecord?.featured_media\n\t\t\t\t )\n\t\t\t\t: null;\n\n\t\t\treturn {\n\t\t\t\tfeaturedMediaSourceUrl:\n\t\t\t\t\tattachedMedia?.media_details.sizes?.medium?.source_url ||\n\t\t\t\t\tattachedMedia?.source_url,\n\t\t\t\tfeaturedMediaAltText: escapeAttribute(\n\t\t\t\t\tattachedMedia?.alt_text ||\n\t\t\t\t\t\tattachedMedia?.description?.raw ||\n\t\t\t\t\t\t''\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ record ]\n\t);\n\n\t// Redirect to the main pages navigation screen if the page is not found or has been deleted.\n\tuseEffect( () => {\n\t\tif ( hasResolved && ! record ) {\n\t\t\thistory.push( {\n\t\t\t\tpath: '/page',\n\t\t\t\tpostId: undefined,\n\t\t\t\tpostType: undefined,\n\t\t\t\tcanvas: 'view',\n\t\t\t} );\n\t\t}\n\t}, [ hasResolved, record, history ] );\n\n\tconst onActionPerformed = useCallback(\n\t\t( actionId, items ) => {\n\t\t\tswitch ( actionId ) {\n\t\t\t\tcase 'move-to-trash':\n\t\t\t\t\t{\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpath: '/' + items[ 0 ].type,\n\t\t\t\t\t\t\tpostId: undefined,\n\t\t\t\t\t\t\tpostType: undefined,\n\t\t\t\t\t\t\tcanvas: 'view',\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'duplicate-post':\n\t\t\t\t\t{\n\t\t\t\t\t\tconst newItem = items[ 0 ];\n\t\t\t\t\t\tconst title =\n\t\t\t\t\t\t\ttypeof newItem.title === 'string'\n\t\t\t\t\t\t\t\t? newItem.title\n\t\t\t\t\t\t\t\t: newItem.title?.rendered;\n\t\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Title of the created post e.g: \"Post 1\".\n\t\t\t\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\t\tid: 'duplicate-post-action',\n\t\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Edit' ),\n\t\t\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\t\t\t\t\t\tpath: undefined,\n\t\t\t\t\t\t\t\t\t\t\t\tpostId: newItem.id,\n\t\t\t\t\t\t\t\t\t\t\t\tpostType: newItem.type,\n\t\t\t\t\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t},\n\t\t[ history, createSuccessNotice ]\n\t);\n\n\tconst featureImageAltText = featuredMediaAltText\n\t\t? decodeEntities( featuredMediaAltText )\n\t\t: decodeEntities( record?.title?.rendered || __( 'Featured image' ) );\n\n\treturn record ? (\n\t\t<SidebarNavigationScreen\n\t\t\tbackPath={ backPath }\n\t\t\ttitle={ decodeEntities(\n\t\t\t\trecord?.title?.rendered || __( '(no title)' )\n\t\t\t) }\n\t\t\tactions={\n\t\t\t\t<>\n\t\t\t\t\t<PostActions\n\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\tbuttonProps={ { size: 'default' } }\n\t\t\t\t\t/>\n\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\tonClick={ () => setCanvasMode( 'edit' ) }\n\t\t\t\t\t\tlabel={ __( 'Edit' ) }\n\t\t\t\t\t\ticon={ pencil }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tmeta={\n\t\t\t\t<ExternalLink\n\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__page-link\"\n\t\t\t\t\thref={ record.link }\n\t\t\t\t>\n\t\t\t\t\t{ filterURLForDisplay(\n\t\t\t\t\t\tsafeDecodeURIComponent( record.link )\n\t\t\t\t\t) }\n\t\t\t\t</ExternalLink>\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ !! featuredMediaSourceUrl && (\n\t\t\t\t\t\t<VStack\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-page__featured-image-wrapper\"\n\t\t\t\t\t\t\talignment=\"left\"\n\t\t\t\t\t\t\tspacing={ 2 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div className=\"edit-site-sidebar-navigation-screen-page__featured-image has-image\">\n\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\talt={ featureImageAltText }\n\t\t\t\t\t\t\t\t\tsrc={ featuredMediaSourceUrl }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t) }\n\t\t\t\t\t{ !! record?.excerpt?.rendered && (\n\t\t\t\t\t\t<Truncate\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-page__excerpt\"\n\t\t\t\t\t\t\tnumberOfLines={ 3 }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ stripHTML( record.excerpt.rendered ) }\n\t\t\t\t\t\t</Truncate>\n\t\t\t\t\t) }\n\t\t\t\t\t<PageDetails id={ postId } />\n\t\t\t\t</>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\trecord?.modified ? (\n\t\t\t\t\t<SidebarNavigationScreenDetailsFooter record={ record } />\n\t\t\t\t) : null\n\t\t\t}\n\t\t/>\n\t) : null;\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAKA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,IAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAAAQ,IAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,OAAA,GAAAX,OAAA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AI;AACT","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_wordcount","_data","_htmlEntities","_coreData","_url","_statusLabel","_interopRequireDefault","_lockUnlock","_store","_sidebarNavigationScreenDetailsPanel","_constants","AVERAGE_READING_RATE","getPageDetails","page","details","label","__","value","_react","createElement","default","status","password","date","short","__experimentalTruncate","numberOfLines","safeDecodeURIComponent","slug","generated_slug","templateTitle","push","decodeEntities","parentTitle","wordCountType","_x","wordsCounted","content","rendered","wordCount","readingTime","Math","round","isPostsPage","toLocaleString","sprintf","PageDetails","id","record","useEntityRecord","useSelect","select","getEditedPostId","unlock","editSiteStore","template","coreStore","getEntityRecord","TEMPLATE_POST_TYPE","_templateTitle","title","_parentTitle","parent","_fields","siteSettings","page_for_posts","SidebarNavigationScreenDetailsPanel","spacing","map","SidebarNavigationScreenDetailsPanelRow","key","SidebarNavigationScreenDetailsPanelLabel","SidebarNavigationScreenDetailsPanelValue"],"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(\n\t\t\t\t\t\tpage.slug || page.generated_slug\n\t\t\t\t\t) }\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 { getEditedPostId } = unlock( select( editSiteStore ) );\n\t\t\tconst template = select( coreStore ).getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\tgetEditedPostId()\n\t\t\t);\n\t\t\tconst _templateTitle = template?.title?.rendered;\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":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,IAAA,GAAAN,OAAA;AAKA,IAAAO,YAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,WAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,oCAAA,GAAAX,OAAA;AAMA,IAAAY,UAAA,GAAAZ,OAAA;AAvBA;AACA;AACA;;AASA;AACA;AACA;;AAYA;AACA,MAAMa,oBAAoB,GAAG,GAAG;AAEhC,SAASC,cAAcA,CAAEC,IAAI,EAAG;EAC/B,IAAK,CAAEA,IAAI,EAAG;IACb,OAAO,EAAE;EACV;EAEA,MAAMC,OAAO,GAAG,CACf;IACCC,KAAK,EAAE,IAAAC,QAAE,EAAE,QAAS,CAAC;IACrBC,KAAK,EACJ,IAAAC,MAAA,CAAAC,aAAA,EAACd,YAAA,CAAAe,OAAW;MACXC,MAAM,EAAGR,IAAI,EAAES,QAAQ,GAAG,WAAW,GAAGT,IAAI,CAACQ,MAAQ;MACrDE,IAAI,EAAGV,IAAI,EAAEU,IAAM;MACnBC,KAAK;IA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AAE,MAAO,CAAC;IAEtD,OAAO;MACNxB,WAAW,EAAE4B,YAAY;MACzB/B,aAAa,EAAE6B,cAAc;MAC7BhB,WAAW,EAAEK,MAAM,EAAED,EAAE,KAAKiB,YAAY,EAAEC;IAC3C,CAAC;EACF,CAAC,EACD,CAAEjB,MAAM,EAAEc,MAAM,EAAEd,MAAM,EAAED,EAAE,CAC7B,CAAC;EACD,OACC,IAAA7B,MAAA,CAAAC,aAAA,EAACV,oCAAA,CAAAyD,mCAAmC;IACnCC,OAAO,EAAG,CAAG;IACbP,KAAK,EAAG,IAAA5C,QAAE,EAAE,SAAU;EAAG,GAEvBJ,cAAc,CAAE;IACjBqB,WAAW;IACXH,aAAa;IACba,WAAW;IACX,GAAGK;EACJ,CAAE,CAAC,CAACoB,GAAG,CAAE,CAAE;IAAErD,KAAK;IAAEE;EAAM,CAAC,KAC1B,IAAAC,MAAA,CAAAC,aAAA,EAACV,oCAAA,CAAA4D,sCAAsC;IAACC,GAAG,EAAGvD;EAAO,GACpD,IAAAG,MAAA,CAAAC,aAAA,EAACV,oCAAA,CAAA8D,wCAAwC,QACtCxD,KACuC,CAAC,EAC3C,IAAAG,MAAA,CAAAC,aAAA,EAACV,oCAAA,CAAA+D,wCAAwC,QACtCvD,KACuC,CACH,CACvC,CACkC,CAAC;AAExC"}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_wordcount","_data","_htmlEntities","_coreData","_url","_statusLabel","_interopRequireDefault","_lockUnlock","_store","_sidebarNavigationScreenDetailsPanel","_constants","AVERAGE_READING_RATE","getPageDetails","page","details","label","__","value","_react","createElement","default","status","password","date","short","__experimentalTruncate","numberOfLines","safeDecodeURIComponent","slug","generated_slug","templateTitle","push","decodeEntities","parentTitle","wordCountType","_x","wordsCounted","content","rendered","wordCount","readingTime","Math","round","isPostsPage","toLocaleString","sprintf","PageDetails","id","record","useEntityRecord","useSelect","select","getEditedPostId","unlock","editSiteStore","template","coreStore","getEntityRecord","TEMPLATE_POST_TYPE","_templateTitle","title","_parentTitle","parent","_fields","siteSettings","page_for_posts","SidebarNavigationScreenDetailsPanel","spacing","map","SidebarNavigationScreenDetailsPanelRow","key","SidebarNavigationScreenDetailsPanelLabel","SidebarNavigationScreenDetailsPanelValue"],"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(\n\t\t\t\t\t\tpage.slug || page.generated_slug\n\t\t\t\t\t) }\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 { getEditedPostId } = unlock( select( editSiteStore ) );\n\t\t\tconst template = select( coreStore ).getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\tgetEditedPostId()\n\t\t\t);\n\t\t\tconst _templateTitle = template?.title?.rendered;\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":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAA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;EACJ,CAAE,CAAC,CAACoB,GAAG,CAAE,CAAE;IAAErD,KAAK;IAAEE;EAAM,CAAC,KAC1B,IAAAC,MAAA,CAAAC,aAAA,EAACV,oCAAA,CAAA4D,sCAAsC;IAACC,GAAG,EAAGvD;EAAO,GACpD,IAAAG,MAAA,CAAAC,aAAA,EAACV,oCAAA,CAAA8D,wCAAwC,QACtCxD,KACuC,CAAC,EAC3C,IAAAG,MAAA,CAAAC,aAAA,EAACV,oCAAA,CAAA+D,wCAAwC,QACtCvD,KACuC,CACH,CACvC,CACkC,CAAC;AAExC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_classnames","_interopRequireDefault","require","_i18n","_date","_element","StatusLabel","status","date","short","relateToNow","humanTimeDiff","statusLabel","createInterpolateElement","sprintf","__","time","_react","createElement","dateTime","formattedDate","dateI18n","getDate","className","classnames"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-page/status-label.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { dateI18n, getDate, humanTimeDiff } from '@wordpress/date';\nimport { createInterpolateElement } from '@wordpress/element';\n\nexport default function StatusLabel( { status, date, short } ) {\n\tconst relateToNow = humanTimeDiff( date );\n\tlet statusLabel = status;\n\tswitch ( status ) {\n\t\tcase 'publish':\n\t\t\tstatusLabel = date\n\t\t\t\t? createInterpolateElement(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %s: is the relative time when the post was published. */\n\t\t\t\t\t\t\t__( 'Published <time>%s</time>' ),\n\t\t\t\t\t\t\trelateToNow\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ time: <time dateTime={ date } /> }\n\t\t\t\t )\n\t\t\t\t: __( 'Published' );\n\t\t\tbreak;\n\t\tcase 'future':\n\t\t\tconst formattedDate = dateI18n(\n\t\t\t\tshort ? 'M j' : 'F j',\n\t\t\t\tgetDate( date )\n\t\t\t);\n\t\t\tstatusLabel = date\n\t\t\t\t? createInterpolateElement(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %s: is the formatted date and time on which the post is scheduled to be published. */\n\t\t\t\t\t\t\t__( 'Scheduled: <time>%s</time>' ),\n\t\t\t\t\t\t\tformattedDate\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ time: <time dateTime={ date } /> }\n\t\t\t\t )\n\t\t\t\t: __( 'Scheduled' );\n\t\t\tbreak;\n\t\tcase 'draft':\n\t\t\tstatusLabel = __( 'Draft' );\n\t\t\tbreak;\n\t\tcase 'pending':\n\t\t\tstatusLabel = __( 'Pending' );\n\t\t\tbreak;\n\t\tcase 'private':\n\t\t\tstatusLabel = __( 'Private' );\n\t\t\tbreak;\n\t\tcase 'protected':\n\t\t\tstatusLabel = __( 'Password protected' );\n\t\t\tbreak;\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames(\n\t\t\t\t'edit-site-sidebar-navigation-screen-page__status',\n\t\t\t\t{\n\t\t\t\t\t[ `has-status has-${ status }-status` ]: !! status,\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t{ statusLabel }\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAVA;AACA;AACA;;AAGA;AACA;AACA;;AAKe,SAASI,WAAWA,CAAE;EAAEC,MAAM;EAAEC,IAAI;EAAEC;AAAM,CAAC,EAAG;EAC9D,MAAMC,WAAW,GAAG,IAAAC,mBAAa,EAAEH,IAAK,CAAC;EACzC,IAAII,WAAW,GAAGL,MAAM;EACxB,QAASA,MAAM;IACd,KAAK,SAAS;MACbK,WAAW,GAAGJ,IAAI,GACf,IAAAK,iCAAwB,EACxB,IAAAC,aAAO,GACN;MACA,IAAAC,QAAE,EAAE,2BAA4B,CAAC,EACjCL,WACD,CAAC,EACD;QAAEM,IAAI,EAAE,IAAAC,MAAA,CAAAC,aAAA;UAAMC,QAAQ,EAAGX;QAAM,CAAE;MAAE,CACnC,CAAC,GACD,IAAAO,QAAE,EAAE,WAAY,CAAC;MACpB;IACD,KAAK,QAAQ;MACZ,MAAMK,aAAa,GAAG,IAAAC,cAAQ,EAC7BZ,KAAK,GAAG,KAAK,GAAG,KAAK,EACrB,IAAAa,aAAO,EAAEd,IAAK,CACf,CAAC;MACDI,WAAW,GAAGJ,IAAI,GACf,IAAAK,iCAAwB,EACxB,IAAAC,aAAO,GACN;MACA,IAAAC,QAAE,EAAE,4BAA6B,CAAC,EAClCK,aACD,CAAC,EACD;QAAEJ,IAAI,EAAE,IAAAC,MAAA,CAAAC,aAAA;UAAMC,QAAQ,EAAGX;QAAM,CAAE;MAAE,CACnC,CAAC,GACD,IAAAO,QAAE,EAAE,WAAY,CAAC;MACpB;IACD,KAAK,OAAO;MACXH,WAAW,GAAG,IAAAG,QAAE,EAAE,OAAQ,CAAC;MAC3B;IACD,KAAK,SAAS;MACbH,WAAW,GAAG,IAAAG,QAAE,EAAE,SAAU,CAAC;MAC7B;IACD,KAAK,SAAS;MACbH,WAAW,GAAG,IAAAG,QAAE,EAAE,SAAU,CAAC;MAC7B;IACD,KAAK,WAAW;MACfH,WAAW,GAAG,IAAAG,QAAE,EAAE,oBAAqB,CAAC;MACxC;EACF;EAEA,OACC,IAAAE,MAAA,CAAAC,aAAA;IACCK,SAAS,EAAG,IAAAC,mBAAU,EACrB,kDAAkD,EAClD;MACC,CAAG,kBAAkBjB,MAAQ,SAAQ,GAAI,CAAC,CAAEA;IAC7C,CACD;EAAG,GAEDK,WACE,CAAC;AAER"}
|
|
1
|
+
{"version":3,"names":["_classnames","_interopRequireDefault","require","_i18n","_date","_element","StatusLabel","status","date","short","relateToNow","humanTimeDiff","statusLabel","createInterpolateElement","sprintf","__","time","_react","createElement","dateTime","formattedDate","dateI18n","getDate","className","classnames"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-page/status-label.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { dateI18n, getDate, humanTimeDiff } from '@wordpress/date';\nimport { createInterpolateElement } from '@wordpress/element';\n\nexport default function StatusLabel( { status, date, short } ) {\n\tconst relateToNow = humanTimeDiff( date );\n\tlet statusLabel = status;\n\tswitch ( status ) {\n\t\tcase 'publish':\n\t\t\tstatusLabel = date\n\t\t\t\t? createInterpolateElement(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %s: is the relative time when the post was published. */\n\t\t\t\t\t\t\t__( 'Published <time>%s</time>' ),\n\t\t\t\t\t\t\trelateToNow\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ time: <time dateTime={ date } /> }\n\t\t\t\t )\n\t\t\t\t: __( 'Published' );\n\t\t\tbreak;\n\t\tcase 'future':\n\t\t\tconst formattedDate = dateI18n(\n\t\t\t\tshort ? 'M j' : 'F j',\n\t\t\t\tgetDate( date )\n\t\t\t);\n\t\t\tstatusLabel = date\n\t\t\t\t? createInterpolateElement(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %s: is the formatted date and time on which the post is scheduled to be published. */\n\t\t\t\t\t\t\t__( 'Scheduled: <time>%s</time>' ),\n\t\t\t\t\t\t\tformattedDate\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ time: <time dateTime={ date } /> }\n\t\t\t\t )\n\t\t\t\t: __( 'Scheduled' );\n\t\t\tbreak;\n\t\tcase 'draft':\n\t\t\tstatusLabel = __( 'Draft' );\n\t\t\tbreak;\n\t\tcase 'pending':\n\t\t\tstatusLabel = __( 'Pending' );\n\t\t\tbreak;\n\t\tcase 'private':\n\t\t\tstatusLabel = __( 'Private' );\n\t\t\tbreak;\n\t\tcase 'protected':\n\t\t\tstatusLabel = __( 'Password protected' );\n\t\t\tbreak;\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames(\n\t\t\t\t'edit-site-sidebar-navigation-screen-page__status',\n\t\t\t\t{\n\t\t\t\t\t[ `has-status has-${ status }-status` ]: !! status,\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t{ statusLabel }\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAVA;AACA;AACA;;AAGA;AACA;AACA;;AAKe,SAASI,WAAWA,CAAE;EAAEC,MAAM;EAAEC,IAAI;EAAEC;AAAM,CAAC,EAAG;EAC9D,MAAMC,WAAW,GAAG,IAAAC,mBAAa,EAAEH,IAAK,CAAC;EACzC,IAAII,WAAW,GAAGL,MAAM;EACxB,QAASA,MAAM;IACd,KAAK,SAAS;MACbK,WAAW,GAAGJ,IAAI,GACf,IAAAK,iCAAwB,EACxB,IAAAC,aAAO,GACN;MACA,IAAAC,QAAE,EAAE,2BAA4B,CAAC,EACjCL,WACD,CAAC,EACD;QAAEM,IAAI,EAAE,IAAAC,MAAA,CAAAC,aAAA;UAAMC,QAAQ,EAAGX;QAAM,CAAE;MAAE,CACnC,CAAC,GACD,IAAAO,QAAE,EAAE,WAAY,CAAC;MACpB;IACD,KAAK,QAAQ;MACZ,MAAMK,aAAa,GAAG,IAAAC,cAAQ,EAC7BZ,KAAK,GAAG,KAAK,GAAG,KAAK,EACrB,IAAAa,aAAO,EAAEd,IAAK,CACf,CAAC;MACDI,WAAW,GAAGJ,IAAI,GACf,IAAAK,iCAAwB,EACxB,IAAAC,aAAO,GACN;MACA,IAAAC,QAAE,EAAE,4BAA6B,CAAC,EAClCK,aACD,CAAC,EACD;QAAEJ,IAAI,EAAE,IAAAC,MAAA,CAAAC,aAAA;UAAMC,QAAQ,EAAGX;QAAM,CAAE;MAAE,CACnC,CAAC,GACD,IAAAO,QAAE,EAAE,WAAY,CAAC;MACpB;IACD,KAAK,OAAO;MACXH,WAAW,GAAG,IAAAG,QAAE,EAAE,OAAQ,CAAC;MAC3B;IACD,KAAK,SAAS;MACbH,WAAW,GAAG,IAAAG,QAAE,EAAE,SAAU,CAAC;MAC7B;IACD,KAAK,SAAS;MACbH,WAAW,GAAG,IAAAG,QAAE,EAAE,SAAU,CAAC;MAC7B;IACD,KAAK,WAAW;MACfH,WAAW,GAAG,IAAAG,QAAE,EAAE,oBAAqB,CAAC;MACxC;EACF;EAEA,OACC,IAAAE,MAAA,CAAAC,aAAA;IACCK,SAAS,EAAG,IAAAC,mBAAU,EACrB,kDAAkD,EAClD;MACC,CAAG,kBAAkBjB,MAAQ,SAAQ,GAAI,CAAC,CAAEA;IAC7C,CACD;EAAG,GAEDK,WACE,CAAC;AAER","ignoreList":[]}
|
|
@@ -6,11 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = SidebarNavigationScreenPattern;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
var _components = require("@wordpress/components");
|
|
10
9
|
var _data = require("@wordpress/data");
|
|
11
10
|
var _i18n = require("@wordpress/i18n");
|
|
12
11
|
var _icons = require("@wordpress/icons");
|
|
13
|
-
var
|
|
12
|
+
var _router = require("@wordpress/router");
|
|
14
13
|
var _sidebarButton = _interopRequireDefault(require("../sidebar-button"));
|
|
15
14
|
var _sidebarNavigationScreen = _interopRequireDefault(require("../sidebar-navigation-screen"));
|
|
16
15
|
var _useInitEditedEntityFromUrl = _interopRequireDefault(require("../sync-state-with-url/use-init-edited-entity-from-url"));
|
|
@@ -18,7 +17,6 @@ var _usePatternDetails = _interopRequireDefault(require("./use-pattern-details")
|
|
|
18
17
|
var _store = require("../../store");
|
|
19
18
|
var _lockUnlock = require("../../lock-unlock");
|
|
20
19
|
var _templateActions = _interopRequireDefault(require("../template-actions"));
|
|
21
|
-
var _constants = require("../../utils/constants");
|
|
22
20
|
/**
|
|
23
21
|
* WordPress dependencies
|
|
24
22
|
*/
|
|
@@ -27,27 +25,31 @@ var _constants = require("../../utils/constants");
|
|
|
27
25
|
* Internal dependencies
|
|
28
26
|
*/
|
|
29
27
|
|
|
28
|
+
const {
|
|
29
|
+
useLocation,
|
|
30
|
+
useHistory
|
|
31
|
+
} = (0, _lockUnlock.unlock)(_router.privateApis);
|
|
30
32
|
function SidebarNavigationScreenPattern() {
|
|
31
|
-
const
|
|
33
|
+
const history = useHistory();
|
|
34
|
+
const location = useLocation();
|
|
32
35
|
const {
|
|
33
36
|
params: {
|
|
34
37
|
postType,
|
|
35
|
-
postId
|
|
38
|
+
postId,
|
|
39
|
+
categoryId,
|
|
40
|
+
categoryType
|
|
36
41
|
}
|
|
37
|
-
} =
|
|
38
|
-
const {
|
|
39
|
-
categoryType
|
|
40
|
-
} = (0, _url.getQueryArgs)(window.location.href);
|
|
42
|
+
} = location;
|
|
41
43
|
const {
|
|
42
44
|
setCanvasMode
|
|
43
45
|
} = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
|
|
44
46
|
(0, _useInitEditedEntityFromUrl.default)();
|
|
45
47
|
const patternDetails = (0, _usePatternDetails.default)(postType, postId);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
const backPath = {
|
|
49
|
+
categoryId,
|
|
50
|
+
categoryType,
|
|
51
|
+
path: '/patterns'
|
|
52
|
+
};
|
|
51
53
|
return (0, _react.createElement)(_sidebarNavigationScreen.default, {
|
|
52
54
|
actions: (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_templateActions.default, {
|
|
53
55
|
postType: postType,
|
|
@@ -56,7 +58,7 @@ function SidebarNavigationScreenPattern() {
|
|
|
56
58
|
as: _sidebarButton.default
|
|
57
59
|
},
|
|
58
60
|
onRemove: () => {
|
|
59
|
-
|
|
61
|
+
history.push(backPath);
|
|
60
62
|
}
|
|
61
63
|
}), (0, _react.createElement)(_sidebarButton.default, {
|
|
62
64
|
onClick: () => setCanvasMode('edit'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_data","require","_i18n","_icons","_router","_sidebarButton","_interopRequireDefault","_sidebarNavigationScreen","_useInitEditedEntityFromUrl","_usePatternDetails","_store","_lockUnlock","_templateActions","useLocation","useHistory","unlock","routerPrivateApis","SidebarNavigationScreenPattern","history","location","params","postType","postId","categoryId","categoryType","setCanvasMode","useDispatch","editSiteStore","useInitEditedEntityFromURL","patternDetails","usePatternDetails","backPath","path","_react","createElement","default","actions","Fragment","toggleProps","as","SidebarButton","onRemove","push","onClick","label","__","icon","pencil"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { pencil } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\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';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationScreenPattern() {\n\tconst history = useHistory();\n\tconst location = useLocation();\n\tconst {\n\t\tparams: { postType, postId, categoryId, categoryType },\n\t} = location;\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\n\tuseInitEditedEntityFromURL();\n\n\tconst patternDetails = usePatternDetails( postType, postId );\n\n\tconst backPath = {\n\t\tcategoryId,\n\t\tcategoryType,\n\t\tpath: '/patterns',\n\t};\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\thistory.push( 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":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAKA,IAAAI,cAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,wBAAA,GAAAD,sBAAA,CAAAL,OAAA;AACA,IAAAO,2BAAA,GAAAF,sBAAA,CAAAL,OAAA;AACA,IAAAQ,kBAAA,GAAAH,sBAAA,CAAAL,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,WAAA,GAAAV,OAAA;AACA,IAAAW,gBAAA,GAAAN,sBAAA,CAAAL,OAAA;AAjBA;AACA;AACA;;AAMA;AACA;AACA;;AASA,MAAM;EAAEY,WAAW;EAAEC;AAAW,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEhD,SAASC,8BAA8BA,CAAA,EAAG;EACxD,MAAMC,OAAO,GAAGJ,UAAU,CAAC,CAAC;EAC5B,MAAMK,QAAQ,GAAGN,WAAW,CAAC,CAAC;EAC9B,MAAM;IACLO,MAAM,EAAE;MAAEC,QAAQ;MAAEC,MAAM;MAAEC,UAAU;MAAEC;IAAa;EACtD,CAAC,GAAGL,QAAQ;EACZ,MAAM;IAAEM;EAAc,CAAC,GAAG,IAAAV,kBAAM,EAAE,IAAAW,iBAAW,EAAEC,YAAc,CAAE,CAAC;EAEhE,IAAAC,mCAA0B,EAAC,CAAC;EAE5B,MAAMC,cAAc,GAAG,IAAAC,0BAAiB,EAAET,QAAQ,EAAEC,MAAO,CAAC;EAE5D,MAAMS,QAAQ,GAAG;IAChBR,UAAU;IACVC,YAAY;IACZQ,IAAI,EAAE;EACP,CAAC;EAED,OACC,IAAAC,MAAA,CAAAC,aAAA,EAAC3B,wBAAA,CAAA4B,OAAuB;IACvBC,OAAO,EACN,IAAAH,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAI,QAAA,QACC,IAAAJ,MAAA,CAAAC,aAAA,EAACtB,gBAAA,CAAAuB,OAAe;MACfd,QAAQ,EAAGA,QAAU;MACrBC,MAAM,EAAGA,MAAQ;MACjBgB,WAAW,EAAG;QAAEC,EAAE,EAAEC;MAAc,CAAG;MACrCC,QAAQ,EAAGA,CAAA,KAAM;QAChBvB,OAAO,CAACwB,IAAI,CAAEX,QAAS,CAAC;MACzB;IAAG,CACH,CAAC,EACF,IAAAE,MAAA,CAAAC,aAAA,EAAC7B,cAAA,CAAA8B,OAAa;MACbQ,OAAO,EAAGA,CAAA,KAAMlB,aAAa,CAAE,MAAO,CAAG;MACzCmB,KAAK,EAAG,IAAAC,QAAE,EAAE,MAAO,CAAG;MACtBC,IAAI,EAAGC;IAAQ,CACf,CACA,CACF;IACDhB,QAAQ,EAAGA,QAAU;IAAA,GAChBF;EAAc,CACnB,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_sidebarNavigationItem","_interopRequireDefault","_useNavigationMenuTitle","_link","_constants","TemplatePartNavigationMenuListItem","id","title","useNavigationMenuTitle","linkInfo","useLink","postId","postType","NAVIGATION_POST_TYPE","undefined","_react","createElement","default","withChevron","__"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport useNavigationMenuTitle from './use-navigation-menu-title';\nimport { useLink } from '../routes/link';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\n\nexport default function TemplatePartNavigationMenuListItem( { id } ) {\n\tconst title = useNavigationMenuTitle( id );\n\n\tconst linkInfo = useLink( {\n\t\tpostId: id,\n\t\tpostType: NAVIGATION_POST_TYPE,\n\t} );\n\n\tif ( ! id || title === undefined ) {\n\t\treturn null;\n\t}\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":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,sBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,uBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AAXA;AACA;AACA;;AAGA;AACA;AACA;;AAMe,SAASM,kCAAkCA,CAAE;EAAEC;AAAG,CAAC,EAAG;EACpE,MAAMC,KAAK,GAAG,IAAAC,+BAAsB,EAAEF,EAAG,CAAC;EAE1C,MAAMG,QAAQ,GAAG,IAAAC,aAAO,EAAE;IACzBC,MAAM,EAAEL,EAAE;IACVM,QAAQ,EAAEC;EACX,CAAE,CAAC;EAEH,IAAK,CAAEP,EAAE,IAAIC,KAAK,KAAKO,SAAS,EAAG;IAClC,OAAO,IAAI;EACZ;EAEA,OACC,IAAAC,MAAA,CAAAC,aAAA,EAAChB,sBAAA,CAAAiB,OAAqB;IAACC,WAAW;IAAA,GAAMT;EAAQ,GAC7CF,KAAK,IAAI,IAAAY,QAAE,EAAE,YAAa,CACN,CAAC;AAE1B"}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_sidebarNavigationItem","_interopRequireDefault","_useNavigationMenuTitle","_link","_constants","TemplatePartNavigationMenuListItem","id","title","useNavigationMenuTitle","linkInfo","useLink","postId","postType","NAVIGATION_POST_TYPE","undefined","_react","createElement","default","withChevron","__"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport useNavigationMenuTitle from './use-navigation-menu-title';\nimport { useLink } from '../routes/link';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\n\nexport default function TemplatePartNavigationMenuListItem( { id } ) {\n\tconst title = useNavigationMenuTitle( id );\n\n\tconst linkInfo = useLink( {\n\t\tpostId: id,\n\t\tpostType: NAVIGATION_POST_TYPE,\n\t} );\n\n\tif ( ! id || title === undefined ) {\n\t\treturn null;\n\t}\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":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAKA,IAAAC,sBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,uBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AAXA;AACA;AACA;;AAGA;AACA;AACA;;AAMe,SAASM,kCAAkCA,CAAE;EAAEC;AAAG,CAAC,EAAG;EACpE,MAAMC,KAAK,GAAG,IAAAC,+BAAsB,EAAEF,EAAG,CAAC;EAE1C,MAAMG,QAAQ,GAAG,IAAAC,aAAO,EAAE;IACzBC,MAAM,EAAEL,EAAE;IACVM,QAAQ,EAAEC;EACX,CAAE,CAAC;EAEH,IAAK,CAAEP,EAAE,IAAIC,KAAK,KAAKO,SAAS,EAAG;IAClC,OAAO,IAAI;EACZ;EAEA,OACC,IAAAC,MAAA,CAAAC,aAAA,EAAChB,sBAAA,CAAAiB,OAAqB;IAACC,WAAW;IAAA,GAAMT;EAAQ,GAC7CF,KAAK,IAAI,IAAAY,QAAE,EAAE,YAAa,CACN,CAAC;AAE1B","ignoreList":[]}
|
package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_templatePartNavigationMenuListItem","_interopRequireDefault","TemplatePartNavigationMenuList","menus","_react","createElement","__experimentalItemGroup","className","map","menuId","default","key","id"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\n/**\n * Internal dependencies\n */\nimport TemplatePartNavigationMenuListItem from './template-part-navigation-menu-list-item';\n\nexport default function TemplatePartNavigationMenuList( { menus } ) {\n\treturn (\n\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-template-part-navigation-menu-list\">\n\t\t\t{ menus.map( ( menuId ) => (\n\t\t\t\t<TemplatePartNavigationMenuListItem\n\t\t\t\t\tkey={ menuId }\n\t\t\t\t\tid={ menuId }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</ItemGroup>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAIA,IAAAC,mCAAA,GAAAC,sBAAA,CAAAF,OAAA;AAPA;AACA;AACA;;AAEA;AACA;AACA;;AAGe,SAASG,8BAA8BA,CAAE;EAAEC;AAAM,CAAC,EAAG;EACnE,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACP,WAAA,CAAAQ,uBAAS;IAACC,SAAS,EAAC;EAAwE,GAC1FJ,KAAK,CAACK,GAAG,CAAIC,MAAM,IACpB,IAAAL,MAAA,CAAAC,aAAA,EAACL,mCAAA,CAAAU,OAAkC;IAClCC,GAAG,EAAGF,MAAQ;IACdG,EAAE,EAAGH;EAAQ,CACb,CACA,CACQ,CAAC;AAEd"}
|
|
1
|
+
{"version":3,"names":["_components","require","_templatePartNavigationMenuListItem","_interopRequireDefault","TemplatePartNavigationMenuList","menus","_react","createElement","__experimentalItemGroup","className","map","menuId","default","key","id"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\n/**\n * Internal dependencies\n */\nimport TemplatePartNavigationMenuListItem from './template-part-navigation-menu-list-item';\n\nexport default function TemplatePartNavigationMenuList( { menus } ) {\n\treturn (\n\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-template-part-navigation-menu-list\">\n\t\t\t{ menus.map( ( menuId ) => (\n\t\t\t\t<TemplatePartNavigationMenuListItem\n\t\t\t\t\tkey={ menuId }\n\t\t\t\t\tid={ menuId }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</ItemGroup>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAIA,IAAAC,mCAAA,GAAAC,sBAAA,CAAAF,OAAA;AAPA;AACA;AACA;;AAEA;AACA;AACA;;AAGe,SAASG,8BAA8BA,CAAE;EAAEC;AAAM,CAAC,EAAG;EACnE,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACP,WAAA,CAAAQ,uBAAS;IAACC,SAAS,EAAC;EAAwE,GAC1FJ,KAAK,CAACK,GAAG,CAAIC,MAAM,IACpB,IAAAL,MAAA,CAAAC,aAAA,EAACL,mCAAA,CAAAU,OAAkC;IAClCC,GAAG,EAAGF,MAAQ;IACdG,EAAE,EAAGH;EAAQ,CACb,CACA,CACQ,CAAC;AAEd","ignoreList":[]}
|
package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_navigationMenuEditor","_interopRequireDefault","_useNavigationMenuTitle","TemplatePartNavigationMenu","id","title","useNavigationMenuTitle","undefined","_react","createElement","Fragment","__experimentalHeading","className","size","upperCase","weight","__","default","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';\n\n/**\n * Internal dependencies\n */\nimport NavigationMenuEditor from '../sidebar-navigation-screen-navigation-menu/navigation-menu-editor';\nimport useNavigationMenuTitle from './use-navigation-menu-title';\n\nexport default function TemplatePartNavigationMenu( { id } ) {\n\tconst title = useNavigationMenuTitle( id );\n\n\tif ( ! id || title === undefined ) {\n\t\treturn null;\n\t}\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\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":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,qBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,uBAAA,GAAAD,sBAAA,CAAAH,OAAA;AAVA;AACA;AACA;;AAIA;AACA;AACA;;AAIe,SAASK,0BAA0BA,CAAE;EAAEC;AAAG,CAAC,EAAG;EAC5D,MAAMC,KAAK,GAAG,IAAAC,+BAAsB,EAAEF,EAAG,CAAC;EAE1C,IAAK,CAAEA,EAAE,IAAIC,KAAK,KAAKE,SAAS,EAAG;IAClC,OAAO,IAAI;EACZ;EAEA,OACC,IAAAC,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAE,QAAA,QACC,IAAAF,MAAA,CAAAC,aAAA,EAACV,WAAA,CAAAY,qBAAO;IACPC,SAAS,EAAC,0EAA0E;IACpFC,IAAI,EAAC,IAAI;IACTC,SAAS;IACTC,MAAM,EAAG;EAAK,GAEZV,KAAK,IAAI,IAAAW,QAAE,EAAE,YAAa,CACpB,CAAC,EACV,IAAAR,MAAA,CAAAC,aAAA,EAACT,qBAAA,CAAAiB,OAAoB;IAACC,gBAAgB,EAAGd;EAAI,CAAE,CAC9C,CAAC;AAEL"}
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_navigationMenuEditor","_interopRequireDefault","_useNavigationMenuTitle","TemplatePartNavigationMenu","id","title","useNavigationMenuTitle","undefined","_react","createElement","Fragment","__experimentalHeading","className","size","upperCase","weight","__","default","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';\n\n/**\n * Internal dependencies\n */\nimport NavigationMenuEditor from '../sidebar-navigation-screen-navigation-menu/navigation-menu-editor';\nimport useNavigationMenuTitle from './use-navigation-menu-title';\n\nexport default function TemplatePartNavigationMenu( { id } ) {\n\tconst title = useNavigationMenuTitle( id );\n\n\tif ( ! id || title === undefined ) {\n\t\treturn null;\n\t}\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\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":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAKA,IAAAE,qBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,uBAAA,GAAAD,sBAAA,CAAAH,OAAA;AAVA;AACA;AACA;;AAIA;AACA;AACA;;AAIe,SAASK,0BAA0BA,CAAE;EAAEC;AAAG,CAAC,EAAG;EAC5D,MAAMC,KAAK,GAAG,IAAAC,+BAAsB,EAAEF,EAAG,CAAC;EAE1C,IAAK,CAAEA,EAAE,IAAIC,KAAK,KAAKE,SAAS,EAAG;IAClC,OAAO,IAAI;EACZ;EAEA,OACC,IAAAC,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAE,QAAA,QACC,IAAAF,MAAA,CAAAC,aAAA,EAACV,WAAA,CAAAY,qBAAO;IACPC,SAAS,EAAC,0EAA0E;IACpFC,IAAI,EAAC,IAAI;IACTC,SAAS;IACTC,MAAM,EAAG;EAAK,GAEZV,KAAK,IAAI,IAAAW,QAAE,EAAE,YAAa,CACpB,CAAC,EACV,IAAAR,MAAA,CAAAC,aAAA,EAACT,qBAAA,CAAAiB,OAAoB;IAACC,gBAAgB,EAAGd;EAAI,CAAE,CAC9C,CAAC;AAEL","ignoreList":[]}
|
package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js
CHANGED
|
@@ -21,7 +21,9 @@ var _templatePartNavigationMenuList = _interopRequireDefault(require("./template
|
|
|
21
21
|
function TemplatePartNavigationMenus({
|
|
22
22
|
menus
|
|
23
23
|
}) {
|
|
24
|
-
if (!menus.length)
|
|
24
|
+
if (!menus.length) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
25
27
|
|
|
26
28
|
// if there is a single menu then render TemplatePartNavigationMenu
|
|
27
29
|
if (menus.length === 1) {
|
package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_components","_templatePartNavigationMenu","_interopRequireDefault","_templatePartNavigationMenuList","TemplatePartNavigationMenus","menus","length","_react","createElement","default","id","Fragment","__experimentalHeading","className","size","upperCase","weight","__"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalHeading as Heading } from '@wordpress/components';\n/**\n * Internal dependencies\n */\nimport TemplatePartNavigationMenu from './template-part-navigation-menu';\nimport TemplatePartNavigationMenuList from './template-part-navigation-menu-list';\n\nexport default function TemplatePartNavigationMenus( { menus } ) {\n\tif ( ! menus.length )
|
|
1
|
+
{"version":3,"names":["_i18n","require","_components","_templatePartNavigationMenu","_interopRequireDefault","_templatePartNavigationMenuList","TemplatePartNavigationMenus","menus","length","_react","createElement","default","id","Fragment","__experimentalHeading","className","size","upperCase","weight","__"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalHeading as Heading } from '@wordpress/components';\n/**\n * Internal dependencies\n */\nimport TemplatePartNavigationMenu from './template-part-navigation-menu';\nimport TemplatePartNavigationMenuList from './template-part-navigation-menu-list';\n\nexport default function TemplatePartNavigationMenus( { menus } ) {\n\tif ( ! menus.length ) {\n\t\treturn null;\n\t}\n\n\t// if there is a single menu then render TemplatePartNavigationMenu\n\tif ( menus.length === 1 ) {\n\t\treturn <TemplatePartNavigationMenu id={ menus[ 0 ] } />;\n\t}\n\n\t// if there are multiple menus then render TemplatePartNavigationMenuList\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\n\t\t\t\tweight={ 500 }\n\t\t\t>\n\t\t\t\t{ __( 'Navigation' ) }\n\t\t\t</Heading>\n\t\t\t<TemplatePartNavigationMenuList menus={ menus } />\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AAIA,IAAAE,2BAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,+BAAA,GAAAD,sBAAA,CAAAH,OAAA;AATA;AACA;AACA;;AAGA;AACA;AACA;;AAIe,SAASK,2BAA2BA,CAAE;EAAEC;AAAM,CAAC,EAAG;EAChE,IAAK,CAAEA,KAAK,CAACC,MAAM,EAAG;IACrB,OAAO,IAAI;EACZ;;EAEA;EACA,IAAKD,KAAK,CAACC,MAAM,KAAK,CAAC,EAAG;IACzB,OAAO,IAAAC,MAAA,CAAAC,aAAA,EAACP,2BAAA,CAAAQ,OAA0B;MAACC,EAAE,EAAGL,KAAK,CAAE,CAAC;IAAI,CAAE,CAAC;EACxD;;EAEA;EACA,OACC,IAAAE,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAI,QAAA,QACC,IAAAJ,MAAA,CAAAC,aAAA,EAACR,WAAA,CAAAY,qBAAO;IACPC,SAAS,EAAC,0EAA0E;IACpFC,IAAI,EAAC,IAAI;IACTC,SAAS;IACTC,MAAM,EAAG;EAAK,GAEZ,IAAAC,QAAE,EAAE,YAAa,CACX,CAAC,EACV,IAAAV,MAAA,CAAAC,aAAA,EAACL,+BAAA,CAAAM,OAA8B;IAACJ,KAAK,EAAGA;EAAO,CAAE,CAChD,CAAC;AAEL","ignoreList":[]}
|
package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blocks2","require","_templatePartNavigationMenus","_interopRequireDefault","_useEditedEntityRecord","_constants","getBlocksFromRecord","record","blocks","content","parse","getBlocksOfTypeFromBlocks","targetBlockType","length","findInBlocks","_blocks","navigationBlocks","block","name","push","innerBlocks","innerNavigationBlocks","useNavigationMenuContent","postType","postId","useEditedEntityRecord","TEMPLATE_PART_POST_TYPE","navigationMenuIds","map","attributes","ref","uniqueNavigationMenuIds","Set","filter","menuId","_react","createElement","default","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\nfunction getBlocksFromRecord( record ) {\n\tif ( record?.blocks ) {\n\t\treturn record?.blocks;\n\t}\n\n\treturn record?.content && typeof record.content !== 'function'\n\t\t? parse( record.content )\n\t\t: [];\n}\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 = getBlocksFromRecord( record );\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":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,4BAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,sBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAVA;AACA;AACA;;AAGA;AACA;AACA;;AAKA,SAASK,mBAAmBA,CAAEC,MAAM,EAAG;EACtC,IAAKA,MAAM,EAAEC,MAAM,EAAG;IACrB,OAAOD,MAAM,EAAEC,MAAM;EACtB;EAEA,OAAOD,MAAM,EAAEE,OAAO,IAAI,OAAOF,MAAM,CAACE,OAAO,KAAK,UAAU,GAC3D,IAAAC,cAAK,EAAEH,MAAM,CAACE,OAAQ,CAAC,GACvB,EAAE;AACN;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASE,yBAAyBA,CAAEC,eAAe,EAAEJ,MAA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IC,GAAG,CAAEL,iBAAkB,CAAC,CAAE,CAACM,MAAM,CACvEC,MAAM,IAAMA,MACf,CAAC;EAED,IAAK,CAAEH,uBAAuB,EAAElB,MAAM,EAAG;IACxC;EACD;EAEA,OAAO,IAAAsB,MAAA,CAAAC,aAAA,EAAClC,4BAAA,CAAAmC,OAA2B;IAACC,KAAK,EAAGP;EAAyB,CAAE,CAAC;AACzE"}
|
|
1
|
+
{"version":3,"names":["_blocks2","require","_templatePartNavigationMenus","_interopRequireDefault","_useEditedEntityRecord","_constants","getBlocksFromRecord","record","blocks","content","parse","getBlocksOfTypeFromBlocks","targetBlockType","length","findInBlocks","_blocks","navigationBlocks","block","name","push","innerBlocks","innerNavigationBlocks","useNavigationMenuContent","postType","postId","useEditedEntityRecord","TEMPLATE_PART_POST_TYPE","navigationMenuIds","map","attributes","ref","uniqueNavigationMenuIds","Set","filter","menuId","_react","createElement","default","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\nfunction getBlocksFromRecord( record ) {\n\tif ( record?.blocks ) {\n\t\treturn record?.blocks;\n\t}\n\n\treturn record?.content && typeof record.content !== 'function'\n\t\t? parse( record.content )\n\t\t: [];\n}\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 = getBlocksFromRecord( record );\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":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AAKA,IAAAC,4BAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,sBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,UAAA,GAAAJ,OAAA;AAVA;AAC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KG,kCAAuB,EAAG;IAC3C;EACD;EAEA,MAAMlB,MAAM,GAAGF,mBAAmB,CAAEC,MAAO,CAAC;EAC5C,MAAMS,gBAAgB,GAAGL,yBAAyB,CACjD,iBAAiB,EACjBH,MACD,CAAC;EAED,IAAK,CAAEQ,gBAAgB,CAACH,MAAM,EAAG;IAChC;EACD;EAEA,MAAMc,iBAAiB,GAAGX,gBAAgB,EAAEY,GAAG,CAC5CX,KAAK,IAAMA,KAAK,CAACY,UAAU,CAACC,GAC/B,CAAC;;EAED;EACA;EACA,MAAMC,uBAAuB,GAAG,CAAE,GAAG,IAAIC,GAAG,CAAEL,iBAAkB,CAAC,CAAE,CAACM,MAAM,CACvEC,MAAM,IAAMA,MACf,CAAC;EAED,IAAK,CAAEH,uBAAuB,EAAElB,MAAM,EAAG;IACxC;EACD;EAEA,OAAO,IAAAsB,MAAA,CAAAC,aAAA,EAAClC,4BAAA,CAAAmC,OAA2B;IAACC,KAAK,EAAGP;EAAyB,CAAE,CAAC;AACzE","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_coreData","_constants","useNavigationMenuTitle","id","useSelect","select","undefined","editedRecord","coreStore","getEditedEntityRecord","NAVIGATION_POST_TYPE","status","title"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\n\nexport default function useNavigationMenuTitle( id ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! id ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst editedRecord = select( coreStore ).getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tNAVIGATION_POST_TYPE,\n\t\t\t\tid\n\t\t\t);\n\n\t\t\t// Do not display a 'trashed' navigation menu.\n\t\t\treturn editedRecord.status === 'trash'\n\t\t\t\t? undefined\n\t\t\t\t: editedRecord.title;\n\t\t},\n\t\t[ id ]\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAKA,IAAAE,UAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGe,SAASG,sBAAsBA,CAAEC,EAAE,EAAG;EACpD,OAAO,IAAAC,eAAS,EACbC,MAAM,IAAM;IACb,IAAK,CAAEF,EAAE,EAAG;MACX,OAAOG,SAAS;IACjB;IAEA,MAAMC,YAAY,GAAGF,MAAM,CAAEG,eAAU,CAAC,CAACC,qBAAqB,CAC7D,UAAU,EACVC,+BAAoB,EACpBP,EACD,CAAC;;IAED;IACA,OAAOI,YAAY,CAACI,MAAM,KAAK,OAAO,GACnCL,SAAS,GACTC,YAAY,CAACK,KAAK;EACtB,CAAC,EACD,CAAET,EAAE,CACL,CAAC;AACF"}
|
|
1
|
+
{"version":3,"names":["_data","require","_coreData","_constants","useNavigationMenuTitle","id","useSelect","select","undefined","editedRecord","coreStore","getEditedEntityRecord","NAVIGATION_POST_TYPE","status","title"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\n\nexport default function useNavigationMenuTitle( id ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! id ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst editedRecord = select( coreStore ).getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tNAVIGATION_POST_TYPE,\n\t\t\t\tid\n\t\t\t);\n\n\t\t\t// Do not display a 'trashed' navigation menu.\n\t\t\treturn editedRecord.status === 'trash'\n\t\t\t\t? undefined\n\t\t\t\t: editedRecord.title;\n\t\t},\n\t\t[ id ]\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAKA,IAAAE,UAAA,GAAAF,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGe,SAASG,sBAAsBA,CAAEC,EAAE,EAAG;EACpD,OAAO,IAAAC,eAAS,EACbC,MAAM,IAAM;IACb,IAAK,CAAEF,EAAE,EAAG;MACX,OAAOG,SAAS;IACjB;IAEA,MAAMC,YAAY,GAAGF,MAAM,CAAEG,eAAU,CAAC,CAACC,qBAAqB,CAC7D,UAAU,EACVC,+BAAoB,EACpBP,EACD,CAAC;;IAED;IACA,OAAOI,YAAY,CAACI,MAAM,KAAK,OAAO,GACnCL,SAAS,GACTC,YAAY,CAACK,KAAK;EACtB,CAAC,EACD,CAAET,EAAE,CACL,CAAC;AACF","ignoreList":[]}
|
|
@@ -11,7 +11,7 @@ var _i18n = require("@wordpress/i18n");
|
|
|
11
11
|
var _coreData = require("@wordpress/core-data");
|
|
12
12
|
var _editor = require("@wordpress/editor");
|
|
13
13
|
var _data = require("@wordpress/data");
|
|
14
|
-
var _hooks = require("../page-templates
|
|
14
|
+
var _hooks = require("../page-templates/hooks");
|
|
15
15
|
var _useEditedEntityRecord = _interopRequireDefault(require("../use-edited-entity-record"));
|
|
16
16
|
var _useNavigationMenuContent = _interopRequireDefault(require("./use-navigation-menu-content"));
|
|
17
17
|
var _sidebarNavigationScreenDetailsFooter = _interopRequireDefault(require("../sidebar-navigation-screen-details-footer"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_changeCase","require","_i18n","_coreData","_editor","_data","_hooks","_useEditedEntityRecord","_interopRequireDefault","_useNavigationMenuContent","_sidebarNavigationScreenDetailsFooter","_sidebarNavigationScreenDetailsPanel","_constants","usePatternDetails","postType","postId","getDescription","getTitle","record","useEditedEntityRecord","templatePartAreas","useSelect","select","editorStore","__experimentalGetDefaultTemplatePartAreas","currentTheme","userPatternCategories","getCurrentTheme","getUserPatternCategories","coreStore","addedBy","useAddedBy","isAddedByActiveTheme","type","theme","stylesheet","title","description","text","PATTERN_TYPES","user","sprintf","__","footer","modified","_react","createElement","default","details","TEMPLATE_PART_POST_TYPE","push","label","value","wp_pattern_sync_status","PATTERN_SYNC_TYPES","unsynced","_x","wp_pattern_category","length","patternCategories","Map","forEach","userCategory","set","id","categories","filter","category","get","map","join","templatePartArea","find","area","areaDetailValue","sentenceCase","className","origin","TEMPLATE_ORIGINS","plugin","has_theme_file","isCustomized","content","Fragment","useNavigationMenuContent","SidebarNavigationScreenDetailsPanel","spacing","SidebarNavigationScreenDetailsPanelRow","key","SidebarNavigationScreenDetailsPanelLabel","SidebarNavigationScreenDetailsPanelValue"],"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 { __, _x, 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 '../page-templates-template-parts/hooks';\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? _x(\n\t\t\t\t\t\t\t'Not synced',\n\t\t\t\t\t\t\t'Text that indicates that the pattern is not synchronized'\n\t\t\t\t\t )\n\t\t\t\t\t: _x(\n\t\t\t\t\t\t\t'Synced',\n\t\t\t\t\t\t\t'Text that indicates that the pattern is synchronized'\n\t\t\t\t\t ),\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 };\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KAAK,EAAG,IAAAM,QAAE,EAAE,SAAU;EAAG,GAEvBM,OAAO,CAACqB,GAAG,CAAE,CAAE;IAAElB,KAAK;IAAEC;EAAM,CAAC,KAChC,IAAAP,MAAA,CAAAC,aAAA,EAACnC,oCAAA,CAAA4E,sCAAsC;IAACC,GAAG,EAAGrC;EAAO,GACpD,IAAAN,MAAA,CAAAC,aAAA,EAACnC,oCAAA,CAAA8E,wCAAwC,QACtCtC,KACuC,CAAC,EAC3C,IAAAN,MAAA,CAAAC,aAAA,EAACnC,oCAAA,CAAA+E,wCAAwC,QACtCtC,KACuC,CACH,CACvC,CACkC,CAErC,CACF;EAED,OAAO;IAAEhB,KAAK;IAAEC,WAAW;IAAE6C,OAAO;IAAEvC;EAAO,CAAC;AAC/C"}
|
|
1
|
+
{"version":3,"names":["_changeCase","require","_i18n","_coreData","_editor","_data","_hooks","_useEditedEntityRecord","_interopRequireDefault","_useNavigationMenuContent","_sidebarNavigationScreenDetailsFooter","_sidebarNavigationScreenDetailsPanel","_constants","usePatternDetails","postType","postId","getDescription","getTitle","record","useEditedEntityRecord","templatePartAreas","useSelect","select","editorStore","__experimentalGetDefaultTemplatePartAreas","currentTheme","userPatternCategories","getCurrentTheme","getUserPatternCategories","coreStore","addedBy","useAddedBy","isAddedByActiveTheme","type","theme","stylesheet","title","description","text","PATTERN_TYPES","user","sprintf","__","footer","modified","_react","createElement","default","details","TEMPLATE_PART_POST_TYPE","push","label","value","wp_pattern_sync_status","PATTERN_SYNC_TYPES","unsynced","_x","wp_pattern_category","length","patternCategories","Map","forEach","userCategory","set","id","categories","filter","category","get","map","join","templatePartArea","find","area","areaDetailValue","sentenceCase","className","origin","TEMPLATE_ORIGINS","plugin","has_theme_file","isCustomized","content","Fragment","useNavigationMenuContent","SidebarNavigationScreenDetailsPanel","spacing","SidebarNavigationScreenDetailsPanelRow","key","SidebarNavigationScreenDetailsPanelLabel","SidebarNavigationScreenDetailsPanelValue"],"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 { __, _x, 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 '../page-templates/hooks';\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? _x(\n\t\t\t\t\t\t\t'Not synced',\n\t\t\t\t\t\t\t'Text that indicates that the pattern is not synchronized'\n\t\t\t\t\t )\n\t\t\t\t\t: _x(\n\t\t\t\t\t\t\t'Synced',\n\t\t\t\t\t\t\t'Text that indicates that the pattern is synchronized'\n\t\t\t\t\t ),\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":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,sBAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,yBAAA,GAAAD,sBAAA,CAAAP,OAAA;AACA,IAAAS,qCAAA,GAAAF,sBAAA,CAAAP,OAAA;AACA,IAAAU,oCAAA,GAAAV,OAAA;AAMA,IAAAW,UAAA,GAAAX,OAAA;AA1BA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;;AAkBe,SAASY,iBAAiBA,CAAEC,QAAQ,EAAEC,MAAM,EAAG;EAC7D,MAAM;IAAEC,cAAc;IAAEC,QAAQ;IAAEC;E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M,CAAC2D,MAAM,KAAKC,2BAAgB,CAACC,MAAM,IAC1C7D,MAAM,CAAC8D,cAAc,KAAK,IAAI,CAAE,EAChC;IACDhC,OAAO,CAACE,IAAI,CAAE;MACbC,KAAK,EAAE,IAAAT,QAAE,EAAE,YAAa,CAAC;MACzBU,KAAK,EACJ,IAAAP,MAAA,CAAAC,aAAA;QAAM8B,SAAS,EAAC;MAA8E,GAC3F9C,OAAO,CAACmD,YAAY,GAAG,IAAAvC,QAAE,EAAE,KAAM,CAAC,GAAG,IAAAA,QAAE,EAAE,IAAK,CAC3C;IAER,CAAE,CAAC;EACJ;EAEA,MAAMwC,OAAO,GACZ,IAAArC,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAsC,QAAA,QACG,IAAAC,iCAAwB,EAAEtE,QAAQ,EAAEC,MAAO,CAAC,EAC5C,CAAC,CAAEiC,OAAO,CAACU,MAAM,IAClB,IAAAb,MAAA,CAAAC,aAAA,EAACnC,oCAAA,CAAA0E,mCAAmC;IACnCC,OAAO,EAAG,CAAG;IACblD,KAAK,EAAG,IAAAM,QAAE,EAAE,SAAU;EAAG,GAEvBM,OAAO,CAACqB,GAAG,CAAE,CAAE;IAAElB,KAAK;IAAEC;EAAM,CAAC,KAChC,IAAAP,MAAA,CAAAC,aAAA,EAACnC,oCAAA,CAAA4E,sCAAsC;IAACC,GAAG,EAAGrC;EAAO,GACpD,IAAAN,MAAA,CAAAC,aAAA,EAACnC,oCAAA,CAAA8E,wCAAwC,QACtCtC,KACuC,CAAC,EAC3C,IAAAN,MAAA,CAAAC,aAAA,EAACnC,oCAAA,CAAA+E,wCAAwC,QACtCtC,KACuC,CACH,CACvC,CACkC,CAErC,CACF;EAED,OAAO;IAAEhB,KAAK;IAAEC,WAAW;IAAE6C,OAAO;IAAEvC;EAAO,CAAC;AAC/C","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_sidebarNavigationItem","_interopRequireDefault","require","_link","CategoryItem","count","icon","id","isActive","label","type","
|
|
1
|
+
{"version":3,"names":["_sidebarNavigationItem","_interopRequireDefault","require","_link","CategoryItem","count","icon","id","isActive","label","type","path","linkInfo","useLink","categoryType","categoryId","_react","createElement","default","suffix","undefined"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-patterns/category-item.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { useLink } from '../routes/link';\n\nexport default function CategoryItem( {\n\tcount,\n\ticon,\n\tid,\n\tisActive,\n\tlabel,\n\ttype,\n\tpath = '/patterns',\n} ) {\n\tconst linkInfo = useLink( {\n\t\tpath,\n\t\tcategoryType: type,\n\t\tcategoryId: id,\n\t} );\n\n\tif ( ! count ) {\n\t\treturn;\n\t}\n\n\treturn (\n\t\t<SidebarNavigationItem\n\t\t\t{ ...linkInfo }\n\t\t\ticon={ icon }\n\t\t\tsuffix={ <span>{ count }</span> }\n\t\t\taria-current={ isActive ? 'true' : undefined }\n\t\t>\n\t\t\t{ label }\n\t\t</SidebarNavigationItem>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,sBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIe,SAASE,YAAYA,CAAE;EACrCC,KAAK;EACLC,IAAI;EACJC,EAAE;EACFC,QAAQ;EACRC,KAAK;EACLC,IAAI;EACJC,IAAI,GAAG;AACR,CAAC,EAAG;EACH,MAAMC,QAAQ,GAAG,IAAAC,aAAO,EAAE;IACzBF,IAAI;IACJG,YAAY,EAAEJ,IAAI;IAClBK,UAAU,EAAER;EACb,CAAE,CAAC;EAEH,IAAK,CAAEF,KAAK,EAAG;IACd;EACD;EAEA,OACC,IAAAW,MAAA,CAAAC,aAAA,EAACjB,sBAAA,CAAAkB,OAAqB;IAAA,GAChBN,QAAQ;IACbN,IAAI,EAAGA,IAAM;IACba,MAAM,EAAG,IAAAH,MAAA,CAAAC,aAAA,gBAAQZ,KAAa,CAAG;IACjC,gBAAeG,QAAQ,GAAG,MAAM,GAAGY;EAAW,GAE5CX,KACoB,CAAC;AAE1B","ignoreList":[]}
|