@wordpress/edit-site 5.25.0 → 5.25.1-next.79a6196f.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/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/sidebar-navigation-screen-templates/index.js +63 -8
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- 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/sidebar-navigation-screen-templates/index.js +64 -9
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- 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 +366 -268
- package/build-style/style.css +366 -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/sidebar-navigation-screen-templates/index.js +85 -28
- package/src/components/sidebar-navigation-screen-templates/style.scss +9 -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 +2 -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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["VisuallyHidden","__experimentalHeading","Heading","__experimentalText","Text","__experimentalVStack","VStack","__","useEntityRecords","decodeEntities","Page","Table","Link","AddedBy","TemplateActions","AddNewTemplate","TEMPLATE_POST_TYPE","PageTemplates","records","templates","per_page","columns","header","cell","template","createElement","as","level","params","postId","id","postType","type","canvas","title","rendered","slug","description","variant","maxWidth","actions","templateType","showIcon","toggleProps","data"],"sources":["@wordpress/edit-site/src/components/page-templates/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tVisuallyHidden,\n\t__experimentalHeading as Heading,\n\t__experimentalText as Text,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useEntityRecords } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport Page from '../page';\nimport Table from '../table';\nimport Link from '../routes/link';\nimport AddedBy from '../list/added-by';\nimport TemplateActions from '../template-actions';\nimport AddNewTemplate from '../add-new-template';\nimport { TEMPLATE_POST_TYPE } from '../../utils/constants';\n\nexport default function PageTemplates() {\n\tconst { records: templates } = useEntityRecords(\n\t\t'postType',\n\t\tTEMPLATE_POST_TYPE,\n\t\t{\n\t\t\tper_page: -1,\n\t\t}\n\t);\n\n\tconst columns = [\n\t\t{\n\t\t\theader: __( 'Template' ),\n\t\t\tcell: ( template ) => (\n\t\t\t\t<VStack>\n\t\t\t\t\t<Heading as=\"h3\" level={ 5 }>\n\t\t\t\t\t\t<Link\n\t\t\t\t\t\t\tparams={ {\n\t\t\t\t\t\t\t\tpostId: template.id,\n\t\t\t\t\t\t\t\tpostType: template.type,\n\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ decodeEntities(\n\t\t\t\t\t\t\t\ttemplate.title?.rendered || template.slug\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Link>\n\t\t\t\t\t</Heading>\n\t\t\t\t\t{ template.description && (\n\t\t\t\t\t\t<Text variant=\"muted\">\n\t\t\t\t\t\t\t{ decodeEntities( template.description ) }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t) }\n\t\t\t\t</VStack>\n\t\t\t),\n\t\t\tmaxWidth: 400,\n\t\t},\n\t\t{\n\t\t\theader: __( 'Added by' ),\n\t\t\tcell: ( template ) => (\n\t\t\t\t<AddedBy postType={ template.type } postId={ template.id } />\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\theader: <VisuallyHidden>{ __( 'Actions' ) }</VisuallyHidden>,\n\t\t\tcell: ( template ) => (\n\t\t\t\t<TemplateActions\n\t\t\t\t\tpostType={ template.type }\n\t\t\t\t\tpostId={ template.id }\n\t\t\t\t/>\n\t\t\t),\n\t\t},\n\t];\n\n\treturn (\n\t\t<Page\n\t\t\ttitle={ __( 'Templates' ) }\n\t\t\tactions={\n\t\t\t\t<AddNewTemplate\n\t\t\t\t\ttemplateType={ TEMPLATE_POST_TYPE }\n\t\t\t\t\tshowIcon={ false }\n\t\t\t\t\ttoggleProps={ { variant: 'primary' } }\n\t\t\t\t/>\n\t\t\t}\n\t\t>\n\t\t\t{ templates && <Table data={ templates } columns={ columns } /> }\n\t\t</Page>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,cAAc,EACdC,qBAAqB,IAAIC,OAAO,EAChCC,kBAAkB,IAAIC,IAAI,EAC1BC,oBAAoB,IAAIC,MAAM,QACxB,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,gBAAgB,QAAQ,sBAAsB;AACvD,SAASC,cAAc,QAAQ,0BAA0B;;AAEzD;AACA;AACA;AACA,OAAOC,IAAI,MAAM,SAAS;AAC1B,OAAOC,KAAK,MAAM,UAAU;AAC5B,OAAOC,IAAI,MAAM,gBAAgB;AACjC,OAAOC,OAAO,MAAM,kBAAkB;AACtC,OAAOC,eAAe,MAAM,qBAAqB;AACjD,OAAOC,cAAc,MAAM,qBAAqB;AAChD,SAASC,kBAAkB,QAAQ,uBAAuB;AAE1D,eAAe,SAASC,aAAaA,CAAA,EAAG;EACvC,MAAM;IAAEC,OAAO,EAAEC;EAAU,CAAC,GAAGX,gBAAgB,CAC9C,UAAU,EACVQ,kBAAkB,EAClB;IACCI,QAAQ,EAAE,CAAC;EACZ,CACD,CAAC;EAED,MAAMC,OAAO,GAAG,CACf;IACCC,MAAM,EAAEf,EAAE,CAAE,UAAW,CAAC;IACxBgB,IAAI,EAAIC,QAAQ,IACfC,aAAA,CAACnB,MAAM,QACNmB,aAAA,CAACvB,OAAO;MAACwB,EAAE,EAA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D,CAAC;AAET"}
|
|
1
|
+
{"version":3,"names":["removeAccents","Icon","__experimentalView","View","__experimentalText","Text","__experimentalHStack","HStack","__experimentalVStack","VStack","VisuallyHidden","__","useState","useMemo","useCallback","useEntityRecords","decodeEntities","ENTER","SPACE","parse","BlockPreview","privateApis","blockEditorPrivateApis","DataViews","sortByTextFields","getPaginationResults","routerPrivateApis","Page","Link","AddNewTemplate","useAddedBy","AvatarImage","TEMPLATE_POST_TYPE","ENUMERATION_TYPE","OPERATOR_IN","OPERATOR_NOT_IN","LAYOUT_GRID","LAYOUT_TABLE","LAYOUT_LIST","useResetTemplateAction","deleteTemplateAction","renameTemplateAction","postRevisionsAction","usePatternSettings","unlock","PostPreview","ExperimentalBlockEditorProvider","useGlobalStyle","useHistory","EMPTY_ARRAY","defaultConfigPerViewType","mediaField","primaryField","DEFAULT_VIEW","type","search","page","perPage","hiddenFields","layout","filters","normalizeSearchInput","input","trim","toLowerCase","TemplateTitle","item","viewType","createElement","Fragment","title","rendered","spacing","as","className","params","postId","id","postType","canvas","AuthorField","text","icon","imageUrl","withIcon","alignment","TemplatePreview","content","settings","backgroundColor","blocks","length","style","DataviewsTemplates","templateId","setTemplateId","view","setView","records","allTemplates","isResolving","isLoadingData","per_page","history","onSelectionChange","items","authors","authorsSet","Set","forEach","template","add","author_text","Array","from","map","author","value","label","fields","header","render","raw","minWidth","maxWidth","enableSorting","getValue","enableHiding","description","variant","elements","data","paginationInfo","totalItems","totalPages","filteredTemplates","normalizedSearch","filter","slug","includes","field","operator","sort","textFields","resetTemplateAction","actions","onChangeView","newView","templateType","showIcon","toggleProps","isLoading","deferredRendering","tabIndex","role","onKeyDown","event","keyCode","push","onClick","display","flexDirection","justifyContent","textAlign","height"],"sources":["@wordpress/edit-site/src/components/page-templates/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport removeAccents from 'remove-accents';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tIcon,\n\t__experimentalView as View,\n\t__experimentalText as Text,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tVisuallyHidden,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useMemo, useCallback } from '@wordpress/element';\nimport { useEntityRecords } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { ENTER, SPACE } from '@wordpress/keycodes';\nimport { parse } from '@wordpress/blocks';\nimport {\n\tBlockPreview,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport {\n\tDataViews,\n\tsortByTextFields,\n\tgetPaginationResults,\n} from '@wordpress/dataviews';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport Page from '../page';\nimport Link from '../routes/link';\nimport AddNewTemplate from '../add-new-template';\nimport { useAddedBy, AvatarImage } from '../list/added-by';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tENUMERATION_TYPE,\n\tOPERATOR_IN,\n\tOPERATOR_NOT_IN,\n\tLAYOUT_GRID,\n\tLAYOUT_TABLE,\n\tLAYOUT_LIST,\n} from '../../utils/constants';\nimport {\n\tuseResetTemplateAction,\n\tdeleteTemplateAction,\n\trenameTemplateAction,\n} from './template-actions';\nimport { postRevisionsAction } from '../actions';\nimport usePatternSettings from '../page-patterns/use-pattern-settings';\nimport { unlock } from '../../lock-unlock';\nimport PostPreview from '../post-preview';\n\nconst { ExperimentalBlockEditorProvider, useGlobalStyle } = unlock(\n\tblockEditorPrivateApis\n);\nconst { useHistory } = unlock( routerPrivateApis );\n\nconst EMPTY_ARRAY = [];\n\nconst defaultConfigPerViewType = {\n\t[ LAYOUT_TABLE ]: {},\n\t[ LAYOUT_GRID ]: {\n\t\tmediaField: 'preview',\n\t\tprimaryField: 'title',\n\t},\n\t[ LAYOUT_LIST ]: {\n\t\tprimaryField: 'title',\n\t\tmediaField: 'preview',\n\t},\n};\n\nconst DEFAULT_VIEW = {\n\ttype: LAYOUT_TABLE,\n\tsearch: '',\n\tpage: 1,\n\tperPage: 20,\n\t// All fields are visible by default, so it's\n\t// better to keep track of the hidden ones.\n\thiddenFields: [ 'preview' ],\n\tlayout: {},\n\tfilters: [],\n};\n\nfunction normalizeSearchInput( input = '' ) {\n\treturn removeAccents( input.trim().toLowerCase() );\n}\n\nfunction TemplateTitle( { item, viewType } ) {\n\tif ( viewType === LAYOUT_LIST ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ decodeEntities( item.title?.rendered ) || __( '(no title)' ) }\n\t\t\t</>\n\t\t);\n\t}\n\n\treturn (\n\t\t<VStack spacing={ 1 }>\n\t\t\t<View as=\"span\" className=\"dataviews-view-grid__title-field\">\n\t\t\t\t<Link\n\t\t\t\t\tparams={ {\n\t\t\t\t\t\tpostId: item.id,\n\t\t\t\t\t\tpostType: item.type,\n\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ decodeEntities( item.title?.rendered ) ||\n\t\t\t\t\t\t__( '(no title)' ) }\n\t\t\t\t</Link>\n\t\t\t</View>\n\t\t</VStack>\n\t);\n}\n\nfunction AuthorField( { item, viewType } ) {\n\tconst { text, icon, imageUrl } = useAddedBy( item.type, item.id );\n\tconst withIcon = viewType !== LAYOUT_LIST;\n\n\treturn (\n\t\t<HStack alignment=\"left\" spacing={ 1 }>\n\t\t\t{ withIcon && imageUrl && <AvatarImage imageUrl={ imageUrl } /> }\n\t\t\t{ withIcon && ! imageUrl && (\n\t\t\t\t<div className=\"edit-site-list-added-by__icon\">\n\t\t\t\t\t<Icon icon={ icon } />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<span>{ text }</span>\n\t\t</HStack>\n\t);\n}\n\nfunction TemplatePreview( { content, viewType } ) {\n\tconst settings = usePatternSettings();\n\tconst [ backgroundColor = 'white' ] = useGlobalStyle( 'color.background' );\n\tconst blocks = useMemo( () => {\n\t\treturn parse( content );\n\t}, [ content ] );\n\tif ( ! blocks?.length ) {\n\t\treturn null;\n\t}\n\t// Wrap everything in a block editor provider to ensure 'styles' that are needed\n\t// for the previews are synced between the site editor store and the block editor store.\n\t// Additionally we need to have the `__experimentalBlockPatterns` setting in order to\n\t// render patterns inside the previews.\n\t// TODO: Same approach is used in the patterns list and it becomes obvious that some of\n\t// the block editor settings are needed in context where we don't have the block editor.\n\t// Explore how we can solve this in a better way.\n\treturn (\n\t\t<ExperimentalBlockEditorProvider settings={ settings }>\n\t\t\t<div\n\t\t\t\tclassName={ `page-templates-preview-field is-viewtype-${ viewType }` }\n\t\t\t\tstyle={ { backgroundColor } }\n\t\t\t>\n\t\t\t\t<BlockPreview blocks={ blocks } />\n\t\t\t</div>\n\t\t</ExperimentalBlockEditorProvider>\n\t);\n}\n\nexport default function DataviewsTemplates() {\n\tconst [ templateId, setTemplateId ] = useState( null );\n\tconst [ view, setView ] = useState( DEFAULT_VIEW );\n\tconst { records: allTemplates, isResolving: isLoadingData } =\n\t\tuseEntityRecords( 'postType', TEMPLATE_POST_TYPE, {\n\t\t\tper_page: -1,\n\t\t} );\n\tconst history = useHistory();\n\n\tconst onSelectionChange = useCallback(\n\t\t( items ) =>\n\t\t\tsetTemplateId( items?.length === 1 ? items[ 0 ].id : null ),\n\t\t[ setTemplateId ]\n\t);\n\n\tconst authors = useMemo( () => {\n\t\tif ( ! allTemplates ) {\n\t\t\treturn EMPTY_ARRAY;\n\t\t}\n\t\tconst authorsSet = new Set();\n\t\tallTemplates.forEach( ( template ) => {\n\t\t\tauthorsSet.add( template.author_text );\n\t\t} );\n\t\treturn Array.from( authorsSet ).map( ( author ) => ( {\n\t\t\tvalue: author,\n\t\t\tlabel: author,\n\t\t} ) );\n\t}, [ allTemplates ] );\n\n\tconst fields = useMemo(\n\t\t() => [\n\t\t\t{\n\t\t\t\theader: __( 'Preview' ),\n\t\t\t\tid: 'preview',\n\t\t\t\trender: ( { item } ) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<TemplatePreview\n\t\t\t\t\t\t\tcontent={ item.content.raw }\n\t\t\t\t\t\t\tviewType={ view.type }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tminWidth: 120,\n\t\t\t\tmaxWidth: 120,\n\t\t\t\tenableSorting: false,\n\t\t\t},\n\t\t\t{\n\t\t\t\theader: __( 'Template' ),\n\t\t\t\tid: 'title',\n\t\t\t\tgetValue: ( { item } ) => item.title?.rendered,\n\t\t\t\trender: ( { item } ) => (\n\t\t\t\t\t<TemplateTitle item={ item } viewType={ view.type } />\n\t\t\t\t),\n\t\t\t\tmaxWidth: 400,\n\t\t\t\tenableHiding: false,\n\t\t\t},\n\t\t\t{\n\t\t\t\theader: __( 'Description' ),\n\t\t\t\tid: 'description',\n\t\t\t\tgetValue: ( { item } ) => item.description,\n\t\t\t\trender: ( { item } ) => {\n\t\t\t\t\treturn item.description ? (\n\t\t\t\t\t\tdecodeEntities( item.description )\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<Text variant=\"muted\" aria-hidden=\"true\">\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\t<VisuallyHidden>\n\t\t\t\t\t\t\t\t{ __( 'No description.' ) }\n\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t</>\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tmaxWidth: 200,\n\t\t\t\tenableSorting: false,\n\t\t\t},\n\t\t\t{\n\t\t\t\theader: __( 'Author' ),\n\t\t\t\tid: 'author',\n\t\t\t\tgetValue: ( { item } ) => item.author_text,\n\t\t\t\trender: ( { item } ) => {\n\t\t\t\t\treturn <AuthorField viewType={ view.type } item={ item } />;\n\t\t\t\t},\n\t\t\t\tenableHiding: false,\n\t\t\t\ttype: ENUMERATION_TYPE,\n\t\t\t\telements: authors,\n\t\t\t},\n\t\t],\n\t\t[ authors, view.type ]\n\t);\n\n\tconst { data, paginationInfo } = useMemo( () => {\n\t\tif ( ! allTemplates ) {\n\t\t\treturn {\n\t\t\t\tdata: EMPTY_ARRAY,\n\t\t\t\tpaginationInfo: { totalItems: 0, totalPages: 0 },\n\t\t\t};\n\t\t}\n\t\tlet filteredTemplates = [ ...allTemplates ];\n\t\t// Handle global search.\n\t\tif ( view.search ) {\n\t\t\tconst normalizedSearch = normalizeSearchInput( view.search );\n\t\t\tfilteredTemplates = filteredTemplates.filter( ( item ) => {\n\t\t\t\tconst title = item.title?.rendered || item.slug;\n\t\t\t\treturn (\n\t\t\t\t\tnormalizeSearchInput( title ).includes(\n\t\t\t\t\t\tnormalizedSearch\n\t\t\t\t\t) ||\n\t\t\t\t\tnormalizeSearchInput( item.description ).includes(\n\t\t\t\t\t\tnormalizedSearch\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} );\n\t\t}\n\n\t\t// Handle filters.\n\t\tif ( view.filters.length > 0 ) {\n\t\t\tview.filters.forEach( ( filter ) => {\n\t\t\t\tif (\n\t\t\t\t\tfilter.field === 'author' &&\n\t\t\t\t\tfilter.operator === OPERATOR_IN &&\n\t\t\t\t\t!! filter.value\n\t\t\t\t) {\n\t\t\t\t\tfilteredTemplates = filteredTemplates.filter( ( item ) => {\n\t\t\t\t\t\treturn item.author_text === filter.value;\n\t\t\t\t\t} );\n\t\t\t\t} else if (\n\t\t\t\t\tfilter.field === 'author' &&\n\t\t\t\t\tfilter.operator === OPERATOR_NOT_IN &&\n\t\t\t\t\t!! filter.value\n\t\t\t\t) {\n\t\t\t\t\tfilteredTemplates = filteredTemplates.filter( ( item ) => {\n\t\t\t\t\t\treturn item.author_text !== filter.value;\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t// Handle sorting.\n\t\tif ( view.sort ) {\n\t\t\tfilteredTemplates = sortByTextFields( {\n\t\t\t\tdata: filteredTemplates,\n\t\t\t\tview,\n\t\t\t\tfields,\n\t\t\t\ttextFields: [ 'title' ],\n\t\t\t} );\n\t\t}\n\t\t// Handle pagination.\n\t\treturn getPaginationResults( {\n\t\t\tdata: filteredTemplates,\n\t\t\tview,\n\t\t} );\n\t}, [ allTemplates, view, fields ] );\n\n\tconst resetTemplateAction = useResetTemplateAction();\n\tconst actions = useMemo(\n\t\t() => [\n\t\t\tresetTemplateAction,\n\t\t\tdeleteTemplateAction,\n\t\t\trenameTemplateAction,\n\t\t\tpostRevisionsAction,\n\t\t],\n\t\t[ resetTemplateAction ]\n\t);\n\n\tconst onChangeView = useCallback(\n\t\t( newView ) => {\n\t\t\tif ( newView.type !== view.type ) {\n\t\t\t\tnewView = {\n\t\t\t\t\t...newView,\n\t\t\t\t\tlayout: {\n\t\t\t\t\t\t...defaultConfigPerViewType[ newView.type ],\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tsetView( newView );\n\t\t},\n\t\t[ view.type, setView ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<Page\n\t\t\t\tclassName={\n\t\t\t\t\tview.type === LAYOUT_LIST\n\t\t\t\t\t\t? 'edit-site-template-pages-list-view'\n\t\t\t\t\t\t: null\n\t\t\t\t}\n\t\t\t\ttitle={ __( 'Templates' ) }\n\t\t\t\tactions={\n\t\t\t\t\t<AddNewTemplate\n\t\t\t\t\t\ttemplateType={ TEMPLATE_POST_TYPE }\n\t\t\t\t\t\tshowIcon={ false }\n\t\t\t\t\t\ttoggleProps={ { variant: 'primary' } }\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<DataViews\n\t\t\t\t\tpaginationInfo={ paginationInfo }\n\t\t\t\t\tfields={ fields }\n\t\t\t\t\tactions={ actions }\n\t\t\t\t\tdata={ data }\n\t\t\t\t\tisLoading={ isLoadingData }\n\t\t\t\t\tview={ view }\n\t\t\t\t\tonChangeView={ onChangeView }\n\t\t\t\t\tonSelectionChange={ onSelectionChange }\n\t\t\t\t\tdeferredRendering={\n\t\t\t\t\t\t! view.hiddenFields?.includes( 'preview' )\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</Page>\n\t\t\t{ view.type === LAYOUT_LIST && (\n\t\t\t\t<Page>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"edit-site-template-pages-preview\"\n\t\t\t\t\t\ttabIndex={ 0 }\n\t\t\t\t\t\trole=\"button\"\n\t\t\t\t\t\tonKeyDown={ ( event ) => {\n\t\t\t\t\t\t\tconst { keyCode } = event;\n\t\t\t\t\t\t\tif ( keyCode === ENTER || keyCode === SPACE ) {\n\t\t\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\t\t\tpostId: templateId,\n\t\t\t\t\t\t\t\t\tpostType: TEMPLATE_POST_TYPE,\n\t\t\t\t\t\t\t\t\tcanvas: 'edit',\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\tonClick={ () =>\n\t\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\t\tpostId: templateId,\n\t\t\t\t\t\t\t\tpostType: TEMPLATE_POST_TYPE,\n\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ templateId !== null ? (\n\t\t\t\t\t\t\t<PostPreview\n\t\t\t\t\t\t\t\tpostId={ templateId }\n\t\t\t\t\t\t\t\tpostType={ TEMPLATE_POST_TYPE }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t\tdisplay: 'flex',\n\t\t\t\t\t\t\t\t\tflexDirection: 'column',\n\t\t\t\t\t\t\t\t\tjustifyContent: 'center',\n\t\t\t\t\t\t\t\t\ttextAlign: 'center',\n\t\t\t\t\t\t\t\t\theight: '100%',\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<p>{ __( 'Select a template to preview' ) }</p>\n\t\t\t\t\t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
7
|
/**
|
|
3
8
|
* WordPress dependencies
|
|
4
9
|
*/
|
|
@@ -8,15 +13,22 @@ export default function Pagination({
|
|
|
8
13
|
currentPage,
|
|
9
14
|
numPages,
|
|
10
15
|
changePage,
|
|
11
|
-
totalItems
|
|
16
|
+
totalItems,
|
|
17
|
+
className,
|
|
18
|
+
disabled = false,
|
|
19
|
+
buttonVariant = 'tertiary',
|
|
20
|
+
label = __('Pagination Navigation')
|
|
12
21
|
}) {
|
|
13
22
|
return createElement(HStack, {
|
|
14
23
|
expanded: false,
|
|
24
|
+
as: "nav",
|
|
25
|
+
"aria-label": label,
|
|
15
26
|
spacing: 3,
|
|
16
27
|
justify: "flex-start",
|
|
17
|
-
className:
|
|
28
|
+
className: classnames('edit-site-pagination', className)
|
|
18
29
|
}, createElement(Text, {
|
|
19
|
-
variant: "muted"
|
|
30
|
+
variant: "muted",
|
|
31
|
+
className: "edit-site-pagination__total"
|
|
20
32
|
},
|
|
21
33
|
// translators: %s: Total number of patterns.
|
|
22
34
|
sprintf(
|
|
@@ -25,14 +37,14 @@ export default function Pagination({
|
|
|
25
37
|
expanded: false,
|
|
26
38
|
spacing: 1
|
|
27
39
|
}, createElement(Button, {
|
|
28
|
-
variant:
|
|
40
|
+
variant: buttonVariant,
|
|
29
41
|
onClick: () => changePage(1),
|
|
30
|
-
disabled: currentPage === 1,
|
|
42
|
+
disabled: disabled || currentPage === 1,
|
|
31
43
|
"aria-label": __('First page')
|
|
32
44
|
}, "\xAB"), createElement(Button, {
|
|
33
|
-
variant:
|
|
45
|
+
variant: buttonVariant,
|
|
34
46
|
onClick: () => changePage(currentPage - 1),
|
|
35
|
-
disabled: currentPage === 1,
|
|
47
|
+
disabled: disabled || currentPage === 1,
|
|
36
48
|
"aria-label": __('Previous page')
|
|
37
49
|
}, "\u2039")), createElement(Text, {
|
|
38
50
|
variant: "muted"
|
|
@@ -42,15 +54,15 @@ export default function Pagination({
|
|
|
42
54
|
expanded: false,
|
|
43
55
|
spacing: 1
|
|
44
56
|
}, createElement(Button, {
|
|
45
|
-
variant:
|
|
57
|
+
variant: buttonVariant,
|
|
46
58
|
onClick: () => changePage(currentPage + 1),
|
|
47
|
-
disabled: currentPage === numPages,
|
|
59
|
+
disabled: disabled || currentPage === numPages,
|
|
48
60
|
"aria-label": __('Next page')
|
|
49
61
|
}, "\u203A"), createElement(Button, {
|
|
50
|
-
variant:
|
|
62
|
+
variant: buttonVariant,
|
|
51
63
|
onClick: () => changePage(numPages),
|
|
52
|
-
disabled: currentPage === numPages,
|
|
64
|
+
disabled: disabled || currentPage === numPages,
|
|
53
65
|
"aria-label": __('Last page')
|
|
54
66
|
}, "\xBB")));
|
|
55
67
|
}
|
|
56
|
-
//# sourceMappingURL=
|
|
68
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["classnames","__experimentalHStack","HStack","__experimentalText","Text","Button","__","_x","_n","sprintf","Pagination","currentPage","numPages","changePage","totalItems","className","disabled","buttonVariant","label","createElement","expanded","as","spacing","justify","variant","onClick"],"sources":["@wordpress/edit-site/src/components/pagination/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalHStack as HStack,\n\t__experimentalText as Text,\n\tButton,\n} from '@wordpress/components';\nimport { __, _x, _n, sprintf } from '@wordpress/i18n';\n\nexport default function Pagination( {\n\tcurrentPage,\n\tnumPages,\n\tchangePage,\n\ttotalItems,\n\tclassName,\n\tdisabled = false,\n\tbuttonVariant = 'tertiary',\n\tlabel = __( 'Pagination Navigation' ),\n} ) {\n\treturn (\n\t\t<HStack\n\t\t\texpanded={ false }\n\t\t\tas=\"nav\"\n\t\t\taria-label={ label }\n\t\t\tspacing={ 3 }\n\t\t\tjustify=\"flex-start\"\n\t\t\tclassName={ classnames( 'edit-site-pagination', className ) }\n\t\t>\n\t\t\t<Text variant=\"muted\" className=\"edit-site-pagination__total\">\n\t\t\t\t{\n\t\t\t\t\t// translators: %s: Total number of patterns.\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t// translators: %s: Total number of patterns.\n\t\t\t\t\t\t_n( '%s item', '%s items', totalItems ),\n\t\t\t\t\t\ttotalItems\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t</Text>\n\t\t\t<HStack expanded={ false } spacing={ 1 }>\n\t\t\t\t<Button\n\t\t\t\t\tvariant={ buttonVariant }\n\t\t\t\t\tonClick={ () => changePage( 1 ) }\n\t\t\t\t\tdisabled={ disabled || currentPage === 1 }\n\t\t\t\t\taria-label={ __( 'First page' ) }\n\t\t\t\t>\n\t\t\t\t\t«\n\t\t\t\t</Button>\n\t\t\t\t<Button\n\t\t\t\t\tvariant={ buttonVariant }\n\t\t\t\t\tonClick={ () => changePage( currentPage - 1 ) }\n\t\t\t\t\tdisabled={ disabled || currentPage === 1 }\n\t\t\t\t\taria-label={ __( 'Previous page' ) }\n\t\t\t\t>\n\t\t\t\t\t‹\n\t\t\t\t</Button>\n\t\t\t</HStack>\n\t\t\t<Text variant=\"muted\">\n\t\t\t\t{ sprintf(\n\t\t\t\t\t// translators: %1$s: Current page number, %2$s: Total number of pages.\n\t\t\t\t\t_x( '%1$s of %2$s', 'paging' ),\n\t\t\t\t\tcurrentPage,\n\t\t\t\t\tnumPages\n\t\t\t\t) }\n\t\t\t</Text>\n\t\t\t<HStack expanded={ false } spacing={ 1 }>\n\t\t\t\t<Button\n\t\t\t\t\tvariant={ buttonVariant }\n\t\t\t\t\tonClick={ () => changePage( currentPage + 1 ) }\n\t\t\t\t\tdisabled={ disabled || currentPage === numPages }\n\t\t\t\t\taria-label={ __( 'Next page' ) }\n\t\t\t\t>\n\t\t\t\t\t›\n\t\t\t\t</Button>\n\t\t\t\t<Button\n\t\t\t\t\tvariant={ buttonVariant }\n\t\t\t\t\tonClick={ () => changePage( numPages ) }\n\t\t\t\t\tdisabled={ disabled || currentPage === numPages }\n\t\t\t\t\taria-label={ __( 'Last page'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A,CAACd,MAAM;IACNmB,OAAO,EAAGP,aAAe;IACzBQ,OAAO,EAAGA,CAAA,KAAMZ,UAAU,CAAEF,WAAW,GAAG,CAAE,CAAG;IAC/CK,QAAQ,EAAGA,QAAQ,IAAIL,WAAW,KAAK,CAAG;IAC1C,cAAaL,EAAE,CAAE,eAAgB;EAAG,GACpC,QAEO,CACD,CAAC,EACTa,aAAA,CAACf,IAAI;IAACoB,OAAO,EAAC;EAAO,GAClBf,OAAO;EACR;EACAF,EAAE,CAAE,cAAc,EAAE,QAAS,CAAC,EAC9BI,WAAW,EACXC,QACD,CACK,CAAC,EACPO,aAAA,CAACjB,MAAM;IAACkB,QAAQ,EAAG,KAAO;IAACE,OAAO,EAAG;EAAG,GACvCH,aAAA,CAACd,MAAM;IACNmB,OAAO,EAAGP,aAAe;IACzBQ,OAAO,EAAGA,CAAA,KAAMZ,UAAU,CAAEF,WAAW,GAAG,CAAE,CAAG;IAC/CK,QAAQ,EAAGA,QAAQ,IAAIL,WAAW,KAAKC,QAAU;IACjD,cAAaN,EAAE,CAAE,WAAY;EAAG,GAChC,QAEO,CAAC,EACTa,aAAA,CAACd,MAAM;IACNmB,OAAO,EAAGP,aAAe;IACzBQ,OAAO,EAAGA,CAAA,KAAMZ,UAAU,CAAED,QAAS,CAAG;IACxCI,QAAQ,EAAGA,QAAQ,IAAIL,WAAW,KAAKC,QAAU;IACjD,cAAaN,EAAE,CAAE,WAAY;EAAG,GAChC,MAEO,CACD,CACD,CAAC;AAEX"}
|
|
@@ -4,7 +4,8 @@ import { createElement } from "react";
|
|
|
4
4
|
*/
|
|
5
5
|
import Editor from '../editor';
|
|
6
6
|
import { useInitEditedEntity } from '../sync-state-with-url/use-init-edited-entity-from-url';
|
|
7
|
-
|
|
7
|
+
import { useIsSiteEditorLoading } from '../layout/hooks';
|
|
8
|
+
export default function PostPreview({
|
|
8
9
|
postType,
|
|
9
10
|
postId
|
|
10
11
|
}) {
|
|
@@ -12,6 +13,9 @@ export default function SideEditor({
|
|
|
12
13
|
postId,
|
|
13
14
|
postType
|
|
14
15
|
});
|
|
15
|
-
|
|
16
|
+
const isEditorLoading = useIsSiteEditorLoading();
|
|
17
|
+
return createElement(Editor, {
|
|
18
|
+
isLoading: isEditorLoading
|
|
19
|
+
});
|
|
16
20
|
}
|
|
17
|
-
//# sourceMappingURL=
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Editor","useInitEditedEntity","useIsSiteEditorLoading","PostPreview","postType","postId","isEditorLoading","createElement","isLoading"],"sources":["@wordpress/edit-site/src/components/post-preview/index.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport Editor from '../editor';\nimport { useInitEditedEntity } from '../sync-state-with-url/use-init-edited-entity-from-url';\nimport { useIsSiteEditorLoading } from '../layout/hooks';\n\nexport default function PostPreview( { postType, postId } ) {\n\tuseInitEditedEntity( {\n\t\tpostId,\n\t\tpostType,\n\t} );\n\tconst isEditorLoading = useIsSiteEditorLoading();\n\n\treturn <Editor isLoading={ isEditorLoading } />;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,MAAM,MAAM,WAAW;AAC9B,SAASC,mBAAmB,QAAQ,wDAAwD;AAC5F,SAASC,sBAAsB,QAAQ,iBAAiB;AAExD,eAAe,SAASC,WAAWA,CAAE;EAAEC,QAAQ;EAAEC;AAAO,CAAC,EAAG;EAC3DJ,mBAAmB,CAAE;IACpBI,MAAM;IACND;EACD,CAAE,CAAC;EACH,MAAME,eAAe,GAAGJ,sBAAsB,CAAC,CAAC;EAEhD,OAAOK,aAAA,CAACP,MAAM;IAACQ,SAAS,EAAGF;EAAiB,CAAE,CAAC;AAChD"}
|
|
@@ -7,17 +7,18 @@ import { ___unstablePreferencesModalBaseOption as BaseOption } from '@wordpress/
|
|
|
7
7
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
8
8
|
export default function EnableFeature(props) {
|
|
9
9
|
const {
|
|
10
|
+
scope = 'core/edit-site',
|
|
10
11
|
featureName,
|
|
11
12
|
onToggle = () => {},
|
|
12
13
|
...remainingProps
|
|
13
14
|
} = props;
|
|
14
|
-
const isChecked = useSelect(select => !!select(preferencesStore).get(
|
|
15
|
+
const isChecked = useSelect(select => !!select(preferencesStore).get(scope, featureName), [scope, featureName]);
|
|
15
16
|
const {
|
|
16
17
|
toggle
|
|
17
18
|
} = useDispatch(preferencesStore);
|
|
18
19
|
const onChange = () => {
|
|
19
20
|
onToggle();
|
|
20
|
-
toggle(
|
|
21
|
+
toggle(scope, featureName);
|
|
21
22
|
};
|
|
22
23
|
return createElement(BaseOption, {
|
|
23
24
|
onChange: onChange,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","useDispatch","___unstablePreferencesModalBaseOption","BaseOption","store","preferencesStore","EnableFeature","props","featureName","onToggle","remainingProps","isChecked","select","get","toggle","onChange","createElement"],"sources":["@wordpress/edit-site/src/components/preferences-modal/enable-feature.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { ___unstablePreferencesModalBaseOption as BaseOption } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\nexport default function EnableFeature( props ) {\n\tconst {
|
|
1
|
+
{"version":3,"names":["useSelect","useDispatch","___unstablePreferencesModalBaseOption","BaseOption","store","preferencesStore","EnableFeature","props","scope","featureName","onToggle","remainingProps","isChecked","select","get","toggle","onChange","createElement"],"sources":["@wordpress/edit-site/src/components/preferences-modal/enable-feature.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { ___unstablePreferencesModalBaseOption as BaseOption } from '@wordpress/interface';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\nexport default function EnableFeature( props ) {\n\tconst {\n\t\tscope = 'core/edit-site',\n\t\tfeatureName,\n\t\tonToggle = () => {},\n\t\t...remainingProps\n\t} = props;\n\tconst isChecked = useSelect(\n\t\t( select ) => !! select( preferencesStore ).get( scope, featureName ),\n\t\t[ scope, featureName ]\n\t);\n\tconst { toggle } = useDispatch( preferencesStore );\n\tconst onChange = () => {\n\t\tonToggle();\n\t\ttoggle( scope, featureName );\n\t};\n\treturn (\n\t\t<BaseOption\n\t\t\tonChange={ onChange }\n\t\t\tisChecked={ isChecked }\n\t\t\t{ ...remainingProps }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,qCAAqC,IAAIC,UAAU,QAAQ,sBAAsB;AAC1F,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;AAElE,eAAe,SAASC,aAAaA,CAAEC,KAAK,EAAG;EAC9C,MAAM;IACLC,KAAK,GAAG,gBAAgB;IACxBC,WAAW;IACXC,QAAQ,GAAGA,CAAA,KAAM,CAAC,CAAC;IACnB,GAAGC;EACJ,CAAC,GAAGJ,KAAK;EACT,MAAMK,SAAS,GAAGZ,SAAS,CACxBa,MAAM,IAAM,CAAC,CAAEA,MAAM,CAAER,gBAAiB,CAAC,CAACS,GAAG,CAAEN,KAAK,EAAEC,WAAY,CAAC,EACrE,CAAED,KAAK,EAAEC,WAAW,CACrB,CAAC;EACD,MAAM;IAAEM;EAAO,CAAC,GAAGd,WAAW,CAAEI,gBAAiB,CAAC;EAClD,MAAMW,QAAQ,GAAGA,CAAA,KAAM;IACtBN,QAAQ,CAAC,CAAC;IACVK,MAAM,CAAEP,KAAK,EAAEC,WAAY,CAAC;EAC7B,CAAC;EACD,OACCQ,aAAA,CAACd,UAAU;IACVa,QAAQ,EAAGA,QAAU;IACrBJ,SAAS,EAAGA,SAAW;IAAA,GAClBD;EAAc,CACnB,CAAC;AAEJ"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { compose, ifCondition } from '@wordpress/compose';
|
|
5
|
+
import { withSelect, withDispatch } from '@wordpress/data';
|
|
6
|
+
import { ___unstablePreferencesModalBaseOption as BaseOption } from '@wordpress/interface';
|
|
7
|
+
import { store as editorStore } from '@wordpress/editor';
|
|
8
|
+
export default compose(withSelect((select, {
|
|
9
|
+
panelName
|
|
10
|
+
}) => {
|
|
11
|
+
const {
|
|
12
|
+
isEditorPanelEnabled,
|
|
13
|
+
isEditorPanelRemoved
|
|
14
|
+
} = select(editorStore);
|
|
15
|
+
return {
|
|
16
|
+
isRemoved: isEditorPanelRemoved(panelName),
|
|
17
|
+
isChecked: isEditorPanelEnabled(panelName)
|
|
18
|
+
};
|
|
19
|
+
}), ifCondition(({
|
|
20
|
+
isRemoved
|
|
21
|
+
}) => !isRemoved), withDispatch((dispatch, {
|
|
22
|
+
panelName
|
|
23
|
+
}) => ({
|
|
24
|
+
onChange: () => dispatch(editorStore).toggleEditorPanelEnabled(panelName)
|
|
25
|
+
})))(BaseOption);
|
|
26
|
+
//# sourceMappingURL=enable-panel-option.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["compose","ifCondition","withSelect","withDispatch","___unstablePreferencesModalBaseOption","BaseOption","store","editorStore","select","panelName","isEditorPanelEnabled","isEditorPanelRemoved","isRemoved","isChecked","dispatch","onChange","toggleEditorPanelEnabled"],"sources":["@wordpress/edit-site/src/components/preferences-modal/enable-panel-option.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { compose, ifCondition } from '@wordpress/compose';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { ___unstablePreferencesModalBaseOption as BaseOption } from '@wordpress/interface';\nimport { store as editorStore } from '@wordpress/editor';\n\nexport default compose(\n\twithSelect( ( select, { panelName } ) => {\n\t\tconst { isEditorPanelEnabled, isEditorPanelRemoved } =\n\t\t\tselect( editorStore );\n\t\treturn {\n\t\t\tisRemoved: isEditorPanelRemoved( panelName ),\n\t\t\tisChecked: isEditorPanelEnabled( panelName ),\n\t\t};\n\t} ),\n\tifCondition( ( { isRemoved } ) => ! isRemoved ),\n\twithDispatch( ( dispatch, { panelName } ) => ( {\n\t\tonChange: () =>\n\t\t\tdispatch( editorStore ).toggleEditorPanelEnabled( panelName ),\n\t} ) )\n)( BaseOption );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,WAAW,QAAQ,oBAAoB;AACzD,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,qCAAqC,IAAIC,UAAU,QAAQ,sBAAsB;AAC1F,SAASC,KAAK,IAAIC,WAAW,QAAQ,mBAAmB;AAExD,eAAeP,OAAO,CACrBE,UAAU,CAAE,CAAEM,MAAM,EAAE;EAAEC;AAAU,CAAC,KAAM;EACxC,MAAM;IAAEC,oBAAoB;IAAEC;EAAqB,CAAC,GACnDH,MAAM,CAAED,WAAY,CAAC;EACtB,OAAO;IACNK,SAAS,EAAED,oBAAoB,CAAEF,SAAU,CAAC;IAC5CI,SAAS,EAAEH,oBAAoB,CAAED,SAAU;EAC5C,CAAC;AACF,CAAE,CAAC,EACHR,WAAW,CAAE,CAAE;EAAEW;AAAU,CAAC,KAAM,CAAEA,SAAU,CAAC,EAC/CT,YAAY,CAAE,CAAEW,QAAQ,EAAE;EAAEL;AAAU,CAAC,MAAQ;EAC9CM,QAAQ,EAAEA,CAAA,KACTD,QAAQ,CAAEP,WAAY,CAAC,CAACS,wBAAwB,CAAEP,SAAU;AAC9D,CAAC,CAAG,CACL,CAAC,CAAEJ,UAAW,CAAC"}
|
|
@@ -3,15 +3,16 @@ import { createElement, Fragment } from "react";
|
|
|
3
3
|
* WordPress dependencies
|
|
4
4
|
*/
|
|
5
5
|
import { PreferencesModal, PreferencesModalTabs, PreferencesModalSection, store as interfaceStore } from '@wordpress/interface';
|
|
6
|
-
import { useMemo } from '@wordpress/element';
|
|
7
6
|
import { __ } from '@wordpress/i18n';
|
|
8
7
|
import { useSelect, useDispatch, useRegistry } from '@wordpress/data';
|
|
9
8
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
9
|
+
import { PostTaxonomies, PostExcerptCheck, PageAttributesCheck, PostFeaturedImageCheck, PostTypeSupportCheck, store as editorStore } from '@wordpress/editor';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Internal dependencies
|
|
13
13
|
*/
|
|
14
14
|
import EnableFeature from './enable-feature';
|
|
15
|
+
import EnablePanelOption from './enable-panel-option';
|
|
15
16
|
import { store as editSiteStore } from '../../store';
|
|
16
17
|
export const PREFERENCES_MODAL_NAME = 'edit-site/preferences';
|
|
17
18
|
export default function EditSitePreferencesModal() {
|
|
@@ -23,38 +24,69 @@ export default function EditSitePreferencesModal() {
|
|
|
23
24
|
const toggleModal = () => isModalActive ? closeModal() : openModal(PREFERENCES_MODAL_NAME);
|
|
24
25
|
const registry = useRegistry();
|
|
25
26
|
const {
|
|
26
|
-
closeGeneralSidebar
|
|
27
|
+
closeGeneralSidebar
|
|
28
|
+
} = useDispatch(editSiteStore);
|
|
29
|
+
const {
|
|
27
30
|
setIsListViewOpened,
|
|
28
31
|
setIsInserterOpened
|
|
29
|
-
} = useDispatch(
|
|
32
|
+
} = useDispatch(editorStore);
|
|
30
33
|
const {
|
|
31
34
|
set: setPreference
|
|
32
35
|
} = useDispatch(preferencesStore);
|
|
33
36
|
const toggleDistractionFree = () => {
|
|
34
37
|
registry.batch(() => {
|
|
35
|
-
setPreference('core
|
|
38
|
+
setPreference('core', 'fixedToolbar', true);
|
|
36
39
|
setIsInserterOpened(false);
|
|
37
40
|
setIsListViewOpened(false);
|
|
38
41
|
closeGeneralSidebar();
|
|
39
42
|
});
|
|
40
43
|
};
|
|
41
44
|
const turnOffDistractionFree = () => {
|
|
42
|
-
setPreference('core
|
|
45
|
+
setPreference('core', 'distractionFree', false);
|
|
43
46
|
};
|
|
44
|
-
const sections =
|
|
47
|
+
const sections = [{
|
|
45
48
|
name: 'general',
|
|
46
49
|
tabLabel: __('General'),
|
|
47
|
-
content: createElement(PreferencesModalSection, {
|
|
50
|
+
content: createElement(Fragment, null, createElement(PreferencesModalSection, {
|
|
48
51
|
title: __('Interface')
|
|
49
52
|
}, createElement(EnableFeature, {
|
|
53
|
+
scope: "core",
|
|
50
54
|
featureName: "showListViewByDefault",
|
|
51
55
|
help: __('Opens the block list view sidebar by default.'),
|
|
52
56
|
label: __('Always open list view')
|
|
53
57
|
}), createElement(EnableFeature, {
|
|
58
|
+
scope: "core",
|
|
54
59
|
featureName: "showBlockBreadcrumbs",
|
|
55
60
|
help: __('Shows block breadcrumbs at the bottom of the editor.'),
|
|
56
61
|
label: __('Display block breadcrumbs')
|
|
57
|
-
})
|
|
62
|
+
}), createElement(EnableFeature, {
|
|
63
|
+
scope: "core",
|
|
64
|
+
featureName: "allowRightClickOverrides",
|
|
65
|
+
help: __('Allows contextual list view menus via right-click, overriding browser defaults.'),
|
|
66
|
+
label: __('Allow right-click contextual menus')
|
|
67
|
+
})), createElement(PreferencesModalSection, {
|
|
68
|
+
title: __('Document settings'),
|
|
69
|
+
description: __('Select what settings are shown in the document panel.')
|
|
70
|
+
}, createElement(PostTaxonomies, {
|
|
71
|
+
taxonomyWrapper: (content, taxonomy) => createElement(EnablePanelOption, {
|
|
72
|
+
label: taxonomy.labels.menu_name,
|
|
73
|
+
panelName: `taxonomy-panel-${taxonomy.slug}`
|
|
74
|
+
})
|
|
75
|
+
}), createElement(PostFeaturedImageCheck, null, createElement(EnablePanelOption, {
|
|
76
|
+
label: __('Featured image'),
|
|
77
|
+
panelName: "featured-image"
|
|
78
|
+
})), createElement(PostExcerptCheck, null, createElement(EnablePanelOption, {
|
|
79
|
+
label: __('Excerpt'),
|
|
80
|
+
panelName: "post-excerpt"
|
|
81
|
+
})), createElement(PostTypeSupportCheck, {
|
|
82
|
+
supportKeys: ['comments', 'trackbacks']
|
|
83
|
+
}, createElement(EnablePanelOption, {
|
|
84
|
+
label: __('Discussion'),
|
|
85
|
+
panelName: "discussion-panel"
|
|
86
|
+
})), createElement(PageAttributesCheck, null, createElement(EnablePanelOption, {
|
|
87
|
+
label: __('Page attributes'),
|
|
88
|
+
panelName: "page-attributes"
|
|
89
|
+
}))))
|
|
58
90
|
}, {
|
|
59
91
|
name: 'appearance',
|
|
60
92
|
tabLabel: __('Appearance'),
|
|
@@ -62,16 +94,19 @@ export default function EditSitePreferencesModal() {
|
|
|
62
94
|
title: __('Appearance'),
|
|
63
95
|
description: __('Customize the editor interface to suit your needs.')
|
|
64
96
|
}, createElement(EnableFeature, {
|
|
97
|
+
scope: "core",
|
|
65
98
|
featureName: "fixedToolbar",
|
|
66
99
|
onToggle: turnOffDistractionFree,
|
|
67
100
|
help: __('Access all block and document tools in a single place.'),
|
|
68
101
|
label: __('Top toolbar')
|
|
69
102
|
}), createElement(EnableFeature, {
|
|
103
|
+
scope: "core",
|
|
70
104
|
featureName: "distractionFree",
|
|
71
105
|
onToggle: toggleDistractionFree,
|
|
72
106
|
help: __('Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'),
|
|
73
107
|
label: __('Distraction free')
|
|
74
108
|
}), createElement(EnableFeature, {
|
|
109
|
+
scope: "core",
|
|
75
110
|
featureName: "focusMode",
|
|
76
111
|
help: __('Highlights the current block and fades other content.'),
|
|
77
112
|
label: __('Spotlight mode')
|
|
@@ -83,17 +118,30 @@ export default function EditSitePreferencesModal() {
|
|
|
83
118
|
title: __('Navigation'),
|
|
84
119
|
description: __('Optimize the editing experience for enhanced control.')
|
|
85
120
|
}, createElement(EnableFeature, {
|
|
121
|
+
scope: "core",
|
|
86
122
|
featureName: "keepCaretInsideBlock",
|
|
87
123
|
help: __('Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block.'),
|
|
88
124
|
label: __('Contain text cursor inside block')
|
|
89
125
|
})), createElement(PreferencesModalSection, {
|
|
90
126
|
title: __('Interface')
|
|
91
127
|
}, createElement(EnableFeature, {
|
|
128
|
+
scope: "core",
|
|
92
129
|
featureName: "showIconLabels",
|
|
93
130
|
label: __('Show button text labels'),
|
|
94
131
|
help: __('Show text instead of icons on buttons across the interface.')
|
|
95
132
|
})))
|
|
96
|
-
}
|
|
133
|
+
}, {
|
|
134
|
+
name: 'blocks',
|
|
135
|
+
tabLabel: __('Blocks'),
|
|
136
|
+
content: createElement(Fragment, null, createElement(PreferencesModalSection, {
|
|
137
|
+
title: __('Inserter')
|
|
138
|
+
}, createElement(EnableFeature, {
|
|
139
|
+
scope: "core",
|
|
140
|
+
featureName: "mostUsedBlocks",
|
|
141
|
+
help: __('Adds a category with the most frequently used blocks in the inserter.'),
|
|
142
|
+
label: __('Show most used blocks')
|
|
143
|
+
})))
|
|
144
|
+
}];
|
|
97
145
|
if (!isModalActive) {
|
|
98
146
|
return null;
|
|
99
147
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PreferencesModal","PreferencesModalTabs","PreferencesModalSection","store","interfaceStore","useMemo","__","useSelect","useDispatch","useRegistry","preferencesStore","EnableFeature","editSiteStore","PREFERENCES_MODAL_NAME","EditSitePreferencesModal","isModalActive","select","closeModal","openModal","toggleModal","registry","closeGeneralSidebar","setIsListViewOpened","setIsInserterOpened","set","setPreference","toggleDistractionFree","batch","turnOffDistractionFree","sections","name","tabLabel","content","createElement","title","featureName","help","label","description","onToggle","Fragment"],"sources":["@wordpress/edit-site/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch, useRegistry } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport EnableFeature from './enable-feature';\nimport { store as editSiteStore } from '../../store';\n\nexport const PREFERENCES_MODAL_NAME = 'edit-site/preferences';\n\nexport default function EditSitePreferencesModal() {\n\tconst isModalActive = useSelect( ( select ) =>\n\t\tselect( interfaceStore ).isModalActive( PREFERENCES_MODAL_NAME )\n\t);\n\tconst { closeModal, openModal } = useDispatch( interfaceStore );\n\tconst toggleModal = () =>\n\t\tisModalActive ? closeModal() : openModal( PREFERENCES_MODAL_NAME );\n\tconst registry = useRegistry();\n\tconst { closeGeneralSidebar, setIsListViewOpened, setIsInserterOpened } =\n\t\tuseDispatch( editSiteStore );\n\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\tconst toggleDistractionFree = () => {\n\t\tregistry.batch( () => {\n\t\t\tsetPreference( 'core/edit-site', 'fixedToolbar', true );\n\t\t\tsetIsInserterOpened( false );\n\t\t\tsetIsListViewOpened( false );\n\t\t\tcloseGeneralSidebar();\n\t\t} );\n\t};\n\n\tconst turnOffDistractionFree = () => {\n\t\tsetPreference( 'core/edit-site', 'distractionFree', false );\n\t};\n\n\tconst sections = useMemo( () => [\n\t\t{\n\t\t\tname: 'general',\n\t\t\ttabLabel: __( 'General' ),\n\t\t\tcontent: (\n\t\t\t\t<PreferencesModalSection title={ __( 'Interface' ) }>\n\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Opens the block list view sidebar by default.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tlabel={ __( 'Always open list view' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Shows block breadcrumbs at the bottom of the editor.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tlabel={ __( 'Display block breadcrumbs' ) }\n\t\t\t\t\t/>\n\t\t\t\t</PreferencesModalSection>\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tname: 'appearance',\n\t\t\ttabLabel: __( 'Appearance' ),\n\t\t\tcontent: (\n\t\t\t\t<PreferencesModalSection\n\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t'Customize the editor interface to suit your needs.'\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\tfeatureName=\"fixedToolbar\"\n\t\t\t\t\t\tonToggle={ turnOffDistractionFree }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Access all block and document tools in a single place.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\tfeatureName=\"distractionFree\"\n\t\t\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t/>\n\t\t\t\t</PreferencesModalSection>\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tname: 'accessibility',\n\t\t\ttabLabel: __( 'Accessibility' ),\n\t\t\tcontent: (\n\t\t\t\t<>\n\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\ttitle={ __( 'Navigation' ) }\n\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t'Optimize the editing experience for enhanced control.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Contain text cursor inside block' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t<PreferencesModalSection title={ __( 'Interface' ) }>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Show text instead of icons on buttons across the interface.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t</>\n\t\t\t),\n\t\t},\n\t] );\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<PreferencesModal closeModal={ toggleModal }>\n\t\t\t<PreferencesModalTabs sections={ sections } />\n\t\t</PreferencesModal>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,gBAAgB,EAChBC,oBAAoB,EACpBC,uBAAuB,EACvBC,KAAK,IAAIC,cAAc,QACjB,sBAAsB;AAC7B,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,EAAEC,WAAW,EAAEC,WAAW,QAAQ,iBAAiB;AACrE,SAASN,KAAK,IAAIO,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,SAASR,KAAK,IAAIS,aAAa,QAAQ,aAAa;AAEpD,OAAO,MAAMC,sBAAsB,GAAG,uBAAuB;AAE7D,eAAe,SAASC,wBAAwBA,CAAA,EAAG;EAClD,MAAMC,aAAa,GAAGR,SAAS,CAAIS,MAAM,IACxCA,MAAM,CAAEZ,cAAe,CAAC,CAACW,aAAa,CAAEF,sBAAuB,CAChE,CAAC;EACD,MAAM;IAAEI,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C;IAAG,CAClD,CACuB,CAAC,EAC1B2B,aAAA,CAAC/B,uBAAuB;MAACgC,KAAK,EAAG5B,EAAE,CAAE,WAAY;IAAG,GACnD2B,aAAA,CAACtB,aAAa;MACbwB,WAAW,EAAC,gBAAgB;MAC5BE,KAAK,EAAG/B,EAAE,CAAE,yBAA0B,CAAG;MACzC8B,IAAI,EAAG9B,EAAE,CACR,6DACD;IAAG,CACH,CACuB,CACxB;EAEJ,CAAC,CACA,CAAC;EACH,IAAK,CAAES,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EACA,OACCkB,aAAA,CAACjC,gBAAgB;IAACiB,UAAU,EAAGE;EAAa,GAC3Cc,aAAA,CAAChC,oBAAoB;IAAC4B,QAAQ,EAAGA;EAAU,CAAE,CAC5B,CAAC;AAErB"}
|
|
1
|
+
{"version":3,"names":["PreferencesModal","PreferencesModalTabs","PreferencesModalSection","store","interfaceStore","__","useSelect","useDispatch","useRegistry","preferencesStore","PostTaxonomies","PostExcerptCheck","PageAttributesCheck","PostFeaturedImageCheck","PostTypeSupportCheck","editorStore","EnableFeature","EnablePanelOption","editSiteStore","PREFERENCES_MODAL_NAME","EditSitePreferencesModal","isModalActive","select","closeModal","openModal","toggleModal","registry","closeGeneralSidebar","setIsListViewOpened","setIsInserterOpened","set","setPreference","toggleDistractionFree","batch","turnOffDistractionFree","sections","name","tabLabel","content","createElement","Fragment","title","scope","featureName","help","label","description","taxonomyWrapper","taxonomy","labels","menu_name","panelName","slug","supportKeys","onToggle"],"sources":["@wordpress/edit-site/src/components/preferences-modal/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPreferencesModal,\n\tPreferencesModalTabs,\n\tPreferencesModalSection,\n\tstore as interfaceStore,\n} from '@wordpress/interface';\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch, useRegistry } from '@wordpress/data';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tPostTaxonomies,\n\tPostExcerptCheck,\n\tPageAttributesCheck,\n\tPostFeaturedImageCheck,\n\tPostTypeSupportCheck,\n\tstore as editorStore,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport EnableFeature from './enable-feature';\nimport EnablePanelOption from './enable-panel-option';\nimport { store as editSiteStore } from '../../store';\n\nexport const PREFERENCES_MODAL_NAME = 'edit-site/preferences';\n\nexport default function EditSitePreferencesModal() {\n\tconst isModalActive = useSelect( ( select ) =>\n\t\tselect( interfaceStore ).isModalActive( PREFERENCES_MODAL_NAME )\n\t);\n\tconst { closeModal, openModal } = useDispatch( interfaceStore );\n\tconst toggleModal = () =>\n\t\tisModalActive ? closeModal() : openModal( PREFERENCES_MODAL_NAME );\n\tconst registry = useRegistry();\n\tconst { closeGeneralSidebar } = useDispatch( editSiteStore );\n\tconst { setIsListViewOpened, setIsInserterOpened } =\n\t\tuseDispatch( editorStore );\n\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\tconst toggleDistractionFree = () => {\n\t\tregistry.batch( () => {\n\t\t\tsetPreference( 'core', 'fixedToolbar', true );\n\t\t\tsetIsInserterOpened( false );\n\t\t\tsetIsListViewOpened( false );\n\t\t\tcloseGeneralSidebar();\n\t\t} );\n\t};\n\n\tconst turnOffDistractionFree = () => {\n\t\tsetPreference( 'core', 'distractionFree', false );\n\t};\n\n\tconst sections = [\n\t\t{\n\t\t\tname: 'general',\n\t\t\ttabLabel: __( 'General' ),\n\t\t\tcontent: (\n\t\t\t\t<>\n\t\t\t\t\t<PreferencesModalSection title={ __( 'Interface' ) }>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"showListViewByDefault\"\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Opens the block list view sidebar by default.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Always open list view' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"showBlockBreadcrumbs\"\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Shows block breadcrumbs at the bottom of the editor.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Display block breadcrumbs' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"allowRightClickOverrides\"\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Allows contextual list view menus via right-click, overriding browser defaults.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Allow right-click contextual menus' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\ttitle={ __( 'Document settings' ) }\n\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t'Select what settings are shown in the document panel.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<PostTaxonomies\n\t\t\t\t\t\t\ttaxonomyWrapper={ ( content, taxonomy ) => (\n\t\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\t\tlabel={ taxonomy.labels.menu_name }\n\t\t\t\t\t\t\t\t\tpanelName={ `taxonomy-panel-${ taxonomy.slug }` }\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\t<PostFeaturedImageCheck>\n\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\tlabel={ __( 'Featured image' ) }\n\t\t\t\t\t\t\t\tpanelName=\"featured-image\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PostFeaturedImageCheck>\n\t\t\t\t\t\t<PostExcerptCheck>\n\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\tlabel={ __( 'Excerpt' ) }\n\t\t\t\t\t\t\t\tpanelName=\"post-excerpt\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PostExcerptCheck>\n\t\t\t\t\t\t<PostTypeSupportCheck\n\t\t\t\t\t\t\tsupportKeys={ [ 'comments', 'trackbacks' ] }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\tlabel={ __( 'Discussion' ) }\n\t\t\t\t\t\t\t\tpanelName=\"discussion-panel\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PostTypeSupportCheck>\n\t\t\t\t\t\t<PageAttributesCheck>\n\t\t\t\t\t\t\t<EnablePanelOption\n\t\t\t\t\t\t\t\tlabel={ __( 'Page attributes' ) }\n\t\t\t\t\t\t\t\tpanelName=\"page-attributes\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</PageAttributesCheck>\n\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t</>\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tname: 'appearance',\n\t\t\ttabLabel: __( 'Appearance' ),\n\t\t\tcontent: (\n\t\t\t\t<PreferencesModalSection\n\t\t\t\t\ttitle={ __( 'Appearance' ) }\n\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t'Customize the editor interface to suit your needs.'\n\t\t\t\t\t) }\n\t\t\t\t>\n\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\tfeatureName=\"fixedToolbar\"\n\t\t\t\t\t\tonToggle={ turnOffDistractionFree }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Access all block and document tools in a single place.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tlabel={ __( 'Top toolbar' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\tfeatureName=\"distractionFree\"\n\t\t\t\t\t\tonToggle={ toggleDistractionFree }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Reduce visual distractions by hiding the toolbar and other elements to focus on writing.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tlabel={ __( 'Distraction free' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\tfeatureName=\"focusMode\"\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Highlights the current block and fades other content.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tlabel={ __( 'Spotlight mode' ) }\n\t\t\t\t\t/>\n\t\t\t\t</PreferencesModalSection>\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tname: 'accessibility',\n\t\t\ttabLabel: __( 'Accessibility' ),\n\t\t\tcontent: (\n\t\t\t\t<>\n\t\t\t\t\t<PreferencesModalSection\n\t\t\t\t\t\ttitle={ __( 'Navigation' ) }\n\t\t\t\t\t\tdescription={ __(\n\t\t\t\t\t\t\t'Optimize the editing experience for enhanced control.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"keepCaretInsideBlock\"\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Keeps the text cursor within the block boundaries, aiding users with screen readers by preventing unintentional cursor movement outside the block.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Contain text cursor inside block' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t\t<PreferencesModalSection title={ __( 'Interface' ) }>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"showIconLabels\"\n\t\t\t\t\t\t\tlabel={ __( 'Show button text labels' ) }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Show text instead of icons on buttons across the interface.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t</>\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tname: 'blocks',\n\t\t\ttabLabel: __( 'Blocks' ),\n\t\t\tcontent: (\n\t\t\t\t<>\n\t\t\t\t\t<PreferencesModalSection title={ __( 'Inserter' ) }>\n\t\t\t\t\t\t<EnableFeature\n\t\t\t\t\t\t\tscope=\"core\"\n\t\t\t\t\t\t\tfeatureName=\"mostUsedBlocks\"\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Adds a category with the most frequently used blocks in the inserter.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlabel={ __( 'Show most used blocks' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</PreferencesModalSection>\n\t\t\t\t</>\n\t\t\t),\n\t\t},\n\t];\n\tif ( ! isModalActive ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<PreferencesModal closeModal={ toggleModal }>\n\t\t\t<PreferencesModalTabs sections={ sections } />\n\t\t</PreferencesModal>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,gBAAgB,EAChBC,oBAAoB,EACpBC,uBAAuB,EACvBC,KAAK,IAAIC,cAAc,QACjB,sBAAsB;AAC7B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,EAAEC,WAAW,EAAEC,WAAW,QAAQ,iBAAiB;AACrE,SAASL,KAAK,IAAIM,gBAAgB,QAAQ,wBAAwB;AAClE,SACCC,cAAc,EACdC,gBAAgB,EAChBC,mBAAmB,EACnBC,sBAAsB,EACtBC,oBAAoB,EACpBX,KAAK,IAAIY,WAAW,QACd,mBAAmB;;AAE1B;AACA;AACA;AACA,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,OAAOC,iBAAiB,MAAM,uBAAuB;AACrD,SAASd,KAAK,IAAIe,aAAa,QAAQ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AAGE;EAAa,GAC3Cc,aAAA,CAACtC,oBAAoB;IAACkC,QAAQ,EAAGA;EAAU,CAAE,CAC5B,CAAC;AAErB"}
|
|
@@ -6,8 +6,7 @@ import { Disabled } from '@wordpress/components';
|
|
|
6
6
|
import { __ } from '@wordpress/i18n';
|
|
7
7
|
import { BlockList, privateApis as blockEditorPrivateApis, store as blockEditorStore, __unstableEditorStyles as EditorStyles, __unstableIframe as Iframe } from '@wordpress/block-editor';
|
|
8
8
|
import { useSelect } from '@wordpress/data';
|
|
9
|
-
import { useMemo } from '@wordpress/element';
|
|
10
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
9
|
+
import { useContext, useMemo } from '@wordpress/element';
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* Internal dependencies
|
|
@@ -18,21 +17,19 @@ import { mergeBaseAndUserConfigs } from '../global-styles/global-styles-provider
|
|
|
18
17
|
import EditorCanvasContainer from '../editor-canvas-container';
|
|
19
18
|
const {
|
|
20
19
|
ExperimentalBlockEditorProvider,
|
|
20
|
+
GlobalStylesContext,
|
|
21
21
|
useGlobalStylesOutputWithConfig
|
|
22
22
|
} = unlock(blockEditorPrivateApis);
|
|
23
23
|
function isObjectEmpty(object) {
|
|
24
24
|
return !object || Object.keys(object).length === 0;
|
|
25
25
|
}
|
|
26
26
|
function Revisions({
|
|
27
|
-
onClose,
|
|
28
27
|
userConfig,
|
|
29
28
|
blocks
|
|
30
29
|
}) {
|
|
31
30
|
const {
|
|
32
|
-
baseConfig
|
|
33
|
-
} =
|
|
34
|
-
baseConfig: select(coreStore).__experimentalGetCurrentThemeBaseGlobalStyles()
|
|
35
|
-
}), []);
|
|
31
|
+
base: baseConfig
|
|
32
|
+
} = useContext(GlobalStylesContext);
|
|
36
33
|
const mergedConfig = useMemo(() => {
|
|
37
34
|
if (!isObjectEmpty(userConfig) && !isObjectEmpty(baseConfig)) {
|
|
38
35
|
return mergeBaseAndUserConfigs(baseConfig, userConfig);
|
|
@@ -49,7 +46,6 @@ function Revisions({
|
|
|
49
46
|
const editorStyles = !isObjectEmpty(globalStyles) && !isObjectEmpty(userConfig) ? globalStyles : settings.styles;
|
|
50
47
|
return createElement(EditorCanvasContainer, {
|
|
51
48
|
title: __('Revisions'),
|
|
52
|
-
onClose: onClose,
|
|
53
49
|
closeButtonLabel: __('Close revisions'),
|
|
54
50
|
enableResizing: true
|
|
55
51
|
}, createElement(Iframe, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Disabled","__","BlockList","privateApis","blockEditorPrivateApis","store","blockEditorStore","__unstableEditorStyles","EditorStyles","__unstableIframe","Iframe","useSelect","
|
|
1
|
+
{"version":3,"names":["Disabled","__","BlockList","privateApis","blockEditorPrivateApis","store","blockEditorStore","__unstableEditorStyles","EditorStyles","__unstableIframe","Iframe","useSelect","useContext","useMemo","unlock","mergeBaseAndUserConfigs","EditorCanvasContainer","ExperimentalBlockEditorProvider","GlobalStylesContext","useGlobalStylesOutputWithConfig","isObjectEmpty","object","Object","keys","length","Revisions","userConfig","blocks","base","baseConfig","mergedConfig","renderedBlocksArray","Array","isArray","originalSettings","select","getSettings","settings","__unstableIsPreviewMode","globalStyles","editorStyles","styles","createElement","title","closeButtonLabel","enableResizing","className","name","tabIndex","value","renderAppender"],"sources":["@wordpress/edit-site/src/components/revisions/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Disabled } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBlockList,\n\tprivateApis as blockEditorPrivateApis,\n\tstore as blockEditorStore,\n\t__unstableEditorStyles as EditorStyles,\n\t__unstableIframe as Iframe,\n} from '@wordpress/block-editor';\nimport { useSelect } from '@wordpress/data';\nimport { useContext, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\n\nimport { unlock } from '../../lock-unlock';\nimport { mergeBaseAndUserConfigs } from '../global-styles/global-styles-provider';\nimport EditorCanvasContainer from '../editor-canvas-container';\n\nconst {\n\tExperimentalBlockEditorProvider,\n\tGlobalStylesContext,\n\tuseGlobalStylesOutputWithConfig,\n} = unlock( blockEditorPrivateApis );\n\nfunction isObjectEmpty( object ) {\n\treturn ! object || Object.keys( object ).length === 0;\n}\n\nfunction Revisions( { userConfig, blocks } ) {\n\tconst { base: baseConfig } = useContext( GlobalStylesContext );\n\n\tconst mergedConfig = useMemo( () => {\n\t\tif ( ! isObjectEmpty( userConfig ) && ! isObjectEmpty( baseConfig ) ) {\n\t\t\treturn mergeBaseAndUserConfigs( baseConfig, userConfig );\n\t\t}\n\t\treturn {};\n\t}, [ baseConfig, userConfig ] );\n\n\tconst renderedBlocksArray = useMemo(\n\t\t() => ( Array.isArray( blocks ) ? blocks : [ blocks ] ),\n\t\t[ blocks ]\n\t);\n\n\tconst originalSettings = useSelect(\n\t\t( select ) => select( blockEditorStore ).getSettings(),\n\t\t[]\n\t);\n\tconst settings = useMemo(\n\t\t() => ( { ...originalSettings, __unstableIsPreviewMode: true } ),\n\t\t[ originalSettings ]\n\t);\n\n\tconst [ globalStyles ] = useGlobalStylesOutputWithConfig( mergedConfig );\n\n\tconst editorStyles =\n\t\t! isObjectEmpty( globalStyles ) && ! isObjectEmpty( userConfig )\n\t\t\t? globalStyles\n\t\t\t: settings.styles;\n\n\treturn (\n\t\t<EditorCanvasContainer\n\t\t\ttitle={ __( 'Revisions' ) }\n\t\t\tcloseButtonLabel={ __( 'Close revisions' ) }\n\t\t\tenableResizing={ true }\n\t\t>\n\t\t\t<Iframe\n\t\t\t\tclassName=\"edit-site-revisions__iframe\"\n\t\t\t\tname=\"revisions\"\n\t\t\t\ttabIndex={ 0 }\n\t\t\t>\n\t\t\t\t<EditorStyles styles={ editorStyles } />\n\t\t\t\t<style>\n\t\t\t\t\t{\n\t\t\t\t\t\t// Forming a \"block formatting context\" to prevent margin collapsing.\n\t\t\t\t\t\t// @see https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Block_formatting_context\n\t\t\t\t\t\t`.is-root-container { display: flow-root; } body { position: relative; padding: 32px; }`\n\t\t\t\t\t}\n\t\t\t\t</style>\n\t\t\t\t<Disabled className=\"edit-site-revisions__example-preview__content\">\n\t\t\t\t\t<ExperimentalBlockEditorProvider\n\t\t\t\t\t\tvalue={ renderedBlocksArray }\n\t\t\t\t\t\tsettings={ settings }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockList renderAppender={ false } />\n\t\t\t\t\t</ExperimentalBlockEditorProvider>\n\t\t\t\t</Disabled>\n\t\t\t</Iframe>\n\t\t</EditorCanvasContainer>\n\t);\n}\n\nexport default Revisions;\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,uBAAuB;AAChD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,SAAS,EACTC,WAAW,IAAIC,sBAAsB,EACrCC,KAAK,IAAIC,gBAAgB,EACzBC,sBAAsB,IAAIC,YAAY,EACtCC,gBAAgB,IAAIC,MAAM,QACpB,yBAAyB;AAChC,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,UAAU,EAAEC,OAAO,QAAQ,oBAAoB;;AAExD;AACA;AACA;;AAEA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,uBAAuB,QAAQ,yCAAyC;AACjF,OAAOC,qBAAqB,MAAM,4BAA4B;AAE9D,MAAM;EACLC,+BAA+B;EAC/BC,mBAAmB;EACnBC;AACD,CAAC,GAAGL,MAAM,CAAEV,sBAAuB,CAAC;AAEpC,SAASgB,aAAaA,CAAEC,MAAM,EAAG;EAChC,OAAO,CAAEA,MAAM,IAAIC,MAAM,CAACC,IAAI,CAAEF,MAAO,CAAC,CAACG,MAAM,KAAK,CAAC;AACtD;AAEA,SAASC,SAASA,CAAE;EAAEC,UAAU;EAAEC;AAAO,CAAC,EAAG;EAC5C,MAAM;IAAEC,IAAI,EAAEC;EAAW,CAAC,GAAGjB,UAAU,CAAEM,mBAAoB,CAAC;EAE9D,MAAMY,YAAY,GAAGjB,OAAO,CAAE,MAAM;IACn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CAAC,EACRA,aAAA,CAAC1C,QAAQ;IAAC8C,SAAS,EAAC;EAA+C,GAClEJ,aAAA,CAACzB,+BAA+B;IAC/BgC,KAAK,EAAGlB,mBAAqB;IAC7BM,QAAQ,EAAGA;EAAU,GAErBK,aAAA,CAACxC,SAAS;IAACgD,cAAc,EAAG;EAAO,CAAE,CACL,CACxB,CACH,CACc,CAAC;AAE1B;AAEA,eAAezB,SAAS"}
|
|
@@ -13,8 +13,7 @@ import { isPreviewingTheme, currentlyPreviewingTheme } from '../../utils/is-prev
|
|
|
13
13
|
const {
|
|
14
14
|
useHistory
|
|
15
15
|
} = unlock(routerPrivateApis);
|
|
16
|
-
export function
|
|
17
|
-
const history = useHistory();
|
|
16
|
+
export function getPostLinkProps(history, params = {}, state, shouldReplace = false) {
|
|
18
17
|
function onClick(event) {
|
|
19
18
|
event.preventDefault();
|
|
20
19
|
if (shouldReplace) {
|
|
@@ -37,6 +36,10 @@ export function useLink(params = {}, state, shouldReplace = false) {
|
|
|
37
36
|
onClick
|
|
38
37
|
};
|
|
39
38
|
}
|
|
39
|
+
export function useLink(params, state, shouldReplace) {
|
|
40
|
+
const history = useHistory();
|
|
41
|
+
return getPostLinkProps(history, params, state, shouldReplace);
|
|
42
|
+
}
|
|
40
43
|
export default function Link({
|
|
41
44
|
params = {},
|
|
42
45
|
state,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["addQueryArgs","getQueryArgs","removeQueryArgs","privateApis","routerPrivateApis","unlock","isPreviewingTheme","currentlyPreviewingTheme","useHistory","
|
|
1
|
+
{"version":3,"names":["addQueryArgs","getQueryArgs","removeQueryArgs","privateApis","routerPrivateApis","unlock","isPreviewingTheme","currentlyPreviewingTheme","useHistory","getPostLinkProps","history","params","state","shouldReplace","onClick","event","preventDefault","replace","push","currentArgs","window","location","href","currentUrlWithoutArgs","Object","keys","wp_theme_preview","newUrl","useLink","Link","children","props","createElement"],"sources":["@wordpress/edit-site/src/components/routes/link.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { addQueryArgs, getQueryArgs, removeQueryArgs } from '@wordpress/url';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport {\n\tisPreviewingTheme,\n\tcurrentlyPreviewingTheme,\n} from '../../utils/is-previewing-theme';\n\nconst { useHistory } = unlock( routerPrivateApis );\n\nexport function getPostLinkProps(\n\thistory,\n\tparams = {},\n\tstate,\n\tshouldReplace = false\n) {\n\tfunction onClick( event ) {\n\t\tevent.preventDefault();\n\n\t\tif ( shouldReplace ) {\n\t\t\thistory.replace( params, state );\n\t\t} else {\n\t\t\thistory.push( params, state );\n\t\t}\n\t}\n\n\tconst currentArgs = getQueryArgs( window.location.href );\n\tconst currentUrlWithoutArgs = removeQueryArgs(\n\t\twindow.location.href,\n\t\t...Object.keys( currentArgs )\n\t);\n\n\tif ( isPreviewingTheme() ) {\n\t\tparams = {\n\t\t\t...params,\n\t\t\twp_theme_preview: currentlyPreviewingTheme(),\n\t\t};\n\t}\n\n\tconst newUrl = addQueryArgs( currentUrlWithoutArgs, params );\n\n\treturn {\n\t\thref: newUrl,\n\t\tonClick,\n\t};\n}\n\nexport function useLink( params, state, shouldReplace ) {\n\tconst history = useHistory();\n\treturn getPostLinkProps( history, params, state, shouldReplace );\n}\n\nexport default function Link( {\n\tparams = {},\n\tstate,\n\treplace: shouldReplace = false,\n\tchildren,\n\t...props\n} ) {\n\tconst { href, onClick } = useLink( params, state, shouldReplace );\n\n\treturn (\n\t\t<a href={ href } onClick={ onClick } { ...props }>\n\t\t\t{ children }\n\t\t</a>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,YAAY,EAAEC,YAAY,EAAEC,eAAe,QAAQ,gBAAgB;AAC5E,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SACCC,iBAAi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EAAEJ,aAAa,GAAG,KAAK;EAC9BiB,QAAQ;EACR,GAAGC;AACJ,CAAC,EAAG;EACH,MAAM;IAAET,IAAI;IAAER;EAAQ,CAAC,GAAGc,OAAO,CAAEjB,MAAM,EAAEC,KAAK,EAAEC,aAAc,CAAC;EAEjE,OACCmB,aAAA;IAAGV,IAAI,EAAGA,IAAM;IAACR,OAAO,EAAGA,OAAS;IAAA,GAAMiB;EAAK,GAC5CD,QACA,CAAC;AAEN"}
|
|
@@ -53,13 +53,16 @@ export default function SaveButton({
|
|
|
53
53
|
const getLabel = () => {
|
|
54
54
|
if (isPreviewingTheme()) {
|
|
55
55
|
if (isSaving) {
|
|
56
|
-
return sprintf(
|
|
56
|
+
return sprintf( /* translators: %s: The name of theme to be activated. */
|
|
57
|
+
__('Activating %s'), previewingThemeName);
|
|
57
58
|
} else if (disabled) {
|
|
58
59
|
return __('Saved');
|
|
59
60
|
} else if (isDirty) {
|
|
60
|
-
return sprintf(
|
|
61
|
+
return sprintf( /* translators: %s: The name of theme to be activated. */
|
|
62
|
+
__('Activate %s & Save'), previewingThemeName);
|
|
61
63
|
}
|
|
62
|
-
return sprintf(
|
|
64
|
+
return sprintf( /* translators: %s: The name of theme to be activated. */
|
|
65
|
+
__('Activate %s'), previewingThemeName);
|
|
63
66
|
}
|
|
64
67
|
if (isSaving) {
|
|
65
68
|
return __('Saving');
|