@wordpress/edit-site 5.11.0 → 5.12.1
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 +7 -0
- package/build/components/add-new-page/index.js +105 -0
- package/build/components/add-new-page/index.js.map +1 -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-generic-template-modal-content.js +4 -5
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/add-custom-template-modal-content.js +27 -44
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/index.js +6 -15
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/add-new-template/new-template.js +26 -35
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/add-new-template/utils.js +71 -120
- package/build/components/add-new-template/utils.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 +6 -6
- package/build/components/block-editor/back-button.js.map +1 -1
- package/build/components/block-editor/block-inspector-button.js +3 -4
- package/build/components/block-editor/block-inspector-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 +14 -15
- 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 -129
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/block-editor/inserter-media-categories.js +25 -42
- package/build/components/block-editor/inserter-media-categories.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/resizable-editor.js +6 -7
- package/build/components/block-editor/resizable-editor.js.map +1 -1
- package/build/components/block-editor/resize-handle.js +5 -7
- package/build/components/block-editor/resize-handle.js.map +1 -1
- 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/code-editor/code-editor-text-area.js +5 -6
- package/build/components/code-editor/code-editor-text-area.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 +73 -33
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/editor/index.js +43 -24
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +29 -12
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/error-boundary/warning.js +8 -10
- package/build/components/error-boundary/warning.js.map +1 -1
- package/build/components/global-styles/block-preview-panel.js +7 -10
- package/build/components/global-styles/block-preview-panel.js.map +1 -1
- package/build/components/global-styles/color-indicator-wrapper.js +7 -9
- package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +5 -6
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +3 -5
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +20 -26
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +5 -6
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/header.js +4 -5
- package/build/components/global-styles/header.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 +7 -9
- package/build/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build/components/global-styles/navigation-button.js +15 -17
- package/build/components/global-styles/navigation-button.js.map +1 -1
- package/build/components/global-styles/palette.js +12 -16
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preview.js +43 -53
- 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 +6 -9
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js +11 -12
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-color-palette.js +3 -4
- package/build/components/global-styles/screen-color-palette.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 +12 -12
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +14 -19
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +7 -13
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build/components/global-styles/screen-root.js +5 -5
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-typography-element.js +3 -4
- package/build/components/global-styles/screen-typography-element.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +8 -9
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +15 -8
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/subtitle.js +4 -5
- package/build/components/global-styles/subtitle.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +6 -7
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-preview.js +7 -8
- package/build/components/global-styles/typography-preview.js.map +1 -1
- package/build/components/global-styles/ui.js +123 -50
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/variations-panel.js +5 -6
- package/build/components/global-styles/variations-panel.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 +136 -24
- package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +8 -14
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/index.js +49 -53
- 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/tools-more-menu-group/index.js +5 -14
- package/build/components/header-edit-mode/tools-more-menu-group/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/dynamic-shortcut.js +3 -4
- package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +42 -51
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
- package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build/components/keyboard-shortcuts/edit-mode.js +7 -2
- 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 +1 -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 +44 -34
- package/build/components/layout/index.js.map +1 -1
- package/build/components/list/added-by.js +13 -23
- package/build/components/list/added-by.js.map +1 -1
- package/build/components/list/header.js +4 -7
- package/build/components/list/header.js.map +1 -1
- package/build/components/list/index.js +4 -6
- package/build/components/list/index.js.map +1 -1
- package/build/components/list/table.js +35 -40
- package/build/components/list/table.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-actions/delete-page-menu-item.js +70 -0
- package/build/components/page-actions/delete-page-menu-item.js.map +1 -0
- package/build/components/page-actions/index.js +43 -0
- package/build/components/page-actions/index.js.map +1 -0
- package/build/components/page-content-focus-manager/back-to-page-notification.js +67 -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 +165 -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 +4 -7
- package/build/components/preferences-modal/enable-feature.js.map +1 -1
- package/build/components/preferences-modal/index.js +4 -5
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/resizable-frame/index.js +25 -15
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/revisions/index.js +14 -17
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/routes/link.js +15 -22
- package/build/components/routes/link.js.map +1 -1
- package/build/components/routes/use-title.js +3 -7
- package/build/components/routes/use-title.js.map +1 -1
- package/build/components/save-button/index.js +23 -13
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js +97 -5
- package/build/components/save-hub/index.js.map +1 -1
- package/build/components/save-panel/index.js +63 -19
- 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 +51 -9
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/index.js +14 -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/default-sidebar.js +11 -12
- package/build/components/sidebar-edit-mode/default-sidebar.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 +13 -10
- 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 +99 -0
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -0
- 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 +8 -12
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/settings-header/index.js +52 -21
- package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/sidebar-card/index.js +46 -0
- package/build/components/sidebar-edit-mode/sidebar-card/index.js.map +1 -0
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +5 -6
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
- package/build/components/sidebar-edit-mode/{template-card → template-panel}/index.js +30 -22
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -0
- package/build/components/sidebar-edit-mode/{template-revisions/index.js → template-panel/last-revision.js} +7 -8
- package/{build-module/components/sidebar-edit-mode/template-revisions/index.js.map → build/components/sidebar-edit-mode/template-panel/last-revision.js.map} +1 -1
- package/build/components/sidebar-edit-mode/{template-card → template-panel}/template-actions.js +12 -16
- package/build/components/sidebar-edit-mode/template-panel/template-actions.js.map +1 -0
- package/build/components/sidebar-edit-mode/{template-card → template-panel}/template-areas.js +15 -19
- package/build/components/sidebar-edit-mode/template-panel/template-areas.js.map +1 -0
- package/build/components/sidebar-navigation-item/index.js +17 -14
- package/build/components/sidebar-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +38 -20
- 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 +114 -24
- 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 +5 -7
- 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 +49 -97
- 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 +54 -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 +163 -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 +59 -26
- 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 +75 -31
- 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 +23 -53
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/index.js +63 -12
- package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/page-details.js +150 -0
- package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -0
- package/build/components/sidebar-navigation-screen-page/status-label.js +111 -0
- package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -0
- package/build/components/sidebar-navigation-screen-pages/index.js +133 -21
- 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 +43 -23
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates/index.js +23 -28
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/site-hub/index.js +29 -24
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/site-icon/index.js +4 -5
- package/build/components/site-icon/index.js.map +1 -1
- package/build/components/start-template-options/index.js +15 -21
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/style-book/index.js +45 -50
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +16 -6
- 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 +21 -12
- 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/{list/actions → template-actions}/index.js +34 -31
- package/build/components/template-actions/index.js.map +1 -0
- package/build/components/{list/actions → template-actions}/rename-menu-item.js +4 -5
- package/build/components/template-actions/rename-menu-item.js.map +1 -0
- package/build/components/template-part-converter/convert-to-regular.js +4 -5
- package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build/components/template-part-converter/convert-to-template-part.js +7 -27
- package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build/components/template-part-converter/index.js +12 -18
- package/build/components/template-part-converter/index.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/image.js +4 -5
- package/build/components/welcome-guide/image.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 +190 -0
- package/build/hooks/commands/use-common-commands.js.map +1 -0
- package/build/hooks/commands/use-edit-mode-commands.js +71 -29
- 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 +15 -10
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/hooks/template-part-edit.js +11 -15
- package/build/hooks/template-part-edit.js.map +1 -1
- package/build/index.js +3 -6
- 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 +165 -125
- 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/private-actions.js +7 -10
- package/build/store/private-actions.js.map +1 -1
- package/build/store/reducer.js +33 -33
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +70 -22
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils.js +1 -3
- package/build/store/utils.js.map +1 -1
- package/build/utils/get-is-list-page.js +13 -7
- package/build/utils/get-is-list-page.js.map +1 -1
- package/build/utils/is-previewing-theme.js +2 -4
- package/build/utils/is-previewing-theme.js.map +1 -1
- package/build/utils/is-template-revertable.js +1 -1
- package/build/utils/is-template-revertable.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-page/index.js +93 -0
- package/build-module/components/add-new-page/index.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-generic-template-modal-content.js +4 -5
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js +25 -41
- 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 +6 -13
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +22 -31
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +71 -120
- package/build-module/components/add-new-template/utils.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 +5 -5
- package/build-module/components/block-editor/back-button.js.map +1 -1
- package/build-module/components/block-editor/block-inspector-button.js +3 -4
- package/build-module/components/block-editor/block-inspector-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 +12 -12
- 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 -125
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/block-editor/inserter-media-categories.js +25 -42
- package/build-module/components/block-editor/inserter-media-categories.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/resizable-editor.js +6 -7
- package/build-module/components/block-editor/resizable-editor.js.map +1 -1
- package/build-module/components/block-editor/resize-handle.js +5 -7
- package/build-module/components/block-editor/resize-handle.js.map +1 -1
- 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/code-editor/code-editor-text-area.js +5 -6
- package/build-module/components/code-editor/code-editor-text-area.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 +70 -34
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/editor/index.js +43 -24
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +26 -10
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/error-boundary/warning.js +8 -10
- package/build-module/components/error-boundary/warning.js.map +1 -1
- package/build-module/components/global-styles/block-preview-panel.js +7 -10
- package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
- package/build-module/components/global-styles/color-indicator-wrapper.js +7 -8
- package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +4 -5
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +2 -4
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +18 -25
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +4 -5
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/header.js +4 -5
- package/build-module/components/global-styles/header.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 +7 -8
- package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build-module/components/global-styles/navigation-button.js +15 -14
- package/build-module/components/global-styles/navigation-button.js.map +1 -1
- package/build-module/components/global-styles/palette.js +11 -15
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preview.js +42 -52
- 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 +5 -8
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +10 -11
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-color-palette.js +3 -4
- package/build-module/components/global-styles/screen-color-palette.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 +9 -9
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +14 -19
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +6 -11
- 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 +4 -4
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-typography-element.js +3 -4
- package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +6 -7
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +15 -8
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/subtitle.js +4 -5
- package/build-module/components/global-styles/subtitle.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +5 -6
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-preview.js +6 -7
- package/build-module/components/global-styles/typography-preview.js.map +1 -1
- package/build-module/components/global-styles/ui.js +123 -50
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/variations-panel.js +5 -6
- package/build-module/components/global-styles/variations-panel.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 +136 -25
- package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +6 -12
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +49 -53
- 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/tools-more-menu-group/index.js +5 -13
- package/build-module/components/header-edit-mode/tools-more-menu-group/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/dynamic-shortcut.js +3 -4
- package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +40 -49
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
- package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/edit-mode.js +7 -2
- 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 +1 -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 +37 -28
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/list/added-by.js +13 -23
- package/build-module/components/list/added-by.js.map +1 -1
- package/build-module/components/list/header.js +4 -7
- package/build-module/components/list/header.js.map +1 -1
- package/build-module/components/list/index.js +3 -5
- package/build-module/components/list/index.js.map +1 -1
- package/build-module/components/list/table.js +34 -39
- package/build-module/components/list/table.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-actions/delete-page-menu-item.js +58 -0
- package/build-module/components/page-actions/delete-page-menu-item.js.map +1 -0
- package/build-module/components/page-actions/index.js +30 -0
- package/build-module/components/page-actions/index.js.map +1 -0
- package/build-module/components/page-content-focus-manager/back-to-page-notification.js +53 -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-focus-manager/disable-non-page-content-blocks.js +45 -0
- 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 +145 -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 +4 -4
- package/build-module/components/preferences-modal/enable-feature.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +4 -5
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/resizable-frame/index.js +24 -14
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/revisions/index.js +12 -14
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/routes/link.js +14 -18
- package/build-module/components/routes/link.js.map +1 -1
- package/build-module/components/routes/use-title.js +2 -6
- package/build-module/components/routes/use-title.js.map +1 -1
- package/build-module/components/save-button/index.js +23 -13
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-hub/index.js +95 -8
- package/build-module/components/save-hub/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +62 -20
- 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 +48 -8
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/index.js +11 -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/default-sidebar.js +11 -12
- package/build-module/components/sidebar-edit-mode/default-sidebar.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 +14 -11
- 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 +78 -0
- package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -0
- 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 +8 -9
- 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 +50 -23
- package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/sidebar-card/index.js +35 -0
- package/build-module/components/sidebar-edit-mode/sidebar-card/index.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +4 -5
- 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 +72 -0
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/{template-revisions/index.js → template-panel/last-revision.js} +7 -8
- package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/{template-card → template-panel}/template-actions.js +12 -16
- package/build-module/components/sidebar-edit-mode/template-panel/template-actions.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/{template-card → template-panel}/template-areas.js +15 -19
- package/build-module/components/sidebar-edit-mode/template-panel/template-areas.js.map +1 -0
- package/build-module/components/sidebar-navigation-item/index.js +17 -14
- package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +39 -21
- 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 +112 -21
- 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 +4 -6
- 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 +47 -95
- 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 +46 -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 +151 -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 +58 -26
- 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 +73 -28
- 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 +24 -53
- 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 +59 -14
- package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/page-details.js +131 -0
- package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-page/status-label.js +98 -0
- package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-pages/index.js +130 -22
- 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 +40 -23
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates/index.js +23 -27
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +28 -22
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/site-icon/index.js +4 -5
- package/build-module/components/site-icon/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +15 -21
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/style-book/index.js +44 -48
- 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 +15 -5
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +20 -11
- 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/{list/actions → template-actions}/index.js +34 -31
- package/build-module/components/template-actions/index.js.map +1 -0
- package/build-module/components/{list/actions → template-actions}/rename-menu-item.js +4 -5
- package/build-module/components/template-actions/rename-menu-item.js.map +1 -0
- package/build-module/components/template-part-converter/convert-to-regular.js +4 -5
- package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build-module/components/template-part-converter/convert-to-template-part.js +8 -26
- package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build-module/components/template-part-converter/index.js +12 -18
- package/build-module/components/template-part-converter/index.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/image.js +4 -5
- package/build-module/components/welcome-guide/image.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 +172 -0
- package/build-module/hooks/commands/use-common-commands.js.map +1 -0
- package/build-module/hooks/commands/use-edit-mode-commands.js +72 -30
- 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 +14 -9
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/hooks/template-part-edit.js +10 -11
- package/build-module/hooks/template-part-edit.js.map +1 -1
- package/build-module/index.js +3 -6
- 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 +157 -126
- 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/private-actions.js +7 -10
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/reducer.js +31 -33
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +62 -21
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils.js +1 -3
- package/build-module/store/utils.js.map +1 -1
- package/build-module/utils/get-is-list-page.js +13 -7
- package/build-module/utils/get-is-list-page.js.map +1 -1
- package/build-module/utils/is-previewing-theme.js +2 -4
- package/build-module/utils/is-previewing-theme.js.map +1 -1
- package/build-module/utils/is-template-revertable.js +1 -1
- package/build-module/utils/is-template-revertable.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 +587 -71
- package/build-style/style.css +587 -71
- package/package.json +44 -37
- package/src/components/add-new-page/index.js +105 -0
- package/src/components/add-new-pattern/index.js +94 -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 +3 -3
- 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 -188
- 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 +63 -3
- package/src/components/editor/index.js +32 -17
- package/src/components/editor/style.scss +6 -11
- 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 +8 -6
- 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 +132 -45
- package/src/components/global-styles-renderer/index.js +1 -1
- package/src/components/header-edit-mode/document-actions/index.js +155 -36
- package/src/components/header-edit-mode/document-actions/style.scss +72 -13
- package/src/components/header-edit-mode/index.js +4 -4
- package/src/components/header-edit-mode/tools-more-menu-group/index.js +1 -6
- package/src/components/keyboard-shortcuts/edit-mode.js +5 -1
- package/src/components/keyboard-shortcuts/index.js +5 -1
- package/src/components/keyboard-shortcuts/register.js +1 -1
- package/src/components/layout/hooks.js +21 -0
- package/src/components/layout/index.js +92 -70
- package/src/components/layout/style.scss +7 -0
- package/src/components/list/index.js +1 -1
- package/src/components/list/table.js +6 -2
- 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-actions/delete-page-menu-item.js +71 -0
- package/src/components/page-actions/index.js +36 -0
- package/src/components/page-content-focus-manager/back-to-page-notification.js +65 -0
- package/src/components/page-content-focus-manager/constants.js +5 -0
- package/src/components/page-content-focus-manager/disable-non-page-content-blocks.js +52 -0
- 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/resizable-frame/index.js +18 -6
- package/src/components/resizable-frame/style.scss +20 -18
- package/src/components/revisions/index.js +7 -8
- package/src/components/routes/link.js +2 -2
- package/src/components/routes/use-title.js +1 -1
- package/src/components/save-button/index.js +16 -7
- package/src/components/save-hub/index.js +143 -38
- package/src/components/save-hub/style.scss +6 -0
- package/src/components/save-panel/index.js +63 -16
- package/src/components/secondary-sidebar/list-view-sidebar.js +56 -2
- package/src/components/sidebar/index.js +13 -7
- package/src/components/sidebar/style.scss +3 -4
- package/src/components/sidebar-edit-mode/global-styles-sidebar.js +42 -29
- package/src/components/sidebar-edit-mode/index.js +16 -14
- package/src/components/sidebar-edit-mode/page-panels/edit-template.js +69 -0
- package/src/components/sidebar-edit-mode/page-panels/index.js +89 -0
- 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 +41 -0
- package/src/components/sidebar-edit-mode/settings-header/index.js +61 -29
- package/src/components/sidebar-edit-mode/sidebar-card/index.js +34 -0
- package/src/components/sidebar-edit-mode/sidebar-card/style.scss +34 -0
- package/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js +1 -1
- package/src/components/sidebar-edit-mode/template-panel/index.js +65 -0
- package/src/components/sidebar-edit-mode/{template-card → template-panel}/style.scss +2 -32
- package/src/components/sidebar-navigation-item/index.js +6 -2
- package/src/components/sidebar-navigation-item/style.scss +7 -0
- package/src/components/sidebar-navigation-screen/index.js +89 -53
- package/src/components/sidebar-navigation-screen/style.scss +66 -5
- 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 +126 -14
- package/src/components/sidebar-navigation-screen-global-styles/style.scss +12 -0
- 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 +7 -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 +51 -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 +175 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/constants.js +3 -1
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +43 -7
- 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 +5 -1
- package/src/components/sidebar-navigation-screen-page/index.js +98 -24
- package/src/components/sidebar-navigation-screen-page/page-details.js +166 -0
- package/src/components/sidebar-navigation-screen-page/status-label.js +105 -0
- package/src/components/sidebar-navigation-screen-page/style.scss +63 -0
- package/src/components/sidebar-navigation-screen-pages/index.js +181 -44
- package/src/components/sidebar-navigation-screen-pattern/index.js +44 -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 +44 -27
- package/src/components/sidebar-navigation-screen-template/style.scss +23 -0
- package/src/components/sidebar-navigation-screen-templates/index.js +19 -26
- package/src/components/site-hub/index.js +26 -7
- package/src/components/site-hub/style.scss +26 -0
- 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/{list/actions → template-actions}/index.js +19 -6
- 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 +167 -0
- package/src/hooks/commands/use-edit-mode-commands.js +61 -25
- 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 +14 -8
- package/src/hooks/template-part-edit.js +1 -1
- package/src/store/actions.js +52 -1
- package/src/store/index.js +1 -1
- package/src/store/reducer.js +21 -0
- package/src/store/selectors.js +54 -5
- package/src/store/test/actions.js +31 -0
- package/src/store/test/reducer.js +44 -0
- package/src/store/test/selectors.js +57 -0
- package/src/style.scss +17 -4
- package/src/utils/get-is-list-page.js +16 -4
- package/src/utils/is-previewing-theme.js +2 -3
- 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 -116
- package/build/components/add-new-template/new-template-part.js.map +0 -1
- package/build/components/list/actions/index.js.map +0 -1
- package/build/components/list/actions/rename-menu-item.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-card/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-card/template-actions.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-card/template-areas.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-revisions/index.js.map +0 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +0 -53
- package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +0 -1
- package/build/components/sidebar-navigation-subtitle/index.js +0 -18
- 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 -96
- package/build-module/components/add-new-template/new-template-part.js.map +0 -1
- package/build-module/components/list/actions/index.js.map +0 -1
- package/build-module/components/list/actions/rename-menu-item.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-card/index.js +0 -68
- package/build-module/components/sidebar-edit-mode/template-card/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-card/template-actions.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-card/template-areas.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +0 -40
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +0 -1
- package/build-module/components/sidebar-navigation-subtitle/index.js +0 -10
- 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/sidebar-edit-mode/template-card/index.js +0 -59
- package/src/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +0 -47
- package/src/components/sidebar-navigation-screen-pages/style.scss +0 -4
- 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/components/sidebar-edit-mode/{template-revisions/index.js → template-panel/last-revision.js} +0 -0
- /package/src/components/sidebar-edit-mode/{template-card → template-panel}/template-actions.js +0 -0
- /package/src/components/sidebar-edit-mode/{template-card → template-panel}/template-areas.js +0 -0
- /package/src/components/{list/actions → template-actions}/rename-menu-item.js +0 -0
- /package/src/{private-apis.js → lock-unlock.js} +0 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
7
|
+
import { useMemo } from '@wordpress/element';
|
|
8
|
+
import { decodeEntities } from '@wordpress/html-entities';
|
|
9
|
+
import { BlockContextProvider, BlockPreview } from '@wordpress/block-editor';
|
|
10
|
+
import { Button, __experimentalVStack as VStack } from '@wordpress/components';
|
|
11
|
+
import { __ } from '@wordpress/i18n';
|
|
12
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
13
|
+
/**
|
|
14
|
+
* Internal dependencies
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { store as editSiteStore } from '../../../store';
|
|
18
|
+
export default function EditTemplate() {
|
|
19
|
+
const {
|
|
20
|
+
context,
|
|
21
|
+
hasResolved,
|
|
22
|
+
title,
|
|
23
|
+
blocks
|
|
24
|
+
} = useSelect(select => {
|
|
25
|
+
const {
|
|
26
|
+
getEditedPostContext,
|
|
27
|
+
getEditedPostType,
|
|
28
|
+
getEditedPostId
|
|
29
|
+
} = select(editSiteStore);
|
|
30
|
+
const {
|
|
31
|
+
getEditedEntityRecord,
|
|
32
|
+
hasFinishedResolution
|
|
33
|
+
} = select(coreStore);
|
|
34
|
+
|
|
35
|
+
const _context = getEditedPostContext();
|
|
36
|
+
|
|
37
|
+
const queryArgs = ['postType', getEditedPostType(), getEditedPostId()];
|
|
38
|
+
const template = getEditedEntityRecord(...queryArgs);
|
|
39
|
+
return {
|
|
40
|
+
context: _context,
|
|
41
|
+
hasResolved: hasFinishedResolution('getEditedEntityRecord', queryArgs),
|
|
42
|
+
title: template?.title,
|
|
43
|
+
blocks: template?.blocks
|
|
44
|
+
};
|
|
45
|
+
}, []);
|
|
46
|
+
const {
|
|
47
|
+
setHasPageContentFocus
|
|
48
|
+
} = useDispatch(editSiteStore);
|
|
49
|
+
const blockContext = useMemo(() => ({ ...context,
|
|
50
|
+
postType: null,
|
|
51
|
+
postId: null
|
|
52
|
+
}), [context]);
|
|
53
|
+
|
|
54
|
+
if (!hasResolved) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return createElement(VStack, null, createElement("div", null, decodeEntities(title)), createElement("div", {
|
|
59
|
+
className: "edit-site-page-panels__edit-template-preview"
|
|
60
|
+
}, createElement(BlockContextProvider, {
|
|
61
|
+
value: blockContext
|
|
62
|
+
}, createElement(BlockPreview, {
|
|
63
|
+
viewportWidth: 1024,
|
|
64
|
+
blocks: blocks
|
|
65
|
+
}))), createElement(Button, {
|
|
66
|
+
className: "edit-site-page-panels__edit-template-button",
|
|
67
|
+
variant: "secondary",
|
|
68
|
+
onClick: () => setHasPageContentFocus(false)
|
|
69
|
+
}, __('Edit template')));
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=edit-template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/page-panels/edit-template.js"],"names":["useSelect","useDispatch","useMemo","decodeEntities","BlockContextProvider","BlockPreview","Button","__experimentalVStack","VStack","__","store","coreStore","editSiteStore","EditTemplate","context","hasResolved","title","blocks","select","getEditedPostContext","getEditedPostType","getEditedPostId","getEditedEntityRecord","hasFinishedResolution","_context","queryArgs","template","setHasPageContentFocus","blockContext","postType","postId"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,cAAT,QAA+B,0BAA/B;AACA,SAASC,oBAAT,EAA+BC,YAA/B,QAAmD,yBAAnD;AACA,SAASC,MAAT,EAAiBC,oBAAoB,IAAIC,MAAzC,QAAuD,uBAAvD;AACA,SAASC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pB,WAAO,IAAP;AACA;;AAED,SACC,cAAC,MAAD,QACC,2BAAOZ,cAAc,CAAEa,KAAF,CAArB,CADD,EAEC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,oBAAD;AAAsB,IAAA,KAAK,EAAGY;AAA9B,KACC,cAAC,YAAD;AAAc,IAAA,aAAa,EAAG,IAA9B;AAAqC,IAAA,MAAM,EAAGX;AAA9C,IADD,CADD,CAFD,EAOC,cAAC,MAAD;AACC,IAAA,SAAS,EAAC,6CADX;AAEC,IAAA,OAAO,EAAC,WAFT;AAGC,IAAA,OAAO,EAAG,MAAMU,sBAAsB,CAAE,KAAF;AAHvC,KAKGlB,EAAE,CAAE,eAAF,CALL,CAPD,CADD;AAiBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { BlockContextProvider, BlockPreview } from '@wordpress/block-editor';\nimport { Button, __experimentalVStack as VStack } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../../store';\n\nexport default function EditTemplate() {\n\tconst { context, hasResolved, title, blocks } = useSelect( ( select ) => {\n\t\tconst { getEditedPostContext, getEditedPostType, getEditedPostId } =\n\t\t\tselect( editSiteStore );\n\t\tconst { getEditedEntityRecord, hasFinishedResolution } =\n\t\t\tselect( coreStore );\n\t\tconst _context = getEditedPostContext();\n\t\tconst queryArgs = [\n\t\t\t'postType',\n\t\t\tgetEditedPostType(),\n\t\t\tgetEditedPostId(),\n\t\t];\n\t\tconst template = getEditedEntityRecord( ...queryArgs );\n\t\treturn {\n\t\t\tcontext: _context,\n\t\t\thasResolved: hasFinishedResolution(\n\t\t\t\t'getEditedEntityRecord',\n\t\t\t\tqueryArgs\n\t\t\t),\n\t\t\ttitle: template?.title,\n\t\t\tblocks: template?.blocks,\n\t\t};\n\t}, [] );\n\n\tconst { setHasPageContentFocus } = useDispatch( editSiteStore );\n\n\tconst blockContext = useMemo(\n\t\t() => ( { ...context, postType: null, postId: null } ),\n\t\t[ context ]\n\t);\n\n\tif ( ! hasResolved ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<VStack>\n\t\t\t<div>{ decodeEntities( title ) }</div>\n\t\t\t<div className=\"edit-site-page-panels__edit-template-preview\">\n\t\t\t\t<BlockContextProvider value={ blockContext }>\n\t\t\t\t\t<BlockPreview viewportWidth={ 1024 } blocks={ blocks } />\n\t\t\t\t</BlockContextProvider>\n\t\t\t</div>\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-site-page-panels__edit-template-button\"\n\t\t\t\tvariant=\"secondary\"\n\t\t\t\tonClick={ () => setHasPageContentFocus( false ) }\n\t\t\t>\n\t\t\t\t{ __( 'Edit template' ) }\n\t\t\t</Button>\n\t\t</VStack>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { PanelBody, __experimentalText as Text, __experimentalVStack as VStack } from '@wordpress/components';
|
|
7
|
+
import { page as pageIcon } from '@wordpress/icons';
|
|
8
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
9
|
+
import { humanTimeDiff } from '@wordpress/date';
|
|
10
|
+
import { useSelect } from '@wordpress/data';
|
|
11
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
12
|
+
import { decodeEntities } from '@wordpress/html-entities';
|
|
13
|
+
/**
|
|
14
|
+
* Internal dependencies
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { store as editSiteStore } from '../../../store';
|
|
18
|
+
import SidebarCard from '../sidebar-card';
|
|
19
|
+
import PageContent from './page-content';
|
|
20
|
+
import PageSummary from './page-summary';
|
|
21
|
+
import EditTemplate from './edit-template';
|
|
22
|
+
export default function PagePanels() {
|
|
23
|
+
const {
|
|
24
|
+
id,
|
|
25
|
+
type,
|
|
26
|
+
hasResolved,
|
|
27
|
+
status,
|
|
28
|
+
date,
|
|
29
|
+
password,
|
|
30
|
+
title,
|
|
31
|
+
modified
|
|
32
|
+
} = useSelect(select => {
|
|
33
|
+
const {
|
|
34
|
+
getEditedPostContext
|
|
35
|
+
} = select(editSiteStore);
|
|
36
|
+
const {
|
|
37
|
+
getEditedEntityRecord,
|
|
38
|
+
hasFinishedResolution
|
|
39
|
+
} = select(coreStore);
|
|
40
|
+
const context = getEditedPostContext();
|
|
41
|
+
const queryArgs = ['postType', context.postType, context.postId];
|
|
42
|
+
const page = getEditedEntityRecord(...queryArgs);
|
|
43
|
+
return {
|
|
44
|
+
hasResolved: hasFinishedResolution('getEditedEntityRecord', queryArgs),
|
|
45
|
+
title: page?.title,
|
|
46
|
+
id: page?.id,
|
|
47
|
+
type: page?.type,
|
|
48
|
+
status: page?.status,
|
|
49
|
+
date: page?.date,
|
|
50
|
+
password: page?.password,
|
|
51
|
+
modified: page?.modified
|
|
52
|
+
};
|
|
53
|
+
}, []);
|
|
54
|
+
|
|
55
|
+
if (!hasResolved) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return createElement(Fragment, null, createElement(PanelBody, null, createElement(SidebarCard, {
|
|
60
|
+
title: decodeEntities(title),
|
|
61
|
+
icon: pageIcon,
|
|
62
|
+
description: createElement(VStack, null, createElement(Text, null, sprintf( // translators: %s: Human-readable time difference, e.g. "2 days ago".
|
|
63
|
+
__('Last edited %s'), humanTimeDiff(modified))))
|
|
64
|
+
})), createElement(PanelBody, {
|
|
65
|
+
title: __('Summary')
|
|
66
|
+
}, createElement(PageSummary, {
|
|
67
|
+
status: status,
|
|
68
|
+
date: date,
|
|
69
|
+
password: password,
|
|
70
|
+
postId: id,
|
|
71
|
+
postType: type
|
|
72
|
+
})), createElement(PanelBody, {
|
|
73
|
+
title: __('Content')
|
|
74
|
+
}, createElement(PageContent, null)), createElement(PanelBody, {
|
|
75
|
+
title: __('Template')
|
|
76
|
+
}, createElement(EditTemplate, null)));
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/page-panels/index.js"],"names":["PanelBody","__experimentalText","Text","__experimentalVStack","VStack","page","pageIcon","__","sprintf","humanTimeDiff","useSelect","store","coreStore","decodeEntities","editSiteStore","SidebarCard","PageContent","PageSummary","EditTemplate","PagePanels","id","type","hasResolved","status","date","password","title","modified","select","getEditedPostContext","getEditedEntityRecord","hasFinishedResolution","context","queryArgs","postType","postId"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,SADD,EAECC,kBAAkB,IAAIC,IAFvB,EAGCC,oBAAoB,IAAIC,MAHzB,QAIO,uBAJP;AAKA,SAASC,IAAI,IAAIC,QAAjB,QAAiC,kBAAjC;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,aAAT,QAA8B,iBAA9B;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASC,cAAT,QAA+B,0BAA/B;AAEA;AACA;AACA;;AACA,SAASF,KAAK,IAAIG,aAAlB,QAAuC,gBAAvC;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AACA,OAAOC,WAAP,MAAwB,gBAAxB;AACA,OAAOC,WAAP,MAAwB,gBAAxB;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AAEA,eAAe,SAASC,UAAT,GAAsB;AACpC,QAAM;AAAEC,IAAAA,EAAF;AAAMC,IAAAA,IAAN;AAAYC,IAAAA,WAAZ;AAAyBC,IAAAA,MAAzB;AAAiCC,IAAAA,IAAjC;AAAuCC,IAAAA,QAAvC;AAAiDC,IAAAA,KAAjD;AAAwDC,IAAAA;AA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,KAAK,EAAGpB,EAAE,CAAE,SAAF;AAArB,KACC,cAAC,WAAD;AACC,IAAA,MAAM,EAAGgB,MADV;AAEC,IAAA,IAAI,EAAGC,IAFR;AAGC,IAAA,QAAQ,EAAGC,QAHZ;AAIC,IAAA,MAAM,EAAGL,EAJV;AAKC,IAAA,QAAQ,EAAGC;AALZ,IADD,CAlBD,EA2BC,cAAC,SAAD;AAAW,IAAA,KAAK,EAAGd,EAAE,CAAE,SAAF;AAArB,KACC,cAAC,WAAD,OADD,CA3BD,EA8BC,cAAC,SAAD;AAAW,IAAA,KAAK,EAAGA,EAAE,CAAE,UAAF;AAArB,KACC,cAAC,YAAD,OADD,CA9BD,CADD;AAoCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPanelBody,\n\t__experimentalText as Text,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { page as pageIcon } from '@wordpress/icons';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { humanTimeDiff } from '@wordpress/date';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../../store';\nimport SidebarCard from '../sidebar-card';\nimport PageContent from './page-content';\nimport PageSummary from './page-summary';\nimport EditTemplate from './edit-template';\n\nexport default function PagePanels() {\n\tconst { id, type, hasResolved, status, date, password, title, modified } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst { getEditedPostContext } = select( editSiteStore );\n\t\t\tconst { getEditedEntityRecord, hasFinishedResolution } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst context = getEditedPostContext();\n\t\t\tconst queryArgs = [ 'postType', context.postType, context.postId ];\n\t\t\tconst page = getEditedEntityRecord( ...queryArgs );\n\t\t\treturn {\n\t\t\t\thasResolved: hasFinishedResolution(\n\t\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t\tqueryArgs\n\t\t\t\t),\n\t\t\t\ttitle: page?.title,\n\t\t\t\tid: page?.id,\n\t\t\t\ttype: page?.type,\n\t\t\t\tstatus: page?.status,\n\t\t\t\tdate: page?.date,\n\t\t\t\tpassword: page?.password,\n\t\t\t\tmodified: page?.modified,\n\t\t\t};\n\t\t}, [] );\n\n\tif ( ! hasResolved ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<PanelBody>\n\t\t\t\t<SidebarCard\n\t\t\t\t\ttitle={ decodeEntities( title ) }\n\t\t\t\t\ticon={ pageIcon }\n\t\t\t\t\tdescription={\n\t\t\t\t\t\t<VStack>\n\t\t\t\t\t\t\t<Text>\n\t\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t\t// translators: %s: Human-readable time difference, e.g. \"2 days ago\".\n\t\t\t\t\t\t\t\t\t__( 'Last edited %s' ),\n\t\t\t\t\t\t\t\t\thumanTimeDiff( modified )\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</PanelBody>\n\t\t\t<PanelBody title={ __( 'Summary' ) }>\n\t\t\t\t<PageSummary\n\t\t\t\t\tstatus={ status }\n\t\t\t\t\tdate={ date }\n\t\t\t\t\tpassword={ password }\n\t\t\t\t\tpostId={ id }\n\t\t\t\t\tpostType={ type }\n\t\t\t\t/>\n\t\t\t</PanelBody>\n\t\t\t<PanelBody title={ __( 'Content' ) }>\n\t\t\t\t<PageContent />\n\t\t\t</PanelBody>\n\t\t\t<PanelBody title={ __( 'Template' ) }>\n\t\t\t\t<EditTemplate />\n\t\t\t</PanelBody>\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { useSelect } from '@wordpress/data';
|
|
7
|
+
import { store as blockEditorStore, privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
8
|
+
/**
|
|
9
|
+
* Internal dependencies
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { PAGE_CONTENT_BLOCK_TYPES } from '../../page-content-focus-manager/constants';
|
|
13
|
+
import { unlock } from '../../../lock-unlock';
|
|
14
|
+
const {
|
|
15
|
+
BlockQuickNavigation
|
|
16
|
+
} = unlock(blockEditorPrivateApis);
|
|
17
|
+
export default function PageContent() {
|
|
18
|
+
const clientIds = useSelect(select => select(blockEditorStore).__experimentalGetGlobalBlocksByName(PAGE_CONTENT_BLOCK_TYPES), []);
|
|
19
|
+
return createElement(BlockQuickNavigation, {
|
|
20
|
+
clientIds: clientIds
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=page-content.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/page-panels/page-content.js"],"names":["useSelect","store","blockEditorStore","privateApis","blockEditorPrivateApis","PAGE_CONTENT_BLOCK_TYPES","unlock","BlockQuickNavigation","PageContent","clientIds","select","__experimentalGetGlobalBlocksByName"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,iBAA1B;AACA,SACCC,KAAK,IAAIC,gBADV,EAECC,WAAW,IAAIC,sBAFhB,QAGO,yBAHP;AAKA;AACA;AACA;;AACA,SAASC,wBAAT,QAAyC,4CAAzC;AACA,SAASC,MAAT,QAAuB,sBAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAA2BD,MAAM,CAAEF,sBAAF,CAAvC;AAEA,eAAe,SAASI,WAAT,GAAuB;AACrC,QAAMC,SAAS,GAAGT,SAAS,CACxBU,MAAF,IACCA,MAAM,CAAER,gBAAF,CAAN,CAA2BS,mCAA3B,CACCN,wBADD,CAFyB,EAK1B,EAL0B,CAA3B;AAOA,SAAO,cAAC,oBAAD;AAAsB,IAAA,SAAS,EAAGI;AAAlC,IAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { PAGE_CONTENT_BLOCK_TYPES } from '../../page-content-focus-manager/constants';\nimport { unlock } from '../../../lock-unlock';\n\nconst { BlockQuickNavigation } = unlock( blockEditorPrivateApis );\n\nexport default function PageContent() {\n\tconst clientIds = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockEditorStore ).__experimentalGetGlobalBlocksByName(\n\t\t\t\tPAGE_CONTENT_BLOCK_TYPES\n\t\t\t),\n\t\t[]\n\t);\n\treturn <BlockQuickNavigation clientIds={ clientIds } />;\n}\n"]}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { createElement, Fragment } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { Button, BaseControl, ToggleControl, Dropdown, __experimentalText as Text, __experimentalHStack as HStack, __experimentalVStack as VStack, TextControl, RadioControl } from '@wordpress/components';
|
|
7
|
+
import { __ } from '@wordpress/i18n';
|
|
8
|
+
import { useDispatch } from '@wordpress/data';
|
|
9
|
+
import { useState, useMemo } from '@wordpress/element';
|
|
10
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
11
|
+
import { store as noticesStore } from '@wordpress/notices';
|
|
12
|
+
import { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';
|
|
13
|
+
/**
|
|
14
|
+
* Internal dependencies
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import StatusLabel from '../../sidebar-navigation-screen-page/status-label';
|
|
18
|
+
const STATUS_OPTIONS = [{
|
|
19
|
+
label: createElement(Fragment, null, __('Draft'), createElement(Text, {
|
|
20
|
+
variant: "muted"
|
|
21
|
+
}, __('Not ready to publish.'))),
|
|
22
|
+
value: 'draft'
|
|
23
|
+
}, {
|
|
24
|
+
label: createElement(Fragment, null, __('Pending'), createElement(Text, {
|
|
25
|
+
variant: "muted"
|
|
26
|
+
}, __('Waiting for review before publishing.'))),
|
|
27
|
+
value: 'pending'
|
|
28
|
+
}, {
|
|
29
|
+
label: createElement(Fragment, null, __('Private'), createElement(Text, {
|
|
30
|
+
variant: "muted"
|
|
31
|
+
}, __('Only visible to site admins and editors.'))),
|
|
32
|
+
value: 'private'
|
|
33
|
+
}, {
|
|
34
|
+
label: createElement(Fragment, null, __('Scheduled'), createElement(Text, {
|
|
35
|
+
variant: "muted"
|
|
36
|
+
}, __('Publish automatically on a chosen date.'))),
|
|
37
|
+
value: 'future'
|
|
38
|
+
}, {
|
|
39
|
+
label: createElement(Fragment, null, __('Published'), createElement(Text, {
|
|
40
|
+
variant: "muted"
|
|
41
|
+
}, __('Visible to everyone.'))),
|
|
42
|
+
value: 'publish'
|
|
43
|
+
}];
|
|
44
|
+
export default function PageStatus({
|
|
45
|
+
postType,
|
|
46
|
+
postId,
|
|
47
|
+
status,
|
|
48
|
+
password,
|
|
49
|
+
date
|
|
50
|
+
}) {
|
|
51
|
+
const [showPassword, setShowPassword] = useState(!!password);
|
|
52
|
+
const {
|
|
53
|
+
editEntityRecord
|
|
54
|
+
} = useDispatch(coreStore);
|
|
55
|
+
const {
|
|
56
|
+
createErrorNotice
|
|
57
|
+
} = useDispatch(noticesStore);
|
|
58
|
+
const [popoverAnchor, setPopoverAnchor] = useState(null); // Memoize popoverProps to avoid returning a new object every time.
|
|
59
|
+
|
|
60
|
+
const popoverProps = useMemo(() => ({
|
|
61
|
+
// Anchor the popover to the middle of the entire row so that it doesn't
|
|
62
|
+
// move around when the label changes.
|
|
63
|
+
anchor: popoverAnchor,
|
|
64
|
+
'aria-label': __('Change status'),
|
|
65
|
+
placement: 'bottom-end'
|
|
66
|
+
}), [popoverAnchor]);
|
|
67
|
+
|
|
68
|
+
const saveStatus = async ({
|
|
69
|
+
status: newStatus = status,
|
|
70
|
+
password: newPassword = password,
|
|
71
|
+
date: newDate = date
|
|
72
|
+
}) => {
|
|
73
|
+
try {
|
|
74
|
+
await editEntityRecord('postType', postType, postId, {
|
|
75
|
+
status: newStatus,
|
|
76
|
+
date: newDate,
|
|
77
|
+
password: newPassword
|
|
78
|
+
});
|
|
79
|
+
} catch (error) {
|
|
80
|
+
const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : __('An error occurred while updating the status');
|
|
81
|
+
createErrorNotice(errorMessage, {
|
|
82
|
+
type: 'snackbar'
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const handleTogglePassword = value => {
|
|
88
|
+
setShowPassword(value);
|
|
89
|
+
|
|
90
|
+
if (!value) {
|
|
91
|
+
saveStatus({
|
|
92
|
+
password: ''
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const handleStatus = value => {
|
|
98
|
+
let newDate = date;
|
|
99
|
+
let newPassword = password;
|
|
100
|
+
|
|
101
|
+
if (value === 'publish') {
|
|
102
|
+
if (new Date(date) > new Date()) {
|
|
103
|
+
newDate = null;
|
|
104
|
+
}
|
|
105
|
+
} else if (value === 'future') {
|
|
106
|
+
if (!date || new Date(date) < new Date()) {
|
|
107
|
+
newDate = new Date();
|
|
108
|
+
newDate.setDate(newDate.getDate() + 7);
|
|
109
|
+
}
|
|
110
|
+
} else if (value === 'private' && password) {
|
|
111
|
+
setShowPassword(false);
|
|
112
|
+
newPassword = '';
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
saveStatus({
|
|
116
|
+
status: value,
|
|
117
|
+
date: newDate,
|
|
118
|
+
password: newPassword
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
return createElement(HStack, {
|
|
123
|
+
className: "edit-site-summary-field"
|
|
124
|
+
}, createElement(Text, {
|
|
125
|
+
className: "edit-site-summary-field__label"
|
|
126
|
+
}, __('Status')), createElement(Dropdown, {
|
|
127
|
+
contentClassName: "edit-site-change-status__content",
|
|
128
|
+
popoverProps: popoverProps,
|
|
129
|
+
focusOnMount: true,
|
|
130
|
+
ref: setPopoverAnchor,
|
|
131
|
+
renderToggle: ({
|
|
132
|
+
onToggle
|
|
133
|
+
}) => createElement(Button, {
|
|
134
|
+
className: "edit-site-summary-field__trigger",
|
|
135
|
+
variant: "tertiary",
|
|
136
|
+
onClick: onToggle
|
|
137
|
+
}, createElement(StatusLabel, {
|
|
138
|
+
status: password ? 'protected' : status
|
|
139
|
+
})),
|
|
140
|
+
renderContent: ({
|
|
141
|
+
onClose
|
|
142
|
+
}) => createElement(Fragment, null, createElement(InspectorPopoverHeader, {
|
|
143
|
+
title: __('Status'),
|
|
144
|
+
onClose: onClose
|
|
145
|
+
}), createElement("form", null, createElement(VStack, {
|
|
146
|
+
spacing: 5
|
|
147
|
+
}, createElement(RadioControl, {
|
|
148
|
+
className: "edit-site-change-status__options",
|
|
149
|
+
hideLabelFromVision: true,
|
|
150
|
+
label: __('Status'),
|
|
151
|
+
options: STATUS_OPTIONS,
|
|
152
|
+
onChange: handleStatus,
|
|
153
|
+
selected: status
|
|
154
|
+
}), status !== 'private' && createElement(BaseControl, {
|
|
155
|
+
id: `edit-site-change-status__password`,
|
|
156
|
+
label: __('Password')
|
|
157
|
+
}, createElement(ToggleControl, {
|
|
158
|
+
label: __('Hide this page behind a password'),
|
|
159
|
+
checked: showPassword,
|
|
160
|
+
onChange: handleTogglePassword
|
|
161
|
+
}), showPassword && createElement(TextControl, {
|
|
162
|
+
onChange: value => saveStatus({
|
|
163
|
+
password: value
|
|
164
|
+
}),
|
|
165
|
+
value: password
|
|
166
|
+
/* eslint-disable jsx-a11y/no-autofocus */
|
|
167
|
+
,
|
|
168
|
+
autoFocus: !password
|
|
169
|
+
/* eslint-enable jsx-a11y/no-autofocus */
|
|
170
|
+
,
|
|
171
|
+
placeholder: __('Enter a secure password'),
|
|
172
|
+
type: "password"
|
|
173
|
+
})))))
|
|
174
|
+
}));
|
|
175
|
+
}
|
|
176
|
+
//# sourceMappingURL=page-status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/page-panels/page-status.js"],"names":["Button","BaseControl","ToggleControl","Dropdown","__experimentalText","Text","__experimentalHStack","HStack","__experimentalVStack","VStack","TextControl","RadioControl","__","useDispatch","useState","useMemo","store","coreStore","noticesStore","__experimentalInspectorPopoverHeader","InspectorPopoverHeader","StatusLabel","STATUS_OPTIONS","label","value","PageStatus","postType","postId","status","password","date","showPassword","setShowPassword","editEntityRecord","createErrorNotice","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","saveStatus","newStatus","newPassword","newDate","error","errorMessage","message","code","type","handleTogglePassword","handleStatus","Date","setDate","getDate","onToggle","onClose"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,MADD,EAECC,WAFD,EAGCC,aAHD,EAICC,QAJD,EAKCC,kBAAkB,IAAIC,IALvB,EAMCC,oBAAoB,IAAIC,MANzB,EAOCC,oBAAoB,IAAIC,MAPzB,EAQCC,WARD,EASCC,YATD,QAUO,uBAVP;AAWA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,WAAT,QAA4B,iBAA5B;AACA,SAASC,QAAT,EAAmBC,OAAnB,QAAkC,oBAAlC;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AACA,SAASD,KAAK,IAAIE,YAAlB,QAAsC,oBAAtC;AACA,SAASC,oCAAoC,IAAIC,sBAAjD,QAA+E,yBAA/E;AACA;AACA;AACA;;AACA,OAAOC,WAAP,MAAwB,mDAAxB;AAEA,MAAMC,cAAc,GAAG,CACtB;AACCC,EAAAA,KAAK,EACJ,8BACGX,EAAE,CAAE,OAAF,CADL,EAEC,cAAC,IAAD;AAAM,IAAA,OAAO,EAAC;AAAd,KAAwBA,EAAE,CAAE,uBAAF,CAA1B,CAFD,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AA,MAAM,EAAGzB,QAAQ,GAAG,WAAH,GAAiBD;AADnC,MALD,CANF;AAgBC,IAAA,aAAa,EAAG,CAAE;AAAE2B,MAAAA;AAAF,KAAF,KACf,8BACC,cAAC,sBAAD;AACC,MAAA,KAAK,EAAG3C,EAAE,CAAE,QAAF,CADX;AAEC,MAAA,OAAO,EAAG2C;AAFX,MADD,EAKC,4BACC,cAAC,MAAD;AAAQ,MAAA,OAAO,EAAG;AAAlB,OACC,cAAC,YAAD;AACC,MAAA,SAAS,EAAC,kCADX;AAEC,MAAA,mBAAmB,MAFpB;AAGC,MAAA,KAAK,EAAG3C,EAAE,CAAE,QAAF,CAHX;AAIC,MAAA,OAAO,EAAGU,cAJX;AAKC,MAAA,QAAQ,EAAG4B,YALZ;AAMC,MAAA,QAAQ,EAAGtB;AANZ,MADD,EASGA,MAAM,KAAK,SAAX,IACD,cAAC,WAAD;AACC,MAAA,EAAE,EAAI,mCADP;AAEC,MAAA,KAAK,EAAGhB,EAAE,CAAE,UAAF;AAFX,OAIC,cAAC,aAAD;AACC,MAAA,KAAK,EAAGA,EAAE,CACT,kCADS,CADX;AAIC,MAAA,OAAO,EAAGmB,YAJX;AAKC,MAAA,QAAQ,EAAGkB;AALZ,MAJD,EAWGlB,YAAY,IACb,cAAC,WAAD;AACC,MAAA,QAAQ,EAAKP,KAAF,IACVgB,UAAU,CAAE;AACXX,QAAAA,QAAQ,EAAEL;AADC,OAAF,CAFZ;AAMC,MAAA,KAAK,EAAGK;AACR;AAPD;AAQC,MAAA,SAAS,EAAG,CAAEA;AACd;AATD;AAUC,MAAA,WAAW,EAAGjB,EAAE,CACf,yBADe,CAVjB;AAaC,MAAA,IAAI,EAAC;AAbN,MAZF,CAVF,CADD,CALD;AAjBF,IAJD,CADD;AA2EA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tBaseControl,\n\tToggleControl,\n\tDropdown,\n\t__experimentalText as Text,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tTextControl,\n\tRadioControl,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { useState, useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\n/**\n * Internal dependencies\n */\nimport StatusLabel from '../../sidebar-navigation-screen-page/status-label';\n\nconst STATUS_OPTIONS = [\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Draft' ) }\n\t\t\t\t<Text variant=\"muted\">{ __( 'Not ready to publish.' ) }</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'draft',\n\t},\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Pending' ) }\n\t\t\t\t<Text variant=\"muted\">\n\t\t\t\t\t{ __( 'Waiting for review before publishing.' ) }\n\t\t\t\t</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'pending',\n\t},\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Private' ) }\n\t\t\t\t<Text variant=\"muted\">\n\t\t\t\t\t{ __( 'Only visible to site admins and editors.' ) }\n\t\t\t\t</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'private',\n\t},\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Scheduled' ) }\n\t\t\t\t<Text variant=\"muted\">\n\t\t\t\t\t{ __( 'Publish automatically on a chosen date.' ) }\n\t\t\t\t</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'future',\n\t},\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Published' ) }\n\t\t\t\t<Text variant=\"muted\">{ __( 'Visible to everyone.' ) }</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'publish',\n\t},\n];\n\nexport default function PageStatus( {\n\tpostType,\n\tpostId,\n\tstatus,\n\tpassword,\n\tdate,\n} ) {\n\tconst [ showPassword, setShowPassword ] = useState( !! password );\n\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\t'aria-label': __( 'Change status' ),\n\t\t\tplacement: 'bottom-end',\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\tconst saveStatus = async ( {\n\t\tstatus: newStatus = status,\n\t\tpassword: newPassword = password,\n\t\tdate: newDate = date,\n\t} ) => {\n\t\ttry {\n\t\t\tawait editEntityRecord( 'postType', postType, postId, {\n\t\t\t\tstatus: newStatus,\n\t\t\t\tdate: newDate,\n\t\t\t\tpassword: newPassword,\n\t\t\t} );\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: __( 'An error occurred while updating the status' );\n\n\t\t\tcreateErrorNotice( errorMessage, {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t}\n\t};\n\n\tconst handleTogglePassword = ( value ) => {\n\t\tsetShowPassword( value );\n\t\tif ( ! value ) {\n\t\t\tsaveStatus( { password: '' } );\n\t\t}\n\t};\n\n\tconst handleStatus = ( value ) => {\n\t\tlet newDate = date;\n\t\tlet newPassword = password;\n\t\tif ( value === 'publish' ) {\n\t\t\tif ( new Date( date ) > new Date() ) {\n\t\t\t\tnewDate = null;\n\t\t\t}\n\t\t} else if ( value === 'future' ) {\n\t\t\tif ( ! date || new Date( date ) < new Date() ) {\n\t\t\t\tnewDate = new Date();\n\t\t\t\tnewDate.setDate( newDate.getDate() + 7 );\n\t\t\t}\n\t\t} else if ( value === 'private' && password ) {\n\t\t\tsetShowPassword( false );\n\t\t\tnewPassword = '';\n\t\t}\n\t\tsaveStatus( {\n\t\t\tstatus: value,\n\t\t\tdate: newDate,\n\t\t\tpassword: newPassword,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<HStack className=\"edit-site-summary-field\">\n\t\t\t<Text className=\"edit-site-summary-field__label\">\n\t\t\t\t{ __( 'Status' ) }\n\t\t\t</Text>\n\t\t\t<Dropdown\n\t\t\t\tcontentClassName=\"edit-site-change-status__content\"\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\tfocusOnMount\n\t\t\t\tref={ setPopoverAnchor }\n\t\t\t\trenderToggle={ ( { onToggle } ) => (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"edit-site-summary-field__trigger\"\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t>\n\t\t\t\t\t\t<StatusLabel\n\t\t\t\t\t\t\tstatus={ password ? 'protected' : status }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<InspectorPopoverHeader\n\t\t\t\t\t\t\ttitle={ __( 'Status' ) }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<form>\n\t\t\t\t\t\t\t<VStack spacing={ 5 }>\n\t\t\t\t\t\t\t\t<RadioControl\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-change-status__options\"\n\t\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Status' ) }\n\t\t\t\t\t\t\t\t\toptions={ STATUS_OPTIONS }\n\t\t\t\t\t\t\t\t\tonChange={ handleStatus }\n\t\t\t\t\t\t\t\t\tselected={ status }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ status !== 'private' && (\n\t\t\t\t\t\t\t\t\t<BaseControl\n\t\t\t\t\t\t\t\t\t\tid={ `edit-site-change-status__password` }\n\t\t\t\t\t\t\t\t\t\tlabel={ __( 'Password' ) }\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Hide this page behind a password'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\tchecked={ showPassword }\n\t\t\t\t\t\t\t\t\t\t\tonChange={ handleTogglePassword }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t{ showPassword && (\n\t\t\t\t\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\t\t\t\t\tsaveStatus( {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpassword: value,\n\t\t\t\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tvalue={ password }\n\t\t\t\t\t\t\t\t\t\t\t\t/* eslint-disable jsx-a11y/no-autofocus */\n\t\t\t\t\t\t\t\t\t\t\t\tautoFocus={ ! password }\n\t\t\t\t\t\t\t\t\t\t\t\t/* eslint-enable jsx-a11y/no-autofocus */\n\t\t\t\t\t\t\t\t\t\t\t\tplaceholder={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'Enter a secure password'\n\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\ttype=\"password\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</BaseControl>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t/>\n\t\t</HStack>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { __experimentalVStack as VStack } from '@wordpress/components';
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import PageStatus from './page-status';
|
|
12
|
+
import PublishDate from './publish-date';
|
|
13
|
+
export default function PageSummary({
|
|
14
|
+
status,
|
|
15
|
+
date,
|
|
16
|
+
password,
|
|
17
|
+
postId,
|
|
18
|
+
postType
|
|
19
|
+
}) {
|
|
20
|
+
return createElement(VStack, null, createElement(PageStatus, {
|
|
21
|
+
status: status,
|
|
22
|
+
date: date,
|
|
23
|
+
password: password,
|
|
24
|
+
postId: postId,
|
|
25
|
+
postType: postType
|
|
26
|
+
}), createElement(PublishDate, {
|
|
27
|
+
status: status,
|
|
28
|
+
date: date,
|
|
29
|
+
postId: postId,
|
|
30
|
+
postType: postType
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=page-summary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/page-panels/page-summary.js"],"names":["__experimentalVStack","VStack","PageStatus","PublishDate","PageSummary","status","date","password","postId","postType"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,oBAAoB,IAAIC,MAAjC,QAA+C,uBAA/C;AACA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,eAAvB;AACA,OAAOC,WAAP,MAAwB,gBAAxB;AAEA,eAAe,SAASC,WAAT,CAAsB;AACpCC,EAAAA,MADoC;AAEpCC,EAAAA,IAFoC;AAGpCC,EAAAA,QAHoC;AAIpCC,EAAAA,MAJoC;AAKpCC,EAAAA;AALoC,CAAtB,EAMX;AACH,SACC,cAAC,MAAD,QACC,cAAC,UAAD;AACC,IAAA,MAAM,EAAGJ,MADV;AAEC,IAAA,IAAI,EAAGC,IAFR;AAGC,IAAA,QAAQ,EAAGC,QAHZ;AAIC,IAAA,MAAM,EAAGC,MAJV;AAKC,IAAA,QAAQ,EAAGC;AALZ,IADD,EAQC,cAAC,WAAD;AACC,IAAA,MAAM,EAAGJ,MADV;AAEC,IAAA,IAAI,EAAGC,IAFR;AAGC,IAAA,MAAM,EAAGE,MAHV;AAIC,IAAA,QAAQ,EAAGC;AAJZ,IARD,CADD;AAiBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalVStack as VStack } from '@wordpress/components';\n/**\n * Internal dependencies\n */\nimport PageStatus from './page-status';\nimport PublishDate from './publish-date';\n\nexport default function PageSummary( {\n\tstatus,\n\tdate,\n\tpassword,\n\tpostId,\n\tpostType,\n} ) {\n\treturn (\n\t\t<VStack>\n\t\t\t<PageStatus\n\t\t\t\tstatus={ status }\n\t\t\t\tdate={ date }\n\t\t\t\tpassword={ password }\n\t\t\t\tpostId={ postId }\n\t\t\t\tpostType={ postType }\n\t\t\t/>\n\t\t\t<PublishDate\n\t\t\t\tstatus={ status }\n\t\t\t\tdate={ date }\n\t\t\t\tpostId={ postId }\n\t\t\t\tpostType={ postType }\n\t\t\t/>\n\t\t</VStack>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { createElement } from "@wordpress/element";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* WordPress dependencies
|
|
5
|
+
*/
|
|
6
|
+
import { Button, Dropdown, __experimentalText as Text, __experimentalHStack as HStack } from '@wordpress/components';
|
|
7
|
+
import { __ } from '@wordpress/i18n';
|
|
8
|
+
import { useDispatch } from '@wordpress/data';
|
|
9
|
+
import { useState, useMemo } from '@wordpress/element';
|
|
10
|
+
import { store as coreStore } from '@wordpress/core-data';
|
|
11
|
+
import { store as noticesStore } from '@wordpress/notices';
|
|
12
|
+
import { __experimentalPublishDateTimePicker as PublishDateTimePicker } from '@wordpress/block-editor';
|
|
13
|
+
import { humanTimeDiff } from '@wordpress/date';
|
|
14
|
+
export default function ChangeStatus({
|
|
15
|
+
postType,
|
|
16
|
+
postId,
|
|
17
|
+
status,
|
|
18
|
+
date
|
|
19
|
+
}) {
|
|
20
|
+
const {
|
|
21
|
+
editEntityRecord
|
|
22
|
+
} = useDispatch(coreStore);
|
|
23
|
+
const {
|
|
24
|
+
createErrorNotice
|
|
25
|
+
} = useDispatch(noticesStore);
|
|
26
|
+
const [popoverAnchor, setPopoverAnchor] = useState(null); // Memoize popoverProps to avoid returning a new object every time.
|
|
27
|
+
|
|
28
|
+
const popoverProps = useMemo(() => ({
|
|
29
|
+
// Anchor the popover to the middle of the entire row so that it doesn't
|
|
30
|
+
// move around when the label changes.
|
|
31
|
+
anchor: popoverAnchor,
|
|
32
|
+
'aria-label': __('Change publish date'),
|
|
33
|
+
placement: 'bottom-end'
|
|
34
|
+
}), [popoverAnchor]);
|
|
35
|
+
|
|
36
|
+
const saveDate = async newDate => {
|
|
37
|
+
try {
|
|
38
|
+
let newStatus = status;
|
|
39
|
+
|
|
40
|
+
if (status === 'future' && new Date(newDate) < new Date()) {
|
|
41
|
+
newStatus = 'publish';
|
|
42
|
+
} else if (status === 'publish' && new Date(newDate) > new Date()) {
|
|
43
|
+
newStatus = 'future';
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
await editEntityRecord('postType', postType, postId, {
|
|
47
|
+
status: newStatus,
|
|
48
|
+
date: newDate
|
|
49
|
+
});
|
|
50
|
+
} catch (error) {
|
|
51
|
+
const errorMessage = error.message && error.code !== 'unknown_error' ? error.message : __('An error occurred while updating the status');
|
|
52
|
+
createErrorNotice(errorMessage, {
|
|
53
|
+
type: 'snackbar'
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const relateToNow = date ? humanTimeDiff(date) : __('Immediately');
|
|
59
|
+
return createElement(HStack, {
|
|
60
|
+
className: "edit-site-summary-field"
|
|
61
|
+
}, createElement(Text, {
|
|
62
|
+
className: "edit-site-summary-field__label"
|
|
63
|
+
}, __('Publish')), createElement(Dropdown, {
|
|
64
|
+
contentClassName: "edit-site-change-status__content",
|
|
65
|
+
popoverProps: popoverProps,
|
|
66
|
+
focusOnMount: true,
|
|
67
|
+
ref: setPopoverAnchor,
|
|
68
|
+
renderToggle: ({
|
|
69
|
+
onToggle
|
|
70
|
+
}) => createElement(Button, {
|
|
71
|
+
className: "edit-site-summary-field__trigger",
|
|
72
|
+
variant: "tertiary",
|
|
73
|
+
onClick: onToggle
|
|
74
|
+
}, relateToNow),
|
|
75
|
+
renderContent: ({
|
|
76
|
+
onClose
|
|
77
|
+
}) => createElement(PublishDateTimePicker, {
|
|
78
|
+
currentDate: date,
|
|
79
|
+
is12Hour: true,
|
|
80
|
+
onClose: onClose,
|
|
81
|
+
onChange: saveDate
|
|
82
|
+
})
|
|
83
|
+
}));
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=publish-date.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/page-panels/publish-date.js"],"names":["Button","Dropdown","__experimentalText","Text","__experimentalHStack","HStack","__","useDispatch","useState","useMemo","store","coreStore","noticesStore","__experimentalPublishDateTimePicker","PublishDateTimePicker","humanTimeDiff","ChangeStatus","postType","postId","status","date","editEntityRecord","createErrorNotice","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","saveDate","newDate","newStatus","Date","error","errorMessage","message","code","type","relateToNow","onToggle","onClose"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,MADD,EAECC,QAFD,EAGCC,kBAAkB,IAAIC,IAHvB,EAICC,oBAAoB,IAAIC,MAJzB,QAKO,uBALP;AAMA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,WAAT,QAA4B,iBAA5B;AACA,SAASC,QAA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__experimentalHStack as HStack,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { useState, useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __experimentalPublishDateTimePicker as PublishDateTimePicker } from '@wordpress/block-editor';\nimport { humanTimeDiff } from '@wordpress/date';\n\nexport default function ChangeStatus( { postType, postId, status, date } ) {\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\t'aria-label': __( 'Change publish date' ),\n\t\t\tplacement: 'bottom-end',\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\tconst saveDate = async ( newDate ) => {\n\t\ttry {\n\t\t\tlet newStatus = status;\n\t\t\tif ( status === 'future' && new Date( newDate ) < new Date() ) {\n\t\t\t\tnewStatus = 'publish';\n\t\t\t} else if (\n\t\t\t\tstatus === 'publish' &&\n\t\t\t\tnew Date( newDate ) > new Date()\n\t\t\t) {\n\t\t\t\tnewStatus = 'future';\n\t\t\t}\n\t\t\tawait editEntityRecord( 'postType', postType, postId, {\n\t\t\t\tstatus: newStatus,\n\t\t\t\tdate: newDate,\n\t\t\t} );\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: __( 'An error occurred while updating the status' );\n\n\t\t\tcreateErrorNotice( errorMessage, {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t}\n\t};\n\n\tconst relateToNow = date ? humanTimeDiff( date ) : __( 'Immediately' );\n\n\treturn (\n\t\t<HStack className=\"edit-site-summary-field\">\n\t\t\t<Text className=\"edit-site-summary-field__label\">\n\t\t\t\t{ __( 'Publish' ) }\n\t\t\t</Text>\n\t\t\t<Dropdown\n\t\t\t\tcontentClassName=\"edit-site-change-status__content\"\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\tfocusOnMount\n\t\t\t\tref={ setPopoverAnchor }\n\t\t\t\trenderToggle={ ( { onToggle } ) => (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"edit-site-summary-field__trigger\"\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ relateToNow }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t<PublishDateTimePicker\n\t\t\t\t\t\tcurrentDate={ date }\n\t\t\t\t\t\tis12Hour\n\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\tonChange={ saveDate }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t/>\n\t\t</HStack>\n\t);\n}\n"]}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
1
|
import { createElement } from "@wordpress/element";
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -77,17 +76,17 @@ import { store as editSiteStore } from '../../../store';
|
|
|
77
76
|
* ```
|
|
78
77
|
*/
|
|
79
78
|
|
|
80
|
-
export default function PluginSidebarEditSite(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
} = _ref;
|
|
79
|
+
export default function PluginSidebarEditSite({
|
|
80
|
+
className,
|
|
81
|
+
...props
|
|
82
|
+
}) {
|
|
85
83
|
const showIconLabels = useSelect(select => select(editSiteStore).getSettings().showIconLabels, []);
|
|
86
|
-
return createElement(ComplementaryArea,
|
|
84
|
+
return createElement(ComplementaryArea, {
|
|
87
85
|
panelClassName: className,
|
|
88
86
|
className: "edit-site-sidebar-edit-mode",
|
|
89
87
|
scope: "core/edit-site",
|
|
90
|
-
showIconLabels: showIconLabels
|
|
91
|
-
|
|
88
|
+
showIconLabels: showIconLabels,
|
|
89
|
+
...props
|
|
90
|
+
});
|
|
92
91
|
}
|
|
93
92
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/plugin-sidebar/index.js"],"names":["ComplementaryArea","useSelect","store","editSiteStore","PluginSidebarEditSite","className","props","showIconLabels","select","getSettings"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/plugin-sidebar/index.js"],"names":["ComplementaryArea","useSelect","store","editSiteStore","PluginSidebarEditSite","className","props","showIconLabels","select","getSettings"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,iBAAT,QAAkC,sBAAlC;AACA,SAASC,SAAT,QAA0B,iBAA1B;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,gBAAvC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,qBAAT,CAAgC;AAAEC,EAAAA,SAAF;AAAa,KAAGC;AAAhB,CAAhC,EAA0D;AACxE,QAAMC,cAAc,GAAGN,SAAS,CAC7BO,MAAF,IAAcA,MAAM,CAAEL,aAAF,CAAN,CAAwBM,WAAxB,GAAsCF,cADrB,EAE/B,EAF+B,CAAhC;AAKA,SACC,cAAC,iBAAD;AACC,IAAA,cAAc,EAAGF,SADlB;AAEC,IAAA,SAAS,EAAC,6BAFX;AAGC,IAAA,KAAK,EAAC,gBAHP;AAIC,IAAA,cAAc,EAAGE,cAJlB;AAAA,OAKMD;AALN,IADD;AASA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ComplementaryArea } from '@wordpress/interface';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../../store';\n\n/**\n * Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar.\n * It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`.\n * If you wish to display the sidebar, you can with use the `PluginSidebarMoreMenuItem` component or the `wp.data.dispatch` API:\n *\n * ```js\n * wp.data.dispatch( 'core/edit-site' ).openGeneralSidebar( 'plugin-name/sidebar-name' );\n * ```\n *\n * @see PluginSidebarMoreMenuItem\n *\n * @param {Object} props Element props.\n * @param {string} props.name A string identifying the sidebar. Must be unique for every sidebar registered within the scope of your plugin.\n * @param {string} [props.className] An optional class name added to the sidebar body.\n * @param {string} props.title Title displayed at the top of the sidebar.\n * @param {boolean} [props.isPinnable=true] Whether to allow to pin sidebar to the toolbar. When set to `true` it also automatically renders a corresponding menu item.\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var el = wp.element.createElement;\n * var PanelBody = wp.components.PanelBody;\n * var PluginSidebar = wp.editSite.PluginSidebar;\n * var moreIcon = wp.element.createElement( 'svg' ); //... svg element.\n *\n * function MyPluginSidebar() {\n * \treturn el(\n * \t\t\tPluginSidebar,\n * \t\t\t{\n * \t\t\t\tname: 'my-sidebar',\n * \t\t\t\ttitle: 'My sidebar title',\n * \t\t\t\ticon: moreIcon,\n * \t\t\t},\n * \t\t\tel(\n * \t\t\t\tPanelBody,\n * \t\t\t\t{},\n * \t\t\t\t__( 'My sidebar content' )\n * \t\t\t)\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PanelBody } from '@wordpress/components';\n * import { PluginSidebar } from '@wordpress/edit-site';\n * import { more } from '@wordpress/icons';\n *\n * const MyPluginSidebar = () => (\n * \t<PluginSidebar\n * \t\tname=\"my-sidebar\"\n * \t\ttitle=\"My sidebar title\"\n * \t\ticon={ more }\n * \t>\n * \t\t<PanelBody>\n * \t\t\t{ __( 'My sidebar content' ) }\n * \t\t</PanelBody>\n * \t</PluginSidebar>\n * );\n * ```\n */\nexport default function PluginSidebarEditSite( { className, ...props } ) {\n\tconst showIconLabels = useSelect(\n\t\t( select ) => select( editSiteStore ).getSettings().showIconLabels,\n\t\t[]\n\t);\n\n\treturn (\n\t\t<ComplementaryArea\n\t\t\tpanelClassName={ className }\n\t\t\tclassName=\"edit-site-sidebar-edit-mode\"\n\t\t\tscope=\"core/edit-site\"\n\t\t\tshowIconLabels={ showIconLabels }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"]}
|