@wordpress/edit-site 5.25.0 → 5.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/LICENSE.md +1 -1
- package/build/components/block-editor/back-button.js +3 -2
- package/build/components/block-editor/back-button.js.map +1 -1
- package/build/components/block-editor/resizable-editor.js +2 -2
- package/build/components/block-editor/resizable-editor.js.map +1 -1
- package/build/components/block-editor/use-post-link-props.js +27 -0
- package/build/components/block-editor/use-post-link-props.js.map +1 -0
- package/build/components/block-editor/use-site-editor-settings.js +7 -24
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +15 -7
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/editor/index.js +15 -16
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +9 -7
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/collection-font-variant.js +5 -2
- package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js +3 -3
- package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +5 -5
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +8 -4
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/index.js +38 -21
- package/build/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +2 -2
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-variant.js +5 -2
- package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/local-fonts.js +26 -10
- package/build/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/resolvers.js +6 -6
- package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
- package/build/components/global-styles/font-library-modal/{tab-layout.js → tab-panel-layout.js} +4 -4
- package/build/components/global-styles/font-library-modal/tab-panel-layout.js.map +1 -0
- package/build/components/global-styles/font-library-modal/utils/index.js +35 -38
- package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build/components/global-styles/preview.js +43 -1
- package/build/components/global-styles/preview.js.map +1 -1
- package/build/components/global-styles/screen-color-palette.js +16 -12
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +52 -52
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +26 -35
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +40 -22
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build/components/global-styles/ui.js +13 -62
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/header-edit-mode/document-tools/index.js +8 -106
- package/build/components/header-edit-mode/document-tools/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +7 -11
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/mode-switcher/index.js +0 -2
- package/build/components/header-edit-mode/mode-switcher/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/index.js +10 -7
- package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/edit-mode.js +0 -23
- package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build/components/keyboard-shortcuts/register.js +0 -36
- package/build/components/keyboard-shortcuts/register.js.map +1 -1
- package/build/components/layout/index.js +6 -13
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page-main/index.js +4 -4
- package/build/components/page-main/index.js.map +1 -1
- package/build/components/page-pages/index.js +84 -37
- package/build/components/page-pages/index.js.map +1 -1
- package/build/components/page-patterns/dataviews-pattern-actions.js +305 -0
- package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -0
- package/build/components/page-patterns/dataviews-patterns.js +307 -0
- package/build/components/page-patterns/dataviews-patterns.js.map +1 -0
- package/build/components/page-patterns/duplicate-menu-item.js +1 -1
- package/build/components/page-patterns/duplicate-menu-item.js.map +1 -1
- package/build/components/page-patterns/grid-item.js +4 -3
- package/build/components/page-patterns/grid-item.js.map +1 -1
- package/build/components/page-patterns/patterns-list.js +2 -1
- package/build/components/page-patterns/patterns-list.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +23 -13
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-templates/index.js +312 -36
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/{page-patterns/pagination.js → pagination/index.js} +25 -12
- package/build/components/pagination/index.js.map +1 -0
- package/build/components/{page-pages/side-editor.js → post-preview/index.js} +8 -4
- package/build/components/post-preview/index.js.map +1 -0
- package/build/components/preferences-modal/enable-feature.js +3 -2
- package/build/components/preferences-modal/enable-feature.js.map +1 -1
- package/build/components/preferences-modal/enable-panel-option.js +33 -0
- package/build/components/preferences-modal/enable-panel-option.js.map +1 -0
- package/build/components/preferences-modal/index.js +57 -9
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/revisions/index.js +3 -7
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/routes/link.js +6 -2
- package/build/components/routes/link.js.map +1 -1
- package/build/components/save-button/index.js +6 -3
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/sidebar/index.js +3 -11
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-dataviews/add-new-view.js +2 -2
- package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +18 -5
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +3 -3
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/default-sidebar.js +1 -5
- package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +62 -10
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/index.js +1 -1
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -4
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/index.js +4 -13
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +5 -2
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/index.js +4 -1
- package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pages-dataviews/index.js +69 -0
- package/build/components/sidebar-navigation-screen-pages-dataviews/index.js.map +1 -0
- package/build/components/style-book/index.js +38 -8
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +11 -6
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/index.js +12 -7
- package/build/index.js.map +1 -1
- package/build/store/actions.js +39 -44
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +6 -2
- package/build/store/private-actions.js.map +1 -1
- package/build/store/reducer.js +0 -46
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +32 -41
- package/build/store/selectors.js.map +1 -1
- package/build/utils/get-is-list-page.js +1 -1
- package/build/utils/get-is-list-page.js.map +1 -1
- package/build-module/components/block-editor/back-button.js +4 -3
- package/build-module/components/block-editor/back-button.js.map +1 -1
- package/build-module/components/block-editor/resizable-editor.js +2 -2
- package/build-module/components/block-editor/resizable-editor.js.map +1 -1
- package/build-module/components/block-editor/use-post-link-props.js +20 -0
- package/build-module/components/block-editor/use-post-link-props.js.map +1 -0
- package/build-module/components/block-editor/use-site-editor-settings.js +8 -25
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +14 -7
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/editor/index.js +16 -17
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +9 -7
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +5 -2
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js +3 -3
- package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +7 -7
- package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +8 -4
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/index.js +39 -22
- package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +2 -2
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js +5 -2
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/local-fonts.js +27 -11
- package/build-module/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/resolvers.js +5 -5
- package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/{tab-layout.js → tab-panel-layout.js} +4 -4
- package/build-module/components/global-styles/font-library-modal/tab-panel-layout.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/utils/index.js +34 -36
- package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build-module/components/global-styles/preview.js +45 -3
- package/build-module/components/global-styles/preview.js.map +1 -1
- package/build-module/components/global-styles/screen-color-palette.js +17 -13
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +53 -53
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +27 -36
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +40 -22
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build-module/components/global-styles/ui.js +15 -64
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/header-edit-mode/document-tools/index.js +13 -110
- package/build-module/components/header-edit-mode/document-tools/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +7 -11
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/header-edit-mode/mode-switcher/index.js +0 -2
- package/build-module/components/header-edit-mode/mode-switcher/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +10 -7
- package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/edit-mode.js +0 -23
- package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/register.js +0 -36
- package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
- package/build-module/components/layout/index.js +6 -13
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page-main/index.js +4 -4
- package/build-module/components/page-main/index.js.map +1 -1
- package/build-module/components/page-pages/index.js +83 -36
- package/build-module/components/page-pages/index.js.map +1 -1
- package/build-module/components/page-patterns/dataviews-pattern-actions.js +292 -0
- package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -0
- package/build-module/components/page-patterns/dataviews-patterns.js +299 -0
- package/build-module/components/page-patterns/dataviews-patterns.js.map +1 -0
- package/build-module/components/page-patterns/duplicate-menu-item.js +1 -1
- package/build-module/components/page-patterns/duplicate-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/grid-item.js +4 -3
- package/build-module/components/page-patterns/grid-item.js.map +1 -1
- package/build-module/components/page-patterns/patterns-list.js +2 -1
- package/build-module/components/page-patterns/patterns-list.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +23 -13
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-templates/index.js +314 -38
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/{page-patterns/pagination.js → pagination/index.js} +24 -12
- package/build-module/components/pagination/index.js.map +1 -0
- package/build-module/components/{page-pages/side-editor.js → post-preview/index.js} +7 -3
- package/build-module/components/post-preview/index.js.map +1 -0
- package/build-module/components/preferences-modal/enable-feature.js +3 -2
- package/build-module/components/preferences-modal/enable-feature.js.map +1 -1
- package/build-module/components/preferences-modal/enable-panel-option.js +26 -0
- package/build-module/components/preferences-modal/enable-panel-option.js.map +1 -0
- package/build-module/components/preferences-modal/index.js +57 -9
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/revisions/index.js +4 -8
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/routes/link.js +5 -2
- package/build-module/components/routes/link.js.map +1 -1
- package/build-module/components/save-button/index.js +6 -3
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +3 -11
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +17 -5
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +2 -2
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/default-sidebar.js +1 -5
- package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +64 -12
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/index.js +2 -2
- package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -4
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/index.js +6 -15
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +5 -2
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/index.js +4 -1
- package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js +61 -0
- package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js.map +1 -0
- package/build-module/components/style-book/index.js +40 -10
- 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 +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +11 -6
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/index.js +12 -7
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +36 -41
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +6 -2
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/reducer.js +0 -44
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +30 -38
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/get-is-list-page.js +1 -1
- package/build-module/utils/get-is-list-page.js.map +1 -1
- package/build-style/style-rtl.css +357 -268
- package/build-style/style.css +357 -268
- package/package.json +42 -42
- package/src/components/add-new-template/style.scss +2 -1
- package/src/components/block-editor/back-button.js +4 -2
- package/src/components/block-editor/resizable-editor.js +1 -1
- package/src/components/block-editor/style.scss +1 -2
- package/src/components/block-editor/use-post-link-props.js +20 -0
- package/src/components/block-editor/use-site-editor-settings.js +10 -41
- package/src/components/code-editor/style.scss +0 -4
- package/src/components/create-template-part-modal/index.js +83 -82
- package/src/components/editor/index.js +24 -31
- package/src/components/editor-canvas-container/index.js +8 -6
- package/src/components/global-styles/font-library-modal/collection-font-variant.js +7 -2
- package/src/components/global-styles/font-library-modal/confirm-delete-dialog.js +3 -3
- package/src/components/global-styles/font-library-modal/context.js +7 -7
- package/src/components/global-styles/font-library-modal/font-collection.js +10 -5
- package/src/components/global-styles/font-library-modal/index.js +44 -24
- package/src/components/global-styles/font-library-modal/installed-fonts.js +3 -3
- package/src/components/global-styles/font-library-modal/library-font-variant.js +7 -2
- package/src/components/global-styles/font-library-modal/local-fonts.js +53 -26
- package/src/components/global-styles/font-library-modal/resolvers.js +5 -5
- package/src/components/global-styles/font-library-modal/style.scss +5 -2
- package/src/components/global-styles/font-library-modal/{tab-layout.js → tab-panel-layout.js} +9 -3
- package/src/components/global-styles/font-library-modal/utils/index.js +21 -23
- package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamily.spec.js +58 -0
- package/src/components/global-styles/preview.js +55 -3
- package/src/components/global-styles/screen-color-palette.js +16 -26
- package/src/components/global-styles/screen-revisions/index.js +91 -92
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +37 -38
- package/src/components/global-styles/screen-revisions/style.scss +77 -20
- package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +67 -0
- package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +73 -46
- package/src/components/global-styles/ui.js +13 -74
- package/src/components/header-edit-mode/document-tools/index.js +33 -165
- package/src/components/header-edit-mode/index.js +6 -17
- package/src/components/header-edit-mode/mode-switcher/index.js +0 -4
- package/src/components/header-edit-mode/more-menu/index.js +9 -7
- package/src/components/header-edit-mode/style.scss +0 -47
- package/src/components/keyboard-shortcuts/edit-mode.js +1 -26
- package/src/components/keyboard-shortcuts/register.js +0 -43
- package/src/components/layout/index.js +8 -27
- package/src/components/layout/style.scss +10 -3
- package/src/components/list/style.scss +0 -5
- package/src/components/page/style.scss +1 -1
- package/src/components/page-main/index.js +8 -8
- package/src/components/page-pages/index.js +112 -41
- package/src/components/page-pages/style.scss +3 -2
- package/src/components/page-patterns/dataviews-pattern-actions.js +329 -0
- package/src/components/page-patterns/dataviews-patterns.js +380 -0
- package/src/components/page-patterns/duplicate-menu-item.js +1 -1
- package/src/components/page-patterns/grid-item.js +3 -2
- package/src/components/page-patterns/patterns-list.js +2 -1
- package/src/components/page-patterns/style.scss +89 -26
- package/src/components/page-patterns/use-patterns.js +24 -15
- package/src/components/page-templates/index.js +399 -64
- package/src/components/{page-patterns/pagination.js → pagination/index.js} +21 -10
- package/src/components/pagination/style.scss +5 -0
- package/src/components/post-preview/index.js +16 -0
- package/src/components/preferences-modal/enable-feature.js +9 -5
- package/src/components/preferences-modal/enable-panel-option.js +23 -0
- package/src/components/preferences-modal/index.js +107 -22
- package/src/components/revisions/index.js +8 -15
- package/src/components/routes/link.js +11 -3
- package/src/components/save-button/index.js +16 -3
- package/src/components/sidebar/index.js +6 -13
- package/src/components/sidebar-dataviews/add-new-view.js +1 -1
- package/src/components/sidebar-dataviews/default-views.js +23 -6
- package/src/components/sidebar-dataviews/index.js +2 -2
- package/src/components/sidebar-edit-mode/default-sidebar.js +0 -12
- package/src/components/sidebar-edit-mode/global-styles-sidebar.js +85 -14
- package/src/components/sidebar-edit-mode/page-panels/index.js +15 -1
- package/src/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -12
- package/src/components/sidebar-edit-mode/style.scss +0 -10
- package/src/components/sidebar-edit-mode/template-panel/index.js +44 -40
- package/src/components/sidebar-edit-mode/template-panel/style.scss +0 -4
- package/src/components/sidebar-navigation-screen-details-footer/index.js +1 -1
- package/src/components/sidebar-navigation-screen-global-styles/index.js +3 -2
- package/src/components/sidebar-navigation-screen-page/index.js +2 -1
- package/src/components/sidebar-navigation-screen-pages-dataviews/index.js +77 -0
- package/src/components/site-hub/style.scss +5 -2
- package/src/components/style-book/index.js +65 -21
- package/src/components/style-book/style.scss +3 -3
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +4 -1
- package/src/hooks/commands/use-edit-mode-commands.js +8 -12
- package/src/index.js +11 -5
- package/src/store/actions.js +35 -45
- package/src/store/private-actions.js +7 -3
- package/src/store/reducer.js +0 -44
- package/src/store/selectors.js +32 -38
- package/src/store/test/actions.js +11 -39
- package/src/store/test/reducer.js +1 -82
- package/src/store/test/selectors.js +0 -24
- package/src/style.scss +1 -1
- package/src/utils/get-is-list-page.js +2 -3
- package/build/components/global-styles/font-library-modal/tab-layout.js.map +0 -1
- package/build/components/global-styles/screen-revisions/get-revision-changes.js +0 -146
- package/build/components/global-styles/screen-revisions/get-revision-changes.js.map +0 -1
- package/build/components/header-edit-mode/undo-redo/redo.js +0 -41
- package/build/components/header-edit-mode/undo-redo/redo.js.map +0 -1
- package/build/components/header-edit-mode/undo-redo/undo.js +0 -40
- package/build/components/header-edit-mode/undo-redo/undo.js.map +0 -1
- package/build/components/page-pages/side-editor.js.map +0 -1
- package/build/components/page-patterns/pagination.js.map +0 -1
- package/build/components/page-templates/dataviews-templates.js +0 -317
- package/build/components/page-templates/dataviews-templates.js.map +0 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +0 -60
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +0 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +0 -109
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +0 -1
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -35
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-panel/last-revision.js +0 -73
- package/build/components/sidebar-edit-mode/template-panel/last-revision.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -219
- package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +0 -1
- package/build-module/components/global-styles/font-library-modal/tab-layout.js.map +0 -1
- package/build-module/components/global-styles/screen-revisions/get-revision-changes.js +0 -139
- package/build-module/components/global-styles/screen-revisions/get-revision-changes.js.map +0 -1
- package/build-module/components/header-edit-mode/undo-redo/redo.js +0 -33
- package/build-module/components/header-edit-mode/undo-redo/redo.js.map +0 -1
- package/build-module/components/header-edit-mode/undo-redo/undo.js +0 -32
- package/build-module/components/header-edit-mode/undo-redo/undo.js.map +0 -1
- package/build-module/components/page-pages/side-editor.js.map +0 -1
- package/build-module/components/page-patterns/pagination.js.map +0 -1
- package/build-module/components/page-templates/dataviews-templates.js +0 -309
- package/build-module/components/page-templates/dataviews-templates.js.map +0 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +0 -53
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +0 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +0 -102
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -27
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js +0 -65
- package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -209
- package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +0 -1
- package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamilies.spec.js +0 -62
- package/src/components/global-styles/font-library-modal/utils/test/wpKebabCase.spec.js +0 -28
- package/src/components/global-styles/screen-revisions/get-revision-changes.js +0 -171
- package/src/components/global-styles/screen-revisions/test/get-revision-changes.js +0 -191
- package/src/components/header-edit-mode/undo-redo/redo.js +0 -38
- package/src/components/header-edit-mode/undo-redo/undo.js +0 -34
- package/src/components/page-pages/side-editor.js +0 -14
- package/src/components/page-templates/dataviews-templates.js +0 -360
- package/src/components/secondary-sidebar/inserter-sidebar.js +0 -66
- package/src/components/secondary-sidebar/list-view-sidebar.js +0 -123
- package/src/components/secondary-sidebar/style.scss +0 -65
- package/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -26
- package/src/components/sidebar-edit-mode/template-panel/last-revision.js +0 -82
- package/src/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -279
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.DEFAULT_VIEWS = exports.DEFAULT_CONFIG_PER_VIEW_TYPE = void 0;
|
|
7
7
|
var _i18n = require("@wordpress/i18n");
|
|
8
8
|
var _icons = require("@wordpress/icons");
|
|
9
9
|
var _constants = require("../../utils/constants");
|
|
@@ -15,8 +15,20 @@ var _constants = require("../../utils/constants");
|
|
|
15
15
|
* Internal dependencies
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
+
const DEFAULT_CONFIG_PER_VIEW_TYPE = {
|
|
19
|
+
[_constants.LAYOUT_TABLE]: {},
|
|
20
|
+
[_constants.LAYOUT_GRID]: {
|
|
21
|
+
mediaField: 'featured-image',
|
|
22
|
+
primaryField: 'title'
|
|
23
|
+
},
|
|
24
|
+
[_constants.LAYOUT_LIST]: {
|
|
25
|
+
primaryField: 'title',
|
|
26
|
+
mediaField: 'featured-image'
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
exports.DEFAULT_CONFIG_PER_VIEW_TYPE = DEFAULT_CONFIG_PER_VIEW_TYPE;
|
|
18
30
|
const DEFAULT_PAGE_BASE = {
|
|
19
|
-
type: _constants.
|
|
31
|
+
type: _constants.LAYOUT_LIST,
|
|
20
32
|
search: '',
|
|
21
33
|
filters: [],
|
|
22
34
|
page: 1,
|
|
@@ -28,7 +40,9 @@ const DEFAULT_PAGE_BASE = {
|
|
|
28
40
|
// All fields are visible by default, so it's
|
|
29
41
|
// better to keep track of the hidden ones.
|
|
30
42
|
hiddenFields: ['date', 'featured-image'],
|
|
31
|
-
layout: {
|
|
43
|
+
layout: {
|
|
44
|
+
...DEFAULT_CONFIG_PER_VIEW_TYPE[_constants.LAYOUT_LIST]
|
|
45
|
+
}
|
|
32
46
|
};
|
|
33
47
|
const DEFAULT_VIEWS = {
|
|
34
48
|
page: [{
|
|
@@ -60,6 +74,5 @@ const DEFAULT_VIEWS = {
|
|
|
60
74
|
}
|
|
61
75
|
}]
|
|
62
76
|
};
|
|
63
|
-
|
|
64
|
-
exports.default = _default;
|
|
77
|
+
exports.DEFAULT_VIEWS = DEFAULT_VIEWS;
|
|
65
78
|
//# sourceMappingURL=default-views.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_icons","_constants","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_icons","_constants","DEFAULT_CONFIG_PER_VIEW_TYPE","LAYOUT_TABLE","LAYOUT_GRID","mediaField","primaryField","LAYOUT_LIST","exports","DEFAULT_PAGE_BASE","type","search","filters","page","perPage","sort","field","direction","hiddenFields","layout","DEFAULT_VIEWS","title","__","slug","view","operator","OPERATOR_IN","value","icon","trash"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/default-views.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { trash } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport {\n\tLAYOUT_LIST,\n\tLAYOUT_TABLE,\n\tLAYOUT_GRID,\n\tOPERATOR_IN,\n} from '../../utils/constants';\n\nexport const DEFAULT_CONFIG_PER_VIEW_TYPE = {\n\t[ LAYOUT_TABLE ]: {},\n\t[ LAYOUT_GRID ]: {\n\t\tmediaField: 'featured-image',\n\t\tprimaryField: 'title',\n\t},\n\t[ LAYOUT_LIST ]: {\n\t\tprimaryField: 'title',\n\t\tmediaField: 'featured-image',\n\t},\n};\n\nconst DEFAULT_PAGE_BASE = {\n\ttype: LAYOUT_LIST,\n\tsearch: '',\n\tfilters: [],\n\tpage: 1,\n\tperPage: 20,\n\tsort: {\n\t\tfield: 'date',\n\t\tdirection: 'desc',\n\t},\n\t// All fields are visible by default, so it's\n\t// better to keep track of the hidden ones.\n\thiddenFields: [ 'date', 'featured-image' ],\n\tlayout: {\n\t\t...DEFAULT_CONFIG_PER_VIEW_TYPE[ LAYOUT_LIST ],\n\t},\n};\n\nexport const DEFAULT_VIEWS = {\n\tpage: [\n\t\t{\n\t\t\ttitle: __( 'All' ),\n\t\t\tslug: 'all',\n\t\t\tview: DEFAULT_PAGE_BASE,\n\t\t},\n\t\t{\n\t\t\ttitle: __( 'Drafts' ),\n\t\t\tslug: 'drafts',\n\t\t\tview: {\n\t\t\t\t...DEFAULT_PAGE_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{ field: 'status', operator: OPERATOR_IN, value: 'draft' },\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle: __( 'Trash' ),\n\t\t\tslug: 'trash',\n\t\t\ticon: trash,\n\t\t\tview: {\n\t\t\t\t...DEFAULT_PAGE_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{ field: 'status', operator: OPERATOR_IN, value: 'trash' },\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t],\n};\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;A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ACL,GAAGf,iBAAiB;MACpBG,OAAO,EAAE,CACR;QAAEI,KAAK,EAAE,QAAQ;QAAES,QAAQ,EAAEC,sBAAW;QAAEC,KAAK,EAAE;MAAQ,CAAC;IAE5D;EACD,CAAC;AAEH,CAAC;AAACnB,OAAA,CAAAY,aAAA,GAAAA,aAAA"}
|
|
@@ -8,7 +8,7 @@ exports.default = DataViewsSidebarContent;
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _components = require("@wordpress/components");
|
|
10
10
|
var _router = require("@wordpress/router");
|
|
11
|
-
var _defaultViews =
|
|
11
|
+
var _defaultViews = require("./default-views");
|
|
12
12
|
var _lockUnlock = require("../../lock-unlock");
|
|
13
13
|
var _dataviewItem = _interopRequireDefault(require("./dataview-item"));
|
|
14
14
|
var _customDataviewsList = _interopRequireDefault(require("./custom-dataviews-list"));
|
|
@@ -24,7 +24,7 @@ const {
|
|
|
24
24
|
useLocation
|
|
25
25
|
} = (0, _lockUnlock.unlock)(_router.privateApis);
|
|
26
26
|
const PATH_TO_TYPE = {
|
|
27
|
-
'/
|
|
27
|
+
'/page': 'page'
|
|
28
28
|
};
|
|
29
29
|
function DataViewsSidebarContent() {
|
|
30
30
|
const {
|
|
@@ -38,7 +38,7 @@ function DataViewsSidebarContent() {
|
|
|
38
38
|
return null;
|
|
39
39
|
}
|
|
40
40
|
const type = PATH_TO_TYPE[path];
|
|
41
|
-
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_components.__experimentalItemGroup, null, _defaultViews.
|
|
41
|
+
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_components.__experimentalItemGroup, null, _defaultViews.DEFAULT_VIEWS[type].map(dataview => {
|
|
42
42
|
return (0, _react.createElement)(_dataviewItem.default, {
|
|
43
43
|
key: dataview.slug,
|
|
44
44
|
slug: dataview.slug,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_router","_defaultViews","
|
|
1
|
+
{"version":3,"names":["_components","require","_router","_defaultViews","_lockUnlock","_dataviewItem","_interopRequireDefault","_customDataviewsList","useLocation","unlock","routerPrivateApis","PATH_TO_TYPE","DataViewsSidebarContent","params","path","activeView","isCustom","type","_react","createElement","Fragment","__experimentalItemGroup","DEFAULT_VIEWS","map","dataview","default","key","slug","title","icon","view","isActive"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\n\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n/**\n * Internal dependencies\n */\n\nimport { DEFAULT_VIEWS } from './default-views';\nimport { unlock } from '../../lock-unlock';\nconst { useLocation } = unlock( routerPrivateApis );\nimport DataViewItem from './dataview-item';\nimport CustomDataViewsList from './custom-dataviews-list';\n\nconst PATH_TO_TYPE = {\n\t'/page': 'page',\n};\n\nexport default function DataViewsSidebarContent() {\n\tconst {\n\t\tparams: { path, activeView = 'all', isCustom = 'false' },\n\t} = useLocation();\n\tif ( ! path || ! PATH_TO_TYPE[ path ] ) {\n\t\treturn null;\n\t}\n\tconst type = PATH_TO_TYPE[ path ];\n\n\treturn (\n\t\t<>\n\t\t\t<ItemGroup>\n\t\t\t\t{ DEFAULT_VIEWS[ type ].map( ( dataview ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<DataViewItem\n\t\t\t\t\t\t\tkey={ dataview.slug }\n\t\t\t\t\t\t\tslug={ dataview.slug }\n\t\t\t\t\t\t\ttitle={ dataview.title }\n\t\t\t\t\t\t\ticon={ dataview.icon }\n\t\t\t\t\t\t\ttype={ dataview.view.type }\n\t\t\t\t\t\t\tisActive={\n\t\t\t\t\t\t\t\tisCustom === 'false' &&\n\t\t\t\t\t\t\t\tdataview.slug === activeView\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tisCustom=\"false\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</ItemGroup>\n\t\t\t<C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IAAM;MACtBZ,IAAI,EAAGO,QAAQ,CAACM,IAAI,CAACb,IAAM;MAC3Bc,QAAQ,EACPf,QAAQ,KAAK,OAAO,IACpBQ,QAAQ,CAACG,IAAI,KAAKZ,UAClB;MACDC,QAAQ,EAAC;IAAO,CAChB,CAAC;EAEJ,CAAE,CACQ,CAAC,EACZ,IAAAE,MAAA,CAAAC,aAAA,EAACZ,oBAAA,CAAAkB,OAAmB;IACnBV,UAAU,EAAGA,UAAY;IACzBE,IAAI,EAAGA,IAAM;IACbD,QAAQ,EAAC;EAAM,CACf,CACA,CAAC;AAEL"}
|
|
@@ -6,8 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = DefaultSidebar;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _interface = require("@wordpress/interface");
|
|
9
|
-
var _data = require("@wordpress/data");
|
|
10
|
-
var _preferences = require("@wordpress/preferences");
|
|
11
9
|
/**
|
|
12
10
|
* WordPress dependencies
|
|
13
11
|
*/
|
|
@@ -23,7 +21,6 @@ function DefaultSidebar({
|
|
|
23
21
|
headerClassName,
|
|
24
22
|
panelClassName
|
|
25
23
|
}) {
|
|
26
|
-
const showIconLabels = (0, _data.useSelect)(select => !!select(_preferences.store).get('core/edit-site', 'showIconLabels'), []);
|
|
27
24
|
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_interface.ComplementaryArea, {
|
|
28
25
|
className: className,
|
|
29
26
|
scope: "core/edit-site",
|
|
@@ -34,8 +31,7 @@ function DefaultSidebar({
|
|
|
34
31
|
closeLabel: closeLabel,
|
|
35
32
|
header: header,
|
|
36
33
|
headerClassName: headerClassName,
|
|
37
|
-
panelClassName: panelClassName
|
|
38
|
-
showIconLabels: showIconLabels
|
|
34
|
+
panelClassName: panelClassName
|
|
39
35
|
}, children), (0, _react.createElement)(_interface.ComplementaryAreaMoreMenuItem, {
|
|
40
36
|
scope: "core/edit-site",
|
|
41
37
|
identifier: identifier,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_interface","require","
|
|
1
|
+
{"version":3,"names":["_interface","require","DefaultSidebar","className","identifier","title","icon","children","closeLabel","header","headerClassName","panelClassName","_react","createElement","Fragment","ComplementaryArea","scope","smallScreenTitle","ComplementaryAreaMoreMenuItem"],"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/default-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tComplementaryArea,\n\tComplementaryAreaMoreMenuItem,\n} from '@wordpress/interface';\n\nexport default function DefaultSidebar( {\n\tclassName,\n\tidentifier,\n\ttitle,\n\ticon,\n\tchildren,\n\tcloseLabel,\n\theader,\n\theaderClassName,\n\tpanelClassName,\n} ) {\n\treturn (\n\t\t<>\n\t\t\t<ComplementaryArea\n\t\t\t\tclassName={ className }\n\t\t\t\tscope=\"core/edit-site\"\n\t\t\t\tidentifier={ identifier }\n\t\t\t\ttitle={ title }\n\t\t\t\tsmallScreenTitle={ title }\n\t\t\t\ticon={ icon }\n\t\t\t\tcloseLabel={ closeLabel }\n\t\t\t\theader={ header }\n\t\t\t\theaderClassName={ headerClassName }\n\t\t\t\tpanelClassName={ panelClassName }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</ComplementaryArea>\n\t\t\t<ComplementaryAreaMoreMenuItem\n\t\t\t\tscope=\"core/edit-site\"\n\t\t\t\tidentifier={ identifier }\n\t\t\t\ticon={ icon }\n\t\t\t>\n\t\t\t\t{ title }\n\t\t\t</ComplementaryAreaMoreMenuItem>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,UAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAMe,SAASC,cAAcA,CAAE;EACvCC,SAAS;EACTC,UAAU;EACVC,KAAK;EACLC,IAAI;EACJC,QAAQ;EACRC,UAAU;EACVC,MAAM;EACNC,eAAe;EACfC;AACD,CAAC,EAAG;EACH,OACC,IAAAC,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAE,QAAA,QACC,IAAAF,MAAA,CAAAC,aAAA,EAACb,UAAA,CAAAe,iBAAiB;IACjBZ,SAAS,EAAGA,SAAW;IACvBa,KAAK,EAAC,gBAAgB;IACtBZ,UAAU,EAAGA,UAAY;IACzBC,KAAK,EAAGA,KAAO;IACfY,gBAAgB,EAAGZ,KAAO;IAC1BC,IAAI,EAAGA,IAAM;IACbE,UAAU,EAAGA,UAAY;IACzBC,MAAM,EAAGA,MAAQ;IACjBC,eAAe,EAAGA,eAAiB;IACnCC,cAAc,EAAGA;EAAgB,GAE/BJ,QACgB,CAAC,EACpB,IAAAK,MAAA,CAAAC,aAAA,EAACb,UAAA,CAAAkB,6BAA6B;IAC7BF,KAAK,EAAC,gBAAgB;IACtBZ,UAAU,EAAGA,UAAY;IACzBE,IAAI,EAAGA;EAAM,GAEXD,KAC4B,CAC9B,CAAC;AAEL"}
|
|
@@ -13,11 +13,13 @@ var _data = require("@wordpress/data");
|
|
|
13
13
|
var _element = require("@wordpress/element");
|
|
14
14
|
var _interface = require("@wordpress/interface");
|
|
15
15
|
var _preferences = require("@wordpress/preferences");
|
|
16
|
+
var _editor = require("@wordpress/editor");
|
|
16
17
|
var _defaultSidebar = _interopRequireDefault(require("./default-sidebar"));
|
|
17
18
|
var _globalStyles = require("../global-styles");
|
|
18
19
|
var _store = require("../../store");
|
|
19
20
|
var _ui = require("../global-styles/ui");
|
|
20
21
|
var _lockUnlock = require("../../lock-unlock");
|
|
22
|
+
var _coreData = require("@wordpress/core-data");
|
|
21
23
|
/**
|
|
22
24
|
* WordPress dependencies
|
|
23
25
|
*/
|
|
@@ -30,7 +32,10 @@ function GlobalStylesSidebar() {
|
|
|
30
32
|
const {
|
|
31
33
|
shouldClearCanvasContainerView,
|
|
32
34
|
isStyleBookOpened,
|
|
33
|
-
showListViewByDefault
|
|
35
|
+
showListViewByDefault,
|
|
36
|
+
hasRevisions,
|
|
37
|
+
isRevisionsOpened,
|
|
38
|
+
isRevisionsStyleBookOpened
|
|
34
39
|
} = (0, _data.useSelect)(select => {
|
|
35
40
|
const {
|
|
36
41
|
getActiveComplementaryArea
|
|
@@ -39,13 +44,23 @@ function GlobalStylesSidebar() {
|
|
|
39
44
|
getEditorCanvasContainerView,
|
|
40
45
|
getCanvasMode
|
|
41
46
|
} = (0, _lockUnlock.unlock)(select(_store.store));
|
|
47
|
+
const canvasContainerView = getEditorCanvasContainerView();
|
|
42
48
|
const _isVisualEditorMode = 'visual' === select(_store.store).getEditorMode();
|
|
43
49
|
const _isEditCanvasMode = 'edit' === getCanvasMode();
|
|
44
|
-
const _showListViewByDefault = select(_preferences.store).get('core
|
|
50
|
+
const _showListViewByDefault = select(_preferences.store).get('core', 'showListViewByDefault');
|
|
51
|
+
const {
|
|
52
|
+
getEntityRecord,
|
|
53
|
+
__experimentalGetCurrentGlobalStylesId
|
|
54
|
+
} = select(_coreData.store);
|
|
55
|
+
const globalStylesId = __experimentalGetCurrentGlobalStylesId();
|
|
56
|
+
const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined;
|
|
45
57
|
return {
|
|
46
|
-
isStyleBookOpened: 'style-book' ===
|
|
58
|
+
isStyleBookOpened: 'style-book' === canvasContainerView,
|
|
47
59
|
shouldClearCanvasContainerView: 'edit-site/global-styles' !== getActiveComplementaryArea('core/edit-site') || !_isVisualEditorMode || !_isEditCanvasMode,
|
|
48
|
-
showListViewByDefault: _showListViewByDefault
|
|
60
|
+
showListViewByDefault: _showListViewByDefault,
|
|
61
|
+
hasRevisions: !!globalStyles?._links?.['version-history']?.[0]?.count,
|
|
62
|
+
isRevisionsStyleBookOpened: 'global-styles-revisions:style-book' === canvasContainerView,
|
|
63
|
+
isRevisionsOpened: 'global-styles-revisions' === canvasContainerView
|
|
49
64
|
};
|
|
50
65
|
}, []);
|
|
51
66
|
const {
|
|
@@ -58,7 +73,41 @@ function GlobalStylesSidebar() {
|
|
|
58
73
|
}, [shouldClearCanvasContainerView]);
|
|
59
74
|
const {
|
|
60
75
|
setIsListViewOpened
|
|
61
|
-
} = (0, _data.useDispatch)(
|
|
76
|
+
} = (0, _data.useDispatch)(_editor.store);
|
|
77
|
+
const {
|
|
78
|
+
goTo
|
|
79
|
+
} = (0, _components.__experimentalUseNavigator)();
|
|
80
|
+
const toggleRevisions = () => {
|
|
81
|
+
setIsListViewOpened(false);
|
|
82
|
+
if (isRevisionsStyleBookOpened) {
|
|
83
|
+
goTo('/');
|
|
84
|
+
setEditorCanvasContainerView('style-book');
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
if (isRevisionsOpened) {
|
|
88
|
+
goTo('/');
|
|
89
|
+
setEditorCanvasContainerView(undefined);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
goTo('/revisions');
|
|
93
|
+
if (isStyleBookOpened) {
|
|
94
|
+
setEditorCanvasContainerView('global-styles-revisions:style-book');
|
|
95
|
+
} else {
|
|
96
|
+
setEditorCanvasContainerView('global-styles-revisions');
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
const toggleStyleBook = () => {
|
|
100
|
+
if (isRevisionsOpened) {
|
|
101
|
+
setEditorCanvasContainerView('global-styles-revisions:style-book');
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (isRevisionsStyleBookOpened) {
|
|
105
|
+
setEditorCanvasContainerView('global-styles-revisions');
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
setIsListViewOpened(isStyleBookOpened && showListViewByDefault);
|
|
109
|
+
setEditorCanvasContainerView(isStyleBookOpened ? undefined : 'style-book');
|
|
110
|
+
};
|
|
62
111
|
return (0, _react.createElement)(_defaultSidebar.default, {
|
|
63
112
|
className: "edit-site-global-styles-sidebar",
|
|
64
113
|
identifier: "edit-site/global-styles",
|
|
@@ -77,12 +126,15 @@ function GlobalStylesSidebar() {
|
|
|
77
126
|
}, (0, _react.createElement)("strong", null, (0, _i18n.__)('Styles'))), (0, _react.createElement)(_components.FlexItem, null, (0, _react.createElement)(_components.Button, {
|
|
78
127
|
icon: _icons.seen,
|
|
79
128
|
label: (0, _i18n.__)('Style Book'),
|
|
80
|
-
isPressed: isStyleBookOpened,
|
|
129
|
+
isPressed: isStyleBookOpened || isRevisionsStyleBookOpened,
|
|
81
130
|
disabled: shouldClearCanvasContainerView,
|
|
82
|
-
onClick:
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
131
|
+
onClick: toggleStyleBook
|
|
132
|
+
})), (0, _react.createElement)(_components.FlexItem, null, (0, _react.createElement)(_components.Button, {
|
|
133
|
+
label: (0, _i18n.__)('Revisions'),
|
|
134
|
+
icon: _icons.backup,
|
|
135
|
+
onClick: toggleRevisions,
|
|
136
|
+
disabled: !hasRevisions,
|
|
137
|
+
isPressed: isRevisionsOpened || isRevisionsStyleBookOpened
|
|
86
138
|
})), (0, _react.createElement)(_ui.GlobalStylesMenuSlot, null))
|
|
87
139
|
}, (0, _react.createElement)(_globalStyles.GlobalStylesUI, null));
|
|
88
140
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_icons","_data","_element","_interface","_preferences","_defaultSidebar","_interopRequireDefault","_globalStyles","_store","_ui","_lockUnlock","GlobalStylesSidebar","shouldClearCanvasContainerView","isStyleBookOpened","showListViewByDefault","useSelect","select","getActiveComplementaryArea","interfaceStore","getEditorCanvasContainerView","getCanvasMode","unlock","editSiteStore","_isVisualEditorMode","getEditorMode","_isEditCanvasMode","_showListViewByDefault","preferencesStore","get","setEditorCanvasContainerView","useDispatch","useEffect","undefined","setIsListViewOpened","_react","createElement","default","className","identifier","title","__","icon","styles","closeLabel","panelClassName","header","Flex","role","FlexBlock","style","minWidth","FlexItem","Button","seen","label","isPressed","disabled","onClick","GlobalStylesMenuSlot","GlobalStylesUI"],"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/global-styles-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { FlexItem, FlexBlock, Flex, Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { styles, seen } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport DefaultSidebar from './default-sidebar';\nimport { GlobalStylesUI } from '../global-styles';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesMenuSlot } from '../global-styles/ui';\nimport { unlock } from '../../lock-unlock';\n\nexport default function GlobalStylesSidebar() {\n\tconst {\n\t\tshouldClearCanvasContainerView,\n\t\tisStyleBookOpened,\n\t\tshowListViewByDefault,\n\t} = useSelect( ( select ) => {\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\t\tconst { getEditorCanvasContainerView, getCanvasMode } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst _isVisualEditorMode =\n\t\t\t'visual' === select( editSiteStore ).getEditorMode();\n\t\tconst _isEditCanvasMode = 'edit' === getCanvasMode();\n\t\tconst _showListViewByDefault = select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\t'showListViewByDefault'\n\t\t);\n\n\t\treturn {\n\t\t\tisStyleBookOpened: 'style-book' === getEditorCanvasContainerView(),\n\t\t\tshouldClearCanvasContainerView:\n\t\t\t\t'edit-site/global-styles' !==\n\t\t\t\t\tgetActiveComplementaryArea( 'core/edit-site' ) ||\n\t\t\t\t! _isVisualEditorMode ||\n\t\t\t\t! _isEditCanvasMode,\n\t\t\tshowListViewByDefault: _showListViewByDefault,\n\t\t};\n\t}, [] );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\n\tuseEffect( () => {\n\t\tif ( shouldClearCanvasContainerView ) {\n\t\t\tsetEditorCanvasContainerView( undefined );\n\t\t}\n\t}, [ shouldClearCanvasContainerView ] );\n\n\tconst { setIsListViewOpened } = useDispatch( editSiteStore );\n\n\treturn (\n\t\t<DefaultSidebar\n\t\t\tclassName=\"edit-site-global-styles-sidebar\"\n\t\t\tidentifier=\"edit-site/global-styles\"\n\t\t\ttitle={ __( 'Styles' ) }\n\t\t\ticon={ styles }\n\t\t\tcloseLabel={ __( 'Close Styles' ) }\n\t\t\tpanelClassName=\"edit-site-global-styles-sidebar__panel\"\n\t\t\theader={\n\t\t\t\t<Flex\n\t\t\t\t\tclassName=\"edit-site-global-styles-sidebar__header\"\n\t\t\t\t\trole=\"menubar\"\n\t\t\t\t\taria-label={ __( 'Styles actions' ) }\n\t\t\t\t>\n\t\t\t\t\t<FlexBlock style={ { minWidth: 'min-content' } }>\n\t\t\t\t\t\t<strong>{ __( 'Styles' ) }</strong>\n\t\t\t\t\t</FlexBlock>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\t\t\t\t\tisPressed={ isStyleBookOpened }\n\t\t\t\t\t\t\tdisabled={ shouldClearCanvasContainerView }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tsetIsListViewOpened(\n\t\t\t\t\t\t\t\t\tisStyleBookOpened && showListViewByDefault\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t\t\t\t\t\tisStyleBookOpened ? undefined : 'style-book'\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<GlobalStylesMenuSlot />\n\t\t\t\t</Flex>\n\t\t\t}\n\t\t>\n\t\t\t<GlobalStylesUI />\n\t\t</DefaultSidebar>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OA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AS,GAAG,YACjC,CAAC;MACF;IAAG,CACH,CACQ,CAAC,EACX,IAAAE,MAAA,CAAAC,aAAA,EAAC1B,GAAA,CAAAiD,oBAAoB,MAAE,CAClB;EACN,GAED,IAAAxB,MAAA,CAAAC,aAAA,EAAC5B,aAAA,CAAAoD,cAAc,MAAE,CACF,CAAC;AAEnB"}
|
|
1
|
+
{"version":3,"names":["_components","require","_i18n","_icons","_data","_element","_interface","_preferences","_editor","_defaultSidebar","_interopRequireDefault","_globalStyles","_store","_ui","_lockUnlock","_coreData","GlobalStylesSidebar","shouldClearCanvasContainerView","isStyleBookOpened","showListViewByDefault","hasRevisions","isRevisionsOpened","isRevisionsStyleBookOpened","useSelect","select","getActiveComplementaryArea","interfaceStore","getEditorCanvasContainerView","getCanvasMode","unlock","editSiteStore","canvasContainerView","_isVisualEditorMode","getEditorMode","_isEditCanvasMode","_showListViewByDefault","preferencesStore","get","getEntityRecord","__experimentalGetCurrentGlobalStylesId","coreStore","globalStylesId","globalStyles","undefined","_links","count","setEditorCanvasContainerView","useDispatch","useEffect","setIsListViewOpened","editorStore","goTo","useNavigator","toggleRevisions","toggleStyleBook","_react","createElement","default","className","identifier","title","__","icon","styles","closeLabel","panelClassName","header","Flex","role","FlexBlock","style","minWidth","FlexItem","Button","seen","label","isPressed","disabled","onClick","backup","GlobalStylesMenuSlot","GlobalStylesUI"],"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/global-styles-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tFlexItem,\n\tFlexBlock,\n\tFlex,\n\tButton,\n\t__experimentalUseNavigator as useNavigator,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { styles, seen, backup } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport DefaultSidebar from './default-sidebar';\nimport { GlobalStylesUI } from '../global-styles';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesMenuSlot } from '../global-styles/ui';\nimport { unlock } from '../../lock-unlock';\nimport { store as coreStore } from '@wordpress/core-data';\n\nexport default function GlobalStylesSidebar() {\n\tconst {\n\t\tshouldClearCanvasContainerView,\n\t\tisStyleBookOpened,\n\t\tshowListViewByDefault,\n\t\thasRevisions,\n\t\tisRevisionsOpened,\n\t\tisRevisionsStyleBookOpened,\n\t} = useSelect( ( select ) => {\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\t\tconst { getEditorCanvasContainerView, getCanvasMode } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst canvasContainerView = getEditorCanvasContainerView();\n\t\tconst _isVisualEditorMode =\n\t\t\t'visual' === select( editSiteStore ).getEditorMode();\n\t\tconst _isEditCanvasMode = 'edit' === getCanvasMode();\n\t\tconst _showListViewByDefault = select( preferencesStore ).get(\n\t\t\t'core',\n\t\t\t'showListViewByDefault'\n\t\t);\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tisStyleBookOpened: 'style-book' === canvasContainerView,\n\t\t\tshouldClearCanvasContainerView:\n\t\t\t\t'edit-site/global-styles' !==\n\t\t\t\t\tgetActiveComplementaryArea( 'core/edit-site' ) ||\n\t\t\t\t! _isVisualEditorMode ||\n\t\t\t\t! _isEditCanvasMode,\n\t\t\tshowListViewByDefault: _showListViewByDefault,\n\t\t\thasRevisions:\n\t\t\t\t!! globalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count,\n\t\t\tisRevisionsStyleBookOpened:\n\t\t\t\t'global-styles-revisions:style-book' === canvasContainerView,\n\t\t\tisRevisionsOpened:\n\t\t\t\t'global-styles-revisions' === canvasContainerView,\n\t\t};\n\t}, [] );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\n\tuseEffect( () => {\n\t\tif ( shouldClearCanvasContainerView ) {\n\t\t\tsetEditorCanvasContainerView( undefined );\n\t\t}\n\t}, [ shouldClearCanvasContainerView ] );\n\n\tconst { setIsListViewOpened } = useDispatch( editorStore );\n\tconst { goTo } = useNavigator();\n\n\tconst toggleRevisions = () => {\n\t\tsetIsListViewOpened( false );\n\t\tif ( isRevisionsStyleBookOpened ) {\n\t\t\tgoTo( '/' );\n\t\t\tsetEditorCanvasContainerView( 'style-book' );\n\t\t\treturn;\n\t\t}\n\t\tif ( isRevisionsOpened ) {\n\t\t\tgoTo( '/' );\n\t\t\tsetEditorCanvasContainerView( undefined );\n\t\t\treturn;\n\t\t}\n\t\tgoTo( '/revisions' );\n\n\t\tif ( isStyleBookOpened ) {\n\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t'global-styles-revisions:style-book'\n\t\t\t);\n\t\t} else {\n\t\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t\t}\n\t};\n\tconst toggleStyleBook = () => {\n\t\tif ( isRevisionsOpened ) {\n\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t'global-styles-revisions:style-book'\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tif ( isRevisionsStyleBookOpened ) {\n\t\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t\t\treturn;\n\t\t}\n\t\tsetIsListViewOpened( isStyleBookOpened && showListViewByDefault );\n\t\tsetEditorCanvasContainerView(\n\t\t\tisStyleBookOpened ? undefined : 'style-book'\n\t\t);\n\t};\n\n\treturn (\n\t\t<DefaultSidebar\n\t\t\tclassName=\"edit-site-global-styles-sidebar\"\n\t\t\tidentifier=\"edit-site/global-styles\"\n\t\t\ttitle={ __( 'Styles' ) }\n\t\t\ticon={ styles }\n\t\t\tcloseLabel={ __( 'Close Styles' ) }\n\t\t\tpanelClassName=\"edit-site-global-styles-sidebar__panel\"\n\t\t\theader={\n\t\t\t\t<Flex\n\t\t\t\t\tclassName=\"edit-site-global-styles-sidebar__header\"\n\t\t\t\t\trole=\"menubar\"\n\t\t\t\t\taria-label={ __( 'Styles actions' ) }\n\t\t\t\t>\n\t\t\t\t\t<FlexBlock style={ { minWidth: 'min-content' } }>\n\t\t\t\t\t\t<strong>{ __( 'Styles' ) }</strong>\n\t\t\t\t\t</FlexBlock>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\t\t\t\t\tisPressed={\n\t\t\t\t\t\t\t\tisStyleBookOpened || isRevisionsStyleBookOpened\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdisabled={ shouldClearCanvasContainerView }\n\t\t\t\t\t\t\tonClick={ toggleStyleBook }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tlabel={ __( 'Revisions' ) }\n\t\t\t\t\t\t\ticon={ backup }\n\t\t\t\t\t\t\tonClick={ toggleRevisions }\n\t\t\t\t\t\t\tdisabled={ ! hasRevisions }\n\t\t\t\t\t\t\tisPressed={\n\t\t\t\t\t\t\t\tisRevisionsOpened || isRevisionsStyleBookOpened\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<GlobalStylesMenuSlot />\n\t\t\t\t</Flex>\n\t\t\t}\n\t\t>\n\t\t\t<GlobalStylesUI />\n\t\t</DefaultSidebar>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAOA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GA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EAAG,IAAAd,QAAE,EAAE,YAAa,CAAG;MAC5Be,SAAS,EACR1D,iBAAiB,IAAII,0BACrB;MACDuD,QAAQ,EAAG5D,8BAAgC;MAC3C6D,OAAO,EAAGxB;IAAiB,CAC3B,CACQ,CAAC,EACX,IAAAC,MAAA,CAAAC,aAAA,EAACxD,WAAA,CAAAwE,QAAQ,QACR,IAAAjB,MAAA,CAAAC,aAAA,EAACxD,WAAA,CAAAyE,MAAM;MACNE,KAAK,EAAG,IAAAd,QAAE,EAAE,WAAY,CAAG;MAC3BC,IAAI,EAAGiB,aAAQ;MACfD,OAAO,EAAGzB,eAAiB;MAC3BwB,QAAQ,EAAG,CAAEzD,YAAc;MAC3BwD,SAAS,EACRvD,iBAAiB,IAAIC;IACrB,CACD,CACQ,CAAC,EACX,IAAAiC,MAAA,CAAAC,aAAA,EAAC3C,GAAA,CAAAmE,oBAAoB,MAAE,CAClB;EACN,GAED,IAAAzB,MAAA,CAAAC,aAAA,EAAC7C,aAAA,CAAAsE,cAAc,MAAE,CACF,CAAC;AAEnB"}
|
|
@@ -82,6 +82,6 @@ function PagePanels() {
|
|
|
82
82
|
postType: type
|
|
83
83
|
})), renderingMode !== 'post-only' && (0, _react.createElement)(_components.PanelBody, {
|
|
84
84
|
title: (0, _i18n.__)('Content')
|
|
85
|
-
}, (0, _react.createElement)(_pageContent.default, null)));
|
|
85
|
+
}, (0, _react.createElement)(_pageContent.default, null)), (0, _react.createElement)(_editor.PostLastRevisionPanel, null), (0, _react.createElement)(_editor.PostTaxonomiesPanel, null), (0, _react.createElement)(_editor.PostFeaturedImagePanel, null), (0, _react.createElement)(_editor.PostExcerptPanel, null), (0, _react.createElement)(_editor.PostDiscussionPanel, null), (0, _react.createElement)(_editor.PageAttributesPanel, null));
|
|
86
86
|
}
|
|
87
87
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_icons","_i18n","_date","_data","_coreData","_htmlEntities","_editor","_store","_sidebarCard","_interopRequireDefault","_pageContent","_pageSummary","PagePanels","id","type","hasResolved","status","date","password","title","modified","renderingMode","useSelect","select","getEditedPostContext","editSiteStore","getEditedEntityRecord","hasFinishedResolution","coreStore","getRenderingMode","editorStore","context","queryArgs","postType","postId","page","_react","createElement","Fragment","PanelBody","default","decodeEntities","icon","pageIcon","description","__experimentalVStack","__experimentalText","sprintf","__","humanTimeDiff"],"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/page-panels/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPanelBody,\n\t__experimentalText as Text,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { page as pageIcon } from '@wordpress/icons';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { humanTimeDiff } from '@wordpress/date';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport {
|
|
1
|
+
{"version":3,"names":["_components","require","_icons","_i18n","_date","_data","_coreData","_htmlEntities","_editor","_store","_sidebarCard","_interopRequireDefault","_pageContent","_pageSummary","PagePanels","id","type","hasResolved","status","date","password","title","modified","renderingMode","useSelect","select","getEditedPostContext","editSiteStore","getEditedEntityRecord","hasFinishedResolution","coreStore","getRenderingMode","editorStore","context","queryArgs","postType","postId","page","_react","createElement","Fragment","PanelBody","default","decodeEntities","icon","pageIcon","description","__experimentalVStack","__experimentalText","sprintf","__","humanTimeDiff","PostLastRevisionPanel","PostTaxonomiesPanel","PostFeaturedImagePanel","PostExcerptPanel","PostDiscussionPanel","PageAttributesPanel"],"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/page-panels/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPanelBody,\n\t__experimentalText as Text,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { page as pageIcon } from '@wordpress/icons';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { humanTimeDiff } from '@wordpress/date';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport {\n\tPageAttributesPanel,\n\tPostDiscussionPanel,\n\tPostExcerptPanel,\n\tPostFeaturedImagePanel,\n\tPostLastRevisionPanel,\n\tPostTaxonomiesPanel,\n\tstore as editorStore,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../../store';\nimport SidebarCard from '../sidebar-card';\nimport PageContent from './page-content';\nimport PageSummary from './page-summary';\n\nexport default function PagePanels() {\n\tconst {\n\t\tid,\n\t\ttype,\n\t\thasResolved,\n\t\tstatus,\n\t\tdate,\n\t\tpassword,\n\t\ttitle,\n\t\tmodified,\n\t\trenderingMode,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditedPostContext } = select( editSiteStore );\n\t\tconst { getEditedEntityRecord, hasFinishedResolution } =\n\t\t\tselect( coreStore );\n\t\tconst { getRenderingMode } = select( editorStore );\n\t\tconst context = getEditedPostContext();\n\t\tconst queryArgs = [ 'postType', context.postType, context.postId ];\n\t\tconst page = getEditedEntityRecord( ...queryArgs );\n\t\treturn {\n\t\t\thasResolved: hasFinishedResolution(\n\t\t\t\t'getEditedEntityRecord',\n\t\t\t\tqueryArgs\n\t\t\t),\n\t\t\ttitle: page?.title,\n\t\t\tid: page?.id,\n\t\t\ttype: page?.type,\n\t\t\tstatus: page?.status,\n\t\t\tdate: page?.date,\n\t\t\tpassword: page?.password,\n\t\t\tmodified: page?.modified,\n\t\t\trenderingMode: getRenderingMode(),\n\t\t};\n\t}, [] );\n\n\tif ( ! hasResolved ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<PanelBody>\n\t\t\t\t<SidebarCard\n\t\t\t\t\ttitle={ decodeEntities( title ) }\n\t\t\t\t\ticon={ pageIcon }\n\t\t\t\t\tdescription={\n\t\t\t\t\t\t<VStack>\n\t\t\t\t\t\t\t<Text>\n\t\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t\t// translators: %s: Human-readable time difference, e.g. \"2 days ago\".\n\t\t\t\t\t\t\t\t\t__( 'Last edited %s' ),\n\t\t\t\t\t\t\t\t\thumanTimeDiff( modified )\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t</VStack>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</PanelBody>\n\t\t\t<PanelBody title={ __( 'Summary' ) }>\n\t\t\t\t<PageSummary\n\t\t\t\t\tstatus={ status }\n\t\t\t\t\tdate={ date }\n\t\t\t\t\tpassword={ password }\n\t\t\t\t\tpostId={ id }\n\t\t\t\t\tpostType={ type }\n\t\t\t\t/>\n\t\t\t</PanelBody>\n\t\t\t{ renderingMode !== 'post-only' && (\n\t\t\t\t<PanelBody title={ __( 'Content' ) }>\n\t\t\t\t\t<PageContent />\n\t\t\t\t</PanelBody>\n\t\t\t) }\n\t\t\t<PostLastRevisionPanel />\n\t\t\t<PostTaxonomiesPanel />\n\t\t\t<PostFeaturedImagePanel />\n\t\t\t<PostExcerptPanel />\n\t\t\t<PostDiscussionPanel />\n\t\t\t<PageAttributesPanel />\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AAaA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,YAAA,GAAAC,sBAAA,CAAAV,OAAA;AACA,IAAAW,YAAA,GAAAD,sBAAA,CAAAV,OAAA;AACA,IAAAY,YAAA,GAAAF,sBAAA,CAAAV,OAAA;AA9BA;AACA;AACA;;AAsBA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EAAC/B,OAAA,CAAA+C,gBAAgB,MAAE,CAAC,EACpB,IAAAjB,MAAA,CAAAC,aAAA,EAAC/B,OAAA,CAAAgD,mBAAmB,MAAE,CAAC,EACvB,IAAAlB,MAAA,CAAAC,aAAA,EAAC/B,OAAA,CAAAiD,mBAAmB,MAAE,CACrB,CAAC;AAEL"}
|
|
@@ -6,8 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = PluginSidebarEditSite;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _interface = require("@wordpress/interface");
|
|
9
|
-
var _data = require("@wordpress/data");
|
|
10
|
-
var _preferences = require("@wordpress/preferences");
|
|
11
9
|
/**
|
|
12
10
|
* WordPress dependencies
|
|
13
11
|
*/
|
|
@@ -81,12 +79,10 @@ function PluginSidebarEditSite({
|
|
|
81
79
|
className,
|
|
82
80
|
...props
|
|
83
81
|
}) {
|
|
84
|
-
const showIconLabels = (0, _data.useSelect)(select => !!select(_preferences.store).get('core/edit-site', 'showIconLabels'), []);
|
|
85
82
|
return (0, _react.createElement)(_interface.ComplementaryArea, {
|
|
86
83
|
panelClassName: className,
|
|
87
84
|
className: "edit-site-sidebar-edit-mode",
|
|
88
85
|
scope: "core/edit-site",
|
|
89
|
-
showIconLabels: showIconLabels,
|
|
90
86
|
...props
|
|
91
87
|
});
|
|
92
88
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_interface","require","
|
|
1
|
+
{"version":3,"names":["_interface","require","PluginSidebarEditSite","className","props","_react","createElement","ComplementaryArea","panelClassName","scope"],"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/plugin-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ComplementaryArea } from '@wordpress/interface';\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\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\t{ ...props }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,UAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;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;AACe,SAASC,qBAAqBA,CAAE;EAAEC,SAAS;EAAE,GAAGC;AAAM,CAAC,EAAG;EACxE,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACN,UAAA,CAAAO,iBAAiB;IACjBC,cAAc,EAAGL,SAAW;IAC5BA,SAAS,EAAC,6BAA6B;IACvCM,KAAK,EAAC,gBAAgB;IAAA,GACjBL;EAAK,CACV,CAAC;AAEJ"}
|
|
@@ -15,10 +15,7 @@ var _icons = require("@wordpress/icons");
|
|
|
15
15
|
var _store = require("../../../store");
|
|
16
16
|
var _templateActions = _interopRequireDefault(require("./template-actions"));
|
|
17
17
|
var _templateAreas = _interopRequireDefault(require("./template-areas"));
|
|
18
|
-
var _lastRevision = _interopRequireDefault(require("./last-revision"));
|
|
19
18
|
var _sidebarCard = _interopRequireDefault(require("../sidebar-card"));
|
|
20
|
-
var _patternCategories = _interopRequireDefault(require("./pattern-categories"));
|
|
21
|
-
var _constants = require("../../../utils/constants");
|
|
22
19
|
/**
|
|
23
20
|
* WordPress dependencies
|
|
24
21
|
*/
|
|
@@ -37,8 +34,7 @@ function TemplatePanel() {
|
|
|
37
34
|
title,
|
|
38
35
|
description,
|
|
39
36
|
icon,
|
|
40
|
-
record
|
|
41
|
-
postType
|
|
37
|
+
record
|
|
42
38
|
} = (0, _data.useSelect)(select => {
|
|
43
39
|
const {
|
|
44
40
|
getEditedPostType,
|
|
@@ -58,16 +54,13 @@ function TemplatePanel() {
|
|
|
58
54
|
title: info.title,
|
|
59
55
|
description: info.description,
|
|
60
56
|
icon: info.icon,
|
|
61
|
-
record: _record
|
|
62
|
-
postType: type
|
|
57
|
+
record: _record
|
|
63
58
|
};
|
|
64
59
|
}, []);
|
|
65
60
|
if (!title && !description) {
|
|
66
61
|
return null;
|
|
67
62
|
}
|
|
68
|
-
return (0, _react.createElement)(_components.PanelBody, {
|
|
69
|
-
className: "edit-site-template-panel"
|
|
70
|
-
}, (0, _react.createElement)(_sidebarCard.default, {
|
|
63
|
+
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_components.PanelBody, null, (0, _react.createElement)(_sidebarCard.default, {
|
|
71
64
|
className: "edit-site-template-card",
|
|
72
65
|
title: (0, _htmlEntities.decodeEntities)(title),
|
|
73
66
|
icon: (_CARD_ICONS$record$ty = CARD_ICONS[record?.type]) !== null && _CARD_ICONS$record$ty !== void 0 ? _CARD_ICONS$record$ty : icon,
|
|
@@ -75,8 +68,6 @@ function TemplatePanel() {
|
|
|
75
68
|
actions: (0, _react.createElement)(_templateActions.default, {
|
|
76
69
|
template: record
|
|
77
70
|
})
|
|
78
|
-
}, (0, _react.createElement)(_templateAreas.default, null)), (0, _react.createElement)(
|
|
79
|
-
post: record
|
|
80
|
-
}));
|
|
71
|
+
}, (0, _react.createElement)(_templateAreas.default, null))), (0, _react.createElement)(_editor.PostLastRevisionPanel, null), (0, _react.createElement)(_editor.PostTaxonomiesPanel, null), (0, _react.createElement)(_editor.PostFeaturedImagePanel, null), (0, _react.createElement)(_editor.PostExcerptPanel, null), (0, _react.createElement)(_editor.PostDiscussionPanel, null), (0, _react.createElement)(_editor.PageAttributesPanel, null));
|
|
81
72
|
}
|
|
82
73
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_components","_editor","_coreData","_htmlEntities","_icons","_store","_templateActions","_interopRequireDefault","_templateAreas","
|
|
1
|
+
{"version":3,"names":["_data","require","_components","_editor","_coreData","_htmlEntities","_icons","_store","_templateActions","_interopRequireDefault","_templateAreas","_sidebarCard","CARD_ICONS","wp_block","symbol","wp_navigation","navigation","TemplatePanel","_CARD_ICONS$record$ty","title","description","icon","record","useSelect","select","getEditedPostType","getEditedPostId","editSiteStore","getEditedEntityRecord","coreStore","__experimentalGetTemplateInfo","getTemplateInfo","editorStore","type","postId","_record","info","_react","createElement","Fragment","PanelBody","default","className","decodeEntities","actions","template","PostLastRevisionPanel","PostTaxonomiesPanel","PostFeaturedImagePanel","PostExcerptPanel","PostDiscussionPanel","PageAttributesPanel"],"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/template-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { PanelBody } from '@wordpress/components';\nimport {\n\tPageAttributesPanel,\n\tPostDiscussionPanel,\n\tPostExcerptPanel,\n\tPostFeaturedImagePanel,\n\tPostLastRevisionPanel,\n\tPostTaxonomiesPanel,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { navigation, symbol } 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 SidebarCard from '../sidebar-card';\n\nconst CARD_ICONS = {\n\twp_block: symbol,\n\twp_navigation: navigation,\n};\n\nexport default function TemplatePanel() {\n\tconst { title, description, icon, record } = 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 type = getEditedPostType();\n\t\tconst postId = getEditedPostId();\n\t\tconst _record = getEditedEntityRecord( 'postType', type, postId );\n\t\tconst info = getTemplateInfo( _record );\n\n\t\treturn {\n\t\t\ttitle: info.title,\n\t\t\tdescription: info.description,\n\t\t\ticon: info.icon,\n\t\t\trecord: _record,\n\t\t};\n\t}, [] );\n\n\tif ( ! title && ! description ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<PanelBody>\n\t\t\t\t<SidebarCard\n\t\t\t\t\tclassName=\"edit-site-template-card\"\n\t\t\t\t\ttitle={ decodeEntities( title ) }\n\t\t\t\t\ticon={ CARD_ICONS[ record?.type ] ?? icon }\n\t\t\t\t\tdescription={ decodeEntities( description ) }\n\t\t\t\t\tactions={ <TemplateActions template={ record } /> }\n\t\t\t\t>\n\t\t\t\t\t<TemplateAreas />\n\t\t\t\t</SidebarCard>\n\t\t\t</PanelBody>\n\t\t\t<PostLastRevisionPanel />\n\t\t\t<PostTaxonomiesPanel />\n\t\t\t<PostFeaturedImagePanel />\n\t\t\t<PostExcerptPanel />\n\t\t\t<PostDiscussionPanel />\n\t\t\t<PageAttributesPanel />\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AASA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,gBAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,cAAA,GAAAD,sBAAA,CAAAR,OAAA;AACA,IAAAU,YAAA,GAAAF,sBAAA,CAAAR,OAA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,EAAG,IAAAwB,4BAAc,EAAExB,KAAM,CAAG;IACjCE,IAAI,GAAAH,qBAAA,GAAGN,UAAU,CAAEU,MAAM,EAAEW,IAAI,CAAE,cAAAf,qBAAA,cAAAA,qBAAA,GAAIG,IAAM;IAC3CD,WAAW,EAAG,IAAAuB,4BAAc,EAAEvB,WAAY,CAAG;IAC7CwB,OAAO,EAAG,IAAAP,MAAA,CAAAC,aAAA,EAAC9B,gBAAA,CAAAiC,OAAe;MAACI,QAAQ,EAAGvB;IAAQ,CAAE;EAAG,GAEnD,IAAAe,MAAA,CAAAC,aAAA,EAAC5B,cAAA,CAAA+B,OAAa,MAAE,CACJ,CACH,CAAC,EACZ,IAAAJ,MAAA,CAAAC,aAAA,EAACnC,OAAA,CAAA2C,qBAAqB,MAAE,CAAC,EACzB,IAAAT,MAAA,CAAAC,aAAA,EAACnC,OAAA,CAAA4C,mBAAmB,MAAE,CAAC,EACvB,IAAAV,MAAA,CAAAC,aAAA,EAACnC,OAAA,CAAA6C,sBAAsB,MAAE,CAAC,EAC1B,IAAAX,MAAA,CAAAC,aAAA,EAACnC,OAAA,CAAA8C,gBAAgB,MAAE,CAAC,EACpB,IAAAZ,MAAA,CAAAC,aAAA,EAACnC,OAAA,CAAA+C,mBAAmB,MAAE,CAAC,EACvB,IAAAb,MAAA,CAAAC,aAAA,EAACnC,OAAA,CAAAgD,mBAAmB,MAAE,CACrB,CAAC;AAEL"}
|
|
@@ -42,7 +42,7 @@ function SidebarNavigationScreenDetailsFooter({
|
|
|
42
42
|
return (0, _react.createElement)(_components.__experimentalItemGroup, {
|
|
43
43
|
className: "edit-site-sidebar-navigation-screen-details-footer"
|
|
44
44
|
}, (0, _react.createElement)(_sidebarNavigationItem.default, {
|
|
45
|
-
label: (0, _i18n.__)('Revisions'),
|
|
45
|
+
"aria-label": (0, _i18n.__)('Revisions'),
|
|
46
46
|
...hrefProps,
|
|
47
47
|
...otherProps
|
|
48
48
|
}, (0, _react.createElement)(_sidebarNavigationScreenDetailsPanel.SidebarNavigationScreenDetailsPanelRow, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_date","_element","_url","_components","_icons","_sidebarNavigationScreenDetailsPanel","_sidebarNavigationItem","_interopRequireDefault","SidebarNavigationScreenDetailsFooter","record","otherProps","hrefProps","_links","id","href","addQueryArgs","revision","as","_react","createElement","__experimentalItemGroup","className","default","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_date","_element","_url","_components","_icons","_sidebarNavigationScreenDetailsPanel","_sidebarNavigationItem","_interopRequireDefault","SidebarNavigationScreenDetailsFooter","record","otherProps","hrefProps","_links","id","href","addQueryArgs","revision","as","_react","createElement","__experimentalItemGroup","className","default","__","SidebarNavigationScreenDetailsPanelRow","justify","SidebarNavigationScreenDetailsPanelLabel","SidebarNavigationScreenDetailsPanelValue","createInterpolateElement","sprintf","humanTimeDiff","modified","time","dateTime","Icon","icon","backup"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-details-footer/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { humanTimeDiff } from '@wordpress/date';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { addQueryArgs } from '@wordpress/url';\nimport {\n\tIcon,\n\t__experimentalItemGroup as ItemGroup,\n} from '@wordpress/components';\nimport { backup } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport {\n\tSidebarNavigationScreenDetailsPanelRow,\n\tSidebarNavigationScreenDetailsPanelLabel,\n\tSidebarNavigationScreenDetailsPanelValue,\n} from '../sidebar-navigation-screen-details-panel';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\n\nexport default function SidebarNavigationScreenDetailsFooter( {\n\trecord,\n\t...otherProps\n} ) {\n\t/*\n\t * There might be other items in the future,\n\t * but for now it's just modified date.\n\t * Later we might render a list of items and isolate\n\t * the following logic.\n\t */\n\tconst hrefProps = {};\n\tif ( record?._links?.[ 'predecessor-version' ]?.[ 0 ]?.id ) {\n\t\threfProps.href = addQueryArgs( 'revision.php', {\n\t\t\trevision: record?._links[ 'predecessor-version' ][ 0 ].id,\n\t\t} );\n\t\threfProps.as = 'a';\n\t}\n\n\treturn (\n\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-details-footer\">\n\t\t\t<SidebarNavigationItem\n\t\t\t\taria-label={ __( 'Revisions' ) }\n\t\t\t\t{ ...hrefProps }\n\t\t\t\t{ ...otherProps }\n\t\t\t>\n\t\t\t\t<SidebarNavigationScreenDetailsPanelRow justify=\"space-between\">\n\t\t\t\t\t<SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t\t{ __( 'Last modified' ) }\n\t\t\t\t\t</SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t<SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: is the relative time when the post was last modified. */\n\t\t\t\t\t\t\t\t__( '<time>%s</time>' ),\n\t\t\t\t\t\t\t\thumanTimeDiff( record.modified )\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttime: <time dateTime={ record.modified } />,\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) }\n\t\t\t\t\t</SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t<Icon\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-details-footer__icon\"\n\t\t\t\t\t\ticon={ backup }\n\t\t\t\t\t/>\n\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t</SidebarNavigationItem>\n\t\t</ItemGroup>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,IAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAA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;IACCC,IAAI,EAAE,IAAAd,MAAA,CAAAC,aAAA;MAAMc,QAAQ,EAAGxB,MAAM,CAACsB;IAAU,CAAE;EAC3C,CACD,CACyC,CAAC,EAC3C,IAAAb,MAAA,CAAAC,aAAA,EAAChB,WAAA,CAAA+B,IAAI;IACJb,SAAS,EAAC,0DAA0D;IACpEc,IAAI,EAAGC;EAAQ,CACf,CACsC,CAClB,CACb,CAAC;AAEd"}
|
|
@@ -15,6 +15,7 @@ var _components = require("@wordpress/components");
|
|
|
15
15
|
var _compose = require("@wordpress/compose");
|
|
16
16
|
var _blockEditor = require("@wordpress/block-editor");
|
|
17
17
|
var _element = require("@wordpress/element");
|
|
18
|
+
var _editor = require("@wordpress/editor");
|
|
18
19
|
var _sidebarNavigationScreen = _interopRequireDefault(require("../sidebar-navigation-screen"));
|
|
19
20
|
var _styleVariationsContainer = _interopRequireDefault(require("../global-styles/style-variations-container"));
|
|
20
21
|
var _lockUnlock = require("../../lock-unlock");
|
|
@@ -87,9 +88,11 @@ function SidebarNavigationScreenGlobalStyles() {
|
|
|
87
88
|
isLoading: isLoadingRevisions
|
|
88
89
|
} = (0, _useGlobalStylesRevisions.default)();
|
|
89
90
|
const {
|
|
90
|
-
openGeneralSidebar
|
|
91
|
-
setIsListViewOpened
|
|
91
|
+
openGeneralSidebar
|
|
92
92
|
} = (0, _data.useDispatch)(_store.store);
|
|
93
|
+
const {
|
|
94
|
+
setIsListViewOpened
|
|
95
|
+
} = (0, _data.useDispatch)(_editor.store);
|
|
93
96
|
const isMobileViewport = (0, _compose.useViewportMatch)('medium', '<');
|
|
94
97
|
const {
|
|
95
98
|
setCanvasMode,
|