@wordpress/edit-site 5.9.0 → 5.11.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-template/{add-custom-generic-template-modal.js → add-custom-generic-template-modal-content.js} +7 -22
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -0
- package/build/components/add-new-template/{add-custom-template-modal.js → add-custom-template-modal-content.js} +32 -27
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -0
- package/build/components/add-new-template/new-template-part.js +8 -2
- package/build/components/add-new-template/new-template-part.js.map +1 -1
- package/build/components/add-new-template/new-template.js +104 -68
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/app/index.js +8 -2
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/back-button.js +10 -3
- package/build/components/block-editor/back-button.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +39 -6
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/index.js +1 -3
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +6 -7
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/editor/index.js +20 -11
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +27 -6
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/global-styles/block-preview-panel.js +1 -1
- package/build/components/global-styles/block-preview-panel.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +14 -3
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +17 -18
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +14 -3
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/root-menu.js +61 -0
- package/build/components/global-styles/root-menu.js.map +1 -0
- package/build/components/global-styles/screen-block-list.js +3 -1
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js +235 -7
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +9 -26
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-css.js +20 -15
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-layout.js +4 -17
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +141 -0
- package/build/components/global-styles/screen-revisions/index.js.map +1 -0
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +130 -0
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -0
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +121 -0
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -0
- package/build/components/global-styles/screen-root.js +6 -6
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-typography-element.js +0 -3
- package/build/components/global-styles/screen-typography-element.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +11 -39
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +9 -18
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +7 -11
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/ui.js +70 -117
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/variations-panel.js +4 -28
- package/build/components/global-styles/variations-panel.js.map +1 -1
- package/build/components/header-edit-mode/document-actions/index.js +28 -103
- package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +15 -2
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/register.js +1 -1
- package/build/components/keyboard-shortcuts/register.js.map +1 -1
- package/build/components/layout/hooks.js +54 -0
- package/build/components/layout/hooks.js.map +1 -0
- package/build/components/layout/index.js +57 -104
- package/build/components/layout/index.js.map +1 -1
- package/build/components/list/actions/index.js +5 -2
- package/build/components/list/actions/index.js.map +1 -1
- package/build/components/list/index.js +9 -3
- package/build/components/list/index.js.map +1 -1
- package/build/components/list/table.js +1 -1
- package/build/components/list/table.js.map +1 -1
- package/build/components/plugin-template-setting-panel/index.js +44 -0
- package/build/components/plugin-template-setting-panel/index.js.map +1 -0
- package/build/components/resizable-frame/index.js +242 -0
- package/build/components/resizable-frame/index.js.map +1 -0
- package/build/components/revisions/index.js +96 -0
- package/build/components/revisions/index.js.map +1 -0
- package/build/components/routes/link.js +17 -2
- package/build/components/routes/link.js.map +1 -1
- package/build/components/routes/use-title.js +8 -2
- package/build/components/routes/use-title.js.map +1 -1
- package/build/components/save-button/index.js +31 -6
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js +14 -31
- package/build/components/save-hub/index.js.map +1 -1
- package/build/components/save-panel/index.js +20 -7
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +6 -10
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/index.js +19 -5
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +9 -3
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +9 -2
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +40 -0
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -0
- package/build/components/sidebar-edit-mode/template-card/index.js +1 -8
- package/build/components/sidebar-edit-mode/template-card/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/{template-card/last-revision.js → template-revisions/index.js} +2 -2
- package/build/components/sidebar-edit-mode/template-revisions/index.js.map +1 -0
- package/build/components/sidebar-navigation-item/index.js +5 -7
- package/build/components/sidebar-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +14 -4
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +75 -11
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +31 -23
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
- package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js +162 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +17 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +55 -93
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +87 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +14 -71
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +53 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +1 -0
- package/build/components/sidebar-navigation-screen-page/index.js +67 -0
- package/build/components/sidebar-navigation-screen-page/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-pages/index.js +74 -0
- package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-templates/index.js +39 -12
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/sidebar-navigation-subtitle/index.js +18 -0
- package/build/components/sidebar-navigation-subtitle/index.js.map +1 -0
- package/build/components/site-hub/index.js +34 -6
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/start-template-options/index.js +12 -16
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/style-book/index.js +93 -19
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +8 -2
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +9 -4
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-path-with-url.js +17 -3
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build/components/use-edited-entity-record/index.js +8 -4
- package/build/components/use-edited-entity-record/index.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +105 -0
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -0
- package/build/hooks/template-part-edit.js +8 -2
- package/build/hooks/template-part-edit.js.map +1 -1
- package/build/index.js +8 -0
- package/build/index.js.map +1 -1
- package/build/store/actions.js +5 -3
- package/build/store/actions.js.map +1 -1
- package/build/utils/is-previewing-theme.js +27 -0
- package/build/utils/is-previewing-theme.js.map +1 -0
- package/build/utils/use-activate-theme.js +46 -0
- package/build/utils/use-activate-theme.js.map +1 -0
- package/build-module/components/add-new-template/{add-custom-generic-template-modal.js → add-custom-generic-template-modal-content.js} +8 -20
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -0
- package/build-module/components/add-new-template/{add-custom-template-modal.js → add-custom-template-modal-content.js} +34 -28
- package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -0
- package/build-module/components/add-new-template/new-template-part.js +5 -1
- package/build-module/components/add-new-template/new-template-part.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +102 -68
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/app/index.js +6 -2
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/back-button.js +6 -1
- package/build-module/components/block-editor/back-button.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +37 -6
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/index.js +1 -3
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +7 -8
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/editor/index.js +18 -11
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +27 -8
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/global-styles/block-preview-panel.js +1 -1
- package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +13 -3
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +17 -18
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +13 -3
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/root-menu.js +47 -0
- package/build-module/components/global-styles/root-menu.js.map +1 -0
- package/build-module/components/global-styles/screen-block-list.js +4 -2
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +229 -7
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +9 -25
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js +20 -15
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-layout.js +4 -16
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +121 -0
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -0
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +118 -0
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -0
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +107 -0
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -0
- package/build-module/components/global-styles/screen-root.js +6 -6
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-typography-element.js +0 -3
- package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +11 -37
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +10 -18
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +7 -11
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/ui.js +71 -115
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/variations-panel.js +3 -22
- package/build-module/components/global-styles/variations-panel.js.map +1 -1
- package/build-module/components/header-edit-mode/document-actions/index.js +31 -107
- package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +16 -4
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/register.js +1 -1
- package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
- package/build-module/components/layout/hooks.js +41 -0
- package/build-module/components/layout/hooks.js.map +1 -0
- package/build-module/components/layout/index.js +53 -102
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/list/actions/index.js +6 -3
- package/build-module/components/list/actions/index.js.map +1 -1
- package/build-module/components/list/index.js +5 -1
- package/build-module/components/list/index.js.map +1 -1
- package/build-module/components/list/table.js +1 -1
- package/build-module/components/list/table.js.map +1 -1
- package/build-module/components/plugin-template-setting-panel/index.js +35 -0
- package/build-module/components/plugin-template-setting-panel/index.js.map +1 -0
- package/build-module/components/resizable-frame/index.js +228 -0
- package/build-module/components/resizable-frame/index.js.map +1 -0
- package/build-module/components/revisions/index.js +78 -0
- package/build-module/components/revisions/index.js.map +1 -0
- package/build-module/components/routes/link.js +13 -1
- package/build-module/components/routes/link.js.map +1 -1
- package/build-module/components/routes/use-title.js +5 -1
- package/build-module/components/routes/use-title.js.map +1 -1
- package/build-module/components/save-button/index.js +28 -6
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-hub/index.js +13 -32
- package/build-module/components/save-hub/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +19 -7
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +6 -11
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/index.js +14 -4
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +9 -3
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +10 -5
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +29 -0
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/template-card/index.js +2 -7
- package/build-module/components/sidebar-edit-mode/template-card/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/{template-card/last-revision.js → template-revisions/index.js} +2 -2
- package/build-module/components/sidebar-edit-mode/template-revisions/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-item/index.js +6 -8
- package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +13 -5
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +70 -14
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +30 -24
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +141 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +10 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +52 -93
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +71 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +13 -72
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +40 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-page/index.js +48 -0
- package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-pages/index.js +57 -0
- package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-templates/index.js +38 -12
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-subtitle/index.js +10 -0
- package/build-module/components/sidebar-navigation-subtitle/index.js.map +1 -0
- package/build-module/components/site-hub/index.js +32 -6
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +13 -17
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/style-book/index.js +93 -20
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +5 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +5 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +13 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build-module/components/use-edited-entity-record/index.js +8 -4
- package/build-module/components/use-edited-entity-record/index.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +86 -0
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -0
- package/build-module/hooks/template-part-edit.js +5 -1
- package/build-module/hooks/template-part-edit.js.map +1 -1
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +5 -3
- package/build-module/store/actions.js.map +1 -1
- package/build-module/utils/is-previewing-theme.js +17 -0
- package/build-module/utils/is-previewing-theme.js.map +1 -0
- package/build-module/utils/use-activate-theme.js +36 -0
- package/build-module/utils/use-activate-theme.js.map +1 -0
- package/build-style/style-rtl.css +409 -265
- package/build-style/style.css +410 -265
- package/package.json +37 -35
- package/src/components/add-new-template/add-custom-generic-template-modal-content.js +82 -0
- package/src/components/add-new-template/{add-custom-template-modal.js → add-custom-template-modal-content.js} +44 -34
- package/src/components/add-new-template/new-template-part.js +4 -1
- package/src/components/add-new-template/new-template.js +142 -154
- package/src/components/add-new-template/style.scss +120 -103
- package/src/components/app/index.js +6 -3
- package/src/components/block-editor/back-button.js +4 -1
- package/src/components/block-editor/editor-canvas.js +36 -8
- package/src/components/block-editor/index.js +2 -3
- package/src/components/block-editor/style.scss +15 -8
- package/src/components/create-template-part-modal/index.js +19 -25
- package/src/components/editor/index.js +20 -8
- package/src/components/editor/style.scss +21 -6
- package/src/components/editor-canvas-container/index.js +43 -21
- package/src/components/global-styles/block-preview-panel.js +1 -1
- package/src/components/global-styles/color-palette-panel.js +9 -0
- package/src/components/global-styles/dimensions-panel.js +15 -15
- package/src/components/global-styles/gradients-palette-panel.js +8 -0
- package/src/components/global-styles/root-menu.js +66 -0
- package/src/components/global-styles/screen-block-list.js +2 -2
- package/src/components/global-styles/screen-block.js +255 -7
- package/src/components/global-styles/screen-colors.js +9 -16
- package/src/components/global-styles/screen-css.js +21 -21
- package/src/components/global-styles/screen-layout.js +5 -9
- package/src/components/global-styles/screen-revisions/index.js +169 -0
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +139 -0
- package/src/components/global-styles/screen-revisions/style.scss +100 -0
- package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +138 -0
- package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +99 -0
- package/src/components/global-styles/screen-root.js +7 -5
- package/src/components/global-styles/screen-typography-element.js +1 -3
- package/src/components/global-styles/screen-typography.js +44 -79
- package/src/components/global-styles/style-variations-container.js +17 -28
- package/src/components/global-styles/style.scss +4 -23
- package/src/components/global-styles/typography-panel.js +12 -13
- package/src/components/global-styles/ui.js +83 -110
- package/src/components/global-styles/variations-panel.js +3 -26
- package/src/components/header-edit-mode/document-actions/index.js +26 -129
- package/src/components/header-edit-mode/document-actions/style.scss +28 -59
- package/src/components/header-edit-mode/index.js +23 -2
- package/src/components/header-edit-mode/style.scss +1 -0
- package/src/components/keyboard-shortcuts/register.js +1 -1
- package/src/components/layout/hooks.js +46 -0
- package/src/components/layout/index.js +60 -125
- package/src/components/layout/style.scss +9 -5
- package/src/components/list/actions/index.js +12 -5
- package/src/components/list/index.js +4 -1
- package/src/components/list/style.scss +5 -0
- package/src/components/list/table.js +3 -1
- package/src/components/plugin-template-setting-panel/index.js +33 -0
- package/src/components/resizable-frame/index.js +253 -0
- package/src/components/resizable-frame/style.scss +69 -0
- package/src/components/revisions/index.js +105 -0
- package/src/components/routes/link.js +16 -1
- package/src/components/routes/use-title.js +4 -1
- package/src/components/save-button/index.js +27 -6
- package/src/components/save-hub/index.js +17 -35
- package/src/components/save-panel/index.js +15 -3
- package/src/components/secondary-sidebar/list-view-sidebar.js +4 -7
- package/src/components/sidebar/index.js +15 -4
- package/src/components/sidebar-edit-mode/global-styles-sidebar.js +9 -7
- package/src/components/sidebar-edit-mode/index.js +17 -6
- package/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js +26 -0
- package/src/components/sidebar-edit-mode/style.scss +10 -0
- package/src/components/sidebar-edit-mode/template-card/index.js +1 -9
- package/src/components/sidebar-edit-mode/{template-card/last-revision.js → template-revisions/index.js} +1 -2
- package/src/components/sidebar-navigation-item/index.js +13 -14
- package/src/components/sidebar-navigation-item/style.scss +17 -1
- package/src/components/sidebar-navigation-screen/index.js +26 -5
- package/src/components/sidebar-navigation-screen/style.scss +1 -2
- package/src/components/sidebar-navigation-screen-global-styles/index.js +106 -21
- package/src/components/sidebar-navigation-screen-main/index.js +39 -35
- package/src/components/sidebar-navigation-screen-navigation-item/index.js +3 -9
- package/src/components/sidebar-navigation-screen-navigation-menu/index.js +157 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/constants.js +9 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +63 -105
- package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +83 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +8 -74
- package/src/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +47 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +6 -20
- package/src/components/sidebar-navigation-screen-page/index.js +59 -0
- package/src/components/sidebar-navigation-screen-pages/index.js +82 -0
- package/src/components/sidebar-navigation-screen-pages/style.scss +4 -0
- package/src/components/sidebar-navigation-screen-templates/index.js +57 -14
- package/src/components/sidebar-navigation-subtitle/index.js +5 -0
- package/src/components/sidebar-navigation-subtitle/style.scss +7 -0
- package/src/components/site-hub/index.js +88 -58
- package/src/components/site-hub/style.scss +8 -0
- package/src/components/start-template-options/index.js +19 -27
- package/src/components/start-template-options/style.scss +28 -21
- package/src/components/style-book/index.js +132 -43
- package/src/components/style-book/style.scss +19 -0
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +4 -1
- package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +3 -1
- package/src/components/sync-state-with-url/use-sync-path-with-url.js +14 -1
- package/src/components/use-edited-entity-record/index.js +12 -3
- package/src/hooks/commands/use-edit-mode-commands.js +79 -0
- package/src/hooks/template-part-edit.js +4 -1
- package/src/index.js +1 -0
- package/src/store/actions.js +4 -5
- package/src/store/test/actions.js +6 -14
- package/src/store/test/utils.js +15 -5
- package/src/style.scss +5 -2
- package/src/utils/is-previewing-theme.js +18 -0
- package/src/utils/use-activate-theme.js +38 -0
- package/build/components/add-new-template/add-custom-generic-template-modal.js.map +0 -1
- package/build/components/add-new-template/add-custom-template-modal.js.map +0 -1
- package/build/components/global-styles/border-panel.js +0 -133
- package/build/components/global-styles/border-panel.js.map +0 -1
- package/build/components/global-styles/context-menu.js +0 -126
- package/build/components/global-styles/context-menu.js.map +0 -1
- package/build/components/global-styles/custom-css.js +0 -113
- package/build/components/global-styles/custom-css.js.map +0 -1
- package/build/components/global-styles/effects-panel.js +0 -53
- package/build/components/global-styles/effects-panel.js.map +0 -1
- package/build/components/global-styles/filters-panel.js +0 -50
- package/build/components/global-styles/filters-panel.js.map +0 -1
- package/build/components/global-styles/screen-border.js +0 -61
- package/build/components/global-styles/screen-border.js.map +0 -1
- package/build/components/global-styles/screen-effects.js +0 -61
- package/build/components/global-styles/screen-effects.js.map +0 -1
- package/build/components/global-styles/screen-filters.js +0 -46
- package/build/components/global-styles/screen-filters.js.map +0 -1
- package/build/components/global-styles/screen-variations.js +0 -71
- package/build/components/global-styles/screen-variations.js.map +0 -1
- package/build/components/navigate-to-link/index.js +0 -51
- package/build/components/navigate-to-link/index.js.map +0 -1
- package/build/components/routes/index.js +0 -60
- package/build/components/routes/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-card/last-revision.js.map +0 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/loader.js +0 -19
- package/build/components/sidebar-navigation-screen-navigation-menus/loader.js.map +0 -1
- package/build/components/template-details/edit-template-title.js +0 -42
- package/build/components/template-details/edit-template-title.js.map +0 -1
- package/build/components/template-details/index.js +0 -103
- package/build/components/template-details/index.js.map +0 -1
- package/build/components/template-details/template-areas.js +0 -160
- package/build/components/template-details/template-areas.js.map +0 -1
- package/build/components/template-details/template-part-area-selector.js +0 -48
- package/build/components/template-details/template-part-area-selector.js.map +0 -1
- package/build/hooks/commands/index.js +0 -19
- package/build/hooks/commands/index.js.map +0 -1
- package/build/hooks/commands/use-navigation-commands.js +0 -126
- package/build/hooks/commands/use-navigation-commands.js.map +0 -1
- package/build/hooks/commands/use-wp-admin-commands.js +0 -97
- package/build/hooks/commands/use-wp-admin-commands.js.map +0 -1
- package/build/utils/history.js +0 -41
- package/build/utils/history.js.map +0 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal.js.map +0 -1
- package/build-module/components/add-new-template/add-custom-template-modal.js.map +0 -1
- package/build-module/components/global-styles/border-panel.js +0 -123
- package/build-module/components/global-styles/border-panel.js.map +0 -1
- package/build-module/components/global-styles/context-menu.js +0 -107
- package/build-module/components/global-styles/context-menu.js.map +0 -1
- package/build-module/components/global-styles/custom-css.js +0 -98
- package/build-module/components/global-styles/custom-css.js.map +0 -1
- package/build-module/components/global-styles/effects-panel.js +0 -43
- package/build-module/components/global-styles/effects-panel.js.map +0 -1
- package/build-module/components/global-styles/filters-panel.js +0 -40
- package/build-module/components/global-styles/filters-panel.js.map +0 -1
- package/build-module/components/global-styles/screen-border.js +0 -44
- package/build-module/components/global-styles/screen-border.js.map +0 -1
- package/build-module/components/global-styles/screen-effects.js +0 -44
- package/build-module/components/global-styles/screen-effects.js.map +0 -1
- package/build-module/components/global-styles/screen-filters.js +0 -33
- package/build-module/components/global-styles/screen-filters.js.map +0 -1
- package/build-module/components/global-styles/screen-variations.js +0 -54
- package/build-module/components/global-styles/screen-variations.js.map +0 -1
- package/build-module/components/navigate-to-link/index.js +0 -39
- package/build-module/components/navigate-to-link/index.js.map +0 -1
- package/build-module/components/routes/index.js +0 -47
- package/build-module/components/routes/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-card/last-revision.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/loader.js +0 -11
- package/build-module/components/sidebar-navigation-screen-navigation-menus/loader.js.map +0 -1
- package/build-module/components/template-details/edit-template-title.js +0 -33
- package/build-module/components/template-details/edit-template-title.js.map +0 -1
- package/build-module/components/template-details/index.js +0 -83
- package/build-module/components/template-details/index.js.map +0 -1
- package/build-module/components/template-details/template-areas.js +0 -141
- package/build-module/components/template-details/template-areas.js.map +0 -1
- package/build-module/components/template-details/template-part-area-selector.js +0 -36
- package/build-module/components/template-details/template-part-area-selector.js.map +0 -1
- package/build-module/hooks/commands/index.js +0 -10
- package/build-module/hooks/commands/index.js.map +0 -1
- package/build-module/hooks/commands/use-navigation-commands.js +0 -109
- package/build-module/hooks/commands/use-navigation-commands.js.map +0 -1
- package/build-module/hooks/commands/use-wp-admin-commands.js +0 -81
- package/build-module/hooks/commands/use-wp-admin-commands.js.map +0 -1
- package/build-module/utils/history.js +0 -31
- package/build-module/utils/history.js.map +0 -1
- package/src/components/add-new-template/add-custom-generic-template-modal.js +0 -101
- package/src/components/global-styles/border-panel.js +0 -112
- package/src/components/global-styles/context-menu.js +0 -175
- package/src/components/global-styles/custom-css.js +0 -131
- package/src/components/global-styles/effects-panel.js +0 -40
- package/src/components/global-styles/filters-panel.js +0 -39
- package/src/components/global-styles/screen-border.js +0 -35
- package/src/components/global-styles/screen-effects.js +0 -35
- package/src/components/global-styles/screen-filters.js +0 -27
- package/src/components/global-styles/screen-variations.js +0 -46
- package/src/components/navigate-to-link/index.js +0 -46
- package/src/components/routes/index.js +0 -53
- package/src/components/sidebar-navigation-screen-navigation-menus/loader.js +0 -9
- package/src/components/template-details/edit-template-title.js +0 -41
- package/src/components/template-details/index.js +0 -113
- package/src/components/template-details/style.scss +0 -72
- package/src/components/template-details/template-areas.js +0 -164
- package/src/components/template-details/template-part-area-selector.js +0 -39
- package/src/hooks/commands/index.js +0 -10
- package/src/hooks/commands/use-navigation-commands.js +0 -112
- package/src/hooks/commands/use-wp-admin-commands.js +0 -79
- package/src/utils/history.js +0 -39
|
@@ -1,117 +1,76 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
1
2
|
import { createElement } from "@wordpress/element";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* WordPress dependencies
|
|
5
6
|
*/
|
|
6
7
|
import { __ } from '@wordpress/i18n';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { createBlock } from '@wordpress/blocks';
|
|
8
|
+
import { useEntityRecords } from '@wordpress/core-data';
|
|
9
|
+
import { decodeEntities } from '@wordpress/html-entities';
|
|
10
|
+
import { __experimentalItemGroup as ItemGroup, Spinner } from '@wordpress/components';
|
|
11
|
+
import { navigation } from '@wordpress/icons';
|
|
12
12
|
/**
|
|
13
13
|
* Internal dependencies
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
import SidebarNavigationItem from '../sidebar-navigation-item';
|
|
18
|
+
import { PRELOADED_NAVIGATION_MENUS_QUERY } from './constants';
|
|
19
|
+
import { useLink } from '../routes/link';
|
|
20
|
+
export default function SidebarNavigationScreenNavigationMenus() {
|
|
21
|
+
const {
|
|
22
|
+
records: navigationMenus,
|
|
23
|
+
isResolving: isLoading
|
|
24
|
+
} = useEntityRecords('postType', `wp_navigation`, PRELOADED_NAVIGATION_MENUS_QUERY);
|
|
25
|
+
const hasNavigationMenus = !!(navigationMenus !== null && navigationMenus !== void 0 && navigationMenus.length);
|
|
22
26
|
|
|
23
|
-
|
|
27
|
+
if (isLoading) {
|
|
28
|
+
return createElement(SidebarNavigationScreenWrapper, null, createElement(Spinner, {
|
|
29
|
+
className: "edit-site-sidebar-navigation-screen-navigation-menus__loading"
|
|
30
|
+
}));
|
|
31
|
+
}
|
|
24
32
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
};
|
|
33
|
+
if (!isLoading && !hasNavigationMenus) {
|
|
34
|
+
return createElement(SidebarNavigationScreenWrapper, {
|
|
35
|
+
description: __('No Navigation Menus found.')
|
|
36
|
+
});
|
|
37
|
+
}
|
|
31
38
|
|
|
32
|
-
|
|
39
|
+
return createElement(SidebarNavigationScreenWrapper, null, createElement(ItemGroup, null, navigationMenus === null || navigationMenus === void 0 ? void 0 : navigationMenus.map(navMenu => {
|
|
40
|
+
var _navMenu$title;
|
|
41
|
+
|
|
42
|
+
return createElement(NavMenuItem, {
|
|
43
|
+
postId: navMenu.id,
|
|
44
|
+
key: navMenu.id,
|
|
45
|
+
withChevron: true,
|
|
46
|
+
icon: navigation
|
|
47
|
+
}, decodeEntities(((_navMenu$title = navMenu.title) === null || _navMenu$title === void 0 ? void 0 : _navMenu$title.rendered) || navMenu.slug));
|
|
48
|
+
})));
|
|
49
|
+
}
|
|
50
|
+
export function SidebarNavigationScreenWrapper(_ref) {
|
|
33
51
|
let {
|
|
34
52
|
children,
|
|
35
|
-
actions
|
|
53
|
+
actions,
|
|
54
|
+
title,
|
|
55
|
+
description
|
|
36
56
|
} = _ref;
|
|
37
57
|
return createElement(SidebarNavigationScreen, {
|
|
38
|
-
title: __('Navigation'),
|
|
58
|
+
title: title || __('Navigation'),
|
|
39
59
|
actions: actions,
|
|
40
|
-
description: __('
|
|
60
|
+
description: description || __('Manage your Navigation menus.'),
|
|
41
61
|
content: children
|
|
42
62
|
});
|
|
43
63
|
}
|
|
44
64
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
} = unlock(select(editSiteStore));
|
|
57
|
-
const {
|
|
58
|
-
getEntityRecords,
|
|
59
|
-
hasFinishedResolution
|
|
60
|
-
} = select(coreStore);
|
|
61
|
-
const navigationMenusQuery = ['postType', 'wp_navigation', NAVIGATION_MENUS_QUERY];
|
|
62
|
-
return {
|
|
63
|
-
storedSettings: getSettings(false),
|
|
64
|
-
navigationMenus: getEntityRecords(...navigationMenusQuery),
|
|
65
|
-
hasResolvedNavigationMenus: hasFinishedResolution('getEntityRecords', navigationMenusQuery)
|
|
66
|
-
};
|
|
67
|
-
}, []);
|
|
68
|
-
const firstNavigationMenu = navigationMenus === null || navigationMenus === void 0 ? void 0 : (_navigationMenus$ = navigationMenus[0]) === null || _navigationMenus$ === void 0 ? void 0 : _navigationMenus$.id;
|
|
69
|
-
const blocks = useMemo(() => {
|
|
70
|
-
return [createBlock('core/navigation', {
|
|
71
|
-
ref: firstNavigationMenu
|
|
72
|
-
})];
|
|
73
|
-
}, [firstNavigationMenu]);
|
|
74
|
-
const isLoading = !hasResolvedNavigationMenus;
|
|
75
|
-
const hasNavigationMenus = !!(navigationMenus !== null && navigationMenus !== void 0 && navigationMenus.length);
|
|
76
|
-
const onSelect = useCallback(selectedBlock => {
|
|
77
|
-
const {
|
|
78
|
-
attributes,
|
|
79
|
-
name
|
|
80
|
-
} = selectedBlock;
|
|
81
|
-
|
|
82
|
-
if (attributes.kind === 'post-type' && attributes.id && attributes.type && history) {
|
|
83
|
-
history.push({
|
|
84
|
-
postType: attributes.type,
|
|
85
|
-
postId: attributes.id
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
if (name === 'core/page-list-item' && attributes.id && history) {
|
|
90
|
-
history.push({
|
|
91
|
-
postType: 'page',
|
|
92
|
-
postId: attributes.id
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
}, [history]);
|
|
96
|
-
|
|
97
|
-
if (hasResolvedNavigationMenus && !hasNavigationMenus) {
|
|
98
|
-
return createElement(SidebarNavigationScreenWrapper, null, __('There are no Navigation Menus.'));
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
if (!hasResolvedNavigationMenus || isLoading) {
|
|
102
|
-
return createElement(SidebarNavigationScreenWrapper, null, createElement(NavigationMenuLoader, null));
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
return createElement(BlockEditorProvider, {
|
|
106
|
-
settings: storedSettings,
|
|
107
|
-
value: blocks,
|
|
108
|
-
onChange: noop,
|
|
109
|
-
onInput: noop
|
|
110
|
-
}, createElement(SidebarNavigationScreenWrapper, null, createElement("div", {
|
|
111
|
-
className: "edit-site-sidebar-navigation-screen-navigation-menus__content"
|
|
112
|
-
}, createElement(NavigationMenuContent, {
|
|
113
|
-
rootClientId: blocks[0].clientId,
|
|
114
|
-
onSelect: onSelect
|
|
115
|
-
}))));
|
|
116
|
-
}
|
|
65
|
+
const NavMenuItem = _ref2 => {
|
|
66
|
+
let {
|
|
67
|
+
postId,
|
|
68
|
+
...props
|
|
69
|
+
} = _ref2;
|
|
70
|
+
const linkInfo = useLink({
|
|
71
|
+
postId,
|
|
72
|
+
postType: 'wp_navigation'
|
|
73
|
+
});
|
|
74
|
+
return createElement(SidebarNavigationItem, _extends({}, linkInfo, props));
|
|
75
|
+
};
|
|
117
76
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/index.js"],"names":["__","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/index.js"],"names":["__","useEntityRecords","decodeEntities","__experimentalItemGroup","ItemGroup","Spinner","navigation","SidebarNavigationScreen","SidebarNavigationItem","PRELOADED_NAVIGATION_MENUS_QUERY","useLink","SidebarNavigationScreenNavigationMenus","records","navigationMenus","isResolving","isLoading","hasNavigationMenus","length","map","navMenu","id","title","rendered","slug","SidebarNavigationScreenWrapper","children","actions","description","NavMenuItem","postId","props","linkInfo","postType"],"mappings":";;;AAAA;AACA;AACA;AACA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B,CADuB;AAAA,GAAtB,CADH,CADD,CADD;AAkBA;AAED,OAAO,SAASC,8BAAT,OAKH;AAAA,MAL4C;AAC/CC,IAAAA,QAD+C;AAE/CC,IAAAA,OAF+C;AAG/CL,IAAAA,KAH+C;AAI/CM,IAAAA;AAJ+C,GAK5C;AACH,SACC,cAAC,uBAAD;AACC,IAAA,KAAK,EAAGN,KAAK,IAAIrB,EAAE,CAAE,YAAF,CADpB;AAEC,IAAA,OAAO,EAAG0B,OAFX;AAGC,IAAA,WAAW,EAAGC,WAAW,IAAI3B,EAAE,CAAE,+BAAF,CAHhC;AAIC,IAAA,OAAO,EAAGyB;AAJX,IADD;AAQA;;AAED,MAAMG,WAAW,GAAG,SAA4B;AAAA,MAA1B;AAAEC,IAAAA,MAAF;AAAU,OAAGC;AAAb,GAA0B;AAC/C,QAAMC,QAAQ,GAAGrB,OAAO,CAAE;AACzBmB,IAAAA,MADyB;AAEzBG,IAAAA,QAAQ,EAAE;AAFe,GAAF,CAAxB;AAIA,SAAO,cAAC,qBAAD,eAA4BD,QAA5B,EAA4CD,KAA5C,EAAP;AACA,CAND","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useEntityRecords } from '@wordpress/core-data';\n\nimport { decodeEntities } from '@wordpress/html-entities';\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\tSpinner,\n} from '@wordpress/components';\nimport { navigation } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { PRELOADED_NAVIGATION_MENUS_QUERY } from './constants';\nimport { useLink } from '../routes/link';\n\nexport default function SidebarNavigationScreenNavigationMenus() {\n\tconst { records: navigationMenus, isResolving: isLoading } =\n\t\tuseEntityRecords(\n\t\t\t'postType',\n\t\t\t`wp_navigation`,\n\t\t\tPRELOADED_NAVIGATION_MENUS_QUERY\n\t\t);\n\n\tconst hasNavigationMenus = !! navigationMenus?.length;\n\n\tif ( isLoading ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper>\n\t\t\t\t<Spinner className=\"edit-site-sidebar-navigation-screen-navigation-menus__loading\" />\n\t\t\t</SidebarNavigationScreenWrapper>\n\t\t);\n\t}\n\n\tif ( ! isLoading && ! hasNavigationMenus ) {\n\t\treturn (\n\t\t\t<SidebarNavigationScreenWrapper\n\t\t\t\tdescription={ __( 'No Navigation Menus found.' ) }\n\t\t\t/>\n\t\t);\n\t}\n\n\treturn (\n\t\t<SidebarNavigationScreenWrapper>\n\t\t\t<ItemGroup>\n\t\t\t\t{ navigationMenus?.map( ( navMenu ) => (\n\t\t\t\t\t<NavMenuItem\n\t\t\t\t\t\tpostId={ navMenu.id }\n\t\t\t\t\t\tkey={ navMenu.id }\n\t\t\t\t\t\twithChevron\n\t\t\t\t\t\ticon={ navigation }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ decodeEntities(\n\t\t\t\t\t\t\tnavMenu.title?.rendered || navMenu.slug\n\t\t\t\t\t\t) }\n\t\t\t\t\t</NavMenuItem>\n\t\t\t\t) ) }\n\t\t\t</ItemGroup>\n\t\t</SidebarNavigationScreenWrapper>\n\t);\n}\n\nexport function SidebarNavigationScreenWrapper( {\n\tchildren,\n\tactions,\n\ttitle,\n\tdescription,\n} ) {\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\ttitle={ title || __( 'Navigation' ) }\n\t\t\tactions={ actions }\n\t\t\tdescription={ description || __( 'Manage your Navigation menus.' ) }\n\t\t\tcontent={ children }\n\t\t/>\n\t);\n}\n\nconst NavMenuItem = ( { postId, ...props } ) => {\n\tconst linkInfo = useLink( {\n\t\tpostId,\n\t\tpostType: 'wp_navigation',\n\t} );\n\treturn <SidebarNavigationItem { ...linkInfo } { ...props } />;\n};\n"]}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import { createElement, Fragment } from "@wordpress/element";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* WordPress dependencies
|
|
6
|
+
*/
|
|
7
|
+
import { chevronUp, chevronDown, moreVertical } from '@wordpress/icons';
|
|
8
|
+
import { DropdownMenu, MenuItem, MenuGroup } from '@wordpress/components';
|
|
9
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
10
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
11
|
+
import { BlockTitle, store as blockEditorStore } from '@wordpress/block-editor';
|
|
12
|
+
const POPOVER_PROPS = {
|
|
13
|
+
className: 'block-editor-block-settings-menu__popover',
|
|
14
|
+
position: 'bottom right',
|
|
15
|
+
variant: 'toolbar'
|
|
16
|
+
};
|
|
17
|
+
export default function LeafMoreMenu(props) {
|
|
18
|
+
const {
|
|
19
|
+
block
|
|
20
|
+
} = props;
|
|
21
|
+
const {
|
|
22
|
+
clientId
|
|
23
|
+
} = block;
|
|
24
|
+
const {
|
|
25
|
+
moveBlocksDown,
|
|
26
|
+
moveBlocksUp,
|
|
27
|
+
removeBlocks
|
|
28
|
+
} = useDispatch(blockEditorStore);
|
|
29
|
+
const removeLabel = sprintf(
|
|
30
|
+
/* translators: %s: block name */
|
|
31
|
+
__('Remove %s'), BlockTitle({
|
|
32
|
+
clientId,
|
|
33
|
+
maximumLength: 25
|
|
34
|
+
}));
|
|
35
|
+
const rootClientId = useSelect(select => {
|
|
36
|
+
const {
|
|
37
|
+
getBlockRootClientId
|
|
38
|
+
} = select(blockEditorStore);
|
|
39
|
+
return getBlockRootClientId(clientId);
|
|
40
|
+
}, [clientId]);
|
|
41
|
+
return createElement(DropdownMenu, _extends({
|
|
42
|
+
icon: moreVertical,
|
|
43
|
+
label: __('Options'),
|
|
44
|
+
className: "block-editor-block-settings-menu",
|
|
45
|
+
popoverProps: POPOVER_PROPS,
|
|
46
|
+
noIcons: true
|
|
47
|
+
}, props), _ref => {
|
|
48
|
+
let {
|
|
49
|
+
onClose
|
|
50
|
+
} = _ref;
|
|
51
|
+
return createElement(Fragment, null, createElement(MenuGroup, null, createElement(MenuItem, {
|
|
52
|
+
icon: chevronUp,
|
|
53
|
+
onClick: () => {
|
|
54
|
+
moveBlocksUp([clientId], rootClientId);
|
|
55
|
+
onClose();
|
|
56
|
+
}
|
|
57
|
+
}, __('Move up')), createElement(MenuItem, {
|
|
58
|
+
icon: chevronDown,
|
|
59
|
+
onClick: () => {
|
|
60
|
+
moveBlocksDown([clientId], rootClientId);
|
|
61
|
+
onClose();
|
|
62
|
+
}
|
|
63
|
+
}, __('Move down'))), createElement(MenuGroup, null, createElement(MenuItem, {
|
|
64
|
+
onClick: () => {
|
|
65
|
+
removeBlocks([clientId], false);
|
|
66
|
+
onClose();
|
|
67
|
+
}
|
|
68
|
+
}, removeLabel)));
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=leaf-more-menu.js.map
|
package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js"],"names":["chevronUp","chevronDown","moreVertical","DropdownMenu","MenuItem","MenuGroup","useDispatch","useSelect","__","sprintf","BlockTitle","store","blockEditorStore","POPOVER_PROPS","className","position","variant","LeafMoreMenu","props","block","clientId","moveBlocksDown","moveBlocksUp","removeBlocks","removeLabel","maximumLength","rootClientId","select","getBlockRootClientId","onClose"],"mappings":";;;AAAA;AACA;AACA;AAEA,SAASA,SAAT,EAAoBC,WAApB,EAAiCC,YAAjC,QAAqD,kBAArD;AACA,SAASC,YAAT,EAAuBC,QAAvB,EAAiCC,SAAjC,QAAkD,uBAAlD;AACA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,UAAT,EAAqBC,KAAK,IAAIC,gBAA9B,QAAsD,yBAAtD;AAEA,M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F,CAPL,CADD,EAUC,cAAC,QAAD;AACC,MAAA,IAAI,EAAGP,WADR;AAEC,MAAA,OAAO,EAAG,MAAM;AACfoB,QAAAA,cAAc,CAAE,CAAED,QAAF,CAAF,EAAgBM,YAAhB,CAAd;AACAG,QAAAA,OAAO;AACP;AALF,OAOGrB,EAAE,CAAE,WAAF,CAPL,CAVD,CADD,EAqBC,cAAC,SAAD,QACC,cAAC,QAAD;AACC,MAAA,OAAO,EAAG,MAAM;AACfe,QAAAA,YAAY,CAAE,CAAEH,QAAF,CAAF,EAAgB,KAAhB,CAAZ;AACAS,QAAAA,OAAO;AACP;AAJF,OAMGL,WANH,CADD,CArBD,CADC;AAAA,GARH,CADD;AA6CA","sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { chevronUp, chevronDown, moreVertical } from '@wordpress/icons';\nimport { DropdownMenu, MenuItem, MenuGroup } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { BlockTitle, store as blockEditorStore } from '@wordpress/block-editor';\n\nconst POPOVER_PROPS = {\n\tclassName: 'block-editor-block-settings-menu__popover',\n\tposition: 'bottom right',\n\tvariant: 'toolbar',\n};\n\nexport default function LeafMoreMenu( props ) {\n\tconst { block } = props;\n\tconst { clientId } = block;\n\tconst { moveBlocksDown, moveBlocksUp, removeBlocks } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst removeLabel = sprintf(\n\t\t/* translators: %s: block name */\n\t\t__( 'Remove %s' ),\n\t\tBlockTitle( { clientId, maximumLength: 25 } )\n\t);\n\n\tconst rootClientId = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockRootClientId } = select( blockEditorStore );\n\n\t\t\treturn getBlockRootClientId( clientId );\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\ticon={ moreVertical }\n\t\t\tlabel={ __( 'Options' ) }\n\t\t\tclassName=\"block-editor-block-settings-menu\"\n\t\t\tpopoverProps={ POPOVER_PROPS }\n\t\t\tnoIcons\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<>\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\ticon={ chevronUp }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tmoveBlocksUp( [ clientId ], rootClientId );\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{ __( 'Move up' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\ticon={ chevronDown }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tmoveBlocksDown( [ clientId ], rootClientId );\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{ __( 'Move down' ) }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t\t<MenuGroup>\n\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tremoveBlocks( [ clientId ], false );\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{ removeLabel }\n\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n}\n"]}
|
|
@@ -3,11 +3,10 @@ import { createElement, Fragment } from "@wordpress/element";
|
|
|
3
3
|
/**
|
|
4
4
|
* WordPress dependencies
|
|
5
5
|
*/
|
|
6
|
-
import { privateApis as blockEditorPrivateApis, store as blockEditorStore, BlockList, BlockTools
|
|
6
|
+
import { privateApis as blockEditorPrivateApis, store as blockEditorStore, BlockList, BlockTools } from '@wordpress/block-editor';
|
|
7
7
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
8
8
|
import { createBlock } from '@wordpress/blocks';
|
|
9
|
-
import {
|
|
10
|
-
import { __unstableStripHTML as stripHTML } from '@wordpress/dom';
|
|
9
|
+
import { VisuallyHidden } from '@wordpress/components';
|
|
11
10
|
import { useCallback, useEffect, useState } from '@wordpress/element';
|
|
12
11
|
import { store as coreStore } from '@wordpress/core-data';
|
|
13
12
|
/**
|
|
@@ -15,46 +14,7 @@ import { store as coreStore } from '@wordpress/core-data';
|
|
|
15
14
|
*/
|
|
16
15
|
|
|
17
16
|
import { unlock } from '../../private-apis';
|
|
18
|
-
import
|
|
19
|
-
|
|
20
|
-
function CustomLinkAdditionalBlockUI(_ref) {
|
|
21
|
-
let {
|
|
22
|
-
block,
|
|
23
|
-
onClose
|
|
24
|
-
} = _ref;
|
|
25
|
-
const {
|
|
26
|
-
updateBlockAttributes
|
|
27
|
-
} = useDispatch(blockEditorStore);
|
|
28
|
-
const {
|
|
29
|
-
label,
|
|
30
|
-
url,
|
|
31
|
-
opensInNewTab
|
|
32
|
-
} = block.attributes;
|
|
33
|
-
const link = {
|
|
34
|
-
url,
|
|
35
|
-
opensInNewTab,
|
|
36
|
-
title: label && stripHTML(label)
|
|
37
|
-
};
|
|
38
|
-
return createElement(Popover, {
|
|
39
|
-
placement: "bottom",
|
|
40
|
-
shift: true,
|
|
41
|
-
onClose: onClose
|
|
42
|
-
}, createElement(LinkControl, {
|
|
43
|
-
hasTextControl: true,
|
|
44
|
-
hasRichPreviews: true,
|
|
45
|
-
value: link,
|
|
46
|
-
onChange: updatedValue => {
|
|
47
|
-
updateBlockAttributes(block.clientId, {
|
|
48
|
-
label: updatedValue.title,
|
|
49
|
-
url: updatedValue.url,
|
|
50
|
-
opensInNewTab: updatedValue.opensInNewTab
|
|
51
|
-
});
|
|
52
|
-
onClose();
|
|
53
|
-
},
|
|
54
|
-
onCancel: onClose
|
|
55
|
-
}));
|
|
56
|
-
} // Needs to be kept in sync with the query used at packages/block-library/src/page-list/edit.js.
|
|
57
|
-
|
|
17
|
+
import LeafMoreMenu from './leaf-more-menu'; // Needs to be kept in sync with the query used at packages/block-library/src/page-list/edit.js.
|
|
58
18
|
|
|
59
19
|
const MAX_PAGE_COUNT = 100;
|
|
60
20
|
const PAGES_QUERY = ['postType', 'page', {
|
|
@@ -66,11 +26,11 @@ const PAGES_QUERY = ['postType', 'page', {
|
|
|
66
26
|
orderby: 'menu_order',
|
|
67
27
|
order: 'asc'
|
|
68
28
|
}];
|
|
69
|
-
export default function NavigationMenuContent(
|
|
29
|
+
export default function NavigationMenuContent(_ref) {
|
|
70
30
|
let {
|
|
71
31
|
rootClientId,
|
|
72
32
|
onSelect
|
|
73
|
-
} =
|
|
33
|
+
} = _ref;
|
|
74
34
|
const [isLoading, setIsLoading] = useState(true);
|
|
75
35
|
const {
|
|
76
36
|
clientIdsTree,
|
|
@@ -101,20 +61,7 @@ export default function NavigationMenuContent(_ref2) {
|
|
|
101
61
|
const {
|
|
102
62
|
replaceBlock,
|
|
103
63
|
__unstableMarkNextChangeAsNotPersistent
|
|
104
|
-
} = useDispatch(blockEditorStore);
|
|
105
|
-
const [customLinkEditPopoverOpenId, setIsCustomLinkEditPopoverOpenId] = useState(false);
|
|
106
|
-
const renderAdditionalBlockUICallback = useCallback(block => {
|
|
107
|
-
if (customLinkEditPopoverOpenId && block.clientId === customLinkEditPopoverOpenId) {
|
|
108
|
-
return createElement(CustomLinkAdditionalBlockUI, {
|
|
109
|
-
block: block,
|
|
110
|
-
onClose: () => {
|
|
111
|
-
setIsCustomLinkEditPopoverOpenId(false);
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return null;
|
|
117
|
-
}, [customLinkEditPopoverOpenId, setIsCustomLinkEditPopoverOpenId]); // Delay loading stop by 50ms to avoid flickering.
|
|
64
|
+
} = useDispatch(blockEditorStore); // Delay loading stop by 50ms to avoid flickering.
|
|
118
65
|
|
|
119
66
|
useEffect(() => {
|
|
120
67
|
let timeoutId;
|
|
@@ -137,32 +84,26 @@ export default function NavigationMenuContent(_ref2) {
|
|
|
137
84
|
};
|
|
138
85
|
}, [shouldKeepLoading, clientIdsTree, isLoading]);
|
|
139
86
|
const {
|
|
140
|
-
|
|
141
|
-
LeafMoreMenu
|
|
87
|
+
PrivateListView
|
|
142
88
|
} = unlock(blockEditorPrivateApis);
|
|
143
89
|
const offCanvasOnselect = useCallback(block => {
|
|
144
90
|
if (block.name === 'core/navigation-link' && !block.attributes.url) {
|
|
145
91
|
__unstableMarkNextChangeAsNotPersistent();
|
|
146
92
|
|
|
147
93
|
replaceBlock(block.clientId, createBlock('core/navigation-link', block.attributes));
|
|
148
|
-
} else if (block.name === 'core/navigation-link' && block.attributes.kind === 'custom' && block.attributes.url) {
|
|
149
|
-
setIsCustomLinkEditPopoverOpenId(block.clientId);
|
|
150
94
|
} else {
|
|
151
95
|
onSelect(block);
|
|
152
96
|
}
|
|
153
|
-
}, [onSelect, __unstableMarkNextChangeAsNotPersistent, replaceBlock
|
|
97
|
+
}, [onSelect, __unstableMarkNextChangeAsNotPersistent, replaceBlock]); // The hidden block is needed because it makes block edit side effects trigger.
|
|
154
98
|
// For example a navigation page list load its items has an effect on edit to load its items.
|
|
155
99
|
|
|
156
|
-
return createElement(Fragment, null,
|
|
100
|
+
return createElement(Fragment, null, !isLoading && createElement(PrivateListView, {
|
|
157
101
|
blocks: isSinglePageList ? clientIdsTree[0].innerBlocks : clientIdsTree,
|
|
158
102
|
onSelect: offCanvasOnselect,
|
|
159
|
-
|
|
160
|
-
showAppender: false
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
style: {
|
|
164
|
-
visibility: 'hidden'
|
|
165
|
-
}
|
|
103
|
+
blockSettingsMenu: LeafMoreMenu,
|
|
104
|
+
showAppender: false
|
|
105
|
+
}), createElement(VisuallyHidden, {
|
|
106
|
+
"aria-hidden": "true"
|
|
166
107
|
}, createElement(BlockTools, null, createElement(BlockList, null))));
|
|
167
108
|
}
|
|
168
109
|
//# sourceMappingURL=navigation-menu-content.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js"],"names":["privateApis","blockEditorPrivateApis","store","blockEditorStore","BlockList","BlockTools","__experimentalLinkControl","LinkControl","useDispatch","useSelect","createBlock","Popover","__unstableStripHTML","stripHTML","useCallback","useEffect","useState","coreStore","unlock","NavigationMenuLoader","CustomLinkAdditionalBlockUI","block","onClose","updateBlockAttributes","label","url","opensInNewTab","attributes","link","title","updatedValue","clientId","MAX_PAGE_COUNT","PAGES_QUERY","per_page","_fields","orderby","order","NavigationMenuContent","rootClientId","onSelect","isLoading","setIsLoading","clientIdsTree","shouldKeepLoading","isSinglePageList","select","__unstableGetClientIdsTree","areInnerBlocksControlled","getBlockName","isResolving","_clientIdsTree","hasOnlyPageListBlock","length","isLoadingPages","innerBlocks","replaceBlock","__unstableMarkNextChangeAsNotPersistent","customLinkEditPopoverOpenId","setIsCustomLinkEditPopoverOpenId","renderAdditionalBlockUICallback","timeoutId","setTimeout","undefined","clearTimeout","OffCanvasEditor","LeafMoreMenu","offCanvasOnselect","name","kind","visibility"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,WAAW,IAAIC,sBADhB,EAECC,KAAK,IAAIC,gBAFV,EAGCC,SAHD,EAICC,UAJD,EAKCC,yBAAyB,IAAIC,WAL9B,QAMO,yBANP;AAOA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,WAAT,QAA4B,mBAA5B;AACA,SAASC,OAAT,QAAwB,uBAAxB;AACA,SAASC,mBAAmB,IAAIC,SAAhC,QAAiD,gBAAjD;AACA,SAASC,WAAT,EAAsBC,SAAtB,EAAiCC,QAAjC,QAAiD,oBAAjD;AACA,SAASd,KAAK,IAAIe,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;A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AACM,UAAN,CAAiBF,GAFpB,EAGE;AACDgC,MAAAA,uCAAuC;;AACvCD,MAAAA,YAAY,CACXnC,KAAK,CAACU,QADK,EAEXrB,WAAW,CAAE,sBAAF,EAA0BW,KAAK,CAACM,UAAhC,CAFA,CAAZ;AAIA,KATD,MASO,IACNN,KAAK,CAAC+C,IAAN,KAAe,sBAAf,IACA/C,KAAK,CAACM,UAAN,CAAiB0C,IAAjB,KAA0B,QAD1B,IAEAhD,KAAK,CAACM,UAAN,CAAiBF,GAHX,EAIL;AACDkC,MAAAA,gCAAgC,CAAEtC,KAAK,CAACU,QAAR,CAAhC;AACA,KANM,MAMA;AACNS,MAAAA,QAAQ,CAAEnB,KAAF,CAAR;AACA;AACD,GApBmC,EAqBpC,CACCmB,QADD,EAECiB,uCAFD,EAGCD,YAHD,EAICG,gCAJD,CArBoC,CAArC,CAlF2E,CA+G3E;AACA;;AACA,SACC,8BACGlB,SAAS,IAAI,cAAC,oBAAD,OADhB,EAEG,CAAEA,SAAF,IACD,cAAC,eAAD;AACC,IAAA,MAAM,EACLI,gBAAgB,GACbF,aAAa,CAAE,CAAF,CAAb,CAAmBY,WADN,GAEbZ,aAJL;AAMC,IAAA,QAAQ,EAAGwB,iBANZ;AAOC,IAAA,YAAY,EAAGD,YAPhB;AAQC,IAAA,YAAY,EAAG,KARhB;AASC,IAAA,uBAAuB,EAAGN;AAT3B,IAHF,EAeC;AAAK,IAAA,KAAK,EAAG;AAAEU,MAAAA,UAAU,EAAE;AAAd;AAAb,KACC,cAAC,UAAD,QACC,cAAC,SAAD,OADD,CADD,CAfD,CADD;AAuBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\tBlockList,\n\tBlockTools,\n\t__experimentalLinkControl as LinkControl,\n} from '@wordpress/block-editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { createBlock } from '@wordpress/blocks';\nimport { Popover } from '@wordpress/components';\nimport { __unstableStripHTML as stripHTML } from '@wordpress/dom';\nimport { useCallback, useEffect, useState } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\nimport { NavigationMenuLoader } from './loader';\n\nfunction CustomLinkAdditionalBlockUI( { block, onClose } ) {\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\tconst { label, url, opensInNewTab } = block.attributes;\n\tconst link = {\n\t\turl,\n\t\topensInNewTab,\n\t\ttitle: label && stripHTML( label ),\n\t};\n\treturn (\n\t\t<Popover placement=\"bottom\" shift onClose={ onClose }>\n\t\t\t<LinkControl\n\t\t\t\thasTextControl\n\t\t\t\thasRichPreviews\n\t\t\t\tvalue={ link }\n\t\t\t\tonChange={ ( updatedValue ) => {\n\t\t\t\t\tupdateBlockAttributes( block.clientId, {\n\t\t\t\t\t\tlabel: updatedValue.title,\n\t\t\t\t\t\turl: updatedValue.url,\n\t\t\t\t\t\topensInNewTab: updatedValue.opensInNewTab,\n\t\t\t\t\t} );\n\t\t\t\t\tonClose();\n\t\t\t\t} }\n\t\t\t\tonCancel={ onClose }\n\t\t\t/>\n\t\t</Popover>\n\t);\n}\n// Needs to be kept in sync with the query used at packages/block-library/src/page-list/edit.js.\nconst MAX_PAGE_COUNT = 100;\nconst PAGES_QUERY = [\n\t'postType',\n\t'page',\n\t{\n\t\tper_page: MAX_PAGE_COUNT,\n\t\t_fields: [ 'id', 'link', 'menu_order', 'parent', 'title', 'type' ],\n\t\t// TODO: When https://core.trac.wordpress.org/ticket/39037 REST API support for multiple orderby\n\t\t// values is resolved, update 'orderby' to [ 'menu_order', 'post_title' ] to provide a consistent\n\t\t// sort.\n\t\torderby: 'menu_order',\n\t\torder: 'asc',\n\t},\n];\n\nexport default function NavigationMenuContent( { rootClientId, onSelect } ) {\n\tconst [ isLoading, setIsLoading ] = useState( true );\n\tconst { clientIdsTree, shouldKeepLoading, isSinglePageList } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__unstableGetClientIdsTree,\n\t\t\t\tareInnerBlocksControlled,\n\t\t\t\tgetBlockName,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst { isResolving } = select( coreStore );\n\n\t\t\tconst _clientIdsTree = __unstableGetClientIdsTree( rootClientId );\n\t\t\tconst hasOnlyPageListBlock =\n\t\t\t\t_clientIdsTree.length === 1 &&\n\t\t\t\tgetBlockName( _clientIdsTree[ 0 ].clientId ) ===\n\t\t\t\t\t'core/page-list';\n\t\t\tconst isLoadingPages = isResolving(\n\t\t\t\t'getEntityRecords',\n\t\t\t\tPAGES_QUERY\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tclientIdsTree: _clientIdsTree,\n\t\t\t\t// This is a small hack to wait for the navigation block\n\t\t\t\t// to actually load its inner blocks.\n\t\t\t\tshouldKeepLoading:\n\t\t\t\t\t! areInnerBlocksControlled( rootClientId ) ||\n\t\t\t\t\tisLoadingPages,\n\t\t\t\tisSinglePageList:\n\t\t\t\t\thasOnlyPageListBlock &&\n\t\t\t\t\t! isLoadingPages &&\n\t\t\t\t\t_clientIdsTree[ 0 ].innerBlocks.length > 0,\n\t\t\t};\n\t\t},\n\t\t[ rootClientId ]\n\t);\n\tconst { replaceBlock, __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\tconst [ customLinkEditPopoverOpenId, setIsCustomLinkEditPopoverOpenId ] =\n\t\tuseState( false );\n\n\tconst renderAdditionalBlockUICallback = useCallback(\n\t\t( block ) => {\n\t\t\tif (\n\t\t\t\tcustomLinkEditPopoverOpenId &&\n\t\t\t\tblock.clientId === customLinkEditPopoverOpenId\n\t\t\t) {\n\t\t\t\treturn (\n\t\t\t\t\t<CustomLinkAdditionalBlockUI\n\t\t\t\t\t\tblock={ block }\n\t\t\t\t\t\tonClose={ () => {\n\t\t\t\t\t\t\tsetIsCustomLinkEditPopoverOpenId( false );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn null;\n\t\t},\n\t\t[ customLinkEditPopoverOpenId, setIsCustomLinkEditPopoverOpenId ]\n\t);\n\n\t// Delay loading stop by 50ms to avoid flickering.\n\tuseEffect( () => {\n\t\tlet timeoutId;\n\t\tif ( shouldKeepLoading && ! isLoading ) {\n\t\t\tsetIsLoading( true );\n\t\t}\n\t\tif ( ! shouldKeepLoading && isLoading ) {\n\t\t\ttimeoutId = setTimeout( () => {\n\t\t\t\tsetIsLoading( false );\n\t\t\t\ttimeoutId = undefined;\n\t\t\t}, 50 );\n\t\t}\n\t\treturn () => {\n\t\t\tif ( timeoutId ) {\n\t\t\t\tclearTimeout( timeoutId );\n\t\t\t}\n\t\t};\n\t}, [ shouldKeepLoading, clientIdsTree, isLoading ] );\n\n\tconst { OffCanvasEditor, LeafMoreMenu } = unlock( blockEditorPrivateApis );\n\n\tconst offCanvasOnselect = useCallback(\n\t\t( block ) => {\n\t\t\tif (\n\t\t\t\tblock.name === 'core/navigation-link' &&\n\t\t\t\t! block.attributes.url\n\t\t\t) {\n\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\treplaceBlock(\n\t\t\t\t\tblock.clientId,\n\t\t\t\t\tcreateBlock( 'core/navigation-link', block.attributes )\n\t\t\t\t);\n\t\t\t} else if (\n\t\t\t\tblock.name === 'core/navigation-link' &&\n\t\t\t\tblock.attributes.kind === 'custom' &&\n\t\t\t\tblock.attributes.url\n\t\t\t) {\n\t\t\t\tsetIsCustomLinkEditPopoverOpenId( block.clientId );\n\t\t\t} else {\n\t\t\t\tonSelect( block );\n\t\t\t}\n\t\t},\n\t\t[\n\t\t\tonSelect,\n\t\t\t__unstableMarkNextChangeAsNotPersistent,\n\t\t\treplaceBlock,\n\t\t\tsetIsCustomLinkEditPopoverOpenId,\n\t\t]\n\t);\n\n\t// The hidden block is needed because it makes block edit side effects trigger.\n\t// For example a navigation page list load its items has an effect on edit to load its items.\n\treturn (\n\t\t<>\n\t\t\t{ isLoading && <NavigationMenuLoader /> }\n\t\t\t{ ! isLoading && (\n\t\t\t\t<OffCanvasEditor\n\t\t\t\t\tblocks={\n\t\t\t\t\t\tisSinglePageList\n\t\t\t\t\t\t\t? clientIdsTree[ 0 ].innerBlocks\n\t\t\t\t\t\t\t: clientIdsTree\n\t\t\t\t\t}\n\t\t\t\t\tonSelect={ offCanvasOnselect }\n\t\t\t\t\tLeafMoreMenu={ LeafMoreMenu }\n\t\t\t\t\tshowAppender={ false }\n\t\t\t\t\trenderAdditionalBlockUI={ renderAdditionalBlockUICallback }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<div style={ { visibility: 'hidden' } }>\n\t\t\t\t<BlockTools>\n\t\t\t\t\t<BlockList />\n\t\t\t\t</BlockTools>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js"],"names":["privateApis","blockEditorPrivateApis","store","blockEditorStore","BlockList","BlockTools","useDispatch","useSelect","createBlock","VisuallyHidden","useCallback","useEffect","useState","coreStore","unlock","LeafMoreMenu","MAX_PAGE_COUNT","PAGES_QUERY","per_page","_fields","orderby","order","NavigationMenuContent","rootClientId","onSelect","isLoading","setIsLoading","clientIdsTree","shouldKeepLoading","isSinglePageList","select","__unstableGetClientIdsTree","areInnerBlocksControlled","getBlockName","isResolving","_clientIdsTree","hasOnlyPageListBlock","length","clientId","isLoadingPages","innerBlocks","replaceBlock","__unstableMarkNextChangeAsNotPersistent","timeoutId","setTimeout","undefined","clearTimeout","PrivateListView","offCanvasOnselect","block","name","attributes","url"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,WAAW,IAAIC,sBADhB,EAECC,KAAK,IAAIC,gBAFV,EAGCC,SAHD,EAICC,UAJD,QAKO,yBALP;AAMA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,WAAT,QAA4B,mBAA5B;A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AiBC,GAFpB,EAGE;AACDV,MAAAA,uCAAuC;;AACvCD,MAAAA,YAAY,CACXQ,KAAK,CAACX,QADK,EAEX9B,WAAW,CAAE,sBAAF,EAA0ByC,KAAK,CAACE,UAAhC,CAFA,CAAZ;AAIA,KATD,MASO;AACN3B,MAAAA,QAAQ,CAAEyB,KAAF,CAAR;AACA;AACD,GAdmC,EAepC,CAAEzB,QAAF,EAAYkB,uCAAZ,EAAqDD,YAArD,CAfoC,CAArC,CA1D2E,CA4E3E;AACA;;AACA,SACC,8BACG,CAAEhB,SAAF,IACD,cAAC,eAAD;AACC,IAAA,MAAM,EACLI,gBAAgB,GACbF,aAAa,CAAE,CAAF,CAAb,CAAmBa,WADN,GAEbb,aAJL;AAMC,IAAA,QAAQ,EAAGqB,iBANZ;AAOC,IAAA,iBAAiB,EAAGjC,YAPrB;AAQC,IAAA,YAAY,EAAG;AARhB,IAFF,EAaC,cAAC,cAAD;AAAgB,mBAAY;AAA5B,KACC,cAAC,UAAD,QACC,cAAC,SAAD,OADD,CADD,CAbD,CADD;AAqBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\tBlockList,\n\tBlockTools,\n} from '@wordpress/block-editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { createBlock } from '@wordpress/blocks';\nimport { VisuallyHidden } from '@wordpress/components';\nimport { useCallback, useEffect, useState } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\nimport LeafMoreMenu from './leaf-more-menu';\n\n// Needs to be kept in sync with the query used at packages/block-library/src/page-list/edit.js.\nconst MAX_PAGE_COUNT = 100;\nconst PAGES_QUERY = [\n\t'postType',\n\t'page',\n\t{\n\t\tper_page: MAX_PAGE_COUNT,\n\t\t_fields: [ 'id', 'link', 'menu_order', 'parent', 'title', 'type' ],\n\t\t// TODO: When https://core.trac.wordpress.org/ticket/39037 REST API support for multiple orderby\n\t\t// values is resolved, update 'orderby' to [ 'menu_order', 'post_title' ] to provide a consistent\n\t\t// sort.\n\t\torderby: 'menu_order',\n\t\torder: 'asc',\n\t},\n];\n\nexport default function NavigationMenuContent( { rootClientId, onSelect } ) {\n\tconst [ isLoading, setIsLoading ] = useState( true );\n\tconst { clientIdsTree, shouldKeepLoading, isSinglePageList } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__unstableGetClientIdsTree,\n\t\t\t\tareInnerBlocksControlled,\n\t\t\t\tgetBlockName,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst { isResolving } = select( coreStore );\n\n\t\t\tconst _clientIdsTree = __unstableGetClientIdsTree( rootClientId );\n\t\t\tconst hasOnlyPageListBlock =\n\t\t\t\t_clientIdsTree.length === 1 &&\n\t\t\t\tgetBlockName( _clientIdsTree[ 0 ].clientId ) ===\n\t\t\t\t\t'core/page-list';\n\t\t\tconst isLoadingPages = isResolving(\n\t\t\t\t'getEntityRecords',\n\t\t\t\tPAGES_QUERY\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tclientIdsTree: _clientIdsTree,\n\t\t\t\t// This is a small hack to wait for the navigation block\n\t\t\t\t// to actually load its inner blocks.\n\t\t\t\tshouldKeepLoading:\n\t\t\t\t\t! areInnerBlocksControlled( rootClientId ) ||\n\t\t\t\t\tisLoadingPages,\n\t\t\t\tisSinglePageList:\n\t\t\t\t\thasOnlyPageListBlock &&\n\t\t\t\t\t! isLoadingPages &&\n\t\t\t\t\t_clientIdsTree[ 0 ].innerBlocks.length > 0,\n\t\t\t};\n\t\t},\n\t\t[ rootClientId ]\n\t);\n\tconst { replaceBlock, __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\n\t// Delay loading stop by 50ms to avoid flickering.\n\tuseEffect( () => {\n\t\tlet timeoutId;\n\t\tif ( shouldKeepLoading && ! isLoading ) {\n\t\t\tsetIsLoading( true );\n\t\t}\n\t\tif ( ! shouldKeepLoading && isLoading ) {\n\t\t\ttimeoutId = setTimeout( () => {\n\t\t\t\tsetIsLoading( false );\n\t\t\t\ttimeoutId = undefined;\n\t\t\t}, 50 );\n\t\t}\n\t\treturn () => {\n\t\t\tif ( timeoutId ) {\n\t\t\t\tclearTimeout( timeoutId );\n\t\t\t}\n\t\t};\n\t}, [ shouldKeepLoading, clientIdsTree, isLoading ] );\n\n\tconst { PrivateListView } = unlock( blockEditorPrivateApis );\n\tconst offCanvasOnselect = useCallback(\n\t\t( block ) => {\n\t\t\tif (\n\t\t\t\tblock.name === 'core/navigation-link' &&\n\t\t\t\t! block.attributes.url\n\t\t\t) {\n\t\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\t\treplaceBlock(\n\t\t\t\t\tblock.clientId,\n\t\t\t\t\tcreateBlock( 'core/navigation-link', block.attributes )\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tonSelect( block );\n\t\t\t}\n\t\t},\n\t\t[ onSelect, __unstableMarkNextChangeAsNotPersistent, replaceBlock ]\n\t);\n\n\t// The hidden block is needed because it makes block edit side effects trigger.\n\t// For example a navigation page list load its items has an effect on edit to load its items.\n\treturn (\n\t\t<>\n\t\t\t{ ! isLoading && (\n\t\t\t\t<PrivateListView\n\t\t\t\t\tblocks={\n\t\t\t\t\t\tisSinglePageList\n\t\t\t\t\t\t\t? clientIdsTree[ 0 ].innerBlocks\n\t\t\t\t\t\t\t: clientIdsTree\n\t\t\t\t\t}\n\t\t\t\t\tonSelect={ offCanvasOnselect }\n\t\t\t\t\tblockSettingsMenu={ LeafMoreMenu }\n\t\t\t\t\tshowAppender={ false }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t<VisuallyHidden aria-hidden=\"true\">\n\t\t\t\t<BlockTools>\n\t\t\t\t\t<BlockList />\n\t\t\t\t</BlockTools>\n\t\t\t</VisuallyHidden>\n\t\t</>\n\t);\n}\n"]}
|
package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import { createElement } from "@wordpress/element";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* WordPress dependencies
|
|
6
|
+
*/
|
|
7
|
+
import { __experimentalNavigatorButton as NavigatorButton } from '@wordpress/components';
|
|
8
|
+
import { useEntityRecords } from '@wordpress/core-data';
|
|
9
|
+
/**
|
|
10
|
+
* Internal dependencies
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { PRELOADED_NAVIGATION_MENUS_QUERY } from './constants';
|
|
14
|
+
export default function SidebarNavigationScreenNavigationMenuButton(_ref) {
|
|
15
|
+
let {
|
|
16
|
+
children,
|
|
17
|
+
...props
|
|
18
|
+
} = _ref;
|
|
19
|
+
const {
|
|
20
|
+
records: navigationMenus,
|
|
21
|
+
isResolving: isLoading
|
|
22
|
+
} = useEntityRecords('postType', `wp_navigation`, PRELOADED_NAVIGATION_MENUS_QUERY);
|
|
23
|
+
const hasNavigationMenus = !!(navigationMenus !== null && navigationMenus !== void 0 && navigationMenus.length);
|
|
24
|
+
const hasSingleNavigationMenu = (navigationMenus === null || navigationMenus === void 0 ? void 0 : navigationMenus.length) === 1;
|
|
25
|
+
const firstNavigationMenu = navigationMenus === null || navigationMenus === void 0 ? void 0 : navigationMenus[0];
|
|
26
|
+
const showNavigationScreen = process.env.IS_GUTENBERG_PLUGIN ? hasNavigationMenus : false; // If there is a single menu then we can go directly to that menu.
|
|
27
|
+
// Otherwise we go to the navigation listing screen.
|
|
28
|
+
|
|
29
|
+
const path = hasSingleNavigationMenu ? `/navigation/wp_navigation/${firstNavigationMenu === null || firstNavigationMenu === void 0 ? void 0 : firstNavigationMenu.id}` : '/navigation';
|
|
30
|
+
|
|
31
|
+
if (!showNavigationScreen) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return createElement(NavigatorButton, _extends({}, props, {
|
|
36
|
+
disabled: isLoading,
|
|
37
|
+
path: path
|
|
38
|
+
}), children);
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=navigator-button.js.map
|
package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/navigator-button.js"],"names":["__experimentalNavigatorButton","NavigatorButton","useEntityRecords","PRELOADED_NAVIGATION_MENUS_QUERY","SidebarNavigationScreenNavigationMenuButton","children","props","records","navigationMenus","isResolving","isLoading","hasNavigationMenus","length","hasSingleNavigationMenu","firstNavigationMenu","showNavigationScreen","process","env","IS_GUTENBERG_PLUGIN","path","id"],"mappings":";;;AAAA;AACA;AACA;AAEA,SAASA,6BAA6B,IAAIC,eAA1C,QAAiE,uBAAjE;AACA,SAASC,gBAAT,QAAiC,sBAAjC;AAEA;AACA;AACA;;AACA,SAASC,gCAAT,QAAiD,aAAjD;AAEA,eAAe,SAASC,2CAAT,OAGX;AAAA,MAHiE;AACpEC,IAAAA,QADoE;AAEpE,OAAGC;AAFiE,GAGjE;AACH,QAAM;AAAEC,IAAAA,OAAO,EAAEC,eAAX;AAA4BC,IAAAA,WAAW,EAAEC;AAAzC,MACLR,gBAAgB,CACf,UADe,EAEd,eAFc,EAGfC,gCAHe,CADjB;AAOA,QAAMQ,kBAAkB,GAAG,CAAC,EAAEH,eAAF,aAAEA,eAAF,eAAEA,eAAe,CAAEI,MAAnB,CAA5B;AACA,QAAMC,uBAAuB,GAAG,CAAAL,eAAe,SAAf,IAAAA,eAAe,WAAf,YAAAA,eAAe,CAAEI,MAAjB,MAA4B,CAA5D;AACA,QAAME,mBAAmB,GAAGN,eAAH,aAAGA,eAAH,uBAAGA,eAAe,CAAI,CAAJ,CAA3C;AAEA,QAAMO,oBAAoB,GAAGC,OAAO,CAACC,GAAR,CAAYC,mBAAZ,GAC1BP,kBAD0B,GAE1B,KAFH,CAZG,CAgBH;AACA;;AACA,QAAMQ,IAAI,GAAGN,uBAAuB,GAChC,6BAA6BC,mBAA9B,aAA8BA,mBAA9B,uBAA8BA,mBAAmB,CAAEM,EAAI,EADtB,GAEjC,aAFH;;AAIA,MAAK,CAAEL,oBAAP,EAA8B;AAC7B,WAAO,IAAP;AACA;;AAED,SACC,cAAC,eAAD,eAAsBT,KAAtB;AAA8B,IAAA,QAAQ,EAAGI,SAAzC;AAAqD,IAAA,IAAI,EAAGS;AAA5D,MACGd,QADH,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __experimentalNavigatorButton as NavigatorButton } from '@wordpress/components';\nimport { useEntityRecords } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { PRELOADED_NAVIGATION_MENUS_QUERY } from './constants';\n\nexport default function SidebarNavigationScreenNavigationMenuButton( {\n\tchildren,\n\t...props\n} ) {\n\tconst { records: navigationMenus, isResolving: isLoading } =\n\t\tuseEntityRecords(\n\t\t\t'postType',\n\t\t\t`wp_navigation`,\n\t\t\tPRELOADED_NAVIGATION_MENUS_QUERY\n\t\t);\n\n\tconst hasNavigationMenus = !! navigationMenus?.length;\n\tconst hasSingleNavigationMenu = navigationMenus?.length === 1;\n\tconst firstNavigationMenu = navigationMenus?.[ 0 ];\n\n\tconst showNavigationScreen = process.env.IS_GUTENBERG_PLUGIN\n\t\t? hasNavigationMenus\n\t\t: false;\n\n\t// If there is a single menu then we can go directly to that menu.\n\t// Otherwise we go to the navigation listing screen.\n\tconst path = hasSingleNavigationMenu\n\t\t? `/navigation/wp_navigation/${ firstNavigationMenu?.id }`\n\t\t: '/navigation';\n\n\tif ( ! showNavigationScreen ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<NavigatorButton { ...props } disabled={ isLoading } path={ path }>\n\t\t\t{ children }\n\t\t</NavigatorButton>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { __ } from '@wordpress/i18n';
|
|
7
|
+
import { useDispatch } from '@wordpress/data';
|
|
8
|
+
import { __experimentalUseNavigator as useNavigator, ExternalLink } from '@wordpress/components';
|
|
9
|
+
import { useEntityRecord } from '@wordpress/core-data';
|
|
10
|
+
import { decodeEntities } from '@wordpress/html-entities';
|
|
11
|
+
import { pencil } from '@wordpress/icons';
|
|
12
|
+
/**
|
|
13
|
+
* Internal dependencies
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
17
|
+
import { unlock } from '../../private-apis';
|
|
18
|
+
import { store as editSiteStore } from '../../store';
|
|
19
|
+
import SidebarButton from '../sidebar-button';
|
|
20
|
+
export default function SidebarNavigationScreenPage() {
|
|
21
|
+
var _record$title, _record$description;
|
|
22
|
+
|
|
23
|
+
const {
|
|
24
|
+
setCanvasMode
|
|
25
|
+
} = unlock(useDispatch(editSiteStore));
|
|
26
|
+
const {
|
|
27
|
+
params: {
|
|
28
|
+
postId
|
|
29
|
+
}
|
|
30
|
+
} = useNavigator();
|
|
31
|
+
const {
|
|
32
|
+
record
|
|
33
|
+
} = useEntityRecord('postType', 'page', postId);
|
|
34
|
+
return createElement(SidebarNavigationScreen, {
|
|
35
|
+
title: record ? decodeEntities(record === null || record === void 0 ? void 0 : (_record$title = record.title) === null || _record$title === void 0 ? void 0 : _record$title.rendered) : null,
|
|
36
|
+
actions: createElement(SidebarButton, {
|
|
37
|
+
onClick: () => setCanvasMode('edit'),
|
|
38
|
+
label: __('Edit'),
|
|
39
|
+
icon: pencil
|
|
40
|
+
}),
|
|
41
|
+
description: __('Pages are static and are not listed by date. Pages do not use tags or categories.'),
|
|
42
|
+
content: createElement(Fragment, null, record !== null && record !== void 0 && record.link ? createElement(ExternalLink, {
|
|
43
|
+
className: "edit-site-sidebar-navigation-screen__page-link",
|
|
44
|
+
href: record.link
|
|
45
|
+
}, record.link) : null, record ? decodeEntities(record === null || record === void 0 ? void 0 : (_record$description = record.description) === null || _record$description === void 0 ? void 0 : _record$description.rendered) : null)
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-page/index.js"],"names":["__","useDispatch","__experimentalUseNavigator","useNavigator","ExternalLink","useEntityRecord","decodeEntities","pencil","SidebarNavigationScreen","unlock","store","editSiteStore","SidebarButton","SidebarNavigationScreenPage","setCanvasMode","params","postId","record","title","rendered","link","description"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AACA,SAASC,WAAT,QAA4B,iBAA5B;AACA,SACCC,0BAA0B,IAAIC,YAD/B,EAECC,YAFD,QAGO,uBAHP;AAIA,SAASC,eAAT,QAAgC,sBAAhC;AACA,SAASC,cAAT,QAA+B,0BAA/B;AACA,SAASC,MAAT,QAAuB,kBAAvB;AAEA;AACA;AACA;;AACA,OAAOC,uBAAP,MAAoC,8BAApC;AACA,SAASC,MAAT,QAAuB,oBAAvB;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AACA,OAAOC,aAAP,MAA0B,mBAA1B;AAEA,eAAe,SAASC,2BAAT,GAAuC;AAAA;;AACrD,QAAM;AAAEC,IAAAA;AAAF,MAAoBL,MAAM,CAAER,WAAW,CAAEU,aAAF,CAAb,CAAhC;AACA,QAAM;AACLI,IAAAA,MAAM,EAAE;AAAEC,MAAAA;AAAF;AADH,MAEFb,YAAY,EAFhB;AAGA,QAAM;AAAEc,IAAAA;AAAF,MAAaZ,eAAe,CAAE,UAAF,EAAc,MAAd,EAAsBW,MAAtB,CAAlC;AAEA,SACC,cAAC,uBAAD;AACC,IAAA,KAAK,EAAGC,MAAM,GAAGX,cAAc,CAAEW,MAAF,aAAEA,MAAF,wCAAEA,MAAM,CAAEC,KAAV,kDAAE,cAAeC,QAAjB,CAAjB,GAA+C,IAD9D;AAEC,IAAA,OAAO,EACN,cAAC,aAAD;AACC,MAAA,OAAO,EAAG,MAAML,aAAa,CAAE,MAAF,CAD9B;AAEC,MAAA,KAAK,EAAGd,EAAE,CAAE,MAAF,CAFX;AAGC,MAAA,IAAI,EAAGO;AAHR,MAHF;AASC,IAAA,WAAW,EAAGP,EAAE,CACf,mFADe,CATjB;AAYC,IAAA,OAAO,EACN,8BACGiB,MAAM,SAAN,IAAAA,MAAM,WAAN,IAAAA,MAAM,CAAEG,IAAR,GACD,cAAC,YAAD;AACC,MAAA,SAAS,EAAC,gDADX;AAEC,MAAA,IAAI,EAAGH,MAAM,CAACG;AAFf,OAIGH,MAAM,CAACG,IAJV,CADC,GAOE,IARL,EASGH,MAAM,GACLX,cAAc,CAAEW,MAAF,aAAEA,MAAF,8CAAEA,MAAM,CAAEI,WAAV,wDAAE,oBAAqBF,QAAvB,CADT,GAEL,IAXJ;AAbF,IADD;AA8BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport {\n\t__experimentalUseNavigator as useNavigator,\n\tExternalLink,\n} from '@wordpress/components';\nimport { useEntityRecord } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { pencil } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { unlock } from '../../private-apis';\nimport { store as editSiteStore } from '../../store';\nimport SidebarButton from '../sidebar-button';\n\nexport default function SidebarNavigationScreenPage() {\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\tconst {\n\t\tparams: { postId },\n\t} = useNavigator();\n\tconst { record } = useEntityRecord( 'postType', 'page', postId );\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\ttitle={ record ? decodeEntities( record?.title?.rendered ) : null }\n\t\t\tactions={\n\t\t\t\t<SidebarButton\n\t\t\t\t\tonClick={ () => setCanvasMode( 'edit' ) }\n\t\t\t\t\tlabel={ __( 'Edit' ) }\n\t\t\t\t\ticon={ pencil }\n\t\t\t\t/>\n\t\t\t}\n\t\t\tdescription={ __(\n\t\t\t\t'Pages are static and are not listed by date. Pages do not use tags or categories.'\n\t\t\t) }\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ record?.link ? (\n\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__page-link\"\n\t\t\t\t\t\t\thref={ record.link }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ record.link }\n\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t) : null }\n\t\t\t\t\t{ record\n\t\t\t\t\t\t? decodeEntities( record?.description?.rendered )\n\t\t\t\t\t\t: null }\n\t\t\t\t</>\n\t\t\t}\n\t\t/>\n\t);\n}\n"]}
|