@wordpress/edit-site 5.29.0 → 5.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/actions/index.js +1 -1
- package/build/components/actions/index.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +10 -11
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/editor/index.js +1 -15
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +9 -0
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/font-families.js +1 -1
- package/build/components/global-styles/font-families.js.map +1 -1
- package/build/components/global-styles/font-library-modal/collection-font-variant.js +2 -2
- package/build/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/context.js +62 -58
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-card.js +10 -15
- package/build/components/global-styles/font-library-modal/font-card.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +118 -76
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-demo.js +29 -8
- package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -1
- package/build/components/global-styles/font-library-modal/index.js +19 -6
- package/build/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +151 -79
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-variant.js +2 -2
- package/build/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js +8 -14
- package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/index.js +38 -4
- package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js +1 -1
- package/build/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/header.js +1 -1
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/highlighted-colors.js +50 -0
- package/build/components/global-styles/highlighted-colors.js.map +1 -0
- package/build/components/global-styles/preview-colors.js +62 -0
- package/build/components/global-styles/preview-colors.js.map +1 -0
- package/build/components/global-styles/preview-iframe.js +131 -0
- package/build/components/global-styles/preview-iframe.js.map +1 -0
- package/build/components/global-styles/preview-styles.js +163 -0
- package/build/components/global-styles/preview-styles.js.map +1 -0
- package/build/components/global-styles/preview-typography.js +65 -0
- package/build/components/global-styles/preview-typography.js.map +1 -0
- package/build/components/global-styles/screen-block-list.js +1 -1
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js +1 -1
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +10 -2
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +2 -2
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-root.js +2 -2
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +10 -2
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/style-variations-container.js +12 -84
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/{typogrphy-elements.js → typography-elements.js} +1 -1
- package/build/components/global-styles/typography-elements.js.map +1 -0
- package/build/components/global-styles/ui.js +27 -2
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/utils.js +22 -0
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/global-styles/variations/variation.js +90 -0
- package/build/components/global-styles/variations/variation.js.map +1 -0
- package/build/components/global-styles/variations/variations-color.js +36 -0
- package/build/components/global-styles/variations/variations-color.js.map +1 -0
- package/build/components/global-styles/{variations-panel.js → variations/variations-panel.js} +1 -1
- package/build/components/global-styles/variations/variations-panel.js.map +1 -0
- package/build/components/global-styles/variations/variations-typography.js +64 -0
- package/build/components/global-styles/variations/variations-typography.js.map +1 -0
- package/build/components/header-edit-mode/index.js +12 -11
- package/build/components/header-edit-mode/index.js.map +1 -1
- package/build/components/header-edit-mode/more-menu/index.js +10 -2
- package/build/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build/components/layout/index.js +4 -1
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page-patterns/index.js +14 -14
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/{list/added-by.js → page-templates-template-parts/hooks.js} +1 -61
- package/build/components/page-templates-template-parts/hooks.js.map +1 -0
- package/build/components/page-templates-template-parts/index.js +14 -6
- package/build/components/page-templates-template-parts/index.js.map +1 -1
- package/build/components/resizable-frame/index.js +2 -1
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/save-panel/index.js +18 -3
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +1 -1
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +2 -0
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +1 -2
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +0 -3
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +2 -2
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build/components/sidebar-navigation-screen-template/index.js +2 -2
- package/build/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.js +4 -4
- package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +7 -5
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/start-template-options/index.js.map +1 -1
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +65 -0
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build-module/components/actions/index.js +1 -1
- package/build-module/components/actions/index.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +10 -11
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/editor/index.js +2 -16
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +8 -0
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/font-families.js +1 -1
- package/build-module/components/global-styles/font-families.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +4 -4
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/context.js +63 -59
- package/build-module/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-card.js +11 -16
- package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +121 -79
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-demo.js +30 -9
- package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/index.js +19 -6
- package/build-module/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +151 -79
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js +4 -4
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js +9 -15
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/index.js +37 -4
- package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js +1 -1
- package/build-module/components/global-styles/font-library-modal/utils/preview-styles.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/header.js +1 -1
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/highlighted-colors.js +43 -0
- package/build-module/components/global-styles/highlighted-colors.js.map +1 -0
- package/build-module/components/global-styles/preview-colors.js +54 -0
- package/build-module/components/global-styles/preview-colors.js.map +1 -0
- package/build-module/components/global-styles/preview-iframe.js +124 -0
- package/build-module/components/global-styles/preview-iframe.js.map +1 -0
- package/build-module/components/global-styles/preview-styles.js +155 -0
- package/build-module/components/global-styles/preview-styles.js.map +1 -0
- package/build-module/components/global-styles/preview-typography.js +58 -0
- package/build-module/components/global-styles/preview-typography.js.map +1 -0
- package/build-module/components/global-styles/screen-block-list.js +1 -1
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +1 -1
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +10 -2
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +2 -2
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +2 -2
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +10 -2
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/style-variations-container.js +13 -85
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/{typogrphy-elements.js → typography-elements.js} +1 -1
- package/build-module/components/global-styles/typography-elements.js.map +1 -0
- package/build-module/components/global-styles/ui.js +27 -2
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/utils.js +21 -0
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/global-styles/variations/variation.js +82 -0
- package/build-module/components/global-styles/variations/variation.js.map +1 -0
- package/build-module/components/global-styles/variations/variations-color.js +28 -0
- package/build-module/components/global-styles/variations/variations-color.js.map +1 -0
- package/build-module/components/global-styles/{variations-panel.js → variations/variations-panel.js} +1 -1
- package/build-module/components/global-styles/variations/variations-panel.js.map +1 -0
- package/build-module/components/global-styles/variations/variations-typography.js +56 -0
- package/build-module/components/global-styles/variations/variations-typography.js.map +1 -0
- package/build-module/components/header-edit-mode/index.js +13 -12
- package/build-module/components/header-edit-mode/index.js.map +1 -1
- package/build-module/components/header-edit-mode/more-menu/index.js +13 -5
- package/build-module/components/header-edit-mode/more-menu/index.js.map +1 -1
- package/build-module/components/layout/index.js +4 -1
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page-patterns/index.js +14 -14
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/{list/added-by.js → page-templates-template-parts/hooks.js} +2 -59
- package/build-module/components/page-templates-template-parts/hooks.js.map +1 -0
- package/build-module/components/page-templates-template-parts/index.js +13 -5
- package/build-module/components/page-templates-template-parts/index.js.map +1 -1
- package/build-module/components/resizable-frame/index.js +2 -1
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +18 -3
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +1 -1
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +3 -1
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-status.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +1 -2
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +0 -3
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js +1 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +7 -5
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/start-template-options/index.js.map +1 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +63 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build-style/style-rtl.css +163 -286
- package/build-style/style.css +163 -286
- package/package.json +42 -42
- package/src/components/actions/index.js +1 -1
- package/src/components/block-editor/editor-canvas.js +13 -12
- package/src/components/block-editor/style.scss +0 -3
- package/src/components/editor/index.js +0 -20
- package/src/components/global-styles/color-palette-panel.js +11 -1
- package/src/components/global-styles/font-families.js +1 -1
- package/src/components/global-styles/font-library-modal/collection-font-variant.js +5 -5
- package/src/components/global-styles/font-library-modal/context.js +116 -104
- package/src/components/global-styles/font-library-modal/font-card.js +11 -26
- package/src/components/global-styles/font-library-modal/font-collection.js +297 -218
- package/src/components/global-styles/font-library-modal/font-demo.js +38 -4
- package/src/components/global-styles/font-library-modal/index.js +23 -16
- package/src/components/global-styles/font-library-modal/installed-fonts.js +243 -114
- package/src/components/global-styles/font-library-modal/library-font-variant.js +5 -5
- package/src/components/global-styles/font-library-modal/style.scss +15 -8
- package/src/components/global-styles/font-library-modal/upload-fonts.js +17 -19
- package/src/components/global-styles/font-library-modal/utils/index.js +44 -4
- package/src/components/global-styles/font-library-modal/utils/preview-styles.js +2 -1
- package/src/components/global-styles/font-library-modal/utils/test/getDisplaySrcFromFontFace.spec.js +7 -18
- package/src/components/global-styles/gradients-palette-panel.js +2 -2
- package/src/components/global-styles/header.js +1 -1
- package/src/components/global-styles/highlighted-colors.js +39 -0
- package/src/components/global-styles/preview-colors.js +61 -0
- package/src/components/global-styles/preview-iframe.js +153 -0
- package/src/components/global-styles/preview-styles.js +185 -0
- package/src/components/global-styles/preview-typography.js +62 -0
- package/src/components/global-styles/screen-block-list.js +1 -1
- package/src/components/global-styles/screen-block.js +4 -1
- package/src/components/global-styles/screen-colors.js +13 -1
- package/src/components/global-styles/screen-revisions/index.js +5 -2
- package/src/components/global-styles/screen-root.js +2 -2
- package/src/components/global-styles/screen-typography.js +19 -2
- package/src/components/global-styles/style-variations-container.js +14 -92
- package/src/components/global-styles/style.scss +0 -34
- package/src/components/global-styles/ui.js +26 -2
- package/src/components/global-styles/utils.js +37 -0
- package/src/components/global-styles/variations/style.scss +44 -0
- package/src/components/global-styles/variations/variation.js +93 -0
- package/src/components/global-styles/variations/variations-color.js +30 -0
- package/src/components/global-styles/{variations-panel.js → variations/variations-panel.js} +1 -1
- package/src/components/global-styles/variations/variations-typography.js +85 -0
- package/src/components/header-edit-mode/index.js +20 -27
- package/src/components/header-edit-mode/more-menu/index.js +17 -8
- package/src/components/header-edit-mode/style.scss +4 -0
- package/src/components/layout/index.js +5 -0
- package/src/components/page-patterns/index.js +21 -21
- package/src/components/{list/added-by.js → page-templates-template-parts/hooks.js} +1 -66
- package/src/components/page-templates-template-parts/index.js +20 -3
- package/src/components/page-templates-template-parts/style.scss +48 -0
- package/src/components/resizable-frame/index.js +1 -0
- package/src/components/revisions/index.js +1 -1
- package/src/components/save-panel/index.js +34 -12
- package/src/components/sidebar/index.js +1 -1
- package/src/components/sidebar-dataviews/default-views.js +3 -1
- package/src/components/sidebar-edit-mode/page-panels/page-status.js +1 -1
- package/src/components/sidebar-edit-mode/template-panel/index.js +1 -1
- package/src/components/sidebar-navigation-screen-main/index.js +0 -2
- package/src/components/sidebar-navigation-screen-navigation-menu/delete-modal.js +1 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +0 -2
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +1 -1
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +1 -1
- package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +1 -1
- package/src/components/sidebar-navigation-screen-template/index.js +1 -1
- package/src/components/sidebar-navigation-screen-templates-browse/content.js +3 -3
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +5 -3
- package/src/components/start-template-options/index.js +1 -1
- package/src/hooks/use-theme-style-variations/test/use-theme-style-variations-by-property.js +173 -0
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +68 -1
- package/src/style.scss +2 -2
- package/build/components/global-styles/font-library-modal/collection-font-details.js +0 -50
- package/build/components/global-styles/font-library-modal/collection-font-details.js.map +0 -1
- package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js +0 -30
- package/build/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +0 -1
- package/build/components/global-styles/font-library-modal/library-font-card.js +0 -39
- package/build/components/global-styles/font-library-modal/library-font-card.js.map +0 -1
- package/build/components/global-styles/font-library-modal/tab-panel-layout.js +0 -67
- package/build/components/global-styles/font-library-modal/tab-panel-layout.js.map +0 -1
- package/build/components/global-styles/preview.js +0 -271
- package/build/components/global-styles/preview.js.map +0 -1
- package/build/components/global-styles/typogrphy-elements.js.map +0 -1
- package/build/components/global-styles/variations-panel.js.map +0 -1
- package/build/components/list/added-by.js.map +0 -1
- package/build/components/list/header.js +0 -55
- package/build/components/list/header.js.map +0 -1
- package/build/components/list/index.js +0 -80
- package/build/components/list/index.js.map +0 -1
- package/build/components/list/table.js +0 -94
- package/build/components/list/table.js.map +0 -1
- package/build/components/list/use-register-shortcuts.js +0 -51
- package/build/components/list/use-register-shortcuts.js.map +0 -1
- package/build/components/sidebar-navigation-screen-main/template-part-hint.js +0 -36
- package/build/components/sidebar-navigation-screen-main/template-part-hint.js.map +0 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js +0 -36
- package/build/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +0 -1
- package/build-module/components/global-styles/font-library-modal/collection-font-details.js +0 -42
- package/build-module/components/global-styles/font-library-modal/collection-font-details.js.map +0 -1
- package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js +0 -23
- package/build-module/components/global-styles/font-library-modal/confirm-delete-dialog.js.map +0 -1
- package/build-module/components/global-styles/font-library-modal/library-font-card.js +0 -31
- package/build-module/components/global-styles/font-library-modal/library-font-card.js.map +0 -1
- package/build-module/components/global-styles/font-library-modal/tab-panel-layout.js +0 -60
- package/build-module/components/global-styles/font-library-modal/tab-panel-layout.js.map +0 -1
- package/build-module/components/global-styles/preview.js +0 -264
- package/build-module/components/global-styles/preview.js.map +0 -1
- package/build-module/components/global-styles/typogrphy-elements.js.map +0 -1
- package/build-module/components/global-styles/variations-panel.js.map +0 -1
- package/build-module/components/list/added-by.js.map +0 -1
- package/build-module/components/list/header.js +0 -47
- package/build-module/components/list/header.js.map +0 -1
- package/build-module/components/list/index.js +0 -72
- package/build-module/components/list/index.js.map +0 -1
- package/build-module/components/list/table.js +0 -86
- package/build-module/components/list/table.js.map +0 -1
- package/build-module/components/list/use-register-shortcuts.js +0 -45
- package/build-module/components/list/use-register-shortcuts.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-main/template-part-hint.js +0 -29
- package/build-module/components/sidebar-navigation-screen-main/template-part-hint.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js +0 -27
- package/build-module/components/sidebar-navigation-screen-navigation-menu/edit-button.js.map +0 -1
- package/src/components/global-styles/font-library-modal/collection-font-details.js +0 -56
- package/src/components/global-styles/font-library-modal/confirm-delete-dialog.js +0 -33
- package/src/components/global-styles/font-library-modal/library-font-card.js +0 -34
- package/src/components/global-styles/font-library-modal/tab-panel-layout.js +0 -85
- package/src/components/global-styles/preview.js +0 -327
- package/src/components/list/header.js +0 -48
- package/src/components/list/index.js +0 -87
- package/src/components/list/style.scss +0 -188
- package/src/components/list/table.js +0 -140
- package/src/components/list/use-register-shortcuts.js +0 -49
- package/src/components/sidebar-navigation-screen-main/template-part-hint.js +0 -34
- package/src/components/sidebar-navigation-screen-navigation-menu/edit-button.js +0 -22
- /package/src/components/global-styles/{typogrphy-elements.js → typography-elements.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["classnames","Button","Modal","EntitiesSavedStates","useEntitiesSavedStatesIsDirty","privateApis","useDispatch","useSelect","__","sprintf","NavigableRegion","store","coreStore","editSiteStore","unlock","useActivateTheme","useActualCurrentTheme","isPreviewingTheme","EntitiesSavedStatesExtensible","EntitiesSavedStatesForPreview","onClose","_currentTheme$name$re","_previewingTheme$name","isDirtyProps","activateSaveLabel","isDirty","currentTheme","previewingTheme","select","getCurrentTheme","additionalPrompt","createElement","name","rendered","activateTheme","onSave","values","close","saveEnabled","saveLabel","_EntitiesSavedStates","SavePanel","isSaveViewOpen","canvasMode","isSaveViewOpened","getCanvasMode","setIsSaveViewOpened","className","onRequestClose","__experimentalHideHeader","contentLabel","ariaLabel","variant","onClick"],"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Modal } from '@wordpress/components';\nimport {\n\tEntitiesSavedStates,\n\tuseEntitiesSavedStatesIsDirty,\n\tprivateApis,\n} from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { NavigableRegion } from '@wordpress/interface';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useActivateTheme } from '../../utils/use-activate-theme';\nimport { useActualCurrentTheme } from '../../utils/use-actual-current-theme';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nconst { EntitiesSavedStatesExtensible } = unlock( privateApis );\n\nconst EntitiesSavedStatesForPreview = ( { onClose } ) => {\n\tconst isDirtyProps = useEntitiesSavedStatesIsDirty();\n\tlet activateSaveLabel;\n\tif ( isDirtyProps.isDirty ) {\n\t\tactivateSaveLabel = __( 'Activate & Save' );\n\t} else {\n\t\tactivateSaveLabel = __( 'Activate' );\n\t}\n\n\tconst currentTheme = useActualCurrentTheme();\n\n\tconst previewingTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme(),\n\t\t[]\n\t);\n\n\tconst additionalPrompt = (\n\t\t<p>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %1$s: The name of active theme, %2$s: The name of theme to be activated. */\n\t\t\t\t__(\n\t\t\t\t\t'Saving your changes will change your active theme from %1$s to %2$s.'\n\t\t\t\t),\n\t\t\t\tcurrentTheme?.name?.rendered ?? '...',\n\t\t\t\tpreviewingTheme?.name?.rendered ?? '...'\n\t\t\t) }\n\t\t</p>\n\t);\n\n\tconst activateTheme = useActivateTheme();\n\tconst onSave = async ( values ) => {\n\t\tawait activateTheme();\n\t\treturn values;\n\t};\n\n\treturn (\n\t\t<EntitiesSavedStatesExtensible\n\t\t\t{ ...{\n\t\t\t\t...isDirtyProps,\n\t\t\t\tadditionalPrompt,\n\t\t\t\tclose: onClose,\n\t\t\t\tonSave,\n\t\t\t\tsaveEnabled: true,\n\t\t\t\tsaveLabel: activateSaveLabel,\n\t\t\t} }\n\t\t/>\n\t);\n};\n\nconst _EntitiesSavedStates = ( { onClose } ) => {\n\tif ( isPreviewingTheme() ) {\n\t\treturn <EntitiesSavedStatesForPreview onClose={ onClose } />;\n\t}\n\treturn <EntitiesSavedStates close={ onClose } />;\n};\n\nexport default function SavePanel() {\n\tconst { isSaveViewOpen, canvasMode } = useSelect(
|
|
1
|
+
{"version":3,"names":["classnames","Button","Modal","EntitiesSavedStates","useEntitiesSavedStatesIsDirty","privateApis","useDispatch","useSelect","__","sprintf","NavigableRegion","store","coreStore","editSiteStore","unlock","useActivateTheme","useActualCurrentTheme","isPreviewingTheme","EntitiesSavedStatesExtensible","EntitiesSavedStatesForPreview","onClose","_currentTheme$name$re","_previewingTheme$name","isDirtyProps","activateSaveLabel","isDirty","currentTheme","previewingTheme","select","getCurrentTheme","additionalPrompt","createElement","name","rendered","activateTheme","onSave","values","close","saveEnabled","saveLabel","_EntitiesSavedStates","SavePanel","isSaveViewOpen","canvasMode","isSaving","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","isResolving","dirtyEntityRecords","isActivatingTheme","isSaveViewOpened","getCanvasMode","length","some","record","kind","key","setIsSaveViewOpened","className","onRequestClose","__experimentalHideHeader","contentLabel","activateSaveEnabled","disabled","ariaLabel","variant","onClick","__experimentalIsFocusable"],"sources":["@wordpress/edit-site/src/components/save-panel/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { Button, Modal } from '@wordpress/components';\nimport {\n\tEntitiesSavedStates,\n\tuseEntitiesSavedStatesIsDirty,\n\tprivateApis,\n} from '@wordpress/editor';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { NavigableRegion } from '@wordpress/interface';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { useActivateTheme } from '../../utils/use-activate-theme';\nimport { useActualCurrentTheme } from '../../utils/use-actual-current-theme';\nimport { isPreviewingTheme } from '../../utils/is-previewing-theme';\n\nconst { EntitiesSavedStatesExtensible } = unlock( privateApis );\n\nconst EntitiesSavedStatesForPreview = ( { onClose } ) => {\n\tconst isDirtyProps = useEntitiesSavedStatesIsDirty();\n\tlet activateSaveLabel;\n\tif ( isDirtyProps.isDirty ) {\n\t\tactivateSaveLabel = __( 'Activate & Save' );\n\t} else {\n\t\tactivateSaveLabel = __( 'Activate' );\n\t}\n\n\tconst currentTheme = useActualCurrentTheme();\n\n\tconst previewingTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme(),\n\t\t[]\n\t);\n\n\tconst additionalPrompt = (\n\t\t<p>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %1$s: The name of active theme, %2$s: The name of theme to be activated. */\n\t\t\t\t__(\n\t\t\t\t\t'Saving your changes will change your active theme from %1$s to %2$s.'\n\t\t\t\t),\n\t\t\t\tcurrentTheme?.name?.rendered ?? '...',\n\t\t\t\tpreviewingTheme?.name?.rendered ?? '...'\n\t\t\t) }\n\t\t</p>\n\t);\n\n\tconst activateTheme = useActivateTheme();\n\tconst onSave = async ( values ) => {\n\t\tawait activateTheme();\n\t\treturn values;\n\t};\n\n\treturn (\n\t\t<EntitiesSavedStatesExtensible\n\t\t\t{ ...{\n\t\t\t\t...isDirtyProps,\n\t\t\t\tadditionalPrompt,\n\t\t\t\tclose: onClose,\n\t\t\t\tonSave,\n\t\t\t\tsaveEnabled: true,\n\t\t\t\tsaveLabel: activateSaveLabel,\n\t\t\t} }\n\t\t/>\n\t);\n};\n\nconst _EntitiesSavedStates = ( { onClose } ) => {\n\tif ( isPreviewingTheme() ) {\n\t\treturn <EntitiesSavedStatesForPreview onClose={ onClose } />;\n\t}\n\treturn <EntitiesSavedStates close={ onClose } />;\n};\n\nexport default function SavePanel() {\n\tconst { isSaveViewOpen, canvasMode, isDirty, isSaving } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\t\tisSavingEntityRecord,\n\t\t\t\tisResolving,\n\t\t\t} = select( coreStore );\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\tconst isActivatingTheme = isResolving( 'activateTheme' );\n\t\t\tconst { isSaveViewOpened, getCanvasMode } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\n\t\t\t// The currently selected entity to display.\n\t\t\t// Typically template or template part in the site editor.\n\t\t\treturn {\n\t\t\t\tisSaveViewOpen: isSaveViewOpened(),\n\t\t\t\tcanvasMode: getCanvasMode(),\n\t\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\t\tisSaving:\n\t\t\t\t\tdirtyEntityRecords.some( ( record ) =>\n\t\t\t\t\t\tisSavingEntityRecord(\n\t\t\t\t\t\t\trecord.kind,\n\t\t\t\t\t\t\trecord.name,\n\t\t\t\t\t\t\trecord.key\n\t\t\t\t\t\t)\n\t\t\t\t\t) || isActivatingTheme,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\tconst { setIsSaveViewOpened } = useDispatch( editSiteStore );\n\tconst onClose = () => setIsSaveViewOpened( false );\n\n\tif ( canvasMode === 'view' ) {\n\t\treturn isSaveViewOpen ? (\n\t\t\t<Modal\n\t\t\t\tclassName=\"edit-site-save-panel__modal\"\n\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t__experimentalHideHeader\n\t\t\t\tcontentLabel={ __(\n\t\t\t\t\t'Save site, content, and template changes'\n\t\t\t\t) }\n\t\t\t>\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } />\n\t\t\t</Modal>\n\t\t) : null;\n\t}\n\tconst activateSaveEnabled = isPreviewingTheme() || isDirty;\n\tconst disabled = isSaving || ! activateSaveEnabled;\n\treturn (\n\t\t<NavigableRegion\n\t\t\tclassName={ classnames( 'edit-site-layout__actions', {\n\t\t\t\t'is-entity-save-view-open': isSaveViewOpen,\n\t\t\t} ) }\n\t\t\tariaLabel={ __( 'Save panel' ) }\n\t\t>\n\t\t\t{ isSaveViewOpen ? (\n\t\t\t\t<_EntitiesSavedStates onClose={ onClose } />\n\t\t\t) : (\n\t\t\t\t<div className=\"edit-site-editor__toggle-save-panel\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tclassName=\"edit-site-editor__toggle-save-panel-button\"\n\t\t\t\t\t\tonClick={ () => setIsSaveViewOpened( true ) }\n\t\t\t\t\t\taria-expanded={ false }\n\t\t\t\t\t\tdisabled={ disabled }\n\t\t\t\t\t\t__experimentalIsFocusable\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Open save panel' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t</NavigableRegion>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,MAAM,EAAEC,KAAK,QAAQ,uBAAuB;AACrD,SACCC,mBAAmB,EACnBC,6BAA6B,EAC7BC,WAAW,QACL,mBAAmB;AAC1B,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,eAAe,QAAQ,sBAAsB;AACtD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,aAAa,QAAQ,aAAa;AACpD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASC,gBAAgB,QAAQ,gCAAgC;AACjE,SAASC,qBAAq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AKd,UAAU,KAAK,MAAM,EAAG;IAC5B,OAAOD,cAAc,GACpBX,aAAA,CAAC7B,KAAK;MACLwD,SAAS,EAAC,6BAA6B;MACvCC,cAAc,EAAGvC,OAAS;MAC1BwC,wBAAwB;MACxBC,YAAY,EAAGrD,EAAE,CAChB,0CACD;IAAG,GAEHuB,aAAA,CAACS,oBAAoB;MAACpB,OAAO,EAAGA;IAAS,CAAE,CACrC,CAAC,GACL,IAAI;EACT;EACA,MAAM0C,mBAAmB,GAAG7C,iBAAiB,CAAC,CAAC,IAAIQ,OAAO;EAC1D,MAAMsC,QAAQ,GAAGnB,QAAQ,IAAI,CAAEkB,mBAAmB;EAClD,OACC/B,aAAA,CAACrB,eAAe;IACfgD,SAAS,EAAG1D,UAAU,CAAE,2BAA2B,EAAE;MACpD,0BAA0B,EAAE0C;IAC7B,CAAE,CAAG;IACLsB,SAAS,EAAGxD,EAAE,CAAE,YAAa;EAAG,GAE9BkC,cAAc,GACfX,aAAA,CAACS,oBAAoB;IAACpB,OAAO,EAAGA;EAAS,CAAE,CAAC,GAE5CW,aAAA;IAAK2B,SAAS,EAAC;EAAqC,GACnD3B,aAAA,CAAC9B,MAAM;IACNgE,OAAO,EAAC,WAAW;IACnBP,SAAS,EAAC,4CAA4C;IACtDQ,OAAO,EAAGA,CAAA,KAAMT,mBAAmB,CAAE,IAAK,CAAG;IAC7C,iBAAgB,KAAO;IACvBM,QAAQ,EAAGA,QAAU;IACrBI,yBAAyB;EAAA,GAEvB3D,EAAE,CAAE,iBAAkB,CACjB,CACJ,CAEU,CAAC;AAEpB"}
|
|
@@ -60,7 +60,7 @@ function SidebarScreens() {
|
|
|
60
60
|
}, createElement(SidebarNavigationScreenPages, null)), createElement(SidebarScreenWrapper, {
|
|
61
61
|
path: "/pages"
|
|
62
62
|
}, createElement(SidebarNavigationScreen, {
|
|
63
|
-
title: __('
|
|
63
|
+
title: __('Manage pages'),
|
|
64
64
|
content: createElement(DataViewsSidebarContent, null),
|
|
65
65
|
backPath: "/page"
|
|
66
66
|
})), createElement(SidebarScreenWrapper, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["classNames","memo","useRef","__experimentalNavigatorProvider","NavigatorProvider","__experimentalNavigatorScreen","NavigatorScreen","privateApis","routerPrivateApis","useViewportMatch","__","SidebarNavigationScreenMain","SidebarNavigationScreenTemplates","SidebarNavigationScreenTemplate","SidebarNavigationScreenPatterns","SidebarNavigationScreenPattern","useSyncPathWithURL","getPathFromURL","SidebarNavigationScreenNavigationMenus","SidebarNavigationScreenNavigationMenu","SidebarNavigationScreenGlobalStyles","SidebarNavigationScreenTemplatesBrowse","SaveHub","unlock","SidebarNavigationScreenPages","SidebarNavigationScreen","DataViewsSidebarContent","SidebarNavigationScreenPage","useLocation","SidebarScreenWrapper","className","props","createElement","SidebarScreens","isMobileViewport","Fragment","path","title","content","backPath","Sidebar","params","urlParams","initialPath","current"],"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { memo, useRef } from '@wordpress/element';\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n} from '@wordpress/components';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';\nimport SidebarNavigationScreenTemplates from '../sidebar-navigation-screen-templates';\nimport SidebarNavigationScreenTemplate from '../sidebar-navigation-screen-template';\nimport SidebarNavigationScreenPatterns from '../sidebar-navigation-screen-patterns';\nimport SidebarNavigationScreenPattern from '../sidebar-navigation-screen-pattern';\nimport useSyncPathWithURL, {\n\tgetPathFromURL,\n} from '../sync-state-with-url/use-sync-path-with-url';\nimport SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';\nimport SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';\nimport SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-global-styles';\nimport SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';\nimport SaveHub from '../save-hub';\nimport { unlock } from '../../lock-unlock';\nimport SidebarNavigationScreenPages from '../sidebar-navigation-screen-pages';\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport DataViewsSidebarContent from '../sidebar-dataviews';\nimport SidebarNavigationScreenPage from '../sidebar-navigation-screen-page';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nfunction SidebarScreenWrapper( { className, ...props } ) {\n\treturn (\n\t\t<NavigatorScreen\n\t\t\tclassName={ classNames(\n\t\t\t\t'edit-site-sidebar__screen-wrapper',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction SidebarScreens() {\n\tuseSyncPathWithURL();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarScreenWrapper path=\"/\">\n\t\t\t\t<SidebarNavigationScreenMain />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/navigation\">\n\t\t\t\t<SidebarNavigationScreenNavigationMenus />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/navigation/:postType/:postId\">\n\t\t\t\t<SidebarNavigationScreenNavigationMenu />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/wp_global_styles\">\n\t\t\t\t<SidebarNavigationScreenGlobalStyles />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/page\">\n\t\t\t\t<SidebarNavigationScreenPages />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/pages\">\n\t\t\t\t<SidebarNavigationScreen\n\t\t\t\t\ttitle={ __( '
|
|
1
|
+
{"version":3,"names":["classNames","memo","useRef","__experimentalNavigatorProvider","NavigatorProvider","__experimentalNavigatorScreen","NavigatorScreen","privateApis","routerPrivateApis","useViewportMatch","__","SidebarNavigationScreenMain","SidebarNavigationScreenTemplates","SidebarNavigationScreenTemplate","SidebarNavigationScreenPatterns","SidebarNavigationScreenPattern","useSyncPathWithURL","getPathFromURL","SidebarNavigationScreenNavigationMenus","SidebarNavigationScreenNavigationMenu","SidebarNavigationScreenGlobalStyles","SidebarNavigationScreenTemplatesBrowse","SaveHub","unlock","SidebarNavigationScreenPages","SidebarNavigationScreen","DataViewsSidebarContent","SidebarNavigationScreenPage","useLocation","SidebarScreenWrapper","className","props","createElement","SidebarScreens","isMobileViewport","Fragment","path","title","content","backPath","Sidebar","params","urlParams","initialPath","current"],"sources":["@wordpress/edit-site/src/components/sidebar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classNames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { memo, useRef } from '@wordpress/element';\nimport {\n\t__experimentalNavigatorProvider as NavigatorProvider,\n\t__experimentalNavigatorScreen as NavigatorScreen,\n} from '@wordpress/components';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';\nimport SidebarNavigationScreenTemplates from '../sidebar-navigation-screen-templates';\nimport SidebarNavigationScreenTemplate from '../sidebar-navigation-screen-template';\nimport SidebarNavigationScreenPatterns from '../sidebar-navigation-screen-patterns';\nimport SidebarNavigationScreenPattern from '../sidebar-navigation-screen-pattern';\nimport useSyncPathWithURL, {\n\tgetPathFromURL,\n} from '../sync-state-with-url/use-sync-path-with-url';\nimport SidebarNavigationScreenNavigationMenus from '../sidebar-navigation-screen-navigation-menus';\nimport SidebarNavigationScreenNavigationMenu from '../sidebar-navigation-screen-navigation-menu';\nimport SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-global-styles';\nimport SidebarNavigationScreenTemplatesBrowse from '../sidebar-navigation-screen-templates-browse';\nimport SaveHub from '../save-hub';\nimport { unlock } from '../../lock-unlock';\nimport SidebarNavigationScreenPages from '../sidebar-navigation-screen-pages';\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport DataViewsSidebarContent from '../sidebar-dataviews';\nimport SidebarNavigationScreenPage from '../sidebar-navigation-screen-page';\n\nconst { useLocation } = unlock( routerPrivateApis );\n\nfunction SidebarScreenWrapper( { className, ...props } ) {\n\treturn (\n\t\t<NavigatorScreen\n\t\t\tclassName={ classNames(\n\t\t\t\t'edit-site-sidebar__screen-wrapper',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n\nfunction SidebarScreens() {\n\tuseSyncPathWithURL();\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarScreenWrapper path=\"/\">\n\t\t\t\t<SidebarNavigationScreenMain />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/navigation\">\n\t\t\t\t<SidebarNavigationScreenNavigationMenus />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/navigation/:postType/:postId\">\n\t\t\t\t<SidebarNavigationScreenNavigationMenu />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/wp_global_styles\">\n\t\t\t\t<SidebarNavigationScreenGlobalStyles />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/page\">\n\t\t\t\t<SidebarNavigationScreenPages />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/pages\">\n\t\t\t\t<SidebarNavigationScreen\n\t\t\t\t\ttitle={ __( 'Manage pages' ) }\n\t\t\t\t\tcontent={ <DataViewsSidebarContent /> }\n\t\t\t\t\tbackPath=\"/page\"\n\t\t\t\t/>\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/page/:postId\">\n\t\t\t\t<SidebarNavigationScreenPage />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/:postType(wp_template)\">\n\t\t\t\t<SidebarNavigationScreenTemplates />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t{ ! isMobileViewport && (\n\t\t\t\t<SidebarScreenWrapper path=\"/patterns\">\n\t\t\t\t\t<SidebarNavigationScreenPatterns />\n\t\t\t\t</SidebarScreenWrapper>\n\t\t\t) }\n\t\t\t<SidebarScreenWrapper path=\"/:postType(wp_template|wp_template_part)/all\">\n\t\t\t\t<SidebarNavigationScreenTemplatesBrowse />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/:postType(wp_template_part|wp_block)/:postId\">\n\t\t\t\t<SidebarNavigationScreenPattern />\n\t\t\t</SidebarScreenWrapper>\n\t\t\t<SidebarScreenWrapper path=\"/:postType(wp_template)/:postId\">\n\t\t\t\t<SidebarNavigationScreenTemplate />\n\t\t\t</SidebarScreenWrapper>\n\t\t</>\n\t);\n}\n\nfunction Sidebar() {\n\tconst { params: urlParams } = useLocation();\n\tconst initialPath = useRef( getPathFromURL( urlParams ) );\n\n\treturn (\n\t\t<>\n\t\t\t<NavigatorProvider\n\t\t\t\tclassName=\"edit-site-sidebar__content\"\n\t\t\t\tinitialPath={ initialPath.current }\n\t\t\t>\n\t\t\t\t<SidebarScreens />\n\t\t\t</NavigatorProvider>\n\t\t\t<SaveHub />\n\t\t</>\n\t);\n}\n\nexport default memo( Sidebar );\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,IAAI,EAAEC,MAAM,QAAQ,oBAAoB;AACjD,SACCC,+BAA+B,IAAIC,iBAAiB,EACpDC,6BAA6B,IAAIC,eAAe,QAC1C,uBA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iC,GAC3DJ,aAAA,CAACnB,+BAA+B,MAAE,CACb,CACrB,CAAC;AAEL;AAEA,SAAS2B,OAAOA,CAAA,EAAG;EAClB,MAAM;IAAEC,MAAM,EAAEC;EAAU,CAAC,GAAGd,WAAW,CAAC,CAAC;EAC3C,MAAMe,WAAW,GAAGzC,MAAM,CAAEe,cAAc,CAAEyB,SAAU,CAAE,CAAC;EAEzD,OACCV,aAAA,CAAAG,QAAA,QACCH,aAAA,CAAC5B,iBAAiB;IACjB0B,SAAS,EAAC,4BAA4B;IACtCa,WAAW,EAAGA,WAAW,CAACC;EAAS,GAEnCZ,aAAA,CAACC,cAAc,MAAE,CACC,CAAC,EACpBD,aAAA,CAACV,OAAO,MAAE,CACT,CAAC;AAEL;AAEA,eAAerB,IAAI,CAAEuC,OAAQ,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import { trash } from '@wordpress/icons';
|
|
5
|
+
import { trash, pages, drafts } from '@wordpress/icons';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
@@ -42,10 +42,12 @@ export const DEFAULT_VIEWS = {
|
|
|
42
42
|
page: [{
|
|
43
43
|
title: __('All pages'),
|
|
44
44
|
slug: 'all',
|
|
45
|
+
icon: pages,
|
|
45
46
|
view: DEFAULT_PAGE_BASE
|
|
46
47
|
}, {
|
|
47
48
|
title: __('Drafts'),
|
|
48
49
|
slug: 'drafts',
|
|
50
|
+
icon: drafts,
|
|
49
51
|
view: {
|
|
50
52
|
...DEFAULT_PAGE_BASE,
|
|
51
53
|
filters: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","trash","LAYOUT_LIST","LAYOUT_TABLE","LAYOUT_GRID","OPERATOR_IN","DEFAULT_CONFIG_PER_VIEW_TYPE","primaryField","mediaField","DEFAULT_PAGE_BASE","type","search","filters","page","perPage","sort","field","direction","hiddenFields","layout","DEFAULT_VIEWS","title","slug","view","operator","value"
|
|
1
|
+
{"version":3,"names":["__","trash","pages","drafts","LAYOUT_LIST","LAYOUT_TABLE","LAYOUT_GRID","OPERATOR_IN","DEFAULT_CONFIG_PER_VIEW_TYPE","primaryField","mediaField","DEFAULT_PAGE_BASE","type","search","filters","page","perPage","sort","field","direction","hiddenFields","layout","DEFAULT_VIEWS","title","slug","icon","view","operator","value"],"sources":["@wordpress/edit-site/src/components/sidebar-dataviews/default-views.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { trash, pages, drafts } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport {\n\tLAYOUT_LIST,\n\tLAYOUT_TABLE,\n\tLAYOUT_GRID,\n\tOPERATOR_IN,\n} from '../../utils/constants';\n\nexport const DEFAULT_CONFIG_PER_VIEW_TYPE = {\n\t[ LAYOUT_TABLE ]: {\n\t\tprimaryField: 'title',\n\t},\n\t[ LAYOUT_GRID ]: {\n\t\tmediaField: 'featured-image',\n\t\tprimaryField: 'title',\n\t},\n\t[ LAYOUT_LIST ]: {\n\t\tprimaryField: 'title',\n\t\tmediaField: 'featured-image',\n\t},\n};\n\nconst DEFAULT_PAGE_BASE = {\n\ttype: LAYOUT_TABLE,\n\tsearch: '',\n\tfilters: [],\n\tpage: 1,\n\tperPage: 20,\n\tsort: {\n\t\tfield: 'date',\n\t\tdirection: 'desc',\n\t},\n\t// All fields are visible by default, so it's\n\t// better to keep track of the hidden ones.\n\thiddenFields: [ 'date', 'featured-image' ],\n\tlayout: {\n\t\t...DEFAULT_CONFIG_PER_VIEW_TYPE[ LAYOUT_TABLE ],\n\t},\n};\n\nexport const DEFAULT_VIEWS = {\n\tpage: [\n\t\t{\n\t\t\ttitle: __( 'All pages' ),\n\t\t\tslug: 'all',\n\t\t\ticon: pages,\n\t\t\tview: DEFAULT_PAGE_BASE,\n\t\t},\n\t\t{\n\t\t\ttitle: __( 'Drafts' ),\n\t\t\tslug: 'drafts',\n\t\t\ticon: drafts,\n\t\t\tview: {\n\t\t\t\t...DEFAULT_PAGE_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{ field: 'status', operator: OPERATOR_IN, value: 'draft' },\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\ttitle: __( 'Trash' ),\n\t\t\tslug: 'trash',\n\t\t\ticon: trash,\n\t\t\tview: {\n\t\t\t\t...DEFAULT_PAGE_BASE,\n\t\t\t\tfilters: [\n\t\t\t\t\t{ field: 'status', operator: OPERATOR_IN, value: 'trash' },\n\t\t\t\t],\n\t\t\t},\n\t\t},\n\t],\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,EAAEC,KAAK,EAAEC,MAAM,QAAQ,kBAAkB;;AAEvD;AACA;AACA;AACA,SACCC,WAAW,EACXC,YAAY,EACZC,WAAW,EACXC,WAAW,QACL,uBAAuB;AAE9B,OAAO,MAAMC,4BAA4B,GAAG;EAC3C,CAAEH,YAAY,GAAI;IACjBI,YAAY,EAAE;EACf,CAAC;EACD,CAAEH,WAAW,GAAI;IAChBI,UAAU,EAAE,gBAAgB;IAC5BD,YAAY,EAAE;EACf,CAAC;EACD,CAAEL,WAAW,GAAI;IAChBK,YAAY,EAAE,OAAO;IACrBC,UAAU,EAAE;EACb;AACD,CAAC;AAED,MAAMC,iBAAiB,GAAG;EACzBC,IAAI,EAAEP,YAAY;EAClBQ,MAAM,EAAE,EAAE;EACVC,OAAO,EAAE,EAAE;EACXC,IAAI,EAAE,CAAC;EACPC,OAAO,EAAE,EAAE;EACXC,IAAI,EAAE;IACLC,KAAK,EAAE,MAAM;IACbC,SAAS,EAAE;EACZ,CAAC;EACD;EACA;EACAC,YAAY,EAAE,CAAE,MAAM,EAAE,gBAAgB,CAAE;EAC1CC,MAAM,EAAE;IACP,GAAGb,4BAA4B,CAAEH,YAAY;EAC9C;AACD,CAAC;AAED,OAAO,MAAMiB,aAAa,GAAG;EAC5BP,IAAI,EAAE,CACL;IACCQ,KAAK,EAAEvB,EAAE,CAAE,WAAY,CAAC;IACxBwB,IAAI,EAAE,KAAK;IACXC,IAAI,EAAEvB,KAAK;IACXwB,IAAI,EAAEf;EACP,CAAC,EACD;IACCY,KAAK,EAAEvB,EAAE,CAAE,QAAS,CAAC;IACrBwB,IAAI,EAAE,QAAQ;IACdC,IAAI,EAAEtB,MAAM;IACZuB,IAAI,EAAE;MACL,GAAGf,iBAAiB;MACpBG,OAAO,EAAE,CACR;QAAEI,KAAK,EAAE,QAAQ;QAAES,QAAQ,EAAEpB,WAAW;QAAEqB,KAAK,EAAE;MAAQ,CAAC;IAE5D;EACD,CAAC,EACD;IACCL,KAAK,EAAEvB,EAAE,CAAE,OAAQ,CAAC;IACpBwB,IAAI,EAAE,OAAO;IACbC,IAAI,EAAExB,KAAK;IACXyB,IAAI,EAAE;MACL,GAAGf,iBAAiB;MACpBG,OAAO,EAAE,CACR;QAAEI,KAAK,EAAE,QAAQ;QAAES,QAAQ,EAAEpB,WAAW;QAAEqB,KAAK,EAAE;MAAQ,CAAC;IAE5D;EACD,CAAC;AAEH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Button","ToggleControl","Dropdown","__experimentalText","Text","__experimentalVStack","VStack","TextControl","RadioControl","VisuallyHidden","__","useDispatch","useState","useMemo","store","coreStore","noticesStore","__experimentalInspectorPopoverHeader","InspectorPopoverHeader","useInstanceId","privateApis","editorPrivateApis","StatusLabel","unlock","PostPanelRow","STATUS_OPTIONS","label","createElement","Fragment","variant","value","PageStatus","postType","postId","status","password","date","showPassword","setShowPassword","instanceId","editEntityRecord","createErrorNotice","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","saveStatus","newStatus","newPassword","newDate","error","errorMessage","message","code","type","handleTogglePassword","handleStatus","Date","setDate","getDate","contentClassName","focusOnMount","ref","renderToggle","onToggle","className","onClick","renderContent","onClose","title","spacing","hideLabelFromVision","options","onChange","selected","as","size","lineHeight","weight","upperCase","checked","htmlFor","placeholder","id"],"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/page-panels/page-status.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tToggleControl,\n\tDropdown,\n\t__experimentalText as Text,\n\t__experimentalVStack as VStack,\n\tTextControl,\n\tRadioControl,\n\tVisuallyHidden,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { useState, useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\nimport { useInstanceId } from '@wordpress/compose';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport StatusLabel from '../../sidebar-navigation-screen-page/status-label';\nimport { unlock } from '../../../lock-unlock';\n\nconst { PostPanelRow } = unlock( editorPrivateApis );\n\nconst STATUS_OPTIONS = [\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Draft' ) }\n\t\t\t\t<Text variant=\"muted\">{ __( 'Not ready to publish.' ) }</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'draft',\n\t},\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Pending' ) }\n\t\t\t\t<Text variant=\"muted\">\n\t\t\t\t\t{ __( 'Waiting for review before publishing.' ) }\n\t\t\t\t</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'pending',\n\t},\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Private' ) }\n\t\t\t\t<Text variant=\"muted\">\n\t\t\t\t\t{ __( 'Only visible to site admins and editors.' ) }\n\t\t\t\t</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'private',\n\t},\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Scheduled' ) }\n\t\t\t\t<Text variant=\"muted\">\n\t\t\t\t\t{ __( 'Publish automatically on a chosen date.' ) }\n\t\t\t\t</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'future',\n\t},\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Published' ) }\n\t\t\t\t<Text variant=\"muted\">{ __( 'Visible to everyone.' ) }</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'publish',\n\t},\n];\n\nexport default function PageStatus( {\n\tpostType,\n\tpostId,\n\tstatus,\n\tpassword,\n\tdate,\n} ) {\n\tconst [ showPassword, setShowPassword ] = useState( !! password );\n\tconst instanceId = useInstanceId( PageStatus );\n\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\t'aria-label': __( 'Change status' ),\n\t\t\tplacement: 'bottom-end',\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\tconst saveStatus = async ( {\n\t\tstatus: newStatus = status,\n\t\tpassword: newPassword = password,\n\t\tdate: newDate = date,\n\t} ) => {\n\t\ttry {\n\t\t\tawait editEntityRecord( 'postType', postType, postId, {\n\t\t\t\tstatus: newStatus,\n\t\t\t\tdate: newDate,\n\t\t\t\tpassword: newPassword,\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'An error occurred while updating the status' );\n\n\t\t\tcreateErrorNotice( errorMessage, {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t}\n\t};\n\n\tconst handleTogglePassword = ( value ) => {\n\t\tsetShowPassword( value );\n\t\tif ( ! value ) {\n\t\t\tsaveStatus( { password: '' } );\n\t\t}\n\t};\n\n\tconst handleStatus = ( value ) => {\n\t\tlet newDate = date;\n\t\tlet newPassword = password;\n\t\tif ( value === 'publish' ) {\n\t\t\tif ( new Date( date ) > new Date() ) {\n\t\t\t\tnewDate = null;\n\t\t\t}\n\t\t} else if ( value === 'future' ) {\n\t\t\tif ( ! date || new Date( date ) < new Date() ) {\n\t\t\t\tnewDate = new Date();\n\t\t\t\tnewDate.setDate( newDate.getDate() + 7 );\n\t\t\t}\n\t\t} else if ( value === 'private' && password ) {\n\t\t\tsetShowPassword( false );\n\t\t\tnewPassword = '';\n\t\t}\n\t\tsaveStatus( {\n\t\t\tstatus: value,\n\t\t\tdate: newDate,\n\t\t\tpassword: newPassword,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<PostPanelRow label={ __( 'Status' ) }>\n\t\t\t<Dropdown\n\t\t\t\tcontentClassName=\"edit-site-change-status__content\"\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\tfocusOnMount\n\t\t\t\tref={ setPopoverAnchor }\n\t\t\t\trenderToggle={ ( { onToggle } ) => (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"edit-site-summary-field__trigger\"\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t>\n\t\t\t\t\t\t<StatusLabel\n\t\t\t\t\t\t\tstatus={ password ? 'protected' : status }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<InspectorPopoverHeader\n\t\t\t\t\t\t\ttitle={ __( 'Status' ) }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<form>\n\t\t\t\t\t\t\t<VStack spacing={ 5 }>\n\t\t\t\t\t\t\t\t<RadioControl\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-change-status__options\"\n\t\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Status' ) }\n\t\t\t\t\t\t\t\t\toptions={ STATUS_OPTIONS }\n\t\t\t\t\t\t\t\t\tonChange={ handleStatus }\n\t\t\t\t\t\t\t\t\tselected={ status }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ status !== 'private' && (\n\t\t\t\t\t\t\t\t\t<fieldset className=\"edit-site-change-status__password-fieldset\">\n\t\t\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\t\t\tas=\"legend\"\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-change-status__password-legend\"\n\t\t\t\t\t\t\t\t\t\t\tsize=\"11\"\n\t\t\t\t\t\t\t\t\t\t\tlineHeight={ 1.4 }\n\t\t\t\t\t\t\t\t\t\t\tweight={ 500 }\n\t\t\t\t\t\t\t\t\t\t\tupperCase={ true }\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Password' ) }\n\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Hide this page behind a password'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\tchecked={ showPassword }\n\t\t\t\t\t\t\t\t\t\t\tonChange={ handleTogglePassword }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t{ showPassword && (\n\t\t\t\t\t\t\t\t\t\t\t<div className=\"edit-site-change-status__password-input\">\n\t\t\t\t\t\t\t\t\t\t\t\t<VisuallyHidden\n\t\t\t\t\t\t\t\t\t\t\t\t\tas=\"label\"\n\t\t\t\t\t\t\t\t\t\t\t\t\thtmlFor={ `edit-site-change-status__password-input-${ instanceId }` }\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Create password' ) }\n\t\t\t\t\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsaveStatus( {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpassword: value,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={ password }\n\t\t\t\t\t\t\t\t\t\t\t\t\tplaceholder={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Use a secure password'\n\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tid={ `edit-site-change-status__password-input-${ instanceId }` }\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t/>\n\t\t</PostPanelRow>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,MAAM,EACNC,aAAa,EACbC,QAAQ,EACRC,kBAAkB,IAAIC,IAAI,EAC1BC,oBAAoB,IAAIC,MAAM,EAC9BC,WAAW,EACXC,YAAY,EACZC,cAAc,QACR,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,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BtE,EAAE,CAAE,UAAW,CACZ,CAAC,EACPiB,aAAA,CAAC1B,aAAa;MACbyB,KAAK,EAAGhB,EAAE,CACT,kCACD,CAAG;MACHuE,OAAO,EAAG5C,YAAc;MACxBqC,QAAQ,EAAGlB;IAAsB,CACjC,CAAC,EACAnB,YAAY,IACbV,aAAA;MAAKuC,SAAS,EAAC;IAAyC,GACvDvC,aAAA,CAAClB,cAAc;MACdmE,EAAE,EAAC,OAAO;MACVM,OAAO,EAAI,2CAA2C3C,UAAY;IAAG,GAEnE7B,EAAE,CAAE,iBAAkB,CACT,CAAC,EACjBiB,aAAA,CAACpB,WAAW;MACXmE,QAAQ,EAAK5C,KAAK,IACjBiB,UAAU,CAAE;QACXZ,QAAQ,EAAEL;MACX,CAAE,CACF;MACDA,KAAK,EAAGK,QAAU;MAClBgD,WAAW,EAAGzE,EAAE,CACf,uBACD,CAAG;MACH6C,IAAI,EAAC,MAAM;MACX6B,EAAE,EAAI,2CAA2C7C,UAAY;IAAG,CAChE,CACG,CAEG,CAEJ,CACH,CACL;EACA,CACH,CACY,CAAC;AAEjB"}
|
|
1
|
+
{"version":3,"names":["Button","ToggleControl","Dropdown","__experimentalText","Text","__experimentalVStack","VStack","TextControl","RadioControl","VisuallyHidden","__","useDispatch","useState","useMemo","store","coreStore","noticesStore","__experimentalInspectorPopoverHeader","InspectorPopoverHeader","useInstanceId","privateApis","editorPrivateApis","StatusLabel","unlock","PostPanelRow","STATUS_OPTIONS","label","createElement","Fragment","variant","value","PageStatus","postType","postId","status","password","date","showPassword","setShowPassword","instanceId","editEntityRecord","createErrorNotice","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","saveStatus","newStatus","newPassword","newDate","error","errorMessage","message","code","type","handleTogglePassword","handleStatus","Date","setDate","getDate","contentClassName","focusOnMount","ref","renderToggle","onToggle","className","onClick","renderContent","onClose","title","spacing","hideLabelFromVision","options","onChange","selected","as","size","lineHeight","weight","upperCase","checked","htmlFor","placeholder","id"],"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/page-panels/page-status.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tToggleControl,\n\tDropdown,\n\t__experimentalText as Text,\n\t__experimentalVStack as VStack,\n\tTextControl,\n\tRadioControl,\n\tVisuallyHidden,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { useState, useMemo } from '@wordpress/element';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\nimport { useInstanceId } from '@wordpress/compose';\nimport { privateApis as editorPrivateApis } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport StatusLabel from '../../sidebar-navigation-screen-page/status-label';\nimport { unlock } from '../../../lock-unlock';\n\nconst { PostPanelRow } = unlock( editorPrivateApis );\n\nconst STATUS_OPTIONS = [\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Draft' ) }\n\t\t\t\t<Text variant=\"muted\">{ __( 'Not ready to publish.' ) }</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'draft',\n\t},\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Pending' ) }\n\t\t\t\t<Text variant=\"muted\">\n\t\t\t\t\t{ __( 'Waiting for review before publishing.' ) }\n\t\t\t\t</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'pending',\n\t},\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Private' ) }\n\t\t\t\t<Text variant=\"muted\">\n\t\t\t\t\t{ __( 'Only visible to site admins and editors.' ) }\n\t\t\t\t</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'private',\n\t},\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Scheduled' ) }\n\t\t\t\t<Text variant=\"muted\">\n\t\t\t\t\t{ __( 'Publish automatically on a chosen date.' ) }\n\t\t\t\t</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'future',\n\t},\n\t{\n\t\tlabel: (\n\t\t\t<>\n\t\t\t\t{ __( 'Published' ) }\n\t\t\t\t<Text variant=\"muted\">{ __( 'Visible to everyone.' ) }</Text>\n\t\t\t</>\n\t\t),\n\t\tvalue: 'publish',\n\t},\n];\n\nexport default function PageStatus( {\n\tpostType,\n\tpostId,\n\tstatus,\n\tpassword,\n\tdate,\n} ) {\n\tconst [ showPassword, setShowPassword ] = useState( !! password );\n\tconst instanceId = useInstanceId( PageStatus );\n\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\t'aria-label': __( 'Change status' ),\n\t\t\tplacement: 'bottom-end',\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\tconst saveStatus = async ( {\n\t\tstatus: newStatus = status,\n\t\tpassword: newPassword = password,\n\t\tdate: newDate = date,\n\t} ) => {\n\t\ttry {\n\t\t\tawait editEntityRecord( 'postType', postType, postId, {\n\t\t\t\tstatus: newStatus,\n\t\t\t\tdate: newDate,\n\t\t\t\tpassword: newPassword,\n\t\t\t} );\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'An error occurred while updating the status' );\n\n\t\t\tcreateErrorNotice( errorMessage, {\n\t\t\t\ttype: 'snackbar',\n\t\t\t} );\n\t\t}\n\t};\n\n\tconst handleTogglePassword = ( value ) => {\n\t\tsetShowPassword( value );\n\t\tif ( ! value ) {\n\t\t\tsaveStatus( { password: '' } );\n\t\t}\n\t};\n\n\tconst handleStatus = ( value ) => {\n\t\tlet newDate = date;\n\t\tlet newPassword = password;\n\t\tif ( value === 'publish' ) {\n\t\t\tif ( new Date( date ) > new Date() ) {\n\t\t\t\tnewDate = null;\n\t\t\t}\n\t\t} else if ( value === 'future' ) {\n\t\t\tif ( ! date || new Date( date ) < new Date() ) {\n\t\t\t\tnewDate = new Date();\n\t\t\t\tnewDate.setDate( newDate.getDate() + 7 );\n\t\t\t}\n\t\t} else if ( value === 'private' && password ) {\n\t\t\tsetShowPassword( false );\n\t\t\tnewPassword = '';\n\t\t}\n\t\tsaveStatus( {\n\t\t\tstatus: value,\n\t\t\tdate: newDate,\n\t\t\tpassword: newPassword,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<PostPanelRow label={ __( 'Status' ) }>\n\t\t\t<Dropdown\n\t\t\t\tcontentClassName=\"edit-site-change-status__content\"\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\tfocusOnMount\n\t\t\t\tref={ setPopoverAnchor }\n\t\t\t\trenderToggle={ ( { onToggle } ) => (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tclassName=\"edit-site-summary-field__trigger\"\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t>\n\t\t\t\t\t\t<StatusLabel\n\t\t\t\t\t\t\tstatus={ password ? 'protected' : status }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<InspectorPopoverHeader\n\t\t\t\t\t\t\ttitle={ __( 'Status' ) }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<form>\n\t\t\t\t\t\t\t<VStack spacing={ 5 }>\n\t\t\t\t\t\t\t\t<RadioControl\n\t\t\t\t\t\t\t\t\tclassName=\"edit-site-change-status__options\"\n\t\t\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\t\t\tlabel={ __( 'Status' ) }\n\t\t\t\t\t\t\t\t\toptions={ STATUS_OPTIONS }\n\t\t\t\t\t\t\t\t\tonChange={ handleStatus }\n\t\t\t\t\t\t\t\t\tselected={ status }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ status !== 'private' && (\n\t\t\t\t\t\t\t\t\t<fieldset className=\"edit-site-change-status__password-fieldset\">\n\t\t\t\t\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\t\t\t\t\tas=\"legend\"\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"edit-site-change-status__password-legend\"\n\t\t\t\t\t\t\t\t\t\t\tsize=\"11\"\n\t\t\t\t\t\t\t\t\t\t\tlineHeight={ 1.4 }\n\t\t\t\t\t\t\t\t\t\t\tweight={ 500 }\n\t\t\t\t\t\t\t\t\t\t\tupperCase\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{ __( 'Password' ) }\n\t\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t\t\t\tlabel={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Hide this page behind a password'\n\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\tchecked={ showPassword }\n\t\t\t\t\t\t\t\t\t\t\tonChange={ handleTogglePassword }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t{ showPassword && (\n\t\t\t\t\t\t\t\t\t\t\t<div className=\"edit-site-change-status__password-input\">\n\t\t\t\t\t\t\t\t\t\t\t\t<VisuallyHidden\n\t\t\t\t\t\t\t\t\t\t\t\t\tas=\"label\"\n\t\t\t\t\t\t\t\t\t\t\t\t\thtmlFor={ `edit-site-change-status__password-input-${ instanceId }` }\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ __( 'Create password' ) }\n\t\t\t\t\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t\t\t\t\t\t<TextControl\n\t\t\t\t\t\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsaveStatus( {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpassword: value,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tvalue={ password }\n\t\t\t\t\t\t\t\t\t\t\t\t\tplaceholder={ __(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Use a secure password'\n\t\t\t\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tid={ `edit-site-change-status__password-input-${ instanceId }` }\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t</fieldset>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</VStack>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t/>\n\t\t</PostPanelRow>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,MAAM,EACNC,aAAa,EACbC,QAAQ,EACRC,kBAAkB,IAAIC,IAAI,EAC1BC,oBAAoB,IAAIC,MAAM,EAC9BC,WAAW,EACXC,YAAY,EACZC,cAAc,QACR,uBAAuB;AAC9B,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,QAAQ,EAAEC,OAAO,QAAQ,oBAAoB;AACtD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASD,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ACHuE,OAAO,EAAG5C,YAAc;MACxBqC,QAAQ,EAAGlB;IAAsB,CACjC,CAAC,EACAnB,YAAY,IACbV,aAAA;MAAKuC,SAAS,EAAC;IAAyC,GACvDvC,aAAA,CAAClB,cAAc;MACdmE,EAAE,EAAC,OAAO;MACVM,OAAO,EAAI,2CAA2C3C,UAAY;IAAG,GAEnE7B,EAAE,CAAE,iBAAkB,CACT,CAAC,EACjBiB,aAAA,CAACpB,WAAW;MACXmE,QAAQ,EAAK5C,KAAK,IACjBiB,UAAU,CAAE;QACXZ,QAAQ,EAAEL;MACX,CAAE,CACF;MACDA,KAAK,EAAGK,QAAU;MAClBgD,WAAW,EAAGzE,EAAE,CACf,uBACD,CAAG;MACH6C,IAAI,EAAC,MAAM;MACX6B,EAAE,EAAI,2CAA2C7C,UAAY;IAAG,CAChE,CACG,CAEG,CAEJ,CACH,CACL;EACA,CACH,CACY,CAAC;AAEjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","useDispatch","PanelBody","PanelRow","PageAttributesPanel","PostDiscussionPanel","PostExcerptPanel","PostFeaturedImagePanel","PostLastRevisionPanel","PostTaxonomiesPanel","store","editorStore","coreStore","decodeEntities","navigation","symbol","__","useAsyncList","serialize","__experimentalBlockPatternsList","BlockPatternsList","editSiteStore","TemplateActions","TemplateAreas","SidebarCard","useAvailablePatterns","TEMPLATE_PART_POST_TYPE","CARD_ICONS","wp_block","wp_navigation","TemplatesList","availableTemplates","onSelect","shownTemplates","length","createElement","label","blockPatterns","shownPatterns","onClickPattern","showTitlesAsTooltip","TemplatePanel","_CARD_ICONS$record$ty","title","description","icon","record","postType","postId","select","getEditedPostType","getEditedPostId","getEditedEntityRecord","__experimentalGetTemplateInfo","getTemplateInfo","type","_postId","_record","info","availablePatterns","editEntityRecord","onTemplateSelect","selectedTemplate","blocks","content","Fragment","className","actions","template","initialOpen"],"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/template-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { PanelBody, PanelRow } from '@wordpress/components';\nimport {\n\tPageAttributesPanel,\n\tPostDiscussionPanel,\n\tPostExcerptPanel,\n\tPostFeaturedImagePanel,\n\tPostLastRevisionPanel,\n\tPostTaxonomiesPanel,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { navigation, symbol } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { useAsyncList } from '@wordpress/compose';\nimport { serialize } from '@wordpress/blocks';\nimport { __experimentalBlockPatternsList as BlockPatternsList } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../../store';\nimport TemplateActions from './template-actions';\nimport TemplateAreas from './template-areas';\nimport SidebarCard from '../sidebar-card';\nimport { useAvailablePatterns } from './hooks';\nimport { TEMPLATE_PART_POST_TYPE } from '../../../utils/constants';\n\nconst CARD_ICONS = {\n\twp_block: symbol,\n\twp_navigation: navigation,\n};\n\nfunction TemplatesList( { availableTemplates, onSelect } ) {\n\tconst shownTemplates = useAsyncList( availableTemplates );\n\tif ( ! availableTemplates || availableTemplates?.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockPatternsList\n\t\t\tlabel={ __( 'Templates' ) }\n\t\t\tblockPatterns={ availableTemplates }\n\t\t\tshownPatterns={ shownTemplates }\n\t\t\tonClickPattern={ onSelect }\n\t\t\tshowTitlesAsTooltip
|
|
1
|
+
{"version":3,"names":["useSelect","useDispatch","PanelBody","PanelRow","PageAttributesPanel","PostDiscussionPanel","PostExcerptPanel","PostFeaturedImagePanel","PostLastRevisionPanel","PostTaxonomiesPanel","store","editorStore","coreStore","decodeEntities","navigation","symbol","__","useAsyncList","serialize","__experimentalBlockPatternsList","BlockPatternsList","editSiteStore","TemplateActions","TemplateAreas","SidebarCard","useAvailablePatterns","TEMPLATE_PART_POST_TYPE","CARD_ICONS","wp_block","wp_navigation","TemplatesList","availableTemplates","onSelect","shownTemplates","length","createElement","label","blockPatterns","shownPatterns","onClickPattern","showTitlesAsTooltip","TemplatePanel","_CARD_ICONS$record$ty","title","description","icon","record","postType","postId","select","getEditedPostType","getEditedPostId","getEditedEntityRecord","__experimentalGetTemplateInfo","getTemplateInfo","type","_postId","_record","info","availablePatterns","editEntityRecord","onTemplateSelect","selectedTemplate","blocks","content","Fragment","className","actions","template","initialOpen"],"sources":["@wordpress/edit-site/src/components/sidebar-edit-mode/template-panel/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { PanelBody, PanelRow } from '@wordpress/components';\nimport {\n\tPageAttributesPanel,\n\tPostDiscussionPanel,\n\tPostExcerptPanel,\n\tPostFeaturedImagePanel,\n\tPostLastRevisionPanel,\n\tPostTaxonomiesPanel,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { navigation, symbol } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { useAsyncList } from '@wordpress/compose';\nimport { serialize } from '@wordpress/blocks';\nimport { __experimentalBlockPatternsList as BlockPatternsList } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../../store';\nimport TemplateActions from './template-actions';\nimport TemplateAreas from './template-areas';\nimport SidebarCard from '../sidebar-card';\nimport { useAvailablePatterns } from './hooks';\nimport { TEMPLATE_PART_POST_TYPE } from '../../../utils/constants';\n\nconst CARD_ICONS = {\n\twp_block: symbol,\n\twp_navigation: navigation,\n};\n\nfunction TemplatesList( { availableTemplates, onSelect } ) {\n\tconst shownTemplates = useAsyncList( availableTemplates );\n\tif ( ! availableTemplates || availableTemplates?.length === 0 ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockPatternsList\n\t\t\tlabel={ __( 'Templates' ) }\n\t\t\tblockPatterns={ availableTemplates }\n\t\t\tshownPatterns={ shownTemplates }\n\t\t\tonClickPattern={ onSelect }\n\t\t\tshowTitlesAsTooltip\n\t\t/>\n\t);\n}\n\nexport default function TemplatePanel() {\n\tconst { title, description, icon, record, postType, postId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEditedPostType, getEditedPostId } =\n\t\t\t\tselect( editSiteStore );\n\t\t\tconst { getEditedEntityRecord } = select( coreStore );\n\t\t\tconst { __experimentalGetTemplateInfo: getTemplateInfo } =\n\t\t\t\tselect( editorStore );\n\n\t\t\tconst type = getEditedPostType();\n\t\t\tconst _postId = getEditedPostId();\n\t\t\tconst _record = getEditedEntityRecord( 'postType', type, _postId );\n\t\t\tconst info = getTemplateInfo( _record );\n\n\t\t\treturn {\n\t\t\t\ttitle: info.title,\n\t\t\t\tdescription: info.description,\n\t\t\t\ticon: info.icon,\n\t\t\t\trecord: _record,\n\t\t\t\tpostType: type,\n\t\t\t\tpostId: _postId,\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst availablePatterns = useAvailablePatterns( record );\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\n\tif ( ! title && ! description ) {\n\t\treturn null;\n\t}\n\n\tconst onTemplateSelect = async ( selectedTemplate ) => {\n\t\tawait editEntityRecord( 'postType', postType, postId, {\n\t\t\tblocks: selectedTemplate.blocks,\n\t\t\tcontent: serialize( selectedTemplate.blocks ),\n\t\t} );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<PanelBody>\n\t\t\t\t<SidebarCard\n\t\t\t\t\tclassName=\"edit-site-template-card\"\n\t\t\t\t\ttitle={ decodeEntities( title ) }\n\t\t\t\t\ticon={ CARD_ICONS[ record?.type ] ?? icon }\n\t\t\t\t\tdescription={ decodeEntities( description ) }\n\t\t\t\t\tactions={ <TemplateActions template={ record } /> }\n\t\t\t\t>\n\t\t\t\t\t<TemplateAreas />\n\t\t\t\t</SidebarCard>\n\t\t\t</PanelBody>\n\t\t\t{ availablePatterns?.length > 0 && (\n\t\t\t\t<PanelBody\n\t\t\t\t\ttitle={ __( 'Transform into:' ) }\n\t\t\t\t\tinitialOpen={ postType === TEMPLATE_PART_POST_TYPE }\n\t\t\t\t>\n\t\t\t\t\t<PanelRow>\n\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'Choose a predefined pattern to switch up the look of your template.' // TODO - make this dynamic?\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</PanelRow>\n\n\t\t\t\t\t<TemplatesList\n\t\t\t\t\t\tavailableTemplates={ availablePatterns }\n\t\t\t\t\t\tonSelect={ onTemplateSelect }\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t) }\n\t\t\t<PostLastRevisionPanel />\n\t\t\t<PostTaxonomiesPanel />\n\t\t\t<PostFeaturedImagePanel />\n\t\t\t<PostExcerptPanel />\n\t\t\t<PostDiscussionPanel />\n\t\t\t<PageAttributesPanel />\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,SAAS,EAAEC,QAAQ,QAAQ,uBAAuB;AAC3D,SACCC,mBAAmB,EACnBC,mBAAmB,EACnBC,gBAAgB,EAChBC,sBAAsB,EACtBC,qBAAqB,EACrBC,mBAAmB,EACnBC,KAAK,IAAIC,WAAW,QACd,mBAAmB;AAC1B,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;AACzD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,UAAU,EAAEC,MAAM,QAAQ,kBAAkB;AACrD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SAASC,SAAS,QAAQ,mBAAmB;AAC7C,SAASC,+BAA+B,IAAIC,iBAAiB,QAAQ,yBAAyB;;AAE9F;AACA;AACA;AACA,S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,CAAE;EAAG,GAEnDX,aAAA,CAACZ,aAAa,MAAE,CACJ,CACH,CAAC,EACVoC,iBAAiB,EAAEzB,MAAM,GAAG,CAAC,IAC9BC,aAAA,CAACjC,SAAS;IACTyC,KAAK,EAAG3B,EAAE,CAAE,iBAAkB,CAAG;IACjCqD,WAAW,EAAGtB,QAAQ,KAAKrB;EAAyB,GAEpDS,aAAA,CAAChC,QAAQ,QACRgC,aAAA,YACGnB,EAAE,CACH,qEAAqE,CAAC;EACvE,CACE,CACM,CAAC,EAEXmB,aAAA,CAACL,aAAa;IACbC,kBAAkB,EAAG4B,iBAAmB;IACxC3B,QAAQ,EAAG6B;EAAkB,CAC7B,CACS,CACX,EACD1B,aAAA,CAAC3B,qBAAqB,MAAE,CAAC,EACzB2B,aAAA,CAAC1B,mBAAmB,MAAE,CAAC,EACvB0B,aAAA,CAAC5B,sBAAsB,MAAE,CAAC,EAC1B4B,aAAA,CAAC7B,gBAAgB,MAAE,CAAC,EACpB6B,aAAA,CAAC9B,mBAAmB,MAAE,CAAC,EACvB8B,aAAA,CAAC/B,mBAAmB,MAAE,CACrB,CAAC;AAEL"}
|
|
@@ -16,7 +16,6 @@ import SidebarNavigationItem from '../sidebar-navigation-item';
|
|
|
16
16
|
import { SidebarNavigationItemGlobalStyles } from '../sidebar-navigation-screen-global-styles';
|
|
17
17
|
import { unlock } from '../../lock-unlock';
|
|
18
18
|
import { store as editSiteStore } from '../../store';
|
|
19
|
-
import TemplatePartHint from './template-part-hint';
|
|
20
19
|
export default function SidebarNavigationScreenMain() {
|
|
21
20
|
const {
|
|
22
21
|
location
|
|
@@ -58,7 +57,7 @@ export default function SidebarNavigationScreenMain() {
|
|
|
58
57
|
path: "/patterns",
|
|
59
58
|
withChevron: true,
|
|
60
59
|
icon: symbol
|
|
61
|
-
}, __('Patterns')))
|
|
60
|
+
}, __('Patterns'))))
|
|
62
61
|
});
|
|
63
62
|
}
|
|
64
63
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__experimentalItemGroup","ItemGroup","__experimentalNavigatorButton","NavigatorButton","__experimentalUseNavigator","useNavigator","__","layout","symbol","navigation","styles","page","useDispatch","useEffect","SidebarNavigationScreen","SidebarNavigationItem","SidebarNavigationItemGlobalStyles","unlock","store","editSiteStore","
|
|
1
|
+
{"version":3,"names":["__experimentalItemGroup","ItemGroup","__experimentalNavigatorButton","NavigatorButton","__experimentalUseNavigator","useNavigator","__","layout","symbol","navigation","styles","page","useDispatch","useEffect","SidebarNavigationScreen","SidebarNavigationItem","SidebarNavigationItemGlobalStyles","unlock","store","editSiteStore","SidebarNavigationScreenMain","location","setEditorCanvasContainerView","path","undefined","createElement","isRoot","title","description","content","Fragment","as","withChevron","icon"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-main/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalItemGroup as ItemGroup,\n\t__experimentalNavigatorButton as NavigatorButton,\n\t__experimentalUseNavigator as useNavigator,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { layout, symbol, navigation, styles, page } from '@wordpress/icons';\nimport { useDispatch } from '@wordpress/data';\n\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { SidebarNavigationItemGlobalStyles } from '../sidebar-navigation-screen-global-styles';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\n\nexport default function SidebarNavigationScreenMain() {\n\tconst { location } = useNavigator();\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\n\t// Clear the editor canvas container view when accessing the main navigation screen.\n\tuseEffect( () => {\n\t\tif ( location?.path === '/' ) {\n\t\t\tsetEditorCanvasContainerView( undefined );\n\t\t}\n\t}, [ setEditorCanvasContainerView, location?.path ] );\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tisRoot\n\t\t\ttitle={ __( 'Design' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Customize the appearance of your website using the block editor.'\n\t\t\t) }\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t<ItemGroup>\n\t\t\t\t\t\t<NavigatorButton\n\t\t\t\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\t\t\t\tpath=\"/navigation\"\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ navigation }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Navigation' ) }\n\t\t\t\t\t\t</NavigatorButton>\n\t\t\t\t\t\t<SidebarNavigationItemGlobalStyles\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ styles }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Styles' ) }\n\t\t\t\t\t\t</SidebarNavigationItemGlobalStyles>\n\t\t\t\t\t\t<NavigatorButton\n\t\t\t\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\t\t\t\tpath=\"/page\"\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ page }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Pages' ) }\n\t\t\t\t\t\t</NavigatorButton>\n\t\t\t\t\t\t<NavigatorButton\n\t\t\t\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\t\t\t\tpath=\"/wp_template\"\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ layout }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Templates' ) }\n\t\t\t\t\t\t</NavigatorButton>\n\t\t\t\t\t\t<NavigatorButton\n\t\t\t\t\t\t\tas={ SidebarNavigationItem }\n\t\t\t\t\t\t\tpath=\"/patterns\"\n\t\t\t\t\t\t\twithChevron\n\t\t\t\t\t\t\ticon={ symbol }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __(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AAA,CAACtB,eAAe;MACf4B,EAAE,EAAGhB,qBAAuB;MAC5BQ,IAAI,EAAC,aAAa;MAClBS,WAAW;MACXC,IAAI,EAAGxB;IAAY,GAEjBH,EAAE,CAAE,YAAa,CACH,CAAC,EAClBmB,aAAA,CAACT,iCAAiC;MACjCgB,WAAW;MACXC,IAAI,EAAGvB;IAAQ,GAEbJ,EAAE,CAAE,QAAS,CACmB,CAAC,EACpCmB,aAAA,CAACtB,eAAe;MACf4B,EAAE,EAAGhB,qBAAuB;MAC5BQ,IAAI,EAAC,OAAO;MACZS,WAAW;MACXC,IAAI,EAAGtB;IAAM,GAEXL,EAAE,CAAE,OAAQ,CACE,CAAC,EAClBmB,aAAA,CAACtB,eAAe;MACf4B,EAAE,EAAGhB,qBAAuB;MAC5BQ,IAAI,EAAC,cAAc;MACnBS,WAAW;MACXC,IAAI,EAAG1B;IAAQ,GAEbD,EAAE,CAAE,WAAY,CACF,CAAC,EAClBmB,aAAA,CAACtB,eAAe;MACf4B,EAAE,EAAGhB,qBAAuB;MAC5BQ,IAAI,EAAC,WAAW;MAChBS,WAAW;MACXC,IAAI,EAAGzB;IAAQ,GAEbF,EAAE,CAAE,UAAW,CACD,CACP,CACV;EACF,CACD,CAAC;AAEJ"}
|
package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-modal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__experimentalConfirmDialog","ConfirmDialog","__","RenameModal","onClose","onConfirm","createElement","isOpen","e","preventDefault","onCancel","confirmButtonText"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/delete-modal.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nexport default function RenameModal( { onClose, onConfirm } ) {\n\treturn (\n\t\t<ConfirmDialog\n\t\t\tisOpen
|
|
1
|
+
{"version":3,"names":["__experimentalConfirmDialog","ConfirmDialog","__","RenameModal","onClose","onConfirm","createElement","isOpen","e","preventDefault","onCancel","confirmButtonText"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/delete-modal.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nexport default function RenameModal( { onClose, onConfirm } ) {\n\treturn (\n\t\t<ConfirmDialog\n\t\t\tisOpen\n\t\t\tonConfirm={ ( e ) => {\n\t\t\t\te.preventDefault();\n\t\t\t\tonConfirm();\n\n\t\t\t\t// Immediate close avoids ability to hit delete multiple times.\n\t\t\t\tonClose();\n\t\t\t} }\n\t\t\tonCancel={ onClose }\n\t\t\tconfirmButtonText={ __( 'Delete' ) }\n\t\t>\n\t\t\t{ __( 'Are you sure you want to delete this Navigation menu?' ) }\n\t\t</ConfirmDialog>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,2BAA2B,IAAIC,aAAa,QAAQ,uBAAuB;AACpF,SAASC,EAAE,QAAQ,iBAAiB;AAEpC,eAAe,SAASC,WAAWA,CAAE;EAAEC,OAAO;EAAEC;AAAU,CAAC,EAAG;EAC7D,OACCC,aAAA,CAACL,aAAa;IACbM,MAAM;IACNF,SAAS,EAAKG,CAAC,IAAM;MACpBA,CAAC,CAACC,cAAc,CAAC,CAAC;MAClBJ,SAAS,CAAC,CAAC;;MAEX;MACAD,OAAO,CAAC,CAAC;IACV,CAAG;IACHM,QAAQ,EAAGN,OAAS;IACpBO,iBAAiB,EAAGT,EAAE,CAAE,QAAS;EAAG,GAElCA,EAAE,CAAE,uDAAwD,CAChD,CAAC;AAElB"}
|
package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js
CHANGED
|
@@ -11,7 +11,6 @@ import { SidebarNavigationScreenWrapper } from '../sidebar-navigation-screen-nav
|
|
|
11
11
|
import ScreenNavigationMoreMenu from './more-menu';
|
|
12
12
|
import NavigationMenuEditor from './navigation-menu-editor';
|
|
13
13
|
import buildNavigationLabel from '../sidebar-navigation-screen-navigation-menus/build-navigation-label';
|
|
14
|
-
import EditButton from './edit-button';
|
|
15
14
|
export default function SingleNavigationMenu({
|
|
16
15
|
navigationMenu,
|
|
17
16
|
handleDelete,
|
|
@@ -25,8 +24,6 @@ export default function SingleNavigationMenu({
|
|
|
25
24
|
onDelete: handleDelete,
|
|
26
25
|
onSave: handleSave,
|
|
27
26
|
onDuplicate: handleDuplicate
|
|
28
|
-
}), createElement(EditButton, {
|
|
29
|
-
postId: navigationMenu?.id
|
|
30
27
|
})),
|
|
31
28
|
title: buildNavigationLabel(navigationMenu?.title, navigationMenu?.id, navigationMenu?.status),
|
|
32
29
|
description: __('Navigation menus are a curated collection of blocks that allow visitors to get around your site.')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","decodeEntities","SidebarNavigationScreenWrapper","ScreenNavigationMoreMenu","NavigationMenuEditor","buildNavigationLabel","
|
|
1
|
+
{"version":3,"names":["__","decodeEntities","SidebarNavigationScreenWrapper","ScreenNavigationMoreMenu","NavigationMenuEditor","buildNavigationLabel","SingleNavigationMenu","navigationMenu","handleDelete","handleDuplicate","handleSave","menuTitle","title","rendered","createElement","actions","Fragment","onDelete","onSave","onDuplicate","id","status","description","navigationMenuId"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\n/**\n * Internal dependencies\n */\nimport { SidebarNavigationScreenWrapper } from '../sidebar-navigation-screen-navigation-menus';\nimport ScreenNavigationMoreMenu from './more-menu';\nimport NavigationMenuEditor from './navigation-menu-editor';\nimport buildNavigationLabel from '../sidebar-navigation-screen-navigation-menus/build-navigation-label';\n\nexport default function SingleNavigationMenu( {\n\tnavigationMenu,\n\thandleDelete,\n\thandleDuplicate,\n\thandleSave,\n} ) {\n\tconst menuTitle = navigationMenu?.title?.rendered;\n\n\treturn (\n\t\t<SidebarNavigationScreenWrapper\n\t\t\tactions={\n\t\t\t\t<>\n\t\t\t\t\t<ScreenNavigationMoreMenu\n\t\t\t\t\t\tmenuTitle={ decodeEntities( menuTitle ) }\n\t\t\t\t\t\tonDelete={ handleDelete }\n\t\t\t\t\t\tonSave={ handleSave }\n\t\t\t\t\t\tonDuplicate={ handleDuplicate }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t}\n\t\t\ttitle={ buildNavigationLabel(\n\t\t\t\tnavigationMenu?.title,\n\t\t\t\tnavigationMenu?.id,\n\t\t\t\tnavigationMenu?.status\n\t\t\t) }\n\t\t\tdescription={ __(\n\t\t\t\t'Navigation menus are a curated collection of blocks that allow visitors to get around your site.'\n\t\t\t) }\n\t\t>\n\t\t\t<NavigationMenuEditor navigationMenuId={ navigationMenu?.id } />\n\t\t</SidebarNavigationScreenWrapper>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,cAAc,QAAQ,0BAA0B;AACzD;AACA;AACA;AACA,SAASC,8BAA8B,QAAQ,+CAA+C;AAC9F,OAAOC,wBAAwB,MAAM,aAAa;AAClD,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,OAAOC,oBAAoB,MAAM,sEAAsE;AAEvG,eAAe,SAASC,oBAAoBA,CAAE;EAC7CC,cAAc;EACdC,YAAY;EACZC,eAAe;EACfC;AACD,CAAC,EAAG;EACH,MAAMC,SAAS,GAAGJ,cAAc,EAAEK,KAAK,EAAEC,QAAQ;EAEjD,OACCC,aAAA,CAACZ,8BAA8B;IAC9Ba,OAAO,EACND,aAAA,CAAAE,QAAA,QACCF,aAAA,CAACX,wBAAwB;MACxBQ,SAAS,EAAGV,cAAc,CAAEU,SAAU,CAAG;MACzCM,QAAQ,EAAGT,YAAc;MACzBU,MAAM,EAAGR,UAAY;MACrBS,WAAW,EAAGV;IAAiB,CAC/B,CACA,CACF;IACDG,KAAK,EAAGP,oBAAoB,CAC3BE,cAAc,EAAEK,KAAK,EACrBL,cAAc,EAAEa,EAAE,EAClBb,cAAc,EAAEc,MACjB,CAAG;IACHC,WAAW,EAAGtB,EAAE,CACf,kGACD;EAAG,GAEHc,aAAA,CAACV,oBAAoB;IAACmB,gBAAgB,EAAGhB,cAAc,EAAEa;EAAI,CAAE,CAChC,CAAC;AAEnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","__experimentalHeading","Heading","NavigationMenuEditor","useNavigationMenuTitle","TemplatePartNavigationMenu","id","title","undefined","createElement","Fragment","className","size","upperCase","weight","navigationMenuId"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalHeading as Heading } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport NavigationMenuEditor from '../sidebar-navigation-screen-navigation-menu/navigation-menu-editor';\nimport useNavigationMenuTitle from './use-navigation-menu-title';\n\nexport default function TemplatePartNavigationMenu( { id } ) {\n\tconst title = useNavigationMenuTitle( id );\n\n\tif ( ! id || title === undefined ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<Heading\n\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-template-part-navigation-menu__title\"\n\t\t\t\tsize=\"11\"\n\t\t\t\tupperCase
|
|
1
|
+
{"version":3,"names":["__","__experimentalHeading","Heading","NavigationMenuEditor","useNavigationMenuTitle","TemplatePartNavigationMenu","id","title","undefined","createElement","Fragment","className","size","upperCase","weight","navigationMenuId"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalHeading as Heading } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport NavigationMenuEditor from '../sidebar-navigation-screen-navigation-menu/navigation-menu-editor';\nimport useNavigationMenuTitle from './use-navigation-menu-title';\n\nexport default function TemplatePartNavigationMenu( { id } ) {\n\tconst title = useNavigationMenuTitle( id );\n\n\tif ( ! id || title === undefined ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<Heading\n\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-template-part-navigation-menu__title\"\n\t\t\t\tsize=\"11\"\n\t\t\t\tupperCase\n\t\t\t\tweight={ 500 }\n\t\t\t>\n\t\t\t\t{ title || __( 'Navigation' ) }\n\t\t\t</Heading>\n\t\t\t<NavigationMenuEditor navigationMenuId={ id } />\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,qBAAqB,IAAIC,OAAO,QAAQ,uBAAuB;;AAExE;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,qEAAqE;AACtG,OAAOC,sBAAsB,MAAM,6BAA6B;AAEhE,eAAe,SAASC,0BAA0BA,CAAE;EAAEC;AAAG,CAAC,EAAG;EAC5D,MAAMC,KAAK,GAAGH,sBAAsB,CAAEE,EAAG,CAAC;EAE1C,IAAK,CAAEA,EAAE,IAAIC,KAAK,KAAKC,SAAS,EAAG;IAClC,OAAO,IAAI;EACZ;EAEA,OACCC,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACP,OAAO;IACPS,SAAS,EAAC,0EAA0E;IACpFC,IAAI,EAAC,IAAI;IACTC,SAAS;IACTC,MAAM,EAAG;EAAK,GAEZP,KAAK,IAAIP,EAAE,CAAE,YAAa,CACpB,CAAC,EACVS,aAAA,CAACN,oBAAoB;IAACY,gBAAgB,EAAGT;EAAI,CAAE,CAC9C,CAAC;AAEL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","__experimentalHeading","Heading","TemplatePartNavigationMenu","TemplatePartNavigationMenuList","TemplatePartNavigationMenus","menus","length","createElement","id","Fragment","className","size","upperCase","weight"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalHeading as Heading } from '@wordpress/components';\n/**\n * Internal dependencies\n */\nimport TemplatePartNavigationMenu from './template-part-navigation-menu';\nimport TemplatePartNavigationMenuList from './template-part-navigation-menu-list';\n\nexport default function TemplatePartNavigationMenus( { menus } ) {\n\tif ( ! menus.length ) return null;\n\n\t// if there is a single menu then render TemplatePartNavigationMenu\n\tif ( menus.length === 1 ) {\n\t\treturn <TemplatePartNavigationMenu id={ menus[ 0 ] } />;\n\t}\n\n\t// if there are multiple menus then render TemplatePartNavigationMenuList\n\treturn (\n\t\t<>\n\t\t\t<Heading\n\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-template-part-navigation-menu__title\"\n\t\t\t\tsize=\"11\"\n\t\t\t\tupperCase
|
|
1
|
+
{"version":3,"names":["__","__experimentalHeading","Heading","TemplatePartNavigationMenu","TemplatePartNavigationMenuList","TemplatePartNavigationMenus","menus","length","createElement","id","Fragment","className","size","upperCase","weight"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalHeading as Heading } from '@wordpress/components';\n/**\n * Internal dependencies\n */\nimport TemplatePartNavigationMenu from './template-part-navigation-menu';\nimport TemplatePartNavigationMenuList from './template-part-navigation-menu-list';\n\nexport default function TemplatePartNavigationMenus( { menus } ) {\n\tif ( ! menus.length ) return null;\n\n\t// if there is a single menu then render TemplatePartNavigationMenu\n\tif ( menus.length === 1 ) {\n\t\treturn <TemplatePartNavigationMenu id={ menus[ 0 ] } />;\n\t}\n\n\t// if there are multiple menus then render TemplatePartNavigationMenuList\n\treturn (\n\t\t<>\n\t\t\t<Heading\n\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-template-part-navigation-menu__title\"\n\t\t\t\tsize=\"11\"\n\t\t\t\tupperCase\n\t\t\t\tweight={ 500 }\n\t\t\t>\n\t\t\t\t{ __( 'Navigation' ) }\n\t\t\t</Heading>\n\t\t\t<TemplatePartNavigationMenuList menus={ menus } />\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,qBAAqB,IAAIC,OAAO,QAAQ,uBAAuB;AACxE;AACA;AACA;AACA,OAAOC,0BAA0B,MAAM,iCAAiC;AACxE,OAAOC,8BAA8B,MAAM,sCAAsC;AAEjF,eAAe,SAASC,2BAA2BA,CAAE;EAAEC;AAAM,CAAC,EAAG;EAChE,IAAK,CAAEA,KAAK,CAACC,MAAM,EAAG,OAAO,IAAI;;EAEjC;EACA,IAAKD,KAAK,CAACC,MAAM,KAAK,CAAC,EAAG;IACzB,OAAOC,aAAA,CAACL,0BAA0B;MAACM,EAAE,EAAGH,KAAK,CAAE,CAAC;IAAI,CAAE,CAAC;EACxD;;EAEA;EACA,OACCE,aAAA,CAAAE,QAAA,QACCF,aAAA,CAACN,OAAO;IACPS,SAAS,EAAC,0EAA0E;IACpFC,IAAI,EAAC,IAAI;IACTC,SAAS;IACTC,MAAM,EAAG;EAAK,GAEZd,EAAE,CAAE,YAAa,CACX,CAAC,EACVQ,aAAA,CAACJ,8BAA8B;IAACE,KAAK,EAAGA;EAAO,CAAE,CAChD,CAAC;AAEL"}
|
|
@@ -15,7 +15,7 @@ import { useSelect } from '@wordpress/data';
|
|
|
15
15
|
/**
|
|
16
16
|
* Internal dependencies
|
|
17
17
|
*/
|
|
18
|
-
import { useAddedBy } from '../
|
|
18
|
+
import { useAddedBy } from '../page-templates-template-parts/hooks';
|
|
19
19
|
import useEditedEntityRecord from '../use-edited-entity-record';
|
|
20
20
|
import useNavigationMenuContent from './use-navigation-menu-content';
|
|
21
21
|
import SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';
|
package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["sentenceCase","__","_x","sprintf","store","coreStore","editorStore","useSelect","useAddedBy","useEditedEntityRecord","useNavigationMenuContent","SidebarNavigationScreenDetailsFooter","SidebarNavigationScreenDetailsPanel","SidebarNavigationScreenDetailsPanelRow","SidebarNavigationScreenDetailsPanelLabel","SidebarNavigationScreenDetailsPanelValue","PATTERN_TYPES","TEMPLATE_PART_POST_TYPE","PATTERN_SYNC_TYPES","TEMPLATE_ORIGINS","usePatternDetails","postType","postId","getDescription","getTitle","record","templatePartAreas","select","__experimentalGetDefaultTemplatePartAreas","currentTheme","userPatternCategories","getCurrentTheme","getUserPatternCategories","addedBy","isAddedByActiveTheme","type","theme","stylesheet","title","description","text","user","footer","modified","createElement","details","push","label","value","wp_pattern_sync_status","unsynced","wp_pattern_category","length","patternCategories","Map","forEach","userCategory","set","id","categories","filter","category","get","map","join","templatePartArea","find","area","areaDetailValue","className","origin","plugin","has_theme_file","isCustomized","content","Fragment","spacing","key"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { sentenceCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useAddedBy } from '../list/added-by';\nimport useEditedEntityRecord from '../use-edited-entity-record';\nimport useNavigationMenuContent from './use-navigation-menu-content';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\nimport {\n\tSidebarNavigationScreenDetailsPanel,\n\tSidebarNavigationScreenDetailsPanelRow,\n\tSidebarNavigationScreenDetailsPanelLabel,\n\tSidebarNavigationScreenDetailsPanelValue,\n} from '../sidebar-navigation-screen-details-panel';\nimport {\n\tPATTERN_TYPES,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_SYNC_TYPES,\n\tTEMPLATE_ORIGINS,\n} from '../../utils/constants';\n\nexport default function usePatternDetails( postType, postId ) {\n\tconst { getDescription, getTitle, record } = useEditedEntityRecord(\n\t\tpostType,\n\t\tpostId\n\t);\n\tconst templatePartAreas = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).__experimentalGetDefaultTemplatePartAreas(),\n\t\t[]\n\t);\n\tconst { currentTheme, userPatternCategories } = useSelect( ( select ) => {\n\t\tconst { getCurrentTheme, getUserPatternCategories } =\n\t\t\tselect( coreStore );\n\n\t\treturn {\n\t\t\tcurrentTheme: getCurrentTheme(),\n\t\t\tuserPatternCategories: getUserPatternCategories(),\n\t\t};\n\t}, [] );\n\n\tconst addedBy = useAddedBy( postType, postId );\n\tconst isAddedByActiveTheme =\n\t\taddedBy.type === 'theme' && record.theme === currentTheme?.stylesheet;\n\tconst title = getTitle();\n\tlet description = getDescription();\n\n\tif ( ! description && addedBy.text ) {\n\t\tdescription =\n\t\t\tpostType === PATTERN_TYPES.user\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t// translators: %s: pattern title e.g: \"Header\".\n\t\t\t\t\t\t__( 'This is the %s pattern.' ),\n\t\t\t\t\t\tgetTitle()\n\t\t\t\t )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t// translators: %s: template part title e.g: \"Header\".\n\t\t\t\t\t\t__( 'This is the %s template part.' ),\n\t\t\t\t\t\tgetTitle()\n\t\t\t\t );\n\t}\n\n\tif ( ! description && postType === PATTERN_TYPES.user && record?.title ) {\n\t\tdescription = sprintf(\n\t\t\t// translators: %s: user created pattern title e.g. \"Footer\".\n\t\t\t__( 'This is the %s pattern.' ),\n\t\t\trecord.title\n\t\t);\n\t}\n\n\tconst footer = record?.modified ? (\n\t\t<SidebarNavigationScreenDetailsFooter record={ record } />\n\t) : null;\n\n\tconst details = [];\n\n\tif (\n\t\tpostType === PATTERN_TYPES.user ||\n\t\tpostType === TEMPLATE_PART_POST_TYPE\n\t) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Syncing' ),\n\t\t\tvalue:\n\t\t\t\trecord.wp_pattern_sync_status === PATTERN_SYNC_TYPES.unsynced\n\t\t\t\t\t? _x(\n\t\t\t\t\t\t\t'Not synced',\n\t\t\t\t\t\t\t'Text that indicates that the pattern is not synchronized'\n\t\t\t\t\t )\n\t\t\t\t\t: _x(\n\t\t\t\t\t\t\t'Synced',\n\t\t\t\t\t\t\t'Text that indicates that the pattern is synchronized'\n\t\t\t\t\t ),\n\t\t} );\n\n\t\tif ( record.wp_pattern_category?.length === 0 ) {\n\t\t\tdetails.push( {\n\t\t\t\tlabel: __( 'Categories' ),\n\t\t\t\tvalue: __( 'Uncategorized' ),\n\t\t\t} );\n\t\t}\n\t\tif ( record.wp_pattern_category?.length > 0 ) {\n\t\t\tconst patternCategories = new Map();\n\t\t\tuserPatternCategories.forEach( ( userCategory ) =>\n\t\t\t\tpatternCategories.set( userCategory.id, userCategory )\n\t\t\t);\n\n\t\t\tconst categories = record.wp_pattern_category\n\t\t\t\t.filter( ( category ) => patternCategories.get( category ) )\n\t\t\t\t.map( ( category ) => patternCategories.get( category ).label );\n\n\t\t\tdetails.push( {\n\t\t\t\tlabel: __( 'Categories' ),\n\t\t\t\tvalue: categories.length > 0 ? categories.join( ', ' ) : '',\n\t\t\t} );\n\t\t}\n\t}\n\n\tif ( postType === TEMPLATE_PART_POST_TYPE ) {\n\t\tconst templatePartArea = templatePartAreas.find(\n\t\t\t( area ) => area.area === record.area\n\t\t);\n\n\t\tlet areaDetailValue = templatePartArea?.label;\n\n\t\tif ( ! areaDetailValue ) {\n\t\t\tareaDetailValue = record.area\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t// translators: %s: Sentenced cased template part area e.g: \"My custom area\".\n\t\t\t\t\t\t__( '%s (removed)' ),\n\t\t\t\t\t\tsentenceCase( record.area )\n\t\t\t\t )\n\t\t\t\t: __( 'None' );\n\t\t}\n\n\t\tdetails.push( { label: __( 'Area' ), value: areaDetailValue } );\n\t}\n\n\tif (\n\t\tpostType === TEMPLATE_PART_POST_TYPE &&\n\t\taddedBy.text &&\n\t\t! isAddedByActiveTheme\n\t) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Added by' ),\n\t\t\tvalue: (\n\t\t\t\t<span className=\"edit-site-sidebar-navigation-screen-pattern__added-by-description-author\">\n\t\t\t\t\t{ addedBy.text }\n\t\t\t\t</span>\n\t\t\t),\n\t\t} );\n\t}\n\n\tif (\n\t\tpostType === TEMPLATE_PART_POST_TYPE &&\n\t\taddedBy.text &&\n\t\t( record.origin === TEMPLATE_ORIGINS.plugin ||\n\t\t\trecord.has_theme_file === true )\n\t) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Customized' ),\n\t\t\tvalue: (\n\t\t\t\t<span className=\"edit-site-sidebar-navigation-screen-pattern__added-by-description-customized\">\n\t\t\t\t\t{ addedBy.isCustomized ? __( 'Yes' ) : __( 'No' ) }\n\t\t\t\t</span>\n\t\t\t),\n\t\t} );\n\t}\n\n\tconst content = (\n\t\t<>\n\t\t\t{ useNavigationMenuContent( postType, postId ) }\n\t\t\t{ !! details.length && (\n\t\t\t\t<SidebarNavigationScreenDetailsPanel\n\t\t\t\t\tspacing={ 5 }\n\t\t\t\t\ttitle={ __( 'Details' ) }\n\t\t\t\t>\n\t\t\t\t\t{ details.map( ( { label, value } ) => (\n\t\t\t\t\t\t<SidebarNavigationScreenDetailsPanelRow key={ label }>\n\t\t\t\t\t\t\t<SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t</SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t\t\t<SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t\t\t\t{ value }\n\t\t\t\t\t\t\t</SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t\t\t) ) }\n\t\t\t\t</SidebarNavigationScreenDetailsPanel>\n\t\t\t) }\n\t\t</>\n\t);\n\n\treturn { title, description, content, footer };\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,aAAa;;AAE1C;AACA;AACA;AACA,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASD,KAAK,IAAIE,WAAW,QAAQ,mBAAmB;AACxD,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,OAAOC,qBAAqB,MAAM,6BAA6B;AAC/D,OAAOC,wBAAwB,MAAM,+BAA+B;AACpE,OAAOC,oCAAoC,MAAM,6CAA6C;AAC9F,SACCC,mCAAmC,EACnCC,sCAAsC,EACtCC,wCAAwC,EACxCC,wCAAwC,QAClC,4CAA4C;AACnD,SACCC,aAAa,EACbC,uBAAuB,EACvBC,kBAAkB,EAClBC,gBAAgB,QACV,uBAAuB;AAE9B,eAAe,SAASC,iBAAiBA,CAAEC,QAAQ,EAAEC,MAAM,EAAG;EAC7D,MAAM;IAAEC,cAAc;IAAEC,QAAQ;IAAEC;EAAO,CAAC,GAAGhB,qBAAqB,CACjEY,QAAQ,EACRC,MACD,CAAC;EACD,MAAMI,iBAAiB,GAAGnB,SAAS,CAChCoB,MAAM,IACPA,MAAM,CAAErB,WAAY,CAAC,CAACsB,yCAAyC,CAAC,CAAC,EAClE,EACD,CAAC;EACD,MAAM;IAAEC,YAAY;IAAEC;EAAsB,CAAC,GAAGvB,SAAS,CAAIoB,MAAM,IAAM;IACxE,MAAM;MAAEI,eAAe;MAAEC;IAAyB,CAAC,GAClDL,MAAM,CAAEtB,SAAU,CAAC;IAEpB,OAAO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OAAO,EAAG,CAAG;IACbtC,KAAK,EAAGrC,EAAE,CAAE,SAAU;EAAG,GAEvB4C,OAAO,CAACkB,GAAG,CAAE,CAAE;IAAEhB,KAAK;IAAEC;EAAM,CAAC,KAChCJ,aAAA,CAAC/B,sCAAsC;IAACgE,GAAG,EAAG9B;EAAO,GACpDH,aAAA,CAAC9B,wCAAwC,QACtCiC,KACuC,CAAC,EAC3CH,aAAA,CAAC7B,wCAAwC,QACtCiC,KACuC,CACH,CACvC,CACkC,CAErC,CACF;EAED,OAAO;IAAEV,KAAK;IAAEC,WAAW;IAAEmC,OAAO;IAAEhC;EAAO,CAAC;AAC/C"}
|
|
1
|
+
{"version":3,"names":["sentenceCase","__","_x","sprintf","store","coreStore","editorStore","useSelect","useAddedBy","useEditedEntityRecord","useNavigationMenuContent","SidebarNavigationScreenDetailsFooter","SidebarNavigationScreenDetailsPanel","SidebarNavigationScreenDetailsPanelRow","SidebarNavigationScreenDetailsPanelLabel","SidebarNavigationScreenDetailsPanelValue","PATTERN_TYPES","TEMPLATE_PART_POST_TYPE","PATTERN_SYNC_TYPES","TEMPLATE_ORIGINS","usePatternDetails","postType","postId","getDescription","getTitle","record","templatePartAreas","select","__experimentalGetDefaultTemplatePartAreas","currentTheme","userPatternCategories","getCurrentTheme","getUserPatternCategories","addedBy","isAddedByActiveTheme","type","theme","stylesheet","title","description","text","user","footer","modified","createElement","details","push","label","value","wp_pattern_sync_status","unsynced","wp_pattern_category","length","patternCategories","Map","forEach","userCategory","set","id","categories","filter","category","get","map","join","templatePartArea","find","area","areaDetailValue","className","origin","plugin","has_theme_file","isCustomized","content","Fragment","spacing","key"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { sentenceCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useAddedBy } from '../page-templates-template-parts/hooks';\nimport useEditedEntityRecord from '../use-edited-entity-record';\nimport useNavigationMenuContent from './use-navigation-menu-content';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\nimport {\n\tSidebarNavigationScreenDetailsPanel,\n\tSidebarNavigationScreenDetailsPanelRow,\n\tSidebarNavigationScreenDetailsPanelLabel,\n\tSidebarNavigationScreenDetailsPanelValue,\n} from '../sidebar-navigation-screen-details-panel';\nimport {\n\tPATTERN_TYPES,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_SYNC_TYPES,\n\tTEMPLATE_ORIGINS,\n} from '../../utils/constants';\n\nexport default function usePatternDetails( postType, postId ) {\n\tconst { getDescription, getTitle, record } = useEditedEntityRecord(\n\t\tpostType,\n\t\tpostId\n\t);\n\tconst templatePartAreas = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).__experimentalGetDefaultTemplatePartAreas(),\n\t\t[]\n\t);\n\tconst { currentTheme, userPatternCategories } = useSelect( ( select ) => {\n\t\tconst { getCurrentTheme, getUserPatternCategories } =\n\t\t\tselect( coreStore );\n\n\t\treturn {\n\t\t\tcurrentTheme: getCurrentTheme(),\n\t\t\tuserPatternCategories: getUserPatternCategories(),\n\t\t};\n\t}, [] );\n\n\tconst addedBy = useAddedBy( postType, postId );\n\tconst isAddedByActiveTheme =\n\t\taddedBy.type === 'theme' && record.theme === currentTheme?.stylesheet;\n\tconst title = getTitle();\n\tlet description = getDescription();\n\n\tif ( ! description && addedBy.text ) {\n\t\tdescription =\n\t\t\tpostType === PATTERN_TYPES.user\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t// translators: %s: pattern title e.g: \"Header\".\n\t\t\t\t\t\t__( 'This is the %s pattern.' ),\n\t\t\t\t\t\tgetTitle()\n\t\t\t\t )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t// translators: %s: template part title e.g: \"Header\".\n\t\t\t\t\t\t__( 'This is the %s template part.' ),\n\t\t\t\t\t\tgetTitle()\n\t\t\t\t );\n\t}\n\n\tif ( ! description && postType === PATTERN_TYPES.user && record?.title ) {\n\t\tdescription = sprintf(\n\t\t\t// translators: %s: user created pattern title e.g. \"Footer\".\n\t\t\t__( 'This is the %s pattern.' ),\n\t\t\trecord.title\n\t\t);\n\t}\n\n\tconst footer = record?.modified ? (\n\t\t<SidebarNavigationScreenDetailsFooter record={ record } />\n\t) : null;\n\n\tconst details = [];\n\n\tif (\n\t\tpostType === PATTERN_TYPES.user ||\n\t\tpostType === TEMPLATE_PART_POST_TYPE\n\t) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Syncing' ),\n\t\t\tvalue:\n\t\t\t\trecord.wp_pattern_sync_status === PATTERN_SYNC_TYPES.unsynced\n\t\t\t\t\t? _x(\n\t\t\t\t\t\t\t'Not synced',\n\t\t\t\t\t\t\t'Text that indicates that the pattern is not synchronized'\n\t\t\t\t\t )\n\t\t\t\t\t: _x(\n\t\t\t\t\t\t\t'Synced',\n\t\t\t\t\t\t\t'Text that indicates that the pattern is synchronized'\n\t\t\t\t\t ),\n\t\t} );\n\n\t\tif ( record.wp_pattern_category?.length === 0 ) {\n\t\t\tdetails.push( {\n\t\t\t\tlabel: __( 'Categories' ),\n\t\t\t\tvalue: __( 'Uncategorized' ),\n\t\t\t} );\n\t\t}\n\t\tif ( record.wp_pattern_category?.length > 0 ) {\n\t\t\tconst patternCategories = new Map();\n\t\t\tuserPatternCategories.forEach( ( userCategory ) =>\n\t\t\t\tpatternCategories.set( userCategory.id, userCategory )\n\t\t\t);\n\n\t\t\tconst categories = record.wp_pattern_category\n\t\t\t\t.filter( ( category ) => patternCategories.get( category ) )\n\t\t\t\t.map( ( category ) => patternCategories.get( category ).label );\n\n\t\t\tdetails.push( {\n\t\t\t\tlabel: __( 'Categories' ),\n\t\t\t\tvalue: categories.length > 0 ? categories.join( ', ' ) : '',\n\t\t\t} );\n\t\t}\n\t}\n\n\tif ( postType === TEMPLATE_PART_POST_TYPE ) {\n\t\tconst templatePartArea = templatePartAreas.find(\n\t\t\t( area ) => area.area === record.area\n\t\t);\n\n\t\tlet areaDetailValue = templatePartArea?.label;\n\n\t\tif ( ! areaDetailValue ) {\n\t\t\tareaDetailValue = record.area\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t// translators: %s: Sentenced cased template part area e.g: \"My custom area\".\n\t\t\t\t\t\t__( '%s (removed)' ),\n\t\t\t\t\t\tsentenceCase( record.area )\n\t\t\t\t )\n\t\t\t\t: __( 'None' );\n\t\t}\n\n\t\tdetails.push( { label: __( 'Area' ), value: areaDetailValue } );\n\t}\n\n\tif (\n\t\tpostType === TEMPLATE_PART_POST_TYPE &&\n\t\taddedBy.text &&\n\t\t! isAddedByActiveTheme\n\t) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Added by' ),\n\t\t\tvalue: (\n\t\t\t\t<span className=\"edit-site-sidebar-navigation-screen-pattern__added-by-description-author\">\n\t\t\t\t\t{ addedBy.text }\n\t\t\t\t</span>\n\t\t\t),\n\t\t} );\n\t}\n\n\tif (\n\t\tpostType === TEMPLATE_PART_POST_TYPE &&\n\t\taddedBy.text &&\n\t\t( record.origin === TEMPLATE_ORIGINS.plugin ||\n\t\t\trecord.has_theme_file === true )\n\t) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Customized' ),\n\t\t\tvalue: (\n\t\t\t\t<span className=\"edit-site-sidebar-navigation-screen-pattern__added-by-description-customized\">\n\t\t\t\t\t{ addedBy.isCustomized ? __( 'Yes' ) : __( 'No' ) }\n\t\t\t\t</span>\n\t\t\t),\n\t\t} );\n\t}\n\n\tconst content = (\n\t\t<>\n\t\t\t{ useNavigationMenuContent( postType, postId ) }\n\t\t\t{ !! details.length && (\n\t\t\t\t<SidebarNavigationScreenDetailsPanel\n\t\t\t\t\tspacing={ 5 }\n\t\t\t\t\ttitle={ __( 'Details' ) }\n\t\t\t\t>\n\t\t\t\t\t{ details.map( ( { label, value } ) => (\n\t\t\t\t\t\t<SidebarNavigationScreenDetailsPanelRow key={ label }>\n\t\t\t\t\t\t\t<SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t</SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t\t\t<SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t\t\t\t{ value }\n\t\t\t\t\t\t\t</SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t\t\t) ) }\n\t\t\t\t</SidebarNavigationScreenDetailsPanel>\n\t\t\t) }\n\t\t</>\n\t);\n\n\treturn { title, description, content, footer };\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,aAAa;;AAE1C;AACA;AACA;AACA,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASD,KAAK,IAAIE,WAAW,QAAQ,mBAAmB;AACxD,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,UAAU,QAAQ,wCAAwC;AACnE,OAAOC,qBAAqB,MAAM,6BAA6B;AAC/D,OAAOC,wBAAwB,MAAM,+BAA+B;AACpE,OAAOC,oCAAoC,MAAM,6CAA6C;AAC9F,SACCC,mCAAmC,EACnCC,sCAAsC,EACtCC,wCAAwC,EACxCC,wCAAwC,QAClC,4CAA4C;AACnD,SACCC,aAAa,EACbC,uBAAuB,EACvBC,kBAAkB,EAClBC,gBAAgB,QACV,uBAAuB;AAE9B,eAAe,SAASC,iBAAiBA,CAAEC,QAAQ,EAAEC,MAAM,EAAG;EAC7D,MAAM;IAAEC,cAAc;IAAEC,QAAQ;IAAEC;EAAO,CAAC,GAAGhB,qBAAqB,CACjEY,QAAQ,EACRC,MACD,CAAC;EACD,M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C3FpC,OAAO,CAACwC,YAAY,GAAGxE,EAAE,CAAE,KAAM,CAAC,GAAGA,EAAE,CAAE,IAAK,CAC3C;IAER,CAAE,CAAC;EACJ;EAEA,MAAMyE,OAAO,GACZ9B,aAAA,CAAA+B,QAAA,QACGjE,wBAAwB,CAAEW,QAAQ,EAAEC,MAAO,CAAC,EAC5C,CAAC,CAAEuB,OAAO,CAACO,MAAM,IAClBR,aAAA,CAAChC,mCAAmC;IACnCgE,OAAO,EAAG,CAAG;IACbtC,KAAK,EAAGrC,EAAE,CAAE,SAAU;EAAG,GAEvB4C,OAAO,CAACkB,GAAG,CAAE,CAAE;IAAEhB,KAAK;IAAEC;EAAM,CAAC,KAChCJ,aAAA,CAAC/B,sCAAsC;IAACgE,GAAG,EAAG9B;EAAO,GACpDH,aAAA,CAAC9B,wCAAwC,QACtCiC,KACuC,CAAC,EAC3CH,aAAA,CAAC7B,wCAAwC,QACtCiC,KACuC,CACH,CACvC,CACkC,CAErC,CACF;EAED,OAAO;IAAEV,KAAK;IAAEC,WAAW;IAAEmC,OAAO;IAAEhC;EAAO,CAAC;AAC/C"}
|
|
@@ -16,7 +16,7 @@ import useEditedEntityRecord from '../use-edited-entity-record';
|
|
|
16
16
|
import { unlock } from '../../lock-unlock';
|
|
17
17
|
import { store as editSiteStore } from '../../store';
|
|
18
18
|
import SidebarButton from '../sidebar-button';
|
|
19
|
-
import { useAddedBy } from '../
|
|
19
|
+
import { useAddedBy } from '../page-templates-template-parts/hooks';
|
|
20
20
|
import TemplateActions from '../template-actions';
|
|
21
21
|
import HomeTemplateDetails from './home-template-details';
|
|
22
22
|
import SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","_x","useDispatch","useSelect","pencil","__experimentalUseNavigator","useNavigator","Icon","store","coreStore","TemplateAreas","SidebarNavigationScreen","useEditedEntityRecord","unlock","editSiteStore","SidebarButton","useAddedBy","TemplateActions","HomeTemplateDetails","SidebarNavigationScreenDetailsFooter","useTemplateDetails","postType","postId","getDescription","getTitle","record","currentTheme","select","getCurrentTheme","addedBy","isAddedByActiveTheme","type","theme","stylesheet","title","descriptionText","text","content","slug","createElement","Fragment","footer","modified","description","className","imageUrl","src","alt","width","height","icon","isCustomized","SidebarNavigationScreenTemplate","navigator","params","setCanvasMode","actions","toggleProps","as","onRemove","goTo","onClick","label"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-template/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { pencil } from '@wordpress/icons';\nimport {\n\t__experimentalUseNavigator as useNavigator,\n\tIcon,\n} from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\n/**\n * Internal dependencies\n */\nimport TemplateAreas from './template-areas';\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport useEditedEntityRecord from '../use-edited-entity-record';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport SidebarButton from '../sidebar-button';\nimport { useAddedBy } from '../
|
|
1
|
+
{"version":3,"names":["__","_x","useDispatch","useSelect","pencil","__experimentalUseNavigator","useNavigator","Icon","store","coreStore","TemplateAreas","SidebarNavigationScreen","useEditedEntityRecord","unlock","editSiteStore","SidebarButton","useAddedBy","TemplateActions","HomeTemplateDetails","SidebarNavigationScreenDetailsFooter","useTemplateDetails","postType","postId","getDescription","getTitle","record","currentTheme","select","getCurrentTheme","addedBy","isAddedByActiveTheme","type","theme","stylesheet","title","descriptionText","text","content","slug","createElement","Fragment","footer","modified","description","className","imageUrl","src","alt","width","height","icon","isCustomized","SidebarNavigationScreenTemplate","navigator","params","setCanvasMode","actions","toggleProps","as","onRemove","goTo","onClick","label"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-template/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, _x } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { pencil } from '@wordpress/icons';\nimport {\n\t__experimentalUseNavigator as useNavigator,\n\tIcon,\n} from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\n/**\n * Internal dependencies\n */\nimport TemplateAreas from './template-areas';\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport useEditedEntityRecord from '../use-edited-entity-record';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport SidebarButton from '../sidebar-button';\nimport { useAddedBy } from '../page-templates-template-parts/hooks';\nimport TemplateActions from '../template-actions';\nimport HomeTemplateDetails from './home-template-details';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\n\nfunction useTemplateDetails( postType, postId ) {\n\tconst { getDescription, getTitle, record } = useEditedEntityRecord(\n\t\tpostType,\n\t\tpostId\n\t);\n\tconst currentTheme = useSelect(\n\t\t( select ) => select( coreStore ).getCurrentTheme(),\n\t\t[]\n\t);\n\tconst addedBy = useAddedBy( postType, postId );\n\tconst isAddedByActiveTheme =\n\t\taddedBy.type === 'theme' && record.theme === currentTheme?.stylesheet;\n\tconst title = getTitle();\n\tlet descriptionText = getDescription();\n\n\tif ( ! descriptionText && addedBy.text ) {\n\t\tdescriptionText = __(\n\t\t\t'This is a custom template that can be applied manually to any Post or Page.'\n\t\t);\n\t}\n\n\tconst content =\n\t\trecord?.slug === 'home' || record?.slug === 'index' ? (\n\t\t\t<>\n\t\t\t\t<HomeTemplateDetails />\n\t\t\t\t<TemplateAreas />\n\t\t\t</>\n\t\t) : (\n\t\t\t<TemplateAreas />\n\t\t);\n\n\tconst footer = record?.modified ? (\n\t\t<SidebarNavigationScreenDetailsFooter record={ record } />\n\t) : null;\n\n\tconst description = (\n\t\t<>\n\t\t\t{ descriptionText }\n\n\t\t\t{ addedBy.text && ! isAddedByActiveTheme && (\n\t\t\t\t<span className=\"edit-site-sidebar-navigation-screen-template__added-by-description\">\n\t\t\t\t\t<span className=\"edit-site-sidebar-navigation-screen-template__added-by-description-author\">\n\t\t\t\t\t\t<span className=\"edit-site-sidebar-navigation-screen-template__added-by-description-author-icon\">\n\t\t\t\t\t\t\t{ addedBy.imageUrl ? (\n\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\tsrc={ addedBy.imageUrl }\n\t\t\t\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t\t\t\t\twidth=\"24\"\n\t\t\t\t\t\t\t\t\theight=\"24\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<Icon icon={ addedBy.icon } />\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t{ addedBy.text }\n\t\t\t\t\t</span>\n\n\t\t\t\t\t{ addedBy.isCustomized && (\n\t\t\t\t\t\t<span className=\"edit-site-sidebar-navigation-screen-template__added-by-description-customized\">\n\t\t\t\t\t\t\t{ _x( '(Customized)', 'template' ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t</span>\n\t\t\t) }\n\t\t</>\n\t);\n\n\treturn { title, description, content, footer };\n}\n\nexport default function SidebarNavigationScreenTemplate() {\n\tconst navigator = useNavigator();\n\tconst {\n\t\tparams: { postType, postId },\n\t} = navigator;\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\tconst { title, content, description, footer } = useTemplateDetails(\n\t\tpostType,\n\t\tpostId\n\t);\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\ttitle={ title }\n\t\t\tactions={\n\t\t\t\t<>\n\t\t\t\t\t<TemplateActions\n\t\t\t\t\t\tpostType={ postType }\n\t\t\t\t\t\tpostId={ postId }\n\t\t\t\t\t\ttoggleProps={ { as: SidebarButton } }\n\t\t\t\t\t\tonRemove={ () => {\n\t\t\t\t\t\t\tnavigator.goTo( `/${ postType }/all` );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\tonClick={ () => setCanvasMode( 'edit' ) }\n\t\t\t\t\t\tlabel={ __( 'Edit' ) }\n\t\t\t\t\t\ticon={ pencil }\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tdescription={ description }\n\t\t\tcontent={ content }\n\t\t\tfooter={ footer }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SACCC,0BAA0B,IAAIC,YAAY,EAC1CC,IAAI,QACE,uBAAuB;AAC9B,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD;AACA;AACA;AACA,OAAOC,aAAa,MAAM,kBAAkB;AAC5C,OAAOC,uBAAuB,MAAM,8BAA8B;AAClE,OAAOC,qBAAqB,MAAM,6BAA6B;AAC/D,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASL,KAAK,IAAIM,aAAa,QAAQ,aAAa;AACpD,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,SAASC,UAAU,QAAQ,wCAAwC;AACnE,OAAOC,eAAe,MAAM,qBAAqB;AACjD,OAAOC,mBAAmB,MAAM,yBAAyB;AACzD,OAAOC,oCAAoC,MAAM,6CAA6C;AAE9F,SAASC,kBAAkBA,CAAEC,QAAQ,EAAEC,MAAM,EAAG;EAC/C,MAAM;IAAEC,cAAc;IAAEC,QAAQ;IAAEC;EAAO,CAAC,GAAGb,qBAAqB,CACjES,QAAQ,EACRC,MACD,CAAC;EACD,MAAMI,YAAY,GAAGvB,SAAS,CAC3BwB,MAAM,IAAMA,MAAM,CAAElB,SAAU,CAAC,CAACmB,eAAe,CAAC,CAAC,EACnD,EACD,CAAC;EACD,MAAMC,OAAO,GAAGb,UAAU,CAAEK,QAAQ,EAAEC,MAAO,CAAC;EAC9C,MA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ress/components';
|
|
|
10
10
|
* Internal dependencies
|
|
11
11
|
*/
|
|
12
12
|
import DataViewItem from '../sidebar-dataviews/dataview-item';
|
|
13
|
-
import { useAddedBy } from '../
|
|
13
|
+
import { useAddedBy } from '../page-templates-template-parts/hooks';
|
|
14
14
|
import { layout } from '@wordpress/icons';
|
|
15
15
|
const EMPTY_ARRAY = [];
|
|
16
16
|
function TemplateDataviewItem({
|
|
@@ -33,7 +33,7 @@ function TemplateDataviewItem({
|
|
|
33
33
|
export default function DataviewsTemplatesSidebarContent({
|
|
34
34
|
activeView,
|
|
35
35
|
postType,
|
|
36
|
-
|
|
36
|
+
title
|
|
37
37
|
}) {
|
|
38
38
|
const {
|
|
39
39
|
records
|
|
@@ -53,7 +53,7 @@ export default function DataviewsTemplatesSidebarContent({
|
|
|
53
53
|
}, [records]);
|
|
54
54
|
return createElement(ItemGroup, null, createElement(DataViewItem, {
|
|
55
55
|
slug: 'all',
|
|
56
|
-
title:
|
|
56
|
+
title: title,
|
|
57
57
|
icon: layout,
|
|
58
58
|
isActive: activeView === 'all',
|
|
59
59
|
isCustom: "false"
|