@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
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
__experimentalVStack as VStack,
|
|
6
|
+
__experimentalHeading as Heading,
|
|
7
|
+
__experimentalText as Text,
|
|
8
|
+
} from '@wordpress/components';
|
|
9
|
+
import { __ } from '@wordpress/i18n';
|
|
10
|
+
import { store as editorStore } from '@wordpress/editor';
|
|
11
|
+
import { useSelect } from '@wordpress/data';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Internal dependencies
|
|
15
|
+
*/
|
|
16
|
+
import usePatternCategories from '../sidebar-navigation-screen-patterns/use-pattern-categories';
|
|
17
|
+
import {
|
|
18
|
+
USER_PATTERN_CATEGORY,
|
|
19
|
+
USER_PATTERNS,
|
|
20
|
+
TEMPLATE_PARTS,
|
|
21
|
+
PATTERNS,
|
|
22
|
+
} from './utils';
|
|
23
|
+
|
|
24
|
+
export default function PatternsHeader( {
|
|
25
|
+
categoryId,
|
|
26
|
+
type,
|
|
27
|
+
titleId,
|
|
28
|
+
descriptionId,
|
|
29
|
+
} ) {
|
|
30
|
+
const { patternCategories } = usePatternCategories();
|
|
31
|
+
const templatePartAreas = useSelect(
|
|
32
|
+
( select ) =>
|
|
33
|
+
select( editorStore ).__experimentalGetDefaultTemplatePartAreas(),
|
|
34
|
+
[]
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
let title, description;
|
|
38
|
+
if ( categoryId === USER_PATTERN_CATEGORY && type === USER_PATTERNS ) {
|
|
39
|
+
title = __( 'My Patterns' );
|
|
40
|
+
description = '';
|
|
41
|
+
} else if ( type === TEMPLATE_PARTS ) {
|
|
42
|
+
const templatePartArea = templatePartAreas.find(
|
|
43
|
+
( area ) => area.area === categoryId
|
|
44
|
+
);
|
|
45
|
+
title = templatePartArea?.label;
|
|
46
|
+
description = templatePartArea?.description;
|
|
47
|
+
} else if ( type === PATTERNS ) {
|
|
48
|
+
const patternCategory = patternCategories.find(
|
|
49
|
+
( category ) => category.name === categoryId
|
|
50
|
+
);
|
|
51
|
+
title = patternCategory?.label;
|
|
52
|
+
description = patternCategory?.description;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if ( ! title ) return null;
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<VStack className="edit-site-patterns__section-header">
|
|
59
|
+
<Heading as="h2" level={ 4 } id={ titleId }>
|
|
60
|
+
{ title }
|
|
61
|
+
</Heading>
|
|
62
|
+
{ description ? (
|
|
63
|
+
<Text variant="muted" as="p" id={ descriptionId }>
|
|
64
|
+
{ description }
|
|
65
|
+
</Text>
|
|
66
|
+
) : null }
|
|
67
|
+
</VStack>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
@@ -32,7 +32,12 @@ export default function PagePatterns() {
|
|
|
32
32
|
title={ __( 'Patterns content' ) }
|
|
33
33
|
hideTitleFromUI
|
|
34
34
|
>
|
|
35
|
-
<PatternsList
|
|
35
|
+
<PatternsList
|
|
36
|
+
// Reset the states when switching between categories and types.
|
|
37
|
+
key={ `${ type }-${ category }` }
|
|
38
|
+
type={ type }
|
|
39
|
+
categoryId={ category }
|
|
40
|
+
/>
|
|
36
41
|
</Page>
|
|
37
42
|
</ExperimentalBlockEditorProvider>
|
|
38
43
|
);
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
__experimentalHStack as HStack,
|
|
6
|
+
__experimentalText as Text,
|
|
7
|
+
Button,
|
|
8
|
+
} from '@wordpress/components';
|
|
9
|
+
import { __, _x, _n, sprintf } from '@wordpress/i18n';
|
|
10
|
+
|
|
11
|
+
export default function Pagination( {
|
|
12
|
+
currentPage,
|
|
13
|
+
numPages,
|
|
14
|
+
changePage,
|
|
15
|
+
totalItems,
|
|
16
|
+
} ) {
|
|
17
|
+
return (
|
|
18
|
+
<HStack
|
|
19
|
+
expanded={ false }
|
|
20
|
+
spacing={ 3 }
|
|
21
|
+
justify="flex-start"
|
|
22
|
+
className="edit-site-patterns__grid-pagination"
|
|
23
|
+
>
|
|
24
|
+
<Text variant="muted">
|
|
25
|
+
{
|
|
26
|
+
// translators: %s: Total number of patterns.
|
|
27
|
+
sprintf(
|
|
28
|
+
// translators: %s: Total number of patterns.
|
|
29
|
+
_n( '%s item', '%s items', totalItems ),
|
|
30
|
+
totalItems
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
</Text>
|
|
34
|
+
<HStack expanded={ false } spacing={ 1 }>
|
|
35
|
+
<Button
|
|
36
|
+
variant="tertiary"
|
|
37
|
+
onClick={ () => changePage( 1 ) }
|
|
38
|
+
disabled={ currentPage === 1 }
|
|
39
|
+
aria-label={ __( 'First page' ) }
|
|
40
|
+
>
|
|
41
|
+
«
|
|
42
|
+
</Button>
|
|
43
|
+
<Button
|
|
44
|
+
variant="tertiary"
|
|
45
|
+
onClick={ () => changePage( currentPage - 1 ) }
|
|
46
|
+
disabled={ currentPage === 1 }
|
|
47
|
+
aria-label={ __( 'Previous page' ) }
|
|
48
|
+
>
|
|
49
|
+
‹
|
|
50
|
+
</Button>
|
|
51
|
+
</HStack>
|
|
52
|
+
<Text variant="muted">
|
|
53
|
+
{ sprintf(
|
|
54
|
+
// translators: %1$s: Current page number, %2$s: Total number of pages.
|
|
55
|
+
_x( '%1$s of %2$s', 'paging' ),
|
|
56
|
+
currentPage,
|
|
57
|
+
numPages
|
|
58
|
+
) }
|
|
59
|
+
</Text>
|
|
60
|
+
<HStack expanded={ false } spacing={ 1 }>
|
|
61
|
+
<Button
|
|
62
|
+
variant="tertiary"
|
|
63
|
+
onClick={ () => changePage( currentPage + 1 ) }
|
|
64
|
+
disabled={ currentPage === numPages }
|
|
65
|
+
aria-label={ __( 'Next page' ) }
|
|
66
|
+
>
|
|
67
|
+
›
|
|
68
|
+
</Button>
|
|
69
|
+
<Button
|
|
70
|
+
variant="tertiary"
|
|
71
|
+
onClick={ () => changePage( numPages ) }
|
|
72
|
+
disabled={ currentPage === numPages }
|
|
73
|
+
aria-label={ __( 'Last page' ) }
|
|
74
|
+
>
|
|
75
|
+
»
|
|
76
|
+
</Button>
|
|
77
|
+
</HStack>
|
|
78
|
+
</HStack>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
@@ -1,118 +1,206 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
|
|
4
|
+
import { useState, useDeferredValue, useId, useMemo } from '@wordpress/element';
|
|
5
5
|
import {
|
|
6
6
|
SearchControl,
|
|
7
|
-
__experimentalHeading as Heading,
|
|
8
|
-
__experimentalText as Text,
|
|
9
7
|
__experimentalVStack as VStack,
|
|
10
8
|
Flex,
|
|
11
9
|
FlexBlock,
|
|
10
|
+
__experimentalToggleGroupControl as ToggleGroupControl,
|
|
11
|
+
__experimentalToggleGroupControlOption as ToggleGroupControlOption,
|
|
12
|
+
__experimentalHeading as Heading,
|
|
13
|
+
__experimentalText as Text,
|
|
12
14
|
} from '@wordpress/components';
|
|
13
15
|
import { __, isRTL } from '@wordpress/i18n';
|
|
14
|
-
import {
|
|
16
|
+
import { chevronLeft, chevronRight } from '@wordpress/icons';
|
|
15
17
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
16
|
-
import { useViewportMatch } from '@wordpress/compose';
|
|
18
|
+
import { useAsyncList, useViewportMatch } from '@wordpress/compose';
|
|
17
19
|
|
|
18
20
|
/**
|
|
19
21
|
* Internal dependencies
|
|
20
22
|
*/
|
|
23
|
+
import PatternsHeader from './header';
|
|
21
24
|
import Grid from './grid';
|
|
22
25
|
import NoPatterns from './no-patterns';
|
|
23
26
|
import usePatterns from './use-patterns';
|
|
24
27
|
import SidebarButton from '../sidebar-button';
|
|
25
28
|
import useDebouncedInput from '../../utils/use-debounced-input';
|
|
26
29
|
import { unlock } from '../../lock-unlock';
|
|
30
|
+
import { SYNC_TYPES, USER_PATTERN_CATEGORY } from './utils';
|
|
31
|
+
import Pagination from './pagination';
|
|
27
32
|
|
|
28
33
|
const { useLocation, useHistory } = unlock( routerPrivateApis );
|
|
29
34
|
|
|
35
|
+
const SYNC_FILTERS = {
|
|
36
|
+
all: __( 'All' ),
|
|
37
|
+
[ SYNC_TYPES.full ]: __( 'Synced' ),
|
|
38
|
+
[ SYNC_TYPES.unsynced ]: __( 'Standard' ),
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const SYNC_DESCRIPTIONS = {
|
|
42
|
+
all: '',
|
|
43
|
+
[ SYNC_TYPES.full ]: __(
|
|
44
|
+
'Patterns that are kept in sync across the site.'
|
|
45
|
+
),
|
|
46
|
+
[ SYNC_TYPES.unsynced ]: __(
|
|
47
|
+
'Patterns that can be changed freely without affecting the site.'
|
|
48
|
+
),
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const PAGE_SIZE = 20;
|
|
52
|
+
|
|
30
53
|
export default function PatternsList( { categoryId, type } ) {
|
|
31
54
|
const location = useLocation();
|
|
32
55
|
const history = useHistory();
|
|
33
56
|
const isMobileViewport = useViewportMatch( 'medium', '<' );
|
|
34
57
|
const [ filterValue, setFilterValue, delayedFilterValue ] =
|
|
35
58
|
useDebouncedInput( '' );
|
|
59
|
+
const deferredFilterValue = useDeferredValue( delayedFilterValue );
|
|
36
60
|
|
|
37
|
-
const [
|
|
61
|
+
const [ syncFilter, setSyncFilter ] = useState( 'all' );
|
|
62
|
+
const [ currentPage, setCurrentPage ] = useState( 1 );
|
|
63
|
+
|
|
64
|
+
const deferredSyncedFilter = useDeferredValue( syncFilter );
|
|
65
|
+
|
|
66
|
+
const { patterns, isResolving } = usePatterns(
|
|
38
67
|
type,
|
|
39
|
-
categoryId,
|
|
40
|
-
|
|
68
|
+
categoryId !== 'uncategorized' ? categoryId : '',
|
|
69
|
+
{
|
|
70
|
+
search: deferredFilterValue,
|
|
71
|
+
syncStatus:
|
|
72
|
+
deferredSyncedFilter === 'all'
|
|
73
|
+
? undefined
|
|
74
|
+
: deferredSyncedFilter,
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
const id = useId();
|
|
79
|
+
const titleId = `${ id }-title`;
|
|
80
|
+
const descriptionId = `${ id }-description`;
|
|
81
|
+
|
|
82
|
+
const hasPatterns = patterns.length;
|
|
83
|
+
const title = SYNC_FILTERS[ syncFilter ];
|
|
84
|
+
const description = SYNC_DESCRIPTIONS[ syncFilter ];
|
|
85
|
+
|
|
86
|
+
const totalItems = patterns.length;
|
|
87
|
+
const pageIndex = currentPage - 1;
|
|
88
|
+
const numPages = Math.ceil( patterns.length / PAGE_SIZE );
|
|
89
|
+
|
|
90
|
+
const list = useMemo(
|
|
91
|
+
() =>
|
|
92
|
+
patterns.slice(
|
|
93
|
+
pageIndex * PAGE_SIZE,
|
|
94
|
+
pageIndex * PAGE_SIZE + PAGE_SIZE
|
|
95
|
+
),
|
|
96
|
+
[ pageIndex, patterns ]
|
|
41
97
|
);
|
|
42
98
|
|
|
43
|
-
const
|
|
44
|
-
|
|
99
|
+
const asyncList = useAsyncList( list, { step: 10 } );
|
|
100
|
+
|
|
101
|
+
const changePage = ( page ) => {
|
|
102
|
+
const scrollContainer = document.querySelector( '.edit-site-patterns' );
|
|
103
|
+
scrollContainer?.scrollTo( 0, 0 );
|
|
104
|
+
|
|
105
|
+
setCurrentPage( page );
|
|
106
|
+
};
|
|
45
107
|
|
|
46
108
|
return (
|
|
47
|
-
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
109
|
+
<>
|
|
110
|
+
<VStack className="edit-site-patterns__header" spacing={ 6 }>
|
|
111
|
+
<PatternsHeader
|
|
112
|
+
categoryId={ categoryId }
|
|
113
|
+
type={ type }
|
|
114
|
+
titleId={ titleId }
|
|
115
|
+
descriptionId={ descriptionId }
|
|
116
|
+
/>
|
|
117
|
+
<Flex alignment="stretch" wrap>
|
|
118
|
+
{ isMobileViewport && (
|
|
119
|
+
<SidebarButton
|
|
120
|
+
icon={ isRTL() ? chevronRight : chevronLeft }
|
|
121
|
+
label={ __( 'Back' ) }
|
|
122
|
+
onClick={ () => {
|
|
123
|
+
// Go back in history if we came from the Patterns page.
|
|
124
|
+
// Otherwise push a stack onto the history.
|
|
125
|
+
if (
|
|
126
|
+
location.state?.backPath === '/patterns'
|
|
127
|
+
) {
|
|
128
|
+
history.back();
|
|
129
|
+
} else {
|
|
130
|
+
history.push( { path: '/patterns' } );
|
|
131
|
+
}
|
|
132
|
+
} }
|
|
133
|
+
/>
|
|
134
|
+
) }
|
|
135
|
+
<FlexBlock className="edit-site-patterns__search-block">
|
|
136
|
+
<SearchControl
|
|
137
|
+
className="edit-site-patterns__search"
|
|
138
|
+
onChange={ ( value ) => setFilterValue( value ) }
|
|
139
|
+
placeholder={ __( 'Search patterns' ) }
|
|
140
|
+
label={ __( 'Search patterns' ) }
|
|
141
|
+
value={ filterValue }
|
|
142
|
+
__nextHasNoMarginBottom
|
|
143
|
+
/>
|
|
144
|
+
</FlexBlock>
|
|
145
|
+
{ categoryId === USER_PATTERN_CATEGORY && (
|
|
146
|
+
<ToggleGroupControl
|
|
147
|
+
className="edit-site-patterns__sync-status-filter"
|
|
148
|
+
hideLabelFromVision
|
|
149
|
+
label={ __( 'Filter by sync status' ) }
|
|
150
|
+
value={ syncFilter }
|
|
151
|
+
isBlock
|
|
152
|
+
onChange={ ( value ) => setSyncFilter( value ) }
|
|
153
|
+
__nextHasNoMarginBottom
|
|
154
|
+
>
|
|
155
|
+
{ Object.entries( SYNC_FILTERS ).map(
|
|
156
|
+
( [ key, label ] ) => (
|
|
157
|
+
<ToggleGroupControlOption
|
|
158
|
+
className="edit-site-patterns__sync-status-filter-option"
|
|
159
|
+
key={ key }
|
|
160
|
+
value={ key }
|
|
161
|
+
label={ label }
|
|
162
|
+
/>
|
|
163
|
+
)
|
|
85
164
|
) }
|
|
86
|
-
</
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
{ ! isResolving && !! unsyncedPatterns.length && (
|
|
97
|
-
<>
|
|
165
|
+
</ToggleGroupControl>
|
|
166
|
+
) }
|
|
167
|
+
</Flex>
|
|
168
|
+
</VStack>
|
|
169
|
+
<VStack
|
|
170
|
+
className="edit-site-patterns__section"
|
|
171
|
+
justify="flex-start"
|
|
172
|
+
spacing={ 6 }
|
|
173
|
+
>
|
|
174
|
+
{ syncFilter !== 'all' && (
|
|
98
175
|
<VStack className="edit-site-patterns__section-header">
|
|
99
|
-
<Heading as="
|
|
100
|
-
{
|
|
176
|
+
<Heading as="h3" level={ 5 } id={ titleId }>
|
|
177
|
+
{ title }
|
|
101
178
|
</Heading>
|
|
102
|
-
|
|
103
|
-
{
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
179
|
+
{ description ? (
|
|
180
|
+
<Text variant="muted" as="p" id={ descriptionId }>
|
|
181
|
+
{ description }
|
|
182
|
+
</Text>
|
|
183
|
+
) : null }
|
|
107
184
|
</VStack>
|
|
185
|
+
) }
|
|
186
|
+
{ hasPatterns && (
|
|
108
187
|
<Grid
|
|
109
188
|
categoryId={ categoryId }
|
|
110
|
-
|
|
111
|
-
|
|
189
|
+
items={ asyncList }
|
|
190
|
+
aria-labelledby={ titleId }
|
|
191
|
+
aria-describedby={ descriptionId }
|
|
112
192
|
/>
|
|
113
|
-
|
|
193
|
+
) }
|
|
194
|
+
{ ! isResolving && ! hasPatterns && <NoPatterns /> }
|
|
195
|
+
</VStack>
|
|
196
|
+
{ numPages > 1 && (
|
|
197
|
+
<Pagination
|
|
198
|
+
currentPage={ currentPage }
|
|
199
|
+
numPages={ numPages }
|
|
200
|
+
changePage={ changePage }
|
|
201
|
+
totalItems={ totalItems }
|
|
202
|
+
/>
|
|
114
203
|
) }
|
|
115
|
-
|
|
116
|
-
</VStack>
|
|
204
|
+
</>
|
|
117
205
|
);
|
|
118
206
|
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
Button,
|
|
6
|
+
MenuItem,
|
|
7
|
+
Modal,
|
|
8
|
+
TextControl,
|
|
9
|
+
__experimentalHStack as HStack,
|
|
10
|
+
__experimentalVStack as VStack,
|
|
11
|
+
} from '@wordpress/components';
|
|
12
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
13
|
+
import { useDispatch } from '@wordpress/data';
|
|
14
|
+
import { useState } from '@wordpress/element';
|
|
15
|
+
import { __ } from '@wordpress/i18n';
|
|
16
|
+
import { store as noticesStore } from '@wordpress/notices';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Internal dependencies
|
|
20
|
+
*/
|
|
21
|
+
import { TEMPLATE_PARTS } from './utils';
|
|
22
|
+
|
|
23
|
+
export default function RenameMenuItem( { item, onClose } ) {
|
|
24
|
+
const [ title, setTitle ] = useState( () => item.title );
|
|
25
|
+
const [ isModalOpen, setIsModalOpen ] = useState( false );
|
|
26
|
+
|
|
27
|
+
const { editEntityRecord, saveEditedEntityRecord } =
|
|
28
|
+
useDispatch( coreStore );
|
|
29
|
+
const { createSuccessNotice, createErrorNotice } =
|
|
30
|
+
useDispatch( noticesStore );
|
|
31
|
+
|
|
32
|
+
if ( item.type === TEMPLATE_PARTS && ! item.isCustom ) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
async function onRename( event ) {
|
|
37
|
+
event.preventDefault();
|
|
38
|
+
|
|
39
|
+
try {
|
|
40
|
+
await editEntityRecord( 'postType', item.type, item.id, { title } );
|
|
41
|
+
|
|
42
|
+
// Update state before saving rerenders the list.
|
|
43
|
+
setTitle( '' );
|
|
44
|
+
setIsModalOpen( false );
|
|
45
|
+
onClose();
|
|
46
|
+
|
|
47
|
+
// Persist edited entity.
|
|
48
|
+
await saveEditedEntityRecord( 'postType', item.type, item.id, {
|
|
49
|
+
throwOnError: true,
|
|
50
|
+
} );
|
|
51
|
+
|
|
52
|
+
createSuccessNotice( __( 'Entity renamed.' ), {
|
|
53
|
+
type: 'snackbar',
|
|
54
|
+
} );
|
|
55
|
+
} catch ( error ) {
|
|
56
|
+
const errorMessage =
|
|
57
|
+
error.message && error.code !== 'unknown_error'
|
|
58
|
+
? error.message
|
|
59
|
+
: __( 'An error occurred while renaming the entity.' );
|
|
60
|
+
|
|
61
|
+
createErrorNotice( errorMessage, { type: 'snackbar' } );
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<>
|
|
67
|
+
<MenuItem
|
|
68
|
+
onClick={ () => {
|
|
69
|
+
setIsModalOpen( true );
|
|
70
|
+
setTitle( item.title );
|
|
71
|
+
} }
|
|
72
|
+
>
|
|
73
|
+
{ __( 'Rename' ) }
|
|
74
|
+
</MenuItem>
|
|
75
|
+
{ isModalOpen && (
|
|
76
|
+
<Modal
|
|
77
|
+
title={ __( 'Rename' ) }
|
|
78
|
+
onRequestClose={ () => {
|
|
79
|
+
setIsModalOpen( false );
|
|
80
|
+
onClose();
|
|
81
|
+
} }
|
|
82
|
+
overlayClassName="edit-site-list__rename_modal"
|
|
83
|
+
>
|
|
84
|
+
<form onSubmit={ onRename }>
|
|
85
|
+
<VStack spacing="5">
|
|
86
|
+
<TextControl
|
|
87
|
+
__nextHasNoMarginBottom
|
|
88
|
+
label={ __( 'Name' ) }
|
|
89
|
+
value={ title }
|
|
90
|
+
onChange={ setTitle }
|
|
91
|
+
required
|
|
92
|
+
/>
|
|
93
|
+
|
|
94
|
+
<HStack justify="right">
|
|
95
|
+
<Button
|
|
96
|
+
variant="tertiary"
|
|
97
|
+
onClick={ () => {
|
|
98
|
+
setIsModalOpen( false );
|
|
99
|
+
onClose();
|
|
100
|
+
} }
|
|
101
|
+
>
|
|
102
|
+
{ __( 'Cancel' ) }
|
|
103
|
+
</Button>
|
|
104
|
+
|
|
105
|
+
<Button variant="primary" type="submit">
|
|
106
|
+
{ __( 'Save' ) }
|
|
107
|
+
</Button>
|
|
108
|
+
</HStack>
|
|
109
|
+
</VStack>
|
|
110
|
+
</form>
|
|
111
|
+
</Modal>
|
|
112
|
+
) }
|
|
113
|
+
</>
|
|
114
|
+
);
|
|
115
|
+
}
|