@wordpress/edit-site 5.34.0 → 5.35.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 +9 -3
- package/build/components/add-new-template/index.js +2 -2
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/app/index.js +4 -2
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +4 -18
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/block-editor/site-editor-canvas.js +2 -2
- package/build/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build/components/dataviews-actions/index.js +46 -0
- package/build/components/dataviews-actions/index.js.map +1 -0
- package/build/components/editor/index.js +68 -12
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/background-panel.js +13 -1
- package/build/components/global-styles/background-panel.js.map +1 -1
- package/build/components/global-styles/color-indicator-wrapper.js +2 -2
- package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +5 -2
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +1 -2
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/hooks.js +5 -2
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/icon-with-current-color.js +2 -2
- package/build/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build/components/global-styles/preset-colors.js +29 -0
- package/build/components/global-styles/preset-colors.js.map +1 -0
- package/build/components/global-styles/preview-colors.js +3 -7
- package/build/components/global-styles/preview-colors.js.map +1 -1
- package/build/components/global-styles/screen-color-palette.js +5 -5
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +1 -4
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/typography-example.js +5 -2
- package/build/components/global-styles/typography-example.js.map +1 -1
- package/build/components/global-styles/ui.js +4 -1
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/variations/variation.js +12 -6
- package/build/components/global-styles/variations/variation.js.map +1 -1
- package/build/components/global-styles/variations/variations-color.js +5 -5
- package/build/components/global-styles/variations/variations-color.js.map +1 -1
- package/build/components/global-styles-sidebar/default-sidebar.js.map +1 -0
- package/build/components/{sidebar-edit-mode/global-styles-sidebar.js → global-styles-sidebar/index.js} +8 -5
- package/build/components/global-styles-sidebar/index.js.map +1 -0
- package/build/components/header-edit-mode/index.js +20 -120
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/layout/index.js +3 -6
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/router.js +69 -14
- package/build/components/layout/router.js.map +1 -1
- package/build/components/page/index.js +2 -2
- package/build/components/page/index.js.map +1 -1
- package/build/components/page-pages/index.js +4 -15
- package/build/components/page-pages/index.js.map +1 -1
- package/build/components/page-patterns/dataviews-pattern-actions.js +4 -80
- package/build/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
- package/build/components/page-patterns/index.js +9 -20
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-templates/index.js +6 -14
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/pagination/index.js +2 -2
- package/build/components/pagination/index.js.map +1 -1
- package/build/components/resizable-frame/index.js +11 -3
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/revisions/index.js +5 -2
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/save-panel/index.js +4 -4
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +61 -31
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-button/index.js +2 -2
- package/build/components/sidebar-button/index.js.map +1 -1
- package/build/components/sidebar-dataviews/dataview-item.js +2 -2
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build/components/sidebar-navigation-item/index.js +5 -3
- package/build/components/sidebar-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +6 -32
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -2
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +4 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js +10 -3
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +16 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +3 -0
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +16 -6
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +2 -9
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-page/status-label.js +2 -2
- package/build/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/index.js +4 -9
- package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +4 -14
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/index.js +4 -1
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +4 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/site-hub/index.js +3 -3
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/site-icon/index.js +2 -2
- package/build/components/site-icon/index.js.map +1 -1
- package/build/components/style-book/index.js +10 -7
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/template-part-converter/index.js +18 -1
- package/build/components/template-part-converter/index.js.map +1 -1
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +5 -2
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.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/utils/use-activate-theme.js +9 -6
- package/build/utils/use-activate-theme.js.map +1 -1
- package/build-module/components/add-new-template/index.js +2 -2
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/app/index.js +4 -2
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +4 -18
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/block-editor/site-editor-canvas.js +2 -2
- package/build-module/components/block-editor/site-editor-canvas.js.map +1 -1
- package/build-module/components/dataviews-actions/index.js +38 -0
- package/build-module/components/dataviews-actions/index.js.map +1 -0
- package/build-module/components/editor/index.js +69 -13
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/background-panel.js +12 -1
- package/build-module/components/global-styles/background-panel.js.map +1 -1
- package/build-module/components/global-styles/color-indicator-wrapper.js +2 -2
- package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +4 -2
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +1 -2
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +4 -1
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/icon-with-current-color.js +2 -2
- package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build-module/components/global-styles/preset-colors.js +22 -0
- package/build-module/components/global-styles/preset-colors.js.map +1 -0
- package/build-module/components/global-styles/preview-colors.js +3 -7
- package/build-module/components/global-styles/preview-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-color-palette.js +5 -5
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +1 -4
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/typography-example.js +4 -1
- package/build-module/components/global-styles/typography-example.js.map +1 -1
- package/build-module/components/global-styles/ui.js +4 -1
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/variations/variation.js +11 -5
- package/build-module/components/global-styles/variations/variation.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-color.js +6 -6
- package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
- package/build-module/components/global-styles-sidebar/default-sidebar.js.map +1 -0
- package/build-module/components/{sidebar-edit-mode/global-styles-sidebar.js → global-styles-sidebar/index.js} +8 -5
- package/build-module/components/global-styles-sidebar/index.js.map +1 -0
- package/build-module/components/header-edit-mode/index.js +20 -120
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/layout/index.js +3 -6
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/router.js +69 -15
- package/build-module/components/layout/router.js.map +1 -1
- package/build-module/components/page/index.js +2 -2
- package/build-module/components/page/index.js.map +1 -1
- package/build-module/components/page-pages/index.js +4 -15
- package/build-module/components/page-pages/index.js.map +1 -1
- package/build-module/components/page-patterns/dataviews-pattern-actions.js +4 -80
- package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +1 -1
- package/build-module/components/page-patterns/index.js +10 -21
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-templates/index.js +6 -14
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/pagination/index.js +2 -2
- package/build-module/components/pagination/index.js.map +1 -1
- package/build-module/components/resizable-frame/index.js +12 -4
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/revisions/index.js +4 -1
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +4 -4
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +62 -32
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-button/index.js +2 -2
- package/build-module/components/sidebar-button/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js +2 -2
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-navigation-item/index.js +5 -3
- package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +6 -32
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -2
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +4 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +10 -3
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +16 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +3 -0
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +16 -6
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +2 -9
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-page/status-label.js +2 -2
- package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/index.js +4 -9
- package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +4 -14
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js +4 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +4 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +3 -3
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/site-icon/index.js +2 -2
- package/build-module/components/site-icon/index.js.map +1 -1
- package/build-module/components/style-book/index.js +9 -6
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/template-part-converter/index.js +18 -1
- package/build-module/components/template-part-converter/index.js.map +1 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +4 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.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-module/utils/use-activate-theme.js +9 -6
- package/build-module/utils/use-activate-theme.js.map +1 -1
- package/build-style/style-rtl.css +144 -374
- package/build-style/style.css +144 -374
- package/package.json +43 -45
- package/src/components/add-new-template/index.js +2 -2
- package/src/components/app/index.js +5 -2
- package/src/components/block-editor/editor-canvas.js +6 -26
- package/src/components/block-editor/site-editor-canvas.js +2 -2
- package/src/components/block-editor/style.scss +2 -2
- package/src/components/dataviews-actions/index.js +38 -0
- package/src/components/editor/index.js +76 -16
- package/src/components/editor/style.scss +0 -4
- package/src/components/global-styles/background-panel.js +17 -2
- package/src/components/global-styles/color-indicator-wrapper.js +2 -2
- package/src/components/global-styles/color-palette-panel.js +3 -4
- package/src/components/global-styles/gradients-palette-panel.js +1 -4
- package/src/components/global-styles/hooks.js +2 -1
- package/src/components/global-styles/icon-with-current-color.js +2 -2
- package/src/components/global-styles/preset-colors.js +18 -0
- package/src/components/global-styles/preview-colors.js +4 -7
- package/src/components/global-styles/screen-color-palette.js +4 -4
- package/src/components/global-styles/screen-colors.js +0 -2
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
- package/src/components/global-styles/stories/index.story.js +2 -1
- package/src/components/global-styles/typography-example.js +2 -1
- package/src/components/global-styles/ui.js +5 -1
- package/src/components/global-styles/variations/style.scss +15 -31
- package/src/components/global-styles/variations/variation.js +13 -10
- package/src/components/global-styles/variations/variations-color.js +5 -8
- package/src/components/{sidebar-edit-mode/global-styles-sidebar.js → global-styles-sidebar/index.js} +7 -2
- package/src/components/{sidebar-edit-mode → global-styles-sidebar}/style.scss +0 -11
- package/src/components/header-edit-mode/index.js +25 -164
- package/src/components/header-edit-mode/style.scss +1 -199
- package/src/components/layout/index.js +3 -8
- package/src/components/layout/router.js +65 -15
- package/src/components/layout/style.scss +2 -1
- package/src/components/page/index.js +2 -2
- package/src/components/page-pages/index.js +8 -38
- package/src/components/page-pages/style.scss +0 -11
- package/src/components/page-patterns/dataviews-pattern-actions.js +3 -92
- package/src/components/page-patterns/index.js +16 -35
- package/src/components/page-templates/index.js +10 -29
- package/src/components/pagination/index.js +2 -2
- package/src/components/resizable-frame/index.js +16 -4
- package/src/components/revisions/index.js +2 -1
- package/src/components/save-panel/index.js +4 -4
- package/src/components/sidebar/index.js +61 -37
- package/src/components/sidebar-button/index.js +2 -5
- package/src/components/sidebar-dataviews/dataview-item.js +4 -7
- package/src/components/sidebar-navigation-item/index.js +3 -3
- package/src/components/sidebar-navigation-screen/index.js +7 -31
- package/src/components/sidebar-navigation-screen/style.scss +11 -9
- package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -2
- package/src/components/sidebar-navigation-screen-global-styles/index.js +2 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/index.js +6 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +18 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +3 -0
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +8 -4
- package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +0 -10
- package/src/components/sidebar-navigation-screen-page/status-label.js +2 -2
- package/src/components/sidebar-navigation-screen-pattern/index.js +2 -8
- package/src/components/sidebar-navigation-screen-patterns/index.js +2 -13
- package/src/components/sidebar-navigation-screen-template/index.js +2 -1
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +2 -1
- package/src/components/site-hub/index.js +3 -3
- package/src/components/site-icon/index.js +2 -2
- package/src/components/style-book/index.js +7 -6
- package/src/components/template-part-converter/index.js +16 -3
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +2 -1
- package/src/style.scss +1 -11
- package/src/utils/get-is-list-page.js +1 -3
- package/src/utils/use-activate-theme.js +4 -4
- package/build/components/global-styles/global-styles-provider.js +0 -129
- package/build/components/global-styles/global-styles-provider.js.map +0 -1
- package/build/components/header-edit-mode/document-tools/index.js +0 -68
- package/build/components/header-edit-mode/document-tools/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/default-sidebar.js.map +0 -1
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +0 -1
- package/build/components/sidebar-edit-mode/index.js +0 -147
- package/build/components/sidebar-edit-mode/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/page-panels/index.js +0 -129
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/page-panels/page-content.js +0 -34
- package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +0 -1
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js +0 -46
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +0 -1
- package/build/components/sidebar-edit-mode/settings-header/index.js +0 -42
- package/build/components/sidebar-edit-mode/settings-header/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-panel/hooks.js +0 -86
- package/build/components/sidebar-edit-mode/template-panel/hooks.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-panel/index.js +0 -127
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +0 -1
- package/build/components/start-template-options/index.js +0 -191
- package/build/components/start-template-options/index.js.map +0 -1
- package/build/utils/math.js +0 -98
- package/build/utils/math.js.map +0 -1
- package/build-module/components/global-styles/global-styles-provider.js +0 -120
- package/build-module/components/global-styles/global-styles-provider.js.map +0 -1
- package/build-module/components/header-edit-mode/document-tools/index.js +0 -61
- package/build-module/components/header-edit-mode/document-tools/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/index.js +0 -138
- package/build-module/components/sidebar-edit-mode/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/page-panels/index.js +0 -121
- package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +0 -27
- package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +0 -39
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/settings-header/index.js +0 -35
- package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-panel/hooks.js +0 -79
- package/build-module/components/sidebar-edit-mode/template-panel/hooks.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-panel/index.js +0 -119
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +0 -1
- package/build-module/components/start-template-options/index.js +0 -184
- package/build-module/components/start-template-options/index.js.map +0 -1
- package/build-module/utils/math.js +0 -92
- package/build-module/utils/math.js.map +0 -1
- package/src/components/global-styles/global-styles-provider.js +0 -162
- package/src/components/header-edit-mode/document-tools/index.js +0 -68
- package/src/components/sidebar-edit-mode/index.js +0 -173
- package/src/components/sidebar-edit-mode/page-panels/index.js +0 -133
- package/src/components/sidebar-edit-mode/page-panels/page-content.js +0 -29
- package/src/components/sidebar-edit-mode/page-panels/page-summary.js +0 -61
- package/src/components/sidebar-edit-mode/settings-header/index.js +0 -43
- package/src/components/sidebar-edit-mode/settings-header/style.scss +0 -14
- package/src/components/sidebar-edit-mode/template-panel/hooks.js +0 -114
- package/src/components/sidebar-edit-mode/template-panel/index.js +0 -134
- package/src/components/sidebar-edit-mode/template-panel/style.scss +0 -16
- package/src/components/start-template-options/index.js +0 -231
- package/src/components/start-template-options/style.scss +0 -55
- package/src/utils/math.js +0 -93
- /package/build/components/{sidebar-edit-mode → global-styles-sidebar}/default-sidebar.js +0 -0
- /package/build-module/components/{sidebar-edit-mode → global-styles-sidebar}/default-sidebar.js +0 -0
- /package/src/components/{sidebar-edit-mode → global-styles-sidebar}/default-sidebar.js +0 -0
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.GlobalStylesProvider = GlobalStylesProvider;
|
|
8
|
-
exports.mergeBaseAndUserConfigs = mergeBaseAndUserConfigs;
|
|
9
|
-
var _react = require("react");
|
|
10
|
-
var _deepmerge = _interopRequireDefault(require("deepmerge"));
|
|
11
|
-
var _isPlainObject = require("is-plain-object");
|
|
12
|
-
var _element = require("@wordpress/element");
|
|
13
|
-
var _data = require("@wordpress/data");
|
|
14
|
-
var _coreData = require("@wordpress/core-data");
|
|
15
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
16
|
-
var _lockUnlock = require("../../lock-unlock");
|
|
17
|
-
/**
|
|
18
|
-
* External dependencies
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* WordPress dependencies
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Internal dependencies
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
const {
|
|
30
|
-
GlobalStylesContext,
|
|
31
|
-
cleanEmptyObject
|
|
32
|
-
} = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
|
|
33
|
-
function mergeBaseAndUserConfigs(base, user) {
|
|
34
|
-
return (0, _deepmerge.default)(base, user, {
|
|
35
|
-
// We only pass as arrays the presets,
|
|
36
|
-
// in which case we want the new array of values
|
|
37
|
-
// to override the old array (no merging).
|
|
38
|
-
isMergeableObject: _isPlainObject.isPlainObject
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
function useGlobalStylesUserConfig() {
|
|
42
|
-
const {
|
|
43
|
-
globalStylesId,
|
|
44
|
-
isReady,
|
|
45
|
-
settings,
|
|
46
|
-
styles
|
|
47
|
-
} = (0, _data.useSelect)(select => {
|
|
48
|
-
const {
|
|
49
|
-
getEditedEntityRecord,
|
|
50
|
-
hasFinishedResolution
|
|
51
|
-
} = select(_coreData.store);
|
|
52
|
-
const _globalStylesId = select(_coreData.store).__experimentalGetCurrentGlobalStylesId();
|
|
53
|
-
const record = _globalStylesId ? getEditedEntityRecord('root', 'globalStyles', _globalStylesId) : undefined;
|
|
54
|
-
let hasResolved = false;
|
|
55
|
-
if (hasFinishedResolution('__experimentalGetCurrentGlobalStylesId')) {
|
|
56
|
-
hasResolved = _globalStylesId ? hasFinishedResolution('getEditedEntityRecord', ['root', 'globalStyles', _globalStylesId]) : true;
|
|
57
|
-
}
|
|
58
|
-
return {
|
|
59
|
-
globalStylesId: _globalStylesId,
|
|
60
|
-
isReady: hasResolved,
|
|
61
|
-
settings: record?.settings,
|
|
62
|
-
styles: record?.styles
|
|
63
|
-
};
|
|
64
|
-
}, []);
|
|
65
|
-
const {
|
|
66
|
-
getEditedEntityRecord
|
|
67
|
-
} = (0, _data.useSelect)(_coreData.store);
|
|
68
|
-
const {
|
|
69
|
-
editEntityRecord
|
|
70
|
-
} = (0, _data.useDispatch)(_coreData.store);
|
|
71
|
-
const config = (0, _element.useMemo)(() => {
|
|
72
|
-
return {
|
|
73
|
-
settings: settings !== null && settings !== void 0 ? settings : {},
|
|
74
|
-
styles: styles !== null && styles !== void 0 ? styles : {}
|
|
75
|
-
};
|
|
76
|
-
}, [settings, styles]);
|
|
77
|
-
const setConfig = (0, _element.useCallback)((callback, options = {}) => {
|
|
78
|
-
var _record$styles, _record$settings;
|
|
79
|
-
const record = getEditedEntityRecord('root', 'globalStyles', globalStylesId);
|
|
80
|
-
const currentConfig = {
|
|
81
|
-
styles: (_record$styles = record?.styles) !== null && _record$styles !== void 0 ? _record$styles : {},
|
|
82
|
-
settings: (_record$settings = record?.settings) !== null && _record$settings !== void 0 ? _record$settings : {}
|
|
83
|
-
};
|
|
84
|
-
const updatedConfig = callback(currentConfig);
|
|
85
|
-
editEntityRecord('root', 'globalStyles', globalStylesId, {
|
|
86
|
-
styles: cleanEmptyObject(updatedConfig.styles) || {},
|
|
87
|
-
settings: cleanEmptyObject(updatedConfig.settings) || {}
|
|
88
|
-
}, options);
|
|
89
|
-
}, [globalStylesId]);
|
|
90
|
-
return [isReady, config, setConfig];
|
|
91
|
-
}
|
|
92
|
-
function useGlobalStylesBaseConfig() {
|
|
93
|
-
const baseConfig = (0, _data.useSelect)(select => {
|
|
94
|
-
return select(_coreData.store).__experimentalGetCurrentThemeBaseGlobalStyles();
|
|
95
|
-
}, []);
|
|
96
|
-
return [!!baseConfig, baseConfig];
|
|
97
|
-
}
|
|
98
|
-
function useGlobalStylesContext() {
|
|
99
|
-
const [isUserConfigReady, userConfig, setUserConfig] = useGlobalStylesUserConfig();
|
|
100
|
-
const [isBaseConfigReady, baseConfig] = useGlobalStylesBaseConfig();
|
|
101
|
-
const mergedConfig = (0, _element.useMemo)(() => {
|
|
102
|
-
if (!baseConfig || !userConfig) {
|
|
103
|
-
return {};
|
|
104
|
-
}
|
|
105
|
-
return mergeBaseAndUserConfigs(baseConfig, userConfig);
|
|
106
|
-
}, [userConfig, baseConfig]);
|
|
107
|
-
const context = (0, _element.useMemo)(() => {
|
|
108
|
-
return {
|
|
109
|
-
isReady: isUserConfigReady && isBaseConfigReady,
|
|
110
|
-
user: userConfig,
|
|
111
|
-
base: baseConfig,
|
|
112
|
-
merged: mergedConfig,
|
|
113
|
-
setUserConfig
|
|
114
|
-
};
|
|
115
|
-
}, [mergedConfig, userConfig, baseConfig, setUserConfig, isUserConfigReady, isBaseConfigReady]);
|
|
116
|
-
return context;
|
|
117
|
-
}
|
|
118
|
-
function GlobalStylesProvider({
|
|
119
|
-
children
|
|
120
|
-
}) {
|
|
121
|
-
const context = useGlobalStylesContext();
|
|
122
|
-
if (!context.isReady) {
|
|
123
|
-
return null;
|
|
124
|
-
}
|
|
125
|
-
return (0, _react.createElement)(GlobalStylesContext.Provider, {
|
|
126
|
-
value: context
|
|
127
|
-
}, children);
|
|
128
|
-
}
|
|
129
|
-
//# sourceMappingURL=global-styles-provider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_deepmerge","_interopRequireDefault","require","_isPlainObject","_element","_data","_coreData","_blockEditor","_lockUnlock","GlobalStylesContext","cleanEmptyObject","unlock","blockEditorPrivateApis","mergeBaseAndUserConfigs","base","user","deepmerge","isMergeableObject","isPlainObject","useGlobalStylesUserConfig","globalStylesId","isReady","settings","styles","useSelect","select","getEditedEntityRecord","hasFinishedResolution","coreStore","_globalStylesId","__experimentalGetCurrentGlobalStylesId","record","undefined","hasResolved","editEntityRecord","useDispatch","config","useMemo","setConfig","useCallback","callback","options","_record$styles","_record$settings","currentConfig","updatedConfig","useGlobalStylesBaseConfig","baseConfig","__experimentalGetCurrentThemeBaseGlobalStyles","useGlobalStylesContext","isUserConfigReady","userConfig","setUserConfig","isBaseConfigReady","mergedConfig","context","merged","GlobalStylesProvider","children","_react","createElement","Provider","value"],"sources":["@wordpress/edit-site/src/components/global-styles/global-styles-provider.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport deepmerge from 'deepmerge';\nimport { isPlainObject } from 'is-plain-object';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo, useCallback } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { GlobalStylesContext, cleanEmptyObject } = unlock(\n\tblockEditorPrivateApis\n);\n\nexport function mergeBaseAndUserConfigs( base, user ) {\n\treturn deepmerge( base, user, {\n\t\t// We only pass as arrays the presets,\n\t\t// in which case we want the new array of values\n\t\t// to override the old array (no merging).\n\t\tisMergeableObject: isPlainObject,\n\t} );\n}\n\nfunction useGlobalStylesUserConfig() {\n\tconst { globalStylesId, isReady, settings, styles } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedEntityRecord, hasFinishedResolution } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst _globalStylesId =\n\t\t\t\tselect( coreStore ).__experimentalGetCurrentGlobalStylesId();\n\t\t\tconst record = _globalStylesId\n\t\t\t\t? getEditedEntityRecord(\n\t\t\t\t\t\t'root',\n\t\t\t\t\t\t'globalStyles',\n\t\t\t\t\t\t_globalStylesId\n\t\t\t\t )\n\t\t\t\t: undefined;\n\n\t\t\tlet hasResolved = false;\n\t\t\tif (\n\t\t\t\thasFinishedResolution(\n\t\t\t\t\t'__experimentalGetCurrentGlobalStylesId'\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\thasResolved = _globalStylesId\n\t\t\t\t\t? hasFinishedResolution( 'getEditedEntityRecord', [\n\t\t\t\t\t\t\t'root',\n\t\t\t\t\t\t\t'globalStyles',\n\t\t\t\t\t\t\t_globalStylesId,\n\t\t\t\t\t ] )\n\t\t\t\t\t: true;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tglobalStylesId: _globalStylesId,\n\t\t\t\tisReady: hasResolved,\n\t\t\t\tsettings: record?.settings,\n\t\t\t\tstyles: record?.styles,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { getEditedEntityRecord } = useSelect( coreStore );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst config = useMemo( () => {\n\t\treturn {\n\t\t\tsettings: settings ?? {},\n\t\t\tstyles: styles ?? {},\n\t\t};\n\t}, [ settings, styles ] );\n\n\tconst setConfig = useCallback(\n\t\t( callback, options = {} ) => {\n\t\t\tconst record = getEditedEntityRecord(\n\t\t\t\t'root',\n\t\t\t\t'globalStyles',\n\t\t\t\tglobalStylesId\n\t\t\t);\n\t\t\tconst currentConfig = {\n\t\t\t\tstyles: record?.styles ?? {},\n\t\t\t\tsettings: record?.settings ?? {},\n\t\t\t};\n\t\t\tconst updatedConfig = callback( currentConfig );\n\t\t\teditEntityRecord(\n\t\t\t\t'root',\n\t\t\t\t'globalStyles',\n\t\t\t\tglobalStylesId,\n\t\t\t\t{\n\t\t\t\t\tstyles: cleanEmptyObject( updatedConfig.styles ) || {},\n\t\t\t\t\tsettings: cleanEmptyObject( updatedConfig.settings ) || {},\n\t\t\t\t},\n\t\t\t\toptions\n\t\t\t);\n\t\t},\n\t\t[ globalStylesId ]\n\t);\n\n\treturn [ isReady, config, setConfig ];\n}\n\nfunction useGlobalStylesBaseConfig() {\n\tconst baseConfig = useSelect( ( select ) => {\n\t\treturn select(\n\t\t\tcoreStore\n\t\t).__experimentalGetCurrentThemeBaseGlobalStyles();\n\t}, [] );\n\n\treturn [ !! baseConfig, baseConfig ];\n}\n\nfunction useGlobalStylesContext() {\n\tconst [ isUserConfigReady, userConfig, setUserConfig ] =\n\t\tuseGlobalStylesUserConfig();\n\tconst [ isBaseConfigReady, baseConfig ] = useGlobalStylesBaseConfig();\n\tconst mergedConfig = useMemo( () => {\n\t\tif ( ! baseConfig || ! userConfig ) {\n\t\t\treturn {};\n\t\t}\n\t\treturn mergeBaseAndUserConfigs( baseConfig, userConfig );\n\t}, [ userConfig, baseConfig ] );\n\tconst context = useMemo( () => {\n\t\treturn {\n\t\t\tisReady: isUserConfigReady && isBaseConfigReady,\n\t\t\tuser: userConfig,\n\t\t\tbase: baseConfig,\n\t\t\tmerged: mergedConfig,\n\t\t\tsetUserConfig,\n\t\t};\n\t}, [\n\t\tmergedConfig,\n\t\tuserConfig,\n\t\tbaseConfig,\n\t\tsetUserConfig,\n\t\tisUserConfigReady,\n\t\tisBaseConfigReady,\n\t] );\n\n\treturn context;\n}\n\nexport function GlobalStylesProvider( { children } ) {\n\tconst context = useGlobalStylesContext();\n\tif ( ! context.isReady ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<GlobalStylesContext.Provider value={ context }>\n\t\t\t{ children }\n\t\t</GlobalStylesContext.Provider>\n\t);\n}\n"],"mappings":";;;;;;;;;AAGA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,cAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAKA,IAAAM,WAAA,GAAAN,OAAA;AAjBA;AACA;AACA;;AAIA;AACA;AACA;;AAMA;AACA;AACA;;AAGA,MAAM;EAAEO,mBAAmB;EAAEC;AAAiB,CAAC,GAAG,IAAAC,kBAAM,EACvDC,wBACD,CAAC;AAEM,SAASC,uBAAuBA,CAAEC,IAAI,EAAEC,IAAI,EAAG;EACrD,OAAO,IAAAC,kBAAS,EAAEF,IAAI,EAAEC,IAAI,EAAE;IAC7B;IACA;IACA;IACAE,iBAAiB,EAAEC;EACpB,CAAE,CAAC;AACJ;AAEA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D,yBAAyB,CAAC,CAAC;EACrE,MAAMQ,YAAY,GAAG,IAAAjB,gBAAO,EAAE,MAAM;IACnC,IAAK,CAAEU,UAAU,IAAI,CAAEI,UAAU,EAAG;MACnC,OAAO,CAAC,CAAC;IACV;IACA,OAAOtC,uBAAuB,CAAEkC,UAAU,EAAEI,UAAW,CAAC;EACzD,CAAC,EAAE,CAAEA,UAAU,EAAEJ,UAAU,CAAG,CAAC;EAC/B,MAAMQ,OAAO,GAAG,IAAAlB,gBAAO,EAAE,MAAM;IAC9B,OAAO;MACNhB,OAAO,EAAE6B,iBAAiB,IAAIG,iBAAiB;MAC/CtC,IAAI,EAAEoC,UAAU;MAChBrC,IAAI,EAAEiC,UAAU;MAChBS,MAAM,EAAEF,YAAY;MACpBF;IACD,CAAC;EACF,CAAC,EAAE,CACFE,YAAY,EACZH,UAAU,EACVJ,UAAU,EACVK,aAAa,EACbF,iBAAiB,EACjBG,iBAAiB,CAChB,CAAC;EAEH,OAAOE,OAAO;AACf;AAEO,SAASE,oBAAoBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACpD,MAAMH,OAAO,GAAGN,sBAAsB,CAAC,CAAC;EACxC,IAAK,CAAEM,OAAO,CAAClC,OAAO,EAAG;IACxB,OAAO,IAAI;EACZ;EAEA,OACC,IAAAsC,MAAA,CAAAC,aAAA,EAACnD,mBAAmB,CAACoD,QAAQ;IAACC,KAAK,EAAGP;EAAS,GAC5CG,QAC2B,CAAC;AAEjC","ignoreList":[]}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = DocumentTools;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _compose = require("@wordpress/compose");
|
|
9
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
10
|
-
var _data = require("@wordpress/data");
|
|
11
|
-
var _i18n = require("@wordpress/i18n");
|
|
12
|
-
var _icons = require("@wordpress/icons");
|
|
13
|
-
var _components = require("@wordpress/components");
|
|
14
|
-
var _editor = require("@wordpress/editor");
|
|
15
|
-
var _lockUnlock = require("../../../lock-unlock");
|
|
16
|
-
/**
|
|
17
|
-
* WordPress dependencies
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Internal dependencies
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
const {
|
|
25
|
-
DocumentTools: EditorDocumentTools
|
|
26
|
-
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
27
|
-
function DocumentTools({
|
|
28
|
-
blockEditorMode,
|
|
29
|
-
hasFixedToolbar,
|
|
30
|
-
isDistractionFree
|
|
31
|
-
}) {
|
|
32
|
-
const {
|
|
33
|
-
isVisualMode
|
|
34
|
-
} = (0, _data.useSelect)(select => {
|
|
35
|
-
const {
|
|
36
|
-
getEditorMode
|
|
37
|
-
} = select(_editor.store);
|
|
38
|
-
return {
|
|
39
|
-
isVisualMode: getEditorMode() === 'visual'
|
|
40
|
-
};
|
|
41
|
-
}, []);
|
|
42
|
-
const {
|
|
43
|
-
__unstableSetEditorMode
|
|
44
|
-
} = (0, _data.useDispatch)(_blockEditor.store);
|
|
45
|
-
const {
|
|
46
|
-
setDeviceType
|
|
47
|
-
} = (0, _data.useDispatch)(_editor.store);
|
|
48
|
-
const isLargeViewport = (0, _compose.useViewportMatch)('medium');
|
|
49
|
-
const isZoomedOutViewExperimentEnabled = window?.__experimentalEnableZoomedOutView && isVisualMode;
|
|
50
|
-
const isZoomedOutView = blockEditorMode === 'zoom-out';
|
|
51
|
-
return (0, _react.createElement)(EditorDocumentTools, {
|
|
52
|
-
disableBlockTools: !isVisualMode,
|
|
53
|
-
listViewLabel: (0, _i18n.__)('List View')
|
|
54
|
-
}, isZoomedOutViewExperimentEnabled && isLargeViewport && !isDistractionFree && !hasFixedToolbar && (0, _react.createElement)(_components.ToolbarItem, {
|
|
55
|
-
as: _components.Button,
|
|
56
|
-
className: "edit-site-header-edit-mode__zoom-out-view-toggle",
|
|
57
|
-
icon: _icons.chevronUpDown,
|
|
58
|
-
isPressed: isZoomedOutView
|
|
59
|
-
/* translators: button label text should, if possible, be under 16 characters. */,
|
|
60
|
-
label: (0, _i18n.__)('Zoom-out View'),
|
|
61
|
-
onClick: () => {
|
|
62
|
-
setDeviceType('Desktop');
|
|
63
|
-
__unstableSetEditorMode(isZoomedOutView ? 'edit' : 'zoom-out');
|
|
64
|
-
},
|
|
65
|
-
size: "compact"
|
|
66
|
-
}));
|
|
67
|
-
}
|
|
68
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_compose","require","_blockEditor","_data","_i18n","_icons","_components","_editor","_lockUnlock","DocumentTools","EditorDocumentTools","unlock","editorPrivateApis","blockEditorMode","hasFixedToolbar","isDistractionFree","isVisualMode","useSelect","select","getEditorMode","editorStore","__unstableSetEditorMode","useDispatch","blockEditorStore","setDeviceType","isLargeViewport","useViewportMatch","isZoomedOutViewExperimentEnabled","window","__experimentalEnableZoomedOutView","isZoomedOutView","_react","createElement","disableBlockTools","listViewLabel","__","ToolbarItem","as","Button","className","icon","chevronUpDown","isPressed","label","onClick","size"],"sources":["@wordpress/edit-site/src/components/header-edit-mode/document-tools/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { chevronUpDown } from '@wordpress/icons';\nimport { Button, ToolbarItem } from '@wordpress/components';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst { DocumentTools: EditorDocumentTools } = unlock( editorPrivateApis );\n\nexport default function DocumentTools( {\n\tblockEditorMode,\n\thasFixedToolbar,\n\tisDistractionFree,\n} ) {\n\tconst { isVisualMode } = useSelect( ( select ) => {\n\t\tconst { getEditorMode } = select( editorStore );\n\n\t\treturn {\n\t\t\tisVisualMode: getEditorMode() === 'visual',\n\t\t};\n\t}, [] );\n\tconst { __unstableSetEditorMode } = useDispatch( blockEditorStore );\n\tconst { setDeviceType } = useDispatch( editorStore );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isZoomedOutViewExperimentEnabled =\n\t\twindow?.__experimentalEnableZoomedOutView && isVisualMode;\n\tconst isZoomedOutView = blockEditorMode === 'zoom-out';\n\n\treturn (\n\t\t<EditorDocumentTools\n\t\t\tdisableBlockTools={ ! isVisualMode }\n\t\t\tlistViewLabel={ __( 'List View' ) }\n\t\t>\n\t\t\t{ isZoomedOutViewExperimentEnabled &&\n\t\t\t\tisLargeViewport &&\n\t\t\t\t! isDistractionFree &&\n\t\t\t\t! hasFixedToolbar && (\n\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\tclassName=\"edit-site-header-edit-mode__zoom-out-view-toggle\"\n\t\t\t\t\t\ticon={ chevronUpDown }\n\t\t\t\t\t\tisPressed={ isZoomedOutView }\n\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\tlabel={ __( 'Zoom-out View' ) }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\tsetDeviceType( 'Desktop' );\n\t\t\t\t\t\t\t__unstableSetEditorMode(\n\t\t\t\t\t\t\t\tisZoomedOutView ? 'edit' : 'zoom-out'\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t</EditorDocumentTools>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;A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AC5DC,IAAI,EAAGC,oBAAe;IACtBC,SAAS,EAAGZ;IACZ;IACAa,KAAK,EAAG,IAAAR,QAAE,EAAE,eAAgB,CAAG;IAC/BS,OAAO,EAAGA,CAAA,KAAM;MACfpB,aAAa,CAAE,SAAU,CAAC;MAC1BH,uBAAuB,CACtBS,eAAe,GAAG,MAAM,GAAG,UAC5B,CAAC;IACF,CAAG;IACHe,IAAI,EAAC;EAAS,CACd,CAEiB,CAAC;AAExB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_editor","require","_lockUnlock","ComplementaryArea","ComplementaryAreaMoreMenuItem","unlock","editorPrivateApis","DefaultSidebar","className","identifier","title","icon","children","closeLabel","header","headerClassName","panelClassName","isActiveByDefault","_react","createElement","Fragment","scope","smallScreenTitle"],"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/default-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { ComplementaryArea, ComplementaryAreaMoreMenuItem } =\n\tunlock( editorPrivateApis );\n\nexport default function DefaultSidebar( {\n\tclassName,\n\tidentifier,\n\ttitle,\n\ticon,\n\tchildren,\n\tcloseLabel,\n\theader,\n\theaderClassName,\n\tpanelClassName,\n\tisActiveByDefault,\n} ) {\n\treturn (\n\t\t<>\n\t\t\t<ComplementaryArea\n\t\t\t\tclassName={ className }\n\t\t\t\tscope=\"core\"\n\t\t\t\tidentifier={ identifier }\n\t\t\t\ttitle={ title }\n\t\t\t\tsmallScreenTitle={ title }\n\t\t\t\ticon={ icon }\n\t\t\t\tcloseLabel={ closeLabel }\n\t\t\t\theader={ header }\n\t\t\t\theaderClassName={ headerClassName }\n\t\t\t\tpanelClassName={ panelClassName }\n\t\t\t\tisActiveByDefault={ isActiveByDefault }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</ComplementaryArea>\n\t\t\t<ComplementaryAreaMoreMenuItem\n\t\t\t\tscope=\"core\"\n\t\t\t\tidentifier={ identifier }\n\t\t\t\ticon={ icon }\n\t\t\t>\n\t\t\t\t{ title }\n\t\t\t</ComplementaryAreaMoreMenuItem>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AARA;AACA;AACA;;AAGA;AACA;AACA;;AAGA,MAAM;EAAEE,iBAAiB;EAAEC;AAA8B,CAAC,GACzD,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEb,SAASC,cAAcA,CAAE;EACvCC,SAAS;EACTC,UAAU;EACVC,KAAK;EACLC,IAAI;EACJC,QAAQ;EACRC,UAAU;EACVC,MAAM;EACNC,eAAe;EACfC,cAAc;EACdC;AACD,CAAC,EAAG;EACH,OACC,IAAAC,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAE,QAAA,QACC,IAAAF,MAAA,CAAAC,aAAA,EAAChB,iBAAiB;IACjBK,SAAS,EAAGA,SAAW;IACvBa,KAAK,EAAC,MAAM;IACZZ,UAAU,EAAGA,UAAY;IACzBC,KAAK,EAAGA,KAAO;IACfY,gBAAgB,EAAGZ,KAAO;IAC1BC,IAAI,EAAGA,IAAM;IACbE,UAAU,EAAGA,UAAY;IACzBC,MAAM,EAAGA,MAAQ;IACjBC,eAAe,EAAGA,eAAiB;IACnCC,cAAc,EAAGA,cAAgB;IACjCC,iBAAiB,EAAGA;EAAmB,GAErCL,QACgB,CAAC,EACpB,IAAAM,MAAA,CAAAC,aAAA,EAACf,6BAA6B;IAC7BiB,KAAK,EAAC,MAAM;IACZZ,UAAU,EAAGA,UAAY;IACzBE,IAAI,EAAGA;EAAM,GAEXD,KAC4B,CAC9B,CAAC;AAEL","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_icons","_data","_element","_preferences","_editor","_defaultSidebar","_interopRequireDefault","_globalStyles","_store","_ui","_lockUnlock","_coreData","interfaceStore","unlock","editorPrivateApis","GlobalStylesSidebar","shouldClearCanvasContainerView","isStyleBookOpened","showListViewByDefault","hasRevisions","isRevisionsOpened","isRevisionsStyleBookOpened","useSelect","select","getActiveComplementaryArea","getEditorCanvasContainerView","getCanvasMode","editSiteStore","canvasContainerView","_isVisualEditorMode","editorStore","getEditorMode","_isEditCanvasMode","_showListViewByDefault","preferencesStore","get","getEntityRecord","__experimentalGetCurrentGlobalStylesId","coreStore","globalStylesId","globalStyles","undefined","_links","count","setEditorCanvasContainerView","useDispatch","useEffect","setIsListViewOpened","goTo","useNavigator","toggleRevisions","toggleStyleBook","_react","createElement","default","className","identifier","title","__","icon","styles","closeLabel","panelClassName","header","Flex","FlexBlock","style","minWidth","FlexItem","Button","seen","label","isPressed","disabled","onClick","backup","GlobalStylesMenuSlot","GlobalStylesUI"],"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/global-styles-sidebar.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tFlexItem,\n\tFlexBlock,\n\tFlex,\n\tButton,\n\t__experimentalUseNavigator as useNavigator,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { styles, seen, backup } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport DefaultSidebar from './default-sidebar';\nimport { GlobalStylesUI } from '../global-styles';\nimport { store as editSiteStore } from '../../store';\nimport { GlobalStylesMenuSlot } from '../global-styles/ui';\nimport { unlock } from '../../lock-unlock';\nimport { store as coreStore } from '@wordpress/core-data';\n\nconst { interfaceStore } = unlock( editorPrivateApis );\n\nexport default function GlobalStylesSidebar() {\n\tconst {\n\t\tshouldClearCanvasContainerView,\n\t\tisStyleBookOpened,\n\t\tshowListViewByDefault,\n\t\thasRevisions,\n\t\tisRevisionsOpened,\n\t\tisRevisionsStyleBookOpened,\n\t} = useSelect( ( select ) => {\n\t\tconst { getActiveComplementaryArea } = select( interfaceStore );\n\t\tconst { getEditorCanvasContainerView, getCanvasMode } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst canvasContainerView = getEditorCanvasContainerView();\n\t\tconst _isVisualEditorMode =\n\t\t\t'visual' === select( editorStore ).getEditorMode();\n\t\tconst _isEditCanvasMode = 'edit' === getCanvasMode();\n\t\tconst _showListViewByDefault = select( preferencesStore ).get(\n\t\t\t'core',\n\t\t\t'showListViewByDefault'\n\t\t);\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\tisStyleBookOpened: 'style-book' === canvasContainerView,\n\t\t\tshouldClearCanvasContainerView:\n\t\t\t\t'edit-site/global-styles' !==\n\t\t\t\t\tgetActiveComplementaryArea( 'core' ) ||\n\t\t\t\t! _isVisualEditorMode ||\n\t\t\t\t! _isEditCanvasMode,\n\t\t\tshowListViewByDefault: _showListViewByDefault,\n\t\t\thasRevisions:\n\t\t\t\t!! globalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count,\n\t\t\tisRevisionsStyleBookOpened:\n\t\t\t\t'global-styles-revisions:style-book' === canvasContainerView,\n\t\t\tisRevisionsOpened:\n\t\t\t\t'global-styles-revisions' === canvasContainerView,\n\t\t};\n\t}, [] );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\n\tuseEffect( () => {\n\t\tif ( shouldClearCanvasContainerView ) {\n\t\t\tsetEditorCanvasContainerView( undefined );\n\t\t}\n\t}, [ shouldClearCanvasContainerView ] );\n\n\tconst { setIsListViewOpened } = useDispatch( editorStore );\n\tconst { goTo } = useNavigator();\n\n\tconst toggleRevisions = () => {\n\t\tsetIsListViewOpened( false );\n\t\tif ( isRevisionsStyleBookOpened ) {\n\t\t\tgoTo( '/' );\n\t\t\tsetEditorCanvasContainerView( 'style-book' );\n\t\t\treturn;\n\t\t}\n\t\tif ( isRevisionsOpened ) {\n\t\t\tgoTo( '/' );\n\t\t\tsetEditorCanvasContainerView( undefined );\n\t\t\treturn;\n\t\t}\n\t\tgoTo( '/revisions' );\n\n\t\tif ( isStyleBookOpened ) {\n\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t'global-styles-revisions:style-book'\n\t\t\t);\n\t\t} else {\n\t\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t\t}\n\t};\n\tconst toggleStyleBook = () => {\n\t\tif ( isRevisionsOpened ) {\n\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t'global-styles-revisions:style-book'\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\t\tif ( isRevisionsStyleBookOpened ) {\n\t\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t\t\treturn;\n\t\t}\n\t\tsetIsListViewOpened( isStyleBookOpened && showListViewByDefault );\n\t\tsetEditorCanvasContainerView(\n\t\t\tisStyleBookOpened ? undefined : 'style-book'\n\t\t);\n\t};\n\n\treturn (\n\t\t<DefaultSidebar\n\t\t\tclassName=\"edit-site-global-styles-sidebar\"\n\t\t\tidentifier=\"edit-site/global-styles\"\n\t\t\ttitle={ __( 'Styles' ) }\n\t\t\ticon={ styles }\n\t\t\tcloseLabel={ __( 'Close Styles' ) }\n\t\t\tpanelClassName=\"edit-site-global-styles-sidebar__panel\"\n\t\t\theader={\n\t\t\t\t<Flex className=\"edit-site-global-styles-sidebar__header\">\n\t\t\t\t\t<FlexBlock style={ { minWidth: 'min-content' } }>\n\t\t\t\t\t\t<h2 className=\"edit-site-global-styles-sidebar__header-title\">\n\t\t\t\t\t\t\t{ __( 'Styles' ) }\n\t\t\t\t\t\t</h2>\n\t\t\t\t\t</FlexBlock>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\t\t\t\t\tisPressed={\n\t\t\t\t\t\t\t\tisStyleBookOpened || isRevisionsStyleBookOpened\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdisabled={ shouldClearCanvasContainerView }\n\t\t\t\t\t\t\tonClick={ toggleStyleBook }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<FlexItem>\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tlabel={ __( 'Revisions' ) }\n\t\t\t\t\t\t\ticon={ backup }\n\t\t\t\t\t\t\tonClick={ toggleRevisions }\n\t\t\t\t\t\t\tdisabled={ ! hasRevisions }\n\t\t\t\t\t\t\tisPressed={\n\t\t\t\t\t\t\t\tisRevisionsOpened || isRevisionsStyleBookOpened\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</FlexItem>\n\t\t\t\t\t<GlobalStylesMenuSlot />\n\t\t\t\t</Flex>\n\t\t\t}\n\t\t>\n\t\t\t<GlobalStylesUI />\n\t\t</DefaultSidebar>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAOA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAQA,IAAAO,eAAA,GAAAC,sBAAA,CAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AACA,IAAAU,MAAA,GAAAV,OAAA;AACA,IAAAW,GAAA,GAAAX,OAA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NE,KAAK,EAAG,IAAAb,QAAE,EAAE,WAAY,CAAG;MAC3BC,IAAI,EAAGgB,aAAQ;MACfD,OAAO,EAAGxB,eAAiB;MAC3BuB,QAAQ,EAAG,CAAEtD,YAAc;MAC3BqD,SAAS,EACRpD,iBAAiB,IAAIC;IACrB,CACD,CACQ,CAAC,EACX,IAAA+B,MAAA,CAAAC,aAAA,EAAC5C,GAAA,CAAAmE,oBAAoB,MAAE,CAClB;EACN,GAED,IAAAxB,MAAA,CAAAC,aAAA,EAAC9C,aAAA,CAAAsE,cAAc,MAAE,CACF,CAAC;AAEnB","ignoreList":[]}
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.SidebarComplementaryAreaFills = SidebarComplementaryAreaFills;
|
|
8
|
-
exports.SidebarInspectorFill = void 0;
|
|
9
|
-
var _react = require("react");
|
|
10
|
-
var _components = require("@wordpress/components");
|
|
11
|
-
var _i18n = require("@wordpress/i18n");
|
|
12
|
-
var _icons = require("@wordpress/icons");
|
|
13
|
-
var _element = require("@wordpress/element");
|
|
14
|
-
var _data = require("@wordpress/data");
|
|
15
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
16
|
-
var _coreData = require("@wordpress/core-data");
|
|
17
|
-
var _editor = require("@wordpress/editor");
|
|
18
|
-
var _defaultSidebar = _interopRequireDefault(require("./default-sidebar"));
|
|
19
|
-
var _globalStylesSidebar = _interopRequireDefault(require("./global-styles-sidebar"));
|
|
20
|
-
var _settingsHeader = _interopRequireDefault(require("./settings-header"));
|
|
21
|
-
var _pagePanels = _interopRequireDefault(require("./page-panels"));
|
|
22
|
-
var _templatePanel = _interopRequireDefault(require("./template-panel"));
|
|
23
|
-
var _store = require("../../store");
|
|
24
|
-
var _lockUnlock = require("../../lock-unlock");
|
|
25
|
-
/**
|
|
26
|
-
* WordPress dependencies
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Internal dependencies
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
const {
|
|
34
|
-
Tabs
|
|
35
|
-
} = (0, _lockUnlock.unlock)(_components.privateApis);
|
|
36
|
-
const {
|
|
37
|
-
interfaceStore,
|
|
38
|
-
useAutoSwitchEditorSidebars,
|
|
39
|
-
PatternOverridesPanel
|
|
40
|
-
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
41
|
-
const {
|
|
42
|
-
Slot: InspectorSlot,
|
|
43
|
-
Fill: InspectorFill
|
|
44
|
-
} = (0, _components.createSlotFill)('EditSiteSidebarInspector');
|
|
45
|
-
const SidebarInspectorFill = exports.SidebarInspectorFill = InspectorFill;
|
|
46
|
-
const FillContents = ({
|
|
47
|
-
tabName,
|
|
48
|
-
isEditingPage,
|
|
49
|
-
supportsGlobalStyles
|
|
50
|
-
}) => {
|
|
51
|
-
const tabListRef = (0, _element.useRef)(null);
|
|
52
|
-
// Because `DefaultSidebar` renders a `ComplementaryArea`, we
|
|
53
|
-
// need to forward the `Tabs` context so it can be passed through the
|
|
54
|
-
// underlying slot/fill.
|
|
55
|
-
const tabsContextValue = (0, _element.useContext)(Tabs.Context);
|
|
56
|
-
|
|
57
|
-
// This effect addresses a race condition caused by tabbing from the last
|
|
58
|
-
// block in the editor into the settings sidebar. Without this effect, the
|
|
59
|
-
// selected tab and browser focus can become separated in an unexpected way.
|
|
60
|
-
// (e.g the "block" tab is focused, but the "post" tab is selected).
|
|
61
|
-
(0, _element.useEffect)(() => {
|
|
62
|
-
const tabsElements = Array.from(tabListRef.current?.querySelectorAll('[role="tab"]') || []);
|
|
63
|
-
const selectedTabElement = tabsElements.find(
|
|
64
|
-
// We are purposefully using a custom `data-tab-id` attribute here
|
|
65
|
-
// because we don't want rely on any assumptions about `Tabs`
|
|
66
|
-
// component internals.
|
|
67
|
-
element => element.getAttribute('data-tab-id') === tabName);
|
|
68
|
-
const activeElement = selectedTabElement?.ownerDocument.activeElement;
|
|
69
|
-
const tabsHasFocus = tabsElements.some(element => {
|
|
70
|
-
return activeElement && activeElement.id === element.id;
|
|
71
|
-
});
|
|
72
|
-
if (tabsHasFocus && selectedTabElement && selectedTabElement.id !== activeElement?.id) {
|
|
73
|
-
selectedTabElement?.focus();
|
|
74
|
-
}
|
|
75
|
-
}, [tabName]);
|
|
76
|
-
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_defaultSidebar.default, {
|
|
77
|
-
identifier: tabName,
|
|
78
|
-
title: (0, _i18n.__)('Settings'),
|
|
79
|
-
icon: (0, _i18n.isRTL)() ? _icons.drawerLeft : _icons.drawerRight,
|
|
80
|
-
closeLabel: (0, _i18n.__)('Close Settings'),
|
|
81
|
-
header: (0, _react.createElement)(Tabs.Context.Provider, {
|
|
82
|
-
value: tabsContextValue
|
|
83
|
-
}, (0, _react.createElement)(_settingsHeader.default, {
|
|
84
|
-
ref: tabListRef
|
|
85
|
-
})),
|
|
86
|
-
headerClassName: "edit-site-sidebar-edit-mode__panel-tabs"
|
|
87
|
-
// This classname is added so we can apply a corrective negative
|
|
88
|
-
// margin to the panel.
|
|
89
|
-
// see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049
|
|
90
|
-
,
|
|
91
|
-
className: "edit-site-sidebar__panel",
|
|
92
|
-
isActiveByDefault: true
|
|
93
|
-
}, (0, _react.createElement)(Tabs.Context.Provider, {
|
|
94
|
-
value: tabsContextValue
|
|
95
|
-
}, (0, _react.createElement)(Tabs.TabPanel, {
|
|
96
|
-
tabId: "edit-post/document",
|
|
97
|
-
focusable: false
|
|
98
|
-
}, isEditingPage ? (0, _react.createElement)(_pagePanels.default, null) : (0, _react.createElement)(_templatePanel.default, null), (0, _react.createElement)(_editor.PostLastRevisionPanel, null), (0, _react.createElement)(_editor.PostTaxonomiesPanel, null), (0, _react.createElement)(_editor.PostDiscussionPanel, null), (0, _react.createElement)(_editor.PageAttributesPanel, null), (0, _react.createElement)(PatternOverridesPanel, null)), (0, _react.createElement)(Tabs.TabPanel, {
|
|
99
|
-
tabId: "edit-post/block",
|
|
100
|
-
focusable: false
|
|
101
|
-
}, (0, _react.createElement)(InspectorSlot, {
|
|
102
|
-
bubblesVirtually: true
|
|
103
|
-
})))), supportsGlobalStyles && (0, _react.createElement)(_globalStylesSidebar.default, null));
|
|
104
|
-
};
|
|
105
|
-
function SidebarComplementaryAreaFills() {
|
|
106
|
-
useAutoSwitchEditorSidebars();
|
|
107
|
-
const {
|
|
108
|
-
tabName,
|
|
109
|
-
supportsGlobalStyles,
|
|
110
|
-
isEditingPage
|
|
111
|
-
} = (0, _data.useSelect)(select => {
|
|
112
|
-
const sidebar = select(interfaceStore).getActiveComplementaryArea('core');
|
|
113
|
-
const _isEditorSidebarOpened = ['edit-post/block', 'edit-post/document'].includes(sidebar);
|
|
114
|
-
let _tabName = sidebar;
|
|
115
|
-
if (!_isEditorSidebarOpened) {
|
|
116
|
-
_tabName = !!select(_blockEditor.store).getBlockSelectionStart() ? 'edit-post/block' : 'edit-post/document';
|
|
117
|
-
}
|
|
118
|
-
return {
|
|
119
|
-
tabName: _tabName,
|
|
120
|
-
supportsGlobalStyles: select(_coreData.store).getCurrentTheme()?.is_block_theme,
|
|
121
|
-
isEditingPage: select(_store.store).isPage()
|
|
122
|
-
};
|
|
123
|
-
}, []);
|
|
124
|
-
const {
|
|
125
|
-
enableComplementaryArea
|
|
126
|
-
} = (0, _data.useDispatch)(interfaceStore);
|
|
127
|
-
|
|
128
|
-
// `newSelectedTabId` could technically be falsey if no tab is selected (i.e.
|
|
129
|
-
// the initial render) or when we don't want a tab displayed (i.e. the
|
|
130
|
-
// sidebar is closed). These cases should both be covered by the `!!` check
|
|
131
|
-
// below, so we shouldn't need any additional falsey handling.
|
|
132
|
-
const onTabSelect = (0, _element.useCallback)(newSelectedTabId => {
|
|
133
|
-
if (!!newSelectedTabId) {
|
|
134
|
-
enableComplementaryArea('core', newSelectedTabId);
|
|
135
|
-
}
|
|
136
|
-
}, [enableComplementaryArea]);
|
|
137
|
-
return (0, _react.createElement)(Tabs, {
|
|
138
|
-
selectedTabId: tabName,
|
|
139
|
-
onSelect: onTabSelect,
|
|
140
|
-
selectOnMove: false
|
|
141
|
-
}, (0, _react.createElement)(FillContents, {
|
|
142
|
-
tabName: tabName,
|
|
143
|
-
isEditingPage: isEditingPage,
|
|
144
|
-
supportsGlobalStyles: supportsGlobalStyles
|
|
145
|
-
}));
|
|
146
|
-
}
|
|
147
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_icons","_element","_data","_blockEditor","_coreData","_editor","_defaultSidebar","_interopRequireDefault","_globalStylesSidebar","_settingsHeader","_pagePanels","_templatePanel","_store","_lockUnlock","Tabs","unlock","componentsPrivateApis","interfaceStore","useAutoSwitchEditorSidebars","PatternOverridesPanel","editorPrivateApis","Slot","InspectorSlot","Fill","InspectorFill","createSlotFill","SidebarInspectorFill","exports","FillContents","tabName","isEditingPage","supportsGlobalStyles","tabListRef","useRef","tabsContextValue","useContext","Context","useEffect","tabsElements","Array","from","current","querySelectorAll","selectedTabElement","find","element","getAttribute","activeElement","ownerDocument","tabsHasFocus","some","id","focus","_react","createElement","Fragment","default","identifier","title","__","icon","isRTL","drawerLeft","drawerRight","closeLabel","header","Provider","value","ref","headerClassName","className","isActiveByDefault","TabPanel","tabId","focusable","PostLastRevisionPanel","PostTaxonomiesPanel","PostDiscussionPanel","PageAttributesPanel","bubblesVirtually","SidebarComplementaryAreaFills","useSelect","select","sidebar","getActiveComplementaryArea","_isEditorSidebarOpened","includes","_tabName","blockEditorStore","getBlockSelectionStart","coreStore","getCurrentTheme","is_block_theme","editSiteStore","isPage","enableComplementaryArea","useDispatch","onTabSelect","useCallback","newSelectedTabId","selectedTabId","onSelect","selectOnMove"],"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tcreateSlotFill,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { useCallback, useContext, useEffect, useRef } from '@wordpress/element';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tPageAttributesPanel,\n\tPostDiscussionPanel,\n\tPostLastRevisionPanel,\n\tPostTaxonomiesPanel,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport DefaultSidebar from './default-sidebar';\nimport GlobalStylesSidebar from './global-styles-sidebar';\nimport SettingsHeader from './settings-header';\nimport PagePanels from './page-panels';\nimport TemplatePanel from './template-panel';\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { Tabs } = unlock( componentsPrivateApis );\nconst { interfaceStore, useAutoSwitchEditorSidebars, PatternOverridesPanel } =\n\tunlock( editorPrivateApis );\nconst { Slot: InspectorSlot, Fill: InspectorFill } = createSlotFill(\n\t'EditSiteSidebarInspector'\n);\nexport const SidebarInspectorFill = InspectorFill;\n\nconst FillContents = ( { tabName, isEditingPage, supportsGlobalStyles } ) => {\n\tconst tabListRef = useRef( null );\n\t// Because `DefaultSidebar` renders a `ComplementaryArea`, we\n\t// need to forward the `Tabs` context so it can be passed through the\n\t// underlying slot/fill.\n\tconst tabsContextValue = useContext( Tabs.Context );\n\n\t// This effect addresses a race condition caused by tabbing from the last\n\t// block in the editor into the settings sidebar. Without this effect, the\n\t// selected tab and browser focus can become separated in an unexpected way.\n\t// (e.g the \"block\" tab is focused, but the \"post\" tab is selected).\n\tuseEffect( () => {\n\t\tconst tabsElements = Array.from(\n\t\t\ttabListRef.current?.querySelectorAll( '[role=\"tab\"]' ) || []\n\t\t);\n\t\tconst selectedTabElement = tabsElements.find(\n\t\t\t// We are purposefully using a custom `data-tab-id` attribute here\n\t\t\t// because we don't want rely on any assumptions about `Tabs`\n\t\t\t// component internals.\n\t\t\t( element ) => element.getAttribute( 'data-tab-id' ) === tabName\n\t\t);\n\t\tconst activeElement = selectedTabElement?.ownerDocument.activeElement;\n\t\tconst tabsHasFocus = tabsElements.some( ( element ) => {\n\t\t\treturn activeElement && activeElement.id === element.id;\n\t\t} );\n\t\tif (\n\t\t\ttabsHasFocus &&\n\t\t\tselectedTabElement &&\n\t\t\tselectedTabElement.id !== activeElement?.id\n\t\t) {\n\t\t\tselectedTabElement?.focus();\n\t\t}\n\t}, [ tabName ] );\n\n\treturn (\n\t\t<>\n\t\t\t<DefaultSidebar\n\t\t\t\tidentifier={ tabName }\n\t\t\t\ttitle={ __( 'Settings' ) }\n\t\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\t\theader={\n\t\t\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t\t\t<SettingsHeader ref={ tabListRef } />\n\t\t\t\t\t</Tabs.Context.Provider>\n\t\t\t\t}\n\t\t\t\theaderClassName=\"edit-site-sidebar-edit-mode__panel-tabs\"\n\t\t\t\t// This classname is added so we can apply a corrective negative\n\t\t\t\t// margin to the panel.\n\t\t\t\t// see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049\n\t\t\t\tclassName=\"edit-site-sidebar__panel\"\n\t\t\t\tisActiveByDefault\n\t\t\t>\n\t\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t\t<Tabs.TabPanel\n\t\t\t\t\t\ttabId=\"edit-post/document\"\n\t\t\t\t\t\tfocusable={ false }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ isEditingPage ? <PagePanels /> : <TemplatePanel /> }\n\t\t\t\t\t\t<PostLastRevisionPanel />\n\t\t\t\t\t\t<PostTaxonomiesPanel />\n\t\t\t\t\t\t<PostDiscussionPanel />\n\t\t\t\t\t\t<PageAttributesPanel />\n\t\t\t\t\t\t<PatternOverridesPanel />\n\t\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t\t<Tabs.TabPanel tabId=\"edit-post/block\" focusable={ false }>\n\t\t\t\t\t\t<InspectorSlot bubblesVirtually />\n\t\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t</Tabs.Context.Provider>\n\t\t\t</DefaultSidebar>\n\t\t\t{ supportsGlobalStyles && <GlobalStylesSidebar /> }\n\t\t</>\n\t);\n};\n\nexport function SidebarComplementaryAreaFills() {\n\tuseAutoSwitchEditorSidebars();\n\tconst { tabName, supportsGlobalStyles, isEditingPage } = useSelect(\n\t\t( select ) => {\n\t\t\tconst sidebar =\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\n\t\t\tconst _isEditorSidebarOpened = [\n\t\t\t\t'edit-post/block',\n\t\t\t\t'edit-post/document',\n\t\t\t].includes( sidebar );\n\t\t\tlet _tabName = sidebar;\n\t\t\tif ( ! _isEditorSidebarOpened ) {\n\t\t\t\t_tabName = !! select(\n\t\t\t\t\tblockEditorStore\n\t\t\t\t).getBlockSelectionStart()\n\t\t\t\t\t? 'edit-post/block'\n\t\t\t\t\t: 'edit-post/document';\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttabName: _tabName,\n\t\t\t\tsupportsGlobalStyles:\n\t\t\t\t\tselect( coreStore ).getCurrentTheme()?.is_block_theme,\n\t\t\t\tisEditingPage: select( editSiteStore ).isPage(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\n\t// `newSelectedTabId` could technically be falsey if no tab is selected (i.e.\n\t// the initial render) or when we don't want a tab displayed (i.e. the\n\t// sidebar is closed). These cases should both be covered by the `!!` check\n\t// below, so we shouldn't need any additional falsey handling.\n\tconst onTabSelect = useCallback(\n\t\t( newSelectedTabId ) => {\n\t\t\tif ( !! newSelectedTabId ) {\n\t\t\t\tenableComplementaryArea( 'core', newSelectedTabId );\n\t\t\t}\n\t\t},\n\t\t[ enableComplementaryArea ]\n\t);\n\n\treturn (\n\t\t<Tabs\n\t\t\tselectedTabId={ tabName }\n\t\t\tonSelect={ onTabSelect }\n\t\t\tselectOnMove={ false }\n\t\t>\n\t\t\t<FillContents\n\t\t\t\ttabName={ tabName }\n\t\t\t\tisEditingPage={ isEditingPage }\n\t\t\t\tsupportsGlobalStyles={ supportsGlobalStyles }\n\t\t\t/>\n\t\t</Tabs>\n\t);\n}\n"],"mappings":";;;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAIA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AAWA,IAAAQ,eAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,oBAAA,GAAAD,sBAAA,CAAAT,OAAA;AACA,IAAAW,eAAA,GAAAF,sBAAA,CAAAT,OAAA;AACA,IAAAY,WAAA,GAAAH,sBAAA,CAAAT,OAAA;AACA,IAAAa,cAAA,GAAAJ,sBAAA,CAAAT,OAAA;AACA,IAAAc,MAAA,GAAAd,OAAA;AACA,IAAAe,WAAA,GAAAf,OAAA;AA9BA;AACA;AACA;;AAmBA;AACA;AACA;;AASA,MAAM;EAAEgB;AAAK,CAAC,GAAG,IAAAC,kBAAM,EAAEC,uBAAsB,CAAC;AAChD,MAAM;EAAEC,cAAc;EAAEC,2BAA2B;EAAEC;AAAsB,CAAC,GAC3E,IAAAJ,kBAAM,EAAEK,mBAAkB,CAAC;AAC5B,MAAM;EAAEC,IAAI,EAAEC,aAAa;EAAEC,IAAI,EAAEC;AA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,IAAM;IACvB,IAAK,CAAC,CAAEA,gBAAgB,EAAG;MAC1BJ,uBAAuB,CAAE,MAAM,EAAEI,gBAAiB,CAAC;IACpD;EACD,CAAC,EACD,CAAEJ,uBAAuB,CAC1B,CAAC;EAED,OACC,IAAA1C,MAAA,CAAAC,aAAA,EAACxC,IAAI;IACJsF,aAAa,EAAGvE,OAAS;IACzBwE,QAAQ,EAAGJ,WAAa;IACxBK,YAAY,EAAG;EAAO,GAEtB,IAAAjD,MAAA,CAAAC,aAAA,EAAC1B,YAAY;IACZC,OAAO,EAAGA,OAAS;IACnBC,aAAa,EAAGA,aAAe;IAC/BC,oBAAoB,EAAGA;EAAsB,CAC7C,CACI,CAAC;AAET","ignoreList":[]}
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = PagePanels;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _components = require("@wordpress/components");
|
|
10
|
-
var _i18n = require("@wordpress/i18n");
|
|
11
|
-
var _data = require("@wordpress/data");
|
|
12
|
-
var _coreData = require("@wordpress/core-data");
|
|
13
|
-
var _editor = require("@wordpress/editor");
|
|
14
|
-
var _router = require("@wordpress/router");
|
|
15
|
-
var _element = require("@wordpress/element");
|
|
16
|
-
var _notices = require("@wordpress/notices");
|
|
17
|
-
var _store = require("../../../store");
|
|
18
|
-
var _pageContent = _interopRequireDefault(require("./page-content"));
|
|
19
|
-
var _pageSummary = _interopRequireDefault(require("./page-summary"));
|
|
20
|
-
var _lockUnlock = require("../../../lock-unlock");
|
|
21
|
-
/**
|
|
22
|
-
* WordPress dependencies
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Internal dependencies
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
const {
|
|
30
|
-
PostCardPanel,
|
|
31
|
-
PostActions
|
|
32
|
-
} = (0, _lockUnlock.unlock)(_editor.privateApis);
|
|
33
|
-
const {
|
|
34
|
-
useHistory
|
|
35
|
-
} = (0, _lockUnlock.unlock)(_router.privateApis);
|
|
36
|
-
function PagePanels() {
|
|
37
|
-
const {
|
|
38
|
-
id,
|
|
39
|
-
type,
|
|
40
|
-
hasResolved,
|
|
41
|
-
status,
|
|
42
|
-
date,
|
|
43
|
-
password,
|
|
44
|
-
renderingMode
|
|
45
|
-
} = (0, _data.useSelect)(select => {
|
|
46
|
-
const {
|
|
47
|
-
getEditedPostContext
|
|
48
|
-
} = select(_store.store);
|
|
49
|
-
const {
|
|
50
|
-
getEditedEntityRecord,
|
|
51
|
-
hasFinishedResolution
|
|
52
|
-
} = select(_coreData.store);
|
|
53
|
-
const {
|
|
54
|
-
getRenderingMode
|
|
55
|
-
} = select(_editor.store);
|
|
56
|
-
const context = getEditedPostContext();
|
|
57
|
-
const queryArgs = ['postType', context.postType, context.postId];
|
|
58
|
-
const page = getEditedEntityRecord(...queryArgs);
|
|
59
|
-
return {
|
|
60
|
-
hasResolved: hasFinishedResolution('getEditedEntityRecord', queryArgs),
|
|
61
|
-
id: page?.id,
|
|
62
|
-
type: page?.type,
|
|
63
|
-
status: page?.status,
|
|
64
|
-
date: page?.date,
|
|
65
|
-
password: page?.password,
|
|
66
|
-
renderingMode: getRenderingMode()
|
|
67
|
-
};
|
|
68
|
-
}, []);
|
|
69
|
-
const {
|
|
70
|
-
createSuccessNotice
|
|
71
|
-
} = (0, _data.useDispatch)(_notices.store);
|
|
72
|
-
const history = useHistory();
|
|
73
|
-
const onActionPerformed = (0, _element.useCallback)((actionId, items) => {
|
|
74
|
-
switch (actionId) {
|
|
75
|
-
case 'move-to-trash':
|
|
76
|
-
{
|
|
77
|
-
history.push({
|
|
78
|
-
path: '/' + items[0].type,
|
|
79
|
-
postId: undefined,
|
|
80
|
-
postType: undefined,
|
|
81
|
-
canvas: 'view'
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
break;
|
|
85
|
-
case 'duplicate-post':
|
|
86
|
-
{
|
|
87
|
-
const newItem = items[0];
|
|
88
|
-
const title = typeof newItem.title === 'string' ? newItem.title : newItem.title?.rendered;
|
|
89
|
-
createSuccessNotice((0, _i18n.sprintf)(
|
|
90
|
-
// translators: %s: Title of the created post e.g: "Post 1".
|
|
91
|
-
(0, _i18n.__)('"%s" successfully created.'), title), {
|
|
92
|
-
type: 'snackbar',
|
|
93
|
-
id: 'duplicate-post-action',
|
|
94
|
-
actions: [{
|
|
95
|
-
label: (0, _i18n.__)('Edit'),
|
|
96
|
-
onClick: () => {
|
|
97
|
-
history.push({
|
|
98
|
-
path: undefined,
|
|
99
|
-
postId: newItem.id,
|
|
100
|
-
postType: newItem.type,
|
|
101
|
-
canvas: 'edit'
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
}]
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
break;
|
|
108
|
-
}
|
|
109
|
-
}, [history, createSuccessNotice]);
|
|
110
|
-
if (!hasResolved) {
|
|
111
|
-
return null;
|
|
112
|
-
}
|
|
113
|
-
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(PostCardPanel, {
|
|
114
|
-
actions: (0, _react.createElement)(PostActions, {
|
|
115
|
-
onActionPerformed: onActionPerformed
|
|
116
|
-
})
|
|
117
|
-
}), (0, _react.createElement)(_components.PanelBody, {
|
|
118
|
-
title: (0, _i18n.__)('Summary')
|
|
119
|
-
}, (0, _react.createElement)(_pageSummary.default, {
|
|
120
|
-
status: status,
|
|
121
|
-
date: date,
|
|
122
|
-
password: password,
|
|
123
|
-
postId: id,
|
|
124
|
-
postType: type
|
|
125
|
-
})), (0, _react.createElement)(_editor.PluginDocumentSettingPanel.Slot, null), renderingMode !== 'post-only' && (0, _react.createElement)(_components.PanelBody, {
|
|
126
|
-
title: (0, _i18n.__)('Content')
|
|
127
|
-
}, (0, _react.createElement)(_pageContent.default, null)));
|
|
128
|
-
}
|
|
129
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_components","require","_i18n","_data","_coreData","_editor","_router","_element","_notices","_store","_pageContent","_interopRequireDefault","_pageSummary","_lockUnlock","PostCardPanel","PostActions","unlock","editorPrivateApis","useHistory","routerPrivateApis","PagePanels","id","type","hasResolved","status","date","password","renderingMode","useSelect","select","getEditedPostContext","editSiteStore","getEditedEntityRecord","hasFinishedResolution","coreStore","getRenderingMode","editorStore","context","queryArgs","postType","postId","page","createSuccessNotice","useDispatch","noticesStore","history","onActionPerformed","useCallback","actionId","items","push","path","undefined","canvas","newItem","title","rendered","sprintf","__","actions","label","onClick","_react","createElement","Fragment","PanelBody","default","PluginDocumentSettingPanel","Slot"],"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/page-panels/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PanelBody } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tPluginDocumentSettingPanel,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useCallback } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../../store';\nimport PageContent from './page-content';\nimport PageSummary from './page-summary';\n\nimport { unlock } from '../../../lock-unlock';\n\nconst { PostCardPanel, PostActions } = unlock( editorPrivateApis );\nconst { useHistory } = unlock( routerPrivateApis );\n\nexport default function PagePanels() {\n\tconst { id, type, hasResolved, status, date, password, renderingMode } =\n\t\tuseSelect( ( select ) => {\n\t\t\tconst { getEditedPostContext } = select( editSiteStore );\n\t\t\tconst { getEditedEntityRecord, hasFinishedResolution } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst { getRenderingMode } = select( editorStore );\n\t\t\tconst context = getEditedPostContext();\n\t\t\tconst queryArgs = [ 'postType', context.postType, context.postId ];\n\t\t\tconst page = getEditedEntityRecord( ...queryArgs );\n\t\t\treturn {\n\t\t\t\thasResolved: hasFinishedResolution(\n\t\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t\tqueryArgs\n\t\t\t\t),\n\t\t\t\tid: page?.id,\n\t\t\t\ttype: page?.type,\n\t\t\t\tstatus: page?.status,\n\t\t\t\tdate: page?.date,\n\t\t\t\tpassword: page?.password,\n\t\t\t\trenderingMode: getRenderingMode(),\n\t\t\t};\n\t\t}, [] );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\tconst history = useHistory();\n\tconst onActionPerformed = useCallback(\n\t\t( actionId, items ) => {\n\t\t\tswitch ( actionId ) {\n\t\t\t\tcase 'move-to-trash':\n\t\t\t\t\t{\n\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\tpath: '/' + items[ 0 ].type,\n\t\t\t\t\t\t\tpostId: undefined,\n\t\t\t\t\t\t\tpostType: undefined,\n\t\t\t\t\t\t\tcanvas: 'view',\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'duplicate-post':\n\t\t\t\t\t{\n\t\t\t\t\t\tconst newItem = items[ 0 ];\n\t\t\t\t\t\tconst title =\n\t\t\t\t\t\t\ttypeof newItem.title === 'string'\n\t\t\t\t\t\t\t\t? newItem.title\n\t\t\t\t\t\t\t\t: newItem.title?.rendered;\n\t\t\t\t\t\tcreateSuccessNotice(\n\t\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Title of the created post e.g: \"Post 1\".\n\t\t\t\t\t\t\t\t__( '\"%s\" successfully created.' ),\n\t\t\t\t\t\t\t\ttitle\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\t\tid: 'duplicate-post-action',\n\t\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'Edit' ),\n\t\t\t\t\t\t\t\t\t\tonClick: () => {\n\t\t\t\t\t\t\t\t\t\t\thistory.push( {\n\t\t\t\t\t\t\t\t\t\t\t\tpath: undefined,\n\t\t\t\t\t\t\t\t\t\t\t\tpostId: newItem.id,\n\t\t\t\t\t\t\t\t\t\t\t\tpostType: newItem.type,\n\t\t\t\t\t\t\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\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}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t},\n\t\t[ history, createSuccessNotice ]\n\t);\n\n\tif ( ! hasResolved ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<PostCardPanel\n\t\t\t\tactions={\n\t\t\t\t\t<PostActions onActionPerformed={ onActionPerformed } />\n\t\t\t\t}\n\t\t\t/>\n\t\t\t<PanelBody title={ __( 'Summary' ) }>\n\t\t\t\t<PageSummary\n\t\t\t\t\tstatus={ status }\n\t\t\t\t\tdate={ date }\n\t\t\t\t\tpassword={ password }\n\t\t\t\t\tpostId={ id }\n\t\t\t\t\tpostType={ type }\n\t\t\t\t/>\n\t\t\t</PanelBody>\n\t\t\t<PluginDocumentSettingPanel.Slot />\n\t\t\t{ renderingMode !== 'post-only' && (\n\t\t\t\t<PanelBody title={ __( 'Content' ) }>\n\t\t\t\t\t<PageContent />\n\t\t\t\t</PanelBody>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA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perty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = PageContent;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _data = require("@wordpress/data");
|
|
9
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
10
|
-
var _lockUnlock = require("../../../lock-unlock");
|
|
11
|
-
/**
|
|
12
|
-
* WordPress dependencies
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Internal dependencies
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
const {
|
|
20
|
-
BlockQuickNavigation
|
|
21
|
-
} = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
|
|
22
|
-
const PAGE_CONTENT_BLOCKS = ['core/post-content', 'core/post-featured-image', 'core/post-title'];
|
|
23
|
-
function PageContent() {
|
|
24
|
-
const clientIds = (0, _data.useSelect)(select => {
|
|
25
|
-
const {
|
|
26
|
-
getBlocksByName
|
|
27
|
-
} = select(_blockEditor.store);
|
|
28
|
-
return getBlocksByName(PAGE_CONTENT_BLOCKS);
|
|
29
|
-
}, []);
|
|
30
|
-
return (0, _react.createElement)(BlockQuickNavigation, {
|
|
31
|
-
clientIds: clientIds
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=page-content.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_data","require","_blockEditor","_lockUnlock","BlockQuickNavigation","unlock","blockEditorPrivateApis","PAGE_CONTENT_BLOCKS","PageContent","clientIds","useSelect","select","getBlocksByName","blockEditorStore","_react","createElement"],"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/page-panels/page-content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst { BlockQuickNavigation } = unlock( blockEditorPrivateApis );\n\nconst PAGE_CONTENT_BLOCKS = [\n\t'core/post-content',\n\t'core/post-featured-image',\n\t'core/post-title',\n];\n\nexport default function PageContent() {\n\tconst clientIds = useSelect( ( select ) => {\n\t\tconst { getBlocksByName } = select( blockEditorStore );\n\t\treturn getBlocksByName( PAGE_CONTENT_BLOCKS );\n\t}, [] );\n\treturn <BlockQuickNavigation clientIds={ clientIds } />;\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAQA,IAAAE,WAAA,GAAAF,OAAA;AAZA;AACA;AACA;;AAOA;AACA;AACA;;AAGA,MAAM;EAAEG;AAAqB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAEjE,MAAMC,mBAAmB,GAAG,CAC3B,mBAAmB,EACnB,0BAA0B,EAC1B,iBAAiB,CACjB;AAEc,SAASC,WAAWA,CAAA,EAAG;EACrC,MAAMC,SAAS,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC1C,MAAM;MAAEC;IAAgB,CAAC,GAAGD,MAAM,CAAEE,kBAAiB,CAAC;IACtD,OAAOD,eAAe,CAAEL,mBAAoB,CAAC;EAC9C,CAAC,EAAE,EAAG,CAAC;EACP,OAAO,IAAAO,MAAA,CAAAC,aAAA,EAACX,oBAAoB;IAACK,SAAS,EAAGA;EAAW,CAAE,CAAC;AACxD","ignoreList":[]}
|