@wordpress/edit-site 5.12.0 → 5.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/build/components/add-new-pattern/index.js +99 -0
- package/build/components/add-new-pattern/index.js.map +1 -0
- package/build/components/add-new-template/add-custom-template-modal-content.js +9 -23
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/index.js +2 -10
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/add-new-template/new-template.js +75 -22
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/app/index.js +2 -2
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/back-button.js +5 -3
- package/build/components/block-editor/back-button.js.map +1 -1
- package/build/components/block-editor/constants.js +9 -0
- package/build/components/block-editor/constants.js.map +1 -0
- package/build/components/block-editor/editor-canvas.js +8 -8
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/get-block-editor-provider.js +42 -0
- package/build/components/block-editor/get-block-editor-provider.js.map +1 -0
- package/build/components/block-editor/index.js +6 -132
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/block-editor/providers/default-block-editor-provider.js +58 -0
- package/build/components/block-editor/providers/default-block-editor-provider.js.map +1 -0
- package/build/components/block-editor/providers/navigation-block-editor-provider.js +117 -0
- package/build/components/block-editor/providers/navigation-block-editor-provider.js.map +1 -0
- package/build/components/block-editor/site-editor-canvas.js +137 -0
- package/build/components/block-editor/site-editor-canvas.js.map +1 -0
- package/build/components/block-editor/use-site-editor-settings.js +82 -0
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -0
- package/build/components/canvas-spinner/index.js +18 -1
- package/build/components/canvas-spinner/index.js.map +1 -1
- package/build/components/create-pattern-modal/index.js +125 -0
- package/build/components/create-pattern-modal/index.js.map +1 -0
- package/build/components/create-template-part-modal/index.js +50 -6
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/editor/index.js +24 -13
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +22 -4
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/global-styles/color-indicator-wrapper.js +4 -5
- package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +2 -2
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +2 -2
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +12 -16
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +2 -2
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/hooks.js +3 -3
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/icon-with-current-color.js +4 -5
- package/build/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build/components/global-styles/navigation-button.js +10 -11
- package/build/components/global-styles/navigation-button.js.map +1 -1
- package/build/components/global-styles/palette.js +3 -3
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preview.js +2 -2
- package/build/components/global-styles/preview.js.map +1 -1
- package/build/components/global-styles/root-menu.js +2 -2
- package/build/components/global-styles/root-menu.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +2 -2
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js +2 -2
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +2 -2
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-css.js +2 -2
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-layout.js +2 -2
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +4 -4
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +2 -2
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build/components/global-styles/screen-root.js +2 -2
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +2 -2
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +11 -3
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +2 -2
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-preview.js +2 -2
- package/build/components/global-styles/typography-preview.js.map +1 -1
- package/build/components/global-styles/ui.js +95 -36
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles-renderer/index.js +2 -2
- package/build/components/global-styles-renderer/index.js.map +1 -1
- package/build/components/header-edit-mode/document-actions/index.js +55 -22
- package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +41 -16
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/index.js +36 -2
- package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +4 -7
- package/build/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +1 -1
- package/build/components/header-edit-mode/undo-redo/redo.js +2 -6
- package/build/components/header-edit-mode/undo-redo/redo.js.map +1 -1
- package/build/components/header-edit-mode/undo-redo/undo.js +2 -6
- package/build/components/header-edit-mode/undo-redo/undo.js.map +1 -1
- package/build/components/keyboard-shortcut-help-modal/index.js +2 -1
- package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/edit-mode.js +39 -3
- package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +7 -2
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/register.js +10 -1
- package/build/components/keyboard-shortcuts/register.js.map +1 -1
- package/build/components/layout/hooks.js +21 -0
- package/build/components/layout/hooks.js.map +1 -1
- package/build/components/layout/index.js +126 -34
- package/build/components/layout/index.js.map +1 -1
- package/build/components/list/index.js +2 -2
- package/build/components/list/index.js.map +1 -1
- package/build/components/page/header.js +41 -0
- package/build/components/page/header.js.map +1 -0
- package/build/components/page/index.js +49 -0
- package/build/components/page/index.js.map +1 -0
- package/build/components/page-content-focus-manager/back-to-page-notification.js +73 -0
- package/build/components/page-content-focus-manager/back-to-page-notification.js.map +1 -0
- package/build/components/page-content-focus-manager/constants.js +9 -0
- package/build/components/page-content-focus-manager/constants.js.map +1 -0
- package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js +60 -0
- package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -0
- package/build/components/page-content-focus-manager/edit-template-notification.js +121 -0
- package/build/components/page-content-focus-manager/edit-template-notification.js.map +1 -0
- package/build/components/page-content-focus-manager/index.js +37 -0
- package/build/components/page-content-focus-manager/index.js.map +1 -0
- package/build/components/page-library/grid-item.js +169 -0
- package/build/components/page-library/grid-item.js.map +1 -0
- package/build/components/page-library/grid.js +49 -0
- package/build/components/page-library/grid.js.map +1 -0
- package/build/components/page-library/index.js +61 -0
- package/build/components/page-library/index.js.map +1 -0
- package/build/components/page-library/no-patterns.js +20 -0
- package/build/components/page-library/no-patterns.js.map +1 -0
- package/build/components/page-library/patterns-list.js +108 -0
- package/build/components/page-library/patterns-list.js.map +1 -0
- package/build/components/page-library/search-items.js +172 -0
- package/build/components/page-library/search-items.js.map +1 -0
- package/build/components/page-library/use-library-settings.js +53 -0
- package/build/components/page-library/use-library-settings.js.map +1 -0
- package/build/components/page-library/use-patterns.js +194 -0
- package/build/components/page-library/use-patterns.js.map +1 -0
- package/build/components/page-library/utils.js +30 -0
- package/build/components/page-library/utils.js.map +1 -0
- package/build/components/page-main/index.js +46 -0
- package/build/components/page-main/index.js.map +1 -0
- package/build/components/page-templates/index.js +101 -0
- package/build/components/page-templates/index.js.map +1 -0
- package/build/components/preferences-modal/enable-feature.js +9 -8
- package/build/components/preferences-modal/enable-feature.js.map +1 -1
- package/build/components/preferences-modal/index.js +30 -0
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/resizable-frame/index.js +6 -4
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/revisions/index.js +2 -2
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/routes/link.js +7 -10
- package/build/components/routes/link.js.map +1 -1
- package/build/components/routes/use-title.js +2 -2
- package/build/components/routes/use-title.js.map +1 -1
- package/build/components/save-button/index.js +15 -11
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js +2 -2
- package/build/components/save-hub/index.js.map +1 -1
- package/build/components/save-panel/index.js +5 -7
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +4 -8
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +47 -10
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build/components/sidebar/index.js +12 -8
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-button/index.js +2 -4
- package/build/components/sidebar-button/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +22 -8
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +8 -6
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/edit-template.js +84 -0
- package/build/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -0
- package/build/components/sidebar-edit-mode/page-panels/index.js +51 -38
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-content.js +35 -0
- package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -0
- package/build/components/sidebar-edit-mode/page-panels/page-status.js +192 -0
- package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -0
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js +45 -0
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -0
- package/build/components/sidebar-edit-mode/page-panels/publish-date.js +98 -0
- package/build/components/sidebar-edit-mode/page-panels/publish-date.js.map +1 -0
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +4 -7
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/settings-header/index.js +19 -6
- package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +2 -2
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/index.js +10 -6
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build/components/sidebar-navigation-item/index.js +11 -7
- package/build/components/sidebar-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +24 -9
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js +36 -0
- package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-details-panel/index.js +58 -0
- package/build/components/sidebar-navigation-screen-details-panel/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +22 -0
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -0
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +35 -0
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -0
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +22 -0
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -0
- package/build/components/sidebar-navigation-screen-global-styles/index.js +28 -16
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-library/category-item.js +48 -0
- package/build/components/sidebar-navigation-screen-library/category-item.js.map +1 -0
- package/build/components/sidebar-navigation-screen-library/index.js +112 -0
- package/build/components/sidebar-navigation-screen-library/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-library/use-default-pattern-categories.js +36 -0
- package/build/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +1 -0
- package/build/components/sidebar-navigation-screen-library/use-pattern-categories.js +76 -0
- package/build/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +1 -0
- package/build/components/sidebar-navigation-screen-library/use-template-part-areas.js +41 -0
- package/build/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +1 -0
- package/build/components/sidebar-navigation-screen-library/use-theme-patterns.js +40 -0
- package/build/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +1 -0
- package/build/components/sidebar-navigation-screen-main/index.js +12 -13
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-item/index.js +2 -2
- package/build/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +42 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +41 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js +47 -92
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +84 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +71 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +63 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +49 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +167 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -0
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js +3 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +58 -8
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +57 -10
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +21 -50
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/index.js +14 -34
- package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/page-details.js +29 -27
- package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/status-label.js +8 -7
- package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pages/index.js +9 -8
- package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/index.js +66 -0
- package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +41 -0
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -0
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +33 -0
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -0
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +40 -0
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -0
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +47 -0
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -0
- package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +82 -0
- package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -0
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +80 -0
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -0
- package/build/components/sidebar-navigation-screen-template/home-template-details.js +212 -0
- package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -0
- package/build/components/sidebar-navigation-screen-template/index.js +21 -7
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates/index.js +11 -11
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/site-hub/index.js +10 -12
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/style-book/index.js +10 -11
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +14 -4
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +4 -4
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-path-with-url.js +12 -2
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build/components/table/index.js +29 -0
- package/build/components/table/index.js.map +1 -0
- package/build/components/template-part-converter/convert-to-template-part.js +3 -21
- package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build/components/welcome-guide/editor.js +1 -1
- package/build/components/welcome-guide/editor.js.map +1 -1
- package/build/components/welcome-guide/styles.js +4 -3
- package/build/components/welcome-guide/styles.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +212 -0
- package/build/hooks/commands/use-common-commands.js.map +1 -0
- package/build/hooks/commands/use-edit-mode-commands.js +196 -24
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/hooks/index.js +2 -0
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/navigation-menu-edit.js +95 -0
- package/build/hooks/navigation-menu-edit.js.map +1 -0
- package/build/hooks/push-changes-to-global-styles/index.js +5 -3
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/hooks/template-part-edit.js +6 -9
- package/build/hooks/template-part-edit.js.map +1 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/{private-apis.js → lock-unlock.js} +1 -1
- package/build/lock-unlock.js.map +1 -0
- package/build/store/actions.js +45 -9
- package/build/store/actions.js.map +1 -1
- package/build/store/index.js +3 -3
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js +7 -6
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +42 -17
- package/build/store/selectors.js.map +1 -1
- package/build/utils/get-is-list-page.js +12 -5
- package/build/utils/get-is-list-page.js.map +1 -1
- package/build/utils/is-previewing-theme.js +2 -2
- package/build/utils/is-previewing-theme.js.map +1 -1
- package/build/utils/use-activate-theme.js +3 -3
- package/build/utils/use-activate-theme.js.map +1 -1
- package/build/utils/use-debounced-input.js +26 -0
- package/build/utils/use-debounced-input.js.map +1 -0
- package/build-module/components/add-new-pattern/index.js +82 -0
- package/build-module/components/add-new-pattern/index.js.map +1 -0
- package/build-module/components/add-new-template/add-custom-template-modal-content.js +7 -20
- package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/index.js +2 -8
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +76 -22
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/app/index.js +1 -1
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/back-button.js +4 -2
- package/build-module/components/block-editor/back-button.js.map +1 -1
- package/build-module/components/block-editor/constants.js +2 -0
- package/build-module/components/block-editor/constants.js.map +1 -0
- package/build-module/components/block-editor/editor-canvas.js +6 -5
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/get-block-editor-provider.js +31 -0
- package/build-module/components/block-editor/get-block-editor-provider.js.map +1 -0
- package/build-module/components/block-editor/index.js +9 -127
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/block-editor/providers/default-block-editor-provider.js +42 -0
- package/build-module/components/block-editor/providers/default-block-editor-provider.js.map +1 -0
- package/build-module/components/block-editor/providers/navigation-block-editor-provider.js +102 -0
- package/build-module/components/block-editor/providers/navigation-block-editor-provider.js.map +1 -0
- package/build-module/components/block-editor/site-editor-canvas.js +115 -0
- package/build-module/components/block-editor/site-editor-canvas.js.map +1 -0
- package/build-module/components/block-editor/use-site-editor-settings.js +67 -0
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -0
- package/build-module/components/canvas-spinner/index.js +15 -1
- package/build-module/components/canvas-spinner/index.js.map +1 -1
- package/build-module/components/create-pattern-modal/index.js +113 -0
- package/build-module/components/create-pattern-modal/index.js.map +1 -0
- package/build-module/components/create-template-part-modal/index.js +47 -7
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/editor/index.js +24 -13
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +19 -2
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/global-styles/color-indicator-wrapper.js +4 -4
- package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +1 -1
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +1 -1
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +10 -15
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +1 -1
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/icon-with-current-color.js +4 -4
- package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build-module/components/global-styles/navigation-button.js +10 -8
- package/build-module/components/global-styles/navigation-button.js.map +1 -1
- package/build-module/components/global-styles/palette.js +2 -2
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preview.js +1 -1
- package/build-module/components/global-styles/preview.js.map +1 -1
- package/build-module/components/global-styles/root-menu.js +1 -1
- package/build-module/components/global-styles/root-menu.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +1 -1
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +1 -1
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +1 -1
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js +1 -1
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-layout.js +1 -1
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +1 -1
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +1 -1
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +11 -3
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +1 -1
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-preview.js +1 -1
- package/build-module/components/global-styles/typography-preview.js.map +1 -1
- package/build-module/components/global-styles/ui.js +94 -35
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles-renderer/index.js +1 -1
- package/build-module/components/global-styles-renderer/index.js.map +1 -1
- package/build-module/components/header-edit-mode/document-actions/index.js +55 -22
- package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +42 -17
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +35 -3
- package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js +4 -4
- package/build-module/components/header-edit-mode/plugin-sidebar-more-menu-item/index.js.map +1 -1
- package/build-module/components/header-edit-mode/undo-redo/redo.js +2 -3
- package/build-module/components/header-edit-mode/undo-redo/redo.js.map +1 -1
- package/build-module/components/header-edit-mode/undo-redo/undo.js +2 -3
- package/build-module/components/header-edit-mode/undo-redo/undo.js.map +1 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js +2 -1
- package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/edit-mode.js +36 -3
- package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +7 -2
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/register.js +10 -1
- package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
- package/build-module/components/layout/hooks.js +21 -0
- package/build-module/components/layout/hooks.js.map +1 -1
- package/build-module/components/layout/index.js +119 -28
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/list/index.js +1 -1
- package/build-module/components/list/index.js.map +1 -1
- package/build-module/components/page/header.js +33 -0
- package/build-module/components/page/header.js.map +1 -0
- package/build-module/components/page/index.js +37 -0
- package/build-module/components/page/index.js.map +1 -0
- package/build-module/components/page-content-focus-manager/back-to-page-notification.js +59 -0
- package/build-module/components/page-content-focus-manager/back-to-page-notification.js.map +1 -0
- package/build-module/components/page-content-focus-manager/constants.js +2 -0
- package/build-module/components/page-content-focus-manager/constants.js.map +1 -0
- package/build-module/components/{page-content-lock/use-disable-non-content-blocks.js → page-content-focus-manager/disable-non-page-content-blocks.js} +18 -9
- package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +1 -0
- package/build-module/components/page-content-focus-manager/edit-template-notification.js +110 -0
- package/build-module/components/page-content-focus-manager/edit-template-notification.js.map +1 -0
- package/build-module/components/page-content-focus-manager/index.js +23 -0
- package/build-module/components/page-content-focus-manager/index.js.map +1 -0
- package/build-module/components/page-library/grid-item.js +149 -0
- package/build-module/components/page-library/grid-item.js.map +1 -0
- package/build-module/components/page-library/grid.js +38 -0
- package/build-module/components/page-library/grid.js.map +1 -0
- package/build-module/components/page-library/index.js +43 -0
- package/build-module/components/page-library/index.js.map +1 -0
- package/build-module/components/page-library/no-patterns.js +12 -0
- package/build-module/components/page-library/no-patterns.js.map +1 -0
- package/build-module/components/page-library/patterns-list.js +87 -0
- package/build-module/components/page-library/patterns-list.js.map +1 -0
- package/build-module/components/page-library/search-items.js +156 -0
- package/build-module/components/page-library/search-items.js.map +1 -0
- package/build-module/components/page-library/use-library-settings.js +40 -0
- package/build-module/components/page-library/use-library-settings.js.map +1 -0
- package/build-module/components/page-library/use-patterns.js +176 -0
- package/build-module/components/page-library/use-patterns.js.map +1 -0
- package/build-module/components/page-library/utils.js +13 -0
- package/build-module/components/page-library/utils.js.map +1 -0
- package/build-module/components/page-main/index.js +32 -0
- package/build-module/components/page-main/index.js.map +1 -0
- package/build-module/components/page-templates/index.js +80 -0
- package/build-module/components/page-templates/index.js.map +1 -0
- package/build-module/components/preferences-modal/enable-feature.js +9 -5
- package/build-module/components/preferences-modal/enable-feature.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +27 -0
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/resizable-frame/index.js +5 -3
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/revisions/index.js +1 -1
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/routes/link.js +6 -6
- package/build-module/components/routes/link.js.map +1 -1
- package/build-module/components/routes/use-title.js +1 -1
- package/build-module/components/routes/use-title.js.map +1 -1
- package/build-module/components/save-button/index.js +15 -11
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-hub/index.js +1 -1
- package/build-module/components/save-hub/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +3 -4
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +4 -5
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +44 -10
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
- package/build-module/components/sidebar/index.js +10 -7
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-button/index.js +2 -3
- package/build-module/components/sidebar-button/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +19 -6
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +8 -6
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js +71 -0
- package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/page-panels/index.js +51 -40
- package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +23 -0
- package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +176 -0
- package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +33 -0
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/page-panels/publish-date.js +85 -0
- package/build-module/components/sidebar-edit-mode/page-panels/publish-date.js.map +1 -0
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +4 -4
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/settings-header/index.js +20 -7
- package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +1 -1
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/index.js +9 -6
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-item/index.js +11 -7
- package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +24 -9
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js +27 -0
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-details-panel/index.js +30 -0
- package/build-module/components/sidebar-navigation-screen-details-panel/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +14 -0
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +24 -0
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +14 -0
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +23 -11
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-library/category-item.js +37 -0
- package/build-module/components/sidebar-navigation-screen-library/category-item.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-library/index.js +87 -0
- package/build-module/components/sidebar-navigation-screen-library/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-library/use-default-pattern-categories.js +25 -0
- package/build-module/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-library/use-pattern-categories.js +61 -0
- package/build-module/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-library/use-template-part-areas.js +34 -0
- package/build-module/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-library/use-theme-patterns.js +27 -0
- package/build-module/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-main/index.js +13 -13
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +33 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +26 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +45 -90
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +70 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +58 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +56 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +35 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +155 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js +3 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/constants.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +57 -9
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +55 -7
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +22 -50
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/index.js +14 -34
- package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/page-details.js +28 -28
- package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/status-label.js +9 -8
- package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pages/index.js +8 -6
- package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/index.js +46 -0
- package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +28 -0
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +22 -0
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +27 -0
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +34 -0
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +71 -0
- package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +64 -0
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-template/home-template-details.js +192 -0
- package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-template/index.js +18 -6
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates/index.js +11 -10
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +8 -9
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/style-book/index.js +9 -9
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +13 -3
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +11 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build-module/components/table/index.js +21 -0
- package/build-module/components/table/index.js.map +1 -0
- package/build-module/components/template-part-converter/convert-to-template-part.js +4 -20
- package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build-module/components/welcome-guide/editor.js +1 -1
- package/build-module/components/welcome-guide/editor.js.map +1 -1
- package/build-module/components/welcome-guide/styles.js +5 -3
- package/build-module/components/welcome-guide/styles.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +194 -0
- package/build-module/hooks/commands/use-common-commands.js.map +1 -0
- package/build-module/hooks/commands/use-edit-mode-commands.js +196 -26
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/hooks/index.js +1 -0
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/navigation-menu-edit.js +77 -0
- package/build-module/hooks/navigation-menu-edit.js.map +1 -0
- package/build-module/hooks/push-changes-to-global-styles/index.js +4 -2
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/hooks/template-part-edit.js +5 -5
- package/build-module/hooks/template-part-edit.js.map +1 -1
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/{private-apis.js → lock-unlock.js} +1 -1
- package/build-module/lock-unlock.js.map +1 -0
- package/build-module/store/actions.js +39 -7
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/index.js +1 -1
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/reducer.js +6 -5
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +37 -15
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/get-is-list-page.js +12 -5
- package/build-module/utils/get-is-list-page.js.map +1 -1
- package/build-module/utils/is-previewing-theme.js +2 -2
- package/build-module/utils/is-previewing-theme.js.map +1 -1
- package/build-module/utils/use-activate-theme.js +2 -2
- package/build-module/utils/use-activate-theme.js.map +1 -1
- package/build-module/utils/use-debounced-input.js +17 -0
- package/build-module/utils/use-debounced-input.js.map +1 -0
- package/build-style/style-rtl.css +424 -38
- package/build-style/style.css +424 -38
- package/package.json +44 -40
- package/src/components/add-new-pattern/index.js +92 -0
- package/src/components/add-new-template/add-custom-template-modal-content.js +1 -13
- package/src/components/add-new-template/index.js +0 -3
- package/src/components/add-new-template/new-template.js +121 -26
- package/src/components/add-new-template/style.scss +30 -2
- package/src/components/app/index.js +1 -1
- package/src/components/block-editor/back-button.js +5 -2
- package/src/components/block-editor/constants.js +1 -0
- package/src/components/block-editor/editor-canvas.js +1 -1
- package/src/components/block-editor/get-block-editor-provider.js +29 -0
- package/src/components/block-editor/index.js +15 -199
- package/src/components/block-editor/providers/default-block-editor-provider.js +44 -0
- package/src/components/block-editor/providers/navigation-block-editor-provider.js +114 -0
- package/src/components/block-editor/site-editor-canvas.js +155 -0
- package/src/components/block-editor/style.scss +6 -0
- package/src/components/block-editor/use-site-editor-settings.js +91 -0
- package/src/components/canvas-spinner/index.js +11 -1
- package/src/components/create-pattern-modal/index.js +134 -0
- package/src/components/create-pattern-modal/style.scss +3 -0
- package/src/components/create-template-part-modal/index.js +64 -4
- package/src/components/editor/index.js +25 -15
- package/src/components/editor/style.scss +4 -0
- package/src/components/editor-canvas-container/index.js +21 -4
- package/src/components/global-styles/color-palette-panel.js +1 -1
- package/src/components/global-styles/dimensions-panel.js +1 -1
- package/src/components/global-styles/global-styles-provider.js +10 -14
- package/src/components/global-styles/gradients-palette-panel.js +1 -1
- package/src/components/global-styles/hooks.js +1 -1
- package/src/components/global-styles/palette.js +2 -2
- package/src/components/global-styles/preview.js +1 -1
- package/src/components/global-styles/root-menu.js +1 -1
- package/src/components/global-styles/screen-block-list.js +1 -1
- package/src/components/global-styles/screen-block.js +1 -1
- package/src/components/global-styles/screen-colors.js +1 -1
- package/src/components/global-styles/screen-css.js +1 -1
- package/src/components/global-styles/screen-layout.js +1 -1
- package/src/components/global-styles/screen-revisions/index.js +1 -1
- package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -1
- package/src/components/global-styles/screen-root.js +1 -1
- package/src/components/global-styles/screen-typography.js +1 -1
- package/src/components/global-styles/stories/index.js +1 -1
- package/src/components/global-styles/style-variations-container.js +13 -3
- package/src/components/global-styles/style.scss +11 -0
- package/src/components/global-styles/typography-panel.js +1 -1
- package/src/components/global-styles/typography-preview.js +1 -1
- package/src/components/global-styles/ui.js +115 -46
- package/src/components/global-styles-renderer/index.js +1 -1
- package/src/components/header-edit-mode/document-actions/index.js +51 -26
- package/src/components/header-edit-mode/document-actions/style.scss +9 -5
- package/src/components/header-edit-mode/index.js +100 -58
- package/src/components/header-edit-mode/more-menu/index.js +52 -7
- package/src/components/keyboard-shortcuts/edit-mode.js +40 -3
- package/src/components/keyboard-shortcuts/index.js +5 -1
- package/src/components/keyboard-shortcuts/register.js +11 -1
- package/src/components/layout/hooks.js +21 -0
- package/src/components/layout/index.js +207 -110
- package/src/components/layout/style.scss +65 -1
- package/src/components/list/index.js +1 -1
- package/src/components/page/header.js +38 -0
- package/src/components/page/index.js +38 -0
- package/src/components/page/style.scss +38 -0
- package/src/components/page-content-focus-manager/back-to-page-notification.js +70 -0
- package/src/components/{page-content-lock → page-content-focus-manager}/constants.js +1 -1
- package/src/components/{page-content-lock/use-disable-non-content-blocks.js → page-content-focus-manager/disable-non-page-content-blocks.js} +15 -7
- package/src/components/page-content-focus-manager/edit-template-notification.js +108 -0
- package/src/components/page-content-focus-manager/index.js +26 -0
- package/src/components/page-library/grid-item.js +179 -0
- package/src/components/page-library/grid.js +39 -0
- package/src/components/page-library/index.js +39 -0
- package/src/components/page-library/no-patterns.js +12 -0
- package/src/components/page-library/patterns-list.js +114 -0
- package/src/components/page-library/search-items.js +171 -0
- package/src/components/page-library/style.scss +105 -0
- package/src/components/page-library/use-library-settings.js +51 -0
- package/src/components/page-library/use-patterns.js +238 -0
- package/src/components/page-library/utils.js +21 -0
- package/src/components/page-main/index.js +27 -0
- package/src/components/page-templates/index.js +104 -0
- package/src/components/preferences-modal/enable-feature.js +5 -2
- package/src/components/preferences-modal/index.js +25 -0
- package/src/components/resizable-frame/index.js +3 -1
- package/src/components/revisions/index.js +1 -1
- package/src/components/routes/link.js +2 -2
- package/src/components/routes/use-title.js +1 -1
- package/src/components/save-button/index.js +14 -11
- package/src/components/save-hub/index.js +1 -1
- package/src/components/save-panel/index.js +1 -1
- package/src/components/secondary-sidebar/list-view-sidebar.js +53 -6
- package/src/components/sidebar/index.js +11 -7
- package/src/components/sidebar-button/style.scss +1 -1
- package/src/components/sidebar-edit-mode/global-styles-sidebar.js +42 -29
- package/src/components/sidebar-edit-mode/index.js +8 -6
- package/src/components/sidebar-edit-mode/page-panels/edit-template.js +69 -0
- package/src/components/sidebar-edit-mode/page-panels/index.js +53 -53
- package/src/components/sidebar-edit-mode/page-panels/page-content.js +27 -0
- package/src/components/sidebar-edit-mode/page-panels/page-status.js +233 -0
- package/src/components/sidebar-edit-mode/page-panels/page-summary.js +35 -0
- package/src/components/sidebar-edit-mode/page-panels/publish-date.js +94 -0
- package/src/components/sidebar-edit-mode/page-panels/style.scss +31 -0
- package/src/components/sidebar-edit-mode/settings-header/index.js +18 -9
- package/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js +1 -1
- package/src/components/sidebar-edit-mode/template-panel/index.js +9 -6
- package/src/components/sidebar-navigation-item/index.js +6 -2
- package/src/components/sidebar-navigation-item/style.scss +8 -1
- package/src/components/sidebar-navigation-screen/index.js +22 -8
- package/src/components/sidebar-navigation-screen/style.scss +30 -9
- package/src/components/sidebar-navigation-screen-details-footer/index.js +45 -0
- package/src/components/sidebar-navigation-screen-details-footer/style.scss +5 -0
- package/src/components/sidebar-navigation-screen-details-panel/index.js +40 -0
- package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +14 -0
- package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +29 -0
- package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +14 -0
- package/src/components/sidebar-navigation-screen-details-panel/style.scss +25 -0
- package/src/components/sidebar-navigation-screen-global-styles/index.js +24 -6
- package/src/components/sidebar-navigation-screen-global-styles/style.scss +0 -3
- package/src/components/sidebar-navigation-screen-library/category-item.js +43 -0
- package/src/components/sidebar-navigation-screen-library/index.js +136 -0
- package/src/components/sidebar-navigation-screen-library/style.scss +3 -0
- package/src/components/sidebar-navigation-screen-library/use-default-pattern-categories.js +32 -0
- package/src/components/sidebar-navigation-screen-library/use-pattern-categories.js +64 -0
- package/src/components/sidebar-navigation-screen-library/use-template-part-areas.js +33 -0
- package/src/components/sidebar-navigation-screen-library/use-theme-patterns.js +44 -0
- package/src/components/sidebar-navigation-screen-main/index.js +11 -14
- package/src/components/sidebar-navigation-screen-navigation-item/index.js +1 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +45 -0
- package/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js +24 -0
- package/src/components/sidebar-navigation-screen-navigation-menu/index.js +50 -96
- package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +89 -0
- package/src/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +51 -0
- package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +62 -0
- package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +39 -0
- package/src/components/sidebar-navigation-screen-navigation-menu/style.scss +15 -0
- package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +179 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/constants.js +3 -1
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +73 -14
- package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +61 -2
- package/src/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +25 -47
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +4 -0
- package/src/components/sidebar-navigation-screen-page/index.js +19 -58
- package/src/components/sidebar-navigation-screen-page/page-details.js +42 -39
- package/src/components/sidebar-navigation-screen-page/status-label.js +23 -19
- package/src/components/sidebar-navigation-screen-page/style.scss +1 -18
- package/src/components/sidebar-navigation-screen-pages/index.js +30 -29
- package/src/components/sidebar-navigation-screen-pattern/index.js +44 -0
- package/src/components/sidebar-navigation-screen-pattern/style.scss +25 -0
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +28 -0
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +21 -0
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +30 -0
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +33 -0
- package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +71 -0
- package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +86 -0
- package/src/components/sidebar-navigation-screen-template/home-template-details.js +230 -0
- package/src/components/sidebar-navigation-screen-template/index.js +19 -5
- package/src/components/sidebar-navigation-screen-template/style.scss +37 -14
- package/src/components/sidebar-navigation-screen-templates/index.js +18 -25
- package/src/components/site-hub/index.js +13 -9
- package/src/components/site-hub/style.scss +4 -3
- package/src/components/style-book/index.js +1 -1
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +16 -3
- package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +1 -1
- package/src/components/sync-state-with-url/use-sync-path-with-url.js +11 -1
- package/src/components/table/index.js +33 -0
- package/src/components/table/style.scss +37 -0
- package/src/components/template-part-converter/convert-to-template-part.js +4 -27
- package/src/components/welcome-guide/editor.js +1 -1
- package/src/components/welcome-guide/styles.js +5 -3
- package/src/hooks/commands/use-common-commands.js +186 -0
- package/src/hooks/commands/use-edit-mode-commands.js +183 -28
- package/src/hooks/index.js +1 -0
- package/src/hooks/navigation-menu-edit.js +95 -0
- package/src/hooks/push-changes-to-global-styles/index.js +1 -1
- package/src/hooks/template-part-edit.js +1 -1
- package/src/index.js +1 -0
- package/src/store/actions.js +40 -8
- package/src/store/index.js +1 -1
- package/src/store/reducer.js +6 -5
- package/src/store/selectors.js +39 -9
- package/src/store/test/actions.js +8 -8
- package/src/store/test/reducer.js +11 -11
- package/src/store/test/selectors.js +10 -8
- package/src/style.scss +13 -2
- package/src/utils/get-is-list-page.js +16 -4
- package/src/utils/is-previewing-theme.js +4 -2
- package/src/utils/use-activate-theme.js +3 -2
- package/src/utils/use-debounced-input.js +17 -0
- package/build/components/add-new-template/new-template-part.js +0 -113
- package/build/components/add-new-template/new-template-part.js.map +0 -1
- package/build/components/page-content-lock/constants.js +0 -9
- package/build/components/page-content-lock/constants.js.map +0 -1
- package/build/components/page-content-lock/index.js +0 -29
- package/build/components/page-content-lock/index.js.map +0 -1
- package/build/components/page-content-lock/use-disable-non-content-blocks.js +0 -49
- package/build/components/page-content-lock/use-disable-non-content-blocks.js.map +0 -1
- package/build/components/page-content-lock/use-page-content-lock-notifications.js +0 -112
- package/build/components/page-content-lock/use-page-content-lock-notifications.js.map +0 -1
- package/build/components/sidebar-edit-mode/page-panels/content-blocks-list.js +0 -79
- package/build/components/sidebar-edit-mode/page-panels/content-blocks-list.js.map +0 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +0 -52
- package/build/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +0 -1
- package/build/components/sidebar-navigation-screen-template-part/index.js +0 -105
- package/build/components/sidebar-navigation-screen-template-part/index.js.map +0 -1
- package/build/components/sidebar-navigation-subtitle/index.js +0 -17
- package/build/components/sidebar-navigation-subtitle/index.js.map +0 -1
- package/build/private-apis.js.map +0 -1
- package/build-module/components/add-new-template/new-template-part.js +0 -93
- package/build-module/components/add-new-template/new-template-part.js.map +0 -1
- package/build-module/components/page-content-lock/constants.js +0 -2
- package/build-module/components/page-content-lock/constants.js.map +0 -1
- package/build-module/components/page-content-lock/index.js +0 -14
- package/build-module/components/page-content-lock/index.js.map +0 -1
- package/build-module/components/page-content-lock/use-disable-non-content-blocks.js.map +0 -1
- package/build-module/components/page-content-lock/use-page-content-lock-notifications.js +0 -98
- package/build-module/components/page-content-lock/use-page-content-lock-notifications.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/page-panels/content-blocks-list.js +0 -67
- package/build-module/components/sidebar-edit-mode/page-panels/content-blocks-list.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +0 -39
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigator-button.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-template-part/index.js +0 -86
- package/build-module/components/sidebar-navigation-screen-template-part/index.js.map +0 -1
- package/build-module/components/sidebar-navigation-subtitle/index.js +0 -9
- package/build-module/components/sidebar-navigation-subtitle/index.js.map +0 -1
- package/build-module/private-apis.js.map +0 -1
- package/src/components/add-new-template/new-template-part.js +0 -109
- package/src/components/page-content-lock/index.js +0 -14
- package/src/components/page-content-lock/use-page-content-lock-notifications.js +0 -128
- package/src/components/sidebar-edit-mode/page-panels/content-blocks-list.js +0 -77
- package/src/components/sidebar-navigation-screen-navigation-menus/navigator-button.js +0 -47
- package/src/components/sidebar-navigation-screen-template-part/index.js +0 -103
- package/src/components/sidebar-navigation-screen-templates/style.scss +0 -4
- package/src/components/sidebar-navigation-subtitle/index.js +0 -5
- package/src/components/sidebar-navigation-subtitle/style.scss +0 -7
- /package/src/{private-apis.js → lock-unlock.js} +0 -0
|
@@ -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,CAFF;AAOCY,EAAAA,KAAK,EAAE;AAPR,CADsB,EAUtB;AACCD,EAAAA,KAAK,EACJ,8BACGX,EAAE,CAAE,SAAF,CADL,EAEC,cAAC,IAAD;AAAM,IAAA,OAAO,EAAC;AAAd,KACGA,EAAE,CAAE,uCAAF,CADL,CAFD,CAFF;AASCY,EAAAA,KAAK,EAAE;AATR,CAVsB,EAqBtB;AACCD,EAAAA,KAAK,EACJ,8BACGX,EAAE,CAAE,SAAF,CADL,EAEC,cAAC,IAAD;AAAM,IAAA,OAAO,EAAC;AAAd,KACGA,EAAE,CAAE,0CAAF,CADL,CAFD,CAFF;AASCY,EAAAA,KAAK,EAAE;AATR,CArBsB,EAgCtB;AACCD,EAAAA,KAAK,EACJ,8BACGX,EAAE,CAAE,WAAF,CADL,EAEC,cAAC,IAAD;AAAM,IAAA,OAAO,EAAC;AAAd,KACGA,EAAE,CAAE,yCAAF,CADL,CAFD,CAFF;AASCY,EAAAA,KAAK,EAAE;AATR,CAhCsB,EA2CtB;AACCD,EAAAA,KAAK,EACJ,8BACGX,EAAE,CAAE,WAAF,CADL,EAEC,cAAC,IAAD;AAAM,IAAA,OAAO,EAAC;AAAd,KAAwBA,EAAE,CAAE,sBAAF,CAA1B,CAFD,CAFF;AAOCY,EAAAA,KAAK,EAAE;AAPR,CA3CsB,CAAvB;AAsDA,eAAe,SAASC,UAAT,CAAqB;AACnCC,EAAAA,QADmC;AAEnCC,EAAAA,MAFmC;AAGnCC,EAAAA,MAHmC;AAInCC,EAAAA,QAJmC;AAKnCC,EAAAA;AALmC,CAArB,EAMX;AACH,QAAM,CAAEC,YAAF,EAAgBC,eAAhB,IAAoClB,QAAQ,CAAE,CAAC,CAAEe,QAAL,CAAlD;AAEA,QAAM;AAAEI,IAAAA;AAAF,MAAuBpB,WAAW,CAAEI,SAAF,CAAxC;AACA,QAAM;AAAEiB,IAAAA;AAAF,MAAwBrB,WAAW,CAAEK,YAAF,CAAzC;AAEA,QAAM,CAAEiB,aAAF,EAAiBC,gBAAjB,IAAsCtB,QAAQ,CAAE,IAAF,CAApD,CANG,CAOH;;AACA,QAAMuB,YAAY,GAAGtB,OAAO,CAC3B,OAAQ;AACP;AACA;AACAuB,IAAAA,MAAM,EAAEH,aAHD;AAIP,kBAAcvB,EAAE,CAAE,eAAF,CAJT;AAKP2B,IAAAA,SAAS,EAAE;AALJ,GAAR,CAD2B,EAQ3B,CAAEJ,aAAF,CAR2B,CAA5B;;AAWA,QAAMK,UAAU,GAAG,OAAQ;AAC1BZ,IAAAA,MAAM,EAAEa,SAAS,GAAGb,MADM;AAE1BC,IAAAA,QAAQ,EAAEa,WAAW,GAAGb,QAFE;AAG1BC,IAAAA,IAAI,EAAEa,OAAO,GAAGb;AAHU,GAAR,KAIZ;AACN,QAAI;AACH,YAAMG,gBAAgB,CAAE,UAAF,EAAcP,QAAd,EAAwBC,MAAxB,EAAgC;AACrDC,QAAAA,MAAM,EAAEa,SAD6C;AAErDX,QAAAA,IAAI,EAAEa,OAF+C;AAGrDd,QAAAA,QAAQ,EAAEa;AAH2C,OAAhC,CAAtB;AAKA,KAND,CAME,OAAQE,KAAR,EAAgB;AACjB,YAAMC,YAAY,GACjBD,KAAK,CAACE,OAAN,IAAiBF,KAAK,CAACG,IAAN,KAAe,eAAhC,GACGH,KAAK,CAACE,OADT,GAEGlC,EAAE,CAAE,6CAAF,CAHN;AAKAsB,MAAAA,iBAAiB,CAAEW,YAAF,EAAgB;AAChCG,QAAAA,IAAI,EAAE;AAD0B,OAAhB,CAAjB;AAGA;AACD,GArBD;;AAuBA,QAAMC,oBAAoB,GAAKzB,KAAF,IAAa;AACzCQ,IAAAA,eAAe,CAAER,KAAF,CAAf;;AACA,QAAK,CAAEA,KAAP,EAAe;AACdgB,MAAAA,UAAU,CAAE;AAAEX,QAAAA,QAAQ,EAAE;AAAZ,OAAF,CAAV;AACA;AACD,GALD;;AAOA,QAAMqB,YAAY,GAAK1B,KAAF,IAAa;AACjC,QAAImB,OAAO,GAAGb,IAAd;AACA,QAAIY,WAAW,GAAGb,QAAlB;;AACA,QAAKL,KAAK,KAAK,SAAf,EAA2B;AAC1B,UAAK,IAAI2B,IAAJ,CAAUrB,IAAV,IAAmB,IAAIqB,IAAJ,EAAxB,EAAqC;AACpCR,QAAAA,OAAO,GAAG,IAAV;AACA;AACD,KAJD,MAIO,IAAKnB,KAAK,KAAK,QAAf,EAA0B;AAChC,UAAK,CAAEM,IAAF,IAAU,IAAIqB,IAAJ,CAAUrB,IAAV,IAAmB,IAAIqB,IAAJ,EAAlC,EAA+C;AAC9CR,QAAAA,OAAO,GAAG,IAAIQ,IAAJ,EAAV;AACAR,QAAAA,OAAO,CAACS,OAAR,CAAiBT,OAAO,CAACU,OAAR,KAAoB,CAArC;AACA;AACD,KALM,MAKA,IAAK7B,KAAK,KAAK,SAAV,IAAuBK,QAA5B,EAAuC;AAC7CG,MAAAA,eAAe,CAAE,KAAF,CAAf;AACAU,MAAAA,WAAW,GAAG,EAAd;AACA;;AACDF,IAAAA,UAAU,CAAE;AACXZ,MAAAA,MAAM,EAAEJ,KADG;AAEXM,MAAAA,IAAI,EAAEa,OAFK;AAGXd,MAAAA,QAAQ,EAAEa;AAHC,KAAF,CAAV;AAKA,GArBD;;AAuBA,SACC,cAAC,MAAD;AAAQ,IAAA,SAAS,EAAC;AAAlB,KACC,cAAC,IAAD;AAAM,IAAA,SAAS,EAAC;AAAhB,KACG9B,EAAE,CAAE,QAAF,CADL,CADD,EAIC,cAAC,QAAD;AACC,IAAA,gBAAgB,EAAC,kCADlB;AAEC,IAAA,YAAY,EAAGyB,YAFhB;AAGC,IAAA,YAAY,MAHb;AAIC,IAAA,GAAG,EAAGD,gBAJP;AAKC,IAAA,YAAY,EAAG,CAAE;AAAEkB,MAAAA;AAAF,KAAF,KACd,cAAC,MAAD;AACC,MAAA,SAAS,EAAC,kCADX;AAEC,MAAA,OAAO,EAAC,UAFT;AAGC,MAAA,OAAO,EAAGA;AAHX,OAKC,cAAC,WAAD;AACC,MAAA,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":"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","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tDropdown,\n\t__experimentalText as Text,\n\t__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
|
/**
|
|
@@ -82,11 +81,12 @@ export default function PluginSidebarEditSite({
|
|
|
82
81
|
...props
|
|
83
82
|
}) {
|
|
84
83
|
const showIconLabels = useSelect(select => select(editSiteStore).getSettings().showIconLabels, []);
|
|
85
|
-
return createElement(ComplementaryArea,
|
|
84
|
+
return createElement(ComplementaryArea, {
|
|
86
85
|
panelClassName: className,
|
|
87
86
|
className: "edit-site-sidebar-edit-mode",
|
|
88
87
|
scope: "core/edit-site",
|
|
89
|
-
showIconLabels: showIconLabels
|
|
90
|
-
|
|
88
|
+
showIconLabels: showIconLabels,
|
|
89
|
+
...props
|
|
90
|
+
});
|
|
91
91
|
}
|
|
92
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"]}
|
|
@@ -9,7 +9,7 @@ import classnames from 'classnames';
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import { Button } from '@wordpress/components';
|
|
12
|
-
import { __ } from '@wordpress/i18n';
|
|
12
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
13
13
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
14
14
|
import { store as interfaceStore } from '@wordpress/interface';
|
|
15
15
|
/**
|
|
@@ -23,7 +23,20 @@ import { store as editSiteStore } from '../../../store';
|
|
|
23
23
|
const SettingsHeader = ({
|
|
24
24
|
sidebarName
|
|
25
25
|
}) => {
|
|
26
|
-
const
|
|
26
|
+
const {
|
|
27
|
+
hasPageContentFocus,
|
|
28
|
+
entityType
|
|
29
|
+
} = useSelect(select => {
|
|
30
|
+
const {
|
|
31
|
+
getEditedPostType,
|
|
32
|
+
hasPageContentFocus: _hasPageContentFocus
|
|
33
|
+
} = select(editSiteStore);
|
|
34
|
+
return {
|
|
35
|
+
hasPageContentFocus: _hasPageContentFocus(),
|
|
36
|
+
entityType: getEditedPostType()
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
const entityLabel = entityType === 'wp_navigation' ? __('Navigation') : __('Template');
|
|
27
40
|
const {
|
|
28
41
|
enableComplementaryArea
|
|
29
42
|
} = useDispatch(interfaceStore);
|
|
@@ -34,14 +47,14 @@ const SettingsHeader = ({
|
|
|
34
47
|
|
|
35
48
|
let templateAriaLabel;
|
|
36
49
|
|
|
37
|
-
if (
|
|
50
|
+
if (hasPageContentFocus) {
|
|
38
51
|
templateAriaLabel = sidebarName === SIDEBAR_TEMPLATE ? // translators: ARIA label for the Template sidebar tab, selected.
|
|
39
52
|
__('Page (selected)') : // translators: ARIA label for the Template Settings Sidebar tab, not selected.
|
|
40
53
|
__('Page');
|
|
41
54
|
} else {
|
|
42
55
|
templateAriaLabel = sidebarName === SIDEBAR_TEMPLATE ? // translators: ARIA label for the Template sidebar tab, selected.
|
|
43
|
-
__('
|
|
44
|
-
|
|
56
|
+
sprintf(__('%s (selected)'), entityLabel) : // translators: ARIA label for the Template Settings Sidebar tab, not selected.
|
|
57
|
+
entityLabel;
|
|
45
58
|
}
|
|
46
59
|
/* Use a list so screen readers will announce how many tabs there are. */
|
|
47
60
|
|
|
@@ -52,8 +65,8 @@ const SettingsHeader = ({
|
|
|
52
65
|
'is-active': sidebarName === SIDEBAR_TEMPLATE
|
|
53
66
|
}),
|
|
54
67
|
"aria-label": templateAriaLabel,
|
|
55
|
-
"data-label":
|
|
56
|
-
},
|
|
68
|
+
"data-label": hasPageContentFocus ? __('Page') : entityLabel
|
|
69
|
+
}, hasPageContentFocus ? __('Page') : entityLabel)), createElement("li", null, createElement(Button, {
|
|
57
70
|
onClick: openBlockSettings,
|
|
58
71
|
className: classnames('edit-site-sidebar-edit-mode__panel-tab', {
|
|
59
72
|
'is-active': sidebarName === SIDEBAR_BLOCK
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/settings-header/index.js"],"names":["classnames","Button","__","useSelect","useDispatch","store","interfaceStore","STORE_NAME","SIDEBAR_BLOCK","SIDEBAR_TEMPLATE","editSiteStore","SettingsHeader","sidebarName","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/settings-header/index.js"],"names":["classnames","Button","__","sprintf","useSelect","useDispatch","store","interfaceStore","STORE_NAME","SIDEBAR_BLOCK","SIDEBAR_TEMPLATE","editSiteStore","SettingsHeader","sidebarName","hasPageContentFocus","entityType","select","getEditedPostType","_hasPageContentFocus","entityLabel","enableComplementaryArea","openTemplateSettings","openBlockSettings","templateAriaLabel"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SAASC,KAAK,IAAIC,cAAlB,QAAwC,sBAAxC;AAEA;AACA;AACA;;AACA,SAASC,UAAT,QAA2B,0BAA3B;AACA,SAASC,aAAT,EAAwBC,gBAAxB,QAAgD,cAAhD;AACA,SAASJ,KAAK,IAAIK,aAAlB,QAAuC,gBAAvC;;AAEA,MAAMC,cAAc,GAAG,CAAE;AAAEC,EAAAA;AAAF,CAAF,KAAuB;AAC7C,QAAM;AAAEC,IAAAA,mBAAF;AAAuBC,IAAAA;AAAvB,MAAsCX,SAAS,CAAIY,MAAF,IAAc;AACpE,UAAM;AAAEC,MAAAA,iBAAF;AAAqBH,MAAAA,mBAAmB,EAAEI;AAA1C,QACLF,MAAM,CAAEL,aAAF,CADP;AAGA,WAAO;AACNG,MAAAA,mBAAmB,EAAEI,oBAAoB,EADnC;AAENH,MAAAA,UAAU,EAAEE,iBAAiB;AAFvB,KAAP;AAIA,GARoD,CAArD;AAUA,QAAME,WAAW,GAChBJ,UAAU,KAAK,eAAf,GAAiCb,EAAE,CAAE,YAAF,CAAnC,GAAsDA,EAAE,CAAE,UAAF,CADzD;AAGA,QAAM;AAAEkB,IAAAA;AAAF,MAA8Bf,WAAW,CAAEE,cAAF,CAA/C;;AACA,QAAMc,oBAAoB,GAAG,MAC5BD,uBAAuB,CAAEZ,UAAF,EAAcE,gBAAd,CADxB;;AAEA,QAAMY,iBAAiB,GAAG,MACzBF,uBAAuB,CAAEZ,UAAF,EAAcC,aAAd,CADxB;;AAGA,MAAIc,iBAAJ;;AACA,MAAKT,mBAAL,EAA2B;AAC1BS,IAAAA,iBAAiB,GAChBV,WAAW,KAAKH,gBAAhB,GACG;AACAR,IAAAA,EAAE,CAAE,iBAAF,CAFL,GAGG;AACAA,IAAAA,EAAE,CAAE,MAAF,CALN;AAMA,GAPD,MAOO;AACNqB,IAAAA,iBAAiB,GAChBV,WAAW,KAAKH,gBAAhB,GACG;AACAP,IAAAA,OAAO,CAAED,EAAE,CAAE,eAAF,CAAJ,EAAyBiB,WAAzB,CAFV,GAGG;AACAA,IAAAA,WALJ;AAMA;AAED;;;AACA,SACC,0BACC,0BACC,cAAC,MAAD;AACC,IAAA,OAAO,EAAGE,oBADX;AAEC,IAAA,SAAS,EAAGrB,UAAU,CACrB,wCADqB,EAErB;AACC,mBAAaa,WAAW,KAAKH;AAD9B,KAFqB,CAFvB;AAQC,kBAAaa,iBARd;AASC,kBACCT,mBAAmB,GAAGZ,EAAE,CAAE,MAAF,CAAL,GAAkBiB;AAVvC,KAaGL,mBAAmB,GAAGZ,EAAE,CAAE,MAAF,CAAL,GAAkBiB,WAbxC,CADD,CADD,EAkBC,0BACC,cAAC,MAAD;AACC,IAAA,OAAO,EAAGG,iBADX;AAEC,IAAA,SAAS,EAAGtB,UAAU,CACrB,wCADqB,EAErB;AACC,mBAAaa,WAAW,KAAKJ;AAD9B,KAFqB,CAFvB;AAQC,kBACCI,WAAW,KAAKJ,aAAhB,GACG;AACAP,IAAAA,EAAE,CAAE,kBAAF,CAFL,GAGG;AACAA,IAAAA,EAAE,CAAE,OAAF,CAbP;AAeC,kBAAaA,EAAE,CAAE,OAAF;AAfhB,KAiBGA,EAAE,CAAE,OAAF,CAjBL,CADD,CAlBD,CADD;AA0CA,CAhFD;;AAkFA,eAAeU,cAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME } from '../../../store/constants';\nimport { SIDEBAR_BLOCK, SIDEBAR_TEMPLATE } from '../constants';\nimport { store as editSiteStore } from '../../../store';\n\nconst SettingsHeader = ( { sidebarName } ) => {\n\tconst { hasPageContentFocus, entityType } = useSelect( ( select ) => {\n\t\tconst { getEditedPostType, hasPageContentFocus: _hasPageContentFocus } =\n\t\t\tselect( editSiteStore );\n\n\t\treturn {\n\t\t\thasPageContentFocus: _hasPageContentFocus(),\n\t\t\tentityType: getEditedPostType(),\n\t\t};\n\t} );\n\n\tconst entityLabel =\n\t\tentityType === 'wp_navigation' ? __( 'Navigation' ) : __( 'Template' );\n\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\tconst openTemplateSettings = () =>\n\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_TEMPLATE );\n\tconst openBlockSettings = () =>\n\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_BLOCK );\n\n\tlet templateAriaLabel;\n\tif ( hasPageContentFocus ) {\n\t\ttemplateAriaLabel =\n\t\t\tsidebarName === SIDEBAR_TEMPLATE\n\t\t\t\t? // translators: ARIA label for the Template sidebar tab, selected.\n\t\t\t\t __( 'Page (selected)' )\n\t\t\t\t: // translators: ARIA label for the Template Settings Sidebar tab, not selected.\n\t\t\t\t __( 'Page' );\n\t} else {\n\t\ttemplateAriaLabel =\n\t\t\tsidebarName === SIDEBAR_TEMPLATE\n\t\t\t\t? // translators: ARIA label for the Template sidebar tab, selected.\n\t\t\t\t sprintf( __( '%s (selected)' ), entityLabel )\n\t\t\t\t: // translators: ARIA label for the Template Settings Sidebar tab, not selected.\n\t\t\t\t entityLabel;\n\t}\n\n\t/* Use a list so screen readers will announce how many tabs there are. */\n\treturn (\n\t\t<ul>\n\t\t\t<li>\n\t\t\t\t<Button\n\t\t\t\t\tonClick={ openTemplateSettings }\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'edit-site-sidebar-edit-mode__panel-tab',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-active': sidebarName === SIDEBAR_TEMPLATE,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\taria-label={ templateAriaLabel }\n\t\t\t\t\tdata-label={\n\t\t\t\t\t\thasPageContentFocus ? __( 'Page' ) : entityLabel\n\t\t\t\t\t}\n\t\t\t\t>\n\t\t\t\t\t{ hasPageContentFocus ? __( 'Page' ) : entityLabel }\n\t\t\t\t</Button>\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<Button\n\t\t\t\t\tonClick={ openBlockSettings }\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'edit-site-sidebar-edit-mode__panel-tab',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-active': sidebarName === SIDEBAR_BLOCK,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\taria-label={\n\t\t\t\t\t\tsidebarName === SIDEBAR_BLOCK\n\t\t\t\t\t\t\t? // translators: ARIA label for the Block Settings Sidebar tab, selected.\n\t\t\t\t\t\t\t __( 'Block (selected)' )\n\t\t\t\t\t\t\t: // translators: ARIA label for the Block Settings Sidebar tab, not selected.\n\t\t\t\t\t\t\t __( 'Block' )\n\t\t\t\t\t}\n\t\t\t\t\tdata-label={ __( 'Block' ) }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Block' ) }\n\t\t\t\t</Button>\n\t\t\t</li>\n\t\t</ul>\n\t);\n};\n\nexport default SettingsHeader;\n"]}
|
|
@@ -8,7 +8,7 @@ import { privateApis as componentsPrivateApis } from '@wordpress/components';
|
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import { unlock } from '../../
|
|
11
|
+
import { unlock } from '../../lock-unlock';
|
|
12
12
|
const {
|
|
13
13
|
createPrivateSlotFill
|
|
14
14
|
} = unlock(componentsPrivateApis);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js"],"names":["privateApis","componentsPrivateApis","unlock","createPrivateSlotFill","SIDEBAR_FIXED_BOTTOM_SLOT_FILL_NAME","Slot","SidebarFixedBottomSlot","Fill","SidebarFixedBottomFill","SidebarFixedBottom","children"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,qBAAxB,QAAqD,uBAArD;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js"],"names":["privateApis","componentsPrivateApis","unlock","createPrivateSlotFill","SIDEBAR_FIXED_BOTTOM_SLOT_FILL_NAME","Slot","SidebarFixedBottomSlot","Fill","SidebarFixedBottomFill","SidebarFixedBottom","children"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,qBAAxB,QAAqD,uBAArD;AAEA;AACA;AACA;;AACA,SAASC,MAAT,QAAuB,mBAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAA4BD,MAAM,CAAED,qBAAF,CAAxC;AACA,MAAMG,mCAAmC,GAAG,oBAA5C;AACA,MAAM;AAAEC,EAAAA,IAAI,EAAEC,sBAAR;AAAgCC,EAAAA,IAAI,EAAEC;AAAtC,IACLL,qBAAqB,CAAEC,mCAAF,CADtB;AAGA,eAAe,SAASK,kBAAT,CAA6B;AAAEC,EAAAA;AAAF,CAA7B,EAA4C;AAC1D,SACC,cAAC,sBAAD,QACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACGA,QADH,CADD,CADD;AAOA;AAED,SAASJ,sBAAT","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { createPrivateSlotFill } = unlock( componentsPrivateApis );\nconst SIDEBAR_FIXED_BOTTOM_SLOT_FILL_NAME = 'SidebarFixedBottom';\nconst { Slot: SidebarFixedBottomSlot, Fill: SidebarFixedBottomFill } =\n\tcreatePrivateSlotFill( SIDEBAR_FIXED_BOTTOM_SLOT_FILL_NAME );\n\nexport default function SidebarFixedBottom( { children } ) {\n\treturn (\n\t\t<SidebarFixedBottomFill>\n\t\t\t<div className=\"edit-site-sidebar-fixed-bottom-slot\">\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</SidebarFixedBottomFill>\n\t);\n}\n\nexport { SidebarFixedBottomSlot };\n"]}
|
|
@@ -9,6 +9,7 @@ import { store as editorStore } from '@wordpress/editor';
|
|
|
9
9
|
import { store as coreStore } from '@wordpress/core-data';
|
|
10
10
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
11
11
|
import { __ } from '@wordpress/i18n';
|
|
12
|
+
import { navigation as navigationIcon } from '@wordpress/icons';
|
|
12
13
|
/**
|
|
13
14
|
* Internal dependencies
|
|
14
15
|
*/
|
|
@@ -25,7 +26,7 @@ export default function TemplatePanel() {
|
|
|
25
26
|
description,
|
|
26
27
|
icon
|
|
27
28
|
},
|
|
28
|
-
|
|
29
|
+
record
|
|
29
30
|
} = useSelect(select => {
|
|
30
31
|
const {
|
|
31
32
|
getEditedPostType,
|
|
@@ -39,11 +40,13 @@ export default function TemplatePanel() {
|
|
|
39
40
|
} = select(editorStore);
|
|
40
41
|
const postType = getEditedPostType();
|
|
41
42
|
const postId = getEditedPostId();
|
|
42
|
-
|
|
43
|
-
const
|
|
43
|
+
|
|
44
|
+
const _record = getEditedEntityRecord('postType', postType, postId);
|
|
45
|
+
|
|
46
|
+
const info = _record ? getTemplateInfo(_record) : {};
|
|
44
47
|
return {
|
|
45
48
|
info,
|
|
46
|
-
|
|
49
|
+
record: _record
|
|
47
50
|
};
|
|
48
51
|
}, []);
|
|
49
52
|
|
|
@@ -56,10 +59,10 @@ export default function TemplatePanel() {
|
|
|
56
59
|
}, createElement(SidebarCard, {
|
|
57
60
|
className: "edit-site-template-card",
|
|
58
61
|
title: decodeEntities(title),
|
|
59
|
-
icon: icon,
|
|
62
|
+
icon: record?.type === 'wp_navigation' ? navigationIcon : icon,
|
|
60
63
|
description: decodeEntities(description),
|
|
61
64
|
actions: createElement(TemplateActions, {
|
|
62
|
-
template:
|
|
65
|
+
template: record
|
|
63
66
|
})
|
|
64
67
|
}, createElement(TemplateAreas, null)), createElement(PanelRow, {
|
|
65
68
|
header: __('Editing history'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/template-panel/index.js"],"names":["useSelect","PanelRow","PanelBody","store","editorStore","coreStore","decodeEntities","__","editSiteStore","TemplateActions","TemplateAreas","LastRevision","SidebarCard","TemplatePanel","info","title","description","icon","
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/template-panel/index.js"],"names":["useSelect","PanelRow","PanelBody","store","editorStore","coreStore","decodeEntities","__","navigation","navigationIcon","editSiteStore","TemplateActions","TemplateAreas","LastRevision","SidebarCard","TemplatePanel","info","title","description","icon","record","select","getEditedPostType","getEditedPostId","getEditedEntityRecord","__experimentalGetTemplateInfo","getTemplateInfo","postType","postId","_record","type"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,iBAA1B;AACA,SAASC,QAAT,EAAmBC,SAAnB,QAAoC,uBAApC;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SAASD,KAAK,IAAIE,SAAlB,QAAmC,sBAAnC;AACA,SAASC,cAAT,QAA+B,0BAA/B;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,UAAU,IAAIC,cAAvB,QAA6C,kBAA7C;AAEA;AACA;AACA;;AACA,SAASN,KAAK,IAAIO,aAAlB,QAAuC,gBAAvC;AACA,OAAOC,eAAP,MAA4B,oBAA5B;AACA,OAAOC,aAAP,MAA0B,kBAA1B;AACA,OAAOC,YAAP,MAAyB,iBAAzB;AACA,OAAOC,WAAP,MAAwB,iBAAxB;AAEA,eAAe,SAASC,aAAT,GAAyB;AACvC,QAAM;AACLC,IAAAA,IAAI,EAAE;AAAEC,MAAAA,KAAF;AAASC,MAAAA,WAAT;AAAsBC,MAAAA;AAAtB,KADD;AAELC,IAAAA;AAFK,MAGFpB,SAAS,CAAIqB,MAAF,IAAc;AAC5B,UAAM;AAAEC,MAAAA,iBAAF;AAAqBC,MAAAA;AAArB,QAAyCF,MAAM,CAAEX,aAAF,CAArD;AACA,UAAM;AAAEc,MAAAA;AAAF,QAA4BH,MAAM,CAAEhB,SAAF,CAAxC;AACA,UAAM;AAAEoB,MAAAA,6BAA6B,EAAEC;AAAjC,QACLL,MAAM,CAAEjB,WAAF,CADP;AAGA,UAAMuB,QAAQ,GAAGL,iBAAiB,EAAlC;AACA,UAAMM,MAAM,GAAGL,eAAe,EAA9B;;AACA,UAAMM,OAAO,GAAGL,qBAAqB,CAAE,UAAF,EAAcG,QAAd,EAAwBC,MAAxB,CAArC;;AAEA,UAAMZ,IAAI,GAAGa,OAAO,GAAGH,eAAe,CAAEG,OAAF,CAAlB,GAAgC,EAApD;AAEA,WAAO;AAAEb,MAAAA,IAAF;AAAQI,MAAAA,MAAM,EAAES;AAAhB,KAAP;AACA,GAbY,EAaV,EAbU,CAHb;;AAkBA,MAAK,CAAEZ,KAAF,IAAW,CAAEC,WAAlB,EAAgC;AAC/B,WAAO,IAAP;AACA;;AAED,SACC,cAAC,SAAD;AAAW,IAAA,SAAS,EAAC;AAArB,KACC,cAAC,WAAD;AACC,IAAA,SAAS,EAAC,yBADX;AAEC,IAAA,KAAK,EAAGZ,cAAc,CAAEW,KAAF,CAFvB;AAGC,IAAA,IAAI,EACHG,MAAM,EAAEU,IAAR,KAAiB,eAAjB,GAAmCrB,cAAnC,GAAoDU,IAJtD;AAMC,IAAA,WAAW,EAAGb,cAAc,CAAEY,WAAF,CAN7B;AAOC,IAAA,OAAO,EAAG,cAAC,eAAD;AAAiB,MAAA,QAAQ,EAAGE;AAA5B;AAPX,KASC,cAAC,aAAD,OATD,CADD,EAYC,cAAC,QAAD;AACC,IAAA,MAAM,EAAGb,EAAE,CAAE,iBAAF,CADZ;AAEC,IAAA,SAAS,EAAC;AAFX,KAIC,cAAC,YAAD,OAJD,CAZD,CADD;AAqBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { PanelRow, PanelBody } from '@wordpress/components';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { __ } from '@wordpress/i18n';\nimport { navigation as navigationIcon } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../../store';\nimport TemplateActions from './template-actions';\nimport TemplateAreas from './template-areas';\nimport LastRevision from './last-revision';\nimport SidebarCard from '../sidebar-card';\n\nexport default function TemplatePanel() {\n\tconst {\n\t\tinfo: { title, description, icon },\n\t\trecord,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditedPostType, getEditedPostId } = select( editSiteStore );\n\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\tconst { __experimentalGetTemplateInfo: getTemplateInfo } =\n\t\t\tselect( editorStore );\n\n\t\tconst postType = getEditedPostType();\n\t\tconst postId = getEditedPostId();\n\t\tconst _record = getEditedEntityRecord( 'postType', postType, postId );\n\n\t\tconst info = _record ? getTemplateInfo( _record ) : {};\n\n\t\treturn { info, record: _record };\n\t}, [] );\n\n\tif ( ! title && ! description ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody className=\"edit-site-template-panel\">\n\t\t\t<SidebarCard\n\t\t\t\tclassName=\"edit-site-template-card\"\n\t\t\t\ttitle={ decodeEntities( title ) }\n\t\t\t\ticon={\n\t\t\t\t\trecord?.type === 'wp_navigation' ? navigationIcon : icon\n\t\t\t\t}\n\t\t\t\tdescription={ decodeEntities( description ) }\n\t\t\t\tactions={ <TemplateActions template={ record } /> }\n\t\t\t>\n\t\t\t\t<TemplateAreas />\n\t\t\t</SidebarCard>\n\t\t\t<PanelRow\n\t\t\t\theader={ __( 'Editing history' ) }\n\t\t\t\tclassName=\"edit-site-template-revisions\"\n\t\t\t>\n\t\t\t\t<LastRevision />\n\t\t\t</PanelRow>\n\t\t</PanelBody>\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
|
/**
|
|
@@ -10,17 +9,22 @@ import classnames from 'classnames';
|
|
|
10
9
|
*/
|
|
11
10
|
|
|
12
11
|
import { __experimentalItem as Item, __experimentalHStack as HStack, FlexBlock } from '@wordpress/components';
|
|
13
|
-
import {
|
|
12
|
+
import { isRTL } from '@wordpress/i18n';
|
|
13
|
+
import { chevronRightSmall, chevronLeftSmall, Icon } from '@wordpress/icons';
|
|
14
14
|
export default function SidebarNavigationItem({
|
|
15
15
|
className,
|
|
16
16
|
icon,
|
|
17
17
|
withChevron = false,
|
|
18
|
+
suffix,
|
|
18
19
|
children,
|
|
19
20
|
...props
|
|
20
21
|
}) {
|
|
21
|
-
return createElement(Item,
|
|
22
|
-
className: classnames('edit-site-sidebar-navigation-item',
|
|
23
|
-
|
|
22
|
+
return createElement(Item, {
|
|
23
|
+
className: classnames('edit-site-sidebar-navigation-item', {
|
|
24
|
+
'with-suffix': !withChevron && suffix
|
|
25
|
+
}, className),
|
|
26
|
+
...props
|
|
27
|
+
}, createElement(HStack, {
|
|
24
28
|
justify: "flex-start"
|
|
25
29
|
}, icon && createElement(Icon, {
|
|
26
30
|
style: {
|
|
@@ -29,9 +33,9 @@ export default function SidebarNavigationItem({
|
|
|
29
33
|
icon: icon,
|
|
30
34
|
size: 24
|
|
31
35
|
}), createElement(FlexBlock, null, children), withChevron && createElement(Icon, {
|
|
32
|
-
icon: chevronRightSmall,
|
|
36
|
+
icon: isRTL() ? chevronLeftSmall : chevronRightSmall,
|
|
33
37
|
className: "edit-site-sidebar-navigation-item__drilldown-indicator",
|
|
34
38
|
size: 24
|
|
35
|
-
})));
|
|
39
|
+
}), !withChevron && suffix));
|
|
36
40
|
}
|
|
37
41
|
//# sourceMappingURL=index.js.map
|