@wordpress/edit-site 5.25.0 → 5.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/LICENSE.md +1 -1
- package/build/components/block-editor/back-button.js +3 -2
- package/build/components/block-editor/back-button.js.map +1 -1
- package/build/components/block-editor/resizable-editor.js +2 -2
- package/build/components/block-editor/resizable-editor.js.map +1 -1
- package/build/components/block-editor/use-post-link-props.js +27 -0
- package/build/components/block-editor/use-post-link-props.js.map +1 -0
- package/build/components/block-editor/use-site-editor-settings.js +7 -24
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +15 -7
- package/build/components/create-template-part-modal/index.js.map +1 -1
- package/build/components/editor/index.js +15 -16
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +9 -7
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/collection-font-variant.js +5 -2
- package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js +3 -3
- package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +5 -5
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +8 -4
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/index.js +38 -21
- package/build/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +2 -2
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-variant.js +5 -2
- package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/local-fonts.js +26 -10
- package/build/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/resolvers.js +6 -6
- package/build/components/global-styles/font-library-modal/resolvers.js.map +1 -1
- package/build/components/global-styles/font-library-modal/{tab-layout.js → tab-panel-layout.js} +4 -4
- package/build/components/global-styles/font-library-modal/tab-panel-layout.js.map +1 -0
- package/build/components/global-styles/font-library-modal/utils/index.js +35 -38
- package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build/components/global-styles/preview.js +43 -1
- package/build/components/global-styles/preview.js.map +1 -1
- package/build/components/global-styles/screen-color-palette.js +16 -12
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +52 -52
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +26 -35
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +40 -22
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build/components/global-styles/ui.js +13 -62
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/header-edit-mode/document-tools/index.js +8 -106
- package/build/components/header-edit-mode/document-tools/index.js.map +1 -1
- package/build/components/header-edit-mode/index.js +7 -11
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/mode-switcher/index.js +0 -2
- package/build/components/header-edit-mode/mode-switcher/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/index.js +10 -7
- package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/edit-mode.js +0 -23
- package/build/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build/components/keyboard-shortcuts/register.js +0 -36
- package/build/components/keyboard-shortcuts/register.js.map +1 -1
- package/build/components/layout/index.js +6 -13
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page-main/index.js +4 -4
- package/build/components/page-main/index.js.map +1 -1
- package/build/components/page-pages/index.js +84 -37
- package/build/components/page-pages/index.js.map +1 -1
- package/build/components/page-patterns/dataviews-pattern-actions.js +305 -0
- package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -0
- package/build/components/page-patterns/dataviews-patterns.js +307 -0
- package/build/components/page-patterns/dataviews-patterns.js.map +1 -0
- package/build/components/page-patterns/duplicate-menu-item.js +1 -1
- package/build/components/page-patterns/duplicate-menu-item.js.map +1 -1
- package/build/components/page-patterns/grid-item.js +4 -3
- package/build/components/page-patterns/grid-item.js.map +1 -1
- package/build/components/page-patterns/patterns-list.js +2 -1
- package/build/components/page-patterns/patterns-list.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +23 -13
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-templates/index.js +312 -36
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/{page-patterns/pagination.js → pagination/index.js} +25 -12
- package/build/components/pagination/index.js.map +1 -0
- package/build/components/{page-pages/side-editor.js → post-preview/index.js} +8 -4
- package/build/components/post-preview/index.js.map +1 -0
- package/build/components/preferences-modal/enable-feature.js +3 -2
- package/build/components/preferences-modal/enable-feature.js.map +1 -1
- package/build/components/preferences-modal/enable-panel-option.js +33 -0
- package/build/components/preferences-modal/enable-panel-option.js.map +1 -0
- package/build/components/preferences-modal/index.js +57 -9
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/revisions/index.js +3 -7
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/routes/link.js +6 -2
- package/build/components/routes/link.js.map +1 -1
- package/build/components/save-button/index.js +6 -3
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/sidebar/index.js +3 -11
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-dataviews/add-new-view.js +2 -2
- package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +18 -5
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +3 -3
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/default-sidebar.js +1 -5
- package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js +62 -10
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/index.js +1 -1
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -4
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/index.js +4 -13
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +5 -2
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/index.js +4 -1
- package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pages-dataviews/index.js +69 -0
- package/build/components/sidebar-navigation-screen-pages-dataviews/index.js.map +1 -0
- package/build/components/style-book/index.js +38 -8
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +11 -6
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/index.js +12 -7
- package/build/index.js.map +1 -1
- package/build/store/actions.js +39 -44
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +6 -2
- package/build/store/private-actions.js.map +1 -1
- package/build/store/reducer.js +0 -46
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +32 -41
- package/build/store/selectors.js.map +1 -1
- package/build/utils/get-is-list-page.js +1 -1
- package/build/utils/get-is-list-page.js.map +1 -1
- package/build-module/components/block-editor/back-button.js +4 -3
- package/build-module/components/block-editor/back-button.js.map +1 -1
- package/build-module/components/block-editor/resizable-editor.js +2 -2
- package/build-module/components/block-editor/resizable-editor.js.map +1 -1
- package/build-module/components/block-editor/use-post-link-props.js +20 -0
- package/build-module/components/block-editor/use-post-link-props.js.map +1 -0
- package/build-module/components/block-editor/use-site-editor-settings.js +8 -25
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +14 -7
- package/build-module/components/create-template-part-modal/index.js.map +1 -1
- package/build-module/components/editor/index.js +16 -17
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +9 -7
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +5 -2
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js +3 -3
- package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +7 -7
- package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +8 -4
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/index.js +39 -22
- package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +2 -2
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js +5 -2
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/local-fonts.js +27 -11
- package/build-module/components/global-styles/font-library-modal/local-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/resolvers.js +5 -5
- package/build-module/components/global-styles/font-library-modal/resolvers.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/{tab-layout.js → tab-panel-layout.js} +4 -4
- package/build-module/components/global-styles/font-library-modal/tab-panel-layout.js.map +1 -0
- package/build-module/components/global-styles/font-library-modal/utils/index.js +34 -36
- package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build-module/components/global-styles/preview.js +45 -3
- package/build-module/components/global-styles/preview.js.map +1 -1
- package/build-module/components/global-styles/screen-color-palette.js +17 -13
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +53 -53
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +27 -36
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +40 -22
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build-module/components/global-styles/ui.js +15 -64
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/header-edit-mode/document-tools/index.js +13 -110
- package/build-module/components/header-edit-mode/document-tools/index.js.map +1 -1
- package/build-module/components/header-edit-mode/index.js +7 -11
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/header-edit-mode/mode-switcher/index.js +0 -2
- package/build-module/components/header-edit-mode/mode-switcher/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +10 -7
- package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/edit-mode.js +0 -23
- package/build-module/components/keyboard-shortcuts/edit-mode.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/register.js +0 -36
- package/build-module/components/keyboard-shortcuts/register.js.map +1 -1
- package/build-module/components/layout/index.js +6 -13
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page-main/index.js +4 -4
- package/build-module/components/page-main/index.js.map +1 -1
- package/build-module/components/page-pages/index.js +83 -36
- package/build-module/components/page-pages/index.js.map +1 -1
- package/build-module/components/page-patterns/dataviews-pattern-actions.js +292 -0
- package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -0
- package/build-module/components/page-patterns/dataviews-patterns.js +299 -0
- package/build-module/components/page-patterns/dataviews-patterns.js.map +1 -0
- package/build-module/components/page-patterns/duplicate-menu-item.js +1 -1
- package/build-module/components/page-patterns/duplicate-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/grid-item.js +4 -3
- package/build-module/components/page-patterns/grid-item.js.map +1 -1
- package/build-module/components/page-patterns/patterns-list.js +2 -1
- package/build-module/components/page-patterns/patterns-list.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +23 -13
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-templates/index.js +314 -38
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/{page-patterns/pagination.js → pagination/index.js} +24 -12
- package/build-module/components/pagination/index.js.map +1 -0
- package/build-module/components/{page-pages/side-editor.js → post-preview/index.js} +7 -3
- package/build-module/components/post-preview/index.js.map +1 -0
- package/build-module/components/preferences-modal/enable-feature.js +3 -2
- package/build-module/components/preferences-modal/enable-feature.js.map +1 -1
- package/build-module/components/preferences-modal/enable-panel-option.js +26 -0
- package/build-module/components/preferences-modal/enable-panel-option.js.map +1 -0
- package/build-module/components/preferences-modal/index.js +57 -9
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/revisions/index.js +4 -8
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/routes/link.js +5 -2
- package/build-module/components/routes/link.js.map +1 -1
- package/build-module/components/save-button/index.js +6 -3
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +3 -11
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +17 -5
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +2 -2
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/default-sidebar.js +1 -5
- package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js +64 -12
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/index.js +2 -2
- package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -4
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/index.js +6 -15
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +5 -2
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/index.js +4 -1
- package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js +61 -0
- package/build-module/components/sidebar-navigation-screen-pages-dataviews/index.js.map +1 -0
- package/build-module/components/style-book/index.js +40 -10
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +11 -6
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/index.js +12 -7
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +36 -41
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +6 -2
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/reducer.js +0 -44
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +30 -38
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/get-is-list-page.js +1 -1
- package/build-module/utils/get-is-list-page.js.map +1 -1
- package/build-style/style-rtl.css +357 -268
- package/build-style/style.css +357 -268
- package/package.json +42 -42
- package/src/components/add-new-template/style.scss +2 -1
- package/src/components/block-editor/back-button.js +4 -2
- package/src/components/block-editor/resizable-editor.js +1 -1
- package/src/components/block-editor/style.scss +1 -2
- package/src/components/block-editor/use-post-link-props.js +20 -0
- package/src/components/block-editor/use-site-editor-settings.js +10 -41
- package/src/components/code-editor/style.scss +0 -4
- package/src/components/create-template-part-modal/index.js +83 -82
- package/src/components/editor/index.js +24 -31
- package/src/components/editor-canvas-container/index.js +8 -6
- package/src/components/global-styles/font-library-modal/collection-font-variant.js +7 -2
- package/src/components/global-styles/font-library-modal/confirm-delete-dialog.js +3 -3
- package/src/components/global-styles/font-library-modal/context.js +7 -7
- package/src/components/global-styles/font-library-modal/font-collection.js +10 -5
- package/src/components/global-styles/font-library-modal/index.js +44 -24
- package/src/components/global-styles/font-library-modal/installed-fonts.js +3 -3
- package/src/components/global-styles/font-library-modal/library-font-variant.js +7 -2
- package/src/components/global-styles/font-library-modal/local-fonts.js +53 -26
- package/src/components/global-styles/font-library-modal/resolvers.js +5 -5
- package/src/components/global-styles/font-library-modal/style.scss +5 -2
- package/src/components/global-styles/font-library-modal/{tab-layout.js → tab-panel-layout.js} +9 -3
- package/src/components/global-styles/font-library-modal/utils/index.js +21 -23
- package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamily.spec.js +58 -0
- package/src/components/global-styles/preview.js +55 -3
- package/src/components/global-styles/screen-color-palette.js +16 -26
- package/src/components/global-styles/screen-revisions/index.js +91 -92
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +37 -38
- package/src/components/global-styles/screen-revisions/style.scss +77 -20
- package/src/components/global-styles/screen-revisions/test/use-global-styles-revisions.js +67 -0
- package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +73 -46
- package/src/components/global-styles/ui.js +13 -74
- package/src/components/header-edit-mode/document-tools/index.js +33 -165
- package/src/components/header-edit-mode/index.js +6 -17
- package/src/components/header-edit-mode/mode-switcher/index.js +0 -4
- package/src/components/header-edit-mode/more-menu/index.js +9 -7
- package/src/components/header-edit-mode/style.scss +0 -47
- package/src/components/keyboard-shortcuts/edit-mode.js +1 -26
- package/src/components/keyboard-shortcuts/register.js +0 -43
- package/src/components/layout/index.js +8 -27
- package/src/components/layout/style.scss +10 -3
- package/src/components/list/style.scss +0 -5
- package/src/components/page/style.scss +1 -1
- package/src/components/page-main/index.js +8 -8
- package/src/components/page-pages/index.js +112 -41
- package/src/components/page-pages/style.scss +3 -2
- package/src/components/page-patterns/dataviews-pattern-actions.js +329 -0
- package/src/components/page-patterns/dataviews-patterns.js +380 -0
- package/src/components/page-patterns/duplicate-menu-item.js +1 -1
- package/src/components/page-patterns/grid-item.js +3 -2
- package/src/components/page-patterns/patterns-list.js +2 -1
- package/src/components/page-patterns/style.scss +89 -26
- package/src/components/page-patterns/use-patterns.js +24 -15
- package/src/components/page-templates/index.js +399 -64
- package/src/components/{page-patterns/pagination.js → pagination/index.js} +21 -10
- package/src/components/pagination/style.scss +5 -0
- package/src/components/post-preview/index.js +16 -0
- package/src/components/preferences-modal/enable-feature.js +9 -5
- package/src/components/preferences-modal/enable-panel-option.js +23 -0
- package/src/components/preferences-modal/index.js +107 -22
- package/src/components/revisions/index.js +8 -15
- package/src/components/routes/link.js +11 -3
- package/src/components/save-button/index.js +16 -3
- package/src/components/sidebar/index.js +6 -13
- package/src/components/sidebar-dataviews/add-new-view.js +1 -1
- package/src/components/sidebar-dataviews/default-views.js +23 -6
- package/src/components/sidebar-dataviews/index.js +2 -2
- package/src/components/sidebar-edit-mode/default-sidebar.js +0 -12
- package/src/components/sidebar-edit-mode/global-styles-sidebar.js +85 -14
- package/src/components/sidebar-edit-mode/page-panels/index.js +15 -1
- package/src/components/sidebar-edit-mode/plugin-sidebar/index.js +0 -12
- package/src/components/sidebar-edit-mode/style.scss +0 -10
- package/src/components/sidebar-edit-mode/template-panel/index.js +44 -40
- package/src/components/sidebar-edit-mode/template-panel/style.scss +0 -4
- package/src/components/sidebar-navigation-screen-details-footer/index.js +1 -1
- package/src/components/sidebar-navigation-screen-global-styles/index.js +3 -2
- package/src/components/sidebar-navigation-screen-page/index.js +2 -1
- package/src/components/sidebar-navigation-screen-pages-dataviews/index.js +77 -0
- package/src/components/site-hub/style.scss +5 -2
- package/src/components/style-book/index.js +65 -21
- package/src/components/style-book/style.scss +3 -3
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +4 -1
- package/src/hooks/commands/use-edit-mode-commands.js +8 -12
- package/src/index.js +11 -5
- package/src/store/actions.js +35 -45
- package/src/store/private-actions.js +7 -3
- package/src/store/reducer.js +0 -44
- package/src/store/selectors.js +32 -38
- package/src/store/test/actions.js +11 -39
- package/src/store/test/reducer.js +1 -82
- package/src/store/test/selectors.js +0 -24
- package/src/style.scss +1 -1
- package/src/utils/get-is-list-page.js +2 -3
- package/build/components/global-styles/font-library-modal/tab-layout.js.map +0 -1
- package/build/components/global-styles/screen-revisions/get-revision-changes.js +0 -146
- package/build/components/global-styles/screen-revisions/get-revision-changes.js.map +0 -1
- package/build/components/header-edit-mode/undo-redo/redo.js +0 -41
- package/build/components/header-edit-mode/undo-redo/redo.js.map +0 -1
- package/build/components/header-edit-mode/undo-redo/undo.js +0 -40
- package/build/components/header-edit-mode/undo-redo/undo.js.map +0 -1
- package/build/components/page-pages/side-editor.js.map +0 -1
- package/build/components/page-patterns/pagination.js.map +0 -1
- package/build/components/page-templates/dataviews-templates.js +0 -317
- package/build/components/page-templates/dataviews-templates.js.map +0 -1
- package/build/components/secondary-sidebar/inserter-sidebar.js +0 -60
- package/build/components/secondary-sidebar/inserter-sidebar.js.map +0 -1
- package/build/components/secondary-sidebar/list-view-sidebar.js +0 -109
- package/build/components/secondary-sidebar/list-view-sidebar.js.map +0 -1
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -35
- package/build/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-panel/last-revision.js +0 -73
- package/build/components/sidebar-edit-mode/template-panel/last-revision.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -219
- package/build/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +0 -1
- package/build-module/components/global-styles/font-library-modal/tab-layout.js.map +0 -1
- package/build-module/components/global-styles/screen-revisions/get-revision-changes.js +0 -139
- package/build-module/components/global-styles/screen-revisions/get-revision-changes.js.map +0 -1
- package/build-module/components/header-edit-mode/undo-redo/redo.js +0 -33
- package/build-module/components/header-edit-mode/undo-redo/redo.js.map +0 -1
- package/build-module/components/header-edit-mode/undo-redo/undo.js +0 -32
- package/build-module/components/header-edit-mode/undo-redo/undo.js.map +0 -1
- package/build-module/components/page-pages/side-editor.js.map +0 -1
- package/build-module/components/page-patterns/pagination.js.map +0 -1
- package/build-module/components/page-templates/dataviews-templates.js +0 -309
- package/build-module/components/page-templates/dataviews-templates.js.map +0 -1
- package/build-module/components/secondary-sidebar/inserter-sidebar.js +0 -53
- package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +0 -1
- package/build-module/components/secondary-sidebar/list-view-sidebar.js +0 -102
- package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -27
- package/build-module/components/sidebar-edit-mode/sidebar-fixed-bottom.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js +0 -65
- package/build-module/components/sidebar-edit-mode/template-panel/last-revision.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -209
- package/build-module/components/sidebar-edit-mode/template-panel/pattern-categories.js.map +0 -1
- package/src/components/global-styles/font-library-modal/utils/test/makeFormDataFromFontFamilies.spec.js +0 -62
- package/src/components/global-styles/font-library-modal/utils/test/wpKebabCase.spec.js +0 -28
- package/src/components/global-styles/screen-revisions/get-revision-changes.js +0 -171
- package/src/components/global-styles/screen-revisions/test/get-revision-changes.js +0 -191
- package/src/components/header-edit-mode/undo-redo/redo.js +0 -38
- package/src/components/header-edit-mode/undo-redo/undo.js +0 -34
- package/src/components/page-pages/side-editor.js +0 -14
- package/src/components/page-templates/dataviews-templates.js +0 -360
- package/src/components/secondary-sidebar/inserter-sidebar.js +0 -66
- package/src/components/secondary-sidebar/list-view-sidebar.js +0 -123
- package/src/components/secondary-sidebar/style.scss +0 -65
- package/src/components/sidebar-edit-mode/sidebar-fixed-bottom.js +0 -26
- package/src/components/sidebar-edit-mode/template-panel/last-revision.js +0 -82
- package/src/components/sidebar-edit-mode/template-panel/pattern-categories.js +0 -279
|
@@ -3,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,UAAU;IAAEC;EAAU,CAAC,GAAGV,WAAW,CAAEJ,cAAe,CAAC;EAC/D,MAAMe,WAAW,GAAGA,CAAA,KACnBJ,aAAa,GAAGE,UAAU,CAAC,CAAC,GAAGC,SAAS,CAAEL,sBAAuB,CAAC;EACnE,MAAMO,QAAQ,GAAGX,WAAW,CAAC,CAAC;EAC9B,MAAM;IAAEY,mBAAmB;IAAEC,mBAAmB;IAAEC;EAAoB,CAAC,GACtEf,WAAW,CAAEI,aAAc,CAAC;EAE7B,MAAM;IAAEY,GAAG,EAAEC;EAAc,CAAC,GAAGjB,WAAW,C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C,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,aAAa;AAEpD,OAAO,MAAMC,sBAAsB,GAAG,uBAAuB;AAE7D,eAAe,SAASC,wBAAwBA,CAAA,EAAG;EAClD,MAAMC,aAAa,GAAGf,SAAS,CAAIgB,MAAM,IACxCA,MAAM,CAAElB,cAAe,CAAC,CAACiB,aAAa,CAAEF,sBAAuB,CAChE,CAAC;EACD,MAAM;IAAEI,UAAU;IAAEC;EAAU,CAAC,GAAGjB,WAAW,CAAEH,cAAe,CAAC;EAC/D,MAAMqB,WAAW,GAAGA,CAAA,KACnBJ,aAAa,GAAGE,UAAU,CAAC,CAAC,GAAGC,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ACD,CAAG;MACHwC,KAAK,EAAGxC,EAAE,CAAE,kCAAmC;IAAG,CAClD,CACuB,CAAC,EAC1BkC,aAAA,CAACrC,uBAAuB;MAACuC,KAAK,EAAGpC,EAAE,CAAE,WAAY;IAAG,GACnDkC,aAAA,CAACvB,aAAa;MACb0B,KAAK,EAAC,MAAM;MACZC,WAAW,EAAC,gBAAgB;MAC5BE,KAAK,EAAGxC,EAAE,CAAE,yBAA0B,CAAG;MACzCuC,IAAI,EAAGvC,EAAE,CACR,6DACD;IAAG,CACH,CACuB,CACxB;EAEJ,CAAC,EACD;IACC+B,IAAI,EAAE,QAAQ;IACdC,QAAQ,EAAEhC,EAAE,CAAE,QAAS,CAAC;IACxBiC,OAAO,EACNC,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACrC,uBAAuB;MAACuC,KAAK,EAAGpC,EAAE,CAAE,UAAW;IAAG,GAClDkC,aAAA,CAACvB,aAAa;MACb0B,KAAK,EAAC,MAAM;MACZC,WAAW,EAAC,gBAAgB;MAC5BC,IAAI,EAAGvC,EAAE,CACR,uEACD,CAAG;MACHwC,KAAK,EAAGxC,EAAE,CAAE,uBAAwB;IAAG,CACvC,CACuB,CACxB;EAEJ,CAAC,CACD;EACD,IAAK,CAAEgB,aAAa,EAAG;IACtB,OAAO,IAAI;EACZ;EACA,OACCkB,aAAA,CAACvC,gBAAgB;IAACuB,UAAU,EAAGE;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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
|
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,iBAAiB,EACjBC,wBAAwB,QAClB,iCAAiC;AAExC,MAAM;EAAEC;AAAW,CAAC,GAAGH,MAAM,CAAED,iBAAkB,CAAC;AAElD,OAAO,SAASK,gBAAgBA,CAC/BC,OAAO,EACPC,MAAM,GAAG,CAAC,CAAC,EACXC,KAAK,EACLC,aAAa,GAAG,KAAK,EACpB;EACD,SAASC,OAAOA,CAAEC,KAAK,EAAG;IACzBA,KAAK,CAACC,cAAc,CAAC,CAAC;IAEtB,IAAKH,aAAa,EAAG;MACpBH,OAAO,CAACO,OAAO,CAAEN,MAAM,EAAEC,KAAM,CAAC;I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(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');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","useDispatch","Button","__","sprintf","store","coreStore","displayShortcut","editSiteStore","currentlyPreviewingTheme","isPreviewingTheme","SaveButton","className","variant","showTooltip","defaultLabel","icon","__next40pxDefaultSize","isDirty","isSaving","isSaveViewOpen","previewingThemeName","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","isResolving","dirtyEntityRecords","isSaveViewOpened","isActivatingTheme","previewingTheme","getTheme","length","some","record","kind","name","key","rendered","setIsSaveViewOpened","activateSaveEnabled","disabled","getLabel","label","createElement","isBusy","onClick","undefined","shortcut","primary","size"],"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { displayShortcut } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport {\n\tcurrentlyPreviewingTheme,\n\tisPreviewingTheme,\n} from '../../utils/is-previewing-theme';\n\nexport default function SaveButton( {\n\tclassName = 'edit-site-save-button__button',\n\tvariant = 'primary',\n\tshowTooltip = true,\n\tdefaultLabel,\n\ticon,\n\t__next40pxDefaultSize = false,\n} ) {\n\tconst { isDirty, isSaving, isSaveViewOpen, previewingThemeName } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tisSavingEntityRecord,\n\t\t\t\tisResolving,\n\t\t\t} = select( coreStore );\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\tconst { isSaveViewOpened } = select( editSiteStore );\n\t\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\t\tconst previewingTheme = select( coreStore ).getTheme(\n\t\t\t\tcurrentlyPreviewingTheme()\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\t\tisSaving:\n\t\t\t\t\tdirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\t\tisSavingEntityRecord(\n\t\t\t\t\t\t\trecord.kind,\n\t\t\t\t\t\t\trecord.name,\n\t\t\t\t\t\t\trecord.key\n\t\t\t\t\t\t)\n\t\t\t\t\t) || isActivatingTheme,\n\t\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\t\tpreviewingThemeName: previewingTheme?.name?.rendered,\n\t\t\t};\n\t\t}, [] );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\n\tconst activateSaveEnabled = isPreviewingTheme() || isDirty;\n\tconst disabled = isSaving || ! activateSaveEnabled;\n\n\tconst getLabel = () => {\n\t\tif ( isPreviewingTheme() ) {\n\t\t\tif ( isSaving ) {\n\t\t\t\treturn sprintf( 'Activating %s'
|
|
1
|
+
{"version":3,"names":["useSelect","useDispatch","Button","__","sprintf","store","coreStore","displayShortcut","editSiteStore","currentlyPreviewingTheme","isPreviewingTheme","SaveButton","className","variant","showTooltip","defaultLabel","icon","__next40pxDefaultSize","isDirty","isSaving","isSaveViewOpen","previewingThemeName","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","isResolving","dirtyEntityRecords","isSaveViewOpened","isActivatingTheme","previewingTheme","getTheme","length","some","record","kind","name","key","rendered","setIsSaveViewOpened","activateSaveEnabled","disabled","getLabel","label","createElement","isBusy","onClick","undefined","shortcut","primary","size"],"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { displayShortcut } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport {\n\tcurrentlyPreviewingTheme,\n\tisPreviewingTheme,\n} from '../../utils/is-previewing-theme';\n\nexport default function SaveButton( {\n\tclassName = 'edit-site-save-button__button',\n\tvariant = 'primary',\n\tshowTooltip = true,\n\tdefaultLabel,\n\ticon,\n\t__next40pxDefaultSize = false,\n} ) {\n\tconst { isDirty, isSaving, isSaveViewOpen, previewingThemeName } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tisSavingEntityRecord,\n\t\t\t\tisResolving,\n\t\t\t} = select( coreStore );\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\tconst { isSaveViewOpened } = select( editSiteStore );\n\t\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\t\tconst previewingTheme = select( coreStore ).getTheme(\n\t\t\t\tcurrentlyPreviewingTheme()\n\t\t\t);\n\n\t\t\treturn {\n\t\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\t\tisSaving:\n\t\t\t\t\tdirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\t\tisSavingEntityRecord(\n\t\t\t\t\t\t\trecord.kind,\n\t\t\t\t\t\t\trecord.name,\n\t\t\t\t\t\t\trecord.key\n\t\t\t\t\t\t)\n\t\t\t\t\t) || isActivatingTheme,\n\t\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\t\tpreviewingThemeName: previewingTheme?.name?.rendered,\n\t\t\t};\n\t\t}, [] );\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\n\tconst activateSaveEnabled = isPreviewingTheme() || isDirty;\n\tconst disabled = isSaving || ! activateSaveEnabled;\n\n\tconst getLabel = () => {\n\t\tif ( isPreviewingTheme() ) {\n\t\t\tif ( isSaving ) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t\t__( 'Activating %s' ),\n\t\t\t\t\tpreviewingThemeName\n\t\t\t\t);\n\t\t\t} else if ( disabled ) {\n\t\t\t\treturn __( 'Saved' );\n\t\t\t} else if ( isDirty ) {\n\t\t\t\treturn sprintf(\n\t\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t\t__( 'Activate %s & Save' ),\n\t\t\t\t\tpreviewingThemeName\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn sprintf(\n\t\t\t\t/* translators: %s: The name of theme to be activated. */\n\t\t\t\t__( 'Activate %s' ),\n\t\t\t\tpreviewingThemeName\n\t\t\t);\n\t\t}\n\n\t\tif ( isSaving ) {\n\t\t\treturn __( 'Saving' );\n\t\t} else if ( disabled ) {\n\t\t\treturn __( 'Saved' );\n\t\t} else if ( defaultLabel ) {\n\t\t\treturn defaultLabel;\n\t\t}\n\t\treturn __( 'Save' );\n\t};\n\tconst label = getLabel();\n\n\treturn (\n\t\t<Button\n\t\t\tvariant={ variant }\n\t\t\tclassName={ className }\n\t\t\taria-disabled={ disabled }\n\t\t\taria-expanded={ isSaveViewOpen }\n\t\t\tisBusy={ isSaving }\n\t\t\tonClick={ disabled ? undefined : () => setIsSaveViewOpened( true ) }\n\t\t\tlabel={ label }\n\t\t\t/*\n\t\t\t * We want the tooltip to show the keyboard shortcut only when the\n\t\t\t * button does something, i.e. when it's not disabled.\n\t\t\t */\n\t\t\tshortcut={ disabled ? undefined : displayShortcut.primary( 's' ) }\n\t\t\t/*\n\t\t\t * Displaying the keyboard shortcut conditionally makes the tooltip\n\t\t\t * itself show conditionally. This would trigger a full-rerendering\n\t\t\t * of the button that we want to avoid. By setting `showTooltip`,\n\t\t\t * the tooltip is always rendered even when there's no keyboard shortcut.\n\t\t\t */\n\t\t\tshowTooltip={ showTooltip }\n\t\t\ticon={ icon }\n\t\t\t__next40pxDefaultSize={ __next40pxDefaultSize }\n\t\t\tsize=\"compact\"\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,eAAe,QAAQ,qBAAqB;;AAErD;AACA;AACA;AACA,SAASF,KAAK,IAAIG,aAAa,QAAQ,aAAa;AACpD,SACCC,wBAAwB,EACxBC,iBAAiB,QACX,iCAAiC;AAExC,eAAe,SAASC,UAAUA,CAAE;EACnCC,SAAS,GAAG,+BAA+B;EAC3CC,OAAO,GAAG,SAAS;EACnBC,WAAW,GAAG,IAAI;EAClBC,YAAY;EACZC,IAAI;EACJC,qBAAqB,GAAG;AACzB,CAAC,EAAG;EACH,MAAM;IAAEC,OAAO;IAAEC,QAAQ;IAAEC,cAAc;IAAEC;EAAoB,CAAC,GAC/DrB,SAAS,CAAIsB,MAAM,IAAM;IACxB,MAAM;MACLC,mCAAmC;MACnCC,oBAAoB;MACpBC;IACD,CAAC,GAAGH,MAAM,CAAEhB,SAAU,CAAC;IACvB,MAAMoB,kBAAkB,GAAGH,mCAAmC,CAAC,CAAC;IAChE,MAAM;MAAEI;IAAiB,CAAC,GAAGL,MAAM,CAAEd,aAAc,CAAC;IACp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S,CAAC;IACtB,CAAC,MAAM,IAAKqC,QAAQ,EAAG;MACtB,OAAOrC,EAAE,CAAE,OAAQ,CAAC;IACrB,CAAC,MAAM,IAAKY,YAAY,EAAG;MAC1B,OAAOA,YAAY;IACpB;IACA,OAAOZ,EAAE,CAAE,MAAO,CAAC;EACpB,CAAC;EACD,MAAMuC,KAAK,GAAGD,QAAQ,CAAC,CAAC;EAExB,OACCE,aAAA,CAACzC,MAAM;IACNW,OAAO,EAAGA,OAAS;IACnBD,SAAS,EAAGA,SAAW;IACvB,iBAAgB4B,QAAU;IAC1B,iBAAgBpB,cAAgB;IAChCwB,MAAM,EAAGzB,QAAU;IACnB0B,OAAO,EAAGL,QAAQ,GAAGM,SAAS,GAAG,MAAMR,mBAAmB,CAAE,IAAK,CAAG;IACpEI,KAAK,EAAGA;IACR;AACH;AACA;AACA,OAHG;IAIAK,QAAQ,EAAGP,QAAQ,GAAGM,SAAS,GAAGvC,eAAe,CAACyC,OAAO,CAAE,GAAI;IAC/D;AACH;AACA;AACA;AACA;AACA,OALG;IAMAlC,WAAW,EAAGA,WAAa;IAC3BE,IAAI,EAAGA,IAAM;IACbC,qBAAqB,EAAGA,qBAAuB;IAC/CgC,IAAI,EAAC;EAAS,GAEZP,KACK,CAAC;AAEX"}
|
|
@@ -8,7 +8,6 @@ import classNames from 'classnames';
|
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
10
|
import { memo, useRef } from '@wordpress/element';
|
|
11
|
-
import { __ } from '@wordpress/i18n';
|
|
12
11
|
import { __experimentalNavigatorProvider as NavigatorProvider, __experimentalNavigatorScreen as NavigatorScreen } from '@wordpress/components';
|
|
13
12
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
14
13
|
|
|
@@ -28,9 +27,8 @@ import SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen
|
|
|
28
27
|
import SaveHub from '../save-hub';
|
|
29
28
|
import { unlock } from '../../lock-unlock';
|
|
30
29
|
import SidebarNavigationScreenPages from '../sidebar-navigation-screen-pages';
|
|
30
|
+
import SidebarNavigationScreenPagesDataViews from '../sidebar-navigation-screen-pages-dataviews';
|
|
31
31
|
import SidebarNavigationScreenPage from '../sidebar-navigation-screen-page';
|
|
32
|
-
import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
33
|
-
import DataViewsSidebarContent from '../sidebar-dataviews';
|
|
34
32
|
const {
|
|
35
33
|
useLocation
|
|
36
34
|
} = unlock(routerPrivateApis);
|
|
@@ -55,15 +53,9 @@ function SidebarScreens() {
|
|
|
55
53
|
path: "/wp_global_styles"
|
|
56
54
|
}, createElement(SidebarNavigationScreenGlobalStyles, null)), createElement(SidebarScreenWrapper, {
|
|
57
55
|
path: "/page"
|
|
58
|
-
}, createElement(SidebarNavigationScreenPages, null)), createElement(SidebarScreenWrapper, {
|
|
56
|
+
}, window?.__experimentalAdminViews ? createElement(SidebarNavigationScreenPagesDataViews, null) : createElement(SidebarNavigationScreenPages, null)), createElement(SidebarScreenWrapper, {
|
|
59
57
|
path: "/page/:postId"
|
|
60
|
-
}, createElement(SidebarNavigationScreenPage, null)),
|
|
61
|
-
path: "/pages"
|
|
62
|
-
}, createElement(SidebarNavigationScreen, {
|
|
63
|
-
title: __('Pages'),
|
|
64
|
-
backPath: "/page",
|
|
65
|
-
content: createElement(DataViewsSidebarContent, null)
|
|
66
|
-
})), createElement(SidebarScreenWrapper, {
|
|
58
|
+
}, createElement(SidebarNavigationScreenPage, null)), createElement(SidebarScreenWrapper, {
|
|
67
59
|
path: "/:postType(wp_template)"
|
|
68
60
|
}, createElement(SidebarNavigationScreenTemplates, null)), createElement(SidebarScreenWrapper, {
|
|
69
61
|
path: "/patterns"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["classNames","memo","useRef","
|
|
1
|
+
{"version":3,"names":["classNames","memo","useRef","__experimentalNavigatorProvider","NavigatorProvider","__experimentalNavigatorScreen","NavigatorScreen","privateApis","routerPrivateApis","SidebarNavigationScreenMain","SidebarNavigationScreenTemplates","SidebarNavigationScreenTemplate","SidebarNavigationScreenPatterns","SidebarNavigationScreenPattern","useSyncPathWithURL","getPathFromURL","SidebarNavigationScreenNavigationMenus","SidebarNavigationScreenNavigationMenu","SidebarNavigationScreenGlobalStyles","SidebarNavigationScreenTemplatesBrowse","SaveHub","unlock","SidebarNavigationScreenPages","SidebarNavigationScreenPagesDataViews","SidebarNavigationScreenPage","useLocation","SidebarScreenWrapper","className","props","createElement","SidebarScreens","Fragment","path","window","__experimentalAdminViews","Sidebar","params","urlParams","initialPath","current"],"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { memo, useRef } from '@wordpress/element';\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n} from '@wordpress/components';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';\nimport SidebarNavigationScreenTemplates from '../sidebar-navigation-screen-templates';\nimport SidebarNavigationScreenTemplate from '../sidebar-navigation-screen-template';\nimport SidebarNavigationScreenPatterns from '../sidebar-navigation-screen-patterns';\nimport SidebarNavigationScreenPattern from '../sidebar-navigation-screen-pattern';\nimport useSyncPathWithURL, {\n\tgetPathFromURL,\n} from '../sync-state-with-url/use-sync-path-with-url';\nimport SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';\nimport SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';\nimport SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-global-styles';\nimport SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';\nimport SaveHub from '../save-hub';\nimport { unlock } from '../../lock-unlock';\nimport SidebarNavigationScreenPages from '../sidebar-navigation-screen-pages';\nimport SidebarNavigationScreenPagesDataViews from '../sidebar-navigation-screen-pages-dataviews';\nimport SidebarNavigationScreenPage from '../sidebar-navigation-screen-page';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nfunction SidebarScreenWrapper( { className, ...props } ) {\n\treturn (\n\t\t<NavigatorScreen\n\t\t\tclassName={ classNames(\n\t\t\t\t'edit-site-sidebar__screen-wrapper',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction SidebarScreens() {\n\tuseSyncPathWithURL();\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarScreenWrapper path=\"/\">\n\t\t\t\t<SidebarNavigationScreenMain />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/navigation\">\n\t\t\t\t<SidebarNavigationScreenNavigationMenus />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/navigation/:postType/:postId\">\n\t\t\t\t<SidebarNavigationScreenNavigationMenu />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/wp_global_styles\">\n\t\t\t\t<SidebarNavigationScreenGlobalStyles />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/page\">\n\t\t\t\t{ window?.__experimentalAdminViews ? (\n\t\t\t\t\t<SidebarNavigationScreenPagesDataViews />\n\t\t\t\t) : (\n\t\t\t\t\t<SidebarNavigationScreenPages />\n\t\t\t\t) }\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/page/:postId\">\n\t\t\t\t<SidebarNavigationScreenPage />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/:postType(wp_template)\">\n\t\t\t\t<SidebarNavigationScreenTemplates />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/patterns\">\n\t\t\t\t<SidebarNavigationScreenPatterns />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/:postType(wp_template|wp_template_part)/all\">\n\t\t\t\t<SidebarNavigationScreenTemplatesBrowse />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/:postType(wp_template_part|wp_block)/:postId\">\n\t\t\t\t<SidebarNavigationScreenPattern />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/:postType(wp_template)/:postId\">\n\t\t\t\t<SidebarNavigationScreenTemplate />\n\t\t\t</SidebarScreenWrapper>\n\t\t</>\n\t);\n}\n\nfunction Sidebar() {\n\tconst { params: urlParams } = useLocation();\n\tconst initialPath = useRef( getPathFromURL( urlParams ) );\n\n\treturn (\n\t\t<>\n\t\t\t<NavigatorProvider\n\t\t\t\tclassName=\"edit-site-sidebar__content\"\n\t\t\t\tinitialPath={ initialPath.current }\n\t\t\t>\n\t\t\t\t<SidebarScreens />\n\t\t\t</NavigatorProvider>\n\t\t\t<SaveHub />\n\t\t</>\n\t);\n}\n\nexport default memo( Sidebar );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,IAAI,EAAEC,MAAM,QAAQ,oBAAoB;AACjD,SACCC,+BAA+B,IAAIC,iBAAiB,EACpDC,6BAA6B,IAAIC,eAAe,QAC1C,uBAAuB;AAC9B,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,OAAOC,2BAA2B,MAAM,mCAAmC;AAC3E,OAAOC,gCAAgC,MAAM,wCAAwC;AACrF,OAAOC,+BAA+B,MAAM,uCAAuC;AACnF,OAAOC,+BAA+B,MAAM,uCAAuC;AACnF,OAAOC,8BAA8B,MAAM,sCAAsC;AACjF,OAAOC,kBAAkB,IACxBC,cAAc,QACR,+CAA+C;AACtD,OAAOC,sCAAsC,MAAM,+CAA+C;AAClG,OAAOC,qCAAqC,MAAM,8CAA8C;AAChG,OAAOC,mCAA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BAA2B,MAAE,CACT,CAAC,EACvBK,aAAA,CAACH,oBAAoB;IAACM,IAAI,EAAC;EAAyB,GACnDH,aAAA,CAACnB,gCAAgC,MAAE,CACd,CAAC,EACvBmB,aAAA,CAACH,oBAAoB;IAACM,IAAI,EAAC;EAAW,GACrCH,aAAA,CAACjB,+BAA+B,MAAE,CACb,CAAC,EACvBiB,aAAA,CAACH,oBAAoB;IAACM,IAAI,EAAC;EAA8C,GACxEH,aAAA,CAACV,sCAAsC,MAAE,CACpB,CAAC,EACvBU,aAAA,CAACH,oBAAoB;IAACM,IAAI,EAAC;EAA+C,GACzEH,aAAA,CAAChB,8BAA8B,MAAE,CACZ,CAAC,EACvBgB,aAAA,CAACH,oBAAoB;IAACM,IAAI,EAAC;EAAiC,GAC3DH,aAAA,CAAClB,+BAA+B,MAAE,CACb,CACrB,CAAC;AAEL;AAEA,SAASwB,OAAOA,CAAA,EAAG;EAClB,MAAM;IAAEC,MAAM,EAAEC;EAAU,CAAC,GAAGZ,WAAW,CAAC,CAAC;EAC3C,MAAMa,WAAW,GAAGpC,MAAM,CAAEa,cAAc,CAAEsB,SAAU,CAAE,CAAC;EAEzD,OACCR,aAAA,CAAAE,QAAA,QACCF,aAAA,CAACzB,iBAAiB;IACjBuB,SAAS,EAAC,4BAA4B;IACtCW,WAAW,EAAGA,WAAW,CAACC;EAAS,GAEnCV,aAAA,CAACC,cAAc,MAAE,CACC,CAAC,EACpBD,aAAA,CAACT,OAAO,MAAE,CACT,CAAC;AAEL;AAEA,eAAenB,IAAI,CAAEkC,OAAQ,CAAC"}
|
|
@@ -14,7 +14,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
|
14
14
|
* Internal dependencies
|
|
15
15
|
*/
|
|
16
16
|
import SidebarNavigationItem from '../sidebar-navigation-item';
|
|
17
|
-
import DEFAULT_VIEWS from './default-views';
|
|
17
|
+
import { DEFAULT_VIEWS } from './default-views';
|
|
18
18
|
import { unlock } from '../../lock-unlock';
|
|
19
19
|
const {
|
|
20
20
|
useHistory,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Modal","TextControl","__experimentalHStack","HStack","__experimentalVStack","VStack","Button","__","useDispatch","resolveSelect","store","coreStore","useState","plus","privateApis","routerPrivateApis","SidebarNavigationItem","DEFAULT_VIEWS","unlock","useHistory","useLocation","AddNewItemModalContent","type","setIsAdding","params","path","history","saveEntityRecord","title","setTitle","isSaving","setIsSaving","createElement","onSubmit","event","preventDefault","getEntityRecords","dataViewTaxonomyId","dataViewTypeRecords","slug","length","id","record","name","savedRecord","status","wp_dataviews_type","content","JSON","stringify","view","push","activeView","isCustom","spacing","__nextHasNoMarginBottom","label","value","onChange","placeholder","className","justify","variant","onClick","isBusy","AddNewItem","isAdding","Fragment","icon","onRequestClose"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/add-new-view.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tModal,\n\tTextControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tButton,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, resolveSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useState } from '@wordpress/element';\nimport { plus } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport DEFAULT_VIEWS from './default-views';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\nfunction AddNewItemModalContent( { type, setIsAdding } ) {\n\tconst {\n\t\tparams: { path },\n\t} = useLocation();\n\tconst history = useHistory();\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst [ title, setTitle ] = useState( '' );\n\tconst [ isSaving, setIsSaving ] = useState( false );\n\treturn (\n\t\t<form\n\t\t\tonSubmit={ async ( event ) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tsetIsSaving( true );\n\t\t\t\tconst { getEntityRecords } = resolveSelect( coreStore );\n\t\t\t\tlet dataViewTaxonomyId;\n\t\t\t\tconst dataViewTypeRecords = await getEntityRecords(\n\t\t\t\t\t'taxonomy',\n\t\t\t\t\t'wp_dataviews_type',\n\t\t\t\t\t{ slug: type }\n\t\t\t\t);\n\t\t\t\tif ( dataViewTypeRecords && dataViewTypeRecords.length > 0 ) {\n\t\t\t\t\tdataViewTaxonomyId = dataViewTypeRecords[ 0 ].id;\n\t\t\t\t} else {\n\t\t\t\t\tconst record = await saveEntityRecord(\n\t\t\t\t\t\t'taxonomy',\n\t\t\t\t\t\t'wp_dataviews_type',\n\t\t\t\t\t\t{ name: type }\n\t\t\t\t\t);\n\t\t\t\t\tif ( record && record.id ) {\n\t\t\t\t\t\tdataViewTaxonomyId = record.id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst savedRecord = await saveEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_dataviews',\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle,\n\t\t\t\t\t\tstatus: 'publish',\n\t\t\t\t\t\twp_dataviews_type: dataViewTaxonomyId,\n\t\t\t\t\t\tcontent: JSON.stringify(\n\t\t\t\t\t\t\tDEFAULT_VIEWS[ type ][ 0 ].view\n\t\t\t\t\t\t),\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\thistory.push( {\n\t\t\t\t\tpath,\n\t\t\t\t\tactiveView: savedRecord.id,\n\t\t\t\t\tisCustom: 'true',\n\t\t\t\t} );\n\t\t\t\tsetIsSaving( false );\n\t\t\t\tsetIsAdding( false );\n\t\t\t} }\n\t\t>\n\t\t\t<VStack spacing=\"5\">\n\t\t\t\t<TextControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\tvalue={ title }\n\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\tplaceholder={ __( 'My view' ) }\n\t\t\t\t\tclassName=\"patterns-create-modal__name-input\"\n\t\t\t\t/>\n\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetIsAdding( false );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t</Button>\n\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\taria-disabled={ ! title || isSaving }\n\t\t\t\t\t\tisBusy={ isSaving }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Create' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t</VStack>\n\t\t</form>\n\t);\n}\n\nexport default function AddNewItem( { type } ) {\n\tconst [ isAdding, setIsAdding ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationItem\n\t\t\t\ticon={ plus }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsAdding( true );\n\t\t\t\t} }\n\t\t\t\tclassName=\"dataviews__siderbar-content-add-new-item\"\n\t\t\t>\n\t\t\t\t{ __( 'New view' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t{ isAdding && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Add new view' ) }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\tsetIsAdding( false );\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<AddNewItemModalContent\n\t\t\t\t\t\ttype={ type }\n\t\t\t\t\t\tsetIsAdding={ setIsAdding }\n\t\t\t\t\t/>\n\t\t\t\t</Modal>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,KAAK,EACLC,WAAW,EACXC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,MAAM,QACA,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,EAAEC,aAAa,QAAQ,iBAAiB;AAC5D,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,IAAI,QAAQ,kBAAkB;AACvC,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,
|
|
1
|
+
{"version":3,"names":["Modal","TextControl","__experimentalHStack","HStack","__experimentalVStack","VStack","Button","__","useDispatch","resolveSelect","store","coreStore","useState","plus","privateApis","routerPrivateApis","SidebarNavigationItem","DEFAULT_VIEWS","unlock","useHistory","useLocation","AddNewItemModalContent","type","setIsAdding","params","path","history","saveEntityRecord","title","setTitle","isSaving","setIsSaving","createElement","onSubmit","event","preventDefault","getEntityRecords","dataViewTaxonomyId","dataViewTypeRecords","slug","length","id","record","name","savedRecord","status","wp_dataviews_type","content","JSON","stringify","view","push","activeView","isCustom","spacing","__nextHasNoMarginBottom","label","value","onChange","placeholder","className","justify","variant","onClick","isBusy","AddNewItem","isAdding","Fragment","icon","onRequestClose"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/add-new-view.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tModal,\n\tTextControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\tButton,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, resolveSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useState } from '@wordpress/element';\nimport { plus } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { DEFAULT_VIEWS } from './default-views';\nimport { unlock } from '../../lock-unlock';\n\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\n\nfunction AddNewItemModalContent( { type, setIsAdding } ) {\n\tconst {\n\t\tparams: { path },\n\t} = useLocation();\n\tconst history = useHistory();\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\tconst [ title, setTitle ] = useState( '' );\n\tconst [ isSaving, setIsSaving ] = useState( false );\n\treturn (\n\t\t<form\n\t\t\tonSubmit={ async ( event ) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tsetIsSaving( true );\n\t\t\t\tconst { getEntityRecords } = resolveSelect( coreStore );\n\t\t\t\tlet dataViewTaxonomyId;\n\t\t\t\tconst dataViewTypeRecords = await getEntityRecords(\n\t\t\t\t\t'taxonomy',\n\t\t\t\t\t'wp_dataviews_type',\n\t\t\t\t\t{ slug: type }\n\t\t\t\t);\n\t\t\t\tif ( dataViewTypeRecords && dataViewTypeRecords.length > 0 ) {\n\t\t\t\t\tdataViewTaxonomyId = dataViewTypeRecords[ 0 ].id;\n\t\t\t\t} else {\n\t\t\t\t\tconst record = await saveEntityRecord(\n\t\t\t\t\t\t'taxonomy',\n\t\t\t\t\t\t'wp_dataviews_type',\n\t\t\t\t\t\t{ name: type }\n\t\t\t\t\t);\n\t\t\t\t\tif ( record && record.id ) {\n\t\t\t\t\t\tdataViewTaxonomyId = record.id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst savedRecord = await saveEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_dataviews',\n\t\t\t\t\t{\n\t\t\t\t\t\ttitle,\n\t\t\t\t\t\tstatus: 'publish',\n\t\t\t\t\t\twp_dataviews_type: dataViewTaxonomyId,\n\t\t\t\t\t\tcontent: JSON.stringify(\n\t\t\t\t\t\t\tDEFAULT_VIEWS[ type ][ 0 ].view\n\t\t\t\t\t\t),\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\thistory.push( {\n\t\t\t\t\tpath,\n\t\t\t\t\tactiveView: savedRecord.id,\n\t\t\t\t\tisCustom: 'true',\n\t\t\t\t} );\n\t\t\t\tsetIsSaving( false );\n\t\t\t\tsetIsAdding( false );\n\t\t\t} }\n\t\t>\n\t\t\t<VStack spacing=\"5\">\n\t\t\t\t<TextControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Name' ) }\n\t\t\t\t\tvalue={ title }\n\t\t\t\t\tonChange={ setTitle }\n\t\t\t\t\tplaceholder={ __( 'My view' ) }\n\t\t\t\t\tclassName=\"patterns-create-modal__name-input\"\n\t\t\t\t/>\n\t\t\t\t<HStack justify=\"right\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetIsAdding( false );\n\t\t\t\t\t\t} }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Cancel' ) }\n\t\t\t\t\t</Button>\n\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\ttype=\"submit\"\n\t\t\t\t\t\taria-disabled={ ! title || isSaving }\n\t\t\t\t\t\tisBusy={ isSaving }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Create' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</HStack>\n\t\t\t</VStack>\n\t\t</form>\n\t);\n}\n\nexport default function AddNewItem( { type } ) {\n\tconst [ isAdding, setIsAdding ] = useState( false );\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationItem\n\t\t\t\ticon={ plus }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tsetIsAdding( true );\n\t\t\t\t} }\n\t\t\t\tclassName=\"dataviews__siderbar-content-add-new-item\"\n\t\t\t>\n\t\t\t\t{ __( 'New view' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t{ isAdding && (\n\t\t\t\t<Modal\n\t\t\t\t\ttitle={ __( 'Add new view' ) }\n\t\t\t\t\tonRequestClose={ () => {\n\t\t\t\t\t\ts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Aa,CAC3B,CACK,CAEP,CAAC;AAEL"}
|
|
@@ -7,9 +7,20 @@ import { trash } from '@wordpress/icons';
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
|
-
import { LAYOUT_TABLE, OPERATOR_IN } from '../../utils/constants';
|
|
10
|
+
import { LAYOUT_LIST, LAYOUT_TABLE, LAYOUT_GRID, OPERATOR_IN } from '../../utils/constants';
|
|
11
|
+
export const DEFAULT_CONFIG_PER_VIEW_TYPE = {
|
|
12
|
+
[LAYOUT_TABLE]: {},
|
|
13
|
+
[LAYOUT_GRID]: {
|
|
14
|
+
mediaField: 'featured-image',
|
|
15
|
+
primaryField: 'title'
|
|
16
|
+
},
|
|
17
|
+
[LAYOUT_LIST]: {
|
|
18
|
+
primaryField: 'title',
|
|
19
|
+
mediaField: 'featured-image'
|
|
20
|
+
}
|
|
21
|
+
};
|
|
11
22
|
const DEFAULT_PAGE_BASE = {
|
|
12
|
-
type:
|
|
23
|
+
type: LAYOUT_LIST,
|
|
13
24
|
search: '',
|
|
14
25
|
filters: [],
|
|
15
26
|
page: 1,
|
|
@@ -21,9 +32,11 @@ const DEFAULT_PAGE_BASE = {
|
|
|
21
32
|
// All fields are visible by default, so it's
|
|
22
33
|
// better to keep track of the hidden ones.
|
|
23
34
|
hiddenFields: ['date', 'featured-image'],
|
|
24
|
-
layout: {
|
|
35
|
+
layout: {
|
|
36
|
+
...DEFAULT_CONFIG_PER_VIEW_TYPE[LAYOUT_LIST]
|
|
37
|
+
}
|
|
25
38
|
};
|
|
26
|
-
const DEFAULT_VIEWS = {
|
|
39
|
+
export const DEFAULT_VIEWS = {
|
|
27
40
|
page: [{
|
|
28
41
|
title: __('All'),
|
|
29
42
|
slug: 'all',
|
|
@@ -53,5 +66,4 @@ const DEFAULT_VIEWS = {
|
|
|
53
66
|
}
|
|
54
67
|
}]
|
|
55
68
|
};
|
|
56
|
-
export default DEFAULT_VIEWS;
|
|
57
69
|
//# sourceMappingURL=default-views.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","trash","LAYOUT_TABLE","OPERATOR_IN","DEFAULT_PAGE_BASE","type","search","filters","page","perPage","sort","field","direction","hiddenFields","layout","DEFAULT_VIEWS","title","slug","view","operator","value","icon"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/default-views.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { trash } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport {
|
|
1
|
+
{"version":3,"names":["__","trash","LAYOUT_LIST","LAYOUT_TABLE","LAYOUT_GRID","OPERATOR_IN","DEFAULT_CONFIG_PER_VIEW_TYPE","mediaField","primaryField","DEFAULT_PAGE_BASE","type","search","filters","page","perPage","sort","field","direction","hiddenFields","layout","DEFAULT_VIEWS","title","slug","view","operator","value","icon"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/default-views.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { trash } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport {\n\tLAYOUT_LIST,\n\tLAYOUT_TABLE,\n\tLAYOUT_GRID,\n\tOPERATOR_IN,\n} from '../../utils/constants';\n\nexport const DEFAULT_CONFIG_PER_VIEW_TYPE = {\n\t[ LAYOUT_TABLE ]: {},\n\t[ LAYOUT_GRID ]: {\n\t\tmediaField: 'featured-image',\n\t\tprimaryField: 'title',\n\t},\n\t[ LAYOUT_LIST ]: {\n\t\tprimaryField: 'title',\n\t\tmediaField: 'featured-image',\n\t},\n};\n\nconst DEFAULT_PAGE_BASE = {\n\ttype: LAYOUT_LIST,\n\tsearch: '',\n\tfilters: [],\n\tpage: 1,\n\tperPage: 20,\n\tsort: {\n\t\tfield: 'date',\n\t\tdirection: 'desc',\n\t},\n\t// All fields are visible by default, so it's\n\t// better to keep track of the hidden ones.\n\thiddenFields: [ 'date', 'featured-image' ],\n\tlayout: {\n\t\t...DEFAULT_CONFIG_PER_VIEW_TYPE[ LAYOUT_LIST ],\n\t},\n};\n\nexport const DEFAULT_VIEWS = {\n\tpage: [\n\t\t{\n\t\t\ttitle: __( 'All' ),\n\t\t\tslug: 'all',\n\t\t\tview: DEFAULT_PAGE_BASE,\n\t\t},\n\t\t{\n\t\t\ttitle: __( 'Drafts' ),\n\t\t\tslug: 'drafts',\n\t\t\tview: {\n\t\t\t\t...DEFAULT_PAGE_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{ field: 'status', operator: OPERATOR_IN, value: 'draft' },\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle: __( 'Trash' ),\n\t\t\tslug: 'trash',\n\t\t\ticon: trash,\n\t\t\tview: {\n\t\t\t\t...DEFAULT_PAGE_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{ field: 'status', operator: OPERATOR_IN, value: 'trash' },\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t],\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,QAAQ,kBAAkB;;AAExC;AACA;AACA;AACA,SACCC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,WAAW,QACL,uBAAuB;AAE9B,OAAO,MAAMC,4BAA4B,GAAG;EAC3C,CAAEH,YAAY,GAAI,CAAC,CAAC;EACpB,CAAEC,WAAW,GAAI;IAChBG,UAAU,EAAE,gBAAgB;IAC5BC,YAAY,EAAE;EACf,CAAC;EACD,CAAEN,WAAW,GAAI;IAChBM,YAAY,EAAE,OAAO;IACrBD,UAAU,EAAE;EACb;AACD,CAAC;AAED,MAAME,iBAAiB,GAAG;EACzBC,IAAI,EAAER,WAAW;EACjBS,MAAM,EAAE,EAAE;EACVC,OAAO,EAAE,EAAE;EACXC,IAAI,EAAE,CAAC;EACPC,OAAO,EAAE,EAAE;EACXC,IAAI,EAAE;IACLC,KAAK,EAAE,MAAM;IACbC,SAAS,EAAE;EACZ,CAAC;EACD;EACA;EACAC,YAAY,EAAE,CAAE,MAAM,EAAE,gBAAgB,CAAE;EAC1CC,MAAM,EAAE;IACP,GAAGb,4BAA4B,CAAEJ,WAAW;EAC7C;AACD,CAAC;AAED,OAAO,MAAMkB,aAAa,GAAG;EAC5BP,IAAI,EAAE,CACL;IACCQ,KAAK,EAAErB,EAAE,CAAE,KAAM,CAAC;IAClBsB,IAAI,EAAE,KAAK;IACXC,IAAI,EAAEd;EACP,CAAC,EACD;IACCY,KAAK,EAAErB,EAAE,CAAE,QAAS,CAAC;IACrBsB,IAAI,EAAE,QAAQ;IACdC,IAAI,EAAE;MACL,GAAGd,iBAAiB;MACpBG,OAAO,EAAE,CACR;QAAEI,KAAK,EAAE,QAAQ;QAAEQ,QAAQ,EAAEnB,WAAW;QAAEoB,KAAK,EAAE;MAAQ,CAAC;IAE5D;EACD,CAAC,EACD;IACCJ,KAAK,EAAErB,EAAE,CAAE,OAAQ,CAAC;IACpBsB,IAAI,EAAE,OAAO;IACbI,IAAI,EAAEzB,KAAK;IACXsB,IAAI,EAAE;MACL,GAAGd,iBAAiB;MACpBG,OAAO,EAAE,CACR;QAAEI,KAAK,EAAE,QAAQ;QAAEQ,QAAQ,EAAEnB,WAAW;QAAEoB,KAAK,EAAE;MAAQ,CAAC;IAE5D;EACD,CAAC;AAEH,CAAC"}
|
|
@@ -8,7 +8,7 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { DEFAULT_VIEWS } from './default-views';
|
|
12
12
|
import { unlock } from '../../lock-unlock';
|
|
13
13
|
const {
|
|
14
14
|
useLocation
|
|
@@ -16,7 +16,7 @@ const {
|
|
|
16
16
|
import DataViewItem from './dataview-item';
|
|
17
17
|
import CustomDataViewsList from './custom-dataviews-list';
|
|
18
18
|
const PATH_TO_TYPE = {
|
|
19
|
-
'/
|
|
19
|
+
'/page': 'page'
|
|
20
20
|
};
|
|
21
21
|
export default function DataViewsSidebarContent() {
|
|
22
22
|
const {
|