@wordpress/edit-site 5.22.0 → 5.24.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 +4 -0
- package/build/components/actions/index.js +115 -15
- package/build/components/actions/index.js.map +1 -1
- package/build/components/add-new-template/new-template.js +0 -7
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/block-editor/site-editor-canvas.js +7 -2
- package/build/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js +54 -63
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/dataviews/add-filter.js +91 -0
- package/build/components/dataviews/add-filter.js.map +1 -0
- package/build/components/dataviews/constants.js +14 -0
- package/build/components/dataviews/constants.js.map +1 -0
- package/build/components/dataviews/dataviews.js +30 -9
- package/build/components/dataviews/dataviews.js.map +1 -1
- package/build/components/dataviews/filter-summary.js +62 -0
- package/build/components/dataviews/filter-summary.js.map +1 -0
- package/build/components/dataviews/filters.js +37 -48
- package/build/components/dataviews/filters.js.map +1 -1
- package/build/components/dataviews/index.js +9 -2
- package/build/components/dataviews/index.js.map +1 -1
- package/build/components/dataviews/item-actions.js +139 -17
- package/build/components/dataviews/item-actions.js.map +1 -1
- package/build/components/dataviews/pagination.js +7 -2
- package/build/components/dataviews/pagination.js.map +1 -1
- package/build/components/dataviews/reset-filters.js +33 -0
- package/build/components/dataviews/reset-filters.js.map +1 -0
- package/build/components/dataviews/search.js +1 -0
- package/build/components/dataviews/search.js.map +1 -1
- package/build/components/dataviews/view-actions.js +49 -32
- package/build/components/dataviews/view-actions.js.map +1 -1
- package/build/components/dataviews/view-grid.js +48 -25
- package/build/components/dataviews/view-grid.js.map +1 -1
- package/build/components/dataviews/view-list.js +130 -14
- package/build/components/dataviews/view-list.js.map +1 -1
- package/build/components/dataviews/view-side-by-side.js +20 -0
- package/build/components/dataviews/view-side-by-side.js.map +1 -0
- package/build/components/editor/index.js +52 -56
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +1 -1
- package/build/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/index.js +15 -2
- package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build/components/global-styles/header.js +4 -2
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +22 -16
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +66 -24
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +52 -24
- 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 +9 -3
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build/components/global-styles/screen-root.js +3 -3
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/ui.js +31 -39
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles-renderer/index.js +1 -1
- package/build/components/global-styles-renderer/index.js.map +1 -1
- package/build/components/header-edit-mode/document-actions/index.js +21 -16
- package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build/components/header-edit-mode/document-tools/index.js +160 -0
- package/build/components/header-edit-mode/document-tools/index.js.map +1 -0
- package/build/components/header-edit-mode/index.js +50 -117
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/index.js +1 -1
- package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/site-export.js +2 -6
- package/build/components/header-edit-mode/more-menu/site-export.js.map +1 -1
- package/build/components/layout/index.js +4 -19
- package/build/components/layout/index.js.map +1 -1
- package/build/components/list/added-by.js +44 -54
- package/build/components/list/added-by.js.map +1 -1
- package/build/components/{page-content-focus-manager → page-content-focus-notifications}/back-to-page-notification.js +11 -15
- package/build/components/page-content-focus-notifications/back-to-page-notification.js.map +1 -0
- package/build/components/{page-content-focus-manager → page-content-focus-notifications}/edit-template-notification.js +9 -13
- package/build/components/page-content-focus-notifications/edit-template-notification.js.map +1 -0
- package/build/components/page-content-focus-notifications/index.js +22 -0
- package/build/components/page-content-focus-notifications/index.js.map +1 -0
- package/build/components/page-main/index.js +2 -1
- package/build/components/page-main/index.js.map +1 -1
- package/build/components/page-pages/index.js +137 -88
- package/build/components/page-pages/index.js.map +1 -1
- package/build/components/page-pages/side-editor.js +25 -0
- package/build/components/page-pages/side-editor.js.map +1 -0
- package/build/components/page-patterns/grid-item.js +2 -2
- package/build/components/page-patterns/grid-item.js.map +1 -1
- package/build/components/page-patterns/patterns-list.js +3 -3
- package/build/components/page-patterns/patterns-list.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +2 -2
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-templates/dataviews-templates.js +316 -0
- package/build/components/page-templates/dataviews-templates.js.map +1 -0
- package/build/components/page-templates/template-actions.js +168 -0
- package/build/components/page-templates/template-actions.js.map +1 -0
- package/build/components/preferences-modal/index.js +1 -1
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/save-button/index.js +9 -6
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js +14 -0
- package/build/components/save-hub/index.js.map +1 -1
- package/build/components/sidebar/index.js +1 -2
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-dataviews/add-new-view.js +124 -0
- package/build/components/sidebar-dataviews/add-new-view.js.map +1 -0
- package/build/components/sidebar-dataviews/custom-dataviews-list.js +191 -0
- package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -0
- package/build/components/sidebar-dataviews/dataview-item.js +71 -0
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -0
- package/build/components/sidebar-dataviews/default-views.js +65 -0
- package/build/components/sidebar-dataviews/default-views.js.map +1 -0
- package/build/components/sidebar-dataviews/index.js +21 -38
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/default-sidebar.js +2 -6
- package/build/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
- package/build/components/sidebar-edit-mode/index.js +6 -5
- package/build/components/sidebar-edit-mode/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/edit-template.js +18 -29
- package/build/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/hooks.js +22 -8
- package/build/components/sidebar-edit-mode/page-panels/hooks.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-status.js +8 -5
- package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js +5 -8
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js +6 -14
- package/build/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js +4 -12
- package/build/components/sidebar-edit-mode/page-panels/swap-template-button.js.map +1 -1
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js +2 -6
- package/build/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/settings-header/index.js +10 -6
- package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/hooks.js +3 -3
- package/build/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/index.js +23 -4
- package/build/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/page-details.js +3 -11
- package/build/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
- package/build/components/site-hub/index.js +18 -6
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/start-template-options/index.js +12 -16
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/components/style-book/index.js +22 -12
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +150 -55
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/template-part-converter/convert-to-regular.js +1 -1
- package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build/components/welcome-guide/page.js +2 -2
- package/build/components/welcome-guide/page.js.map +1 -1
- package/build/components/welcome-guide/template.js +6 -3
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +24 -14
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js +3 -1
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/hooks/template-part-edit.js +6 -2
- package/build/hooks/template-part-edit.js.map +1 -1
- package/build/index.js +0 -3
- package/build/index.js.map +1 -1
- package/build/store/actions.js +39 -83
- package/build/store/actions.js.map +1 -1
- package/build/store/private-actions.js +2 -27
- package/build/store/private-actions.js.map +1 -1
- package/build/store/private-selectors.js +0 -23
- package/build/store/private-selectors.js.map +1 -1
- package/build/store/reducer.js +1 -40
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +33 -67
- package/build/store/selectors.js.map +1 -1
- package/build/utils/constants.js +3 -14
- package/build/utils/constants.js.map +1 -1
- package/build-module/components/actions/index.js +113 -14
- package/build-module/components/actions/index.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +0 -7
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/block-editor/site-editor-canvas.js +7 -2
- package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +54 -62
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/dataviews/add-filter.js +84 -0
- package/build-module/components/dataviews/add-filter.js.map +1 -0
- package/build-module/components/dataviews/constants.js +6 -0
- package/build-module/components/dataviews/constants.js.map +1 -0
- package/build-module/components/dataviews/dataviews.js +29 -9
- package/build-module/components/dataviews/dataviews.js.map +1 -1
- package/build-module/components/dataviews/filter-summary.js +55 -0
- package/build-module/components/dataviews/filter-summary.js.map +1 -0
- package/build-module/components/dataviews/filters.js +37 -48
- package/build-module/components/dataviews/filters.js.map +1 -1
- package/build-module/components/dataviews/index.js +1 -1
- package/build-module/components/dataviews/index.js.map +1 -1
- package/build-module/components/dataviews/item-actions.js +142 -20
- package/build-module/components/dataviews/item-actions.js.map +1 -1
- package/build-module/components/dataviews/pagination.js +7 -2
- package/build-module/components/dataviews/pagination.js.map +1 -1
- package/build-module/components/dataviews/reset-filters.js +26 -0
- package/build-module/components/dataviews/reset-filters.js.map +1 -0
- package/build-module/components/dataviews/search.js +1 -0
- package/build-module/components/dataviews/search.js.map +1 -1
- package/build-module/components/dataviews/view-actions.js +50 -33
- package/build-module/components/dataviews/view-actions.js.map +1 -1
- package/build-module/components/dataviews/view-grid.js +49 -26
- package/build-module/components/dataviews/view-grid.js.map +1 -1
- package/build-module/components/dataviews/view-list.js +132 -16
- package/build-module/components/dataviews/view-list.js.map +1 -1
- package/build-module/components/dataviews/view-side-by-side.js +12 -0
- package/build-module/components/dataviews/view-side-by-side.js.map +1 -0
- package/build-module/components/editor/index.js +55 -59
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/index.js +14 -2
- package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build-module/components/global-styles/header.js +4 -2
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +23 -17
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +67 -25
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +51 -24
- 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 +9 -3
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +3 -3
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/ui.js +31 -39
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles-renderer/index.js +1 -1
- package/build-module/components/global-styles-renderer/index.js.map +1 -1
- package/build-module/components/header-edit-mode/document-actions/index.js +21 -16
- package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build-module/components/header-edit-mode/document-tools/index.js +152 -0
- package/build-module/components/header-edit-mode/document-tools/index.js.map +1 -0
- package/build-module/components/header-edit-mode/index.js +54 -121
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/site-export.js +2 -6
- package/build-module/components/header-edit-mode/more-menu/site-export.js.map +1 -1
- package/build-module/components/layout/index.js +5 -20
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/list/added-by.js +45 -56
- package/build-module/components/list/added-by.js.map +1 -1
- package/build-module/components/{page-content-focus-manager → page-content-focus-notifications}/back-to-page-notification.js +11 -15
- package/build-module/components/page-content-focus-notifications/back-to-page-notification.js.map +1 -0
- package/build-module/components/{page-content-focus-manager → page-content-focus-notifications}/edit-template-notification.js +9 -13
- package/build-module/components/page-content-focus-notifications/edit-template-notification.js.map +1 -0
- package/build-module/components/page-content-focus-notifications/index.js +14 -0
- package/build-module/components/page-content-focus-notifications/index.js.map +1 -0
- package/build-module/components/page-main/index.js +2 -1
- package/build-module/components/page-main/index.js.map +1 -1
- package/build-module/components/page-pages/index.js +141 -90
- package/build-module/components/page-pages/index.js.map +1 -1
- package/build-module/components/page-pages/side-editor.js +17 -0
- package/build-module/components/page-pages/side-editor.js.map +1 -0
- package/build-module/components/page-patterns/grid-item.js +2 -2
- package/build-module/components/page-patterns/grid-item.js.map +1 -1
- package/build-module/components/page-patterns/patterns-list.js +4 -4
- package/build-module/components/page-patterns/patterns-list.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +3 -3
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-templates/dataviews-templates.js +308 -0
- package/build-module/components/page-templates/dataviews-templates.js.map +1 -0
- package/build-module/components/page-templates/template-actions.js +157 -0
- package/build-module/components/page-templates/template-actions.js.map +1 -0
- package/build-module/components/preferences-modal/index.js +1 -1
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/save-button/index.js +11 -8
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-hub/index.js +14 -0
- package/build-module/components/save-hub/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +1 -2
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js +116 -0
- package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -0
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +182 -0
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -0
- package/build-module/components/sidebar-dataviews/dataview-item.js +63 -0
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -0
- package/build-module/components/sidebar-dataviews/default-views.js +57 -0
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -0
- package/build-module/components/sidebar-dataviews/index.js +22 -39
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/default-sidebar.js +2 -6
- package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/index.js +6 -5
- package/build-module/components/sidebar-edit-mode/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js +20 -31
- package/build-module/components/sidebar-edit-mode/page-panels/edit-template.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/hooks.js +21 -7
- package/build-module/components/sidebar-edit-mode/page-panels/hooks.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-status.js +9 -6
- package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +6 -8
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js +8 -16
- package/build-module/components/sidebar-edit-mode/page-panels/reset-default-template.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/swap-template-button.js +5 -13
- package/build-module/components/sidebar-edit-mode/page-panels/swap-template-button.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js +2 -6
- package/build-module/components/sidebar-edit-mode/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/settings-header/index.js +10 -6
- package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/hooks.js +4 -4
- package/build-module/components/sidebar-edit-mode/template-panel/hooks.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/index.js +23 -4
- package/build-module/components/sidebar-navigation-screen-page/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/page-details.js +3 -11
- package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +2 -2
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -1
- package/build-module/components/site-hub/index.js +19 -7
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js +13 -16
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/components/style-book/index.js +22 -12
- 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 +150 -56
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/template-part-converter/convert-to-regular.js +1 -1
- package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build-module/components/welcome-guide/page.js +2 -2
- package/build-module/components/welcome-guide/page.js.map +1 -1
- package/build-module/components/welcome-guide/template.js +6 -3
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +24 -14
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +4 -2
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/hooks/template-part-edit.js +6 -2
- package/build-module/hooks/template-part-edit.js.map +1 -1
- package/build-module/index.js +0 -3
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +37 -80
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/private-actions.js +1 -25
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/private-selectors.js +0 -22
- package/build-module/store/private-selectors.js.map +1 -1
- package/build-module/store/reducer.js +1 -38
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +27 -62
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/constants.js +1 -11
- package/build-module/utils/constants.js.map +1 -1
- package/build-style/style-rtl.css +221 -181
- package/build-style/style.css +221 -181
- package/package.json +41 -41
- package/src/components/actions/index.js +150 -14
- package/src/components/add-new-template/new-template.js +0 -5
- package/src/components/block-editor/site-editor-canvas.js +8 -2
- package/src/components/block-editor/style.scss +0 -87
- package/src/components/block-editor/use-site-editor-settings.js +68 -89
- package/src/components/dataviews/README.md +80 -83
- package/src/components/dataviews/add-filter.js +108 -0
- package/src/components/dataviews/constants.js +5 -0
- package/src/components/dataviews/dataviews.js +28 -10
- package/src/components/dataviews/filter-summary.js +79 -0
- package/src/components/dataviews/filters.js +48 -58
- package/src/components/dataviews/index.js +1 -1
- package/src/components/dataviews/item-actions.js +169 -30
- package/src/components/dataviews/pagination.js +9 -4
- package/src/components/dataviews/reset-filters.js +26 -0
- package/src/components/dataviews/search.js +1 -0
- package/src/components/dataviews/style.scss +89 -9
- package/src/components/dataviews/view-actions.js +77 -49
- package/src/components/dataviews/view-grid.js +63 -38
- package/src/components/dataviews/view-list.js +182 -18
- package/src/components/dataviews/view-side-by-side.js +9 -0
- package/src/components/editor/index.js +135 -123
- package/src/components/global-styles/font-library-modal/utils/get-intersecting-font-faces.js +1 -1
- package/src/components/global-styles/font-library-modal/utils/index.js +20 -9
- package/src/components/global-styles/font-library-modal/utils/test/getIntersectingFontFaces.spec.js +46 -15
- package/src/components/global-styles/font-library-modal/utils/test/wpKebabCase.spec.js +28 -0
- package/src/components/global-styles/header.js +2 -1
- package/src/components/global-styles/screen-block-list.js +37 -26
- package/src/components/global-styles/screen-revisions/index.js +91 -35
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +65 -45
- package/src/components/global-styles/screen-revisions/style.scss +52 -28
- package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +15 -6
- package/src/components/global-styles/screen-root.js +2 -1
- package/src/components/global-styles/style.scss +0 -11
- package/src/components/global-styles/ui.js +60 -75
- package/src/components/global-styles-renderer/index.js +1 -1
- package/src/components/header-edit-mode/document-actions/index.js +20 -18
- package/src/components/header-edit-mode/document-tools/index.js +201 -0
- package/src/components/header-edit-mode/index.js +87 -184
- package/src/components/header-edit-mode/more-menu/index.js +1 -1
- package/src/components/header-edit-mode/more-menu/site-export.js +2 -6
- package/src/components/header-edit-mode/style.scss +35 -2
- package/src/components/layout/index.js +4 -11
- package/src/components/layout/style.scss +6 -18
- package/src/components/list/added-by.js +24 -64
- package/src/components/list/style.scss +11 -13
- package/src/components/{page-content-focus-manager → page-content-focus-notifications}/back-to-page-notification.js +10 -22
- package/src/components/{page-content-focus-manager → page-content-focus-notifications}/edit-template-notification.js +9 -13
- package/src/components/page-content-focus-notifications/index.js +14 -0
- package/src/components/page-main/index.js +6 -1
- package/src/components/page-pages/index.js +167 -91
- package/src/components/page-pages/side-editor.js +14 -0
- package/src/components/page-patterns/grid-item.js +3 -3
- package/src/components/page-patterns/patterns-list.js +10 -4
- package/src/components/page-patterns/use-patterns.js +4 -3
- package/src/components/page-templates/dataviews-templates.js +345 -0
- package/src/components/page-templates/style.scss +13 -0
- package/src/components/page-templates/template-actions.js +209 -0
- package/src/components/preferences-modal/index.js +1 -1
- package/src/components/save-button/index.js +37 -24
- package/src/components/save-hub/index.js +15 -0
- package/src/components/save-hub/style.scss +7 -0
- package/src/components/sidebar/index.js +1 -2
- package/src/components/sidebar-dataviews/add-new-view.js +141 -0
- package/src/components/sidebar-dataviews/custom-dataviews-list.js +229 -0
- package/src/components/sidebar-dataviews/dataview-item.js +67 -0
- package/src/components/sidebar-dataviews/default-views.js +59 -0
- package/src/components/sidebar-dataviews/index.js +36 -45
- package/src/components/sidebar-dataviews/style.scss +29 -0
- package/src/components/sidebar-edit-mode/default-sidebar.js +6 -6
- package/src/components/sidebar-edit-mode/index.js +13 -9
- package/src/components/sidebar-edit-mode/page-panels/edit-template.js +31 -57
- package/src/components/sidebar-edit-mode/page-panels/hooks.js +20 -9
- package/src/components/sidebar-edit-mode/page-panels/page-status.js +6 -6
- package/src/components/sidebar-edit-mode/page-panels/page-summary.js +10 -8
- package/src/components/sidebar-edit-mode/page-panels/reset-default-template.js +13 -12
- package/src/components/sidebar-edit-mode/page-panels/style.scss +14 -19
- package/src/components/sidebar-edit-mode/page-panels/swap-template-button.js +10 -9
- package/src/components/sidebar-edit-mode/plugin-sidebar/index.js +6 -6
- package/src/components/sidebar-edit-mode/settings-header/index.js +8 -9
- package/src/components/sidebar-edit-mode/template-panel/hooks.js +11 -7
- package/src/components/sidebar-navigation-screen/style.scss +1 -0
- package/src/components/sidebar-navigation-screen-global-styles/index.js +1 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +1 -1
- package/src/components/sidebar-navigation-screen-page/index.js +24 -3
- package/src/components/sidebar-navigation-screen-page/page-details.js +4 -17
- package/src/components/sidebar-navigation-screen-patterns/use-theme-patterns.js +2 -2
- package/src/components/sidebar-navigation-screen-template/style.scss +6 -1
- package/src/components/site-hub/index.js +9 -8
- package/src/components/start-template-options/index.js +14 -12
- package/src/components/style-book/index.js +48 -35
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +182 -63
- package/src/components/template-part-converter/convert-to-regular.js +1 -1
- package/src/components/welcome-guide/page.js +2 -2
- package/src/components/welcome-guide/template.js +4 -2
- package/src/hooks/commands/use-edit-mode-commands.js +22 -16
- package/src/hooks/push-changes-to-global-styles/index.js +13 -6
- package/src/hooks/template-part-edit.js +4 -2
- package/src/index.js +0 -8
- package/src/store/actions.js +42 -96
- package/src/store/private-actions.js +1 -24
- package/src/store/private-selectors.js +0 -22
- package/src/store/reducer.js +0 -39
- package/src/store/selectors.js +43 -95
- package/src/store/test/actions.js +14 -169
- package/src/store/test/reducer.js +0 -62
- package/src/store/test/selectors.js +0 -117
- package/src/style.scss +2 -0
- package/src/utils/constants.js +1 -11
- package/build/components/block-editor/block-editor-provider/default-block-editor-provider.js +0 -77
- package/build/components/block-editor/block-editor-provider/default-block-editor-provider.js.map +0 -1
- package/build/components/block-editor/block-editor-provider/index.js +0 -31
- package/build/components/block-editor/block-editor-provider/index.js.map +0 -1
- package/build/components/block-editor/block-editor-provider/navigation-block-editor-provider.js +0 -110
- package/build/components/block-editor/block-editor-provider/navigation-block-editor-provider.js.map +0 -1
- package/build/components/block-editor/block-editor-provider/use-page-content-blocks.js +0 -84
- package/build/components/block-editor/block-editor-provider/use-page-content-blocks.js.map +0 -1
- package/build/components/block-editor/index.js +0 -30
- package/build/components/block-editor/index.js.map +0 -1
- package/build/components/dataviews/in-filter.js +0 -49
- package/build/components/dataviews/in-filter.js.map +0 -1
- package/build/components/page-content-focus-manager/back-to-page-notification.js.map +0 -1
- package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js +0 -50
- package/build/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +0 -1
- package/build/components/page-content-focus-manager/edit-template-notification.js.map +0 -1
- package/build/components/page-content-focus-manager/index.js +0 -61
- package/build/components/page-content-focus-manager/index.js.map +0 -1
- package/build/components/page-pages/default-views.js +0 -62
- package/build/components/page-pages/default-views.js.map +0 -1
- package/build/components/sidebar-edit-mode/page-panels/publish-date.js +0 -87
- package/build/components/sidebar-edit-mode/page-panels/publish-date.js.map +0 -1
- package/build-module/components/block-editor/block-editor-provider/default-block-editor-provider.js +0 -69
- package/build-module/components/block-editor/block-editor-provider/default-block-editor-provider.js.map +0 -1
- package/build-module/components/block-editor/block-editor-provider/index.js +0 -23
- package/build-module/components/block-editor/block-editor-provider/index.js.map +0 -1
- package/build-module/components/block-editor/block-editor-provider/navigation-block-editor-provider.js +0 -102
- package/build-module/components/block-editor/block-editor-provider/navigation-block-editor-provider.js.map +0 -1
- package/build-module/components/block-editor/block-editor-provider/use-page-content-blocks.js +0 -78
- package/build-module/components/block-editor/block-editor-provider/use-page-content-blocks.js.map +0 -1
- package/build-module/components/block-editor/index.js +0 -22
- package/build-module/components/block-editor/index.js.map +0 -1
- package/build-module/components/dataviews/in-filter.js +0 -41
- package/build-module/components/dataviews/in-filter.js.map +0 -1
- package/build-module/components/page-content-focus-manager/back-to-page-notification.js.map +0 -1
- package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js +0 -43
- package/build-module/components/page-content-focus-manager/disable-non-page-content-blocks.js.map +0 -1
- package/build-module/components/page-content-focus-manager/edit-template-notification.js.map +0 -1
- package/build-module/components/page-content-focus-manager/index.js +0 -52
- package/build-module/components/page-content-focus-manager/index.js.map +0 -1
- package/build-module/components/page-pages/default-views.js +0 -55
- package/build-module/components/page-pages/default-views.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/page-panels/publish-date.js +0 -80
- package/build-module/components/sidebar-edit-mode/page-panels/publish-date.js.map +0 -1
- package/src/components/block-editor/block-editor-provider/default-block-editor-provider.js +0 -75
- package/src/components/block-editor/block-editor-provider/index.js +0 -29
- package/src/components/block-editor/block-editor-provider/navigation-block-editor-provider.js +0 -114
- package/src/components/block-editor/block-editor-provider/test/use-page-content-blocks.js +0 -116
- package/src/components/block-editor/block-editor-provider/use-page-content-blocks.js +0 -90
- package/src/components/block-editor/index.js +0 -28
- package/src/components/dataviews/in-filter.js +0 -45
- package/src/components/page-content-focus-manager/disable-non-page-content-blocks.js +0 -52
- package/src/components/page-content-focus-manager/index.js +0 -51
- package/src/components/page-pages/default-views.js +0 -60
- package/src/components/sidebar-edit-mode/page-panels/publish-date.js +0 -94
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.setEditorCanvasContainerView = exports.setCanvasMode = void 0;
|
|
7
7
|
var _blockEditor = require("@wordpress/block-editor");
|
|
8
8
|
var _preferences = require("@wordpress/preferences");
|
|
9
9
|
/**
|
|
@@ -17,8 +17,7 @@ var _preferences = require("@wordpress/preferences");
|
|
|
17
17
|
*/
|
|
18
18
|
const setCanvasMode = mode => ({
|
|
19
19
|
registry,
|
|
20
|
-
dispatch
|
|
21
|
-
select
|
|
20
|
+
dispatch
|
|
22
21
|
}) => {
|
|
23
22
|
registry.dispatch(_blockEditor.store).__unstableSetEditorMode('edit');
|
|
24
23
|
dispatch({
|
|
@@ -30,10 +29,6 @@ const setCanvasMode = mode => ({
|
|
|
30
29
|
if (mode === 'edit' && registry.select(_preferences.store).get('core/edit-site', 'showListViewByDefault') && !registry.select(_preferences.store).get('core/edit-site', 'distractionFree')) {
|
|
31
30
|
dispatch.setIsListViewOpened(true);
|
|
32
31
|
}
|
|
33
|
-
// Switch focus away from editing the template when switching to view mode.
|
|
34
|
-
if (mode === 'view' && select.isPage()) {
|
|
35
|
-
dispatch.setHasPageContentFocus(true);
|
|
36
|
-
}
|
|
37
32
|
};
|
|
38
33
|
|
|
39
34
|
/**
|
|
@@ -50,25 +45,5 @@ const setEditorCanvasContainerView = view => ({
|
|
|
50
45
|
view
|
|
51
46
|
});
|
|
52
47
|
};
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Sets the type of page content focus. Can be one of:
|
|
56
|
-
*
|
|
57
|
-
* - `'disableTemplate'`: Disable the blocks belonging to the page's template.
|
|
58
|
-
* - `'hideTemplate'`: Hide the blocks belonging to the page's template.
|
|
59
|
-
*
|
|
60
|
-
* @param {'disableTemplate'|'hideTemplate'} pageContentFocusType The type of page content focus.
|
|
61
|
-
*
|
|
62
|
-
* @return {Object} Action object.
|
|
63
|
-
*/
|
|
64
48
|
exports.setEditorCanvasContainerView = setEditorCanvasContainerView;
|
|
65
|
-
const setPageContentFocusType = pageContentFocusType => ({
|
|
66
|
-
dispatch
|
|
67
|
-
}) => {
|
|
68
|
-
dispatch({
|
|
69
|
-
type: 'SET_PAGE_CONTENT_FOCUS_TYPE',
|
|
70
|
-
pageContentFocusType
|
|
71
|
-
});
|
|
72
|
-
};
|
|
73
|
-
exports.setPageContentFocusType = setPageContentFocusType;
|
|
74
49
|
//# sourceMappingURL=private-actions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_blockEditor","require","_preferences","setCanvasMode","mode","registry","dispatch","
|
|
1
|
+
{"version":3,"names":["_blockEditor","require","_preferences","setCanvasMode","mode","registry","dispatch","blockEditorStore","__unstableSetEditorMode","type","select","preferencesStore","get","setIsListViewOpened","exports","setEditorCanvasContainerView","view"],"sources":["@wordpress/edit-site/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Action that switches the canvas mode.\n *\n * @param {?string} mode Canvas mode.\n */\nexport const setCanvasMode =\n\t( mode ) =>\n\t( { registry, dispatch } ) => {\n\t\tregistry.dispatch( blockEditorStore ).__unstableSetEditorMode( 'edit' );\n\t\tdispatch( {\n\t\t\ttype: 'SET_CANVAS_MODE',\n\t\t\tmode,\n\t\t} );\n\t\t// Check if the block list view should be open by default.\n\t\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t\tif (\n\t\t\tmode === 'edit' &&\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-site', 'showListViewByDefault' ) &&\n\t\t\t! registry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core/edit-site', 'distractionFree' )\n\t\t) {\n\t\t\tdispatch.setIsListViewOpened( true );\n\t\t}\n\t};\n\n/**\n * Action that switches the editor canvas container view.\n *\n * @param {?string} view Editor canvas container view.\n */\nexport const setEditorCanvasContainerView =\n\t( view ) =>\n\t( { dispatch } ) => {\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITOR_CANVAS_CONTAINER_VIEW',\n\t\t\tview,\n\t\t} );\n\t};\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAJA;AACA;AACA;;AAIA;AACA;AACA;AACA;AACA;AACO,MAAME,aAAa,GACvBC,IAAI,IACN,CAAE;EAAEC,QAAQ;EAAEC;AAAS,CAAC,KAAM;EAC7BD,QAAQ,CAACC,QAAQ,CAAEC,kBAAiB,CAAC,CAACC,uBAAuB,CAAE,MAAO,CAAC;EACvEF,QAAQ,CAAE;IACTG,IAAI,EAAE,iBAAiB;IACvBL;EACD,CAAE,CAAC;EACH;EACA;EACA,IACCA,IAAI,KAAK,MAAM,IACfC,QAAQ,CACNK,MAAM,CAAEC,kBAAiB,CAAC,CAC1BC,GAAG,CAAE,gBAAgB,EAAE,uBAAwB,CAAC,IAClD,CAAEP,QAAQ,CACRK,MAAM,CAAEC,kBAAiB,CAAC,CAC1BC,GAAG,CAAE,gBAAgB,EAAE,iBAAkB,CAAC,EAC3C;IACDN,QAAQ,CAACO,mBAAmB,CAAE,IAAK,CAAC;EACrC;AACD,CAAC;;AAEF;AACA;AACA;AACA;AACA;AAJAC,OAAA,CAAAX,aAAA,GAAAA,aAAA;AAKO,MAAMY,4BAA4B,GACtCC,IAAI,IACN,CAAE;EAAEV;AAAS,CAAC,KAAM;EACnBA,QAAQ,CAAE;IACTG,IAAI,EAAE,kCAAkC;IACxCO;EACD,CAAE,CAAC;AACJ,CAAC;AAACF,OAAA,CAAAC,4BAAA,GAAAA,4BAAA"}
|
|
@@ -5,12 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getCanvasMode = getCanvasMode;
|
|
7
7
|
exports.getEditorCanvasContainerView = getEditorCanvasContainerView;
|
|
8
|
-
exports.getPageContentFocusType = getPageContentFocusType;
|
|
9
|
-
var _selectors = require("./selectors");
|
|
10
|
-
/**
|
|
11
|
-
* Internal dependencies
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
8
|
/**
|
|
15
9
|
* Returns the current canvas mode.
|
|
16
10
|
*
|
|
@@ -32,21 +26,4 @@ function getCanvasMode(state) {
|
|
|
32
26
|
function getEditorCanvasContainerView(state) {
|
|
33
27
|
return state.editorCanvasContainerView;
|
|
34
28
|
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Returns the type of the current page content focus, or null if there is no
|
|
38
|
-
* page content focus.
|
|
39
|
-
*
|
|
40
|
-
* Possible values are:
|
|
41
|
-
*
|
|
42
|
-
* - `'disableTemplate'`: Disable the blocks belonging to the page's template.
|
|
43
|
-
* - `'hideTemplate'`: Hide the blocks belonging to the page's template.
|
|
44
|
-
*
|
|
45
|
-
* @param {Object} state Global application state.
|
|
46
|
-
*
|
|
47
|
-
* @return {'disableTemplate'|'hideTemplate'|null} Type of the current page content focus.
|
|
48
|
-
*/
|
|
49
|
-
function getPageContentFocusType(state) {
|
|
50
|
-
return (0, _selectors.hasPageContentFocus)(state) ? state.pageContentFocusType : null;
|
|
51
|
-
}
|
|
52
29
|
//# sourceMappingURL=private-selectors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["getCanvasMode","state","canvasMode","getEditorCanvasContainerView","editorCanvasContainerView"],"sources":["@wordpress/edit-site/src/store/private-selectors.js"],"sourcesContent":["/**\n * Returns the current canvas mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Canvas mode.\n */\nexport function getCanvasMode( state ) {\n\treturn state.canvasMode;\n}\n\n/**\n * Returns the editor canvas container view.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editor canvas container view.\n */\nexport function getEditorCanvasContainerView( state ) {\n\treturn state.editorCanvasContainerView;\n}\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,aAAaA,CAAEC,KAAK,EAAG;EACtC,OAAOA,KAAK,CAACC,UAAU;AACxB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,4BAA4BA,CAAEF,KAAK,EAAG;EACrD,OAAOA,KAAK,CAACG,yBAAyB;AACvC"}
|
package/build/store/reducer.js
CHANGED
|
@@ -7,9 +7,7 @@ exports.blockInserterPanel = blockInserterPanel;
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
exports.deviceType = deviceType;
|
|
9
9
|
exports.editedPost = editedPost;
|
|
10
|
-
exports.hasPageContentFocus = hasPageContentFocus;
|
|
11
10
|
exports.listViewPanel = listViewPanel;
|
|
12
|
-
exports.pageContentFocusType = pageContentFocusType;
|
|
13
11
|
exports.saveViewPanel = saveViewPanel;
|
|
14
12
|
exports.settings = settings;
|
|
15
13
|
var _data = require("@wordpress/data");
|
|
@@ -165,41 +163,6 @@ function editorCanvasContainerView(state = undefined, action) {
|
|
|
165
163
|
}
|
|
166
164
|
return state;
|
|
167
165
|
}
|
|
168
|
-
|
|
169
|
-
/**
|
|
170
|
-
* Reducer used to track whether the editor allows only page content to be
|
|
171
|
-
* edited.
|
|
172
|
-
*
|
|
173
|
-
* @param {boolean} state Current state.
|
|
174
|
-
* @param {Object} action Dispatched action.
|
|
175
|
-
*
|
|
176
|
-
* @return {boolean} Updated state.
|
|
177
|
-
*/
|
|
178
|
-
function hasPageContentFocus(state = false, action) {
|
|
179
|
-
switch (action.type) {
|
|
180
|
-
case 'SET_EDITED_POST':
|
|
181
|
-
return !!action.context?.postId;
|
|
182
|
-
case 'SET_HAS_PAGE_CONTENT_FOCUS':
|
|
183
|
-
return action.hasPageContentFocus;
|
|
184
|
-
}
|
|
185
|
-
return state;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Reducer used to track the type of page content focus.
|
|
190
|
-
*
|
|
191
|
-
* @param {string} state Current state.
|
|
192
|
-
* @param {Object} action Dispatched action.
|
|
193
|
-
*
|
|
194
|
-
* @return {string} Updated state.
|
|
195
|
-
*/
|
|
196
|
-
function pageContentFocusType(state = 'disableTemplate', action) {
|
|
197
|
-
switch (action.type) {
|
|
198
|
-
case 'SET_PAGE_CONTENT_FOCUS_TYPE':
|
|
199
|
-
return action.pageContentFocusType;
|
|
200
|
-
}
|
|
201
|
-
return state;
|
|
202
|
-
}
|
|
203
166
|
var _default = (0, _data.combineReducers)({
|
|
204
167
|
deviceType,
|
|
205
168
|
settings,
|
|
@@ -208,9 +171,7 @@ var _default = (0, _data.combineReducers)({
|
|
|
208
171
|
listViewPanel,
|
|
209
172
|
saveViewPanel,
|
|
210
173
|
canvasMode,
|
|
211
|
-
editorCanvasContainerView
|
|
212
|
-
hasPageContentFocus,
|
|
213
|
-
pageContentFocusType
|
|
174
|
+
editorCanvasContainerView
|
|
214
175
|
});
|
|
215
176
|
exports.default = _default;
|
|
216
177
|
//# sourceMappingURL=reducer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","deviceType","state","action","type","settings","editedPost","postType","id","context","blockInserterPanel","isOpen","value","listViewPanel","saveViewPanel","canvasMode","mode","editorCanvasContainerView","undefined","view","
|
|
1
|
+
{"version":3,"names":["_data","require","deviceType","state","action","type","settings","editedPost","postType","id","context","blockInserterPanel","isOpen","value","listViewPanel","saveViewPanel","canvasMode","mode","editorCanvasContainerView","undefined","view","_default","combineReducers","exports","default"],"sources":["@wordpress/edit-site/src/store/reducer.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer returning the editing canvas device type.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function deviceType( state = 'Desktop', action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_PREVIEW_DEVICE_TYPE':\n\t\t\treturn action.deviceType;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer returning the settings.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function settings( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'UPDATE_SETTINGS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t...action.settings,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer keeping track of the currently edited Post Type,\n * Post Id and the context provided to fill the content of the block editor.\n *\n * @param {Object} state Current edited post.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport function editedPost( state = {}, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_EDITED_POST':\n\t\t\treturn {\n\t\t\t\tpostType: action.postType,\n\t\t\t\tid: action.id,\n\t\t\t\tcontext: action.context,\n\t\t\t};\n\t\tcase 'SET_EDITED_POST_CONTEXT':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tcontext: action.context,\n\t\t\t};\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer to set the block inserter panel open or closed.\n *\n * Note: this reducer interacts with the navigation and list view panels reducers\n * to make sure that only one of the three panels is open at the same time.\n *\n * @param {boolean|Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function blockInserterPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen ? false : state;\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the list view panel open or closed.\n *\n * Note: this reducer interacts with the navigation and inserter panels reducers\n * to make sure that only one of the three panels is open at the same time.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function listViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_INSERTER_OPENED':\n\t\t\treturn action.value ? false : state;\n\t\tcase 'SET_IS_LIST_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer to set the save view panel open or closed.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nexport function saveViewPanel( state = false, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_IS_SAVE_VIEW_OPENED':\n\t\t\treturn action.isOpen;\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn false;\n\t}\n\treturn state;\n}\n\n/**\n * Reducer used to track the site editor canvas mode (edit or view).\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n */\nfunction canvasMode( state = 'init', action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_CANVAS_MODE':\n\t\t\treturn action.mode;\n\t}\n\n\treturn state;\n}\n\n/**\n * Reducer used to track the site editor canvas container view.\n * Default is `undefined`, denoting the default, visual block editor.\n * This could be, for example, `'style-book'` (the style book).\n *\n * @param {string|undefined} state Current state.\n * @param {Object} action Dispatched action.\n */\nfunction editorCanvasContainerView( state = undefined, action ) {\n\tswitch ( action.type ) {\n\t\tcase 'SET_EDITOR_CANVAS_CONTAINER_VIEW':\n\t\t\treturn action.view;\n\t}\n\n\treturn state;\n}\n\nexport default combineReducers( {\n\tdeviceType,\n\tsettings,\n\teditedPost,\n\tblockInserterPanel,\n\tlistViewPanel,\n\tsaveViewPanel,\n\tcanvasMode,\n\teditorCanvasContainerView,\n} );\n"],"mappings":";;;;;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAAEC,KAAK,GAAG,SAAS,EAAEC,MAAM,EAAG;EACvD,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,yBAAyB;MAC7B,OAAOD,MAAM,CAACF,UAAU;EAC1B;EAEA,OAAOC,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,QAAQA,CAAEH,KAAK,GAAG,CAAC,CAAC,EAAEC,MAAM,EAAG;EAC9C,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,iBAAiB;MACrB,OAAO;QACN,GAAGF,KAAK;QACR,GAAGC,MAAM,CAACE;MACX,CAAC;EACH;EAEA,OAAOH,KAAK;AACb;;AAE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,yBAAyB;MAC7B,OAAOD,MAAM,CAACQ,MAAM;IACrB,KAAK,iBAAiB;MACrB,OAAO,KAAK;EACd;EACA,OAAOT,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAASa,UAAUA,CAAEb,KAAK,GAAG,MAAM,EAAEC,MAAM,EAAG;EAC7C,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,iBAAiB;MACrB,OAAOD,MAAM,CAACa,IAAI;EACpB;EAEA,OAAOd,KAAK;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASe,yBAAyBA,CAAEf,KAAK,GAAGgB,SAAS,EAAEf,MAAM,EAAG;EAC/D,QAASA,MAAM,CAACC,IAAI;IACnB,KAAK,kCAAkC;MACtC,OAAOD,MAAM,CAACgB,IAAI;EACpB;EAEA,OAAOjB,KAAK;AACb;AAAC,IAAAkB,QAAA,GAEc,IAAAC,qBAAe,EAAE;EAC/BpB,UAAU;EACVI,QAAQ;EACRC,UAAU;EACVI,kBAAkB;EAClBG,aAAa;EACbC,aAAa;EACbC,UAAU;EACVE;AACD,CAAE,CAAC;AAAAK,OAAA,CAAAC,OAAA,GAAAH,QAAA"}
|
package/build/store/selectors.js
CHANGED
|
@@ -6,38 +6,34 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.__experimentalGetInsertionPoint = void 0;
|
|
8
8
|
exports.__experimentalGetPreviewDeviceType = __experimentalGetPreviewDeviceType;
|
|
9
|
-
exports.getCanUserCreateMedia =
|
|
9
|
+
exports.getCanUserCreateMedia = void 0;
|
|
10
10
|
exports.getCurrentTemplateNavigationPanelSubMenu = getCurrentTemplateNavigationPanelSubMenu;
|
|
11
11
|
exports.getCurrentTemplateTemplateParts = void 0;
|
|
12
12
|
exports.getEditedPostContext = getEditedPostContext;
|
|
13
13
|
exports.getEditedPostId = getEditedPostId;
|
|
14
14
|
exports.getEditedPostType = getEditedPostType;
|
|
15
|
-
exports.getEditorMode =
|
|
15
|
+
exports.getEditorMode = void 0;
|
|
16
16
|
exports.getHomeTemplateId = getHomeTemplateId;
|
|
17
17
|
exports.getNavigationPanelActiveMenu = getNavigationPanelActiveMenu;
|
|
18
18
|
exports.getPage = getPage;
|
|
19
|
-
exports.
|
|
19
|
+
exports.getReusableBlocks = void 0;
|
|
20
|
+
exports.getSettings = getSettings;
|
|
20
21
|
exports.hasPageContentFocus = hasPageContentFocus;
|
|
21
|
-
exports.isFeatureActive =
|
|
22
|
+
exports.isFeatureActive = void 0;
|
|
22
23
|
exports.isInserterOpened = isInserterOpened;
|
|
23
24
|
exports.isListViewOpened = isListViewOpened;
|
|
24
25
|
exports.isNavigationOpened = isNavigationOpened;
|
|
25
26
|
exports.isPage = isPage;
|
|
26
27
|
exports.isSaveViewOpened = isSaveViewOpened;
|
|
27
|
-
var _rememo = _interopRequireDefault(require("rememo"));
|
|
28
28
|
var _coreData = require("@wordpress/core-data");
|
|
29
29
|
var _data = require("@wordpress/data");
|
|
30
30
|
var _deprecated = _interopRequireDefault(require("@wordpress/deprecated"));
|
|
31
|
-
var _mediaUtils = require("@wordpress/media-utils");
|
|
32
31
|
var _element = require("@wordpress/element");
|
|
33
32
|
var _preferences = require("@wordpress/preferences");
|
|
34
33
|
var _blockEditor = require("@wordpress/block-editor");
|
|
34
|
+
var _editor = require("@wordpress/editor");
|
|
35
35
|
var _utils = require("./utils");
|
|
36
36
|
var _constants = require("../utils/constants");
|
|
37
|
-
/**
|
|
38
|
-
* External dependencies
|
|
39
|
-
*/
|
|
40
|
-
|
|
41
37
|
/**
|
|
42
38
|
* WordPress dependencies
|
|
43
39
|
*/
|
|
@@ -50,17 +46,6 @@ var _constants = require("../utils/constants");
|
|
|
50
46
|
* @typedef {'template'|'template_type'} TemplateType Template type.
|
|
51
47
|
*/
|
|
52
48
|
|
|
53
|
-
/**
|
|
54
|
-
* Helper for getting a preference from the preferences store.
|
|
55
|
-
*
|
|
56
|
-
* This is only present so that `getSettings` doesn't need to be made a
|
|
57
|
-
* registry selector.
|
|
58
|
-
*
|
|
59
|
-
* It's unstable because the selector needs to be exported and so part of the
|
|
60
|
-
* public API to work.
|
|
61
|
-
*/
|
|
62
|
-
const __unstableGetPreference = (0, _data.createRegistrySelector)(select => (state, name) => select(_preferences.store).get('core/edit-site', name));
|
|
63
|
-
|
|
64
49
|
/**
|
|
65
50
|
* Returns whether the given feature is enabled or not.
|
|
66
51
|
*
|
|
@@ -70,14 +55,13 @@ const __unstableGetPreference = (0, _data.createRegistrySelector)(select => (sta
|
|
|
70
55
|
*
|
|
71
56
|
* @return {boolean} Is active.
|
|
72
57
|
*/
|
|
73
|
-
|
|
74
|
-
function isFeatureActive(state, featureName) {
|
|
58
|
+
const isFeatureActive = (0, _data.createRegistrySelector)(select => (_, featureName) => {
|
|
75
59
|
(0, _deprecated.default)(`select( 'core/edit-site' ).isFeatureActive`, {
|
|
76
60
|
since: '6.0',
|
|
77
61
|
alternative: `select( 'core/preferences' ).get`
|
|
78
62
|
});
|
|
79
|
-
return !!
|
|
80
|
-
}
|
|
63
|
+
return !!select(_preferences.store).get('core/edit-site', featureName);
|
|
64
|
+
});
|
|
81
65
|
|
|
82
66
|
/**
|
|
83
67
|
* Returns the current editing canvas device type.
|
|
@@ -86,6 +70,7 @@ function isFeatureActive(state, featureName) {
|
|
|
86
70
|
*
|
|
87
71
|
* @return {string} Device type.
|
|
88
72
|
*/
|
|
73
|
+
exports.isFeatureActive = isFeatureActive;
|
|
89
74
|
function __experimentalGetPreviewDeviceType(state) {
|
|
90
75
|
return state.deviceType;
|
|
91
76
|
}
|
|
@@ -108,6 +93,10 @@ const getCanUserCreateMedia = (0, _data.createRegistrySelector)(select => () =>
|
|
|
108
93
|
*/
|
|
109
94
|
exports.getCanUserCreateMedia = getCanUserCreateMedia;
|
|
110
95
|
const getReusableBlocks = (0, _data.createRegistrySelector)(select => () => {
|
|
96
|
+
(0, _deprecated.default)("select( 'core/core' ).getEntityRecords( 'postType', 'wp_block' )", {
|
|
97
|
+
since: '6.5',
|
|
98
|
+
version: '6.8'
|
|
99
|
+
});
|
|
111
100
|
const isWeb = _element.Platform.OS === 'web';
|
|
112
101
|
return isWeb ? select(_coreData.store).getEntityRecords('postType', 'wp_block', {
|
|
113
102
|
per_page: -1
|
|
@@ -115,50 +104,23 @@ const getReusableBlocks = (0, _data.createRegistrySelector)(select => () => {
|
|
|
115
104
|
});
|
|
116
105
|
|
|
117
106
|
/**
|
|
118
|
-
* Returns the
|
|
107
|
+
* Returns the site editor settings.
|
|
119
108
|
*
|
|
120
|
-
* @param {Object}
|
|
121
|
-
* @param {Function} setIsInserterOpen Setter for the open state of the global inserter.
|
|
109
|
+
* @param {Object} state Global application state.
|
|
122
110
|
*
|
|
123
111
|
* @return {Object} Settings.
|
|
124
112
|
*/
|
|
125
113
|
exports.getReusableBlocks = getReusableBlocks;
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
hasFixedToolbar: !!__unstableGetPreference(state, 'fixedToolbar'),
|
|
133
|
-
keepCaretInsideBlock: !!__unstableGetPreference(state, 'keepCaretInsideBlock'),
|
|
134
|
-
showIconLabels: !!__unstableGetPreference(state, 'showIconLabels'),
|
|
135
|
-
__experimentalSetIsInserterOpened: setIsInserterOpen,
|
|
136
|
-
__experimentalReusableBlocks: getReusableBlocks(state),
|
|
137
|
-
__experimentalPreferPatternsOnRoot: _constants.TEMPLATE_POST_TYPE === getEditedPostType(state)
|
|
138
|
-
};
|
|
139
|
-
const canUserCreateMedia = getCanUserCreateMedia(state);
|
|
140
|
-
if (!canUserCreateMedia) {
|
|
141
|
-
return settings;
|
|
142
|
-
}
|
|
143
|
-
settings.mediaUpload = ({
|
|
144
|
-
onError,
|
|
145
|
-
...rest
|
|
146
|
-
}) => {
|
|
147
|
-
(0, _mediaUtils.uploadMedia)({
|
|
148
|
-
wpAllowedMimeTypes: state.settings.allowedMimeTypes,
|
|
149
|
-
onError: ({
|
|
150
|
-
message
|
|
151
|
-
}) => onError(message),
|
|
152
|
-
...rest
|
|
153
|
-
});
|
|
154
|
-
};
|
|
155
|
-
return settings;
|
|
156
|
-
}, state => [getCanUserCreateMedia(state), state.settings, __unstableGetPreference(state, 'focusMode'), __unstableGetPreference(state, 'distractionFree'), __unstableGetPreference(state, 'fixedToolbar'), __unstableGetPreference(state, 'keepCaretInsideBlock'), __unstableGetPreference(state, 'showIconLabels'), getReusableBlocks(state), getEditedPostType(state)]);
|
|
114
|
+
function getSettings(state) {
|
|
115
|
+
// It is important that we don't inject anything into these settings locally.
|
|
116
|
+
// The reason for this is that we have an effect in place that calls setSettings based on the previous value of getSettings.
|
|
117
|
+
// If we add computed settings here, we'll be adding these computed settings to the state which is very unexpected.
|
|
118
|
+
return state.settings;
|
|
119
|
+
}
|
|
157
120
|
|
|
158
121
|
/**
|
|
159
122
|
* @deprecated
|
|
160
123
|
*/
|
|
161
|
-
exports.getSettings = getSettings;
|
|
162
124
|
function getHomeTemplateId() {
|
|
163
125
|
(0, _deprecated.default)("select( 'core/edit-site' ).getHomeTemplateId", {
|
|
164
126
|
since: '6.2',
|
|
@@ -245,7 +207,7 @@ const __experimentalGetInsertionPoint = (0, _data.createRegistrySelector)(select
|
|
|
245
207
|
filterValue
|
|
246
208
|
};
|
|
247
209
|
}
|
|
248
|
-
if (
|
|
210
|
+
if (isPage(state) && select(_editor.store).getRenderingMode() !== 'template-only') {
|
|
249
211
|
const [postContentClientId] = select(_blockEditor.store).__experimentalGetGlobalBlocksByName('core/post-content');
|
|
250
212
|
if (postContentClientId) {
|
|
251
213
|
return {
|
|
@@ -308,13 +270,14 @@ const getCurrentTemplateTemplateParts = (0, _data.createRegistrySelector)(select
|
|
|
308
270
|
* @return {string} Editing mode.
|
|
309
271
|
*/
|
|
310
272
|
exports.getCurrentTemplateTemplateParts = getCurrentTemplateTemplateParts;
|
|
311
|
-
|
|
312
|
-
return
|
|
313
|
-
}
|
|
273
|
+
const getEditorMode = (0, _data.createRegistrySelector)(select => () => {
|
|
274
|
+
return select(_preferences.store).get('core/edit-site', 'editorMode');
|
|
275
|
+
});
|
|
314
276
|
|
|
315
277
|
/**
|
|
316
278
|
* @deprecated
|
|
317
279
|
*/
|
|
280
|
+
exports.getEditorMode = getEditorMode;
|
|
318
281
|
function getCurrentTemplateNavigationPanelSubMenu() {
|
|
319
282
|
(0, _deprecated.default)("dispatch( 'core/edit-site' ).getCurrentTemplateNavigationPanelSubMenu", {
|
|
320
283
|
since: '6.2',
|
|
@@ -358,11 +321,14 @@ function isPage(state) {
|
|
|
358
321
|
/**
|
|
359
322
|
* Whether or not the editor allows only page content to be edited.
|
|
360
323
|
*
|
|
361
|
-
* @
|
|
324
|
+
* @deprecated
|
|
362
325
|
*
|
|
363
326
|
* @return {boolean} Whether or not focus is on editing page content.
|
|
364
327
|
*/
|
|
365
|
-
function hasPageContentFocus(
|
|
366
|
-
|
|
328
|
+
function hasPageContentFocus() {
|
|
329
|
+
(0, _deprecated.default)(`select( 'core/edit-site' ).hasPageContentFocus`, {
|
|
330
|
+
since: '6.5'
|
|
331
|
+
});
|
|
332
|
+
return false;
|
|
367
333
|
}
|
|
368
334
|
//# sourceMappingURL=selectors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_rememo","_interopRequireDefault","require","_coreData","_data","_deprecated","_mediaUtils","_element","_preferences","_blockEditor","_utils","_constants","__unstableGetPreference","createRegistrySelector","select","state","name","preferencesStore","get","exports","isFeatureActive","featureName","deprecated","since","alternative","__experimentalGetPreviewDeviceType","deviceType","getCanUserCreateMedia","coreDataStore","canUser","getReusableBlocks","isWeb","Platform","OS","getEntityRecords","per_page","getSettings","createSelector","setIsInserterOpen","settings","outlineMode","focusMode","isDistractionFree","hasFixedToolbar","keepCaretInsideBlock","showIconLabels","__experimentalSetIsInserterOpened","__experimentalReusableBlocks","__experimentalPreferPatternsOnRoot","TEMPLATE_POST_TYPE","getEditedPostType","canUserCreateMedia","mediaUpload","onError","rest","uploadMedia","wpAllowedMimeTypes","allowedMimeTypes","message","getHomeTemplateId","version","editedPost","postType","getEditedPostId","id","getEditedPostContext","context","getPage","isInserterOpened","blockInserterPanel","__experimentalGetInsertionPoint","rootClientId","insertionIndex","filterValue","hasPageContentFocus","postContentClientId","blockEditorStore","__experimentalGetGlobalBlocksByName","undefined","isListViewOpened","listViewPanel","isSaveViewOpened","saveViewPanel","getCurrentTemplateTemplateParts","templateParts","TEMPLATE_PART_POST_TYPE","clientIds","blocks","getBlocksByClientId","getFilteredTemplatePartBlocks","getEditorMode","getCurrentTemplateNavigationPanelSubMenu","getNavigationPanelActiveMenu","isNavigationOpened","isPage","postId"],"sources":["@wordpress/edit-site/src/store/selectors.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport createSelector from 'rememo';\n\n/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { createRegistrySelector } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { uploadMedia } from '@wordpress/media-utils';\nimport { Platform } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { getFilteredTemplatePartBlocks } from './utils';\nimport {\n\tTEMPLATE_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n} from '../utils/constants';\n/**\n * @typedef {'template'|'template_type'} TemplateType Template type.\n */\n\n/**\n * Helper for getting a preference from the preferences store.\n *\n * This is only present so that `getSettings` doesn't need to be made a\n * registry selector.\n *\n * It's unstable because the selector needs to be exported and so part of the\n * public API to work.\n */\nexport const __unstableGetPreference = createRegistrySelector(\n\t( select ) => ( state, name ) =>\n\t\tselect( preferencesStore ).get( 'core/edit-site', name )\n);\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @deprecated\n * @param {Object} state Global application state.\n * @param {string} featureName Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport function isFeatureActive( state, featureName ) {\n\tdeprecated( `select( 'core/edit-site' ).isFeatureActive`, {\n\t\tsince: '6.0',\n\t\talternative: `select( 'core/preferences' ).get`,\n\t} );\n\n\treturn !! __unstableGetPreference( state, featureName );\n}\n\n/**\n * Returns the current editing canvas device type.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport function __experimentalGetPreviewDeviceType( state ) {\n\treturn state.deviceType;\n}\n\n/**\n * Returns whether the current user can create media or not.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Whether the current user can create media or not.\n */\nexport const getCanUserCreateMedia = createRegistrySelector(\n\t( select ) => () => select( coreDataStore ).canUser( 'create', 'media' )\n);\n\n/**\n * Returns any available Reusable blocks.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} The available reusable blocks.\n */\nexport const getReusableBlocks = createRegistrySelector( ( select ) => () => {\n\tconst isWeb = Platform.OS === 'web';\n\treturn isWeb\n\t\t? select( coreDataStore ).getEntityRecords( 'postType', 'wp_block', {\n\t\t\t\tper_page: -1,\n\t\t } )\n\t\t: [];\n} );\n\n/**\n * Returns the settings, taking into account active features and permissions.\n *\n * @param {Object} state Global application state.\n * @param {Function} setIsInserterOpen Setter for the open state of the global inserter.\n *\n * @return {Object} Settings.\n */\nexport const getSettings = createSelector(\n\t( state, setIsInserterOpen ) => {\n\t\tconst settings = {\n\t\t\t...state.settings,\n\t\t\toutlineMode: true,\n\t\t\tfocusMode: !! __unstableGetPreference( state, 'focusMode' ),\n\t\t\tisDistractionFree: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'distractionFree'\n\t\t\t),\n\t\t\thasFixedToolbar: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'fixedToolbar'\n\t\t\t),\n\t\t\tkeepCaretInsideBlock: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'keepCaretInsideBlock'\n\t\t\t),\n\t\t\tshowIconLabels: !! __unstableGetPreference(\n\t\t\t\tstate,\n\t\t\t\t'showIconLabels'\n\t\t\t),\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpen,\n\t\t\t__experimentalReusableBlocks: getReusableBlocks( state ),\n\t\t\t__experimentalPreferPatternsOnRoot:\n\t\t\t\tTEMPLATE_POST_TYPE === getEditedPostType( state ),\n\t\t};\n\n\t\tconst canUserCreateMedia = getCanUserCreateMedia( state );\n\t\tif ( ! canUserCreateMedia ) {\n\t\t\treturn settings;\n\t\t}\n\n\t\tsettings.mediaUpload = ( { onError, ...rest } ) => {\n\t\t\tuploadMedia( {\n\t\t\t\twpAllowedMimeTypes: state.settings.allowedMimeTypes,\n\t\t\t\tonError: ( { message } ) => onError( message ),\n\t\t\t\t...rest,\n\t\t\t} );\n\t\t};\n\t\treturn settings;\n\t},\n\t( state ) => [\n\t\tgetCanUserCreateMedia( state ),\n\t\tstate.settings,\n\t\t__unstableGetPreference( state, 'focusMode' ),\n\t\t__unstableGetPreference( state, 'distractionFree' ),\n\t\t__unstableGetPreference( state, 'fixedToolbar' ),\n\t\t__unstableGetPreference( state, 'keepCaretInsideBlock' ),\n\t\t__unstableGetPreference( state, 'showIconLabels' ),\n\t\tgetReusableBlocks( state ),\n\t\tgetEditedPostType( state ),\n\t]\n);\n\n/**\n * @deprecated\n */\nexport function getHomeTemplateId() {\n\tdeprecated( \"select( 'core/edit-site' ).getHomeTemplateId\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * Returns the current edited post type (wp_template or wp_template_part).\n *\n * @param {Object} state Global application state.\n *\n * @return {TemplateType?} Template type.\n */\nexport function getEditedPostType( state ) {\n\treturn state.editedPost.postType;\n}\n\n/**\n * Returns the ID of the currently edited template or template part.\n *\n * @param {Object} state Global application state.\n *\n * @return {string?} Post ID.\n */\nexport function getEditedPostId( state ) {\n\treturn state.editedPost.id;\n}\n\n/**\n * Returns the edited post's context object.\n *\n * @deprecated\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getEditedPostContext( state ) {\n\treturn state.editedPost.context;\n}\n\n/**\n * Returns the current page object.\n *\n * @deprecated\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getPage( state ) {\n\treturn { context: state.editedPost.context };\n}\n\n/**\n * Returns the current opened/closed state of the inserter panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the inserter panel should be open; false if closed.\n */\nexport function isInserterOpened( state ) {\n\treturn !! state.blockInserterPanel;\n}\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport const __experimentalGetInsertionPoint = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tif ( typeof state.blockInserterPanel === 'object' ) {\n\t\t\tconst { rootClientId, insertionIndex, filterValue } =\n\t\t\t\tstate.blockInserterPanel;\n\t\t\treturn { rootClientId, insertionIndex, filterValue };\n\t\t}\n\n\t\tif ( hasPageContentFocus( state ) ) {\n\t\t\tconst [ postContentClientId ] =\n\t\t\t\tselect( blockEditorStore ).__experimentalGetGlobalBlocksByName(\n\t\t\t\t\t'core/post-content'\n\t\t\t\t);\n\t\t\tif ( postContentClientId ) {\n\t\t\t\treturn {\n\t\t\t\t\trootClientId: postContentClientId,\n\t\t\t\t\tinsertionIndex: undefined,\n\t\t\t\t\tfilterValue: undefined,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\trootClientId: undefined,\n\t\t\tinsertionIndex: undefined,\n\t\t\tfilterValue: undefined,\n\t\t};\n\t}\n);\n\n/**\n * Returns the current opened/closed state of the list view panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the list view panel should be open; false if closed.\n */\nexport function isListViewOpened( state ) {\n\treturn state.listViewPanel;\n}\n\n/**\n * Returns the current opened/closed state of the save panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the save panel should be open; false if closed.\n */\nexport function isSaveViewOpened( state ) {\n\treturn state.saveViewPanel;\n}\n\n/**\n * Returns the template parts and their blocks for the current edited template.\n *\n * @param {Object} state Global application state.\n * @return {Array} Template parts and their blocks in an array.\n */\nexport const getCurrentTemplateTemplateParts = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst templateParts = select( coreDataStore ).getEntityRecords(\n\t\t\t'postType',\n\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t{ per_page: -1 }\n\t\t);\n\n\t\tconst clientIds =\n\t\t\tselect( blockEditorStore ).__experimentalGetGlobalBlocksByName(\n\t\t\t\t'core/template-part'\n\t\t\t);\n\t\tconst blocks =\n\t\t\tselect( blockEditorStore ).getBlocksByClientId( clientIds );\n\n\t\treturn getFilteredTemplatePartBlocks( blocks, templateParts );\n\t}\n);\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport function getEditorMode( state ) {\n\treturn __unstableGetPreference( state, 'editorMode' );\n}\n\n/**\n * @deprecated\n */\nexport function getCurrentTemplateNavigationPanelSubMenu() {\n\tdeprecated(\n\t\t\"dispatch( 'core/edit-site' ).getCurrentTemplateNavigationPanelSubMenu\",\n\t\t{\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.4',\n\t\t}\n\t);\n}\n\n/**\n * @deprecated\n */\nexport function getNavigationPanelActiveMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).getNavigationPanelActiveMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * @deprecated\n */\nexport function isNavigationOpened() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).isNavigationOpened\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * Whether or not the editor has a page loaded into it.\n *\n * @see setPage\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether or not the editor has a page loaded into it.\n */\nexport function isPage( state ) {\n\treturn !! state.editedPost.context?.postId;\n}\n\n/**\n * Whether or not the editor allows only page content to be edited.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether or not focus is on editing page content.\n */\nexport function hasPageContentFocus( state ) {\n\treturn isPage( state ) ? state.hasPageContentFocus : false;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAKA,IAAAQ,MAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AApBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;;AAMA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMU,uBAAuB,GAAG,IAAAC,4BAAsB,EAC1DC,MAAM,IAAM,CAAEC,KAAK,EAAEC,IAAI,KAC1BF,MAAM,CAAEG,kBAAiB,CAAC,CAACC,GAAG,CAAE,gBAAgB,EAAEF,IAAK,CACzD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AARAG,OAAA,CAAAP,uBAAA,GAAAA,uBAAA;AASO,SAASQ,eAAeA,CAAEL,KAAK,EAAEM,WAAW,EAAG;EACrD,IAAAC,mBAAU,EAAG,4CAA2C,EAAE;IACzDC,KAAK,EAAE,KAAK;IACZC,WAAW,EAAG;EACf,CAAE,CAAC;EAEH,OAAO,CAAC,CAAEZ,uBAAuB,CAAEG,KAAK,EAAEM,WAAY,CAAC;AACxD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASI,kCAAkCA,CAAEV,KAAK,EAAG;EAC3D,OAAOA,KAAK,CAACW,UAAU;AACxB;;AAEA;AACA;AACA;AACA;A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4BAA4BA,CAAA,EAAG;EAC9C,IAAAtE,mBAAU,EAAE,2DAA2D,EAAE;IACxEC,KAAK,EAAE,KAAK;IACZqC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACO,SAASiC,kBAAkBA,CAAA,EAAG;EACpC,IAAAvE,mBAAU,EAAE,iDAAiD,EAAE;IAC9DC,KAAK,EAAE,KAAK;IACZqC,OAAO,EAAE;EACV,CAAE,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASkC,MAAMA,CAAE/E,KAAK,EAAG;EAC/B,OAAO,CAAC,CAAEA,KAAK,CAAC8C,UAAU,CAACK,OAAO,EAAE6B,MAAM;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASrB,mBAAmBA,CAAE3D,KAAK,EAAG;EAC5C,OAAO+E,MAAM,CAAE/E,KAAM,CAAC,GAAGA,KAAK,CAAC2D,mBAAmB,GAAG,KAAK;AAC3D"}
|
|
1
|
+
{"version":3,"names":["_coreData","require","_data","_deprecated","_interopRequireDefault","_element","_preferences","_blockEditor","_editor","_utils","_constants","isFeatureActive","createRegistrySelector","select","_","featureName","deprecated","since","alternative","preferencesStore","get","exports","__experimentalGetPreviewDeviceType","state","deviceType","getCanUserCreateMedia","coreDataStore","canUser","getReusableBlocks","version","isWeb","Platform","OS","getEntityRecords","per_page","getSettings","settings","getHomeTemplateId","getEditedPostType","editedPost","postType","getEditedPostId","id","getEditedPostContext","context","getPage","isInserterOpened","blockInserterPanel","__experimentalGetInsertionPoint","rootClientId","insertionIndex","filterValue","isPage","editorStore","getRenderingMode","postContentClientId","blockEditorStore","__experimentalGetGlobalBlocksByName","undefined","isListViewOpened","listViewPanel","isSaveViewOpened","saveViewPanel","getCurrentTemplateTemplateParts","templateParts","TEMPLATE_PART_POST_TYPE","clientIds","blocks","getBlocksByClientId","getFilteredTemplatePartBlocks","getEditorMode","getCurrentTemplateNavigationPanelSubMenu","getNavigationPanelActiveMenu","isNavigationOpened","postId","hasPageContentFocus"],"sources":["@wordpress/edit-site/src/store/selectors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { createRegistrySelector } from '@wordpress/data';\nimport deprecated from '@wordpress/deprecated';\nimport { Platform } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { getFilteredTemplatePartBlocks } from './utils';\nimport { TEMPLATE_PART_POST_TYPE } from '../utils/constants';\n/**\n * @typedef {'template'|'template_type'} TemplateType Template type.\n */\n\n/**\n * Returns whether the given feature is enabled or not.\n *\n * @deprecated\n * @param {Object} state Global application state.\n * @param {string} featureName Feature slug.\n *\n * @return {boolean} Is active.\n */\nexport const isFeatureActive = createRegistrySelector(\n\t( select ) => ( _, featureName ) => {\n\t\tdeprecated( `select( 'core/edit-site' ).isFeatureActive`, {\n\t\t\tsince: '6.0',\n\t\t\talternative: `select( 'core/preferences' ).get`,\n\t\t} );\n\n\t\treturn !! select( preferencesStore ).get(\n\t\t\t'core/edit-site',\n\t\t\tfeatureName\n\t\t);\n\t}\n);\n\n/**\n * Returns the current editing canvas device type.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Device type.\n */\nexport function __experimentalGetPreviewDeviceType( state ) {\n\treturn state.deviceType;\n}\n\n/**\n * Returns whether the current user can create media or not.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Whether the current user can create media or not.\n */\nexport const getCanUserCreateMedia = createRegistrySelector(\n\t( select ) => () => select( coreDataStore ).canUser( 'create', 'media' )\n);\n\n/**\n * Returns any available Reusable blocks.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} The available reusable blocks.\n */\nexport const getReusableBlocks = createRegistrySelector( ( select ) => () => {\n\tdeprecated(\n\t\t\"select( 'core/core' ).getEntityRecords( 'postType', 'wp_block' )\",\n\t\t{\n\t\t\tsince: '6.5',\n\t\t\tversion: '6.8',\n\t\t}\n\t);\n\tconst isWeb = Platform.OS === 'web';\n\treturn isWeb\n\t\t? select( coreDataStore ).getEntityRecords( 'postType', 'wp_block', {\n\t\t\t\tper_page: -1,\n\t\t } )\n\t\t: [];\n} );\n\n/**\n * Returns the site editor settings.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Settings.\n */\nexport function getSettings( state ) {\n\t// It is important that we don't inject anything into these settings locally.\n\t// The reason for this is that we have an effect in place that calls setSettings based on the previous value of getSettings.\n\t// If we add computed settings here, we'll be adding these computed settings to the state which is very unexpected.\n\treturn state.settings;\n}\n\n/**\n * @deprecated\n */\nexport function getHomeTemplateId() {\n\tdeprecated( \"select( 'core/edit-site' ).getHomeTemplateId\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * Returns the current edited post type (wp_template or wp_template_part).\n *\n * @param {Object} state Global application state.\n *\n * @return {TemplateType?} Template type.\n */\nexport function getEditedPostType( state ) {\n\treturn state.editedPost.postType;\n}\n\n/**\n * Returns the ID of the currently edited template or template part.\n *\n * @param {Object} state Global application state.\n *\n * @return {string?} Post ID.\n */\nexport function getEditedPostId( state ) {\n\treturn state.editedPost.id;\n}\n\n/**\n * Returns the edited post's context object.\n *\n * @deprecated\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getEditedPostContext( state ) {\n\treturn state.editedPost.context;\n}\n\n/**\n * Returns the current page object.\n *\n * @deprecated\n * @param {Object} state Global application state.\n *\n * @return {Object} Page.\n */\nexport function getPage( state ) {\n\treturn { context: state.editedPost.context };\n}\n\n/**\n * Returns the current opened/closed state of the inserter panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the inserter panel should be open; false if closed.\n */\nexport function isInserterOpened( state ) {\n\treturn !! state.blockInserterPanel;\n}\n\n/**\n * Get the insertion point for the inserter.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} The root client ID, index to insert at and starting filter value.\n */\nexport const __experimentalGetInsertionPoint = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tif ( typeof state.blockInserterPanel === 'object' ) {\n\t\t\tconst { rootClientId, insertionIndex, filterValue } =\n\t\t\t\tstate.blockInserterPanel;\n\t\t\treturn { rootClientId, insertionIndex, filterValue };\n\t\t}\n\n\t\tif (\n\t\t\tisPage( state ) &&\n\t\t\tselect( editorStore ).getRenderingMode() !== 'template-only'\n\t\t) {\n\t\t\tconst [ postContentClientId ] =\n\t\t\t\tselect( blockEditorStore ).__experimentalGetGlobalBlocksByName(\n\t\t\t\t\t'core/post-content'\n\t\t\t\t);\n\t\t\tif ( postContentClientId ) {\n\t\t\t\treturn {\n\t\t\t\t\trootClientId: postContentClientId,\n\t\t\t\t\tinsertionIndex: undefined,\n\t\t\t\t\tfilterValue: undefined,\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\treturn {\n\t\t\trootClientId: undefined,\n\t\t\tinsertionIndex: undefined,\n\t\t\tfilterValue: undefined,\n\t\t};\n\t}\n);\n\n/**\n * Returns the current opened/closed state of the list view panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the list view panel should be open; false if closed.\n */\nexport function isListViewOpened( state ) {\n\treturn state.listViewPanel;\n}\n\n/**\n * Returns the current opened/closed state of the save panel.\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} True if the save panel should be open; false if closed.\n */\nexport function isSaveViewOpened( state ) {\n\treturn state.saveViewPanel;\n}\n\n/**\n * Returns the template parts and their blocks for the current edited template.\n *\n * @param {Object} state Global application state.\n * @return {Array} Template parts and their blocks in an array.\n */\nexport const getCurrentTemplateTemplateParts = createRegistrySelector(\n\t( select ) => () => {\n\t\tconst templateParts = select( coreDataStore ).getEntityRecords(\n\t\t\t'postType',\n\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\t{ per_page: -1 }\n\t\t);\n\n\t\tconst clientIds =\n\t\t\tselect( blockEditorStore ).__experimentalGetGlobalBlocksByName(\n\t\t\t\t'core/template-part'\n\t\t\t);\n\t\tconst blocks =\n\t\t\tselect( blockEditorStore ).getBlocksByClientId( clientIds );\n\n\t\treturn getFilteredTemplatePartBlocks( blocks, templateParts );\n\t}\n);\n\n/**\n * Returns the current editing mode.\n *\n * @param {Object} state Global application state.\n *\n * @return {string} Editing mode.\n */\nexport const getEditorMode = createRegistrySelector( ( select ) => () => {\n\treturn select( preferencesStore ).get( 'core/edit-site', 'editorMode' );\n} );\n\n/**\n * @deprecated\n */\nexport function getCurrentTemplateNavigationPanelSubMenu() {\n\tdeprecated(\n\t\t\"dispatch( 'core/edit-site' ).getCurrentTemplateNavigationPanelSubMenu\",\n\t\t{\n\t\t\tsince: '6.2',\n\t\t\tversion: '6.4',\n\t\t}\n\t);\n}\n\n/**\n * @deprecated\n */\nexport function getNavigationPanelActiveMenu() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).getNavigationPanelActiveMenu\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * @deprecated\n */\nexport function isNavigationOpened() {\n\tdeprecated( \"dispatch( 'core/edit-site' ).isNavigationOpened\", {\n\t\tsince: '6.2',\n\t\tversion: '6.4',\n\t} );\n}\n\n/**\n * Whether or not the editor has a page loaded into it.\n *\n * @see setPage\n *\n * @param {Object} state Global application state.\n *\n * @return {boolean} Whether or not the editor has a page loaded into it.\n */\nexport function isPage( state ) {\n\treturn !! state.editedPost.context?.postId;\n}\n\n/**\n * Whether or not the editor allows only page content to be edited.\n *\n * @deprecated\n *\n * @return {boolean} Whether or not focus is on editing page content.\n */\nexport function hasPageContentFocus() {\n\tdeprecated( `select( 'core/edit-site' ).hasPageContentFocus`, {\n\t\tsince: '6.5',\n\t} );\n\n\treturn false;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAA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M;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,mBAAmBA,CAAA,EAAG;EACrC,IAAA3D,mBAAU,EAAG,gDAA+C,EAAE;IAC7DC,KAAK,EAAE;EACR,CAAE,CAAC;EAEH,OAAO,KAAK;AACb"}
|
package/build/utils/constants.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.TEMPLATE_POST_TYPE = exports.TEMPLATE_PART_POST_TYPE = exports.TEMPLATE_PART_AREA_DEFAULT_CATEGORY = exports.TEMPLATE_ORIGINS = exports.POST_TYPE_LABELS = exports.PATTERN_USER_CATEGORY = exports.PATTERN_TYPES = exports.PATTERN_SYNC_TYPES = exports.PATTERN_DEFAULT_CATEGORY = exports.
|
|
6
|
+
exports.TEMPLATE_POST_TYPE = exports.TEMPLATE_PART_POST_TYPE = exports.TEMPLATE_PART_AREA_DEFAULT_CATEGORY = exports.TEMPLATE_ORIGINS = exports.POST_TYPE_LABELS = exports.PATTERN_USER_CATEGORY = exports.PATTERN_TYPES = exports.PATTERN_SYNC_TYPES = exports.PATTERN_DEFAULT_CATEGORY = exports.NAVIGATION_POST_TYPE = exports.FOCUSABLE_ENTITIES = exports.EXCLUDED_PATTERN_SOURCES = void 0;
|
|
7
7
|
var _i18n = require("@wordpress/i18n");
|
|
8
8
|
var _patterns = require("@wordpress/patterns");
|
|
9
9
|
var _lockUnlock = require("../lock-unlock");
|
|
@@ -38,29 +38,18 @@ const {
|
|
|
38
38
|
PATTERN_TYPES,
|
|
39
39
|
PATTERN_DEFAULT_CATEGORY,
|
|
40
40
|
PATTERN_USER_CATEGORY,
|
|
41
|
-
|
|
41
|
+
EXCLUDED_PATTERN_SOURCES,
|
|
42
42
|
PATTERN_SYNC_TYPES
|
|
43
43
|
} = (0, _lockUnlock.unlock)(_patterns.privateApis);
|
|
44
44
|
|
|
45
45
|
// Entities that are editable in focus mode.
|
|
46
46
|
exports.PATTERN_SYNC_TYPES = PATTERN_SYNC_TYPES;
|
|
47
|
-
exports.
|
|
47
|
+
exports.EXCLUDED_PATTERN_SOURCES = EXCLUDED_PATTERN_SOURCES;
|
|
48
48
|
exports.PATTERN_USER_CATEGORY = PATTERN_USER_CATEGORY;
|
|
49
49
|
exports.PATTERN_DEFAULT_CATEGORY = PATTERN_DEFAULT_CATEGORY;
|
|
50
50
|
exports.PATTERN_TYPES = PATTERN_TYPES;
|
|
51
51
|
const FOCUSABLE_ENTITIES = [TEMPLATE_PART_POST_TYPE, NAVIGATION_POST_TYPE, PATTERN_TYPES.user];
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Block types that are considered to be page content. These are the only blocks
|
|
55
|
-
* editable when hasPageContentFocus() is true.
|
|
56
|
-
*/
|
|
57
52
|
exports.FOCUSABLE_ENTITIES = FOCUSABLE_ENTITIES;
|
|
58
|
-
const PAGE_CONTENT_BLOCK_TYPES = {
|
|
59
|
-
'core/post-title': true,
|
|
60
|
-
'core/post-featured-image': true,
|
|
61
|
-
'core/post-content': true
|
|
62
|
-
};
|
|
63
|
-
exports.PAGE_CONTENT_BLOCK_TYPES = PAGE_CONTENT_BLOCK_TYPES;
|
|
64
53
|
const POST_TYPE_LABELS = {
|
|
65
54
|
[TEMPLATE_POST_TYPE]: (0, _i18n.__)('Template'),
|
|
66
55
|
[TEMPLATE_PART_POST_TYPE]: (0, _i18n.__)('Template part'),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_patterns","_lockUnlock","NAVIGATION_POST_TYPE","exports","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","TEMPLATE_ORIGINS","custom","theme","plugin","TEMPLATE_PART_AREA_DEFAULT_CATEGORY","PATTERN_TYPES","PATTERN_DEFAULT_CATEGORY","PATTERN_USER_CATEGORY","
|
|
1
|
+
{"version":3,"names":["_i18n","require","_patterns","_lockUnlock","NAVIGATION_POST_TYPE","exports","TEMPLATE_POST_TYPE","TEMPLATE_PART_POST_TYPE","TEMPLATE_ORIGINS","custom","theme","plugin","TEMPLATE_PART_AREA_DEFAULT_CATEGORY","PATTERN_TYPES","PATTERN_DEFAULT_CATEGORY","PATTERN_USER_CATEGORY","EXCLUDED_PATTERN_SOURCES","PATTERN_SYNC_TYPES","unlock","patternPrivateApis","FOCUSABLE_ENTITIES","user","POST_TYPE_LABELS","__"],"sources":["@wordpress/edit-site/src/utils/constants.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { privateApis as patternPrivateApis } from '@wordpress/patterns';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\n\n// Navigation\nexport const NAVIGATION_POST_TYPE = 'wp_navigation';\n\n// Templates.\nexport const TEMPLATE_POST_TYPE = 'wp_template';\nexport const TEMPLATE_PART_POST_TYPE = 'wp_template_part';\nexport const TEMPLATE_ORIGINS = {\n\tcustom: 'custom',\n\ttheme: 'theme',\n\tplugin: 'plugin',\n};\nexport const TEMPLATE_PART_AREA_DEFAULT_CATEGORY = 'uncategorized';\n\n// Patterns.\nexport const {\n\tPATTERN_TYPES,\n\tPATTERN_DEFAULT_CATEGORY,\n\tPATTERN_USER_CATEGORY,\n\tEXCLUDED_PATTERN_SOURCES,\n\tPATTERN_SYNC_TYPES,\n} = unlock( patternPrivateApis );\n\n// Entities that are editable in focus mode.\nexport const FOCUSABLE_ENTITIES = [\n\tTEMPLATE_PART_POST_TYPE,\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_TYPES.user,\n];\n\nexport const POST_TYPE_LABELS = {\n\t[ TEMPLATE_POST_TYPE ]: __( 'Template' ),\n\t[ TEMPLATE_PART_POST_TYPE ]: __( 'Template part' ),\n\t[ PATTERN_TYPES.user ]: __( 'Pattern' ),\n\t[ NAVIGATION_POST_TYPE ]: __( 'Navigation' ),\n};\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAA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