@wordpress/edit-site 5.14.0 → 5.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/components/add-new-page/index.js +1 -6
- package/build/components/add-new-page/index.js.map +1 -1
- package/build/components/add-new-pattern/index.js +22 -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 +114 -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 +5 -5
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +12 -7
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/screen-block.js +16 -0
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +12 -5
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +10 -22
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +32 -25
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +5 -3
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/header-edit-mode/document-actions/index.js +4 -2
- package/build/components/header-edit-mode/document-actions/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/keyboard-shortcuts/edit-mode.js +7 -5
- package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build/components/layout/index.js +17 -5
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page/index.js +3 -3
- package/build/components/page/index.js.map +1 -1
- package/build/components/page-actions/index.js +2 -2
- package/build/components/page-actions/index.js.map +1 -1
- package/build/components/page-actions/{delete-page-menu-item.js → trash-page-menu-item.js} +8 -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 +110 -31
- 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 +116 -118
- 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 +3 -25
- package/build/components/page-template-parts/index.js.map +1 -1
- package/build/components/page-templates/index.js +1 -16
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/resizable-frame/index.js +85 -51
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/save-button/index.js +4 -2
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js +10 -4
- package/build/components/save-hub/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-edit-mode/template-panel/index.js +15 -8
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +31 -15
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +34 -40
- package/build/components/sidebar-navigation-screen-global-styles/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 +5 -4
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +2 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +4 -4
- 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 +8 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/index.js +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 +35 -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 +4 -3
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -2
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +19 -4
- 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 +55 -28
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/category-item.js +0 -5
- package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +72 -60
- 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/sidebar-navigation-screen-templates/index.js +1 -10
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +9 -0
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/site-hub/index.js +29 -13
- 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-canvas-mode-with-url.js +1 -1
- 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 +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 +120 -32
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +65 -7
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js +138 -57
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/store/private-actions.js +9 -2
- 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/utils/use-debounced-input.js +5 -7
- package/build/utils/use-debounced-input.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 +20 -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 +116 -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 +5 -5
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +12 -7
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +16 -0
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +13 -6
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +10 -22
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +28 -21
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +5 -3
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/header-edit-mode/document-actions/index.js +6 -4
- package/build-module/components/header-edit-mode/document-actions/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/keyboard-shortcuts/edit-mode.js +7 -5
- package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build-module/components/layout/index.js +17 -5
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page/index.js +3 -3
- package/build-module/components/page/index.js.map +1 -1
- package/build-module/components/page-actions/index.js +2 -2
- package/build-module/components/page-actions/index.js.map +1 -1
- package/build-module/components/page-actions/{delete-page-menu-item.js → trash-page-menu-item.js} +8 -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 +111 -34
- 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 +116 -119
- 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 +4 -24
- package/build-module/components/page-template-parts/index.js.map +1 -1
- package/build-module/components/page-templates/index.js +2 -15
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/resizable-frame/index.js +87 -55
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/save-button/index.js +4 -2
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-hub/index.js +10 -4
- package/build-module/components/save-hub/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-edit-mode/template-panel/index.js +15 -9
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +29 -16
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +34 -40
- package/build-module/components/sidebar-navigation-screen-global-styles/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 +5 -4
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +2 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +4 -4
- 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 +7 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +2 -2
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/index.js +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 +35 -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 +4 -3
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +3 -2
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +18 -4
- 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 +53 -28
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +0 -5
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +76 -60
- 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/sidebar-navigation-screen-templates/index.js +1 -8
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +7 -0
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +28 -13
- 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-canvas-mode-with-url.js +1 -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 +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 +116 -32
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +65 -9
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +139 -57
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/store/private-actions.js +9 -2
- 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-module/utils/use-debounced-input.js +5 -7
- package/build-module/utils/use-debounced-input.js.map +1 -1
- package/build-style/style-rtl.css +281 -103
- package/build-style/style.css +281 -103
- package/package.json +39 -40
- package/src/components/add-new-page/index.js +0 -3
- package/src/components/add-new-pattern/index.js +25 -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 +119 -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 +5 -5
- package/src/components/global-styles/global-styles-provider.js +7 -2
- package/src/components/global-styles/screen-block.js +15 -0
- package/src/components/global-styles/screen-revisions/index.js +64 -58
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +17 -31
- package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +14 -1
- package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +64 -48
- package/src/components/global-styles/style-variations-container.js +2 -0
- package/src/components/header-edit-mode/document-actions/index.js +8 -4
- package/src/components/header-edit-mode/document-actions/style.scss +45 -28
- package/src/components/header-edit-mode/index.js +29 -22
- package/src/components/keyboard-shortcuts/edit-mode.js +4 -5
- package/src/components/layout/index.js +49 -22
- package/src/components/layout/style.scss +4 -3
- package/src/components/page/index.js +8 -8
- package/src/components/page/style.scss +8 -5
- 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 +172 -71
- package/src/components/page-patterns/rename-menu-item.js +115 -0
- package/src/components/page-patterns/style.scss +141 -30
- package/src/components/page-patterns/use-patterns.js +115 -169
- package/src/components/page-template-parts/add-new-template-part.js +57 -0
- package/src/components/page-template-parts/index.js +3 -23
- package/src/components/page-templates/index.js +6 -19
- package/src/components/resizable-frame/index.js +104 -51
- package/src/components/resizable-frame/style.scss +9 -9
- package/src/components/save-button/index.js +2 -0
- package/src/components/save-hub/index.js +6 -1
- package/src/components/save-hub/style.scss +1 -1
- 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-edit-mode/template-panel/index.js +15 -11
- package/src/components/sidebar-navigation-item/style.scss +5 -12
- package/src/components/sidebar-navigation-screen/index.js +30 -15
- package/src/components/sidebar-navigation-screen/style.scss +18 -0
- package/src/components/sidebar-navigation-screen-details-panel/style.scss +1 -0
- package/src/components/sidebar-navigation-screen-global-styles/index.js +48 -44
- 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 +16 -7
- package/src/components/sidebar-navigation-screen-navigation-menus/constants.js +2 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +4 -4
- package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +27 -15
- package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +1 -4
- 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 +48 -33
- package/src/components/sidebar-navigation-screen-pattern/index.js +5 -2
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +3 -2
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +2 -1
- package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +23 -3
- package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +74 -43
- package/src/components/sidebar-navigation-screen-patterns/category-item.js +5 -13
- package/src/components/sidebar-navigation-screen-patterns/index.js +103 -106
- 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/sidebar-navigation-screen-templates/index.js +1 -9
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +10 -0
- package/src/components/site-hub/index.js +48 -29
- package/src/components/site-hub/style.scss +14 -2
- 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-canvas-mode-with-url.js +1 -4
- package/src/components/sync-state-with-url/use-sync-path-with-url.js +73 -66
- package/src/components/table/style.scss +1 -0
- 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 +105 -32
- package/src/hooks/commands/use-edit-mode-commands.js +94 -23
- package/src/hooks/push-changes-to-global-styles/index.js +141 -50
- package/src/store/private-actions.js +10 -2
- 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/src/utils/use-debounced-input.js +8 -7
- 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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-site",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.16.0",
|
|
4
4
|
"description": "Edit Site Page module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -27,43 +27,43 @@
|
|
|
27
27
|
"react-native": "src/index",
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@babel/runtime": "^7.16.0",
|
|
30
|
-
"@wordpress/a11y": "^3.
|
|
31
|
-
"@wordpress/api-fetch": "^6.
|
|
32
|
-
"@wordpress/block-editor": "^12.
|
|
33
|
-
"@wordpress/block-library": "^8.
|
|
34
|
-
"@wordpress/blocks": "^12.
|
|
35
|
-
"@wordpress/commands": "^0.
|
|
36
|
-
"@wordpress/components": "^25.
|
|
37
|
-
"@wordpress/compose": "^6.
|
|
38
|
-
"@wordpress/core-commands": "^0.
|
|
39
|
-
"@wordpress/core-data": "^6.
|
|
40
|
-
"@wordpress/data": "^9.
|
|
41
|
-
"@wordpress/date": "^4.
|
|
42
|
-
"@wordpress/deprecated": "^3.
|
|
43
|
-
"@wordpress/dom": "^3.
|
|
44
|
-
"@wordpress/editor": "^13.
|
|
45
|
-
"@wordpress/element": "^5.
|
|
46
|
-
"@wordpress/escape-html": "^2.
|
|
47
|
-
"@wordpress/hooks": "^3.
|
|
48
|
-
"@wordpress/html-entities": "^3.
|
|
49
|
-
"@wordpress/i18n": "^4.
|
|
50
|
-
"@wordpress/icons": "^9.
|
|
51
|
-
"@wordpress/interface": "^5.
|
|
52
|
-
"@wordpress/keyboard-shortcuts": "^4.
|
|
53
|
-
"@wordpress/keycodes": "^3.
|
|
54
|
-
"@wordpress/media-utils": "^4.
|
|
55
|
-
"@wordpress/notices": "^4.
|
|
56
|
-
"@wordpress/plugins": "^6.
|
|
57
|
-
"@wordpress/preferences": "^3.
|
|
58
|
-
"@wordpress/primitives": "^3.
|
|
59
|
-
"@wordpress/private-apis": "^0.
|
|
60
|
-
"@wordpress/reusable-blocks": "^4.
|
|
61
|
-
"@wordpress/router": "^0.
|
|
62
|
-
"@wordpress/style-engine": "^1.
|
|
63
|
-
"@wordpress/url": "^3.
|
|
64
|
-
"@wordpress/viewport": "^5.
|
|
65
|
-
"@wordpress/widgets": "^3.
|
|
66
|
-
"@wordpress/wordcount": "^3.
|
|
30
|
+
"@wordpress/a11y": "^3.39.0",
|
|
31
|
+
"@wordpress/api-fetch": "^6.36.0",
|
|
32
|
+
"@wordpress/block-editor": "^12.7.0",
|
|
33
|
+
"@wordpress/block-library": "^8.16.0",
|
|
34
|
+
"@wordpress/blocks": "^12.16.0",
|
|
35
|
+
"@wordpress/commands": "^0.10.0",
|
|
36
|
+
"@wordpress/components": "^25.5.0",
|
|
37
|
+
"@wordpress/compose": "^6.16.0",
|
|
38
|
+
"@wordpress/core-commands": "^0.8.0",
|
|
39
|
+
"@wordpress/core-data": "^6.16.0",
|
|
40
|
+
"@wordpress/data": "^9.9.0",
|
|
41
|
+
"@wordpress/date": "^4.39.0",
|
|
42
|
+
"@wordpress/deprecated": "^3.39.0",
|
|
43
|
+
"@wordpress/dom": "^3.39.0",
|
|
44
|
+
"@wordpress/editor": "^13.16.0",
|
|
45
|
+
"@wordpress/element": "^5.16.0",
|
|
46
|
+
"@wordpress/escape-html": "^2.39.0",
|
|
47
|
+
"@wordpress/hooks": "^3.39.0",
|
|
48
|
+
"@wordpress/html-entities": "^3.39.0",
|
|
49
|
+
"@wordpress/i18n": "^4.39.0",
|
|
50
|
+
"@wordpress/icons": "^9.30.0",
|
|
51
|
+
"@wordpress/interface": "^5.16.0",
|
|
52
|
+
"@wordpress/keyboard-shortcuts": "^4.16.0",
|
|
53
|
+
"@wordpress/keycodes": "^3.39.0",
|
|
54
|
+
"@wordpress/media-utils": "^4.30.0",
|
|
55
|
+
"@wordpress/notices": "^4.7.0",
|
|
56
|
+
"@wordpress/plugins": "^6.7.0",
|
|
57
|
+
"@wordpress/preferences": "^3.16.0",
|
|
58
|
+
"@wordpress/primitives": "^3.37.0",
|
|
59
|
+
"@wordpress/private-apis": "^0.21.0",
|
|
60
|
+
"@wordpress/reusable-blocks": "^4.16.0",
|
|
61
|
+
"@wordpress/router": "^0.8.0",
|
|
62
|
+
"@wordpress/style-engine": "^1.22.0",
|
|
63
|
+
"@wordpress/url": "^3.40.0",
|
|
64
|
+
"@wordpress/viewport": "^5.16.0",
|
|
65
|
+
"@wordpress/widgets": "^3.16.0",
|
|
66
|
+
"@wordpress/wordcount": "^3.39.0",
|
|
67
67
|
"change-case": "^4.1.2",
|
|
68
68
|
"classnames": "^2.3.1",
|
|
69
69
|
"colord": "^2.9.2",
|
|
@@ -71,7 +71,6 @@
|
|
|
71
71
|
"downloadjs": "^1.4.7",
|
|
72
72
|
"fast-deep-equal": "^3.1.3",
|
|
73
73
|
"is-plain-object": "^5.0.0",
|
|
74
|
-
"lodash": "^4.17.21",
|
|
75
74
|
"memize": "^2.1.0",
|
|
76
75
|
"react-autosize-textarea": "^7.1.0",
|
|
77
76
|
"rememo": "^4.0.2",
|
|
@@ -84,5 +83,5 @@
|
|
|
84
83
|
"publishConfig": {
|
|
85
84
|
"access": "public"
|
|
86
85
|
},
|
|
87
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "b898cf1dc8e70841d1647ea0994ac6278acc18a7"
|
|
88
87
|
}
|
|
@@ -72,9 +72,6 @@ export default function AddNewPageModal( { onSave, onClose } ) {
|
|
|
72
72
|
<form onSubmit={ createPage }>
|
|
73
73
|
<VStack spacing={ 3 }>
|
|
74
74
|
<TextControl
|
|
75
|
-
/* eslint-disable jsx-a11y/no-autofocus */
|
|
76
|
-
autoFocus
|
|
77
|
-
/* eslint-enable jsx-a11y/no-autofocus */
|
|
78
75
|
label={ __( 'Page title' ) }
|
|
79
76
|
onChange={ setTitle }
|
|
80
77
|
placeholder={ __( 'No title' ) }
|
|
@@ -5,6 +5,7 @@ import { DropdownMenu } from '@wordpress/components';
|
|
|
5
5
|
import { useState } from '@wordpress/element';
|
|
6
6
|
import { __ } from '@wordpress/i18n';
|
|
7
7
|
import { plus, symbol, symbolFilled } from '@wordpress/icons';
|
|
8
|
+
import { useSelect } from '@wordpress/data';
|
|
8
9
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
9
10
|
|
|
10
11
|
/**
|
|
@@ -14,6 +15,7 @@ import CreatePatternModal from '../create-pattern-modal';
|
|
|
14
15
|
import CreateTemplatePartModal from '../create-template-part-modal';
|
|
15
16
|
import SidebarButton from '../sidebar-button';
|
|
16
17
|
import { unlock } from '../../lock-unlock';
|
|
18
|
+
import { store as editSiteStore } from '../../store';
|
|
17
19
|
|
|
18
20
|
const { useHistory } = unlock( routerPrivateApis );
|
|
19
21
|
|
|
@@ -22,6 +24,10 @@ export default function AddNewPattern() {
|
|
|
22
24
|
const [ showPatternModal, setShowPatternModal ] = useState( false );
|
|
23
25
|
const [ showTemplatePartModal, setShowTemplatePartModal ] =
|
|
24
26
|
useState( false );
|
|
27
|
+
const isTemplatePartsMode = useSelect( ( select ) => {
|
|
28
|
+
const settings = select( editSiteStore ).getSettings();
|
|
29
|
+
return !! settings.supportsTemplatePartsMode;
|
|
30
|
+
}, [] );
|
|
25
31
|
|
|
26
32
|
function handleCreatePattern( { pattern, categoryId } ) {
|
|
27
33
|
setShowPatternModal( false );
|
|
@@ -51,21 +57,28 @@ export default function AddNewPattern() {
|
|
|
51
57
|
setShowTemplatePartModal( false );
|
|
52
58
|
}
|
|
53
59
|
|
|
60
|
+
const controls = [
|
|
61
|
+
{
|
|
62
|
+
icon: symbol,
|
|
63
|
+
onClick: () => setShowPatternModal( true ),
|
|
64
|
+
title: __( 'Create pattern' ),
|
|
65
|
+
},
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
// Remove condition when command palette issues are resolved.
|
|
69
|
+
// See: https://github.com/WordPress/gutenberg/issues/52154.
|
|
70
|
+
if ( ! isTemplatePartsMode ) {
|
|
71
|
+
controls.push( {
|
|
72
|
+
icon: symbolFilled,
|
|
73
|
+
onClick: () => setShowTemplatePartModal( true ),
|
|
74
|
+
title: __( 'Create template part' ),
|
|
75
|
+
} );
|
|
76
|
+
}
|
|
77
|
+
|
|
54
78
|
return (
|
|
55
79
|
<>
|
|
56
80
|
<DropdownMenu
|
|
57
|
-
controls={
|
|
58
|
-
{
|
|
59
|
-
icon: symbolFilled,
|
|
60
|
-
onClick: () => setShowTemplatePartModal( true ),
|
|
61
|
-
title: __( 'Create template part' ),
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
icon: symbol,
|
|
65
|
-
onClick: () => setShowPatternModal( true ),
|
|
66
|
-
title: __( 'Create pattern' ),
|
|
67
|
-
},
|
|
68
|
-
] }
|
|
81
|
+
controls={ controls }
|
|
69
82
|
toggleProps={ {
|
|
70
83
|
as: SidebarButton,
|
|
71
84
|
} }
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { get } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
@@ -20,6 +15,14 @@ import { blockMeta, post, archive } from '@wordpress/icons';
|
|
|
20
15
|
* @property {string} name The entity's name.
|
|
21
16
|
*/
|
|
22
17
|
|
|
18
|
+
const getValueFromObjectPath = ( object, path ) => {
|
|
19
|
+
let value = object;
|
|
20
|
+
path.split( '.' ).forEach( ( fieldName ) => {
|
|
21
|
+
value = value?.[ fieldName ];
|
|
22
|
+
} );
|
|
23
|
+
return value;
|
|
24
|
+
};
|
|
25
|
+
|
|
23
26
|
/**
|
|
24
27
|
* Helper util to map records to add a `name` prop from a
|
|
25
28
|
* provided path, in order to handle all entities in the same
|
|
@@ -32,7 +35,7 @@ import { blockMeta, post, archive } from '@wordpress/icons';
|
|
|
32
35
|
export const mapToIHasNameAndId = ( entities, path ) => {
|
|
33
36
|
return ( entities || [] ).map( ( entity ) => ( {
|
|
34
37
|
...entity,
|
|
35
|
-
name: decodeEntities(
|
|
38
|
+
name: decodeEntities( getValueFromObjectPath( entity, path ) ),
|
|
36
39
|
} ) );
|
|
37
40
|
};
|
|
38
41
|
|
|
@@ -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,93 @@ 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
|
+
let isAuthor = false;
|
|
21
|
+
let authorSlug;
|
|
22
|
+
if ( taxonomyMatches ) {
|
|
23
|
+
// If is for a all taxonomies of a type
|
|
24
|
+
if ( taxonomyMatches[ 1 ] ) {
|
|
25
|
+
taxonomy = taxonomyMatches[ 2 ]
|
|
26
|
+
? taxonomyMatches[ 2 ]
|
|
27
|
+
: taxonomyMatches[ 1 ];
|
|
28
|
+
}
|
|
29
|
+
// If is for a all taxonomies of a type
|
|
30
|
+
else if ( taxonomyMatches[ 3 ] ) {
|
|
31
|
+
taxonomy = taxonomyMatches[ 6 ]
|
|
32
|
+
? taxonomyMatches[ 6 ]
|
|
33
|
+
: taxonomyMatches[ 4 ];
|
|
34
|
+
term = taxonomyMatches[ 7 ];
|
|
35
|
+
}
|
|
36
|
+
taxonomy = taxonomy === 'tag' ? 'post_tag' : taxonomy;
|
|
37
|
+
|
|
38
|
+
//getTaxonomy( 'category' );
|
|
39
|
+
//wp.data.select('core').getEntityRecords( 'taxonomy', 'category', {slug: 'newcat'} );
|
|
40
|
+
} else {
|
|
41
|
+
const authorMatches = templateSlug?.match( /^(author)$|^author-(.+)$/ );
|
|
42
|
+
if ( authorMatches ) {
|
|
43
|
+
isAuthor = true;
|
|
44
|
+
if ( authorMatches[ 2 ] ) {
|
|
45
|
+
authorSlug = authorMatches[ 2 ];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return useSelect(
|
|
50
|
+
( select ) => {
|
|
51
|
+
const { getEntityRecords, getTaxonomy, getAuthors } =
|
|
52
|
+
select( coreStore );
|
|
53
|
+
let archiveTypeLabel;
|
|
54
|
+
let archiveNameLabel;
|
|
55
|
+
if ( taxonomy ) {
|
|
56
|
+
archiveTypeLabel =
|
|
57
|
+
getTaxonomy( taxonomy )?.labels?.singular_name;
|
|
58
|
+
}
|
|
59
|
+
if ( term ) {
|
|
60
|
+
const records = getEntityRecords( 'taxonomy', taxonomy, {
|
|
61
|
+
slug: term,
|
|
62
|
+
per_page: 1,
|
|
63
|
+
} );
|
|
64
|
+
if ( records && records[ 0 ] ) {
|
|
65
|
+
archiveNameLabel = records[ 0 ].name;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if ( isAuthor ) {
|
|
69
|
+
archiveTypeLabel = 'Author';
|
|
70
|
+
if ( authorSlug ) {
|
|
71
|
+
const authorRecords = getAuthors( { slug: authorSlug } );
|
|
72
|
+
if ( authorRecords && authorRecords[ 0 ] ) {
|
|
73
|
+
archiveNameLabel = authorRecords[ 0 ].name;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
archiveTypeLabel,
|
|
79
|
+
archiveNameLabel,
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
[ authorSlug, isAuthor, taxonomy, term ]
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export default function useSiteEditorSettings() {
|
|
87
|
+
const { setIsInserterOpened } = useDispatch( editSiteStore );
|
|
88
|
+
const { storedSettings, canvasMode, templateType } = useSelect(
|
|
89
|
+
( select ) => {
|
|
90
|
+
const { getSettings, getCanvasMode, getEditedPostType } = unlock(
|
|
91
|
+
select( editSiteStore )
|
|
92
|
+
);
|
|
93
|
+
return {
|
|
94
|
+
storedSettings: getSettings( setIsInserterOpened ),
|
|
95
|
+
canvasMode: getCanvasMode(),
|
|
96
|
+
templateType: getEditedPostType(),
|
|
97
|
+
};
|
|
98
|
+
},
|
|
99
|
+
[ setIsInserterOpened ]
|
|
100
|
+
);
|
|
24
101
|
|
|
25
102
|
const settingsBlockPatterns =
|
|
26
103
|
storedSettings.__experimentalAdditionalBlockPatterns ?? // WP 6.0
|
|
@@ -29,14 +106,27 @@ export default function useSiteEditorSettings( templateType ) {
|
|
|
29
106
|
storedSettings.__experimentalAdditionalBlockPatternCategories ?? // WP 6.0
|
|
30
107
|
storedSettings.__experimentalBlockPatternCategories; // WP 5.9
|
|
31
108
|
|
|
32
|
-
const { restBlockPatterns, restBlockPatternCategories } =
|
|
33
|
-
( select ) =>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
109
|
+
const { restBlockPatterns, restBlockPatternCategories, templateSlug } =
|
|
110
|
+
useSelect( ( select ) => {
|
|
111
|
+
const { getEditedPostType, getEditedPostId } =
|
|
112
|
+
select( editSiteStore );
|
|
113
|
+
const { getEditedEntityRecord } = select( coreStore );
|
|
114
|
+
const usedPostType = getEditedPostType();
|
|
115
|
+
const usedPostId = getEditedPostId();
|
|
116
|
+
const _record = getEditedEntityRecord(
|
|
117
|
+
'postType',
|
|
118
|
+
usedPostType,
|
|
119
|
+
usedPostId
|
|
120
|
+
);
|
|
121
|
+
return {
|
|
122
|
+
restBlockPatterns: select( coreStore ).getBlockPatterns(),
|
|
123
|
+
restBlockPatternCategories:
|
|
124
|
+
select( coreStore ).getBlockPatternCategories(),
|
|
125
|
+
templateSlug: _record.slug,
|
|
126
|
+
};
|
|
127
|
+
}, [] );
|
|
128
|
+
const archiveLabels = useArchiveLabel( templateSlug );
|
|
129
|
+
|
|
40
130
|
const blockPatterns = useMemo(
|
|
41
131
|
() =>
|
|
42
132
|
[
|
|
@@ -82,6 +172,15 @@ export default function useSiteEditorSettings( templateType ) {
|
|
|
82
172
|
__experimentalBlockPatterns: blockPatterns,
|
|
83
173
|
__experimentalBlockPatternCategories: blockPatternCategories,
|
|
84
174
|
focusMode: canvasMode === 'view' && focusMode ? false : focusMode,
|
|
175
|
+
__experimentalArchiveTitleTypeLabel: archiveLabels.archiveTypeLabel,
|
|
176
|
+
__experimentalArchiveTitleNameLabel: archiveLabels.archiveNameLabel,
|
|
85
177
|
};
|
|
86
|
-
}, [
|
|
178
|
+
}, [
|
|
179
|
+
storedSettings,
|
|
180
|
+
blockPatterns,
|
|
181
|
+
blockPatternCategories,
|
|
182
|
+
canvasMode,
|
|
183
|
+
archiveLabels.archiveTypeLabel,
|
|
184
|
+
archiveLabels.archiveNameLabel,
|
|
185
|
+
] );
|
|
87
186
|
}
|
|
@@ -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
|
>
|
|
@@ -58,9 +58,10 @@ const interfaceLabels = {
|
|
|
58
58
|
};
|
|
59
59
|
|
|
60
60
|
const typeLabels = {
|
|
61
|
-
wp_template: __( 'Template
|
|
61
|
+
wp_template: __( 'Template' ),
|
|
62
62
|
wp_template_part: __( 'Template Part' ),
|
|
63
63
|
wp_block: __( 'Pattern' ),
|
|
64
|
+
wp_navigation: __( 'Navigation' ),
|
|
64
65
|
};
|
|
65
66
|
|
|
66
67
|
// Prevent accidental removal of certain blocks, asking the user for
|
|
@@ -70,8 +71,8 @@ const blockRemovalRules = {
|
|
|
70
71
|
'core/post-content': __(
|
|
71
72
|
'Post Content displays the content of a post or page.'
|
|
72
73
|
),
|
|
73
|
-
'core/
|
|
74
|
-
'
|
|
74
|
+
'core/post-template': __(
|
|
75
|
+
'Post Template displays each post or page in a Query Loop.'
|
|
75
76
|
),
|
|
76
77
|
};
|
|
77
78
|
|
|
@@ -165,12 +166,11 @@ export default function Editor( { isLoading } ) {
|
|
|
165
166
|
|
|
166
167
|
let title;
|
|
167
168
|
if ( hasLoadedPost ) {
|
|
168
|
-
const type = typeLabels[ editedPostType ] ?? __( 'Template' );
|
|
169
169
|
title = sprintf(
|
|
170
170
|
// translators: A breadcrumb trail in browser tab. %1$s: title of template being edited, %2$s: type of template (Template or Template Part).
|
|
171
171
|
__( '%1$s ‹ %2$s ‹ Editor' ),
|
|
172
172
|
getTitle(),
|
|
173
|
-
|
|
173
|
+
typeLabels[ editedPostType ] ?? typeLabels.wp_template
|
|
174
174
|
);
|
|
175
175
|
}
|
|
176
176
|
|
|
@@ -31,7 +31,7 @@ export function mergeBaseAndUserConfigs( base, user ) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
function useGlobalStylesUserConfig() {
|
|
34
|
-
const { globalStylesId, isReady, settings, styles } = useSelect(
|
|
34
|
+
const { globalStylesId, isReady, settings, styles, behaviors } = useSelect(
|
|
35
35
|
( select ) => {
|
|
36
36
|
const { getEditedEntityRecord, hasFinishedResolution } =
|
|
37
37
|
select( coreStore );
|
|
@@ -65,6 +65,7 @@ function useGlobalStylesUserConfig() {
|
|
|
65
65
|
isReady: hasResolved,
|
|
66
66
|
settings: record?.settings,
|
|
67
67
|
styles: record?.styles,
|
|
68
|
+
behaviors: record?.behaviors,
|
|
68
69
|
};
|
|
69
70
|
},
|
|
70
71
|
[]
|
|
@@ -76,8 +77,9 @@ function useGlobalStylesUserConfig() {
|
|
|
76
77
|
return {
|
|
77
78
|
settings: settings ?? {},
|
|
78
79
|
styles: styles ?? {},
|
|
80
|
+
behaviors: behaviors ?? {},
|
|
79
81
|
};
|
|
80
|
-
}, [ settings, styles ] );
|
|
82
|
+
}, [ settings, styles, behaviors ] );
|
|
81
83
|
|
|
82
84
|
const setConfig = useCallback(
|
|
83
85
|
( callback, options = {} ) => {
|
|
@@ -89,6 +91,7 @@ function useGlobalStylesUserConfig() {
|
|
|
89
91
|
const currentConfig = {
|
|
90
92
|
styles: record?.styles ?? {},
|
|
91
93
|
settings: record?.settings ?? {},
|
|
94
|
+
behaviors: record?.behaviors ?? {},
|
|
92
95
|
};
|
|
93
96
|
const updatedConfig = callback( currentConfig );
|
|
94
97
|
editEntityRecord(
|
|
@@ -98,6 +101,8 @@ function useGlobalStylesUserConfig() {
|
|
|
98
101
|
{
|
|
99
102
|
styles: cleanEmptyObject( updatedConfig.styles ) || {},
|
|
100
103
|
settings: cleanEmptyObject( updatedConfig.settings ) || {},
|
|
104
|
+
behaviors:
|
|
105
|
+
cleanEmptyObject( updatedConfig.behaviors ) || {},
|
|
101
106
|
},
|
|
102
107
|
options
|
|
103
108
|
);
|