@wordpress/edit-site 5.13.0 → 5.15.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 +2 -13
- package/build/components/add-new-page/index.js.map +1 -1
- package/build/components/add-new-pattern/index.js +29 -15
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js +2 -2
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/new-template.js +69 -14
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/add-new-template/utils.js +10 -8
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/block-editor/constants.js +1 -1
- package/build/components/block-editor/constants.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +1 -1
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/index.js +0 -4
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/block-editor/inserter-media-categories.js +1 -22
- package/build/components/block-editor/inserter-media-categories.js.map +1 -1
- package/build/components/block-editor/site-editor-canvas.js +29 -32
- package/build/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js +90 -19
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/canvas-spinner/index.js +1 -18
- package/build/components/canvas-spinner/index.js.map +1 -1
- package/build/components/code-editor/index.js +60 -28
- package/build/components/code-editor/index.js.map +1 -1
- package/build/components/create-pattern-modal/index.js +15 -11
- package/build/components/create-pattern-modal/index.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +1 -1
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/editor/index.js +11 -1
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/palette.js +1 -1
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/ui.js +7 -2
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/header-edit-mode/document-actions/index.js +9 -1
- package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +49 -14
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/index.js +47 -17
- package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +17 -4
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/edit-mode.js +32 -1
- package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build/components/keyboard-shortcuts/register.js +9 -0
- package/build/components/keyboard-shortcuts/register.js.map +1 -1
- package/build/components/layout/index.js +110 -28
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page/header.js +1 -1
- package/build/components/page/header.js.map +1 -1
- package/build/components/page/index.js +3 -1
- package/build/components/page/index.js.map +1 -1
- package/build/components/page-actions/index.js +2 -2
- package/build/components/page-actions/index.js.map +1 -1
- package/build/components/page-actions/{delete-page-menu-item.js → trash-page-menu-item.js} +8 -15
- package/build/components/page-actions/trash-page-menu-item.js.map +1 -0
- package/build/components/page-content-focus-manager/back-to-page-notification.js +9 -3
- package/build/components/page-content-focus-manager/back-to-page-notification.js.map +1 -1
- package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js +5 -5
- package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
- package/build/components/page-main/index.js +8 -4
- package/build/components/page-main/index.js.map +1 -1
- package/build/components/page-patterns/duplicate-menu-item.js +163 -0
- package/build/components/page-patterns/duplicate-menu-item.js.map +1 -0
- package/build/components/page-patterns/grid-item.js +218 -0
- package/build/components/page-patterns/grid-item.js.map +1 -0
- package/build/components/{page-library → page-patterns}/grid.js +6 -19
- package/build/components/page-patterns/grid.js.map +1 -0
- package/build/components/page-patterns/header.js +69 -0
- package/build/components/page-patterns/header.js.map +1 -0
- package/build/components/{page-library → page-patterns}/index.js +9 -7
- package/build/components/page-patterns/index.js.map +1 -0
- package/build/components/{page-library → page-patterns}/no-patterns.js +1 -1
- package/build/components/page-patterns/no-patterns.js.map +1 -0
- package/build/components/page-patterns/pagination.js +63 -0
- package/build/components/page-patterns/pagination.js.map +1 -0
- package/build/components/page-patterns/patterns-list.js +175 -0
- package/build/components/page-patterns/patterns-list.js.map +1 -0
- package/build/components/page-patterns/rename-menu-item.js +109 -0
- package/build/components/page-patterns/rename-menu-item.js.map +1 -0
- package/build/components/page-patterns/search-items.js.map +1 -0
- package/build/components/{page-library/use-library-settings.js → page-patterns/use-pattern-settings.js} +3 -3
- package/build/components/page-patterns/use-pattern-settings.js.map +1 -0
- package/build/components/page-patterns/use-patterns.js +185 -0
- package/build/components/page-patterns/use-patterns.js.map +1 -0
- package/build/components/{page-library → page-patterns}/utils.js +3 -3
- package/build/components/page-patterns/utils.js.map +1 -0
- package/build/components/page-template-parts/add-new-template-part.js +74 -0
- package/build/components/page-template-parts/add-new-template-part.js.map +1 -0
- package/build/components/page-template-parts/index.js +82 -0
- package/build/components/page-template-parts/index.js.map +1 -0
- package/build/components/page-templates/index.js +1 -0
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/preferences-modal/enable-feature.js +5 -1
- package/build/components/preferences-modal/enable-feature.js.map +1 -1
- package/build/components/preferences-modal/index.js +43 -4
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/resizable-frame/index.js +78 -36
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/save-panel/index.js +5 -5
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +6 -6
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +4 -2
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-content.js +4 -3
- package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-status.js +3 -8
- package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
- package/build/components/sidebar-edit-mode/settings-header/index.js +7 -1
- package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +21 -11
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +69 -5
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +5 -3
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/template-part-hint.js +45 -0
- package/build/components/sidebar-navigation-screen-main/template-part-hint.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +7 -16
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +10 -11
- package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js +10 -10
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +10 -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 +9 -3
- 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 +9 -4
- 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 +29 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +2 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +27 -4
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/index.js +2 -3
- package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/page-details.js +11 -4
- package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/status-label.js +2 -35
- package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pages/index.js +33 -25
- package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/index.js +20 -13
- package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +4 -3
- 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 -2
- 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 +11 -3
- package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +28 -2
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/category-item.js +4 -4
- package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -0
- package/build/components/sidebar-navigation-screen-patterns/index.js +173 -0
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -0
- package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js +34 -0
- package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +1 -0
- package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-pattern-categories.js +11 -19
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -0
- package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +52 -0
- package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -0
- package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-theme-patterns.js +2 -2
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -0
- package/build/components/sidebar-navigation-screen-templates/index.js +11 -63
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +4 -2
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/site-hub/index.js +25 -12
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +10 -5
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-path-with-url.js +16 -13
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build/components/template-actions/index.js +25 -7
- package/build/components/template-actions/index.js.map +1 -1
- package/build/components/template-actions/rename-menu-item.js +12 -8
- package/build/components/template-actions/rename-menu-item.js.map +1 -1
- package/build/components/use-edited-entity-record/index.js +6 -1
- package/build/components/use-edited-entity-record/index.js.map +1 -1
- package/build/components/welcome-guide/editor.js +1 -1
- package/build/components/welcome-guide/editor.js.map +1 -1
- package/build/components/welcome-guide/index.js +5 -1
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/page.js +70 -0
- package/build/components/welcome-guide/page.js.map +1 -0
- package/build/components/welcome-guide/styles.js +1 -1
- package/build/components/welcome-guide/styles.js.map +1 -1
- package/build/components/welcome-guide/template.js +71 -0
- package/build/components/welcome-guide/template.js.map +1 -0
- package/build/hooks/commands/use-common-commands.js +115 -20
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +195 -44
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js +56 -10
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/index.js +9 -0
- package/build/index.js.map +1 -1
- package/build/store/actions.js +5 -2
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +7 -1
- package/build/store/private-actions.js.map +1 -1
- package/build/store/selectors.js +2 -1
- package/build/store/selectors.js.map +1 -1
- package/build/utils/get-is-list-page.js +2 -2
- package/build/utils/get-is-list-page.js.map +1 -1
- package/build/utils/normalize-record-key.js +19 -0
- package/build/utils/normalize-record-key.js.map +1 -0
- package/build/utils/template-part-create.js +2 -2
- package/build/utils/template-part-create.js.map +1 -1
- package/build/utils/use-activate-theme.js +1 -1
- package/build/utils/use-activate-theme.js.map +1 -1
- package/build-module/components/add-new-page/index.js +2 -12
- package/build-module/components/add-new-page/index.js.map +1 -1
- package/build-module/components/add-new-pattern/index.js +28 -16
- 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 +1 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +72 -17
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +9 -6
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/block-editor/constants.js +1 -1
- package/build-module/components/block-editor/constants.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +1 -1
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/index.js +0 -4
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/block-editor/inserter-media-categories.js +1 -22
- package/build-module/components/block-editor/inserter-media-categories.js.map +1 -1
- package/build-module/components/block-editor/site-editor-canvas.js +29 -32
- package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +92 -20
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/canvas-spinner/index.js +1 -15
- package/build-module/components/canvas-spinner/index.js.map +1 -1
- package/build-module/components/code-editor/index.js +62 -30
- package/build-module/components/code-editor/index.js.map +1 -1
- package/build-module/components/create-pattern-modal/index.js +14 -11
- package/build-module/components/create-pattern-modal/index.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +1 -1
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/editor/index.js +11 -1
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/palette.js +1 -1
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/ui.js +8 -3
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/header-edit-mode/document-actions/index.js +10 -2
- package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +51 -16
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +44 -20
- package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +15 -6
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/edit-mode.js +29 -1
- package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/register.js +9 -0
- package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
- package/build-module/components/layout/index.js +110 -28
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page/header.js +1 -1
- package/build-module/components/page/header.js.map +1 -1
- package/build-module/components/page/index.js +2 -1
- package/build-module/components/page/index.js.map +1 -1
- package/build-module/components/page-actions/index.js +2 -2
- package/build-module/components/page-actions/index.js.map +1 -1
- package/build-module/components/page-actions/{delete-page-menu-item.js → trash-page-menu-item.js} +8 -16
- package/build-module/components/page-actions/trash-page-menu-item.js.map +1 -0
- package/build-module/components/page-content-focus-manager/back-to-page-notification.js +9 -3
- package/build-module/components/page-content-focus-manager/back-to-page-notification.js.map +1 -1
- package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js +5 -3
- package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -1
- package/build-module/components/page-main/index.js +6 -3
- package/build-module/components/page-main/index.js.map +1 -1
- package/build-module/components/page-patterns/duplicate-menu-item.js +147 -0
- package/build-module/components/page-patterns/duplicate-menu-item.js.map +1 -0
- package/build-module/components/page-patterns/grid-item.js +195 -0
- package/build-module/components/page-patterns/grid-item.js.map +1 -0
- package/build-module/components/page-patterns/grid.js +26 -0
- package/build-module/components/page-patterns/grid.js.map +1 -0
- package/build-module/components/page-patterns/header.js +54 -0
- package/build-module/components/page-patterns/header.js.map +1 -0
- package/build-module/components/{page-library → page-patterns}/index.js +8 -6
- package/build-module/components/page-patterns/index.js.map +1 -0
- package/build-module/components/{page-library → page-patterns}/no-patterns.js +1 -1
- package/build-module/components/page-patterns/no-patterns.js.map +1 -0
- package/build-module/components/page-patterns/pagination.js +54 -0
- package/build-module/components/page-patterns/pagination.js.map +1 -0
- package/build-module/components/page-patterns/patterns-list.js +152 -0
- package/build-module/components/page-patterns/patterns-list.js.map +1 -0
- package/build-module/components/page-patterns/rename-menu-item.js +97 -0
- package/build-module/components/page-patterns/rename-menu-item.js.map +1 -0
- package/build-module/components/page-patterns/search-items.js.map +1 -0
- package/build-module/components/{page-library/use-library-settings.js → page-patterns/use-pattern-settings.js} +2 -2
- package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -0
- package/build-module/components/page-patterns/use-patterns.js +167 -0
- package/build-module/components/page-patterns/use-patterns.js.map +1 -0
- package/build-module/components/{page-library → page-patterns}/utils.js +3 -3
- package/build-module/components/page-patterns/utils.js.map +1 -0
- package/build-module/components/page-template-parts/add-new-template-part.js +58 -0
- package/build-module/components/page-template-parts/add-new-template-part.js.map +1 -0
- package/build-module/components/page-template-parts/index.js +63 -0
- package/build-module/components/page-template-parts/index.js.map +1 -0
- package/build-module/components/page-templates/index.js +1 -0
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/preferences-modal/enable-feature.js +5 -1
- package/build-module/components/preferences-modal/enable-feature.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +38 -5
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/resizable-frame/index.js +79 -39
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +5 -5
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +5 -5
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +4 -2
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +5 -2
- 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-status.js +3 -8
- package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/settings-header/index.js +6 -1
- package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +22 -12
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +67 -5
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +5 -4
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/template-part-hint.js +33 -0
- package/build-module/components/sidebar-navigation-screen-main/template-part-hint.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +8 -17
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +10 -9
- package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +9 -10
- 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 +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +11 -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 +8 -4
- 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 +9 -4
- 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 +20 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +2 -0
- 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 +26 -6
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/index.js +2 -3
- package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/page-details.js +11 -4
- 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 +2 -33
- package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pages/index.js +34 -26
- package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/index.js +18 -12
- 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.js +4 -3
- 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 -2
- 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 +11 -3
- package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +25 -2
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/category-item.js +4 -4
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +148 -0
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js +24 -0
- package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +1 -0
- package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-pattern-categories.js +11 -17
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +43 -0
- package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -0
- package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-theme-patterns.js +2 -2
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-templates/index.js +12 -62
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +4 -2
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +25 -12
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +7 -5
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +17 -13
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build-module/components/template-actions/index.js +26 -8
- package/build-module/components/template-actions/index.js.map +1 -1
- package/build-module/components/template-actions/rename-menu-item.js +11 -8
- package/build-module/components/template-actions/rename-menu-item.js.map +1 -1
- package/build-module/components/use-edited-entity-record/index.js +3 -1
- package/build-module/components/use-edited-entity-record/index.js.map +1 -1
- package/build-module/components/welcome-guide/editor.js +1 -1
- package/build-module/components/welcome-guide/editor.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +3 -1
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/page.js +59 -0
- package/build-module/components/welcome-guide/page.js.map +1 -0
- package/build-module/components/welcome-guide/styles.js +1 -1
- package/build-module/components/welcome-guide/styles.js.map +1 -1
- package/build-module/components/welcome-guide/template.js +60 -0
- package/build-module/components/welcome-guide/template.js.map +1 -0
- package/build-module/hooks/commands/use-common-commands.js +111 -21
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +193 -46
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +57 -10
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/index.js +4 -0
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +5 -2
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +7 -1
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/selectors.js +2 -1
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/get-is-list-page.js +2 -2
- package/build-module/utils/get-is-list-page.js.map +1 -1
- package/build-module/utils/normalize-record-key.js +12 -0
- package/build-module/utils/normalize-record-key.js.map +1 -0
- package/build-module/utils/template-part-create.js +1 -1
- package/build-module/utils/template-part-create.js.map +1 -1
- package/build-module/utils/use-activate-theme.js +1 -1
- package/build-module/utils/use-activate-theme.js.map +1 -1
- package/build-style/style-rtl.css +383 -109
- package/build-style/style.css +383 -109
- package/package.json +39 -40
- package/src/components/add-new-page/index.js +1 -9
- package/src/components/add-new-pattern/index.js +30 -21
- package/src/components/add-new-template/add-custom-generic-template-modal-content.js +1 -1
- package/src/components/add-new-template/new-template.js +120 -24
- package/src/components/add-new-template/style.scss +30 -2
- package/src/components/add-new-template/utils.js +9 -6
- package/src/components/block-editor/constants.js +5 -1
- package/src/components/block-editor/editor-canvas.js +3 -1
- package/src/components/block-editor/index.js +0 -4
- package/src/components/block-editor/inserter-media-categories.js +1 -21
- package/src/components/block-editor/site-editor-canvas.js +7 -1
- package/src/components/block-editor/use-site-editor-settings.js +100 -25
- package/src/components/canvas-spinner/index.js +1 -11
- package/src/components/canvas-spinner/style.scss +18 -0
- package/src/components/code-editor/index.js +51 -33
- package/src/components/create-pattern-modal/index.js +15 -13
- package/src/components/create-template-part-modal/index.js +1 -1
- package/src/components/editor/index.js +16 -1
- package/src/components/editor/style.scss +4 -0
- package/src/components/global-styles/palette.js +10 -9
- package/src/components/global-styles/stories/index.js +1 -0
- package/src/components/global-styles/ui.js +34 -24
- package/src/components/header-edit-mode/document-actions/index.js +9 -1
- package/src/components/header-edit-mode/document-actions/style.scss +12 -0
- package/src/components/header-edit-mode/index.js +136 -79
- package/src/components/header-edit-mode/more-menu/index.js +74 -30
- package/src/components/keyboard-shortcut-help-modal/index.js +21 -7
- package/src/components/keyboard-shortcuts/edit-mode.js +35 -2
- package/src/components/keyboard-shortcuts/register.js +10 -0
- package/src/components/layout/index.js +156 -78
- package/src/components/layout/style.scss +49 -2
- package/src/components/page/header.js +1 -1
- package/src/components/page/index.js +5 -1
- package/src/components/page-actions/index.js +2 -2
- package/src/components/page-actions/{delete-page-menu-item.js → trash-page-menu-item.js} +9 -21
- package/src/components/page-content-focus-manager/back-to-page-notification.js +7 -2
- package/src/components/page-content-focus-manager/disable-non-page-content-blocks.js +12 -3
- package/src/components/page-main/index.js +6 -3
- package/src/components/page-patterns/duplicate-menu-item.js +196 -0
- package/src/components/page-patterns/grid-item.js +284 -0
- package/src/components/page-patterns/grid.js +22 -0
- package/src/components/page-patterns/header.js +69 -0
- package/src/components/{page-library → page-patterns}/index.js +11 -6
- package/src/components/{page-library → page-patterns}/no-patterns.js +1 -1
- package/src/components/page-patterns/pagination.js +80 -0
- package/src/components/page-patterns/patterns-list.js +206 -0
- package/src/components/page-patterns/rename-menu-item.js +115 -0
- package/src/components/page-patterns/style.scss +219 -0
- package/src/components/{page-library/use-library-settings.js → page-patterns/use-pattern-settings.js} +1 -1
- package/src/components/page-patterns/use-patterns.js +177 -0
- package/src/components/{page-library → page-patterns}/utils.js +3 -3
- package/src/components/page-template-parts/add-new-template-part.js +57 -0
- package/src/components/page-template-parts/index.js +86 -0
- package/src/components/page-templates/index.js +1 -1
- package/src/components/preferences-modal/enable-feature.js +5 -2
- package/src/components/preferences-modal/index.js +35 -4
- package/src/components/resizable-frame/index.js +102 -34
- package/src/components/resizable-frame/style.scss +9 -9
- package/src/components/save-panel/index.js +10 -4
- package/src/components/sidebar/index.js +6 -6
- package/src/components/sidebar-button/style.scss +1 -1
- package/src/components/sidebar-edit-mode/index.js +4 -2
- package/src/components/sidebar-edit-mode/page-panels/page-content.js +7 -5
- package/src/components/sidebar-edit-mode/page-panels/page-status.js +2 -5
- package/src/components/sidebar-edit-mode/settings-header/index.js +7 -2
- package/src/components/sidebar-navigation-item/style.scss +7 -13
- package/src/components/sidebar-navigation-screen/index.js +18 -9
- package/src/components/sidebar-navigation-screen/style.scss +21 -2
- package/src/components/sidebar-navigation-screen-details-panel/style.scss +1 -1
- package/src/components/sidebar-navigation-screen-global-styles/index.js +57 -17
- package/src/components/sidebar-navigation-screen-main/index.js +44 -40
- package/src/components/sidebar-navigation-screen-main/template-part-hint.js +34 -0
- package/src/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +14 -35
- package/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js +8 -11
- package/src/components/sidebar-navigation-screen-navigation-menu/index.js +13 -11
- package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -0
- package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +12 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +16 -7
- package/src/components/sidebar-navigation-screen-navigation-menu/style.scss +2 -7
- package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +20 -6
- package/src/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js +24 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/constants.js +2 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +39 -8
- package/src/components/sidebar-navigation-screen-page/index.js +3 -3
- package/src/components/sidebar-navigation-screen-page/page-details.js +8 -3
- package/src/components/sidebar-navigation-screen-page/status-label.js +2 -36
- package/src/components/sidebar-navigation-screen-pages/index.js +40 -30
- package/src/components/sidebar-navigation-screen-pattern/index.js +18 -8
- package/src/components/sidebar-navigation-screen-pattern/style.scss +29 -0
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +3 -2
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +2 -1
- package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +12 -2
- package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +48 -3
- package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/category-item.js +4 -4
- package/src/components/sidebar-navigation-screen-patterns/index.js +194 -0
- package/src/components/sidebar-navigation-screen-patterns/style.scss +23 -0
- package/src/components/sidebar-navigation-screen-patterns/use-my-patterns.js +24 -0
- package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-pattern-categories.js +9 -17
- package/src/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +55 -0
- package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-theme-patterns.js +3 -2
- package/src/components/sidebar-navigation-screen-template/style.scss +15 -15
- package/src/components/sidebar-navigation-screen-templates/index.js +15 -82
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +2 -0
- package/src/components/site-hub/index.js +46 -29
- package/src/components/site-hub/style.scss +17 -3
- package/src/components/start-template-options/style.scss +0 -3
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +8 -2
- package/src/components/sync-state-with-url/use-sync-path-with-url.js +73 -66
- package/src/components/template-actions/index.js +40 -9
- package/src/components/template-actions/rename-menu-item.js +17 -10
- package/src/components/use-edited-entity-record/index.js +6 -1
- package/src/components/welcome-guide/editor.js +1 -1
- package/src/components/welcome-guide/index.js +4 -0
- package/src/components/welcome-guide/page.js +75 -0
- package/src/components/welcome-guide/style.scss +15 -1
- package/src/components/welcome-guide/styles.js +1 -1
- package/src/components/welcome-guide/template.js +82 -0
- package/src/hooks/commands/use-common-commands.js +88 -24
- package/src/hooks/commands/use-edit-mode-commands.js +182 -38
- package/src/hooks/push-changes-to-global-styles/index.js +63 -9
- package/src/index.js +4 -0
- package/src/store/actions.js +8 -1
- package/src/store/private-actions.js +5 -1
- package/src/store/selectors.js +5 -0
- package/src/store/test/selectors.js +2 -0
- package/src/style.scss +13 -14
- package/src/utils/get-is-list-page.js +4 -3
- package/src/utils/normalize-record-key.js +11 -0
- package/src/utils/template-part-create.js +1 -1
- package/src/utils/use-activate-theme.js +1 -1
- package/build/components/code-editor/code-editor-text-area.js +0 -96
- package/build/components/code-editor/code-editor-text-area.js.map +0 -1
- package/build/components/keyboard-shortcuts/index.js +0 -148
- package/build/components/keyboard-shortcuts/index.js.map +0 -1
- package/build/components/page-actions/delete-page-menu-item.js.map +0 -1
- package/build/components/page-content-focus-manager/constants.js +0 -9
- package/build/components/page-content-focus-manager/constants.js.map +0 -1
- package/build/components/page-library/grid-item.js +0 -165
- package/build/components/page-library/grid-item.js.map +0 -1
- package/build/components/page-library/grid.js.map +0 -1
- package/build/components/page-library/index.js.map +0 -1
- package/build/components/page-library/no-patterns.js.map +0 -1
- package/build/components/page-library/patterns-list.js +0 -108
- package/build/components/page-library/patterns-list.js.map +0 -1
- package/build/components/page-library/search-items.js.map +0 -1
- package/build/components/page-library/use-library-settings.js.map +0 -1
- package/build/components/page-library/use-patterns.js +0 -194
- package/build/components/page-library/use-patterns.js.map +0 -1
- package/build/components/page-library/utils.js.map +0 -1
- package/build/components/sidebar-navigation-screen-library/category-item.js.map +0 -1
- package/build/components/sidebar-navigation-screen-library/index.js +0 -112
- package/build/components/sidebar-navigation-screen-library/index.js.map +0 -1
- package/build/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +0 -1
- package/build/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +0 -1
- package/build/components/sidebar-navigation-screen-library/use-template-part-areas.js +0 -41
- package/build/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +0 -1
- package/build/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +0 -1
- package/build-module/components/code-editor/code-editor-text-area.js +0 -84
- package/build-module/components/code-editor/code-editor-text-area.js.map +0 -1
- package/build-module/components/keyboard-shortcuts/index.js +0 -132
- package/build-module/components/keyboard-shortcuts/index.js.map +0 -1
- package/build-module/components/page-actions/delete-page-menu-item.js.map +0 -1
- package/build-module/components/page-content-focus-manager/constants.js +0 -2
- package/build-module/components/page-content-focus-manager/constants.js.map +0 -1
- package/build-module/components/page-library/grid-item.js +0 -145
- package/build-module/components/page-library/grid-item.js.map +0 -1
- package/build-module/components/page-library/grid.js +0 -38
- package/build-module/components/page-library/grid.js.map +0 -1
- package/build-module/components/page-library/index.js.map +0 -1
- package/build-module/components/page-library/no-patterns.js.map +0 -1
- package/build-module/components/page-library/patterns-list.js +0 -87
- package/build-module/components/page-library/patterns-list.js.map +0 -1
- package/build-module/components/page-library/search-items.js.map +0 -1
- package/build-module/components/page-library/use-library-settings.js.map +0 -1
- package/build-module/components/page-library/use-patterns.js +0 -176
- package/build-module/components/page-library/use-patterns.js.map +0 -1
- package/build-module/components/page-library/utils.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-library/category-item.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-library/index.js +0 -87
- package/build-module/components/sidebar-navigation-screen-library/index.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-library/use-template-part-areas.js +0 -34
- package/build-module/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +0 -1
- package/src/components/code-editor/code-editor-text-area.js +0 -84
- package/src/components/keyboard-shortcuts/index.js +0 -137
- package/src/components/page-content-focus-manager/constants.js +0 -5
- package/src/components/page-library/grid-item.js +0 -179
- package/src/components/page-library/grid.js +0 -39
- package/src/components/page-library/patterns-list.js +0 -114
- package/src/components/page-library/style.scss +0 -105
- package/src/components/page-library/use-patterns.js +0 -238
- package/src/components/sidebar-navigation-screen-library/index.js +0 -136
- package/src/components/sidebar-navigation-screen-library/style.scss +0 -7
- package/src/components/sidebar-navigation-screen-library/use-template-part-areas.js +0 -33
- /package/build/components/{page-library → page-patterns}/search-items.js +0 -0
- /package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-default-pattern-categories.js +0 -0
- /package/build-module/components/{page-library → page-patterns}/search-items.js +0 -0
- /package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-default-pattern-categories.js +0 -0
- /package/src/components/{page-library → page-patterns}/search-items.js +0 -0
- /package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-default-pattern-categories.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createElement } from "@wordpress/element";
|
|
1
|
+
import { createElement, Fragment } from "@wordpress/element";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* WordPress dependencies
|
|
@@ -17,6 +17,7 @@ import SidebarNavigationItem from '../sidebar-navigation-item';
|
|
|
17
17
|
import { SidebarNavigationItemGlobalStyles } from '../sidebar-navigation-screen-global-styles';
|
|
18
18
|
import { unlock } from '../../lock-unlock';
|
|
19
19
|
import { store as editSiteStore } from '../../store';
|
|
20
|
+
import TemplatePartHint from './template-part-hint';
|
|
20
21
|
export default function SidebarNavigationScreenMain() {
|
|
21
22
|
const {
|
|
22
23
|
location
|
|
@@ -34,7 +35,7 @@ export default function SidebarNavigationScreenMain() {
|
|
|
34
35
|
isRoot: true,
|
|
35
36
|
title: __('Design'),
|
|
36
37
|
description: __('Customize the appearance of your website using the block editor.'),
|
|
37
|
-
content: createElement(ItemGroup, null, createElement(NavigatorButton, {
|
|
38
|
+
content: createElement(Fragment, null, createElement(ItemGroup, null, createElement(NavigatorButton, {
|
|
38
39
|
as: SidebarNavigationItem,
|
|
39
40
|
path: "/navigation",
|
|
40
41
|
withChevron: true,
|
|
@@ -54,10 +55,10 @@ export default function SidebarNavigationScreenMain() {
|
|
|
54
55
|
icon: layout
|
|
55
56
|
}, __('Templates')), createElement(NavigatorButton, {
|
|
56
57
|
as: SidebarNavigationItem,
|
|
57
|
-
path: "/
|
|
58
|
+
path: "/patterns",
|
|
58
59
|
withChevron: true,
|
|
59
60
|
icon: symbol
|
|
60
|
-
}, __('
|
|
61
|
+
}, __('Patterns'))), createElement(TemplatePartHint, null))
|
|
61
62
|
});
|
|
62
63
|
}
|
|
63
64
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-main/index.js"],"names":["__experimentalItemGroup","ItemGroup","__experimentalNavigatorButton","NavigatorButton","__experimentalUseNavigator","useNavigator","__","layout","symbol","navigation","styles","page","useDispatch","useEffect","SidebarNavigationScreen","SidebarNavigationItem","SidebarNavigationItemGlobalStyles","unlock","store","editSiteStore","SidebarNavigationScreenMain","location","setEditorCanvasContainerView","path","undefined"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,uBAAuB,IAAIC,SAD5B,EAECC,6BAA6B,IAAIC,eAFlC,EAGCC,0BAA0B,IAAIC,YAH/B,QAIO,uBAJP;AAKA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,MAAT,EAAiBC,MAAjB,EAAyBC,UAAzB,EAAqCC,MAArC,EAA6CC,IAA7C,QAAyD,kBAAzD;AACA,SAASC,WAAT,QAA4B,iBAA5B;AAEA,SAASC,SAAT,QAA0B,oBAA1B;AAEA;AACA;AACA;;AACA,OAAOC,uBAAP,MAAoC,8BAApC;AACA,OAAOC,qBAAP,MAAkC,4BAAlC;AACA,SAASC,iCAAT,QAAkD,4CAAlD;AACA,SAASC,MAAT,QAAuB,mBAAvB;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AAEA,eAAe,SAASC,2BAAT,GAAuC;AACrD,QAAM;AAAEC,IAAAA;AAAF,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-main/index.js"],"names":["__experimentalItemGroup","ItemGroup","__experimentalNavigatorButton","NavigatorButton","__experimentalUseNavigator","useNavigator","__","layout","symbol","navigation","styles","page","useDispatch","useEffect","SidebarNavigationScreen","SidebarNavigationItem","SidebarNavigationItemGlobalStyles","unlock","store","editSiteStore","TemplatePartHint","SidebarNavigationScreenMain","location","setEditorCanvasContainerView","path","undefined"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,uBAAuB,IAAIC,SAD5B,EAECC,6BAA6B,IAAIC,eAFlC,EAGCC,0BAA0B,IAAIC,YAH/B,QAIO,uBAJP;AAKA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,MAAT,EAAiBC,MAAjB,EAAyBC,UAAzB,EAAqCC,MAArC,EAA6CC,IAA7C,QAAyD,kBAAzD;AACA,SAASC,WAAT,QAA4B,iBAA5B;AAEA,SAASC,SAAT,QAA0B,oBAA1B;AAEA;AACA;AACA;;AACA,OAAOC,uBAAP,MAAoC,8BAApC;AACA,OAAOC,qBAAP,MAAkC,4BAAlC;AACA,SAASC,iCAAT,QAAkD,4CAAlD;AACA,SAASC,MAAT,QAAuB,mBAAvB;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AACA,OAAOC,gBAAP,MAA6B,sBAA7B;AAEA,eAAe,SAASC,2BAAT,GAAuC;AACrD,QAAM;AAAEC,IAAAA;AAAF,MAAejB,YAAY,EAAjC;AACA,QAAM;AAAEkB,IAAAA;AAAF,MAAmCN,MAAM,CAC9CL,WAAW,CAAEO,aAAF,CADmC,CAA/C,CAFqD,CAMrD;;AACAN,EAAAA,SAAS,CAAE,MAAM;AAChB,QAAKS,QAAQ,EAAEE,IAAV,KAAmB,GAAxB,EAA8B;AAC7BD,MAAAA,4BAA4B,CAAEE,SAAF,CAA5B;AACA;AACD,GAJQ,EAIN,CAAEF,4BAAF,EAAgCD,QAAQ,EAAEE,IAA1C,CAJM,CAAT;AAMA,SACC,cAAC,uBAAD;AACC,IAAA,MAAM,MADP;AAEC,IAAA,KAAK,EAAGlB,EAAE,CAAE,QAAF,CAFX;AAGC,IAAA,WAAW,EAAGA,EAAE,CACf,kEADe,CAHjB;AAMC,IAAA,OAAO,EACN,8BACC,cAAC,SAAD,QACC,cAAC,eAAD;AACC,MAAA,EAAE,EAAGS,qBADN;AAEC,MAAA,IAAI,EAAC,aAFN;AAGC,MAAA,WAAW,MAHZ;AAIC,MAAA,IAAI,EAAGN;AAJR,OAMGH,EAAE,CAAE,YAAF,CANL,CADD,EASC,cAAC,iCAAD;AACC,MAAA,WAAW,MADZ;AAEC,MAAA,IAAI,EAAGI;AAFR,OAIGJ,EAAE,CAAE,QAAF,CAJL,CATD,EAeC,cAAC,eAAD;AACC,MAAA,EAAE,EAAGS,qBADN;AAEC,MAAA,IAAI,EAAC,OAFN;AAGC,MAAA,WAAW,MAHZ;AAIC,MAAA,IAAI,EAAGJ;AAJR,OAMGL,EAAE,CAAE,OAAF,CANL,CAfD,EAuBC,cAAC,eAAD;AACC,MAAA,EAAE,EAAGS,qBADN;AAEC,MAAA,IAAI,EAAC,cAFN;AAGC,MAAA,WAAW,MAHZ;AAIC,MAAA,IAAI,EAAGR;AAJR,OAMGD,EAAE,CAAE,WAAF,CANL,CAvBD,EA+BC,cAAC,eAAD;AACC,MAAA,EAAE,EAAGS,qBADN;AAEC,MAAA,IAAI,EAAC,WAFN;AAGC,MAAA,WAAW,MAHZ;AAIC,MAAA,IAAI,EAAGP;AAJR,OAMGF,EAAE,CAAE,UAAF,CANL,CA/BD,CADD,EAyCC,cAAC,gBAAD,OAzCD;AAPF,IADD;AAsDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalNavigatorButton as NavigatorButton,\n\t__experimentalUseNavigator as useNavigator,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { layout, symbol, navigation, styles, page } from '@wordpress/icons';\nimport { useDispatch } from '@wordpress/data';\n\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { SidebarNavigationItemGlobalStyles } from '../sidebar-navigation-screen-global-styles';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport TemplatePartHint from './template-part-hint';\n\nexport default function SidebarNavigationScreenMain() {\n\tconst { location } = useNavigator();\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\n\t// Clear the editor canvas container view when accessing the main navigation screen.\n\tuseEffect( () => {\n\t\tif ( location?.path === '/' ) {\n\t\t\tsetEditorCanvasContainerView( undefined );\n\t\t}\n\t}, [ setEditorCanvasContainerView, location?.path ] );\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tisRoot\n\t\t\ttitle={ __( 'Design' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Customize the appearance of your website using the block editor.'\n\t\t\t) }\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t<NavigatorButton\n\t\t\t\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\t\t\t\tpath=\"/navigation\"\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ navigation }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Navigation' ) }\n\t\t\t\t\t\t</NavigatorButton>\n\t\t\t\t\t\t<SidebarNavigationItemGlobalStyles\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ styles }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Styles' ) }\n\t\t\t\t\t\t</SidebarNavigationItemGlobalStyles>\n\t\t\t\t\t\t<NavigatorButton\n\t\t\t\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\t\t\t\tpath=\"/page\"\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ page }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Pages' ) }\n\t\t\t\t\t\t</NavigatorButton>\n\t\t\t\t\t\t<NavigatorButton\n\t\t\t\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\t\t\t\tpath=\"/wp_template\"\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ layout }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Templates' ) }\n\t\t\t\t\t\t</NavigatorButton>\n\t\t\t\t\t\t<NavigatorButton\n\t\t\t\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\t\t\t\tpath=\"/patterns\"\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ symbol }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Patterns' ) }\n\t\t\t\t\t\t</NavigatorButton>\n\t\t\t\t\t</ItemGroup>\n\t\t\t\t\t<TemplatePartHint />\n\t\t\t\t</>\n\t\t\t}\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { Notice } from '@wordpress/components';
|
|
7
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
8
|
+
import { __ } from '@wordpress/i18n';
|
|
9
|
+
import { store as preferencesStore } from '@wordpress/preferences';
|
|
10
|
+
const PREFERENCE_NAME = 'isTemplatePartMoveHintVisible';
|
|
11
|
+
export default function TemplatePartHint() {
|
|
12
|
+
const showTemplatePartHint = useSelect(select => {
|
|
13
|
+
var _select$get;
|
|
14
|
+
|
|
15
|
+
return (_select$get = select(preferencesStore).get('core', PREFERENCE_NAME)) !== null && _select$get !== void 0 ? _select$get : true;
|
|
16
|
+
}, []);
|
|
17
|
+
const {
|
|
18
|
+
set: setPreference
|
|
19
|
+
} = useDispatch(preferencesStore);
|
|
20
|
+
|
|
21
|
+
if (!showTemplatePartHint) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return createElement(Notice, {
|
|
26
|
+
politeness: "polite",
|
|
27
|
+
className: "edit-site-sidebar__notice",
|
|
28
|
+
onRemove: () => {
|
|
29
|
+
setPreference('core', PREFERENCE_NAME, false);
|
|
30
|
+
}
|
|
31
|
+
}, __('Looking for template parts? Find them in "Patterns".'));
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=template-part-hint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-main/template-part-hint.js"],"names":["Notice","useDispatch","useSelect","__","store","preferencesStore","PREFERENCE_NAME","TemplatePartHint","showTemplatePartHint","select","get","set","setPreference"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,QAAuB,uBAAvB;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,wBAA1C;AAEA,MAAMC,eAAe,GAAG,+BAAxB;AAEA,eAAe,SAASC,gBAAT,GAA4B;AAC1C,QAAMC,oBAAoB,GAAGN,SAAS,CACnCO,MAAF;AAAA;;AAAA,0BACCA,MAAM,CAAEJ,gBAAF,CAAN,CAA2BK,GAA3B,CAAgC,MAAhC,EAAwCJ,eAAxC,CADD,qDAC8D,IAD9D;AAAA,GADqC,EAGrC,EAHqC,CAAtC;AAMA,QAAM;AAAEK,IAAAA,GAAG,EAAEC;AAAP,MAAyBX,WAAW,CAAEI,gBAAF,CAA1C;;AACA,MAAK,CAAEG,oBAAP,EAA8B;AAC7B,WAAO,IAAP;AACA;;AAED,SACC,cAAC,MAAD;AACC,IAAA,UAAU,EAAC,QADZ;AAEC,IAAA,SAAS,EAAC,2BAFX;AAGC,IAAA,QAAQ,EAAG,MAAM;AAChBI,MAAAA,aAAa,CAAE,MAAF,EAAUN,eAAV,EAA2B,KAA3B,CAAb;AACA;AALF,KAOGH,EAAE,CAAE,sDAAF,CAPL,CADD;AAWA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Notice } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\nconst PREFERENCE_NAME = 'isTemplatePartMoveHintVisible';\n\nexport default function TemplatePartHint() {\n\tconst showTemplatePartHint = useSelect(\n\t\t( select ) =>\n\t\t\tselect( preferencesStore ).get( 'core', PREFERENCE_NAME ) ?? true,\n\t\t[]\n\t);\n\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\tif ( ! showTemplatePartHint ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Notice\n\t\t\tpoliteness=\"polite\"\n\t\t\tclassName=\"edit-site-sidebar__notice\"\n\t\t\tonRemove={ () => {\n\t\t\t\tsetPreference( 'core', PREFERENCE_NAME, false );\n\t\t\t} }\n\t\t>\n\t\t\t{ __( 'Looking for template parts? Find them in \"Patterns\".' ) }\n\t\t</Notice>\n\t);\n}\n"]}
|
|
@@ -3,31 +3,22 @@ import { createElement } from "@wordpress/element";
|
|
|
3
3
|
/**
|
|
4
4
|
* WordPress dependencies
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';
|
|
7
7
|
import { __ } from '@wordpress/i18n';
|
|
8
8
|
export default function RenameModal({
|
|
9
9
|
onClose,
|
|
10
10
|
onConfirm
|
|
11
11
|
}) {
|
|
12
|
-
return createElement(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}, createElement("form", null, createElement(VStack, {
|
|
16
|
-
spacing: "3"
|
|
17
|
-
}, createElement("p", null, __('Are you sure you want to delete this Navigation menu?')), createElement(HStack, {
|
|
18
|
-
justify: "right"
|
|
19
|
-
}, createElement(Button, {
|
|
20
|
-
variant: "tertiary",
|
|
21
|
-
onClick: onClose
|
|
22
|
-
}, __('Cancel')), createElement(Button, {
|
|
23
|
-
variant: "primary",
|
|
24
|
-
type: "submit",
|
|
25
|
-
onClick: e => {
|
|
12
|
+
return createElement(ConfirmDialog, {
|
|
13
|
+
isOpen: true,
|
|
14
|
+
onConfirm: e => {
|
|
26
15
|
e.preventDefault();
|
|
27
16
|
onConfirm(); // Immediate close avoids ability to hit delete multiple times.
|
|
28
17
|
|
|
29
18
|
onClose();
|
|
30
|
-
}
|
|
31
|
-
|
|
19
|
+
},
|
|
20
|
+
onCancel: onClose,
|
|
21
|
+
confirmButtonText: __('Delete')
|
|
22
|
+
}, __('Are you sure you want to delete this Navigation menu?'));
|
|
32
23
|
}
|
|
33
24
|
//# sourceMappingURL=delete-modal.js.map
|
package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/delete-modal.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/delete-modal.js"],"names":["__experimentalConfirmDialog","ConfirmDialog","__","RenameModal","onClose","onConfirm","e","preventDefault"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,2BAA2B,IAAIC,aAAxC,QAA6D,uBAA7D;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA,eAAe,SAASC,WAAT,CAAsB;AAAEC,EAAAA,OAAF;AAAWC,EAAAA;AAAX,CAAtB,EAA+C;AAC7D,SACC,cAAC,aAAD;AACC,IAAA,MAAM,EAAG,IADV;AAEC,IAAA,SAAS,EAAKC,CAAF,IAAS;AACpBA,MAAAA,CAAC,CAACC,cAAF;AACAF,MAAAA,SAAS,GAFW,CAIpB;;AACAD,MAAAA,OAAO;AACP,KARF;AASC,IAAA,QAAQ,EAAGA,OATZ;AAUC,IAAA,iBAAiB,EAAGF,EAAE,CAAE,QAAF;AAVvB,KAYGA,EAAE,CAAE,uDAAF,CAZL,CADD;AAgBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nexport default function RenameModal( { onClose, onConfirm } ) {\n\treturn (\n\t\t<ConfirmDialog\n\t\t\tisOpen={ true }\n\t\t\tonConfirm={ ( e ) => {\n\t\t\t\te.preventDefault();\n\t\t\t\tonConfirm();\n\n\t\t\t\t// Immediate close avoids ability to hit delete multiple times.\n\t\t\t\tonClose();\n\t\t\t} }\n\t\t\tonCancel={ onClose }\n\t\t\tconfirmButtonText={ __( 'Delete' ) }\n\t\t>\n\t\t\t{ __( 'Are you sure you want to delete this Navigation menu?' ) }\n\t\t</ConfirmDialog>\n\t);\n}\n"]}
|
|
@@ -4,21 +4,22 @@ import { createElement } from "@wordpress/element";
|
|
|
4
4
|
* WordPress dependencies
|
|
5
5
|
*/
|
|
6
6
|
import { __ } from '@wordpress/i18n';
|
|
7
|
-
import { useDispatch } from '@wordpress/data';
|
|
8
7
|
import { pencil } from '@wordpress/icons';
|
|
9
8
|
/**
|
|
10
9
|
* Internal dependencies
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
|
-
import { store as editSiteStore } from '../../store';
|
|
14
12
|
import SidebarButton from '../sidebar-button';
|
|
15
|
-
import {
|
|
16
|
-
export default function EditButton(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
import { useLink } from '../routes/link';
|
|
14
|
+
export default function EditButton({
|
|
15
|
+
postId
|
|
16
|
+
}) {
|
|
17
|
+
const linkInfo = useLink({
|
|
18
|
+
postId,
|
|
19
|
+
postType: 'wp_navigation',
|
|
20
|
+
canvas: 'edit'
|
|
21
|
+
});
|
|
22
|
+
return createElement(SidebarButton, { ...linkInfo,
|
|
22
23
|
label: __('Edit'),
|
|
23
24
|
icon: pencil
|
|
24
25
|
});
|
package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js"],"names":["__","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js"],"names":["__","pencil","SidebarButton","useLink","EditButton","postId","linkInfo","postType","canvas"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,MAAT,QAAuB,kBAAvB;AACA;AACA;AACA;;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AACA,SAASC,OAAT,QAAwB,gBAAxB;AAEA,eAAe,SAASC,UAAT,CAAqB;AAAEC,EAAAA;AAAF,CAArB,EAAkC;AAChD,QAAMC,QAAQ,GAAGH,OAAO,CAAE;AACzBE,IAAAA,MADyB;AAEzBE,IAAAA,QAAQ,EAAE,eAFe;AAGzBC,IAAAA,MAAM,EAAE;AAHiB,GAAF,CAAxB;AAKA,SACC,cAAC,aAAD,OAAoBF,QAApB;AAA+B,IAAA,KAAK,EAAGN,EAAE,CAAE,MAAF,CAAzC;AAAsD,IAAA,IAAI,EAAGC;AAA7D,IADD;AAGA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { pencil } from '@wordpress/icons';\n/**\n * Internal dependencies\n */\nimport SidebarButton from '../sidebar-button';\nimport { useLink } from '../routes/link';\n\nexport default function EditButton( { postId } ) {\n\tconst linkInfo = useLink( {\n\t\tpostId,\n\t\tpostType: 'wp_navigation',\n\t\tcanvas: 'edit',\n\t} );\n\treturn (\n\t\t<SidebarButton { ...linkInfo } label={ __( 'Edit' ) } icon={ pencil } />\n\t);\n}\n"]}
|
|
@@ -16,13 +16,14 @@ import { SidebarNavigationScreenWrapper } from '../sidebar-navigation-screen-nav
|
|
|
16
16
|
import ScreenNavigationMoreMenu from './more-menu';
|
|
17
17
|
import SingleNavigationMenu from './single-navigation-menu';
|
|
18
18
|
import useNavigationMenuHandlers from './use-navigation-menu-handlers';
|
|
19
|
+
import buildNavigationLabel from '../sidebar-navigation-screen-navigation-menus/build-navigation-label';
|
|
19
20
|
export const postType = `wp_navigation`;
|
|
20
21
|
export default function SidebarNavigationScreenNavigationMenu() {
|
|
21
22
|
const {
|
|
22
|
-
params
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
params
|
|
24
|
+
} = useNavigator(); // See https://github.com/WordPress/gutenberg/pull/52120.
|
|
25
|
+
|
|
26
|
+
const postId = Number(params?.postId);
|
|
26
27
|
const {
|
|
27
28
|
record: navigationMenu,
|
|
28
29
|
isResolving
|
|
@@ -33,13 +34,11 @@ export default function SidebarNavigationScreenNavigationMenu() {
|
|
|
33
34
|
} = useSelect(select => {
|
|
34
35
|
const {
|
|
35
36
|
isSavingEntityRecord,
|
|
36
|
-
isDeletingEntityRecord
|
|
37
|
-
getEditedEntityRecord: getEditedEntityRecordSelector
|
|
37
|
+
isDeletingEntityRecord
|
|
38
38
|
} = select(coreStore);
|
|
39
39
|
return {
|
|
40
40
|
isSaving: isSavingEntityRecord('postType', postType, postId),
|
|
41
|
-
isDeleting: isDeletingEntityRecord('postType', postType, postId)
|
|
42
|
-
getEditedEntityRecord: getEditedEntityRecordSelector
|
|
41
|
+
isDeleting: isDeletingEntityRecord('postType', postType, postId)
|
|
43
42
|
};
|
|
44
43
|
}, [postId]);
|
|
45
44
|
const isLoading = isResolving || isSaving || isDeleting;
|
|
@@ -52,7 +51,7 @@ export default function SidebarNavigationScreenNavigationMenu() {
|
|
|
52
51
|
|
|
53
52
|
const _handleDelete = () => handleDelete(navigationMenu);
|
|
54
53
|
|
|
55
|
-
const _handleSave =
|
|
54
|
+
const _handleSave = edits => handleSave(navigationMenu, edits);
|
|
56
55
|
|
|
57
56
|
const _handleDuplicate = () => handleDuplicate(navigationMenu);
|
|
58
57
|
|
|
@@ -78,7 +77,7 @@ export default function SidebarNavigationScreenNavigationMenu() {
|
|
|
78
77
|
onSave: _handleSave,
|
|
79
78
|
onDuplicate: _handleDuplicate
|
|
80
79
|
}),
|
|
81
|
-
title:
|
|
80
|
+
title: buildNavigationLabel(navigationMenu?.title, navigationMenu?.id, navigationMenu?.status),
|
|
82
81
|
description: __('This Navigation Menu is empty.')
|
|
83
82
|
});
|
|
84
83
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/index.js"],"names":["useEntityRecord","store","coreStore","__experimentalUseNavigator","useNavigator","Spinner","__","useSelect","decodeEntities","SidebarNavigationScreenWrapper","ScreenNavigationMoreMenu","SingleNavigationMenu","useNavigationMenuHandlers","postType","SidebarNavigationScreenNavigationMenu","params","postId","record","navigationMenu","isResolving","isSaving","isDeleting","select","isSavingEntityRecord","isDeletingEntityRecord","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/index.js"],"names":["useEntityRecord","store","coreStore","__experimentalUseNavigator","useNavigator","Spinner","__","useSelect","decodeEntities","SidebarNavigationScreenWrapper","ScreenNavigationMoreMenu","SingleNavigationMenu","useNavigationMenuHandlers","buildNavigationLabel","postType","SidebarNavigationScreenNavigationMenu","params","postId","Number","record","navigationMenu","isResolving","isSaving","isDeleting","select","isSavingEntityRecord","isDeletingEntityRecord","isLoading","menuTitle","title","rendered","slug","handleSave","handleDelete","handleDuplicate","_handleDelete","_handleSave","edits","_handleDuplicate","content","raw","id","status"],"mappings":"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","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEntityRecord, store as coreStore } from '@wordpress/core-data';\nimport {\n\t__experimentalUseNavigator as useNavigator,\n\tSpinner,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { SidebarNavigationScreenWrapper } from '../sidebar-navigation-screen-navigation-menus';\nimport ScreenNavigationMoreMenu from './more-menu';\nimport SingleNavigationMenu from './single-navigation-menu';\nimport useNavigationMenuHandlers from './use-navigation-menu-handlers';\nimport buildNavigationLabel from '../sidebar-navigation-screen-navigation-menus/build-navigation-label';\n\nexport const postType = `wp_navigation`;\n\nexport default function SidebarNavigationScreenNavigationMenu() {\n\tconst { params } = useNavigator();\n\n\t// See https://github.com/WordPress/gutenberg/pull/52120.\n\tconst postId = Number( params?.postId );\n\n\tconst { record: navigationMenu, isResolving } = useEntityRecord(\n\t\t'postType',\n\t\tpostType,\n\t\tpostId\n\t);\n\n\tconst { isSaving, isDeleting } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { isSavingEntityRecord, isDeletingEntityRecord } =\n\t\t\t\tselect( coreStore );\n\n\t\t\treturn {\n\t\t\t\tisSaving: isSavingEntityRecord( 'postType', postType, postId ),\n\t\t\t\tisDeleting: isDeletingEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ postId ]\n\t);\n\n\tconst isLoading = isResolving || isSaving || isDeleting;\n\n\tconst menuTitle = navigationMenu?.title?.rendered || navigationMenu?.slug;\n\n\tconst { handleSave, handleDelete, handleDuplicate } =\n\t\tuseNavigationMenuHandlers();\n\n\tconst _handleDelete = () => handleDelete( navigationMenu );\n\tconst _handleSave = ( edits ) => handleSave( navigationMenu, edits );\n\tconst _handleDuplicate = () => handleDuplicate( navigationMenu );\n\n\tif ( isLoading ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Navigation menus are a curated collection of blocks that allow visitors to get around your site.'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<Spinner className=\"edit-site-sidebar-navigation-screen-navigation-menus__loading\" />\n\t\t\t</SidebarNavigationScreenWrapper>\n\t\t);\n\t}\n\n\tif ( ! isLoading && ! navigationMenu ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tdescription={ __( 'Navigation Menu missing.' ) }\n\t\t\t/>\n\t\t);\n\t}\n\n\tif ( ! navigationMenu?.content?.raw ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tactions={\n\t\t\t\t\t<ScreenNavigationMoreMenu\n\t\t\t\t\t\tmenuTitle={ decodeEntities( menuTitle ) }\n\t\t\t\t\t\tonDelete={ _handleDelete }\n\t\t\t\t\t\tonSave={ _handleSave }\n\t\t\t\t\t\tonDuplicate={ _handleDuplicate }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t\ttitle={ buildNavigationLabel(\n\t\t\t\t\tnavigationMenu?.title,\n\t\t\t\t\tnavigationMenu?.id,\n\t\t\t\t\tnavigationMenu?.status\n\t\t\t\t) }\n\t\t\t\tdescription={ __( 'This Navigation Menu is empty.' ) }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<SingleNavigationMenu\n\t\t\tnavigationMenu={ navigationMenu }\n\t\t\thandleDelete={ _handleDelete }\n\t\t\thandleSave={ _handleSave }\n\t\t\thandleDuplicate={ _handleDuplicate }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -37,6 +37,7 @@ export default function ScreenNavigationMoreMenu(props) {
|
|
|
37
37
|
|
|
38
38
|
return createElement(Fragment, null, createElement(DropdownMenu, {
|
|
39
39
|
className: "sidebar-navigation__more-menu",
|
|
40
|
+
label: __('Actions'),
|
|
40
41
|
icon: moreVertical,
|
|
41
42
|
popoverProps: POPOVER_PROPS
|
|
42
43
|
}, ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js"],"names":["DropdownMenu","MenuItem","MenuGroup","moreVertical","__","useState","RenameModal","DeleteModal","POPOVER_PROPS","position","ScreenNavigationMoreMenu","props","onDelete","onSave","onDuplicate","menuTitle","renameModalOpen","setRenameModalOpen","deleteModalOpen","setDeleteModalOpen","closeModals","openRenameModal","openDeleteModal","onClose"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,YAAT,EAAuBC,QAAvB,EAAiCC,SAAjC,QAAkD,uBAAlD;AACA,SAASC,YAAT,QAA6B,kBAA7B;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,QAAT,QAAyB,oBAAzB;AAEA;AACA;AACA;;AACA,OAAOC,WAAP,MAAwB,gBAAxB;AACA,OAAOC,WAAP,MAAwB,gBAAxB;AAEA,MAAMC,aAAa,GAAG;AACrBC,EAAAA,QAAQ,EAAE;AADW,CAAtB;AAIA,eAAe,SAASC,wBAAT,CAAmCC,KAAnC,EAA2C;AACzD,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,MAAZ;AAAoBC,IAAAA,WAApB;AAAiCC,IAAAA;AAAjC,MAA+CJ,KAArD;AAEA,QAAM,CAAEK,eAAF,EAAmBC,kBAAnB,IAA0CZ,QAAQ,CAAE,KAAF,CAAxD;AACA,QAAM,CAAEa,eAAF,EAAmBC,kBAAnB,IAA0Cd,QAAQ,CAAE,KAAF,CAAxD;;AAEA,QAAMe,WAAW,GAAG,MAAM;AACzBH,IAAAA,kBAAkB,CAAE,KAAF,CAAlB;AACAE,IAAAA,kBAAkB,CAAE,KAAF,CAAlB;AACA,GAHD;;AAIA,QAAME,eAAe,GAAG,MAAMJ,kBAAkB,CAAE,IAAF,CAAhD;;AACA,QAAMK,eAAe,GAAG,MAAMH,kBAAkB,CAAE,IAAF,CAAhD;;AAEA,SACC,8BACC,cAAC,YAAD;AACC,IAAA,SAAS,EAAC,+BADX;AAEC,IAAA,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js"],"names":["DropdownMenu","MenuItem","MenuGroup","moreVertical","__","useState","RenameModal","DeleteModal","POPOVER_PROPS","position","ScreenNavigationMoreMenu","props","onDelete","onSave","onDuplicate","menuTitle","renameModalOpen","setRenameModalOpen","deleteModalOpen","setDeleteModalOpen","closeModals","openRenameModal","openDeleteModal","onClose"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,YAAT,EAAuBC,QAAvB,EAAiCC,SAAjC,QAAkD,uBAAlD;AACA,SAASC,YAAT,QAA6B,kBAA7B;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,QAAT,QAAyB,oBAAzB;AAEA;AACA;AACA;;AACA,OAAOC,WAAP,MAAwB,gBAAxB;AACA,OAAOC,WAAP,MAAwB,gBAAxB;AAEA,MAAMC,aAAa,GAAG;AACrBC,EAAAA,QAAQ,EAAE;AADW,CAAtB;AAIA,eAAe,SAASC,wBAAT,CAAmCC,KAAnC,EAA2C;AACzD,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA,MAAZ;AAAoBC,IAAAA,WAApB;AAAiCC,IAAAA;AAAjC,MAA+CJ,KAArD;AAEA,QAAM,CAAEK,eAAF,EAAmBC,kBAAnB,IAA0CZ,QAAQ,CAAE,KAAF,CAAxD;AACA,QAAM,CAAEa,eAAF,EAAmBC,kBAAnB,IAA0Cd,QAAQ,CAAE,KAAF,CAAxD;;AAEA,QAAMe,WAAW,GAAG,MAAM;AACzBH,IAAAA,kBAAkB,CAAE,KAAF,CAAlB;AACAE,IAAAA,kBAAkB,CAAE,KAAF,CAAlB;AACA,GAHD;;AAIA,QAAME,eAAe,GAAG,MAAMJ,kBAAkB,CAAE,IAAF,CAAhD;;AACA,QAAMK,eAAe,GAAG,MAAMH,kBAAkB,CAAE,IAAF,CAAhD;;AAEA,SACC,8BACC,cAAC,YAAD;AACC,IAAA,SAAS,EAAC,+BADX;AAEC,IAAA,KAAK,EAAGf,EAAE,CAAE,SAAF,CAFX;AAGC,IAAA,IAAI,EAAGD,YAHR;AAIC,IAAA,YAAY,EAAGK;AAJhB,KAMG,CAAE;AAAEe,IAAAA;AAAF,GAAF,KACD,2BACC,cAAC,SAAD,QACC,cAAC,QAAD;AACC,IAAA,OAAO,EAAG,MAAM;AACfF,MAAAA,eAAe,GADA,CAEf;;AACAE,MAAAA,OAAO;AACP;AALF,KAOGnB,EAAE,CAAE,QAAF,CAPL,CADD,EAUC,cAAC,QAAD;AACC,IAAA,OAAO,EAAG,MAAM;AACfU,MAAAA,WAAW;AACXS,MAAAA,OAAO;AACP;AAJF,KAMGnB,EAAE,CAAE,WAAF,CANL,CAVD,CADD,EAoBC,cAAC,SAAD,QACC,cAAC,QAAD;AACC,IAAA,OAAO,EAAG,MAAM;AACfkB,MAAAA,eAAe,GADA,CAGf;;AACAC,MAAAA,OAAO;AACP;AANF,KAQGnB,EAAE,CAAE,QAAF,CARL,CADD,CApBD,CAPF,CADD,EA4CGc,eAAe,IAChB,cAAC,WAAD;AAAa,IAAA,OAAO,EAAGE,WAAvB;AAAqC,IAAA,SAAS,EAAGR;AAAjD,IA7CF,EAgDGI,eAAe,IAChB,cAAC,WAAD;AACC,IAAA,OAAO,EAAGI,WADX;AAEC,IAAA,SAAS,EAAGL,SAFb;AAGC,IAAA,MAAM,EAAGF;AAHV,IAjDF,CADD;AA0DA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { DropdownMenu, MenuItem, MenuGroup } from '@wordpress/components';\nimport { moreVertical } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport RenameModal from './rename-modal';\nimport DeleteModal from './delete-modal';\n\nconst POPOVER_PROPS = {\n\tposition: 'bottom right',\n};\n\nexport default function ScreenNavigationMoreMenu( props ) {\n\tconst { onDelete, onSave, onDuplicate, menuTitle } = props;\n\n\tconst [ renameModalOpen, setRenameModalOpen ] = useState( false );\n\tconst [ deleteModalOpen, setDeleteModalOpen ] = useState( false );\n\n\tconst closeModals = () => {\n\t\tsetRenameModalOpen( false );\n\t\tsetDeleteModalOpen( false );\n\t};\n\tconst openRenameModal = () => setRenameModalOpen( true );\n\tconst openDeleteModal = () => setDeleteModalOpen( true );\n\n\treturn (\n\t\t<>\n\t\t\t<DropdownMenu\n\t\t\t\tclassName=\"sidebar-navigation__more-menu\"\n\t\t\t\tlabel={ __( 'Actions' ) }\n\t\t\t\ticon={ moreVertical }\n\t\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\t>\n\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\topenRenameModal();\n\t\t\t\t\t\t\t\t\t// Close the dropdown after opening the modal.\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Rename' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonDuplicate();\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Duplicate' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\topenDeleteModal();\n\n\t\t\t\t\t\t\t\t\t// Close the dropdown after opening the modal.\n\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Delete' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t</div>\n\t\t\t\t) }\n\t\t\t</DropdownMenu>\n\n\t\t\t{ deleteModalOpen && (\n\t\t\t\t<DeleteModal onClose={ closeModals } onConfirm={ onDelete } />\n\t\t\t) }\n\n\t\t\t{ renameModalOpen && (\n\t\t\t\t<RenameModal\n\t\t\t\t\tonClose={ closeModals }\n\t\t\t\t\tmenuTitle={ menuTitle }\n\t\t\t\t\tonSave={ onSave }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -6,12 +6,17 @@ import { createElement } from "@wordpress/element";
|
|
|
6
6
|
import { __experimentalHStack as HStack, __experimentalVStack as VStack, Button, TextControl, Modal } from '@wordpress/components';
|
|
7
7
|
import { __ } from '@wordpress/i18n';
|
|
8
8
|
import { useState } from '@wordpress/element';
|
|
9
|
+
|
|
10
|
+
const notEmptyString = testString => testString?.trim()?.length > 0;
|
|
11
|
+
|
|
9
12
|
export default function RenameModal({
|
|
10
13
|
menuTitle,
|
|
11
14
|
onClose,
|
|
12
15
|
onSave
|
|
13
16
|
}) {
|
|
14
17
|
const [editedMenuTitle, setEditedMenuTitle] = useState(menuTitle);
|
|
18
|
+
const titleHasChanged = editedMenuTitle !== menuTitle;
|
|
19
|
+
const isEditedMenuTitleValid = titleHasChanged && notEmptyString(editedMenuTitle);
|
|
15
20
|
return createElement(Modal, {
|
|
16
21
|
title: __('Rename'),
|
|
17
22
|
onRequestClose: onClose
|
|
@@ -30,11 +35,16 @@ export default function RenameModal({
|
|
|
30
35
|
variant: "tertiary",
|
|
31
36
|
onClick: onClose
|
|
32
37
|
}, __('Cancel')), createElement(Button, {
|
|
33
|
-
disabled:
|
|
38
|
+
disabled: !isEditedMenuTitleValid,
|
|
34
39
|
variant: "primary",
|
|
35
40
|
type: "submit",
|
|
36
41
|
onClick: e => {
|
|
37
42
|
e.preventDefault();
|
|
43
|
+
|
|
44
|
+
if (!isEditedMenuTitleValid) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
38
48
|
onSave({
|
|
39
49
|
title: editedMenuTitle
|
|
40
50
|
}); // Immediate close avoids ability to hit save multiple times.
|
package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js"],"names":["__experimentalHStack","HStack","__experimentalVStack","VStack","Button","TextControl","Modal","__","useState","RenameModal","menuTitle","onClose","onSave","editedMenuTitle","setEditedMenuTitle","e","preventDefault","title"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,oBAAoB,IAAIC,MADzB,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,MAHD,EAICC,WAJD,EAKCC,KALD,QAMO,uBANP;AAOA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,QAAT,QAAyB,oBAAzB
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js"],"names":["__experimentalHStack","HStack","__experimentalVStack","VStack","Button","TextControl","Modal","__","useState","notEmptyString","testString","trim","length","RenameModal","menuTitle","onClose","onSave","editedMenuTitle","setEditedMenuTitle","titleHasChanged","isEditedMenuTitleValid","e","preventDefault","title"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,oBAAoB,IAAIC,MADzB,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,MAHD,EAICC,WAJD,EAKCC,KALD,QAMO,uBANP;AAOA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,QAAT,QAAyB,oBAAzB;;AAEA,MAAMC,cAAc,GAAKC,UAAF,IAAkBA,UAAU,EAAEC,IAAZ,IAAoBC,MAApB,GAA6B,CAAtE;;AAEA,eAAe,SAASC,WAAT,CAAsB;AAAEC,EAAAA,SAAF;AAAaC,EAAAA,OAAb;AAAsBC,EAAAA;AAAtB,CAAtB,EAAuD;AACrE,QAAM,CAAEC,eAAF,EAAmBC,kBAAnB,IAA0CV,QAAQ,CAAEM,SAAF,CAAxD;AAEA,QAAMK,eAAe,GAAGF,eAAe,KAAKH,SAA5C;AAEA,QAAMM,sBAAsB,GAC3BD,eAAe,IAAIV,cAAc,CAAEQ,eAAF,CADlC;AAGA,SACC,cAAC,KAAD;AAAO,IAAA,KAAK,EAAGV,EAAE,CAAE,QAAF,CAAjB;AAAgC,IAAA,cAAc,EAAGQ;AAAjD,KACC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,cAAC,WAAD;AACC,IAAA,uBAAuB,MADxB;AAEC,IAAA,KAAK,EAAGE,eAFT;AAGC,IAAA,WAAW,EAAGV,EAAE,CAAE,kBAAF,CAHjB;AAIC,IAAA,QAAQ,EAAGW;AAJZ,IADD,EAOC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAC;AAAhB,KACC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAC,UAAhB;AAA2B,IAAA,OAAO,EAAGH;AAArC,KACGR,EAAE,CAAE,QAAF,CADL,CADD,EAKC,cAAC,MAAD;AACC,IAAA,QAAQ,EAAG,CAAEa,sBADd;AAEC,IAAA,OAAO,EAAC,SAFT;AAGC,IAAA,IAAI,EAAC,QAHN;AAIC,IAAA,OAAO,EAAKC,CAAF,IAAS;AAClBA,MAAAA,CAAC,CAACC,cAAF;;AAEA,UAAK,CAAEF,sBAAP,EAAgC;AAC/B;AACA;;AACDJ,MAAAA,MAAM,CAAE;AAAEO,QAAAA,KAAK,EAAEN;AAAT,OAAF,CAAN,CANkB,CAQlB;;AACAF,MAAAA,OAAO;AACP;AAdF,KAgBGR,EAAE,CAAE,MAAF,CAhBL,CALD,CAPD,CADD,CADD,CADD;AAsCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tButton,\n\tTextControl,\n\tModal,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState } from '@wordpress/element';\n\nconst notEmptyString = ( testString ) => testString?.trim()?.length > 0;\n\nexport default function RenameModal( { menuTitle, onClose, onSave } ) {\n\tconst [ editedMenuTitle, setEditedMenuTitle ] = useState( menuTitle );\n\n\tconst titleHasChanged = editedMenuTitle !== menuTitle;\n\n\tconst isEditedMenuTitleValid =\n\t\ttitleHasChanged && notEmptyString( editedMenuTitle );\n\n\treturn (\n\t\t<Modal title={ __( 'Rename' ) } onRequestClose={ onClose }>\n\t\t\t<form className=\"sidebar-navigation__rename-modal-form\">\n\t\t\t\t<VStack spacing=\"3\">\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\tvalue={ editedMenuTitle }\n\t\t\t\t\t\tplaceholder={ __( 'Navigation title' ) }\n\t\t\t\t\t\tonChange={ setEditedMenuTitle }\n\t\t\t\t\t/>\n\t\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t\t<Button variant=\"tertiary\" onClick={ onClose }>\n\t\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t\t</Button>\n\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tdisabled={ ! isEditedMenuTitleValid }\n\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\t\tonClick={ ( e ) => {\n\t\t\t\t\t\t\t\te.preventDefault();\n\n\t\t\t\t\t\t\t\tif ( ! isEditedMenuTitleValid ) {\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonSave( { title: editedMenuTitle } );\n\n\t\t\t\t\t\t\t\t// Immediate close avoids ability to hit save multiple times.\n\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Save' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</form>\n\t\t</Modal>\n\t);\n}\n"]}
|
package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createElement } from "@wordpress/element";
|
|
1
|
+
import { createElement, Fragment } from "@wordpress/element";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* WordPress dependencies
|
|
@@ -12,6 +12,8 @@ import { decodeEntities } from '@wordpress/html-entities';
|
|
|
12
12
|
import { SidebarNavigationScreenWrapper } from '../sidebar-navigation-screen-navigation-menus';
|
|
13
13
|
import ScreenNavigationMoreMenu from './more-menu';
|
|
14
14
|
import NavigationMenuEditor from './navigation-menu-editor';
|
|
15
|
+
import buildNavigationLabel from '../sidebar-navigation-screen-navigation-menus/build-navigation-label';
|
|
16
|
+
import EditButton from './edit-button';
|
|
15
17
|
export default function SingleNavigationMenu({
|
|
16
18
|
navigationMenu,
|
|
17
19
|
handleDelete,
|
|
@@ -20,13 +22,15 @@ export default function SingleNavigationMenu({
|
|
|
20
22
|
}) {
|
|
21
23
|
const menuTitle = navigationMenu?.title?.rendered;
|
|
22
24
|
return createElement(SidebarNavigationScreenWrapper, {
|
|
23
|
-
actions: createElement(ScreenNavigationMoreMenu, {
|
|
25
|
+
actions: createElement(Fragment, null, createElement(ScreenNavigationMoreMenu, {
|
|
24
26
|
menuTitle: decodeEntities(menuTitle),
|
|
25
27
|
onDelete: handleDelete,
|
|
26
28
|
onSave: handleSave,
|
|
27
29
|
onDuplicate: handleDuplicate
|
|
28
|
-
}),
|
|
29
|
-
|
|
30
|
+
}), createElement(EditButton, {
|
|
31
|
+
postId: navigationMenu?.id
|
|
32
|
+
})),
|
|
33
|
+
title: buildNavigationLabel(navigationMenu?.title, navigationMenu?.id, navigationMenu?.status),
|
|
30
34
|
description: __('Navigation menus are a curated collection of blocks that allow visitors to get around your site.')
|
|
31
35
|
}, createElement(NavigationMenuEditor, {
|
|
32
36
|
navigationMenuId: navigationMenu?.id
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js"],"names":["__","decodeEntities","SidebarNavigationScreenWrapper","ScreenNavigationMoreMenu","NavigationMenuEditor","SingleNavigationMenu","navigationMenu","handleDelete","handleDuplicate","handleSave","menuTitle","title","rendered","id"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,cAAT,QAA+B,0BAA/B;AACA;AACA;AACA;;AACA,SAASC,8BAAT,QAA+C,+CAA/C;AACA,OAAOC,wBAAP,MAAqC,aAArC;AACA,OAAOC,oBAAP,MAAiC,0BAAjC;AAEA,eAAe,SAASC,oBAAT,CAA+B;AAC7CC,EAAAA,cAD6C;AAE7CC,EAAAA,YAF6C;AAG7CC,EAAAA,eAH6C;AAI7CC,EAAAA;AAJ6C,CAA/B,EAKX;AACH,QAAMC,SAAS,GAAGJ,cAAc,EAAEK,KAAhB,EAAuBC,QAAzC;AAEA,SACC,cAAC,8BAAD;AACC,IAAA,OAAO,EACN,cAAC,wBAAD;AACC,MAAA,SAAS,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js"],"names":["__","decodeEntities","SidebarNavigationScreenWrapper","ScreenNavigationMoreMenu","NavigationMenuEditor","buildNavigationLabel","EditButton","SingleNavigationMenu","navigationMenu","handleDelete","handleDuplicate","handleSave","menuTitle","title","rendered","id","status"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,cAAT,QAA+B,0BAA/B;AACA;AACA;AACA;;AACA,SAASC,8BAAT,QAA+C,+CAA/C;AACA,OAAOC,wBAAP,MAAqC,aAArC;AACA,OAAOC,oBAAP,MAAiC,0BAAjC;AACA,OAAOC,oBAAP,MAAiC,sEAAjC;AACA,OAAOC,UAAP,MAAuB,eAAvB;AAEA,eAAe,SAASC,oBAAT,CAA+B;AAC7CC,EAAAA,cAD6C;AAE7CC,EAAAA,YAF6C;AAG7CC,EAAAA,eAH6C;AAI7CC,EAAAA;AAJ6C,CAA/B,EAKX;AACH,QAAMC,SAAS,GAAGJ,cAAc,EAAEK,KAAhB,EAAuBC,QAAzC;AAEA,SACC,cAAC,8BAAD;AACC,IAAA,OAAO,EACN,8BACC,cAAC,wBAAD;AACC,MAAA,SAAS,EAAGb,cAAc,CAAEW,SAAF,CAD3B;AAEC,MAAA,QAAQ,EAAGH,YAFZ;AAGC,MAAA,MAAM,EAAGE,UAHV;AAIC,MAAA,WAAW,EAAGD;AAJf,MADD,EAOC,cAAC,UAAD;AAAY,MAAA,MAAM,EAAGF,cAAc,EAAEO;AAArC,MAPD,CAFF;AAYC,IAAA,KAAK,EAAGV,oBAAoB,CAC3BG,cAAc,EAAEK,KADW,EAE3BL,cAAc,EAAEO,EAFW,EAG3BP,cAAc,EAAEQ,MAHW,CAZ7B;AAiBC,IAAA,WAAW,EAAGhB,EAAE,CACf,kGADe;AAjBjB,KAqBC,cAAC,oBAAD;AAAsB,IAAA,gBAAgB,EAAGQ,cAAc,EAAEO;AAAzD,IArBD,CADD;AAyBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\n/**\n * Internal dependencies\n */\nimport { SidebarNavigationScreenWrapper } from '../sidebar-navigation-screen-navigation-menus';\nimport ScreenNavigationMoreMenu from './more-menu';\nimport NavigationMenuEditor from './navigation-menu-editor';\nimport buildNavigationLabel from '../sidebar-navigation-screen-navigation-menus/build-navigation-label';\nimport EditButton from './edit-button';\n\nexport default function SingleNavigationMenu( {\n\tnavigationMenu,\n\thandleDelete,\n\thandleDuplicate,\n\thandleSave,\n} ) {\n\tconst menuTitle = navigationMenu?.title?.rendered;\n\n\treturn (\n\t\t<SidebarNavigationScreenWrapper\n\t\t\tactions={\n\t\t\t\t<>\n\t\t\t\t\t<ScreenNavigationMoreMenu\n\t\t\t\t\t\tmenuTitle={ decodeEntities( menuTitle ) }\n\t\t\t\t\t\tonDelete={ handleDelete }\n\t\t\t\t\t\tonSave={ handleSave }\n\t\t\t\t\t\tonDuplicate={ handleDuplicate }\n\t\t\t\t\t/>\n\t\t\t\t\t<EditButton postId={ navigationMenu?.id } />\n\t\t\t\t</>\n\t\t\t}\n\t\t\ttitle={ buildNavigationLabel(\n\t\t\t\tnavigationMenu?.title,\n\t\t\t\tnavigationMenu?.id,\n\t\t\t\tnavigationMenu?.status\n\t\t\t) }\n\t\t\tdescription={ __(\n\t\t\t\t'Navigation menus are a curated collection of blocks that allow visitors to get around your site.'\n\t\t\t) }\n\t\t>\n\t\t\t<NavigationMenuEditor navigationMenuId={ navigationMenu?.id } />\n\t\t</SidebarNavigationScreenWrapper>\n\t);\n}\n"]}
|
|
@@ -62,22 +62,27 @@ function useSaveNavigationMenu() {
|
|
|
62
62
|
}, []);
|
|
63
63
|
const {
|
|
64
64
|
editEntityRecord,
|
|
65
|
-
|
|
65
|
+
__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits
|
|
66
66
|
} = useDispatch(coreStore);
|
|
67
67
|
const {
|
|
68
68
|
createSuccessNotice,
|
|
69
69
|
createErrorNotice
|
|
70
70
|
} = useDispatch(noticesStore);
|
|
71
71
|
|
|
72
|
-
const handleSave = async (navigationMenu, edits
|
|
72
|
+
const handleSave = async (navigationMenu, edits) => {
|
|
73
|
+
if (!edits) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
|
|
73
77
|
const postId = navigationMenu?.id; // Prepare for revert in case of error.
|
|
74
78
|
|
|
75
79
|
const originalRecord = getEditedEntityRecord('postType', 'wp_navigation', postId); // Apply the edits.
|
|
76
80
|
|
|
77
|
-
editEntityRecord('postType', postType, postId, edits);
|
|
81
|
+
editEntityRecord('postType', postType, postId, edits);
|
|
82
|
+
const recordPropertiesToSave = Object.keys(edits); // Attempt to persist.
|
|
78
83
|
|
|
79
84
|
try {
|
|
80
|
-
await
|
|
85
|
+
await saveSpecifiedEntityEdits('postType', postType, postId, recordPropertiesToSave, {
|
|
81
86
|
throwOnError: true
|
|
82
87
|
});
|
|
83
88
|
createSuccessNotice(__('Renamed Navigation menu'), {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js"],"names":["store","coreStore","__experimentalUseNavigator","useNavigator","__","sprintf","useSelect","useDispatch","noticesStore","postType","useDeleteNavigationMenu","goTo","deleteEntityRecord","createSuccessNotice","createErrorNotice","handleDelete","navigationMenu","postId","id","force","throwOnError","type","error","message","useSaveNavigationMenu","getEditedEntityRecord","select","getEditedEntityRecordSelector","editEntityRecord","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js"],"names":["store","coreStore","__experimentalUseNavigator","useNavigator","__","sprintf","useSelect","useDispatch","noticesStore","postType","useDeleteNavigationMenu","goTo","deleteEntityRecord","createSuccessNotice","createErrorNotice","handleDelete","navigationMenu","postId","id","force","throwOnError","type","error","message","useSaveNavigationMenu","getEditedEntityRecord","select","getEditedEntityRecordSelector","editEntityRecord","__experimentalSaveSpecifiedEntityEdits","saveSpecifiedEntityEdits","handleSave","edits","originalRecord","recordPropertiesToSave","Object","keys","useDuplicateNavigationMenu","saveEntityRecord","handleDuplicate","menuTitle","title","rendered","slug","savedRecord","content","raw","status","useNavigationMenuHandlers"],"mappings":"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","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __experimentalUseNavigator as useNavigator } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as noticesStore } from '@wordpress/notices';\n/**\n * Internal dependencies\n */\nimport { postType } from '.';\n\nfunction useDeleteNavigationMenu() {\n\tconst { goTo } = useNavigator();\n\n\tconst { deleteEntityRecord } = useDispatch( coreStore );\n\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst handleDelete = async ( navigationMenu ) => {\n\t\tconst postId = navigationMenu?.id;\n\t\ttry {\n\t\t\tawait deleteEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId,\n\t\t\t\t{\n\t\t\t\t\tforce: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\t\t\tcreateSuccessNotice( __( 'Deleted Navigation menu' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t\tgoTo( '/navigation' );\n\t\t} catch ( error ) {\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be deleted. */\n\t\t\t\t\t__( `Unable to delete Navigation menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleDelete;\n}\n\nfunction useSaveNavigationMenu() {\n\tconst { getEditedEntityRecord } = useSelect( ( select ) => {\n\t\tconst { getEditedEntityRecord: getEditedEntityRecordSelector } =\n\t\t\tselect( coreStore );\n\n\t\treturn {\n\t\t\tgetEditedEntityRecord: getEditedEntityRecordSelector,\n\t\t};\n\t}, [] );\n\n\tconst {\n\t\teditEntityRecord,\n\t\t__experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits,\n\t} = useDispatch( coreStore );\n\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst handleSave = async ( navigationMenu, edits ) => {\n\t\tif ( ! edits ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst postId = navigationMenu?.id;\n\t\t// Prepare for revert in case of error.\n\t\tconst originalRecord = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\t'wp_navigation',\n\t\t\tpostId\n\t\t);\n\n\t\t// Apply the edits.\n\t\teditEntityRecord( 'postType', postType, postId, edits );\n\n\t\tconst recordPropertiesToSave = Object.keys( edits );\n\n\t\t// Attempt to persist.\n\t\ttry {\n\t\t\tawait saveSpecifiedEntityEdits(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\tpostId,\n\t\t\t\trecordPropertiesToSave,\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\t\t\tcreateSuccessNotice( __( 'Renamed Navigation menu' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\t// Revert to original in case of error.\n\t\t\teditEntityRecord( 'postType', postType, postId, originalRecord );\n\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be renamed. */\n\t\t\t\t\t__( `Unable to rename Navigation menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleSave;\n}\n\nfunction useDuplicateNavigationMenu() {\n\tconst { goTo } = useNavigator();\n\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\tconst { createSuccessNotice, createErrorNotice } =\n\t\tuseDispatch( noticesStore );\n\n\tconst handleDuplicate = async ( navigationMenu ) => {\n\t\tconst menuTitle =\n\t\t\tnavigationMenu?.title?.rendered || navigationMenu?.slug;\n\n\t\ttry {\n\t\t\tconst savedRecord = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tpostType,\n\t\t\t\t{\n\t\t\t\t\ttitle: sprintf(\n\t\t\t\t\t\t/* translators: %s: Navigation menu title */\n\t\t\t\t\t\t__( '%s (Copy)' ),\n\t\t\t\t\t\tmenuTitle\n\t\t\t\t\t),\n\t\t\t\t\tcontent: navigationMenu?.content?.raw,\n\t\t\t\t\tstatus: 'publish',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tthrowOnError: true,\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tif ( savedRecord ) {\n\t\t\t\tcreateSuccessNotice( __( 'Duplicated Navigation menu' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\t\tgoTo( `/navigation/${ postType }/${ savedRecord.id }` );\n\t\t\t}\n\t\t} catch ( error ) {\n\t\t\tcreateErrorNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t/* translators: %s: error message describing why the navigation menu could not be deleted. */\n\t\t\t\t\t__( `Unable to duplicate Navigation menu (%s).` ),\n\t\t\t\t\terror?.message\n\t\t\t\t),\n\n\t\t\t\t{\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t};\n\n\treturn handleDuplicate;\n}\n\nexport default function useNavigationMenuHandlers() {\n\treturn {\n\t\thandleDelete: useDeleteNavigationMenu(),\n\t\thandleSave: useSaveNavigationMenu(),\n\t\thandleDuplicate: useDuplicateNavigationMenu(),\n\t};\n}\n"]}
|
package/build-module/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
5
|
+
import { decodeEntities } from '@wordpress/html-entities'; // Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.
|
|
6
|
+
|
|
7
|
+
export default function buildNavigationLabel(title, id, status) {
|
|
8
|
+
if (!title?.rendered) {
|
|
9
|
+
/* translators: %s is the index of the menu in the list of menus. */
|
|
10
|
+
return sprintf(__('(no title %s)'), id);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
if (status === 'publish') {
|
|
14
|
+
return decodeEntities(title?.rendered);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return sprintf( // translators: %1s: title of the menu; %2s: status of the menu (draft, pending, etc.).
|
|
18
|
+
__('%1$s (%2$s)'), decodeEntities(title?.rendered), status);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=build-navigation-label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/build-navigation-label.js"],"names":["__","sprintf","decodeEntities","buildNavigationLabel","title","id","status","rendered"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,cAAT,QAA+B,0BAA/B,C,CAEA;;AACA,eAAe,SAASC,oBAAT,CAA+BC,KAA/B,EAAsCC,EAAtC,EAA0CC,MAA1C,EAAmD;AACjE,MAAK,CAAEF,KAAK,EAAEG,QAAd,EAAyB;AACxB;AACA,WAAON,OAAO,CAAED,EAAE,CAAE,eAAF,CAAJ,EAAyBK,EAAzB,CAAd;AACA;;AAED,MAAKC,MAAM,KAAK,SAAhB,EAA4B;AAC3B,WAAOJ,cAAc,CAAEE,KAAK,EAAEG,QAAT,CAArB;AACA;;AAED,SAAON,OAAO,EACb;AACAD,EAAAA,EAAE,CAAE,aAAF,CAFW,EAGbE,cAAc,CAAEE,KAAK,EAAEG,QAAT,CAHD,EAIbD,MAJa,CAAd;AAMA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n// Copied from packages/block-library/src/navigation/edit/navigation-menu-selector.js.\nexport default function buildNavigationLabel( title, id, status ) {\n\tif ( ! title?.rendered ) {\n\t\t/* translators: %s is the index of the menu in the list of menus. */\n\t\treturn sprintf( __( '(no title %s)' ), id );\n\t}\n\n\tif ( status === 'publish' ) {\n\t\treturn decodeEntities( title?.rendered );\n\t}\n\n\treturn sprintf(\n\t\t// translators: %1s: title of the menu; %2s: status of the menu (draft, pending, etc.).\n\t\t__( '%1$s (%2$s)' ),\n\t\tdecodeEntities( title?.rendered ),\n\t\tstatus\n\t);\n}\n"]}
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
// on apiFetch this query is limited to 100.
|
|
4
4
|
// These parameters must be kept aligned with those in
|
|
5
5
|
// lib/compat/wordpress-6.3/navigation-block-preloading.php
|
|
6
|
+
// and
|
|
7
|
+
// block-library/src/navigation/constants.js
|
|
6
8
|
export const PRELOADED_NAVIGATION_MENUS_QUERY = {
|
|
7
9
|
per_page: 100,
|
|
8
10
|
status: ['publish', 'draft'],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/constants.js"],"names":["PRELOADED_NAVIGATION_MENUS_QUERY","per_page","status","order","orderby"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,gCAAgC,GAAG;AAC/CC,EAAAA,QAAQ,EAAE,GADqC;AAE/CC,EAAAA,MAAM,EAAE,CAAE,SAAF,EAAa,OAAb,CAFuC;AAG/CC,EAAAA,KAAK,EAAE,MAHwC;AAI/CC,EAAAA,OAAO,EAAE;AAJsC,CAAzC","sourcesContent":["// This requested is preloaded in `gutenberg_preload_navigation_posts`.\n// As unbounded queries are limited to 100 by `fetchAllMiddleware`\n// on apiFetch this query is limited to 100.\n// These parameters must be kept aligned with those in\n// lib/compat/wordpress-6.3/navigation-block-preloading.php\nexport const PRELOADED_NAVIGATION_MENUS_QUERY = {\n\tper_page: 100,\n\tstatus: [ 'publish', 'draft' ],\n\torder: 'desc',\n\torderby: 'date',\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/constants.js"],"names":["PRELOADED_NAVIGATION_MENUS_QUERY","per_page","status","order","orderby"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,gCAAgC,GAAG;AAC/CC,EAAAA,QAAQ,EAAE,GADqC;AAE/CC,EAAAA,MAAM,EAAE,CAAE,SAAF,EAAa,OAAb,CAFuC;AAG/CC,EAAAA,KAAK,EAAE,MAHwC;AAI/CC,EAAAA,OAAO,EAAE;AAJsC,CAAzC","sourcesContent":["// This requested is preloaded in `gutenberg_preload_navigation_posts`.\n// As unbounded queries are limited to 100 by `fetchAllMiddleware`\n// on apiFetch this query is limited to 100.\n// These parameters must be kept aligned with those in\n// lib/compat/wordpress-6.3/navigation-block-preloading.php\n// and\n// block-library/src/navigation/constants.js\nexport const PRELOADED_NAVIGATION_MENUS_QUERY = {\n\tper_page: 100,\n\tstatus: [ 'publish', 'draft' ],\n\torder: 'desc',\n\torderby: 'date',\n};\n"]}
|