@wordpress/edit-site 5.14.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 +2 -0
- package/build/components/add-new-page/index.js +1 -6
- package/build/components/add-new-page/index.js.map +1 -1
- package/build/components/add-new-pattern/index.js +21 -7
- package/build/components/add-new-pattern/index.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/use-site-editor-settings.js +87 -13
- package/build/components/block-editor/use-site-editor-settings.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 +7 -3
- package/build/components/create-pattern-modal/index.js.map +1 -1
- package/build/components/editor/index.js +1 -1
- package/build/components/editor/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +13 -9
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/layout/index.js +8 -3
- package/build/components/layout/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 -16
- package/build/components/page-actions/trash-page-menu-item.js.map +1 -0
- 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-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 +83 -58
- package/build/components/page-patterns/grid-item.js.map +1 -1
- package/build/components/page-patterns/grid.js +5 -18
- package/build/components/page-patterns/grid.js.map +1 -1
- package/build/components/page-patterns/header.js +69 -0
- package/build/components/page-patterns/header.js.map +1 -0
- package/build/components/page-patterns/index.js +3 -1
- package/build/components/page-patterns/index.js.map +1 -1
- 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 +95 -30
- package/build/components/page-patterns/patterns-list.js.map +1 -1
- 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/use-patterns.js +102 -121
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- 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 +2 -23
- package/build/components/page-template-parts/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-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-navigation-screen/index.js +14 -8
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +4 -2
- 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/index.js +4 -4
- 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/single-navigation-menu.js +3 -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 +4 -3
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- 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-page/index.js +2 -3
- package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/status-label.js +1 -34
- 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 +9 -7
- package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +3 -2
- 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 +5 -2
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +72 -51
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js +9 -5
- package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +11 -1
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +20 -9
- package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
- package/build/components/site-hub/index.js +24 -11
- 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 +15 -12
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build/components/template-actions/index.js +3 -1
- 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/hooks/commands/use-common-commands.js +78 -20
- package/build/hooks/commands/use-common-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/store/private-actions.js +7 -1
- package/build/store/private-actions.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/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 +1 -6
- package/build-module/components/add-new-page/index.js.map +1 -1
- package/build-module/components/add-new-pattern/index.js +19 -7
- package/build-module/components/add-new-pattern/index.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/use-site-editor-settings.js +89 -14
- package/build-module/components/block-editor/use-site-editor-settings.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 +6 -3
- package/build-module/components/create-pattern-modal/index.js.map +1 -1
- package/build-module/components/editor/index.js +1 -1
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +13 -9
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/layout/index.js +8 -3
- package/build-module/components/layout/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 -17
- package/build-module/components/page-actions/trash-page-menu-item.js.map +1 -0
- 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-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 +84 -64
- package/build-module/components/page-patterns/grid-item.js.map +1 -1
- package/build-module/components/page-patterns/grid.js +5 -17
- package/build-module/components/page-patterns/grid.js.map +1 -1
- 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-patterns/index.js +3 -1
- package/build-module/components/page-patterns/index.js.map +1 -1
- 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 +96 -33
- package/build-module/components/page-patterns/patterns-list.js.map +1 -1
- 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/use-patterns.js +103 -122
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- 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 +3 -22
- package/build-module/components/page-template-parts/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-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-navigation-screen/index.js +15 -9
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +4 -3
- 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/index.js +4 -4
- 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/single-navigation-menu.js +3 -3
- 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 +4 -3
- 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/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-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/status-label.js +1 -32
- package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pages/index.js +33 -25
- package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/index.js +8 -7
- 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 +3 -2
- 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 +4 -2
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +76 -53
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js +9 -5
- package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +10 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +18 -9
- package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
- package/build-module/components/site-hub/index.js +24 -11
- 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 +16 -12
- 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 +2 -1
- 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/hooks/commands/use-common-commands.js +74 -20
- package/build-module/hooks/commands/use-common-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/store/private-actions.js +7 -1
- package/build-module/store/private-actions.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/use-activate-theme.js +1 -1
- package/build-module/utils/use-activate-theme.js.map +1 -1
- package/build-style/style-rtl.css +221 -63
- package/build-style/style.css +221 -63
- package/package.json +39 -40
- package/src/components/add-new-page/index.js +0 -3
- package/src/components/add-new-pattern/index.js +23 -12
- 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 +1 -1
- package/src/components/block-editor/index.js +0 -4
- package/src/components/block-editor/use-site-editor-settings.js +99 -20
- package/src/components/canvas-spinner/style.scss +14 -0
- package/src/components/code-editor/index.js +51 -33
- package/src/components/create-pattern-modal/index.js +5 -2
- package/src/components/editor/index.js +2 -2
- package/src/components/header-edit-mode/document-actions/style.scss +4 -0
- package/src/components/header-edit-mode/index.js +29 -22
- package/src/components/layout/index.js +16 -2
- package/src/components/layout/style.scss +2 -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 -22
- package/src/components/page-content-focus-manager/disable-non-page-content-blocks.js +12 -3
- package/src/components/page-patterns/duplicate-menu-item.js +196 -0
- package/src/components/page-patterns/grid-item.js +189 -133
- package/src/components/page-patterns/grid.js +3 -20
- package/src/components/page-patterns/header.js +69 -0
- package/src/components/page-patterns/index.js +6 -1
- package/src/components/page-patterns/pagination.js +80 -0
- package/src/components/page-patterns/patterns-list.js +160 -72
- package/src/components/page-patterns/rename-menu-item.js +115 -0
- package/src/components/page-patterns/style.scss +140 -30
- package/src/components/page-patterns/use-patterns.js +102 -172
- package/src/components/page-template-parts/add-new-template-part.js +57 -0
- package/src/components/page-template-parts/index.js +3 -22
- 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-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-navigation-item/style.scss +5 -12
- package/src/components/sidebar-navigation-screen/index.js +14 -7
- package/src/components/sidebar-navigation-screen/style.scss +14 -0
- 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/index.js +4 -3
- package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +1 -0
- package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +1 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +15 -5
- package/src/components/sidebar-navigation-screen-navigation-menus/constants.js +2 -0
- package/src/components/sidebar-navigation-screen-page/index.js +3 -3
- package/src/components/sidebar-navigation-screen-page/status-label.js +1 -35
- package/src/components/sidebar-navigation-screen-pages/index.js +39 -29
- package/src/components/sidebar-navigation-screen-pattern/index.js +5 -2
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +2 -1
- 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 +5 -2
- package/src/components/sidebar-navigation-screen-patterns/index.js +103 -98
- package/src/components/sidebar-navigation-screen-patterns/style.scss +20 -0
- package/src/components/sidebar-navigation-screen-patterns/use-my-patterns.js +7 -6
- package/src/components/sidebar-navigation-screen-patterns/use-pattern-categories.js +9 -0
- package/src/components/sidebar-navigation-screen-patterns/use-template-part-areas.js +31 -9
- package/src/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +2 -1
- package/src/components/site-hub/index.js +45 -28
- package/src/components/site-hub/style.scss +13 -0
- 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 +2 -1
- package/src/components/template-actions/rename-menu-item.js +17 -10
- package/src/components/use-edited-entity-record/index.js +6 -1
- package/src/hooks/commands/use-common-commands.js +56 -23
- package/src/hooks/push-changes-to-global-styles/index.js +63 -9
- package/src/store/private-actions.js +5 -1
- package/src/style.scss +10 -12
- package/src/utils/normalize-record-key.js +11 -0
- 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-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/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
|
@@ -88,7 +88,7 @@ function EditorCanvas( { enableResizing, settings, children, ...props } ) {
|
|
|
88
88
|
enableResizing ? 'min-height:0!important;' : ''
|
|
89
89
|
}}body{position:relative; ${
|
|
90
90
|
canvasMode === 'view'
|
|
91
|
-
? 'cursor: pointer; height: 100vh'
|
|
91
|
+
? 'cursor: pointer; min-height: 100vh;'
|
|
92
92
|
: ''
|
|
93
93
|
}}}`
|
|
94
94
|
}</style>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { useSelect } from '@wordpress/data';
|
|
4
|
+
import { useDispatch, useSelect } from '@wordpress/data';
|
|
5
5
|
import { useMemo } from '@wordpress/element';
|
|
6
6
|
import { store as coreStore } from '@wordpress/core-data';
|
|
7
7
|
/**
|
|
@@ -11,16 +11,73 @@ import { store as editSiteStore } from '../../store';
|
|
|
11
11
|
import { unlock } from '../../lock-unlock';
|
|
12
12
|
import inserterMediaCategories from './inserter-media-categories';
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
function useArchiveLabel( templateSlug ) {
|
|
15
|
+
const taxonomyMatches = templateSlug?.match(
|
|
16
|
+
/^(category|tag|taxonomy-([^-]+))$|^(((category|tag)|taxonomy-([^-]+))-(.+))$/
|
|
17
|
+
);
|
|
18
|
+
let taxonomy;
|
|
19
|
+
let term;
|
|
20
|
+
if ( taxonomyMatches ) {
|
|
21
|
+
// If is for a all taxonomies of a type
|
|
22
|
+
if ( taxonomyMatches[ 1 ] ) {
|
|
23
|
+
taxonomy = taxonomyMatches[ 2 ]
|
|
24
|
+
? taxonomyMatches[ 2 ]
|
|
25
|
+
: taxonomyMatches[ 1 ];
|
|
26
|
+
}
|
|
27
|
+
// If is for a all taxonomies of a type
|
|
28
|
+
else if ( taxonomyMatches[ 3 ] ) {
|
|
29
|
+
taxonomy = taxonomyMatches[ 6 ]
|
|
30
|
+
? taxonomyMatches[ 6 ]
|
|
31
|
+
: taxonomyMatches[ 4 ];
|
|
32
|
+
term = taxonomyMatches[ 7 ];
|
|
33
|
+
}
|
|
34
|
+
taxonomy = taxonomy === 'tag' ? 'post_tag' : taxonomy;
|
|
35
|
+
|
|
36
|
+
//getTaxonomy( 'category' );
|
|
37
|
+
//wp.data.select('core').getEntityRecords( 'taxonomy', 'category', {slug: 'newcat'} );
|
|
38
|
+
}
|
|
39
|
+
return useSelect(
|
|
40
|
+
( select ) => {
|
|
41
|
+
const { getEntityRecords, getTaxonomy } = select( coreStore );
|
|
42
|
+
let archiveTypeLabel;
|
|
43
|
+
let archiveNameLabel;
|
|
44
|
+
if ( taxonomy ) {
|
|
45
|
+
archiveTypeLabel =
|
|
46
|
+
getTaxonomy( taxonomy )?.labels?.singular_name;
|
|
47
|
+
}
|
|
48
|
+
if ( term ) {
|
|
49
|
+
const records = getEntityRecords( 'taxonomy', taxonomy, {
|
|
50
|
+
slug: term,
|
|
51
|
+
per_page: 1,
|
|
52
|
+
} );
|
|
53
|
+
if ( records && records[ 0 ] ) {
|
|
54
|
+
archiveNameLabel = records[ 0 ].name;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return {
|
|
58
|
+
archiveTypeLabel,
|
|
59
|
+
archiveNameLabel,
|
|
60
|
+
};
|
|
61
|
+
},
|
|
62
|
+
[ taxonomy, term ]
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export default function useSiteEditorSettings() {
|
|
67
|
+
const { setIsInserterOpened } = useDispatch( editSiteStore );
|
|
68
|
+
const { storedSettings, canvasMode, templateType } = useSelect(
|
|
69
|
+
( select ) => {
|
|
70
|
+
const { getSettings, getCanvasMode, getEditedPostType } = unlock(
|
|
71
|
+
select( editSiteStore )
|
|
72
|
+
);
|
|
73
|
+
return {
|
|
74
|
+
storedSettings: getSettings( setIsInserterOpened ),
|
|
75
|
+
canvasMode: getCanvasMode(),
|
|
76
|
+
templateType: getEditedPostType(),
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
[ setIsInserterOpened ]
|
|
80
|
+
);
|
|
24
81
|
|
|
25
82
|
const settingsBlockPatterns =
|
|
26
83
|
storedSettings.__experimentalAdditionalBlockPatterns ?? // WP 6.0
|
|
@@ -29,14 +86,27 @@ export default function useSiteEditorSettings( templateType ) {
|
|
|
29
86
|
storedSettings.__experimentalAdditionalBlockPatternCategories ?? // WP 6.0
|
|
30
87
|
storedSettings.__experimentalBlockPatternCategories; // WP 5.9
|
|
31
88
|
|
|
32
|
-
const { restBlockPatterns, restBlockPatternCategories } =
|
|
33
|
-
( select ) =>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
89
|
+
const { restBlockPatterns, restBlockPatternCategories, templateSlug } =
|
|
90
|
+
useSelect( ( select ) => {
|
|
91
|
+
const { getEditedPostType, getEditedPostId } =
|
|
92
|
+
select( editSiteStore );
|
|
93
|
+
const { getEditedEntityRecord } = select( coreStore );
|
|
94
|
+
const usedPostType = getEditedPostType();
|
|
95
|
+
const usedPostId = getEditedPostId();
|
|
96
|
+
const _record = getEditedEntityRecord(
|
|
97
|
+
'postType',
|
|
98
|
+
usedPostType,
|
|
99
|
+
usedPostId
|
|
100
|
+
);
|
|
101
|
+
return {
|
|
102
|
+
restBlockPatterns: select( coreStore ).getBlockPatterns(),
|
|
103
|
+
restBlockPatternCategories:
|
|
104
|
+
select( coreStore ).getBlockPatternCategories(),
|
|
105
|
+
templateSlug: _record.slug,
|
|
106
|
+
};
|
|
107
|
+
}, [] );
|
|
108
|
+
const archiveLabels = useArchiveLabel( templateSlug );
|
|
109
|
+
|
|
40
110
|
const blockPatterns = useMemo(
|
|
41
111
|
() =>
|
|
42
112
|
[
|
|
@@ -82,6 +152,15 @@ export default function useSiteEditorSettings( templateType ) {
|
|
|
82
152
|
__experimentalBlockPatterns: blockPatterns,
|
|
83
153
|
__experimentalBlockPatternCategories: blockPatternCategories,
|
|
84
154
|
focusMode: canvasMode === 'view' && focusMode ? false : focusMode,
|
|
155
|
+
__experimentalArchiveTitleTypeLabel: archiveLabels.archiveTypeLabel,
|
|
156
|
+
__experimentalArchiveTitleNameLabel: archiveLabels.archiveNameLabel,
|
|
85
157
|
};
|
|
86
|
-
}, [
|
|
158
|
+
}, [
|
|
159
|
+
storedSettings,
|
|
160
|
+
blockPatterns,
|
|
161
|
+
blockPatternCategories,
|
|
162
|
+
canvasMode,
|
|
163
|
+
archiveLabels.archiveTypeLabel,
|
|
164
|
+
archiveLabels.archiveNameLabel,
|
|
165
|
+
] );
|
|
87
166
|
}
|
|
@@ -2,10 +2,24 @@
|
|
|
2
2
|
width: 100%;
|
|
3
3
|
height: 100%;
|
|
4
4
|
display: flex;
|
|
5
|
+
opacity: 0;
|
|
5
6
|
align-items: center;
|
|
6
7
|
justify-content: center;
|
|
7
8
|
|
|
9
|
+
animation: 0.5s ease 1s edit-site-canvas-spinner__fade-in-animation;
|
|
10
|
+
animation-fill-mode: forwards;
|
|
11
|
+
@include reduce-motion("animation");
|
|
12
|
+
|
|
8
13
|
circle {
|
|
9
14
|
stroke: rgba($black, 0.3);
|
|
10
15
|
}
|
|
11
16
|
}
|
|
17
|
+
|
|
18
|
+
@keyframes edit-site-canvas-spinner__fade-in-animation {
|
|
19
|
+
from {
|
|
20
|
+
opacity: 0;
|
|
21
|
+
}
|
|
22
|
+
to {
|
|
23
|
+
opacity: 1;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -1,50 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import Textarea from 'react-autosize-textarea';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* WordPress dependencies
|
|
3
8
|
*/
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
9
|
+
import { __unstableSerializeAndClean } from '@wordpress/blocks';
|
|
10
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
6
11
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
7
12
|
import { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';
|
|
8
13
|
import { __ } from '@wordpress/i18n';
|
|
9
|
-
import { Button } from '@wordpress/components';
|
|
14
|
+
import { Button, VisuallyHidden } from '@wordpress/components';
|
|
15
|
+
import { useMemo } from '@wordpress/element';
|
|
16
|
+
import { useInstanceId } from '@wordpress/compose';
|
|
10
17
|
|
|
11
18
|
/**
|
|
12
19
|
* Internal dependencies
|
|
13
20
|
*/
|
|
14
21
|
import { store as editSiteStore } from '../../store';
|
|
15
|
-
import CodeEditorTextArea from './code-editor-text-area';
|
|
16
22
|
|
|
17
23
|
export default function CodeEditor() {
|
|
18
|
-
const
|
|
19
|
-
|
|
24
|
+
const instanceId = useInstanceId( CodeEditor );
|
|
25
|
+
const { shortcut, content, blocks, type, id } = useSelect( ( select ) => {
|
|
26
|
+
const { getEditedEntityRecord } = select( coreStore );
|
|
27
|
+
const { getEditedPostType, getEditedPostId } = select( editSiteStore );
|
|
20
28
|
const { getShortcutRepresentation } = select( keyboardShortcutsStore );
|
|
29
|
+
const _type = getEditedPostType();
|
|
30
|
+
const _id = getEditedPostId();
|
|
31
|
+
const editedRecord = getEditedEntityRecord( 'postType', _type, _id );
|
|
32
|
+
|
|
21
33
|
return {
|
|
22
|
-
templateType: getEditedPostType(),
|
|
23
34
|
shortcut: getShortcutRepresentation( 'core/edit-site/toggle-mode' ),
|
|
35
|
+
content: editedRecord?.content,
|
|
36
|
+
blocks: editedRecord?.blocks,
|
|
37
|
+
type: _type,
|
|
38
|
+
id: _id,
|
|
24
39
|
};
|
|
25
40
|
}, [] );
|
|
26
|
-
const
|
|
27
|
-
'postType',
|
|
28
|
-
templateType,
|
|
29
|
-
'content'
|
|
30
|
-
);
|
|
31
|
-
const [ blocks, , onChange ] = useEntityBlockEditor(
|
|
32
|
-
'postType',
|
|
33
|
-
templateType
|
|
34
|
-
);
|
|
35
|
-
|
|
41
|
+
const { editEntityRecord } = useDispatch( coreStore );
|
|
36
42
|
// Replicates the logic found in getEditedPostContent().
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
content
|
|
47
|
-
}
|
|
43
|
+
const realContent = useMemo( () => {
|
|
44
|
+
if ( content instanceof Function ) {
|
|
45
|
+
return content( { blocks } );
|
|
46
|
+
} else if ( blocks ) {
|
|
47
|
+
// If we have parsed blocks already, they should be our source of truth.
|
|
48
|
+
// Parsing applies block deprecations and legacy block conversions that
|
|
49
|
+
// unparsed content will not have.
|
|
50
|
+
return __unstableSerializeAndClean( blocks );
|
|
51
|
+
}
|
|
52
|
+
return content;
|
|
53
|
+
}, [ content, blocks ] );
|
|
48
54
|
|
|
49
55
|
const { switchEditorMode } = useDispatch( editSiteStore );
|
|
50
56
|
return (
|
|
@@ -60,14 +66,26 @@ export default function CodeEditor() {
|
|
|
60
66
|
</Button>
|
|
61
67
|
</div>
|
|
62
68
|
<div className="edit-site-code-editor__body">
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
69
|
+
<VisuallyHidden
|
|
70
|
+
as="label"
|
|
71
|
+
htmlFor={ `code-editor-text-area-${ instanceId }` }
|
|
72
|
+
>
|
|
73
|
+
{ __( 'Type text or HTML' ) }
|
|
74
|
+
</VisuallyHidden>
|
|
75
|
+
<Textarea
|
|
76
|
+
autoComplete="off"
|
|
77
|
+
dir="auto"
|
|
78
|
+
value={ realContent }
|
|
79
|
+
onChange={ ( event ) => {
|
|
80
|
+
editEntityRecord( 'postType', type, id, {
|
|
81
|
+
content: event.target.value,
|
|
82
|
+
blocks: undefined,
|
|
67
83
|
selection: undefined,
|
|
68
84
|
} );
|
|
69
85
|
} }
|
|
70
|
-
|
|
86
|
+
className="edit-site-code-editor-text-area"
|
|
87
|
+
id={ `code-editor-text-area-${ instanceId }` }
|
|
88
|
+
placeholder={ __( 'Start writing with text or HTML' ) }
|
|
71
89
|
/>
|
|
72
90
|
</div>
|
|
73
91
|
</div>
|
|
@@ -14,6 +14,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
14
14
|
import { useState } from '@wordpress/element';
|
|
15
15
|
import { store as noticesStore } from '@wordpress/notices';
|
|
16
16
|
import { useDispatch } from '@wordpress/data';
|
|
17
|
+
import { serialize } from '@wordpress/blocks';
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* Internal dependencies
|
|
@@ -21,9 +22,11 @@ import { useDispatch } from '@wordpress/data';
|
|
|
21
22
|
import { SYNC_TYPES, USER_PATTERN_CATEGORY } from '../page-patterns/utils';
|
|
22
23
|
|
|
23
24
|
export default function CreatePatternModal( {
|
|
25
|
+
blocks = [],
|
|
24
26
|
closeModal,
|
|
25
27
|
onCreate,
|
|
26
28
|
onError,
|
|
29
|
+
title,
|
|
27
30
|
} ) {
|
|
28
31
|
const [ name, setName ] = useState( '' );
|
|
29
32
|
const [ syncType, setSyncType ] = useState( SYNC_TYPES.unsynced );
|
|
@@ -52,7 +55,7 @@ export default function CreatePatternModal( {
|
|
|
52
55
|
'wp_block',
|
|
53
56
|
{
|
|
54
57
|
title: name || __( 'Untitled Pattern' ),
|
|
55
|
-
content: '',
|
|
58
|
+
content: blocks?.length ? serialize( blocks ) : '',
|
|
56
59
|
status: 'publish',
|
|
57
60
|
meta:
|
|
58
61
|
syncType === SYNC_TYPES.unsynced
|
|
@@ -76,7 +79,7 @@ export default function CreatePatternModal( {
|
|
|
76
79
|
|
|
77
80
|
return (
|
|
78
81
|
<Modal
|
|
79
|
-
title={ __( 'Create pattern' ) }
|
|
82
|
+
title={ title || __( 'Create pattern' ) }
|
|
80
83
|
onRequestClose={ closeModal }
|
|
81
84
|
overlayClassName="edit-site-create-pattern-modal"
|
|
82
85
|
>
|
|
@@ -70,8 +70,8 @@ const blockRemovalRules = {
|
|
|
70
70
|
'core/post-content': __(
|
|
71
71
|
'Post Content displays the content of a post or page.'
|
|
72
72
|
),
|
|
73
|
-
'core/
|
|
74
|
-
'
|
|
73
|
+
'core/post-template': __(
|
|
74
|
+
'Post Template displays each post or page in a Query Loop.'
|
|
75
75
|
),
|
|
76
76
|
};
|
|
77
77
|
|
|
@@ -66,6 +66,7 @@ export default function HeaderEditMode() {
|
|
|
66
66
|
homeUrl,
|
|
67
67
|
showIconLabels,
|
|
68
68
|
editorCanvasView,
|
|
69
|
+
hasFixedToolbar,
|
|
69
70
|
} = useSelect( ( select ) => {
|
|
70
71
|
const {
|
|
71
72
|
__experimentalGetPreviewDeviceType,
|
|
@@ -83,6 +84,8 @@ export default function HeaderEditMode() {
|
|
|
83
84
|
getUnstableBase, // Site index.
|
|
84
85
|
} = select( coreStore );
|
|
85
86
|
|
|
87
|
+
const { get: getPreference } = select( preferencesStore );
|
|
88
|
+
|
|
86
89
|
return {
|
|
87
90
|
deviceType: __experimentalGetPreviewDeviceType(),
|
|
88
91
|
templateType: postType,
|
|
@@ -94,23 +97,24 @@ export default function HeaderEditMode() {
|
|
|
94
97
|
isVisualMode: getEditorMode() === 'visual',
|
|
95
98
|
blockEditorMode: __unstableGetEditorMode(),
|
|
96
99
|
homeUrl: getUnstableBase()?.home,
|
|
97
|
-
showIconLabels:
|
|
98
|
-
|
|
100
|
+
showIconLabels: getPreference(
|
|
101
|
+
editSiteStore.name,
|
|
99
102
|
'showIconLabels'
|
|
100
103
|
),
|
|
101
104
|
editorCanvasView: unlock(
|
|
102
105
|
select( editSiteStore )
|
|
103
106
|
).getEditorCanvasContainerView(),
|
|
104
|
-
isDistractionFree:
|
|
105
|
-
|
|
107
|
+
isDistractionFree: getPreference(
|
|
108
|
+
editSiteStore.name,
|
|
106
109
|
'distractionFree'
|
|
107
110
|
),
|
|
111
|
+
hasFixedToolbar: getPreference(
|
|
112
|
+
editSiteStore.name,
|
|
113
|
+
'fixedToolbar'
|
|
114
|
+
),
|
|
108
115
|
};
|
|
109
116
|
}, [] );
|
|
110
117
|
|
|
111
|
-
const { get: getPreference } = useSelect( preferencesStore );
|
|
112
|
-
const hasFixedToolbar = getPreference( editSiteStore.name, 'fixedToolbar' );
|
|
113
|
-
|
|
114
118
|
const {
|
|
115
119
|
__experimentalSetPreviewDeviceType: setPreviewDeviceType,
|
|
116
120
|
setIsInserterOpened,
|
|
@@ -319,21 +323,24 @@ export default function HeaderEditMode() {
|
|
|
319
323
|
setDeviceType={ setPreviewDeviceType }
|
|
320
324
|
label={ __( 'View' ) }
|
|
321
325
|
>
|
|
322
|
-
|
|
323
|
-
<
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
{
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
326
|
+
{ ( { onClose } ) => (
|
|
327
|
+
<MenuGroup>
|
|
328
|
+
<MenuItem
|
|
329
|
+
href={ homeUrl }
|
|
330
|
+
target="_blank"
|
|
331
|
+
icon={ external }
|
|
332
|
+
onClick={ onClose }
|
|
333
|
+
>
|
|
334
|
+
{ __( 'View site' ) }
|
|
335
|
+
<VisuallyHidden as="span">
|
|
336
|
+
{
|
|
337
|
+
/* translators: accessibility text */
|
|
338
|
+
__( '(opens in a new tab)' )
|
|
339
|
+
}
|
|
340
|
+
</VisuallyHidden>
|
|
341
|
+
</MenuItem>
|
|
342
|
+
</MenuGroup>
|
|
343
|
+
) }
|
|
337
344
|
</PreviewOptions>
|
|
338
345
|
</div>
|
|
339
346
|
) }
|
|
@@ -121,6 +121,8 @@ export default function Layout() {
|
|
|
121
121
|
const [ fullResizer ] = useResizeObserver();
|
|
122
122
|
const [ isResizing ] = useState( false );
|
|
123
123
|
const isEditorLoading = useIsSiteEditorLoading();
|
|
124
|
+
const [ isResizableFrameOversized, setIsResizableFrameOversized ] =
|
|
125
|
+
useState( false );
|
|
124
126
|
|
|
125
127
|
// This determines which animation variant should apply to the header.
|
|
126
128
|
// There is also a `isDistractionFreeHovering` state that gets priority
|
|
@@ -218,6 +220,7 @@ export default function Layout() {
|
|
|
218
220
|
edit: { x: 0 },
|
|
219
221
|
} }
|
|
220
222
|
ref={ hubRef }
|
|
223
|
+
isTransparent={ isResizableFrameOversized }
|
|
221
224
|
className="edit-site-layout__hub"
|
|
222
225
|
/>
|
|
223
226
|
|
|
@@ -315,7 +318,13 @@ export default function Layout() {
|
|
|
315
318
|
}
|
|
316
319
|
initial={ false }
|
|
317
320
|
layout="position"
|
|
318
|
-
className=
|
|
321
|
+
className={ classnames(
|
|
322
|
+
'edit-site-layout__canvas',
|
|
323
|
+
{
|
|
324
|
+
'is-right-aligned':
|
|
325
|
+
isResizableFrameOversized,
|
|
326
|
+
}
|
|
327
|
+
) }
|
|
319
328
|
transition={ {
|
|
320
329
|
type: 'tween',
|
|
321
330
|
duration:
|
|
@@ -331,7 +340,12 @@ export default function Layout() {
|
|
|
331
340
|
! isEditorLoading
|
|
332
341
|
}
|
|
333
342
|
isFullWidth={ isEditing }
|
|
334
|
-
|
|
343
|
+
isOversized={
|
|
344
|
+
isResizableFrameOversized
|
|
345
|
+
}
|
|
346
|
+
setIsOversized={
|
|
347
|
+
setIsResizableFrameOversized
|
|
348
|
+
}
|
|
335
349
|
innerContentStyle={ {
|
|
336
350
|
background:
|
|
337
351
|
gradientValue ??
|
|
@@ -61,6 +61,7 @@
|
|
|
61
61
|
.edit-site-layout__sidebar {
|
|
62
62
|
z-index: z-index(".edit-site-layout__sidebar");
|
|
63
63
|
width: 100vw;
|
|
64
|
+
flex-shrink: 0;
|
|
64
65
|
|
|
65
66
|
@include break-medium {
|
|
66
67
|
width: $nav-sidebar-width;
|
|
@@ -120,7 +121,7 @@
|
|
|
120
121
|
justify-content: center;
|
|
121
122
|
align-items: center;
|
|
122
123
|
|
|
123
|
-
|
|
124
|
+
&.is-right-aligned {
|
|
124
125
|
justify-content: flex-end;
|
|
125
126
|
}
|
|
126
127
|
|
|
@@ -8,7 +8,7 @@ import { moreVertical } from '@wordpress/icons';
|
|
|
8
8
|
/**
|
|
9
9
|
* Internal dependencies
|
|
10
10
|
*/
|
|
11
|
-
import
|
|
11
|
+
import TrashPageMenuItem from './trash-page-menu-item';
|
|
12
12
|
|
|
13
13
|
export default function PageActions( {
|
|
14
14
|
postId,
|
|
@@ -25,7 +25,7 @@ export default function PageActions( {
|
|
|
25
25
|
>
|
|
26
26
|
{ () => (
|
|
27
27
|
<MenuGroup>
|
|
28
|
-
<
|
|
28
|
+
<TrashPageMenuItem
|
|
29
29
|
postId={ postId }
|
|
30
30
|
onRemove={ onRemove }
|
|
31
31
|
/>
|
|
@@ -3,17 +3,12 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
5
5
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
6
|
-
import { useState } from '@wordpress/element';
|
|
7
6
|
import { store as coreStore } from '@wordpress/core-data';
|
|
8
7
|
import { __, sprintf } from '@wordpress/i18n';
|
|
9
|
-
import {
|
|
10
|
-
MenuItem,
|
|
11
|
-
__experimentalConfirmDialog as ConfirmDialog,
|
|
12
|
-
} from '@wordpress/components';
|
|
8
|
+
import { MenuItem } from '@wordpress/components';
|
|
13
9
|
import { store as noticesStore } from '@wordpress/notices';
|
|
14
10
|
|
|
15
|
-
export default function
|
|
16
|
-
const [ isModalOpen, setIsModalOpen ] = useState( false );
|
|
11
|
+
export default function TrashPageMenuItem( { postId, onRemove } ) {
|
|
17
12
|
const { createSuccessNotice, createErrorNotice } =
|
|
18
13
|
useDispatch( noticesStore );
|
|
19
14
|
const { deleteEntityRecord } = useDispatch( coreStore );
|
|
@@ -34,12 +29,12 @@ export default function DeletePageMenuItem( { postId, onRemove } ) {
|
|
|
34
29
|
createSuccessNotice(
|
|
35
30
|
sprintf(
|
|
36
31
|
/* translators: The page's title. */
|
|
37
|
-
__( '"%s"
|
|
32
|
+
__( '"%s" moved to the Trash.' ),
|
|
38
33
|
decodeEntities( page.title.rendered )
|
|
39
34
|
),
|
|
40
35
|
{
|
|
41
36
|
type: 'snackbar',
|
|
42
|
-
id: 'edit-site-page-
|
|
37
|
+
id: 'edit-site-page-trashed',
|
|
43
38
|
}
|
|
44
39
|
);
|
|
45
40
|
onRemove?.();
|
|
@@ -47,26 +42,18 @@ export default function DeletePageMenuItem( { postId, onRemove } ) {
|
|
|
47
42
|
const errorMessage =
|
|
48
43
|
error.message && error.code !== 'unknown_error'
|
|
49
44
|
? error.message
|
|
50
|
-
: __(
|
|
45
|
+
: __(
|
|
46
|
+
'An error occurred while moving the page to the trash.'
|
|
47
|
+
);
|
|
51
48
|
|
|
52
49
|
createErrorNotice( errorMessage, { type: 'snackbar' } );
|
|
53
|
-
} finally {
|
|
54
|
-
setIsModalOpen( false );
|
|
55
50
|
}
|
|
56
51
|
}
|
|
57
52
|
return (
|
|
58
53
|
<>
|
|
59
|
-
<MenuItem onClick={ () =>
|
|
60
|
-
{ __( '
|
|
54
|
+
<MenuItem onClick={ () => removePage() } isDestructive>
|
|
55
|
+
{ __( 'Move to Trash' ) }
|
|
61
56
|
</MenuItem>
|
|
62
|
-
<ConfirmDialog
|
|
63
|
-
isOpen={ isModalOpen }
|
|
64
|
-
onConfirm={ removePage }
|
|
65
|
-
onCancel={ () => setIsModalOpen( false ) }
|
|
66
|
-
confirmButtonText={ __( 'Delete' ) }
|
|
67
|
-
>
|
|
68
|
-
{ __( 'Are you sure you want to delete this page?' ) }
|
|
69
|
-
</ConfirmDialog>
|
|
70
57
|
</>
|
|
71
58
|
);
|
|
72
59
|
}
|
|
@@ -10,16 +10,22 @@ import { useEffect } from '@wordpress/element';
|
|
|
10
10
|
* Internal dependencies
|
|
11
11
|
*/
|
|
12
12
|
import { unlock } from '../../lock-unlock';
|
|
13
|
-
import { PAGE_CONTENT_BLOCK_TYPES } from './constants';
|
|
14
13
|
|
|
15
14
|
const { useBlockEditingMode } = unlock( blockEditorPrivateApis );
|
|
16
15
|
|
|
16
|
+
const PAGE_CONTENT_BLOCK_TYPES = [
|
|
17
|
+
'core/post-title',
|
|
18
|
+
'core/post-featured-image',
|
|
19
|
+
'core/post-content',
|
|
20
|
+
];
|
|
21
|
+
|
|
17
22
|
/**
|
|
18
23
|
* Component that when rendered, makes it so that the site editor allows only
|
|
19
24
|
* page content to be edited.
|
|
20
25
|
*/
|
|
21
26
|
export default function DisableNonPageContentBlocks() {
|
|
22
27
|
useDisableNonPageContentBlocks();
|
|
28
|
+
return null;
|
|
23
29
|
}
|
|
24
30
|
|
|
25
31
|
/**
|
|
@@ -43,8 +49,11 @@ export function useDisableNonPageContentBlocks() {
|
|
|
43
49
|
|
|
44
50
|
const withDisableNonPageContentBlocks = createHigherOrderComponent(
|
|
45
51
|
( BlockEdit ) => ( props ) => {
|
|
46
|
-
const
|
|
47
|
-
const
|
|
52
|
+
const isDescendentOfQueryLoop = !! props.context.queryId;
|
|
53
|
+
const isPageContent =
|
|
54
|
+
PAGE_CONTENT_BLOCK_TYPES.includes( props.name ) &&
|
|
55
|
+
! isDescendentOfQueryLoop;
|
|
56
|
+
const mode = isPageContent ? 'contentOnly' : undefined;
|
|
48
57
|
useBlockEditingMode( mode );
|
|
49
58
|
return <BlockEdit { ...props } />;
|
|
50
59
|
},
|