@wordpress/edit-site 5.12.0 → 5.12.2
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 +5 -0
- package/build/components/add-new-pattern/index.js +99 -0
- package/build/components/add-new-pattern/index.js.map +1 -0
- package/build/components/add-new-template/add-custom-template-modal-content.js +9 -23
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/index.js +2 -10
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/add-new-template/new-template.js +75 -22
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/app/index.js +2 -2
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/back-button.js +5 -3
- package/build/components/block-editor/back-button.js.map +1 -1
- package/build/components/block-editor/constants.js +9 -0
- package/build/components/block-editor/constants.js.map +1 -0
- package/build/components/block-editor/editor-canvas.js +8 -8
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/get-block-editor-provider.js +42 -0
- package/build/components/block-editor/get-block-editor-provider.js.map +1 -0
- package/build/components/block-editor/index.js +6 -132
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/block-editor/providers/default-block-editor-provider.js +58 -0
- package/build/components/block-editor/providers/default-block-editor-provider.js.map +1 -0
- package/build/components/block-editor/providers/navigation-block-editor-provider.js +117 -0
- package/build/components/block-editor/providers/navigation-block-editor-provider.js.map +1 -0
- package/build/components/block-editor/site-editor-canvas.js +137 -0
- package/build/components/block-editor/site-editor-canvas.js.map +1 -0
- package/build/components/block-editor/use-site-editor-settings.js +82 -0
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -0
- package/build/components/canvas-spinner/index.js +18 -1
- package/build/components/canvas-spinner/index.js.map +1 -1
- package/build/components/create-pattern-modal/index.js +125 -0
- package/build/components/create-pattern-modal/index.js.map +1 -0
- package/build/components/create-template-part-modal/index.js +50 -6
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/editor/index.js +24 -13
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +22 -4
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/global-styles/color-indicator-wrapper.js +4 -5
- package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +2 -2
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +2 -2
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +12 -16
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +2 -2
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/hooks.js +3 -3
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/icon-with-current-color.js +4 -5
- package/build/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build/components/global-styles/navigation-button.js +10 -11
- package/build/components/global-styles/navigation-button.js.map +1 -1
- package/build/components/global-styles/palette.js +3 -3
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preview.js +2 -2
- package/build/components/global-styles/preview.js.map +1 -1
- package/build/components/global-styles/root-menu.js +2 -2
- package/build/components/global-styles/root-menu.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +2 -2
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js +2 -2
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +2 -2
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-css.js +2 -2
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-layout.js +2 -2
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +4 -4
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +2 -2
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build/components/global-styles/screen-root.js +2 -2
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +2 -2
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +11 -3
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +2 -2
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-preview.js +2 -2
- package/build/components/global-styles/typography-preview.js.map +1 -1
- package/build/components/global-styles/ui.js +95 -36
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles-renderer/index.js +2 -2
- package/build/components/global-styles-renderer/index.js.map +1 -1
- package/build/components/header-edit-mode/document-actions/index.js +55 -22
- package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +41 -16
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/index.js +36 -2
- package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +4 -7
- package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +1 -1
- package/build/components/header-edit-mode/undo-redo/redo.js +2 -6
- package/build/components/header-edit-mode/undo-redo/redo.js.map +1 -1
- package/build/components/header-edit-mode/undo-redo/undo.js +2 -6
- package/build/components/header-edit-mode/undo-redo/undo.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +2 -1
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/edit-mode.js +39 -3
- package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +7 -2
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/register.js +10 -1
- package/build/components/keyboard-shortcuts/register.js.map +1 -1
- package/build/components/layout/hooks.js +21 -0
- package/build/components/layout/hooks.js.map +1 -1
- package/build/components/layout/index.js +126 -34
- package/build/components/layout/index.js.map +1 -1
- package/build/components/list/index.js +2 -2
- package/build/components/list/index.js.map +1 -1
- package/build/components/page/header.js +41 -0
- package/build/components/page/header.js.map +1 -0
- package/build/components/page/index.js +49 -0
- package/build/components/page/index.js.map +1 -0
- package/build/components/page-content-focus-manager/back-to-page-notification.js +73 -0
- package/build/components/page-content-focus-manager/back-to-page-notification.js.map +1 -0
- package/build/components/page-content-focus-manager/constants.js +9 -0
- package/build/components/page-content-focus-manager/constants.js.map +1 -0
- package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js +60 -0
- package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -0
- package/build/components/page-content-focus-manager/edit-template-notification.js +121 -0
- package/build/components/page-content-focus-manager/edit-template-notification.js.map +1 -0
- package/build/components/page-content-focus-manager/index.js +37 -0
- package/build/components/page-content-focus-manager/index.js.map +1 -0
- package/build/components/page-library/grid-item.js +169 -0
- package/build/components/page-library/grid-item.js.map +1 -0
- package/build/components/page-library/grid.js +49 -0
- package/build/components/page-library/grid.js.map +1 -0
- package/build/components/page-library/index.js +61 -0
- package/build/components/page-library/index.js.map +1 -0
- package/build/components/page-library/no-patterns.js +20 -0
- package/build/components/page-library/no-patterns.js.map +1 -0
- package/build/components/page-library/patterns-list.js +108 -0
- package/build/components/page-library/patterns-list.js.map +1 -0
- package/build/components/page-library/search-items.js +172 -0
- package/build/components/page-library/search-items.js.map +1 -0
- package/build/components/page-library/use-library-settings.js +53 -0
- package/build/components/page-library/use-library-settings.js.map +1 -0
- package/build/components/page-library/use-patterns.js +194 -0
- package/build/components/page-library/use-patterns.js.map +1 -0
- package/build/components/page-library/utils.js +30 -0
- package/build/components/page-library/utils.js.map +1 -0
- package/build/components/page-main/index.js +46 -0
- package/build/components/page-main/index.js.map +1 -0
- package/build/components/page-templates/index.js +101 -0
- package/build/components/page-templates/index.js.map +1 -0
- package/build/components/preferences-modal/enable-feature.js +9 -8
- package/build/components/preferences-modal/enable-feature.js.map +1 -1
- package/build/components/preferences-modal/index.js +30 -0
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/resizable-frame/index.js +6 -4
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/revisions/index.js +2 -2
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/routes/link.js +7 -10
- package/build/components/routes/link.js.map +1 -1
- package/build/components/routes/use-title.js +2 -2
- package/build/components/routes/use-title.js.map +1 -1
- package/build/components/save-button/index.js +15 -11
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js +2 -2
- package/build/components/save-hub/index.js.map +1 -1
- package/build/components/save-panel/index.js +5 -7
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +4 -8
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +47 -10
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/index.js +12 -8
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-button/index.js +2 -4
- package/build/components/sidebar-button/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +22 -8
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +8 -6
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/edit-template.js +84 -0
- package/build/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -0
- package/build/components/sidebar-edit-mode/page-panels/index.js +51 -38
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-content.js +35 -0
- package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -0
- package/build/components/sidebar-edit-mode/page-panels/page-status.js +192 -0
- package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -0
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js +45 -0
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -0
- package/build/components/sidebar-edit-mode/page-panels/publish-date.js +98 -0
- package/build/components/sidebar-edit-mode/page-panels/publish-date.js.map +1 -0
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +4 -7
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/settings-header/index.js +19 -6
- package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +2 -2
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/index.js +10 -6
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build/components/sidebar-navigation-item/index.js +11 -7
- package/build/components/sidebar-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +24 -9
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js +36 -0
- package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-details-panel/index.js +58 -0
- package/build/components/sidebar-navigation-screen-details-panel/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +22 -0
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -0
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +35 -0
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -0
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +22 -0
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -0
- package/build/components/sidebar-navigation-screen-global-styles/index.js +28 -16
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-library/category-item.js +48 -0
- package/build/components/sidebar-navigation-screen-library/category-item.js.map +1 -0
- package/build/components/sidebar-navigation-screen-library/index.js +112 -0
- package/build/components/sidebar-navigation-screen-library/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-library/use-default-pattern-categories.js +36 -0
- package/build/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +1 -0
- package/build/components/sidebar-navigation-screen-library/use-pattern-categories.js +76 -0
- package/build/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +1 -0
- package/build/components/sidebar-navigation-screen-library/use-template-part-areas.js +41 -0
- package/build/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +1 -0
- package/build/components/sidebar-navigation-screen-library/use-theme-patterns.js +40 -0
- package/build/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +1 -0
- package/build/components/sidebar-navigation-screen-main/index.js +12 -13
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-item/index.js +2 -2
- package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +42 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +41 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js +47 -92
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +84 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +71 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +63 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +49 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +167 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +3 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +58 -8
- 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 +57 -10
- 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 +21 -50
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/index.js +14 -34
- package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/page-details.js +29 -27
- package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/status-label.js +8 -7
- package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pages/index.js +9 -8
- package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/index.js +66 -0
- package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +41 -0
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -0
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +33 -0
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -0
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +40 -0
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -0
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +47 -0
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -0
- package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +82 -0
- package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -0
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +80 -0
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -0
- package/build/components/sidebar-navigation-screen-template/home-template-details.js +212 -0
- package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -0
- package/build/components/sidebar-navigation-screen-template/index.js +21 -7
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates/index.js +11 -11
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/site-hub/index.js +10 -12
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/style-book/index.js +10 -11
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +14 -4
- 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 +4 -4
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-path-with-url.js +12 -2
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build/components/table/index.js +29 -0
- package/build/components/table/index.js.map +1 -0
- package/build/components/template-part-converter/convert-to-template-part.js +3 -21
- package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build/components/welcome-guide/editor.js +1 -1
- package/build/components/welcome-guide/editor.js.map +1 -1
- package/build/components/welcome-guide/styles.js +4 -3
- package/build/components/welcome-guide/styles.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +212 -0
- package/build/hooks/commands/use-common-commands.js.map +1 -0
- package/build/hooks/commands/use-edit-mode-commands.js +196 -24
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/hooks/index.js +2 -0
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/navigation-menu-edit.js +95 -0
- package/build/hooks/navigation-menu-edit.js.map +1 -0
- package/build/hooks/push-changes-to-global-styles/index.js +5 -3
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/hooks/template-part-edit.js +6 -9
- package/build/hooks/template-part-edit.js.map +1 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/{private-apis.js → lock-unlock.js} +1 -1
- package/build/lock-unlock.js.map +1 -0
- package/build/store/actions.js +45 -9
- package/build/store/actions.js.map +1 -1
- package/build/store/index.js +3 -3
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js +7 -6
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +42 -17
- package/build/store/selectors.js.map +1 -1
- package/build/utils/get-is-list-page.js +12 -5
- package/build/utils/get-is-list-page.js.map +1 -1
- package/build/utils/is-previewing-theme.js +2 -2
- package/build/utils/is-previewing-theme.js.map +1 -1
- package/build/utils/use-activate-theme.js +3 -3
- package/build/utils/use-activate-theme.js.map +1 -1
- package/build/utils/use-debounced-input.js +26 -0
- package/build/utils/use-debounced-input.js.map +1 -0
- package/build-module/components/add-new-pattern/index.js +82 -0
- package/build-module/components/add-new-pattern/index.js.map +1 -0
- package/build-module/components/add-new-template/add-custom-template-modal-content.js +7 -20
- package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/index.js +2 -8
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +76 -22
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/app/index.js +1 -1
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/back-button.js +4 -2
- package/build-module/components/block-editor/back-button.js.map +1 -1
- package/build-module/components/block-editor/constants.js +2 -0
- package/build-module/components/block-editor/constants.js.map +1 -0
- package/build-module/components/block-editor/editor-canvas.js +6 -5
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/get-block-editor-provider.js +31 -0
- package/build-module/components/block-editor/get-block-editor-provider.js.map +1 -0
- package/build-module/components/block-editor/index.js +9 -127
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/block-editor/providers/default-block-editor-provider.js +42 -0
- package/build-module/components/block-editor/providers/default-block-editor-provider.js.map +1 -0
- package/build-module/components/block-editor/providers/navigation-block-editor-provider.js +102 -0
- package/build-module/components/block-editor/providers/navigation-block-editor-provider.js.map +1 -0
- package/build-module/components/block-editor/site-editor-canvas.js +115 -0
- package/build-module/components/block-editor/site-editor-canvas.js.map +1 -0
- package/build-module/components/block-editor/use-site-editor-settings.js +67 -0
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -0
- package/build-module/components/canvas-spinner/index.js +15 -1
- package/build-module/components/canvas-spinner/index.js.map +1 -1
- package/build-module/components/create-pattern-modal/index.js +113 -0
- package/build-module/components/create-pattern-modal/index.js.map +1 -0
- package/build-module/components/create-template-part-modal/index.js +47 -7
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/editor/index.js +24 -13
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +19 -2
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/global-styles/color-indicator-wrapper.js +4 -4
- package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +1 -1
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +1 -1
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +10 -15
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +1 -1
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/icon-with-current-color.js +4 -4
- package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build-module/components/global-styles/navigation-button.js +10 -8
- package/build-module/components/global-styles/navigation-button.js.map +1 -1
- package/build-module/components/global-styles/palette.js +2 -2
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preview.js +1 -1
- package/build-module/components/global-styles/preview.js.map +1 -1
- package/build-module/components/global-styles/root-menu.js +1 -1
- package/build-module/components/global-styles/root-menu.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +1 -1
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +1 -1
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +1 -1
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js +1 -1
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-layout.js +1 -1
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +1 -1
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +1 -1
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +11 -3
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +1 -1
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-preview.js +1 -1
- package/build-module/components/global-styles/typography-preview.js.map +1 -1
- package/build-module/components/global-styles/ui.js +94 -35
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles-renderer/index.js +1 -1
- package/build-module/components/global-styles-renderer/index.js.map +1 -1
- package/build-module/components/header-edit-mode/document-actions/index.js +55 -22
- package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +42 -17
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +35 -3
- package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +4 -4
- package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +1 -1
- package/build-module/components/header-edit-mode/undo-redo/redo.js +2 -3
- package/build-module/components/header-edit-mode/undo-redo/redo.js.map +1 -1
- package/build-module/components/header-edit-mode/undo-redo/undo.js +2 -3
- package/build-module/components/header-edit-mode/undo-redo/undo.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +2 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/edit-mode.js +36 -3
- package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +7 -2
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/register.js +10 -1
- package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
- package/build-module/components/layout/hooks.js +21 -0
- package/build-module/components/layout/hooks.js.map +1 -1
- package/build-module/components/layout/index.js +119 -28
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/list/index.js +1 -1
- package/build-module/components/list/index.js.map +1 -1
- package/build-module/components/page/header.js +33 -0
- package/build-module/components/page/header.js.map +1 -0
- package/build-module/components/page/index.js +37 -0
- package/build-module/components/page/index.js.map +1 -0
- package/build-module/components/page-content-focus-manager/back-to-page-notification.js +59 -0
- package/build-module/components/page-content-focus-manager/back-to-page-notification.js.map +1 -0
- package/build-module/components/page-content-focus-manager/constants.js +2 -0
- package/build-module/components/page-content-focus-manager/constants.js.map +1 -0
- package/build-module/components/{page-content-lock/use-disable-non-content-blocks.js → page-content-focus-manager/disable-non-page-content-blocks.js} +18 -9
- package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -0
- package/build-module/components/page-content-focus-manager/edit-template-notification.js +110 -0
- package/build-module/components/page-content-focus-manager/edit-template-notification.js.map +1 -0
- package/build-module/components/page-content-focus-manager/index.js +23 -0
- package/build-module/components/page-content-focus-manager/index.js.map +1 -0
- package/build-module/components/page-library/grid-item.js +149 -0
- package/build-module/components/page-library/grid-item.js.map +1 -0
- package/build-module/components/page-library/grid.js +38 -0
- package/build-module/components/page-library/grid.js.map +1 -0
- package/build-module/components/page-library/index.js +43 -0
- package/build-module/components/page-library/index.js.map +1 -0
- package/build-module/components/page-library/no-patterns.js +12 -0
- package/build-module/components/page-library/no-patterns.js.map +1 -0
- package/build-module/components/page-library/patterns-list.js +87 -0
- package/build-module/components/page-library/patterns-list.js.map +1 -0
- package/build-module/components/page-library/search-items.js +156 -0
- package/build-module/components/page-library/search-items.js.map +1 -0
- package/build-module/components/page-library/use-library-settings.js +40 -0
- package/build-module/components/page-library/use-library-settings.js.map +1 -0
- package/build-module/components/page-library/use-patterns.js +176 -0
- package/build-module/components/page-library/use-patterns.js.map +1 -0
- package/build-module/components/page-library/utils.js +13 -0
- package/build-module/components/page-library/utils.js.map +1 -0
- package/build-module/components/page-main/index.js +32 -0
- package/build-module/components/page-main/index.js.map +1 -0
- package/build-module/components/page-templates/index.js +80 -0
- package/build-module/components/page-templates/index.js.map +1 -0
- package/build-module/components/preferences-modal/enable-feature.js +9 -5
- package/build-module/components/preferences-modal/enable-feature.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +27 -0
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/resizable-frame/index.js +5 -3
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/revisions/index.js +1 -1
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/routes/link.js +6 -6
- package/build-module/components/routes/link.js.map +1 -1
- package/build-module/components/routes/use-title.js +1 -1
- package/build-module/components/routes/use-title.js.map +1 -1
- package/build-module/components/save-button/index.js +15 -11
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-hub/index.js +1 -1
- package/build-module/components/save-hub/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +3 -4
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +4 -5
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +44 -10
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/index.js +10 -7
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-button/index.js +2 -3
- package/build-module/components/sidebar-button/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +19 -6
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +8 -6
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js +71 -0
- package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/page-panels/index.js +51 -40
- package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +23 -0
- package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +176 -0
- package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +33 -0
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/page-panels/publish-date.js +85 -0
- package/build-module/components/sidebar-edit-mode/page-panels/publish-date.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +4 -4
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/settings-header/index.js +20 -7
- package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +1 -1
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/index.js +9 -6
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-item/index.js +11 -7
- package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +24 -9
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js +27 -0
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-details-panel/index.js +30 -0
- package/build-module/components/sidebar-navigation-screen-details-panel/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +14 -0
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +24 -0
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +14 -0
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +23 -11
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-library/category-item.js +37 -0
- package/build-module/components/sidebar-navigation-screen-library/category-item.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-library/index.js +87 -0
- package/build-module/components/sidebar-navigation-screen-library/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-library/use-default-pattern-categories.js +25 -0
- package/build-module/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-library/use-pattern-categories.js +61 -0
- package/build-module/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-library/use-template-part-areas.js +34 -0
- package/build-module/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-library/use-theme-patterns.js +27 -0
- package/build-module/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-main/index.js +13 -13
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +33 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +26 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +45 -90
- 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 +70 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +58 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +56 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +35 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +155 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +3 -1
- 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 +57 -9
- 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 +55 -7
- 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 +22 -50
- 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 +14 -34
- package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/page-details.js +28 -28
- package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/status-label.js +9 -8
- package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pages/index.js +8 -6
- package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/index.js +46 -0
- package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +28 -0
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +22 -0
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +27 -0
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +34 -0
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +71 -0
- package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +64 -0
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-template/home-template-details.js +192 -0
- package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-template/index.js +18 -6
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates/index.js +11 -10
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +8 -9
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/style-book/index.js +9 -9
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +13 -3
- 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 +11 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build-module/components/table/index.js +21 -0
- package/build-module/components/table/index.js.map +1 -0
- package/build-module/components/template-part-converter/convert-to-template-part.js +4 -20
- package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build-module/components/welcome-guide/editor.js +1 -1
- package/build-module/components/welcome-guide/editor.js.map +1 -1
- package/build-module/components/welcome-guide/styles.js +5 -3
- package/build-module/components/welcome-guide/styles.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +194 -0
- package/build-module/hooks/commands/use-common-commands.js.map +1 -0
- package/build-module/hooks/commands/use-edit-mode-commands.js +196 -26
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/hooks/index.js +1 -0
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/navigation-menu-edit.js +77 -0
- package/build-module/hooks/navigation-menu-edit.js.map +1 -0
- package/build-module/hooks/push-changes-to-global-styles/index.js +4 -2
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/hooks/template-part-edit.js +5 -5
- package/build-module/hooks/template-part-edit.js.map +1 -1
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/{private-apis.js → lock-unlock.js} +1 -1
- package/build-module/lock-unlock.js.map +1 -0
- package/build-module/store/actions.js +39 -7
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/index.js +1 -1
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/reducer.js +6 -5
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +37 -15
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/get-is-list-page.js +12 -5
- package/build-module/utils/get-is-list-page.js.map +1 -1
- package/build-module/utils/is-previewing-theme.js +2 -2
- package/build-module/utils/is-previewing-theme.js.map +1 -1
- package/build-module/utils/use-activate-theme.js +2 -2
- package/build-module/utils/use-activate-theme.js.map +1 -1
- package/build-module/utils/use-debounced-input.js +17 -0
- package/build-module/utils/use-debounced-input.js.map +1 -0
- package/build-style/style-rtl.css +424 -38
- package/build-style/style.css +424 -38
- package/package.json +44 -40
- package/src/components/add-new-pattern/index.js +92 -0
- package/src/components/add-new-template/add-custom-template-modal-content.js +1 -13
- package/src/components/add-new-template/index.js +0 -3
- package/src/components/add-new-template/new-template.js +121 -26
- package/src/components/add-new-template/style.scss +30 -2
- package/src/components/app/index.js +1 -1
- package/src/components/block-editor/back-button.js +5 -2
- package/src/components/block-editor/constants.js +1 -0
- package/src/components/block-editor/editor-canvas.js +1 -1
- package/src/components/block-editor/get-block-editor-provider.js +29 -0
- package/src/components/block-editor/index.js +15 -199
- package/src/components/block-editor/providers/default-block-editor-provider.js +44 -0
- package/src/components/block-editor/providers/navigation-block-editor-provider.js +114 -0
- package/src/components/block-editor/site-editor-canvas.js +155 -0
- package/src/components/block-editor/style.scss +6 -0
- package/src/components/block-editor/use-site-editor-settings.js +91 -0
- package/src/components/canvas-spinner/index.js +11 -1
- package/src/components/create-pattern-modal/index.js +134 -0
- package/src/components/create-pattern-modal/style.scss +3 -0
- package/src/components/create-template-part-modal/index.js +64 -4
- package/src/components/editor/index.js +25 -15
- package/src/components/editor/style.scss +4 -0
- package/src/components/editor-canvas-container/index.js +21 -4
- package/src/components/global-styles/color-palette-panel.js +1 -1
- package/src/components/global-styles/dimensions-panel.js +1 -1
- package/src/components/global-styles/global-styles-provider.js +10 -14
- package/src/components/global-styles/gradients-palette-panel.js +1 -1
- package/src/components/global-styles/hooks.js +1 -1
- package/src/components/global-styles/palette.js +2 -2
- package/src/components/global-styles/preview.js +1 -1
- package/src/components/global-styles/root-menu.js +1 -1
- package/src/components/global-styles/screen-block-list.js +1 -1
- package/src/components/global-styles/screen-block.js +1 -1
- package/src/components/global-styles/screen-colors.js +1 -1
- package/src/components/global-styles/screen-css.js +1 -1
- package/src/components/global-styles/screen-layout.js +1 -1
- package/src/components/global-styles/screen-revisions/index.js +1 -1
- package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -1
- package/src/components/global-styles/screen-root.js +1 -1
- package/src/components/global-styles/screen-typography.js +1 -1
- package/src/components/global-styles/stories/index.js +1 -1
- package/src/components/global-styles/style-variations-container.js +13 -3
- package/src/components/global-styles/style.scss +11 -0
- package/src/components/global-styles/typography-panel.js +1 -1
- package/src/components/global-styles/typography-preview.js +1 -1
- package/src/components/global-styles/ui.js +115 -46
- package/src/components/global-styles-renderer/index.js +1 -1
- package/src/components/header-edit-mode/document-actions/index.js +51 -26
- package/src/components/header-edit-mode/document-actions/style.scss +9 -5
- package/src/components/header-edit-mode/index.js +100 -58
- package/src/components/header-edit-mode/more-menu/index.js +52 -7
- package/src/components/keyboard-shortcuts/edit-mode.js +40 -3
- package/src/components/keyboard-shortcuts/index.js +5 -1
- package/src/components/keyboard-shortcuts/register.js +11 -1
- package/src/components/layout/hooks.js +21 -0
- package/src/components/layout/index.js +207 -110
- package/src/components/layout/style.scss +65 -1
- package/src/components/list/index.js +1 -1
- package/src/components/page/header.js +38 -0
- package/src/components/page/index.js +38 -0
- package/src/components/page/style.scss +38 -0
- package/src/components/page-content-focus-manager/back-to-page-notification.js +70 -0
- package/src/components/{page-content-lock → page-content-focus-manager}/constants.js +1 -1
- package/src/components/{page-content-lock/use-disable-non-content-blocks.js → page-content-focus-manager/disable-non-page-content-blocks.js} +15 -7
- package/src/components/page-content-focus-manager/edit-template-notification.js +108 -0
- package/src/components/page-content-focus-manager/index.js +26 -0
- package/src/components/page-library/grid-item.js +179 -0
- package/src/components/page-library/grid.js +39 -0
- package/src/components/page-library/index.js +39 -0
- package/src/components/page-library/no-patterns.js +12 -0
- package/src/components/page-library/patterns-list.js +114 -0
- package/src/components/page-library/search-items.js +171 -0
- package/src/components/page-library/style.scss +105 -0
- package/src/components/page-library/use-library-settings.js +51 -0
- package/src/components/page-library/use-patterns.js +238 -0
- package/src/components/page-library/utils.js +21 -0
- package/src/components/page-main/index.js +27 -0
- package/src/components/page-templates/index.js +104 -0
- package/src/components/preferences-modal/enable-feature.js +5 -2
- package/src/components/preferences-modal/index.js +25 -0
- package/src/components/resizable-frame/index.js +3 -1
- package/src/components/revisions/index.js +1 -1
- package/src/components/routes/link.js +2 -2
- package/src/components/routes/use-title.js +1 -1
- package/src/components/save-button/index.js +14 -11
- package/src/components/save-hub/index.js +1 -1
- package/src/components/save-panel/index.js +1 -1
- package/src/components/secondary-sidebar/list-view-sidebar.js +53 -6
- package/src/components/sidebar/index.js +11 -7
- package/src/components/sidebar-button/style.scss +1 -1
- package/src/components/sidebar-edit-mode/global-styles-sidebar.js +42 -29
- package/src/components/sidebar-edit-mode/index.js +8 -6
- package/src/components/sidebar-edit-mode/page-panels/edit-template.js +69 -0
- package/src/components/sidebar-edit-mode/page-panels/index.js +53 -53
- package/src/components/sidebar-edit-mode/page-panels/page-content.js +27 -0
- package/src/components/sidebar-edit-mode/page-panels/page-status.js +233 -0
- package/src/components/sidebar-edit-mode/page-panels/page-summary.js +35 -0
- package/src/components/sidebar-edit-mode/page-panels/publish-date.js +94 -0
- package/src/components/sidebar-edit-mode/page-panels/style.scss +31 -0
- package/src/components/sidebar-edit-mode/settings-header/index.js +18 -9
- package/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js +1 -1
- package/src/components/sidebar-edit-mode/template-panel/index.js +9 -6
- package/src/components/sidebar-navigation-item/index.js +6 -2
- package/src/components/sidebar-navigation-item/style.scss +8 -1
- package/src/components/sidebar-navigation-screen/index.js +22 -8
- package/src/components/sidebar-navigation-screen/style.scss +30 -9
- package/src/components/sidebar-navigation-screen-details-footer/index.js +45 -0
- package/src/components/sidebar-navigation-screen-details-footer/style.scss +5 -0
- package/src/components/sidebar-navigation-screen-details-panel/index.js +40 -0
- package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +14 -0
- package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +29 -0
- package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +14 -0
- package/src/components/sidebar-navigation-screen-details-panel/style.scss +25 -0
- package/src/components/sidebar-navigation-screen-global-styles/index.js +24 -6
- package/src/components/sidebar-navigation-screen-global-styles/style.scss +0 -3
- package/src/components/sidebar-navigation-screen-library/category-item.js +43 -0
- package/src/components/sidebar-navigation-screen-library/index.js +136 -0
- package/src/components/sidebar-navigation-screen-library/style.scss +3 -0
- package/src/components/sidebar-navigation-screen-library/use-default-pattern-categories.js +32 -0
- package/src/components/sidebar-navigation-screen-library/use-pattern-categories.js +64 -0
- package/src/components/sidebar-navigation-screen-library/use-template-part-areas.js +33 -0
- package/src/components/sidebar-navigation-screen-library/use-theme-patterns.js +44 -0
- package/src/components/sidebar-navigation-screen-main/index.js +11 -14
- package/src/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +45 -0
- package/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js +24 -0
- package/src/components/sidebar-navigation-screen-navigation-menu/index.js +50 -96
- package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +89 -0
- package/src/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +51 -0
- package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +62 -0
- package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +39 -0
- package/src/components/sidebar-navigation-screen-navigation-menu/style.scss +15 -0
- package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +179 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/constants.js +3 -1
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +73 -14
- package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +61 -2
- package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +25 -47
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +4 -0
- package/src/components/sidebar-navigation-screen-page/index.js +19 -58
- package/src/components/sidebar-navigation-screen-page/page-details.js +42 -39
- package/src/components/sidebar-navigation-screen-page/status-label.js +23 -19
- package/src/components/sidebar-navigation-screen-page/style.scss +1 -18
- package/src/components/sidebar-navigation-screen-pages/index.js +30 -29
- package/src/components/sidebar-navigation-screen-pattern/index.js +44 -0
- package/src/components/sidebar-navigation-screen-pattern/style.scss +25 -0
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +28 -0
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +21 -0
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +30 -0
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +33 -0
- package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +71 -0
- package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +86 -0
- package/src/components/sidebar-navigation-screen-template/home-template-details.js +230 -0
- package/src/components/sidebar-navigation-screen-template/index.js +19 -5
- package/src/components/sidebar-navigation-screen-template/style.scss +37 -14
- package/src/components/sidebar-navigation-screen-templates/index.js +18 -25
- package/src/components/site-hub/index.js +13 -9
- package/src/components/site-hub/style.scss +4 -3
- package/src/components/style-book/index.js +1 -1
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +16 -3
- package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -1
- package/src/components/sync-state-with-url/use-sync-path-with-url.js +11 -1
- package/src/components/table/index.js +33 -0
- package/src/components/table/style.scss +37 -0
- package/src/components/template-part-converter/convert-to-template-part.js +4 -27
- package/src/components/welcome-guide/editor.js +1 -1
- package/src/components/welcome-guide/styles.js +5 -3
- package/src/hooks/commands/use-common-commands.js +186 -0
- package/src/hooks/commands/use-edit-mode-commands.js +183 -28
- package/src/hooks/index.js +1 -0
- package/src/hooks/navigation-menu-edit.js +95 -0
- package/src/hooks/push-changes-to-global-styles/index.js +1 -1
- package/src/hooks/template-part-edit.js +1 -1
- package/src/index.js +1 -0
- package/src/store/actions.js +40 -8
- package/src/store/index.js +1 -1
- package/src/store/reducer.js +6 -5
- package/src/store/selectors.js +39 -9
- package/src/store/test/actions.js +8 -8
- package/src/store/test/reducer.js +11 -11
- package/src/store/test/selectors.js +10 -8
- package/src/style.scss +13 -2
- package/src/utils/get-is-list-page.js +16 -4
- package/src/utils/is-previewing-theme.js +4 -2
- package/src/utils/use-activate-theme.js +3 -2
- package/src/utils/use-debounced-input.js +17 -0
- package/build/components/add-new-template/new-template-part.js +0 -113
- package/build/components/add-new-template/new-template-part.js.map +0 -1
- package/build/components/page-content-lock/constants.js +0 -9
- package/build/components/page-content-lock/constants.js.map +0 -1
- package/build/components/page-content-lock/index.js +0 -29
- package/build/components/page-content-lock/index.js.map +0 -1
- package/build/components/page-content-lock/use-disable-non-content-blocks.js +0 -49
- package/build/components/page-content-lock/use-disable-non-content-blocks.js.map +0 -1
- package/build/components/page-content-lock/use-page-content-lock-notifications.js +0 -112
- package/build/components/page-content-lock/use-page-content-lock-notifications.js.map +0 -1
- package/build/components/sidebar-edit-mode/page-panels/content-blocks-list.js +0 -79
- package/build/components/sidebar-edit-mode/page-panels/content-blocks-list.js.map +0 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +0 -52
- package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +0 -1
- package/build/components/sidebar-navigation-screen-template-part/index.js +0 -105
- package/build/components/sidebar-navigation-screen-template-part/index.js.map +0 -1
- package/build/components/sidebar-navigation-subtitle/index.js +0 -17
- package/build/components/sidebar-navigation-subtitle/index.js.map +0 -1
- package/build/private-apis.js.map +0 -1
- package/build-module/components/add-new-template/new-template-part.js +0 -93
- package/build-module/components/add-new-template/new-template-part.js.map +0 -1
- package/build-module/components/page-content-lock/constants.js +0 -2
- package/build-module/components/page-content-lock/constants.js.map +0 -1
- package/build-module/components/page-content-lock/index.js +0 -14
- package/build-module/components/page-content-lock/index.js.map +0 -1
- package/build-module/components/page-content-lock/use-disable-non-content-blocks.js.map +0 -1
- package/build-module/components/page-content-lock/use-page-content-lock-notifications.js +0 -98
- package/build-module/components/page-content-lock/use-page-content-lock-notifications.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/page-panels/content-blocks-list.js +0 -67
- package/build-module/components/sidebar-edit-mode/page-panels/content-blocks-list.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +0 -39
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-template-part/index.js +0 -86
- package/build-module/components/sidebar-navigation-screen-template-part/index.js.map +0 -1
- package/build-module/components/sidebar-navigation-subtitle/index.js +0 -9
- package/build-module/components/sidebar-navigation-subtitle/index.js.map +0 -1
- package/build-module/private-apis.js.map +0 -1
- package/src/components/add-new-template/new-template-part.js +0 -109
- package/src/components/page-content-lock/index.js +0 -14
- package/src/components/page-content-lock/use-page-content-lock-notifications.js +0 -128
- package/src/components/sidebar-edit-mode/page-panels/content-blocks-list.js +0 -77
- package/src/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +0 -47
- package/src/components/sidebar-navigation-screen-template-part/index.js +0 -103
- package/src/components/sidebar-navigation-screen-templates/style.scss +0 -4
- package/src/components/sidebar-navigation-subtitle/index.js +0 -5
- package/src/components/sidebar-navigation-subtitle/style.scss +0 -7
- /package/src/{private-apis.js → lock-unlock.js} +0 -0
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = SidebarNavigationScreenNavigationMenuButton;
|
|
9
|
-
|
|
10
|
-
var _element = require("@wordpress/element");
|
|
11
|
-
|
|
12
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
|
-
|
|
14
|
-
var _components = require("@wordpress/components");
|
|
15
|
-
|
|
16
|
-
var _coreData = require("@wordpress/core-data");
|
|
17
|
-
|
|
18
|
-
var _constants = require("./constants");
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* WordPress dependencies
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Internal dependencies
|
|
26
|
-
*/
|
|
27
|
-
function SidebarNavigationScreenNavigationMenuButton({
|
|
28
|
-
children,
|
|
29
|
-
...props
|
|
30
|
-
}) {
|
|
31
|
-
const {
|
|
32
|
-
records: navigationMenus,
|
|
33
|
-
isResolving: isLoading
|
|
34
|
-
} = (0, _coreData.useEntityRecords)('postType', `wp_navigation`, _constants.PRELOADED_NAVIGATION_MENUS_QUERY);
|
|
35
|
-
const hasNavigationMenus = !!navigationMenus?.length;
|
|
36
|
-
const hasSingleNavigationMenu = navigationMenus?.length === 1;
|
|
37
|
-
const firstNavigationMenu = navigationMenus?.[0];
|
|
38
|
-
const showNavigationScreen = process.env.IS_GUTENBERG_PLUGIN ? hasNavigationMenus : false; // If there is a single menu then we can go directly to that menu.
|
|
39
|
-
// Otherwise we go to the navigation listing screen.
|
|
40
|
-
|
|
41
|
-
const path = hasSingleNavigationMenu ? `/navigation/wp_navigation/${firstNavigationMenu?.id}` : '/navigation';
|
|
42
|
-
|
|
43
|
-
if (!showNavigationScreen) {
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return (0, _element.createElement)(_components.__experimentalNavigatorButton, (0, _extends2.default)({}, props, {
|
|
48
|
-
disabled: isLoading,
|
|
49
|
-
path: path
|
|
50
|
-
}), children);
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=navigator-button.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/navigator-button.js"],"names":["SidebarNavigationScreenNavigationMenuButton","children","props","records","navigationMenus","isResolving","isLoading","PRELOADED_NAVIGATION_MENUS_QUERY","hasNavigationMenus","length","hasSingleNavigationMenu","firstNavigationMenu","showNavigationScreen","process","env","IS_GUTENBERG_PLUGIN","path","id"],"mappings":";;;;;;;;;;;;;AAIA;;AACA;;AAKA;;AAVA;AACA;AACA;;AAKA;AACA;AACA;AAGe,SAASA,2CAAT,CAAsD;AACpEC,EAAAA,QADoE;AAEpE,KAAGC;AAFiE,CAAtD,EAGX;AACH,QAAM;AAAEC,IAAAA,OAAO,EAAEC,eAAX;AAA4BC,IAAAA,WAAW,EAAEC;AAAzC,MACL,gCACC,UADD,EAEE,eAFF,EAGCC,2CAHD,CADD;AAOA,QAAMC,kBAAkB,GAAG,CAAC,CAAEJ,eAAe,EAAEK,MAA/C;AACA,QAAMC,uBAAuB,GAAGN,eAAe,EAAEK,MAAjB,KAA4B,CAA5D;AACA,QAAME,mBAAmB,GAAGP,eAAe,GAAI,CAAJ,CAA3C;AAEA,QAAMQ,oBAAoB,GAAGC,OAAO,CAACC,GAAR,CAAYC,mBAAZ,GAC1BP,kBAD0B,GAE1B,KAFH,CAZG,CAgBH;AACA;;AACA,QAAMQ,IAAI,GAAGN,uBAAuB,GAChC,6BAA6BC,mBAAmB,EAAEM,EAAI,EADtB,GAEjC,aAFH;;AAIA,MAAK,CAAEL,oBAAP,EAA8B;AAC7B,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,yCAAD,6BAAsBV,KAAtB;AAA8B,IAAA,QAAQ,EAAGI,SAAzC;AAAqD,IAAA,IAAI,EAAGU;AAA5D,MACGf,QADH,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __experimentalNavigatorButton as NavigatorButton } from '@wordpress/components';\nimport { useEntityRecords } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { PRELOADED_NAVIGATION_MENUS_QUERY } from './constants';\n\nexport default function SidebarNavigationScreenNavigationMenuButton( {\n\tchildren,\n\t...props\n} ) {\n\tconst { records: navigationMenus, isResolving: isLoading } =\n\t\tuseEntityRecords(\n\t\t\t'postType',\n\t\t\t`wp_navigation`,\n\t\t\tPRELOADED_NAVIGATION_MENUS_QUERY\n\t\t);\n\n\tconst hasNavigationMenus = !! navigationMenus?.length;\n\tconst hasSingleNavigationMenu = navigationMenus?.length === 1;\n\tconst firstNavigationMenu = navigationMenus?.[ 0 ];\n\n\tconst showNavigationScreen = process.env.IS_GUTENBERG_PLUGIN\n\t\t? hasNavigationMenus\n\t\t: false;\n\n\t// If there is a single menu then we can go directly to that menu.\n\t// Otherwise we go to the navigation listing screen.\n\tconst path = hasSingleNavigationMenu\n\t\t? `/navigation/wp_navigation/${ firstNavigationMenu?.id }`\n\t\t: '/navigation';\n\n\tif ( ! showNavigationScreen ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<NavigatorButton { ...props } disabled={ isLoading } path={ path }>\n\t\t\t{ children }\n\t\t</NavigatorButton>\n\t);\n}\n"]}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = SidebarNavigationScreenTemplatePart;
|
|
9
|
-
|
|
10
|
-
var _element = require("@wordpress/element");
|
|
11
|
-
|
|
12
|
-
var _i18n = require("@wordpress/i18n");
|
|
13
|
-
|
|
14
|
-
var _data = require("@wordpress/data");
|
|
15
|
-
|
|
16
|
-
var _icons = require("@wordpress/icons");
|
|
17
|
-
|
|
18
|
-
var _components = require("@wordpress/components");
|
|
19
|
-
|
|
20
|
-
var _coreData = require("@wordpress/core-data");
|
|
21
|
-
|
|
22
|
-
var _sidebarNavigationScreen = _interopRequireDefault(require("../sidebar-navigation-screen"));
|
|
23
|
-
|
|
24
|
-
var _useEditedEntityRecord = _interopRequireDefault(require("../use-edited-entity-record"));
|
|
25
|
-
|
|
26
|
-
var _privateApis = require("../../private-apis");
|
|
27
|
-
|
|
28
|
-
var _store = require("../../store");
|
|
29
|
-
|
|
30
|
-
var _sidebarButton = _interopRequireDefault(require("../sidebar-button"));
|
|
31
|
-
|
|
32
|
-
var _addedBy = require("../list/added-by");
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* WordPress dependencies
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Internal dependencies
|
|
40
|
-
*/
|
|
41
|
-
function useTemplateTitleAndDescription(postType, postId) {
|
|
42
|
-
const {
|
|
43
|
-
getDescription,
|
|
44
|
-
getTitle,
|
|
45
|
-
record
|
|
46
|
-
} = (0, _useEditedEntityRecord.default)(postType, postId);
|
|
47
|
-
const currentTheme = (0, _data.useSelect)(select => select(_coreData.store).getCurrentTheme(), []);
|
|
48
|
-
const addedBy = (0, _addedBy.useAddedBy)(postType, postId);
|
|
49
|
-
const isAddedByActiveTheme = addedBy.type === 'theme' && record.theme === currentTheme?.stylesheet;
|
|
50
|
-
const title = getTitle();
|
|
51
|
-
let descriptionText = getDescription();
|
|
52
|
-
|
|
53
|
-
if (!descriptionText && addedBy.text) {
|
|
54
|
-
descriptionText = (0, _i18n.sprintf)( // translators: %s: template part title e.g: "Header".
|
|
55
|
-
(0, _i18n.__)('This is your %s template part.'), getTitle());
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const description = (0, _element.createElement)(_element.Fragment, null, descriptionText, addedBy.text && !isAddedByActiveTheme && (0, _element.createElement)("span", {
|
|
59
|
-
className: "edit-site-sidebar-navigation-screen-template__added-by-description"
|
|
60
|
-
}, (0, _element.createElement)("span", {
|
|
61
|
-
className: "edit-site-sidebar-navigation-screen-template__added-by-description-author"
|
|
62
|
-
}, (0, _element.createElement)("span", {
|
|
63
|
-
className: "edit-site-sidebar-navigation-screen-template__added-by-description-author-icon"
|
|
64
|
-
}, addedBy.imageUrl ? (0, _element.createElement)("img", {
|
|
65
|
-
src: addedBy.imageUrl,
|
|
66
|
-
alt: "",
|
|
67
|
-
width: "24",
|
|
68
|
-
height: "24"
|
|
69
|
-
}) : (0, _element.createElement)(_components.Icon, {
|
|
70
|
-
icon: addedBy.icon
|
|
71
|
-
})), addedBy.text), addedBy.isCustomized && (0, _element.createElement)("span", {
|
|
72
|
-
className: "edit-site-sidebar-navigation-screen-template__added-by-description-customized"
|
|
73
|
-
}, (0, _i18n._x)('(Customized)', 'template part'))));
|
|
74
|
-
return {
|
|
75
|
-
title,
|
|
76
|
-
description
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function SidebarNavigationScreenTemplatePart() {
|
|
81
|
-
const {
|
|
82
|
-
params
|
|
83
|
-
} = (0, _components.__experimentalUseNavigator)();
|
|
84
|
-
const {
|
|
85
|
-
postType,
|
|
86
|
-
postId
|
|
87
|
-
} = params;
|
|
88
|
-
const {
|
|
89
|
-
setCanvasMode
|
|
90
|
-
} = (0, _privateApis.unlock)((0, _data.useDispatch)(_store.store));
|
|
91
|
-
const {
|
|
92
|
-
title,
|
|
93
|
-
description
|
|
94
|
-
} = useTemplateTitleAndDescription(postType, postId);
|
|
95
|
-
return (0, _element.createElement)(_sidebarNavigationScreen.default, {
|
|
96
|
-
title: title,
|
|
97
|
-
actions: (0, _element.createElement)(_sidebarButton.default, {
|
|
98
|
-
onClick: () => setCanvasMode('edit'),
|
|
99
|
-
label: (0, _i18n.__)('Edit'),
|
|
100
|
-
icon: _icons.pencil
|
|
101
|
-
}),
|
|
102
|
-
description: description
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-template-part/index.js"],"names":["useTemplateTitleAndDescription","postType","postId","getDescription","getTitle","record","currentTheme","select","coreStore","getCurrentTheme","addedBy","isAddedByActiveTheme","type","theme","stylesheet","title","descriptionText","text","description","imageUrl","icon","isCustomized","SidebarNavigationScreenTemplatePart","params","setCanvasMode","editSiteStore","pencil"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AAIA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AApBA;AACA;AACA;;AAUA;AACA;AACA;AAQA,SAASA,8BAAT,CAAyCC,QAAzC,EAAmDC,MAAnD,EAA4D;AAC3D,QAAM;AAAEC,IAAAA,cAAF;AAAkBC,IAAAA,QAAlB;AAA4BC,IAAAA;AAA5B,MAAuC,oCAC5CJ,QAD4C,EAE5CC,MAF4C,CAA7C;AAIA,QAAMI,YAAY,GAAG,qBAClBC,MAAF,IAAcA,MAAM,CAAEC,eAAF,CAAN,CAAoBC,eAApB,EADM,EAEpB,EAFoB,CAArB;AAIA,QAAMC,OAAO,GAAG,yBAAYT,QAAZ,EAAsBC,MAAtB,CAAhB;AACA,QAAMS,oBAAoB,GACzBD,OAAO,CAACE,IAAR,KAAiB,OAAjB,IAA4BP,MAAM,CAACQ,KAAP,KAAiBP,YAAY,EAAEQ,UAD5D;AAEA,QAAMC,KAAK,GAAGX,QAAQ,EAAtB;AACA,MAAIY,eAAe,GAAGb,cAAc,EAApC;;AAEA,MAAK,CAAEa,eAAF,IAAqBN,OAAO,CAACO,IAAlC,EAAyC;AACxCD,IAAAA,eAAe,GAAG,oBACjB;AACA,kBAAI,gCAAJ,CAFiB,EAGjBZ,QAAQ,EAHS,CAAlB;AAKA;;AAED,QAAMc,WAAW,GAChB,qDACGF,eADH,EAGGN,OAAO,CAACO,IAAR,IAAgB,CAAEN,oBAAlB,IACD;AAAM,IAAA,SAAS,EAAC;AAAhB,KACC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACGD,OAAO,CAACS,QAAR,GACD;AACC,IAAA,GAAG,EAAGT,OAAO,CAACS,QADf;AAEC,IAAA,GAAG,EAAC,EAFL;AAGC,IAAA,KAAK,EAAC,IAHP;AAIC,IAAA,MAAM,EAAC;AAJR,IADC,GAQD,4BAAC,gBAAD;AAAM,IAAA,IAAI,EAAGT,OAAO,CAACU;AAArB,IATF,CADD,EAaGV,OAAO,CAACO,IAbX,CADD,EAiBGP,OAAO,CAACW,YAAR,IACD;AAAM,IAAA,SAAS,EAAC;AAAhB,KACG,cAAI,cAAJ,EAAoB,eAApB,CADH,CAlBF,CAJF,CADD;AAgCA,SAAO;AAAEN,IAAAA,KAAF;AAASG,IAAAA;AAAT,GAAP;AACA;;AAEc,SAASI,mCAAT,GAA+C;AAC7D,QAAM;AAAEC,IAAAA;AAAF,MAAa,6CAAnB;AACA,QAAM;AAAEtB,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAAuBqB,MAA7B;AACA,QAAM;AAAEC,IAAAA;AAAF,MAAoB,yBAAQ,uBAAaC,YAAb,CAAR,CAA1B;AACA,QAAM;AAAEV,IAAAA,KAAF;AAASG,IAAAA;AAAT,MAAyBlB,8BAA8B,CAC5DC,QAD4D,EAE5DC,MAF4D,CAA7D;AAKA,SACC,4BAAC,gCAAD;AACC,IAAA,KAAK,EAAGa,KADT;AAEC,IAAA,OAAO,EACN,4BAAC,sBAAD;AACC,MAAA,OAAO,EAAG,MAAMS,aAAa,CAAE,MAAF,CAD9B;AAEC,MAAA,KAAK,EAAG,cAAI,MAAJ,CAFT;AAGC,MAAA,IAAI,EAAGE;AAHR,MAHF;AASC,IAAA,WAAW,EAAGR;AATf,IADD;AAaA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf, _x } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { pencil } from '@wordpress/icons';\nimport {\n\t__experimentalUseNavigator as useNavigator,\n\tIcon,\n} from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport useEditedEntityRecord from '../use-edited-entity-record';\nimport { unlock } from '../../private-apis';\nimport { store as editSiteStore } from '../../store';\nimport SidebarButton from '../sidebar-button';\nimport { useAddedBy } from '../list/added-by';\n\nfunction useTemplateTitleAndDescription( postType, postId ) {\n\tconst { getDescription, getTitle, record } = useEditedEntityRecord(\n\t\tpostType,\n\t\tpostId\n\t);\n\tconst currentTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme(),\n\t\t[]\n\t);\n\tconst addedBy = useAddedBy( postType, postId );\n\tconst isAddedByActiveTheme =\n\t\taddedBy.type === 'theme' && record.theme === currentTheme?.stylesheet;\n\tconst title = getTitle();\n\tlet descriptionText = getDescription();\n\n\tif ( ! descriptionText && addedBy.text ) {\n\t\tdescriptionText = sprintf(\n\t\t\t// translators: %s: template part title e.g: \"Header\".\n\t\t\t__( 'This is your %s template part.' ),\n\t\t\tgetTitle()\n\t\t);\n\t}\n\n\tconst description = (\n\t\t<>\n\t\t\t{ descriptionText }\n\n\t\t\t{ addedBy.text && ! isAddedByActiveTheme && (\n\t\t\t\t<span className=\"edit-site-sidebar-navigation-screen-template__added-by-description\">\n\t\t\t\t\t<span className=\"edit-site-sidebar-navigation-screen-template__added-by-description-author\">\n\t\t\t\t\t\t<span className=\"edit-site-sidebar-navigation-screen-template__added-by-description-author-icon\">\n\t\t\t\t\t\t\t{ addedBy.imageUrl ? (\n\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\tsrc={ addedBy.imageUrl }\n\t\t\t\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t\t\t\t\twidth=\"24\"\n\t\t\t\t\t\t\t\t\theight=\"24\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<Icon icon={ addedBy.icon } />\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t{ addedBy.text }\n\t\t\t\t\t</span>\n\n\t\t\t\t\t{ addedBy.isCustomized && (\n\t\t\t\t\t\t<span className=\"edit-site-sidebar-navigation-screen-template__added-by-description-customized\">\n\t\t\t\t\t\t\t{ _x( '(Customized)', 'template part' ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t</span>\n\t\t\t) }\n\t\t</>\n\t);\n\n\treturn { title, description };\n}\n\nexport default function SidebarNavigationScreenTemplatePart() {\n\tconst { params } = useNavigator();\n\tconst { postType, postId } = params;\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\tconst { title, description } = useTemplateTitleAndDescription(\n\t\tpostType,\n\t\tpostId\n\t);\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\ttitle={ title }\n\t\t\tactions={\n\t\t\t\t<SidebarButton\n\t\t\t\t\tonClick={ () => setCanvasMode( 'edit' ) }\n\t\t\t\t\tlabel={ __( 'Edit' ) }\n\t\t\t\t\ticon={ pencil }\n\t\t\t\t/>\n\t\t\t}\n\t\t\tdescription={ description }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = SidebarNavigationSubtitle;
|
|
7
|
-
|
|
8
|
-
var _element = require("@wordpress/element");
|
|
9
|
-
|
|
10
|
-
function SidebarNavigationSubtitle({
|
|
11
|
-
children
|
|
12
|
-
}) {
|
|
13
|
-
return (0, _element.createElement)("h3", {
|
|
14
|
-
className: "edit-site-sidebar-navigation-subtitle"
|
|
15
|
-
}, children);
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-subtitle/index.js"],"names":["SidebarNavigationSubtitle","children"],"mappings":";;;;;;;;;AAAe,SAASA,yBAAT,CAAoC;AAAEC,EAAAA;AAAF,CAApC,EAAmD;AACjE,SACC;AAAI,IAAA,SAAS,EAAC;AAAd,KAAwDA,QAAxD,CADD;AAGA","sourcesContent":["export default function SidebarNavigationSubtitle( { children } ) {\n\treturn (\n\t\t<h3 className=\"edit-site-sidebar-navigation-subtitle\">{ children }</h3>\n\t);\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/private-apis.js"],"names":["lock","unlock"],"mappings":";;;;;;;AAGA;;AAHA;AACA;AACA;AAGO,MAAM;AAAEA,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IACZ,mEACC,8GADD,EAEC,sBAFD,CADM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',\n\t\t'@wordpress/edit-site'\n\t);\n"]}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import { createElement, Fragment } from "@wordpress/element";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* WordPress dependencies
|
|
6
|
-
*/
|
|
7
|
-
import { useState } from '@wordpress/element';
|
|
8
|
-
import { useDispatch } from '@wordpress/data';
|
|
9
|
-
import { Button } from '@wordpress/components';
|
|
10
|
-
import { __ } from '@wordpress/i18n';
|
|
11
|
-
import { store as noticesStore } from '@wordpress/notices';
|
|
12
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
13
|
-
import { plus } from '@wordpress/icons';
|
|
14
|
-
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
15
|
-
/**
|
|
16
|
-
* Internal dependencies
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
import CreateTemplatePartModal from '../create-template-part-modal';
|
|
20
|
-
import { useExistingTemplateParts, getUniqueTemplatePartTitle, getCleanTemplatePartSlug } from '../../utils/template-part-create';
|
|
21
|
-
import { unlock } from '../../private-apis';
|
|
22
|
-
const {
|
|
23
|
-
useHistory
|
|
24
|
-
} = unlock(routerPrivateApis);
|
|
25
|
-
export default function NewTemplatePart({
|
|
26
|
-
postType,
|
|
27
|
-
showIcon = true,
|
|
28
|
-
toggleProps
|
|
29
|
-
}) {
|
|
30
|
-
const history = useHistory();
|
|
31
|
-
const [isModalOpen, setIsModalOpen] = useState(false);
|
|
32
|
-
const {
|
|
33
|
-
createErrorNotice
|
|
34
|
-
} = useDispatch(noticesStore);
|
|
35
|
-
const {
|
|
36
|
-
saveEntityRecord
|
|
37
|
-
} = useDispatch(coreStore);
|
|
38
|
-
const existingTemplateParts = useExistingTemplateParts();
|
|
39
|
-
|
|
40
|
-
async function createTemplatePart({
|
|
41
|
-
title,
|
|
42
|
-
area
|
|
43
|
-
}) {
|
|
44
|
-
if (!title) {
|
|
45
|
-
createErrorNotice(__('Title is not defined.'), {
|
|
46
|
-
type: 'snackbar'
|
|
47
|
-
});
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
try {
|
|
52
|
-
const uniqueTitle = getUniqueTemplatePartTitle(title, existingTemplateParts);
|
|
53
|
-
const cleanSlug = getCleanTemplatePartSlug(uniqueTitle);
|
|
54
|
-
const templatePart = await saveEntityRecord('postType', 'wp_template_part', {
|
|
55
|
-
slug: cleanSlug,
|
|
56
|
-
title: uniqueTitle,
|
|
57
|
-
content: '',
|
|
58
|
-
area
|
|
59
|
-
}, {
|
|
60
|
-
throwOnError: true
|
|
61
|
-
});
|
|
62
|
-
setIsModalOpen(false); // Navigate to the created template part editor.
|
|
63
|
-
|
|
64
|
-
history.push({
|
|
65
|
-
postId: templatePart.id,
|
|
66
|
-
postType: 'wp_template_part',
|
|
67
|
-
canvas: 'edit'
|
|
68
|
-
}); // TODO: Add a success notice?
|
|
69
|
-
} catch (error) {
|
|
70
|
-
const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : __('An error occurred while creating the template part.');
|
|
71
|
-
createErrorNotice(errorMessage, {
|
|
72
|
-
type: 'snackbar'
|
|
73
|
-
});
|
|
74
|
-
setIsModalOpen(false);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const {
|
|
79
|
-
as: Toggle = Button,
|
|
80
|
-
...restToggleProps
|
|
81
|
-
} = toggleProps !== null && toggleProps !== void 0 ? toggleProps : {};
|
|
82
|
-
return createElement(Fragment, null, createElement(Toggle, _extends({}, restToggleProps, {
|
|
83
|
-
onClick: () => {
|
|
84
|
-
setIsModalOpen(true);
|
|
85
|
-
},
|
|
86
|
-
icon: showIcon ? plus : null,
|
|
87
|
-
label: postType.labels.add_new
|
|
88
|
-
}), showIcon ? null : postType.labels.add_new), isModalOpen && createElement(CreateTemplatePartModal, {
|
|
89
|
-
closeModal: () => setIsModalOpen(false),
|
|
90
|
-
onCreate: createTemplatePart
|
|
91
|
-
}));
|
|
92
|
-
}
|
|
93
|
-
//# sourceMappingURL=new-template-part.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/add-new-template/new-template-part.js"],"names":["useState","useDispatch","Button","__","store","noticesStore","coreStore","plus","privateApis","routerPrivateApis","CreateTemplatePartModal","useExistingTemplateParts","getUniqueTemplatePartTitle","getCleanTemplatePartSlug","unlock","useHistory","NewTemplatePart","postType","showIcon","toggleProps","history","isModalOpen","setIsModalOpen","createErrorNotice","saveEntityRecord","existingTemplateParts","createTemplatePart","title","area","type","uniqueTitle","cleanSlug","templatePart","slug","content","throwOnError","push","postId","id","canvas","error","errorMessage","message","code","as","Toggle","restToggleProps","labels","add_new"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,QAAT,QAAyB,oBAAzB;AACA,SAASC,WAAT,QAA4B,iBAA5B;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,KAAK,IAAIC,YAAlB,QAAsC,oBAAtC;AACA,SAASD,KAAK,IAAIE,SAAlB,QAAmC,sBAAnC;AACA,SAASC,IAAT,QAAqB,kBAArB;AACA,SAASC,WAAW,IAAIC,iBAAxB,QAAiD,mBAAjD;AAEA;AACA;AACA;;AACA,OAAOC,uBAAP,MAAoC,+BAApC;AACA,SACCC,wBADD,EAECC,0BAFD,EAGCC,wBAHD,QAIO,kCAJP;AAKA,SAASC,MAAT,QAAuB,oBAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAiBD,MAAM,CAAEL,iBAAF,CAA7B;AAEA,eAAe,SAASO,eAAT,CAA0B;AACxCC,EAAAA,QADwC;AAExCC,EAAAA,QAAQ,GAAG,IAF6B;AAGxCC,EAAAA;AAHwC,CAA1B,EAIX;AACH,QAAMC,OAAO,GAAGL,UAAU,EAA1B;AACA,QAAM,CAAEM,WAAF,EAAeC,cAAf,IAAkCtB,QAAQ,CAAE,KAAF,CAAhD;AACA,QAAM;AAAEuB,IAAAA;AAAF,MAAwBtB,WAAW,CAAEI,YAAF,CAAzC;AACA,QAAM;AAAEmB,IAAAA;AAAF,MAAuBvB,WAAW,CAAEK,SAAF,CAAxC;AACA,QAAMmB,qBAAqB,GAAGd,wBAAwB,EAAtD;;AAEA,iBAAee,kBAAf,CAAmC;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAAnC,EAAqD;AACpD,QAAK,CAAED,KAAP,EAAe;AACdJ,MAAAA,iBAAiB,CAAEpB,EAAE,CAAE,uBAAF,CAAJ,EAAiC;AACjD0B,QAAAA,IAAI,EAAE;AAD2C,OAAjC,CAAjB;AAGA;AACA;;AAED,QAAI;AACH,YAAMC,WAAW,GAAGlB,0BAA0B,CAC7Ce,KAD6C,EAE7CF,qBAF6C,CAA9C;AAIA,YAAMM,SAAS,GAAGlB,wBAAwB,CAAEiB,WAAF,CAA1C;AAEA,YAAME,YAAY,GAAG,MAAMR,gBAAgB,CAC1C,UAD0C,EAE1C,kBAF0C,EAG1C;AACCS,QAAAA,IAAI,EAAEF,SADP;AAECJ,QAAAA,KAAK,EAAEG,WAFR;AAGCI,QAAAA,OAAO,EAAE,EAHV;AAICN,QAAAA;AAJD,OAH0C,EAS1C;AAAEO,QAAAA,YAAY,EAAE;AAAhB,OAT0C,CAA3C;AAYAb,MAAAA,cAAc,CAAE,KAAF,CAAd,CAnBG,CAqBH;;AACAF,MAAAA,OAAO,CAACgB,IAAR,CAAc;AACbC,QAAAA,MAAM,EAAEL,YAAY,CAACM,EADR;AAEbrB,QAAAA,QAAQ,EAAE,kBAFG;AAGbsB,QAAAA,MAAM,EAAE;AAHK,OAAd,EAtBG,CA4BH;AACA,KA7BD,CA6BE,OAAQC,KAAR,EAAgB;AACjB,YAAMC,YAAY,GACjBD,KAAK,CAACE,OAAN,IAAiBF,KAAK,CAACG,IAAN,KAAe,eAAhC,GACGH,KAAK,CAACE,OADT,GAEGvC,EAAE,CACF,qDADE,CAHN;AAOAoB,MAAAA,iBAAiB,CAAEkB,YAAF,EAAgB;AAAEZ,QAAAA,IAAI,EAAE;AAAR,OAAhB,CAAjB;AAEAP,MAAAA,cAAc,CAAE,KAAF,CAAd;AACA;AACD;;AACD,QAAM;AAAEsB,IAAAA,EAAE,EAAEC,MAAM,GAAG3C,MAAf;AAAuB,OAAG4C;AAA1B,MAA8C3B,WAA9C,aAA8CA,WAA9C,cAA8CA,WAA9C,GAA6D,EAAnE;AAEA,SACC,8BACC,cAAC,MAAD,eACM2B,eADN;AAEC,IAAA,OAAO,EAAG,MAAM;AACfxB,MAAAA,cAAc,CAAE,IAAF,CAAd;AACA,KAJF;AAKC,IAAA,IAAI,EAAGJ,QAAQ,GAAGX,IAAH,GAAU,IAL1B;AAMC,IAAA,KAAK,EAAGU,QAAQ,CAAC8B,MAAT,CAAgBC;AANzB,MAQG9B,QAAQ,GAAG,IAAH,GAAUD,QAAQ,CAAC8B,MAAT,CAAgBC,OARrC,CADD,EAWG3B,WAAW,IACZ,cAAC,uBAAD;AACC,IAAA,UAAU,EAAG,MAAMC,cAAc,CAAE,KAAF,CADlC;AAEC,IAAA,QAAQ,EAAGI;AAFZ,IAZF,CADD;AAoBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport { useDispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { plus } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport CreateTemplatePartModal from '../create-template-part-modal';\nimport {\n\tuseExistingTemplateParts,\n\tgetUniqueTemplatePartTitle,\n\tgetCleanTemplatePartSlug,\n} from '../../utils/template-part-create';\nimport { unlock } from '../../private-apis';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nexport default function NewTemplatePart( {\n\tpostType,\n\tshowIcon = true,\n\ttoggleProps,\n} ) {\n\tconst history = useHistory();\n\tconst [ isModalOpen, setIsModalOpen ] = useState( false );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst existingTemplateParts = useExistingTemplateParts();\n\n\tasync function createTemplatePart( { title, area } ) {\n\t\tif ( ! title ) {\n\t\t\tcreateErrorNotice( __( 'Title is not defined.' ), {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst uniqueTitle = getUniqueTemplatePartTitle(\n\t\t\t\ttitle,\n\t\t\t\texistingTemplateParts\n\t\t\t);\n\t\t\tconst cleanSlug = getCleanTemplatePartSlug( uniqueTitle );\n\n\t\t\tconst templatePart = await saveEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'wp_template_part',\n\t\t\t\t{\n\t\t\t\t\tslug: cleanSlug,\n\t\t\t\t\ttitle: uniqueTitle,\n\t\t\t\t\tcontent: '',\n\t\t\t\t\tarea,\n\t\t\t\t},\n\t\t\t\t{ throwOnError: true }\n\t\t\t);\n\n\t\t\tsetIsModalOpen( false );\n\n\t\t\t// Navigate to the created template part editor.\n\t\t\thistory.push( {\n\t\t\t\tpostId: templatePart.id,\n\t\t\t\tpostType: 'wp_template_part',\n\t\t\t\tcanvas: 'edit',\n\t\t\t} );\n\n\t\t\t// TODO: Add a success notice?\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __(\n\t\t\t\t\t\t\t'An error occurred while creating the template part.'\n\t\t\t\t\t );\n\n\t\t\tcreateErrorNotice( errorMessage, { type: 'snackbar' } );\n\n\t\t\tsetIsModalOpen( false );\n\t\t}\n\t}\n\tconst { as: Toggle = Button, ...restToggleProps } = toggleProps ?? {};\n\n\treturn (\n\t\t<>\n\t\t\t<Toggle\n\t\t\t\t{ ...restToggleProps }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsModalOpen( true );\n\t\t\t\t} }\n\t\t\t\ticon={ showIcon ? plus : null }\n\t\t\t\tlabel={ postType.labels.add_new }\n\t\t\t>\n\t\t\t\t{ showIcon ? null : postType.labels.add_new }\n\t\t\t</Toggle>\n\t\t\t{ isModalOpen && (\n\t\t\t\t<CreateTemplatePartModal\n\t\t\t\t\tcloseModal={ () => setIsModalOpen( false ) }\n\t\t\t\t\tonCreate={ createTemplatePart }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/page-content-lock/constants.js"],"names":["CONTENT_BLOCK_TYPES"],"mappings":"AAAA,OAAO,MAAMA,mBAAmB,GAAG,CAClC,iBADkC,EAElC,0BAFkC,EAGlC,mBAHkC,CAA5B","sourcesContent":["export const CONTENT_BLOCK_TYPES = [\n\t'core/post-title',\n\t'core/post-featured-image',\n\t'core/post-content',\n];\n"]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Internal dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { useDisableNonContentBlocks } from './use-disable-non-content-blocks';
|
|
5
|
-
/**
|
|
6
|
-
* Component that when rendered, locks the site editor so that only page content
|
|
7
|
-
* can be edited.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
export function PageContentLock() {
|
|
11
|
-
useDisableNonContentBlocks();
|
|
12
|
-
}
|
|
13
|
-
export { usePageContentLockNotifications } from './use-page-content-lock-notifications';
|
|
14
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/page-content-lock/index.js"],"names":["useDisableNonContentBlocks","PageContentLock","usePageContentLockNotifications"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,0BAAT,QAA2C,kCAA3C;AAEA;AACA;AACA;AACA;;AACA,OAAO,SAASC,eAAT,GAA2B;AACjCD,EAAAA,0BAA0B;AAC1B;AAED,SAASE,+BAAT,QAAgD,uCAAhD","sourcesContent":["/**\n * Internal dependencies\n */\nimport { useDisableNonContentBlocks } from './use-disable-non-content-blocks';\n\n/**\n * Component that when rendered, locks the site editor so that only page content\n * can be edited.\n */\nexport function PageContentLock() {\n\tuseDisableNonContentBlocks();\n}\n\nexport { usePageContentLockNotifications } from './use-page-content-lock-notifications';\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/page-content-lock/use-disable-non-content-blocks.js"],"names":["createHigherOrderComponent","addFilter","removeFilter","privateApis","blockEditorPrivateApis","useEffect","unlock","CONTENT_BLOCK_TYPES","useBlockEditingMode","useDisableNonContentBlocks","withDisableNonContentBlocks","BlockEdit","props","isContent","includes","name","mode","undefined"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,0BAAT,QAA2C,oBAA3C;AACA,SAASC,SAAT,EAAoBC,YAApB,QAAwC,kBAAxC;AACA,SAASC,WAAW,IAAIC,sBAAxB,QAAsD,yBAAtD;AACA,SAASC,SAAT,QAA0B,oBAA1B;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,oBAAvB;AACA,SAASC,mBAAT,QAAoC,aAApC;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAA0BF,MAAM,CAAEF,sBAAF,CAAtC;AAEA;AACA;AACA;;AACA,OAAO,SAASK,0BAAT,GAAsC;AAC5CD,EAAAA,mBAAmB,CAAE,UAAF,CAAnB;AACAH,EAAAA,SAAS,CAAE,MAAM;AAChBJ,IAAAA,SAAS,CACR,kBADQ,EAER,2CAFQ,EAGRS,2BAHQ,CAAT;AAKA,WAAO,MACNR,YAAY,CACX,kBADW,EAEX,2CAFW,CADb;AAKA,GAXQ,EAWN,EAXM,CAAT;AAYA;AAED,MAAMQ,2BAA2B,GAAGV,0BAA0B,CAC3DW,SAAF,IAAmBC,KAAF,IAAa;AAC7B,QAAMC,SAAS,GAAGN,mBAAmB,CAACO,QAApB,CAA8BF,KAAK,CAACG,IAApC,CAAlB;AACA,QAAMC,IAAI,GAAGH,SAAS,GAAG,aAAH,GAAmBI,SAAzC;AACAT,EAAAA,mBAAmB,CAAEQ,IAAF,CAAnB;AACA,SAAO,cAAC,SAAD,EAAgBJ,KAAhB,CAAP;AACA,CAN4D,EAO7D,sBAP6D,CAA9D","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { createHigherOrderComponent } from '@wordpress/compose';\nimport { addFilter, removeFilter } from '@wordpress/hooks';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../private-apis';\nimport { CONTENT_BLOCK_TYPES } from './constants';\n\nconst { useBlockEditingMode } = unlock( blockEditorPrivateApis );\n\n/**\n * Disables non-content blocks using the `useBlockEditingMode` hook.\n */\nexport function useDisableNonContentBlocks() {\n\tuseBlockEditingMode( 'disabled' );\n\tuseEffect( () => {\n\t\taddFilter(\n\t\t\t'editor.BlockEdit',\n\t\t\t'core/edit-site/disable-non-content-blocks',\n\t\t\twithDisableNonContentBlocks\n\t\t);\n\t\treturn () =>\n\t\t\tremoveFilter(\n\t\t\t\t'editor.BlockEdit',\n\t\t\t\t'core/edit-site/disable-non-content-blocks'\n\t\t\t);\n\t}, [] );\n}\n\nconst withDisableNonContentBlocks = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst isContent = CONTENT_BLOCK_TYPES.includes( props.name );\n\t\tconst mode = isContent ? 'contentOnly' : undefined;\n\t\tuseBlockEditingMode( mode );\n\t\treturn <BlockEdit { ...props } />;\n\t},\n\t'withBlockEditingMode'\n);\n"]}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { useSelect, useDispatch } from '@wordpress/data';
|
|
5
|
-
import { useEffect, useRef } from '@wordpress/element';
|
|
6
|
-
import { store as noticesStore } from '@wordpress/notices';
|
|
7
|
-
import { __ } from '@wordpress/i18n';
|
|
8
|
-
import { useRefEffect } from '@wordpress/compose';
|
|
9
|
-
/**
|
|
10
|
-
* Internal dependencies
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import { store as editSiteStore } from '../../store';
|
|
14
|
-
/**
|
|
15
|
-
* Hook that displays notifications that guide the user towards using the
|
|
16
|
-
* content vs. template editing modes.
|
|
17
|
-
*
|
|
18
|
-
* @return {import('react').RefObject<HTMLElement>} Ref which should be passed
|
|
19
|
-
* (using useMergeRefs()) to
|
|
20
|
-
* the editor iframe canvas.
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
export function usePageContentLockNotifications() {
|
|
24
|
-
const ref = useEditTemplateNotification();
|
|
25
|
-
useBackToPageNotification();
|
|
26
|
-
return ref;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Hook that displays a 'Edit your template to edit this block' notification
|
|
30
|
-
* when the user is focusing on editing page content and clicks on a locked
|
|
31
|
-
* template block.
|
|
32
|
-
*
|
|
33
|
-
* @return {import('react').RefObject<HTMLElement>} Ref which should be passed
|
|
34
|
-
* (using useMergeRefs()) to
|
|
35
|
-
* the editor iframe canvas.
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
function useEditTemplateNotification() {
|
|
39
|
-
const hasPageContentLock = useSelect(select => select(editSiteStore).hasPageContentLock(), []);
|
|
40
|
-
const alreadySeen = useRef(false);
|
|
41
|
-
const {
|
|
42
|
-
createInfoNotice
|
|
43
|
-
} = useDispatch(noticesStore);
|
|
44
|
-
const {
|
|
45
|
-
setHasPageContentLock
|
|
46
|
-
} = useDispatch(editSiteStore);
|
|
47
|
-
return useRefEffect(node => {
|
|
48
|
-
const handleClick = event => {
|
|
49
|
-
if (!alreadySeen.current && hasPageContentLock && event.target.classList.contains('is-root-container')) {
|
|
50
|
-
createInfoNotice(__('Edit your template to edit this block'), {
|
|
51
|
-
isDismissible: true,
|
|
52
|
-
type: 'snackbar',
|
|
53
|
-
actions: [{
|
|
54
|
-
label: __('Edit template'),
|
|
55
|
-
onClick: () => setHasPageContentLock(false)
|
|
56
|
-
}]
|
|
57
|
-
});
|
|
58
|
-
alreadySeen.current = true;
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
node.addEventListener('click', handleClick);
|
|
63
|
-
return () => node.removeEventListener('click', handleClick);
|
|
64
|
-
}, [hasPageContentLock, alreadySeen, createInfoNotice, setHasPageContentLock]);
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Hook that displays a 'You are editing a template' notification when the user
|
|
68
|
-
* switches from focusing on editing page content to editing a template.
|
|
69
|
-
*/
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
function useBackToPageNotification() {
|
|
73
|
-
const hasPageContentLock = useSelect(select => select(editSiteStore).hasPageContentLock(), []);
|
|
74
|
-
const alreadySeen = useRef(false);
|
|
75
|
-
const prevHasPageContentLock = useRef(false);
|
|
76
|
-
const {
|
|
77
|
-
createInfoNotice
|
|
78
|
-
} = useDispatch(noticesStore);
|
|
79
|
-
const {
|
|
80
|
-
setHasPageContentLock
|
|
81
|
-
} = useDispatch(editSiteStore);
|
|
82
|
-
useEffect(() => {
|
|
83
|
-
if (!alreadySeen.current && prevHasPageContentLock.current && !hasPageContentLock) {
|
|
84
|
-
createInfoNotice(__('You are editing a template'), {
|
|
85
|
-
isDismissible: true,
|
|
86
|
-
type: 'snackbar',
|
|
87
|
-
actions: [{
|
|
88
|
-
label: __('Back to page'),
|
|
89
|
-
onClick: () => setHasPageContentLock(true)
|
|
90
|
-
}]
|
|
91
|
-
});
|
|
92
|
-
alreadySeen.current = true;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
prevHasPageContentLock.current = hasPageContentLock;
|
|
96
|
-
}, [alreadySeen, prevHasPageContentLock, hasPageContentLock, createInfoNotice, setHasPageContentLock]);
|
|
97
|
-
}
|
|
98
|
-
//# sourceMappingURL=use-page-content-lock-notifications.js.map
|
package/build-module/components/page-content-lock/use-page-content-lock-notifications.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/page-content-lock/use-page-content-lock-notifications.js"],"names":["useSelect","useDispatch","useEffect","useRef","store","noticesStore","__","useRefEffect","editSiteStore","usePageContentLockNotifications","ref","useEditTemplateNotification","useBackToPageNotification","hasPageContentLock","select","alreadySeen","createInfoNotice","setHasPageContentLock","node","handleClick","event","current","target","classList","contains","isDismissible","type","actions","label","onClick","addEventListener","removeEventListener","prevHasPageContentLock"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,SAAT,EAAoBC,MAApB,QAAkC,oBAAlC;AACA,SAASC,KAAK,IAAIC,YAAlB,QAAsC,oBAAtC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,YAAT,QAA6B,oBAA7B;AAEA;AACA;AACA;;AACA,SAASH,KAAK,IAAII,aAAlB,QAAuC,aAAvC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,+BAAT,GAA2C;AACjD,QAAMC,GAAG,GAAGC,2BAA2B,EAAvC;AACAC,EAAAA,yBAAyB;AACzB,SAAOF,GAAP;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASC,2BAAT,GAAuC;AACtC,QAAME,kBAAkB,GAAGb,SAAS,CACjCc,MAAF,IAAcA,MAAM,CAAEN,aAAF,CAAN,CAAwBK,kBAAxB,EADqB,EAEnC,EAFmC,CAApC;AAKA,QAAME,WAAW,GAAGZ,MAAM,CAAE,KAAF,CAA1B;AAEA,QAAM;AAAEa,IAAAA;AAAF,MAAuBf,WAAW,CAAEI,YAAF,CAAxC;AACA,QAAM;AAAEY,IAAAA;AAAF,MAA4BhB,WAAW,CAAEO,aAAF,CAA7C;AAEA,SAAOD,YAAY,CAChBW,IAAF,IAAY;AACX,UAAMC,WAAW,GAAKC,KAAF,IAAa;AAChC,UACC,CAAEL,WAAW,CAACM,OAAd,IACAR,kBADA,IAEAO,KAAK,CAACE,MAAN,CAAaC,SAAb,CAAuBC,QAAvB,CAAiC,mBAAjC,CAHD,EAIE;AACDR,QAAAA,gBAAgB,CACfV,EAAE,CAAE,uCAAF,CADa,EAEf;AACCmB,UAAAA,aAAa,EAAE,IADhB;AAECC,UAAAA,IAAI,EAAE,UAFP;AAGCC,UAAAA,OAAO,EAAE,CACR;AACCC,YAAAA,KAAK,EAAEtB,EAAE,CAAE,eAAF,CADV;AAECuB,YAAAA,OAAO,EAAE,MACRZ,qBAAqB,CAAE,KAAF;AAHvB,WADQ;AAHV,SAFe,CAAhB;AAcAF,QAAAA,WAAW,CAACM,OAAZ,GAAsB,IAAtB;AACA;AACD,KAtBD;;AAuBAH,IAAAA,IAAI,CAACY,gBAAL,CAAuB,OAAvB,EAAgCX,WAAhC;AACA,WAAO,MAAMD,IAAI,CAACa,mBAAL,CAA0B,OAA1B,EAAmCZ,WAAnC,CAAb;AACA,GA3BiB,EA4BlB,CACCN,kBADD,EAECE,WAFD,EAGCC,gBAHD,EAICC,qBAJD,CA5BkB,CAAnB;AAmCA;AAED;AACA;AACA;AACA;;;AACA,SAASL,yBAAT,GAAqC;AACpC,QAAMC,kBAAkB,GAAGb,SAAS,CACjCc,MAAF,IAAcA,MAAM,CAAEN,aAAF,CAAN,CAAwBK,kBAAxB,EADqB,EAEnC,EAFmC,CAApC;AAKA,QAAME,WAAW,GAAGZ,MAAM,CAAE,KAAF,CAA1B;AACA,QAAM6B,sBAAsB,GAAG7B,MAAM,CAAE,KAAF,CAArC;AAEA,QAAM;AAAEa,IAAAA;AAAF,MAAuBf,WAAW,CAAEI,YAAF,CAAxC;AACA,QAAM;AAAEY,IAAAA;AAAF,MAA4BhB,WAAW,CAAEO,aAAF,CAA7C;AAEAN,EAAAA,SAAS,CAAE,MAAM;AAChB,QACC,CAAEa,WAAW,CAACM,OAAd,IACAW,sBAAsB,CAACX,OADvB,IAEA,CAAER,kBAHH,EAIE;AACDG,MAAAA,gBAAgB,CAAEV,EAAE,CAAE,4BAAF,CAAJ,EAAsC;AACrDmB,QAAAA,aAAa,EAAE,IADsC;AAErDC,QAAAA,IAAI,EAAE,UAF+C;AAGrDC,QAAAA,OAAO,EAAE,CACR;AACCC,UAAAA,KAAK,EAAEtB,EAAE,CAAE,cAAF,CADV;AAECuB,UAAAA,OAAO,EAAE,MAAMZ,qBAAqB,CAAE,IAAF;AAFrC,SADQ;AAH4C,OAAtC,CAAhB;AAUAF,MAAAA,WAAW,CAACM,OAAZ,GAAsB,IAAtB;AACA;;AACDW,IAAAA,sBAAsB,CAACX,OAAvB,GAAiCR,kBAAjC;AACA,GAnBQ,EAmBN,CACFE,WADE,EAEFiB,sBAFE,EAGFnB,kBAHE,EAIFG,gBAJE,EAKFC,qBALE,CAnBM,CAAT;AA0BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect, useRef } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __ } from '@wordpress/i18n';\nimport { useRefEffect } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\n\n/**\n * Hook that displays notifications that guide the user towards using the\n * content vs. template editing modes.\n *\n * @return {import('react').RefObject<HTMLElement>} Ref which should be passed\n * (using useMergeRefs()) to\n * the editor iframe canvas.\n */\nexport function usePageContentLockNotifications() {\n\tconst ref = useEditTemplateNotification();\n\tuseBackToPageNotification();\n\treturn ref;\n}\n\n/**\n * Hook that displays a 'Edit your template to edit this block' notification\n * when the user is focusing on editing page content and clicks on a locked\n * template block.\n *\n * @return {import('react').RefObject<HTMLElement>} Ref which should be passed\n * (using useMergeRefs()) to\n * the editor iframe canvas.\n */\nfunction useEditTemplateNotification() {\n\tconst hasPageContentLock = useSelect(\n\t\t( select ) => select( editSiteStore ).hasPageContentLock(),\n\t\t[]\n\t);\n\n\tconst alreadySeen = useRef( false );\n\n\tconst { createInfoNotice } = useDispatch( noticesStore );\n\tconst { setHasPageContentLock } = useDispatch( editSiteStore );\n\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tconst handleClick = ( event ) => {\n\t\t\t\tif (\n\t\t\t\t\t! alreadySeen.current &&\n\t\t\t\t\thasPageContentLock &&\n\t\t\t\t\tevent.target.classList.contains( 'is-root-container' )\n\t\t\t\t) {\n\t\t\t\t\tcreateInfoNotice(\n\t\t\t\t\t\t__( 'Edit your template to edit this block' ),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tisDismissible: true,\n\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tlabel: __( 'Edit template' ),\n\t\t\t\t\t\t\t\t\tonClick: () =>\n\t\t\t\t\t\t\t\t\t\tsetHasPageContentLock( false ),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\talreadySeen.current = true;\n\t\t\t\t}\n\t\t\t};\n\t\t\tnode.addEventListener( 'click', handleClick );\n\t\t\treturn () => node.removeEventListener( 'click', handleClick );\n\t\t},\n\t\t[\n\t\t\thasPageContentLock,\n\t\t\talreadySeen,\n\t\t\tcreateInfoNotice,\n\t\t\tsetHasPageContentLock,\n\t\t]\n\t);\n}\n\n/**\n * Hook that displays a 'You are editing a template' notification when the user\n * switches from focusing on editing page content to editing a template.\n */\nfunction useBackToPageNotification() {\n\tconst hasPageContentLock = useSelect(\n\t\t( select ) => select( editSiteStore ).hasPageContentLock(),\n\t\t[]\n\t);\n\n\tconst alreadySeen = useRef( false );\n\tconst prevHasPageContentLock = useRef( false );\n\n\tconst { createInfoNotice } = useDispatch( noticesStore );\n\tconst { setHasPageContentLock } = useDispatch( editSiteStore );\n\n\tuseEffect( () => {\n\t\tif (\n\t\t\t! alreadySeen.current &&\n\t\t\tprevHasPageContentLock.current &&\n\t\t\t! hasPageContentLock\n\t\t) {\n\t\t\tcreateInfoNotice( __( 'You are editing a template' ), {\n\t\t\t\tisDismissible: true,\n\t\t\t\ttype: 'snackbar',\n\t\t\t\tactions: [\n\t\t\t\t\t{\n\t\t\t\t\t\tlabel: __( 'Back to page' ),\n\t\t\t\t\t\tonClick: () => setHasPageContentLock( true ),\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t} );\n\t\t\talreadySeen.current = true;\n\t\t}\n\t\tprevHasPageContentLock.current = hasPageContentLock;\n\t}, [\n\t\talreadySeen,\n\t\tprevHasPageContentLock,\n\t\thasPageContentLock,\n\t\tcreateInfoNotice,\n\t\tsetHasPageContentLock,\n\t] );\n}\n"]}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { createElement } from "@wordpress/element";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* WordPress dependencies
|
|
5
|
-
*/
|
|
6
|
-
import { useSelect, useDispatch } from '@wordpress/data';
|
|
7
|
-
import { Button, __experimentalVStack as VStack, __experimentalHStack as HStack, FlexItem } from '@wordpress/components';
|
|
8
|
-
import { getBlockType, __experimentalGetBlockLabel } from '@wordpress/blocks';
|
|
9
|
-
import { store as blockEditorStore, BlockIcon } from '@wordpress/block-editor';
|
|
10
|
-
/**
|
|
11
|
-
* Internal dependencies
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import { CONTENT_BLOCK_TYPES } from '../../page-content-lock/constants'; // TODO: This overlaps a lot with BlockInspectorLockedBlocks in
|
|
15
|
-
// @wordpress/block-editor. DRY them into a single component.
|
|
16
|
-
|
|
17
|
-
export default function ContentBlocksList() {
|
|
18
|
-
const contentBlocks = useSelect(select => {
|
|
19
|
-
const {
|
|
20
|
-
getClientIdsWithDescendants,
|
|
21
|
-
getBlockName,
|
|
22
|
-
getBlock,
|
|
23
|
-
isBlockSelected,
|
|
24
|
-
hasSelectedInnerBlock
|
|
25
|
-
} = select(blockEditorStore);
|
|
26
|
-
return getClientIdsWithDescendants().flatMap(clientId => {
|
|
27
|
-
const blockName = getBlockName(clientId);
|
|
28
|
-
|
|
29
|
-
if (!CONTENT_BLOCK_TYPES.includes(blockName)) {
|
|
30
|
-
return [];
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return [{
|
|
34
|
-
block: getBlock(clientId),
|
|
35
|
-
isSelected: isBlockSelected(clientId) || hasSelectedInnerBlock(clientId,
|
|
36
|
-
/* deep: */
|
|
37
|
-
true)
|
|
38
|
-
}];
|
|
39
|
-
});
|
|
40
|
-
}, []);
|
|
41
|
-
const {
|
|
42
|
-
selectBlock
|
|
43
|
-
} = useDispatch(blockEditorStore);
|
|
44
|
-
|
|
45
|
-
if (!contentBlocks.length) {
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return createElement(VStack, {
|
|
50
|
-
spacing: 1
|
|
51
|
-
}, contentBlocks.map(({
|
|
52
|
-
block,
|
|
53
|
-
isSelected
|
|
54
|
-
}) => {
|
|
55
|
-
const blockType = getBlockType(block.name);
|
|
56
|
-
return createElement(Button, {
|
|
57
|
-
key: block.clientId,
|
|
58
|
-
isPressed: isSelected,
|
|
59
|
-
onClick: () => selectBlock(block.clientId)
|
|
60
|
-
}, createElement(HStack, {
|
|
61
|
-
justify: "flex-start"
|
|
62
|
-
}, createElement(BlockIcon, {
|
|
63
|
-
icon: blockType.icon
|
|
64
|
-
}), createElement(FlexItem, null, __experimentalGetBlockLabel(blockType, block.attributes, 'list-view'))));
|
|
65
|
-
}));
|
|
66
|
-
}
|
|
67
|
-
//# sourceMappingURL=content-blocks-list.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/page-panels/content-blocks-list.js"],"names":["useSelect","useDispatch","Button","__experimentalVStack","VStack","__experimentalHStack","HStack","FlexItem","getBlockType","__experimentalGetBlockLabel","store","blockEditorStore","BlockIcon","CONTENT_BLOCK_TYPES","ContentBlocksList","contentBlocks","select","getClientIdsWithDescendants","getBlockName","getBlock","isBlockSelected","hasSelectedInnerBlock","flatMap","clientId","blockName","includes","block","isSelected","selectBlock","length","map","blockType","name","icon","attributes"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SACCC,MADD,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,oBAAoB,IAAIC,MAHzB,EAICC,QAJD,QAKO,uBALP;AAMA,SAASC,YAAT,EAAuBC,2BAAvB,QAA0D,mBAA1D;AACA,SAASC,KAAK,IAAIC,gBAAlB,EAAoCC,SAApC,QAAqD,yBAArD;AAEA;AACA;AACA;;AACA,SAASC,mBAAT,QAAoC,mCAApC,C,CAEA;AACA;;AACA,eAAe,SAASC,iBAAT,GAA6B;AAC3C,QAAMC,aAAa,GAAGf,SAAS,CAAIgB,MAAF,IAAc;AAC9C,UAAM;AACLC,MAAAA,2BADK;AAELC,MAAAA,YAFK;AAGLC,MAAAA,QAHK;AAILC,MAAAA,eAJK;AAKLC,MAAAA;AALK,QAMFL,MAAM,CAAEL,gBAAF,CANV;AAOA,WAAOM,2BAA2B,GAAGK,OAA9B,CAAyCC,QAAF,IAAgB;AAC7D,YAAMC,SAAS,GAAGN,YAAY,CAAEK,QAAF,CAA9B;;AACA,UAAK,CAAEV,mBAAmB,CAACY,QAApB,CAA8BD,SAA9B,CAAP,EAAmD;AAClD,eAAO,EAAP;AACA;;AACD,aAAO,CACN;AACCE,QAAAA,KAAK,EAAEP,QAAQ,CAAEI,QAAF,CADhB;AAECI,QAAAA,UAAU,EACTP,eAAe,CAAEG,QAAF,CAAf,IACAF,qBAAqB,CAAEE,QAAF;AAAY;AAAY,YAAxB;AAJvB,OADM,CAAP;AAQA,KAbM,CAAP;AAcA,GAtB8B,EAsB5B,EAtB4B,CAA/B;AAwBA,QAAM;AAAEK,IAAAA;AAAF,MAAkB3B,WAAW,CAAEU,gBAAF,CAAnC;;AAEA,MAAK,CAAEI,aAAa,CAACc,MAArB,EAA8B;AAC7B,WAAO,IAAP;AACA;;AAED,SACC,cAAC,MAAD;AAAQ,IAAA,OAAO,EAAG;AAAlB,KACGd,aAAa,CAACe,GAAd,CAAmB,CAAE;AAAEJ,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAAF,KAA6B;AACjD,UAAMI,SAAS,GAAGvB,YAAY,CAAEkB,KAAK,CAACM,IAAR,CAA9B;AACA,WACC,cAAC,MAAD;AACC,MAAA,GAAG,EAAGN,KAAK,CAACH,QADb;AAEC,MAAA,SAAS,EAAGI,UAFb;AAGC,MAAA,OAAO,EAAG,MAAMC,WAAW,CAAEF,KAAK,CAACH,QAAR;AAH5B,OAKC,cAAC,MAAD;AAAQ,MAAA,OAAO,EAAC;AAAhB,OACC,cAAC,SAAD;AAAW,MAAA,IAAI,EAAGQ,SAAS,CAACE;AAA5B,MADD,EAEC,cAAC,QAAD,QACGxB,2BAA2B,CAC5BsB,SAD4B,EAE5BL,KAAK,CAACQ,UAFsB,EAG5B,WAH4B,CAD9B,CAFD,CALD,CADD;AAkBA,GApBC,CADH,CADD;AAyBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__experimentalVStack as VStack,\n\t__experimentalHStack as HStack,\n\tFlexItem,\n} from '@wordpress/components';\nimport { getBlockType, __experimentalGetBlockLabel } from '@wordpress/blocks';\nimport { store as blockEditorStore, BlockIcon } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { CONTENT_BLOCK_TYPES } from '../../page-content-lock/constants';\n\n// TODO: This overlaps a lot with BlockInspectorLockedBlocks in\n// @wordpress/block-editor. DRY them into a single component.\nexport default function ContentBlocksList() {\n\tconst contentBlocks = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetClientIdsWithDescendants,\n\t\t\tgetBlockName,\n\t\t\tgetBlock,\n\t\t\tisBlockSelected,\n\t\t\thasSelectedInnerBlock,\n\t\t} = select( blockEditorStore );\n\t\treturn getClientIdsWithDescendants().flatMap( ( clientId ) => {\n\t\t\tconst blockName = getBlockName( clientId );\n\t\t\tif ( ! CONTENT_BLOCK_TYPES.includes( blockName ) ) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tblock: getBlock( clientId ),\n\t\t\t\t\tisSelected:\n\t\t\t\t\t\tisBlockSelected( clientId ) ||\n\t\t\t\t\t\thasSelectedInnerBlock( clientId, /* deep: */ true ),\n\t\t\t\t},\n\t\t\t];\n\t\t} );\n\t}, [] );\n\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\n\tif ( ! contentBlocks.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<VStack spacing={ 1 }>\n\t\t\t{ contentBlocks.map( ( { block, isSelected } ) => {\n\t\t\t\tconst blockType = getBlockType( block.name );\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey={ block.clientId }\n\t\t\t\t\t\tisPressed={ isSelected }\n\t\t\t\t\t\tonClick={ () => selectBlock( block.clientId ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<HStack justify=\"flex-start\">\n\t\t\t\t\t\t\t<BlockIcon icon={ blockType.icon } />\n\t\t\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t\t\t{ __experimentalGetBlockLabel(\n\t\t\t\t\t\t\t\t\tblockType,\n\t\t\t\t\t\t\t\t\tblock.attributes,\n\t\t\t\t\t\t\t\t\t'list-view'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</FlexItem>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</VStack>\n\t);\n}\n"]}
|
package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
import { createElement } from "@wordpress/element";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* WordPress dependencies
|
|
6
|
-
*/
|
|
7
|
-
import { __experimentalNavigatorButton as NavigatorButton } from '@wordpress/components';
|
|
8
|
-
import { useEntityRecords } from '@wordpress/core-data';
|
|
9
|
-
/**
|
|
10
|
-
* Internal dependencies
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import { PRELOADED_NAVIGATION_MENUS_QUERY } from './constants';
|
|
14
|
-
export default function SidebarNavigationScreenNavigationMenuButton({
|
|
15
|
-
children,
|
|
16
|
-
...props
|
|
17
|
-
}) {
|
|
18
|
-
const {
|
|
19
|
-
records: navigationMenus,
|
|
20
|
-
isResolving: isLoading
|
|
21
|
-
} = useEntityRecords('postType', `wp_navigation`, PRELOADED_NAVIGATION_MENUS_QUERY);
|
|
22
|
-
const hasNavigationMenus = !!navigationMenus?.length;
|
|
23
|
-
const hasSingleNavigationMenu = navigationMenus?.length === 1;
|
|
24
|
-
const firstNavigationMenu = navigationMenus?.[0];
|
|
25
|
-
const showNavigationScreen = process.env.IS_GUTENBERG_PLUGIN ? hasNavigationMenus : false; // If there is a single menu then we can go directly to that menu.
|
|
26
|
-
// Otherwise we go to the navigation listing screen.
|
|
27
|
-
|
|
28
|
-
const path = hasSingleNavigationMenu ? `/navigation/wp_navigation/${firstNavigationMenu?.id}` : '/navigation';
|
|
29
|
-
|
|
30
|
-
if (!showNavigationScreen) {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return createElement(NavigatorButton, _extends({}, props, {
|
|
35
|
-
disabled: isLoading,
|
|
36
|
-
path: path
|
|
37
|
-
}), children);
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=navigator-button.js.map
|
package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menus/navigator-button.js"],"names":["__experimentalNavigatorButton","NavigatorButton","useEntityRecords","PRELOADED_NAVIGATION_MENUS_QUERY","SidebarNavigationScreenNavigationMenuButton","children","props","records","navigationMenus","isResolving","isLoading","hasNavigationMenus","length","hasSingleNavigationMenu","firstNavigationMenu","showNavigationScreen","process","env","IS_GUTENBERG_PLUGIN","path","id"],"mappings":";;;AAAA;AACA;AACA;AAEA,SAASA,6BAA6B,IAAIC,eAA1C,QAAiE,uBAAjE;AACA,SAASC,gBAAT,QAAiC,sBAAjC;AAEA;AACA;AACA;;AACA,SAASC,gCAAT,QAAiD,aAAjD;AAEA,eAAe,SAASC,2CAAT,CAAsD;AACpEC,EAAAA,QADoE;AAEpE,KAAGC;AAFiE,CAAtD,EAGX;AACH,QAAM;AAAEC,IAAAA,OAAO,EAAEC,eAAX;AAA4BC,IAAAA,WAAW,EAAEC;AAAzC,MACLR,gBAAgB,CACf,UADe,EAEd,eAFc,EAGfC,gCAHe,CADjB;AAOA,QAAMQ,kBAAkB,GAAG,CAAC,CAAEH,eAAe,EAAEI,MAA/C;AACA,QAAMC,uBAAuB,GAAGL,eAAe,EAAEI,MAAjB,KAA4B,CAA5D;AACA,QAAME,mBAAmB,GAAGN,eAAe,GAAI,CAAJ,CAA3C;AAEA,QAAMO,oBAAoB,GAAGC,OAAO,CAACC,GAAR,CAAYC,mBAAZ,GAC1BP,kBAD0B,GAE1B,KAFH,CAZG,CAgBH;AACA;;AACA,QAAMQ,IAAI,GAAGN,uBAAuB,GAChC,6BAA6BC,mBAAmB,EAAEM,EAAI,EADtB,GAEjC,aAFH;;AAIA,MAAK,CAAEL,oBAAP,EAA8B;AAC7B,WAAO,IAAP;AACA;;AAED,SACC,cAAC,eAAD,eAAsBT,KAAtB;AAA8B,IAAA,QAAQ,EAAGI,SAAzC;AAAqD,IAAA,IAAI,EAAGS;AAA5D,MACGd,QADH,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\n\nimport { __experimentalNavigatorButton as NavigatorButton } from '@wordpress/components';\nimport { useEntityRecords } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { PRELOADED_NAVIGATION_MENUS_QUERY } from './constants';\n\nexport default function SidebarNavigationScreenNavigationMenuButton( {\n\tchildren,\n\t...props\n} ) {\n\tconst { records: navigationMenus, isResolving: isLoading } =\n\t\tuseEntityRecords(\n\t\t\t'postType',\n\t\t\t`wp_navigation`,\n\t\t\tPRELOADED_NAVIGATION_MENUS_QUERY\n\t\t);\n\n\tconst hasNavigationMenus = !! navigationMenus?.length;\n\tconst hasSingleNavigationMenu = navigationMenus?.length === 1;\n\tconst firstNavigationMenu = navigationMenus?.[ 0 ];\n\n\tconst showNavigationScreen = process.env.IS_GUTENBERG_PLUGIN\n\t\t? hasNavigationMenus\n\t\t: false;\n\n\t// If there is a single menu then we can go directly to that menu.\n\t// Otherwise we go to the navigation listing screen.\n\tconst path = hasSingleNavigationMenu\n\t\t? `/navigation/wp_navigation/${ firstNavigationMenu?.id }`\n\t\t: '/navigation';\n\n\tif ( ! showNavigationScreen ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<NavigatorButton { ...props } disabled={ isLoading } path={ path }>\n\t\t\t{ children }\n\t\t</NavigatorButton>\n\t);\n}\n"]}
|