@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
package/build/utils/math.js
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.computeIFrameScale = computeIFrameScale;
|
|
7
|
-
/**
|
|
8
|
-
* @typedef {Object} WPPoint
|
|
9
|
-
* @property {number} x The horizontal coordinate.
|
|
10
|
-
* @property {number} y The vertical coordinate.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Clamps a value to a range. Uses the CSS `clamp()` ordering for arguments.
|
|
15
|
-
*
|
|
16
|
-
* @param {number} min Minimum range.
|
|
17
|
-
* @param {number} value Value to clamp.
|
|
18
|
-
* @param {number} max Maximum range.
|
|
19
|
-
*
|
|
20
|
-
* @return {number} Clamped value.
|
|
21
|
-
*/
|
|
22
|
-
function clamp(min, value, max) {
|
|
23
|
-
return Math.max(min, Math.min(value, max));
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Evaluates a linear function passing through two points at the given x value.
|
|
28
|
-
*
|
|
29
|
-
* Example:
|
|
30
|
-
* f(x)
|
|
31
|
-
* │ ╲
|
|
32
|
-
* │ * (p0)
|
|
33
|
-
* │ ╲
|
|
34
|
-
* │ ╲
|
|
35
|
-
* │ (p1) *
|
|
36
|
-
* │ ╲
|
|
37
|
-
* └──────────── x
|
|
38
|
-
*
|
|
39
|
-
* @param {WPPoint} p0 First point.
|
|
40
|
-
* @param {WPPoint} p1 Second point.
|
|
41
|
-
* @param {number} x Value to evaluate at.
|
|
42
|
-
*
|
|
43
|
-
* @return {number} Result of the two-point linear function at x.
|
|
44
|
-
*/
|
|
45
|
-
function twoPointLinearFn(p0, p1, x) {
|
|
46
|
-
return (p1.y - p0.y) / (p1.x - p0.x) * (x - p0.x) + p0.y;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Evaluates a two-point linear function at a given x value, clamped to the range of the points.
|
|
51
|
-
*
|
|
52
|
-
* Example:
|
|
53
|
-
* f(x)
|
|
54
|
-
* │ ───* (p0)
|
|
55
|
-
* │ ╲
|
|
56
|
-
* │ ╲
|
|
57
|
-
* │ (p1) *───
|
|
58
|
-
* └──────────── x
|
|
59
|
-
*
|
|
60
|
-
* @param {WPPoint} p0 First point.
|
|
61
|
-
* @param {WPPoint} p1 Second point.
|
|
62
|
-
* @param {number} x Value to evaluate at.
|
|
63
|
-
*
|
|
64
|
-
* @return {number} Result of the two-point linear function clamped to the range of the points.
|
|
65
|
-
*/
|
|
66
|
-
function clampedTwoPointLinearFn(p0, p1, x) {
|
|
67
|
-
return clamp(Math.min(p0.y, p1.y), twoPointLinearFn(p0, p1, x), Math.max(p0.y, p1.y));
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Computes the iframe scale using a start and end width/scale pair and the current width.
|
|
72
|
-
*
|
|
73
|
-
* The scale is clamped outside the points and is linearly interpolated between.
|
|
74
|
-
*
|
|
75
|
-
* Example:
|
|
76
|
-
* scale
|
|
77
|
-
* │ ───* (start)
|
|
78
|
-
* │ ╲
|
|
79
|
-
* │ ╲
|
|
80
|
-
* │ (end) *───
|
|
81
|
-
* └──────────── width
|
|
82
|
-
*
|
|
83
|
-
* @param {Object} start First width and scale pair.
|
|
84
|
-
* @param {Object} end Second width and scale pair.
|
|
85
|
-
* @param {number} currentWidth Current width.
|
|
86
|
-
*
|
|
87
|
-
* @return {number} The scale of the current width between the two points.
|
|
88
|
-
*/
|
|
89
|
-
function computeIFrameScale(start, end, currentWidth) {
|
|
90
|
-
return clampedTwoPointLinearFn({
|
|
91
|
-
x: start.width,
|
|
92
|
-
y: start.scale
|
|
93
|
-
}, {
|
|
94
|
-
x: end.width,
|
|
95
|
-
y: end.scale
|
|
96
|
-
}, currentWidth);
|
|
97
|
-
}
|
|
98
|
-
//# sourceMappingURL=math.js.map
|
package/build/utils/math.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["clamp","min","value","max","Math","twoPointLinearFn","p0","p1","x","y","clampedTwoPointLinearFn","computeIFrameScale","start","end","currentWidth","width","scale"],"sources":["@wordpress/edit-site/src/utils/math.js"],"sourcesContent":["/**\n * @typedef {Object} WPPoint\n * @property {number} x The horizontal coordinate.\n * @property {number} y The vertical coordinate.\n */\n\n/**\n * Clamps a value to a range. Uses the CSS `clamp()` ordering for arguments.\n *\n * @param {number} min Minimum range.\n * @param {number} value Value to clamp.\n * @param {number} max Maximum range.\n *\n * @return {number} Clamped value.\n */\nfunction clamp( min, value, max ) {\n\treturn Math.max( min, Math.min( value, max ) );\n}\n\n/**\n * Evaluates a linear function passing through two points at the given x value.\n *\n * Example:\n * f(x)\n * │ ╲\n * │ * (p0)\n * │ ╲\n * │ ╲\n * │ (p1) *\n * │ ╲\n * └──────────── x\n *\n * @param {WPPoint} p0 First point.\n * @param {WPPoint} p1 Second point.\n * @param {number} x Value to evaluate at.\n *\n * @return {number} Result of the two-point linear function at x.\n */\nfunction twoPointLinearFn( p0, p1, x ) {\n\treturn ( ( p1.y - p0.y ) / ( p1.x - p0.x ) ) * ( x - p0.x ) + p0.y;\n}\n\n/**\n * Evaluates a two-point linear function at a given x value, clamped to the range of the points.\n *\n * Example:\n * f(x)\n * │ ───* (p0)\n * │ ╲\n * │ ╲\n * │ (p1) *───\n * └──────────── x\n *\n * @param {WPPoint} p0 First point.\n * @param {WPPoint} p1 Second point.\n * @param {number} x Value to evaluate at.\n *\n * @return {number} Result of the two-point linear function clamped to the range of the points.\n */\nfunction clampedTwoPointLinearFn( p0, p1, x ) {\n\treturn clamp(\n\t\tMath.min( p0.y, p1.y ),\n\t\ttwoPointLinearFn( p0, p1, x ),\n\t\tMath.max( p0.y, p1.y )\n\t);\n}\n\n/**\n * Computes the iframe scale using a start and end width/scale pair and the current width.\n *\n * The scale is clamped outside the points and is linearly interpolated between.\n *\n * Example:\n * scale\n * │ ───* (start)\n * │ ╲\n * │ ╲\n * │ (end) *───\n * └──────────── width\n *\n * @param {Object} start First width and scale pair.\n * @param {Object} end Second width and scale pair.\n * @param {number} currentWidth Current width.\n *\n * @return {number} The scale of the current width between the two points.\n */\nexport function computeIFrameScale( start, end, currentWidth ) {\n\treturn clampedTwoPointLinearFn(\n\t\t{ x: start.width, y: start.scale },\n\t\t{ x: end.width, y: end.scale },\n\t\tcurrentWidth\n\t);\n}\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASA,KAAKA,CAAEC,GAAG,EAAEC,KAAK,EAAEC,GAAG,EAAG;EACjC,OAAOC,IAAI,CAACD,GAAG,CAAEF,GAAG,EAAEG,IAAI,CAACH,GAAG,CAAEC,K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
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* External dependencies
|
|
4
|
-
*/
|
|
5
|
-
import deepmerge from 'deepmerge';
|
|
6
|
-
import { isPlainObject } from 'is-plain-object';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* WordPress dependencies
|
|
10
|
-
*/
|
|
11
|
-
import { useMemo, useCallback } from '@wordpress/element';
|
|
12
|
-
import { useSelect, useDispatch } from '@wordpress/data';
|
|
13
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
14
|
-
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Internal dependencies
|
|
18
|
-
*/
|
|
19
|
-
import { unlock } from '../../lock-unlock';
|
|
20
|
-
const {
|
|
21
|
-
GlobalStylesContext,
|
|
22
|
-
cleanEmptyObject
|
|
23
|
-
} = unlock(blockEditorPrivateApis);
|
|
24
|
-
export function mergeBaseAndUserConfigs(base, user) {
|
|
25
|
-
return deepmerge(base, user, {
|
|
26
|
-
// We only pass as arrays the presets,
|
|
27
|
-
// in which case we want the new array of values
|
|
28
|
-
// to override the old array (no merging).
|
|
29
|
-
isMergeableObject: isPlainObject
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
function useGlobalStylesUserConfig() {
|
|
33
|
-
const {
|
|
34
|
-
globalStylesId,
|
|
35
|
-
isReady,
|
|
36
|
-
settings,
|
|
37
|
-
styles
|
|
38
|
-
} = useSelect(select => {
|
|
39
|
-
const {
|
|
40
|
-
getEditedEntityRecord,
|
|
41
|
-
hasFinishedResolution
|
|
42
|
-
} = select(coreStore);
|
|
43
|
-
const _globalStylesId = select(coreStore).__experimentalGetCurrentGlobalStylesId();
|
|
44
|
-
const record = _globalStylesId ? getEditedEntityRecord('root', 'globalStyles', _globalStylesId) : undefined;
|
|
45
|
-
let hasResolved = false;
|
|
46
|
-
if (hasFinishedResolution('__experimentalGetCurrentGlobalStylesId')) {
|
|
47
|
-
hasResolved = _globalStylesId ? hasFinishedResolution('getEditedEntityRecord', ['root', 'globalStyles', _globalStylesId]) : true;
|
|
48
|
-
}
|
|
49
|
-
return {
|
|
50
|
-
globalStylesId: _globalStylesId,
|
|
51
|
-
isReady: hasResolved,
|
|
52
|
-
settings: record?.settings,
|
|
53
|
-
styles: record?.styles
|
|
54
|
-
};
|
|
55
|
-
}, []);
|
|
56
|
-
const {
|
|
57
|
-
getEditedEntityRecord
|
|
58
|
-
} = useSelect(coreStore);
|
|
59
|
-
const {
|
|
60
|
-
editEntityRecord
|
|
61
|
-
} = useDispatch(coreStore);
|
|
62
|
-
const config = useMemo(() => {
|
|
63
|
-
return {
|
|
64
|
-
settings: settings !== null && settings !== void 0 ? settings : {},
|
|
65
|
-
styles: styles !== null && styles !== void 0 ? styles : {}
|
|
66
|
-
};
|
|
67
|
-
}, [settings, styles]);
|
|
68
|
-
const setConfig = useCallback((callback, options = {}) => {
|
|
69
|
-
var _record$styles, _record$settings;
|
|
70
|
-
const record = getEditedEntityRecord('root', 'globalStyles', globalStylesId);
|
|
71
|
-
const currentConfig = {
|
|
72
|
-
styles: (_record$styles = record?.styles) !== null && _record$styles !== void 0 ? _record$styles : {},
|
|
73
|
-
settings: (_record$settings = record?.settings) !== null && _record$settings !== void 0 ? _record$settings : {}
|
|
74
|
-
};
|
|
75
|
-
const updatedConfig = callback(currentConfig);
|
|
76
|
-
editEntityRecord('root', 'globalStyles', globalStylesId, {
|
|
77
|
-
styles: cleanEmptyObject(updatedConfig.styles) || {},
|
|
78
|
-
settings: cleanEmptyObject(updatedConfig.settings) || {}
|
|
79
|
-
}, options);
|
|
80
|
-
}, [globalStylesId]);
|
|
81
|
-
return [isReady, config, setConfig];
|
|
82
|
-
}
|
|
83
|
-
function useGlobalStylesBaseConfig() {
|
|
84
|
-
const baseConfig = useSelect(select => {
|
|
85
|
-
return select(coreStore).__experimentalGetCurrentThemeBaseGlobalStyles();
|
|
86
|
-
}, []);
|
|
87
|
-
return [!!baseConfig, baseConfig];
|
|
88
|
-
}
|
|
89
|
-
function useGlobalStylesContext() {
|
|
90
|
-
const [isUserConfigReady, userConfig, setUserConfig] = useGlobalStylesUserConfig();
|
|
91
|
-
const [isBaseConfigReady, baseConfig] = useGlobalStylesBaseConfig();
|
|
92
|
-
const mergedConfig = useMemo(() => {
|
|
93
|
-
if (!baseConfig || !userConfig) {
|
|
94
|
-
return {};
|
|
95
|
-
}
|
|
96
|
-
return mergeBaseAndUserConfigs(baseConfig, userConfig);
|
|
97
|
-
}, [userConfig, baseConfig]);
|
|
98
|
-
const context = useMemo(() => {
|
|
99
|
-
return {
|
|
100
|
-
isReady: isUserConfigReady && isBaseConfigReady,
|
|
101
|
-
user: userConfig,
|
|
102
|
-
base: baseConfig,
|
|
103
|
-
merged: mergedConfig,
|
|
104
|
-
setUserConfig
|
|
105
|
-
};
|
|
106
|
-
}, [mergedConfig, userConfig, baseConfig, setUserConfig, isUserConfigReady, isBaseConfigReady]);
|
|
107
|
-
return context;
|
|
108
|
-
}
|
|
109
|
-
export function GlobalStylesProvider({
|
|
110
|
-
children
|
|
111
|
-
}) {
|
|
112
|
-
const context = useGlobalStylesContext();
|
|
113
|
-
if (!context.isReady) {
|
|
114
|
-
return null;
|
|
115
|
-
}
|
|
116
|
-
return createElement(GlobalStylesContext.Provider, {
|
|
117
|
-
value: context
|
|
118
|
-
}, children);
|
|
119
|
-
}
|
|
120
|
-
//# sourceMappingURL=global-styles-provider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["deepmerge","isPlainObject","useMemo","useCallback","useSelect","useDispatch","store","coreStore","privateApis","blockEditorPrivateApis","unlock","GlobalStylesContext","cleanEmptyObject","mergeBaseAndUserConfigs","base","user","isMergeableObject","useGlobalStylesUserConfig","globalStylesId","isReady","settings","styles","select","getEditedEntityRecord","hasFinishedResolution","_globalStylesId","__experimentalGetCurrentGlobalStylesId","record","undefined","hasResolved","editEntityRecord","config","setConfig","callback","options","_record$styles","_record$settings","currentConfig","updatedConfig","useGlobalStylesBaseConfig","baseConfig","__experimentalGetCurrentThemeBaseGlobalStyles","useGlobalStylesContext","isUserConfigReady","userConfig","setUserConfig","isBaseConfigReady","mergedConfig","context","merged","GlobalStylesProvider","children","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":";AAAA;AACA;AACA;AACA,OAAOA,SAAS,MAAM,WAAW;AACjC,SAASC,aAAa,QAAQ,iBAAiB;;AAE/C;AACA;AACA;AACA,SAASC,OAAO,EAAEC,WAAW,QAAQ,oBAAoB;AACzD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,WAAW,IAAIC,sBAAsB,QAAQ,yBAAyB;;AAE/E;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC,mBAAmB;EAAEC;AAAiB,CAAC,GAAGF,MAAM,CACvDD,sBACD,CAAC;AAED,OAAO,SAASI,uBAAuBA,CAAEC,IAAI,EAAEC,IAAI,EAAG;EACrD,OAAOf,SAAS,CAAEc,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AC,CAAC;EAC5B,MAAM,CAAE6B,iBAAiB,EAAEN,UAAU,CAAE,GAAGD,yBAAyB,CAAC,CAAC;EACrE,MAAMQ,YAAY,GAAG7C,OAAO,CAAE,MAAM;IACnC,IAAK,CAAEsC,UAAU,IAAI,CAAEI,UAAU,EAAG;MACnC,OAAO,CAAC,CAAC;IACV;IACA,OAAO/B,uBAAuB,CAAE2B,UAAU,EAAEI,UAAW,CAAC;EACzD,CAAC,EAAE,CAAEA,UAAU,EAAEJ,UAAU,CAAG,CAAC;EAC/B,MAAMQ,OAAO,GAAG9C,OAAO,CAAE,MAAM;IAC9B,OAAO;MACNiB,OAAO,EAAEwB,iBAAiB,IAAIG,iBAAiB;MAC/C/B,IAAI,EAAE6B,UAAU;MAChB9B,IAAI,EAAE0B,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;AAEA,OAAO,SAASE,oBAAoBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EACpD,MAAMH,OAAO,GAAGN,sBAAsB,CAAC,CAAC;EACxC,IAAK,CAAEM,OAAO,CAAC7B,OAAO,EAAG;IACxB,OAAO,IAAI;EACZ;EAEA,OACCiC,aAAA,CAACzC,mBAAmB,CAAC0C,QAAQ;IAACC,KAAK,EAAGN;EAAS,GAC5CG,QAC2B,CAAC;AAEjC","ignoreList":[]}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { useViewportMatch } from '@wordpress/compose';
|
|
6
|
-
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
7
|
-
import { useSelect, useDispatch } from '@wordpress/data';
|
|
8
|
-
import { __ } from '@wordpress/i18n';
|
|
9
|
-
import { chevronUpDown } from '@wordpress/icons';
|
|
10
|
-
import { Button, ToolbarItem } from '@wordpress/components';
|
|
11
|
-
import { store as editorStore, privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Internal dependencies
|
|
15
|
-
*/
|
|
16
|
-
import { unlock } from '../../../lock-unlock';
|
|
17
|
-
const {
|
|
18
|
-
DocumentTools: EditorDocumentTools
|
|
19
|
-
} = unlock(editorPrivateApis);
|
|
20
|
-
export default function DocumentTools({
|
|
21
|
-
blockEditorMode,
|
|
22
|
-
hasFixedToolbar,
|
|
23
|
-
isDistractionFree
|
|
24
|
-
}) {
|
|
25
|
-
const {
|
|
26
|
-
isVisualMode
|
|
27
|
-
} = useSelect(select => {
|
|
28
|
-
const {
|
|
29
|
-
getEditorMode
|
|
30
|
-
} = select(editorStore);
|
|
31
|
-
return {
|
|
32
|
-
isVisualMode: getEditorMode() === 'visual'
|
|
33
|
-
};
|
|
34
|
-
}, []);
|
|
35
|
-
const {
|
|
36
|
-
__unstableSetEditorMode
|
|
37
|
-
} = useDispatch(blockEditorStore);
|
|
38
|
-
const {
|
|
39
|
-
setDeviceType
|
|
40
|
-
} = useDispatch(editorStore);
|
|
41
|
-
const isLargeViewport = useViewportMatch('medium');
|
|
42
|
-
const isZoomedOutViewExperimentEnabled = window?.__experimentalEnableZoomedOutView && isVisualMode;
|
|
43
|
-
const isZoomedOutView = blockEditorMode === 'zoom-out';
|
|
44
|
-
return createElement(EditorDocumentTools, {
|
|
45
|
-
disableBlockTools: !isVisualMode,
|
|
46
|
-
listViewLabel: __('List View')
|
|
47
|
-
}, isZoomedOutViewExperimentEnabled && isLargeViewport && !isDistractionFree && !hasFixedToolbar && createElement(ToolbarItem, {
|
|
48
|
-
as: Button,
|
|
49
|
-
className: "edit-site-header-edit-mode__zoom-out-view-toggle",
|
|
50
|
-
icon: chevronUpDown,
|
|
51
|
-
isPressed: isZoomedOutView
|
|
52
|
-
/* translators: button label text should, if possible, be under 16 characters. */,
|
|
53
|
-
label: __('Zoom-out View'),
|
|
54
|
-
onClick: () => {
|
|
55
|
-
setDeviceType('Desktop');
|
|
56
|
-
__unstableSetEditorMode(isZoomedOutView ? 'edit' : 'zoom-out');
|
|
57
|
-
},
|
|
58
|
-
size: "compact"
|
|
59
|
-
}));
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useViewportMatch","store","blockEditorStore","useSelect","useDispatch","__","chevronUpDown","Button","ToolbarItem","editorStore","privateApis","editorPrivateApis","unlock","DocumentTools","EditorDocumentTools","blockEditorMode","hasFixedToolbar","isDistractionFree","isVisualMode","select","getEditorMode","__unstableSetEditorMode","setDeviceType","isLargeViewport","isZoomedOutViewExperimentEnabled","window","__experimentalEnableZoomedOutView","isZoomedOutView","createElement","disableBlockTools","listViewLabel","as","className","icon","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":";AAAA;AACA;AACA;AACA,SAASA,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,MAAM,EAAEC,WAAW,QAAQ,uBAAuB;AAC3D,SACCP,KAAK,IAAIQ,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BAAuB,CACtBM,eAAe,GAAG,MAAM,GAAG,UAC5B,CAAC;IACF,CAAG;IACHU,IAAI,EAAC;EAAS,CACd,CAEiB,CAAC;AAExB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["privateApis","editorPrivateApis","unlock","ComplementaryArea","ComplementaryAreaMoreMenuItem","DefaultSidebar","className","identifier","title","icon","children","closeLabel","header","headerClassName","panelClassName","isActiveByDefault","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":";AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAM;EAAEC,iBAAiB;EAAEC;AAA8B,CAAC,GACzDF,MAAM,CAAED,iBAAkB,CAAC;AAE5B,eAAe,SAASI,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,OACCC,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACb,iBAAiB;IACjBG,SAAS,EAAGA,SAAW;IACvBY,KAAK,EAAC,MAAM;IACZX,UAAU,EAAGA,UAAY;IACzBC,KAAK,EAAGA,KAAO;IACfW,gBAAgB,EAAGX,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,EACpBM,aAAA,CAACZ,6BAA6B;IAC7Bc,KAAK,EAAC,MAAM;IACZX,UAAU,EAAGA,UAAY;IACzBE,IAAI,EAAGA;EAAM,GAEXD,KAC4B,CAC9B,CAAC;AAEL","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["FlexItem","FlexBlock","Flex","Button","__experimentalUseNavigator","useNavigator","__","styles","seen","backup","useSelect","useDispatch","useEffect","store","preferencesStore","editorStore","privateApis","editorPrivateApis","DefaultSidebar","GlobalStylesUI","editSiteStore","GlobalStylesMenuSlot","unlock","coreStore","interfaceStore","GlobalStylesSidebar","shouldClearCanvasContainerView","isStyleBookOpened","showListViewByDefault","hasRevisions","isRevisionsOpened","isRevisionsStyleBookOpened","select","getActiveComplementaryArea","getEditorCanvasContainerView","getCanvasMode","canvasContainerView","_isVisualEditorMode","getEditorMode","_isEditCanvasMode","_showListViewByDefault","get","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","count","setEditorCanvasContainerView","setIsListViewOpened","goTo","toggleRevisions","toggleStyleBook","createElement","className","identifier","title","icon","closeLabel","panelClassName","header","style","minWidth","label","isPressed","disabled","onClick"],"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":";AAAA;AACA;AACA;AACA,SACCA,QAAQ,EACRC,SAAS,EACTC,IAAI,EACJC,MAAM,EACNC,0BAA0B,IAAIC,YAAY,QACpC,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,MAAM,EAAEC,IAAI,EAAEC,MAAM,QAAQ,kBAAkB;AACvD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,wBAAwB;AAClE,SACCD,KAAK,IAAIE,WAAW,EACpBC,WAAW,IAAIC,iBAAiB,QAC1B,mBAAmB;;AAE1B;AACA;AACA;AACA,OAAOC,cAAc,MAAM,mBAAmB;AAC9C,SAASC,cAAc,QAAQ,kBAAkB;AACjD,SAASN,KAAK,IAAIO,aAAa,QAAQ,aAAa;AACpD,SAASC,oBAAoB,QAAQ,qBAAqB;AAC1D,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAAST,KAAK,IAAIU,SAAS,QAAQ,sBAAsB;AAEzD,MAAM;EAAEC;AAAe,CA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AAC;EACF,CAAC;EAED,OACCQ,aAAA,CAACpC,cAAc;IACdqC,SAAS,EAAC,iCAAiC;IAC3CC,UAAU,EAAC,yBAAyB;IACpCC,KAAK,EAAGnD,EAAE,CAAE,QAAS,CAAG;IACxBoD,IAAI,EAAGnD,MAAQ;IACfoD,UAAU,EAAGrD,EAAE,CAAE,cAAe,CAAG;IACnCsD,cAAc,EAAC,wCAAwC;IACvDC,MAAM,EACLP,aAAA,CAACpD,IAAI;MAACqD,SAAS,EAAC;IAAyC,GACxDD,aAAA,CAACrD,SAAS;MAAC6D,KAAK,EAAG;QAAEC,QAAQ,EAAE;MAAc;IAAG,GAC/CT,aAAA;MAAIC,SAAS,EAAC;IAA+C,GAC1DjD,EAAE,CAAE,QAAS,CACZ,CACM,CAAC,EACZgD,aAAA,CAACtD,QAAQ,QACRsD,aAAA,CAACnD,MAAM;MACNuD,IAAI,EAAGlD,IAAM;MACbwD,KAAK,EAAG1D,EAAE,CAAE,YAAa,CAAG;MAC5B2D,SAAS,EACRtC,iBAAiB,IAAII,0BACrB;MACDmC,QAAQ,EAAGxC,8BAAgC;MAC3CyC,OAAO,EAAGd;IAAiB,CAC3B,CACQ,CAAC,EACXC,aAAA,CAACtD,QAAQ,QACRsD,aAAA,CAACnD,MAAM;MACN6D,KAAK,EAAG1D,EAAE,CAAE,WAAY,CAAG;MAC3BoD,IAAI,EAAGjD,MAAQ;MACf0D,OAAO,EAAGf,eAAiB;MAC3Bc,QAAQ,EAAG,CAAErC,YAAc;MAC3BoC,SAAS,EACRnC,iBAAiB,IAAIC;IACrB,CACD,CACQ,CAAC,EACXuB,aAAA,CAACjC,oBAAoB,MAAE,CAClB;EACN,GAEDiC,aAAA,CAACnC,cAAc,MAAE,CACF,CAAC;AAEnB","ignoreList":[]}
|
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
import { createElement, Fragment } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { createSlotFill, privateApis as componentsPrivateApis } from '@wordpress/components';
|
|
6
|
-
import { isRTL, __ } from '@wordpress/i18n';
|
|
7
|
-
import { drawerLeft, drawerRight } from '@wordpress/icons';
|
|
8
|
-
import { useCallback, useContext, useEffect, useRef } from '@wordpress/element';
|
|
9
|
-
import { useSelect, useDispatch } from '@wordpress/data';
|
|
10
|
-
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
11
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
12
|
-
import { PageAttributesPanel, PostDiscussionPanel, PostLastRevisionPanel, PostTaxonomiesPanel, privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Internal dependencies
|
|
16
|
-
*/
|
|
17
|
-
import DefaultSidebar from './default-sidebar';
|
|
18
|
-
import GlobalStylesSidebar from './global-styles-sidebar';
|
|
19
|
-
import SettingsHeader from './settings-header';
|
|
20
|
-
import PagePanels from './page-panels';
|
|
21
|
-
import TemplatePanel from './template-panel';
|
|
22
|
-
import { store as editSiteStore } from '../../store';
|
|
23
|
-
import { unlock } from '../../lock-unlock';
|
|
24
|
-
const {
|
|
25
|
-
Tabs
|
|
26
|
-
} = unlock(componentsPrivateApis);
|
|
27
|
-
const {
|
|
28
|
-
interfaceStore,
|
|
29
|
-
useAutoSwitchEditorSidebars,
|
|
30
|
-
PatternOverridesPanel
|
|
31
|
-
} = unlock(editorPrivateApis);
|
|
32
|
-
const {
|
|
33
|
-
Slot: InspectorSlot,
|
|
34
|
-
Fill: InspectorFill
|
|
35
|
-
} = createSlotFill('EditSiteSidebarInspector');
|
|
36
|
-
export const SidebarInspectorFill = InspectorFill;
|
|
37
|
-
const FillContents = ({
|
|
38
|
-
tabName,
|
|
39
|
-
isEditingPage,
|
|
40
|
-
supportsGlobalStyles
|
|
41
|
-
}) => {
|
|
42
|
-
const tabListRef = useRef(null);
|
|
43
|
-
// Because `DefaultSidebar` renders a `ComplementaryArea`, we
|
|
44
|
-
// need to forward the `Tabs` context so it can be passed through the
|
|
45
|
-
// underlying slot/fill.
|
|
46
|
-
const tabsContextValue = useContext(Tabs.Context);
|
|
47
|
-
|
|
48
|
-
// This effect addresses a race condition caused by tabbing from the last
|
|
49
|
-
// block in the editor into the settings sidebar. Without this effect, the
|
|
50
|
-
// selected tab and browser focus can become separated in an unexpected way.
|
|
51
|
-
// (e.g the "block" tab is focused, but the "post" tab is selected).
|
|
52
|
-
useEffect(() => {
|
|
53
|
-
const tabsElements = Array.from(tabListRef.current?.querySelectorAll('[role="tab"]') || []);
|
|
54
|
-
const selectedTabElement = tabsElements.find(
|
|
55
|
-
// We are purposefully using a custom `data-tab-id` attribute here
|
|
56
|
-
// because we don't want rely on any assumptions about `Tabs`
|
|
57
|
-
// component internals.
|
|
58
|
-
element => element.getAttribute('data-tab-id') === tabName);
|
|
59
|
-
const activeElement = selectedTabElement?.ownerDocument.activeElement;
|
|
60
|
-
const tabsHasFocus = tabsElements.some(element => {
|
|
61
|
-
return activeElement && activeElement.id === element.id;
|
|
62
|
-
});
|
|
63
|
-
if (tabsHasFocus && selectedTabElement && selectedTabElement.id !== activeElement?.id) {
|
|
64
|
-
selectedTabElement?.focus();
|
|
65
|
-
}
|
|
66
|
-
}, [tabName]);
|
|
67
|
-
return createElement(Fragment, null, createElement(DefaultSidebar, {
|
|
68
|
-
identifier: tabName,
|
|
69
|
-
title: __('Settings'),
|
|
70
|
-
icon: isRTL() ? drawerLeft : drawerRight,
|
|
71
|
-
closeLabel: __('Close Settings'),
|
|
72
|
-
header: createElement(Tabs.Context.Provider, {
|
|
73
|
-
value: tabsContextValue
|
|
74
|
-
}, createElement(SettingsHeader, {
|
|
75
|
-
ref: tabListRef
|
|
76
|
-
})),
|
|
77
|
-
headerClassName: "edit-site-sidebar-edit-mode__panel-tabs"
|
|
78
|
-
// This classname is added so we can apply a corrective negative
|
|
79
|
-
// margin to the panel.
|
|
80
|
-
// see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049
|
|
81
|
-
,
|
|
82
|
-
className: "edit-site-sidebar__panel",
|
|
83
|
-
isActiveByDefault: true
|
|
84
|
-
}, createElement(Tabs.Context.Provider, {
|
|
85
|
-
value: tabsContextValue
|
|
86
|
-
}, createElement(Tabs.TabPanel, {
|
|
87
|
-
tabId: "edit-post/document",
|
|
88
|
-
focusable: false
|
|
89
|
-
}, isEditingPage ? createElement(PagePanels, null) : createElement(TemplatePanel, null), createElement(PostLastRevisionPanel, null), createElement(PostTaxonomiesPanel, null), createElement(PostDiscussionPanel, null), createElement(PageAttributesPanel, null), createElement(PatternOverridesPanel, null)), createElement(Tabs.TabPanel, {
|
|
90
|
-
tabId: "edit-post/block",
|
|
91
|
-
focusable: false
|
|
92
|
-
}, createElement(InspectorSlot, {
|
|
93
|
-
bubblesVirtually: true
|
|
94
|
-
})))), supportsGlobalStyles && createElement(GlobalStylesSidebar, null));
|
|
95
|
-
};
|
|
96
|
-
export function SidebarComplementaryAreaFills() {
|
|
97
|
-
useAutoSwitchEditorSidebars();
|
|
98
|
-
const {
|
|
99
|
-
tabName,
|
|
100
|
-
supportsGlobalStyles,
|
|
101
|
-
isEditingPage
|
|
102
|
-
} = useSelect(select => {
|
|
103
|
-
const sidebar = select(interfaceStore).getActiveComplementaryArea('core');
|
|
104
|
-
const _isEditorSidebarOpened = ['edit-post/block', 'edit-post/document'].includes(sidebar);
|
|
105
|
-
let _tabName = sidebar;
|
|
106
|
-
if (!_isEditorSidebarOpened) {
|
|
107
|
-
_tabName = !!select(blockEditorStore).getBlockSelectionStart() ? 'edit-post/block' : 'edit-post/document';
|
|
108
|
-
}
|
|
109
|
-
return {
|
|
110
|
-
tabName: _tabName,
|
|
111
|
-
supportsGlobalStyles: select(coreStore).getCurrentTheme()?.is_block_theme,
|
|
112
|
-
isEditingPage: select(editSiteStore).isPage()
|
|
113
|
-
};
|
|
114
|
-
}, []);
|
|
115
|
-
const {
|
|
116
|
-
enableComplementaryArea
|
|
117
|
-
} = useDispatch(interfaceStore);
|
|
118
|
-
|
|
119
|
-
// `newSelectedTabId` could technically be falsey if no tab is selected (i.e.
|
|
120
|
-
// the initial render) or when we don't want a tab displayed (i.e. the
|
|
121
|
-
// sidebar is closed). These cases should both be covered by the `!!` check
|
|
122
|
-
// below, so we shouldn't need any additional falsey handling.
|
|
123
|
-
const onTabSelect = useCallback(newSelectedTabId => {
|
|
124
|
-
if (!!newSelectedTabId) {
|
|
125
|
-
enableComplementaryArea('core', newSelectedTabId);
|
|
126
|
-
}
|
|
127
|
-
}, [enableComplementaryArea]);
|
|
128
|
-
return createElement(Tabs, {
|
|
129
|
-
selectedTabId: tabName,
|
|
130
|
-
onSelect: onTabSelect,
|
|
131
|
-
selectOnMove: false
|
|
132
|
-
}, createElement(FillContents, {
|
|
133
|
-
tabName: tabName,
|
|
134
|
-
isEditingPage: isEditingPage,
|
|
135
|
-
supportsGlobalStyles: supportsGlobalStyles
|
|
136
|
-
}));
|
|
137
|
-
}
|
|
138
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createSlotFill","privateApis","componentsPrivateApis","isRTL","__","drawerLeft","drawerRight","useCallback","useContext","useEffect","useRef","useSelect","useDispatch","store","blockEditorStore","coreStore","PageAttributesPanel","PostDiscussionPanel","PostLastRevisionPanel","PostTaxonomiesPanel","editorPrivateApis","DefaultSidebar","GlobalStylesSidebar","SettingsHeader","PagePanels","TemplatePanel","editSiteStore","unlock","Tabs","interfaceStore","useAutoSwitchEditorSidebars","PatternOverridesPanel","Slot","InspectorSlot","Fill","InspectorFill","SidebarInspectorFill","FillContents","tabName","isEditingPage","supportsGlobalStyles","tabListRef","tabsContextValue","Context","tabsElements","Array","from","current","querySelectorAll","selectedTabElement","find","element","getAttribute","activeElement","ownerDocument","tabsHasFocus","some","id","focus","createElement","Fragment","identifier","title","icon","closeLabel","header","Provider","value","ref","headerClassName","className","isActiveByDefault","TabPanel","tabId","focusable","bubblesVirtually","SidebarComplementaryAreaFills","select","sidebar","getActiveComplementaryArea","_isEditorSidebarOpened","includes","_tabName","getBlockSelectionStart","getCurrentTheme","is_block_theme","isPage","enableComplementaryArea","onTabSelect","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":";AAAA;AACA;AACA;AACA,SACCA,cAAc,EACdC,WAAW,IAAIC,qBAAqB,QAC9B,uBAAuB;AAC9B,SAASC,KAAK,EAAEC,EAAE,QAAQ,iBAAiB;AAC3C,SAASC,UAAU,EAAEC,WAAW,QAAQ,kBAAkB;AAC1D,SAASC,WAAW,EAAEC,UAAU,EAAEC,SAAS,EAAEC,MAAM,QAAQ,oBAAoB;AAC/E,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;AACzD,SACCC,mBAAmB,EACnBC,mBAAmB,EACnBC,qBAAqB,EACrBC,mBAAmB,EACnBlB,WAAW,IAAImB,iBAAiB,QAC1B,mBAAmB;;AAE1B;AACA;AACA;AACA,OAAOC,cAAc,MAAM,mBAAmB;AAC9C,OAAOC,mBAAmB,MAAM,yBAAyB;AACzD,OAAOC,cAAc,MAAM,mBAAmB;AAC9C,OAAOC,UAAU,MAAM,eAAe;AACtC,OAAOC,aAAa,MAAM,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,aAAa,EAAGpD,OAAS;IACzBqD,QAAQ,EAAGH,WAAa;IACxBI,YAAY,EAAG;EAAO,GAEtBjC,aAAA,CAACtB,YAAY;IACZC,OAAO,EAAGA,OAAS;IACnBC,aAAa,EAAGA,aAAe;IAC/BC,oBAAoB,EAAGA;EAAsB,CAC7C,CACI,CAAC;AAET","ignoreList":[]}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { createElement, Fragment } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { PanelBody } from '@wordpress/components';
|
|
6
|
-
import { __, sprintf } from '@wordpress/i18n';
|
|
7
|
-
import { useSelect, useDispatch } from '@wordpress/data';
|
|
8
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
9
|
-
import { PluginDocumentSettingPanel, store as editorStore, privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
10
|
-
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
11
|
-
import { useCallback } from '@wordpress/element';
|
|
12
|
-
import { store as noticesStore } from '@wordpress/notices';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Internal dependencies
|
|
16
|
-
*/
|
|
17
|
-
import { store as editSiteStore } from '../../../store';
|
|
18
|
-
import PageContent from './page-content';
|
|
19
|
-
import PageSummary from './page-summary';
|
|
20
|
-
import { unlock } from '../../../lock-unlock';
|
|
21
|
-
const {
|
|
22
|
-
PostCardPanel,
|
|
23
|
-
PostActions
|
|
24
|
-
} = unlock(editorPrivateApis);
|
|
25
|
-
const {
|
|
26
|
-
useHistory
|
|
27
|
-
} = unlock(routerPrivateApis);
|
|
28
|
-
export default function PagePanels() {
|
|
29
|
-
const {
|
|
30
|
-
id,
|
|
31
|
-
type,
|
|
32
|
-
hasResolved,
|
|
33
|
-
status,
|
|
34
|
-
date,
|
|
35
|
-
password,
|
|
36
|
-
renderingMode
|
|
37
|
-
} = useSelect(select => {
|
|
38
|
-
const {
|
|
39
|
-
getEditedPostContext
|
|
40
|
-
} = select(editSiteStore);
|
|
41
|
-
const {
|
|
42
|
-
getEditedEntityRecord,
|
|
43
|
-
hasFinishedResolution
|
|
44
|
-
} = select(coreStore);
|
|
45
|
-
const {
|
|
46
|
-
getRenderingMode
|
|
47
|
-
} = select(editorStore);
|
|
48
|
-
const context = getEditedPostContext();
|
|
49
|
-
const queryArgs = ['postType', context.postType, context.postId];
|
|
50
|
-
const page = getEditedEntityRecord(...queryArgs);
|
|
51
|
-
return {
|
|
52
|
-
hasResolved: hasFinishedResolution('getEditedEntityRecord', queryArgs),
|
|
53
|
-
id: page?.id,
|
|
54
|
-
type: page?.type,
|
|
55
|
-
status: page?.status,
|
|
56
|
-
date: page?.date,
|
|
57
|
-
password: page?.password,
|
|
58
|
-
renderingMode: getRenderingMode()
|
|
59
|
-
};
|
|
60
|
-
}, []);
|
|
61
|
-
const {
|
|
62
|
-
createSuccessNotice
|
|
63
|
-
} = useDispatch(noticesStore);
|
|
64
|
-
const history = useHistory();
|
|
65
|
-
const onActionPerformed = useCallback((actionId, items) => {
|
|
66
|
-
switch (actionId) {
|
|
67
|
-
case 'move-to-trash':
|
|
68
|
-
{
|
|
69
|
-
history.push({
|
|
70
|
-
path: '/' + items[0].type,
|
|
71
|
-
postId: undefined,
|
|
72
|
-
postType: undefined,
|
|
73
|
-
canvas: 'view'
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
break;
|
|
77
|
-
case 'duplicate-post':
|
|
78
|
-
{
|
|
79
|
-
const newItem = items[0];
|
|
80
|
-
const title = typeof newItem.title === 'string' ? newItem.title : newItem.title?.rendered;
|
|
81
|
-
createSuccessNotice(sprintf(
|
|
82
|
-
// translators: %s: Title of the created post e.g: "Post 1".
|
|
83
|
-
__('"%s" successfully created.'), title), {
|
|
84
|
-
type: 'snackbar',
|
|
85
|
-
id: 'duplicate-post-action',
|
|
86
|
-
actions: [{
|
|
87
|
-
label: __('Edit'),
|
|
88
|
-
onClick: () => {
|
|
89
|
-
history.push({
|
|
90
|
-
path: undefined,
|
|
91
|
-
postId: newItem.id,
|
|
92
|
-
postType: newItem.type,
|
|
93
|
-
canvas: 'edit'
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
}]
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
break;
|
|
100
|
-
}
|
|
101
|
-
}, [history, createSuccessNotice]);
|
|
102
|
-
if (!hasResolved) {
|
|
103
|
-
return null;
|
|
104
|
-
}
|
|
105
|
-
return createElement(Fragment, null, createElement(PostCardPanel, {
|
|
106
|
-
actions: createElement(PostActions, {
|
|
107
|
-
onActionPerformed: onActionPerformed
|
|
108
|
-
})
|
|
109
|
-
}), createElement(PanelBody, {
|
|
110
|
-
title: __('Summary')
|
|
111
|
-
}, createElement(PageSummary, {
|
|
112
|
-
status: status,
|
|
113
|
-
date: date,
|
|
114
|
-
password: password,
|
|
115
|
-
postId: id,
|
|
116
|
-
postType: type
|
|
117
|
-
})), createElement(PluginDocumentSettingPanel.Slot, null), renderingMode !== 'post-only' && createElement(PanelBody, {
|
|
118
|
-
title: __('Content')
|
|
119
|
-
}, createElement(PageContent, null)));
|
|
120
|
-
}
|
|
121
|
-
//# sourceMappingURL=index.js.map
|