@wordpress/edit-site 5.34.0 → 6.0.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 +16 -3
- package/build/components/add-new-page/index.js +33 -27
- package/build/components/add-new-page/index.js.map +1 -1
- package/build/components/add-new-pattern/index.js +95 -78
- package/build/components/add-new-pattern/index.js.map +1 -1
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js +35 -30
- package/build/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/add-custom-template-modal-content.js +119 -95
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/index.js +89 -73
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/add-new-template/utils.js +36 -17
- package/build/components/add-new-template/utils.js.map +1 -1
- package/build/components/app/index.js +13 -5
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/block-inspector-button.js +5 -4
- package/build/components/block-editor/block-inspector-button.js.map +1 -1
- package/build/components/block-editor/use-editor-iframe-props.js +88 -0
- package/build/components/block-editor/use-editor-iframe-props.js.map +1 -0
- package/build/components/canvas-loader/index.js +13 -12
- package/build/components/canvas-loader/index.js.map +1 -1
- package/build/components/dataviews-actions/index.js +49 -0
- package/build/components/dataviews-actions/index.js.map +1 -0
- package/build/components/editor/index.js +107 -140
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +27 -29
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/error-boundary/index.js +2 -2
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/error-boundary/warning.js +13 -11
- package/build/components/error-boundary/warning.js.map +1 -1
- package/build/components/global-styles/background-panel.js +19 -6
- package/build/components/global-styles/background-panel.js.map +1 -1
- package/build/components/global-styles/block-preview-panel.js +19 -17
- package/build/components/global-styles/block-preview-panel.js.map +1 -1
- package/build/components/global-styles/color-indicator-wrapper.js +4 -4
- package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +32 -28
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +2 -2
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/font-families.js +55 -39
- package/build/components/global-styles/font-families.js.map +1 -1
- package/build/components/global-styles/font-family-item.js +17 -13
- package/build/components/global-styles/font-family-item.js.map +1 -1
- package/build/components/global-styles/font-library-modal/collection-font-variant.js +25 -22
- 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 +7 -30
- package/build/components/global-styles/font-library-modal/context.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-card.js +24 -16
- 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 +195 -152
- 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 +14 -12
- package/build/components/global-styles/font-library-modal/font-demo.js.map +1 -1
- package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +29 -20
- package/build/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
- package/build/components/global-styles/font-library-modal/index.js +41 -36
- package/build/components/global-styles/font-library-modal/index.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +153 -109
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-details.js +16 -14
- package/build/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
- package/build/components/global-styles/font-library-modal/library-font-variant.js +25 -22
- 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 +40 -34
- 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 +3 -3
- package/build/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build/components/global-styles/gradients-palette-panel.js +41 -38
- package/build/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build/components/global-styles/header.js +37 -28
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/highlighted-colors.js +3 -4
- package/build/components/global-styles/highlighted-colors.js.map +1 -1
- package/build/components/global-styles/hooks.js +11 -20
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/icon-with-current-color.js +4 -4
- package/build/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build/components/global-styles/navigation-button.js +15 -11
- package/build/components/global-styles/navigation-button.js.map +1 -1
- package/build/components/global-styles/palette.js +39 -32
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preset-colors.js +28 -0
- package/build/components/global-styles/preset-colors.js.map +1 -0
- package/build/components/global-styles/preview-colors.js +23 -25
- package/build/components/global-styles/preview-colors.js.map +1 -1
- package/build/components/global-styles/preview-iframe.js +34 -29
- package/build/components/global-styles/preview-iframe.js.map +1 -1
- package/build/components/global-styles/preview-styles.js +95 -90
- package/build/components/global-styles/preview-styles.js.map +1 -1
- package/build/components/global-styles/root-menu.js +28 -21
- package/build/components/global-styles/root-menu.js.map +1 -1
- package/build/components/global-styles/screen-background.js +6 -4
- package/build/components/global-styles/screen-background.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +33 -27
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js +62 -53
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-color-palette.js +29 -19
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +18 -17
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-css.js +20 -14
- package/build/components/global-styles/screen-css.js.map +1 -1
- package/build/components/global-styles/screen-layout.js +9 -4
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-revisions/index.js +52 -42
- package/build/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +82 -71
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -0
- package/build/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build/components/global-styles/screen-root.js +76 -42
- package/build/components/global-styles/screen-root.js.map +1 -1
- package/build/components/global-styles/screen-shadows.js +22 -0
- package/build/components/global-styles/screen-shadows.js.map +1 -0
- package/build/components/global-styles/screen-style-variations.js +14 -9
- package/build/components/global-styles/screen-style-variations.js.map +1 -1
- package/build/components/global-styles/screen-typography-element.js +50 -45
- package/build/components/global-styles/screen-typography-element.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +15 -11
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/shadow-utils.js +230 -0
- package/build/components/global-styles/shadow-utils.js.map +1 -0
- package/build/components/global-styles/shadows-edit-panel.js +458 -0
- package/build/components/global-styles/shadows-edit-panel.js.map +1 -0
- package/build/components/global-styles/shadows-panel.js +128 -0
- package/build/components/global-styles/shadows-panel.js.map +1 -0
- package/build/components/global-styles/style-variations-container.js +67 -18
- package/build/components/global-styles/style-variations-container.js.map +1 -1
- package/build/components/global-styles/subtitle.js +5 -4
- package/build/components/global-styles/subtitle.js.map +1 -1
- package/build/components/global-styles/typography-elements.js +53 -45
- package/build/components/global-styles/typography-elements.js.map +1 -1
- package/build/components/global-styles/typography-example.js +16 -10
- package/build/components/global-styles/typography-example.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +2 -2
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/typography-preview.js +5 -4
- package/build/components/global-styles/typography-preview.js.map +1 -1
- package/build/components/global-styles/ui.js +124 -89
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/utils.js +28 -0
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/global-styles/variations/variation.js +36 -25
- package/build/components/global-styles/variations/variation.js.map +1 -1
- package/build/components/global-styles/variations/variations-color.js +19 -14
- package/build/components/global-styles/variations/variations-color.js.map +1 -1
- package/build/components/global-styles/variations/variations-panel.js +27 -17
- package/build/components/global-styles/variations/variations-panel.js.map +1 -1
- package/build/components/global-styles/variations/variations-typography.js +37 -31
- package/build/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build/components/global-styles-renderer/index.js +5 -1
- package/build/components/global-styles-renderer/index.js.map +1 -1
- package/build/components/global-styles-sidebar/default-sidebar.js +56 -0
- package/build/components/global-styles-sidebar/default-sidebar.js.map +1 -0
- package/build/components/{sidebar-edit-mode/global-styles-sidebar.js → global-styles-sidebar/index.js} +37 -26
- package/build/components/global-styles-sidebar/index.js.map +1 -0
- package/build/components/layout/index.js +113 -99
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/router.js +110 -75
- package/build/components/layout/router.js.map +1 -1
- package/build/components/media/index.js +2 -2
- package/build/components/media/index.js.map +1 -1
- package/build/components/{header-edit-mode/more-menu → more-menu}/index.js +7 -3
- package/build/components/more-menu/index.js.map +1 -0
- package/build/components/{header-edit-mode/more-menu → more-menu}/site-export.js +5 -4
- package/build/components/more-menu/site-export.js.map +1 -0
- package/build/components/{header-edit-mode/more-menu → more-menu}/welcome-guide-menu-item.js +5 -4
- package/build/components/more-menu/welcome-guide-menu-item.js.map +1 -0
- package/build/components/page/header.js +24 -20
- package/build/components/page/header.js.map +1 -1
- package/build/components/page/index.js +14 -12
- package/build/components/page/index.js.map +1 -1
- package/build/components/page-pages/index.js +136 -66
- package/build/components/page-pages/index.js.map +1 -1
- package/build/components/page-patterns/delete-category-menu-item.js +23 -20
- package/build/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build/components/page-patterns/header.js +47 -32
- package/build/components/page-patterns/header.js.map +1 -1
- package/build/components/page-patterns/index.js +120 -125
- package/build/components/page-patterns/index.js.map +1 -1
- package/build/components/page-patterns/rename-category-menu-item.js +14 -11
- package/build/components/page-patterns/rename-category-menu-item.js.map +1 -1
- package/build/components/page-patterns/use-patterns.js +7 -6
- package/build/components/page-patterns/use-patterns.js.map +1 -1
- package/build/components/page-templates/index.js +83 -72
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/pagination/index.js +51 -42
- package/build/components/pagination/index.js.map +1 -1
- package/build/components/plugin-template-setting-panel/index.js +4 -2
- package/build/components/plugin-template-setting-panel/index.js.map +1 -1
- package/build/components/resizable-frame/index.js +48 -34
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/revisions/index.js +31 -22
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/routes/link.js +5 -4
- package/build/components/routes/link.js.map +1 -1
- package/build/components/save-button/index.js +5 -4
- package/build/components/save-button/index.js.map +1 -1
- package/build/components/save-hub/index.js +12 -11
- package/build/components/save-hub/index.js.map +1 -1
- package/build/components/save-panel/index.js +36 -30
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +68 -35
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-button/index.js +4 -4
- package/build/components/sidebar-button/index.js.map +1 -1
- package/build/components/sidebar-dataviews/add-new-view.js +56 -48
- package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build/components/sidebar-dataviews/custom-dataviews-list.js +106 -89
- package/build/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build/components/sidebar-dataviews/dataview-item.js +14 -12
- package/build/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build/components/sidebar-dataviews/default-views.js +48 -0
- package/build/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build/components/sidebar-dataviews/index.js +21 -22
- package/build/components/sidebar-dataviews/index.js.map +1 -1
- package/build/components/sidebar-navigation-item/index.js +32 -28
- package/build/components/sidebar-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +56 -70
- package/build/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-footer/index.js +24 -17
- package/build/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-panel/index.js +9 -7
- package/build/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +5 -4
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +7 -7
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +5 -4
- package/build/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +57 -45
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +45 -22
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +5 -4
- package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js +20 -12
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +61 -35
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +10 -8
- package/build/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +42 -36
- package/build/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +18 -12
- package/build/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +36 -22
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +48 -40
- package/build/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +12 -9
- package/build/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/category-item.js +12 -10
- package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build/components/sidebar-navigation-screen-patterns/index.js +62 -77
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/content.js +17 -17
- package/build/components/sidebar-navigation-screen-templates-browse/content.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +8 -5
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/site-hub/index.js +83 -74
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/site-icon/index.js +9 -8
- package/build/components/site-icon/index.js.map +1 -1
- package/build/components/style-book/index.js +122 -103
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +10 -30
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/table/index.js +23 -15
- package/build/components/table/index.js.map +1 -1
- package/build/components/template-part-converter/convert-to-regular.js +5 -4
- package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build/components/template-part-converter/convert-to-template-part.js +23 -17
- package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build/components/template-part-converter/index.js +30 -11
- package/build/components/template-part-converter/index.js.map +1 -1
- package/build/components/welcome-guide/editor.js +20 -15
- package/build/components/welcome-guide/editor.js.map +1 -1
- package/build/components/welcome-guide/image.js +13 -12
- package/build/components/welcome-guide/image.js.map +1 -1
- package/build/components/welcome-guide/index.js +4 -2
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/page.js +18 -13
- package/build/components/welcome-guide/page.js.map +1 -1
- package/build/components/welcome-guide/styles.js +45 -28
- package/build/components/welcome-guide/styles.js.map +1 -1
- package/build/components/welcome-guide/template.js +18 -13
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/deprecated.js +4 -4
- package/build/deprecated.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +12 -24
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +2 -116
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/hooks/index.js +0 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/push-changes-to-global-styles/index.js +25 -16
- package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +7 -3
- package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build/index.js +3 -3
- package/build/index.js.map +1 -1
- package/build/store/private-actions.js +7 -1
- package/build/store/private-actions.js.map +1 -1
- package/build/store/selectors.js +2 -2
- package/build/store/selectors.js.map +1 -1
- package/build/utils/template-part-create.js +0 -62
- package/build/utils/template-part-create.js.map +1 -1
- package/build/utils/use-activate-theme.js +9 -7
- package/build/utils/use-activate-theme.js.map +1 -1
- package/build-module/components/add-new-page/index.js +34 -27
- package/build-module/components/add-new-page/index.js.map +1 -1
- package/build-module/components/add-new-pattern/index.js +98 -78
- package/build-module/components/add-new-pattern/index.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js +36 -30
- package/build-module/components/add-new-template/add-custom-generic-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js +121 -95
- package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/index.js +91 -73
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/add-new-template/utils.js +36 -17
- package/build-module/components/add-new-template/utils.js.map +1 -1
- package/build-module/components/app/index.js +15 -6
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/block-inspector-button.js +5 -4
- package/build-module/components/block-editor/block-inspector-button.js.map +1 -1
- package/build-module/components/block-editor/use-editor-iframe-props.js +80 -0
- package/build-module/components/block-editor/use-editor-iframe-props.js.map +1 -0
- package/build-module/components/canvas-loader/index.js +14 -13
- package/build-module/components/canvas-loader/index.js.map +1 -1
- package/build-module/components/dataviews-actions/index.js +41 -0
- package/build-module/components/dataviews-actions/index.js.map +1 -0
- package/build-module/components/editor/index.js +113 -144
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +29 -30
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/error-boundary/index.js +2 -2
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/error-boundary/warning.js +13 -11
- package/build-module/components/error-boundary/warning.js.map +1 -1
- package/build-module/components/global-styles/background-panel.js +18 -6
- package/build-module/components/global-styles/background-panel.js.map +1 -1
- package/build-module/components/global-styles/block-preview-panel.js +19 -17
- package/build-module/components/global-styles/block-preview-panel.js.map +1 -1
- package/build-module/components/global-styles/color-indicator-wrapper.js +4 -4
- package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +32 -28
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +2 -2
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/font-families.js +58 -40
- package/build-module/components/global-styles/font-families.js.map +1 -1
- package/build-module/components/global-styles/font-family-item.js +18 -13
- package/build-module/components/global-styles/font-family-item.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/collection-font-variant.js +26 -22
- 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 +7 -30
- 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 +25 -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 +198 -153
- 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 +14 -12
- package/build-module/components/global-styles/font-library-modal/font-demo.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js +30 -20
- package/build-module/components/global-styles/font-library-modal/google-fonts-confirm-dialog.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/index.js +42 -36
- 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 +157 -111
- 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-details.js +18 -14
- package/build-module/components/global-styles/font-library-modal/library-font-details.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/library-font-variant.js +26 -22
- 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 +42 -35
- 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 +3 -3
- package/build-module/components/global-styles/font-library-modal/utils/index.js.map +1 -1
- package/build-module/components/global-styles/gradients-palette-panel.js +42 -38
- package/build-module/components/global-styles/gradients-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/header.js +38 -28
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/highlighted-colors.js +3 -4
- package/build-module/components/global-styles/highlighted-colors.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +11 -20
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/icon-with-current-color.js +4 -4
- package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build-module/components/global-styles/navigation-button.js +16 -11
- package/build-module/components/global-styles/navigation-button.js.map +1 -1
- package/build-module/components/global-styles/palette.js +42 -34
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preset-colors.js +21 -0
- package/build-module/components/global-styles/preset-colors.js.map +1 -0
- package/build-module/components/global-styles/preview-colors.js +23 -25
- package/build-module/components/global-styles/preview-colors.js.map +1 -1
- package/build-module/components/global-styles/preview-iframe.js +36 -29
- package/build-module/components/global-styles/preview-iframe.js.map +1 -1
- package/build-module/components/global-styles/preview-styles.js +96 -90
- package/build-module/components/global-styles/preview-styles.js.map +1 -1
- package/build-module/components/global-styles/root-menu.js +31 -22
- package/build-module/components/global-styles/root-menu.js.map +1 -1
- package/build-module/components/global-styles/screen-background.js +8 -4
- package/build-module/components/global-styles/screen-background.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +35 -27
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +64 -53
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-color-palette.js +31 -19
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +20 -17
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-css.js +22 -14
- package/build-module/components/global-styles/screen-css.js.map +1 -1
- package/build-module/components/global-styles/screen-layout.js +11 -4
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/index.js +54 -42
- package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +83 -71
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -0
- package/build-module/components/global-styles/screen-revisions/use-global-styles-revisions.js.map +1 -1
- package/build-module/components/global-styles/screen-root.js +78 -42
- package/build-module/components/global-styles/screen-root.js.map +1 -1
- package/build-module/components/global-styles/screen-shadows.js +13 -0
- package/build-module/components/global-styles/screen-shadows.js.map +1 -0
- package/build-module/components/global-styles/screen-style-variations.js +16 -9
- package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
- package/build-module/components/global-styles/screen-typography-element.js +52 -45
- package/build-module/components/global-styles/screen-typography-element.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +17 -11
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/shadow-utils.js +221 -0
- package/build-module/components/global-styles/shadow-utils.js.map +1 -0
- package/build-module/components/global-styles/shadows-edit-panel.js +452 -0
- package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -0
- package/build-module/components/global-styles/shadows-panel.js +121 -0
- package/build-module/components/global-styles/shadows-panel.js.map +1 -0
- package/build-module/components/global-styles/style-variations-container.js +68 -19
- package/build-module/components/global-styles/style-variations-container.js.map +1 -1
- package/build-module/components/global-styles/subtitle.js +5 -4
- package/build-module/components/global-styles/subtitle.js.map +1 -1
- package/build-module/components/global-styles/typography-elements.js +54 -45
- package/build-module/components/global-styles/typography-elements.js.map +1 -1
- package/build-module/components/global-styles/typography-example.js +16 -9
- package/build-module/components/global-styles/typography-example.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +2 -2
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/typography-preview.js +5 -4
- package/build-module/components/global-styles/typography-preview.js.map +1 -1
- package/build-module/components/global-styles/ui.js +126 -89
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/utils.js +27 -0
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/global-styles/variations/variation.js +35 -24
- package/build-module/components/global-styles/variations/variation.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-color.js +21 -15
- package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-panel.js +28 -18
- package/build-module/components/global-styles/variations/variations-panel.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-typography.js +38 -31
- package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
- package/build-module/components/global-styles-renderer/index.js +5 -1
- package/build-module/components/global-styles-renderer/index.js.map +1 -1
- package/build-module/components/global-styles-sidebar/default-sidebar.js +51 -0
- package/build-module/components/global-styles-sidebar/default-sidebar.js.map +1 -0
- package/build-module/components/{sidebar-edit-mode/global-styles-sidebar.js → global-styles-sidebar/index.js} +38 -26
- package/build-module/components/global-styles-sidebar/index.js.map +1 -0
- package/build-module/components/layout/index.js +116 -100
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/router.js +110 -76
- package/build-module/components/layout/router.js.map +1 -1
- package/build-module/components/media/index.js +2 -2
- package/build-module/components/media/index.js.map +1 -1
- package/build-module/components/{header-edit-mode/more-menu → more-menu}/index.js +9 -3
- package/build-module/components/more-menu/index.js.map +1 -0
- package/build-module/components/{header-edit-mode/more-menu → more-menu}/site-export.js +5 -4
- package/build-module/components/more-menu/site-export.js.map +1 -0
- package/build-module/components/{header-edit-mode/more-menu → more-menu}/welcome-guide-menu-item.js +5 -4
- package/build-module/components/more-menu/welcome-guide-menu-item.js.map +1 -0
- package/build-module/components/page/header.js +25 -19
- package/build-module/components/page/header.js.map +1 -1
- package/build-module/components/page/index.js +16 -13
- package/build-module/components/page/index.js.map +1 -1
- package/build-module/components/page-pages/index.js +141 -69
- package/build-module/components/page-pages/index.js.map +1 -1
- package/build-module/components/page-patterns/delete-category-menu-item.js +25 -20
- package/build-module/components/page-patterns/delete-category-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/header.js +48 -32
- package/build-module/components/page-patterns/header.js.map +1 -1
- package/build-module/components/page-patterns/index.js +121 -125
- package/build-module/components/page-patterns/index.js.map +1 -1
- package/build-module/components/page-patterns/rename-category-menu-item.js +16 -11
- package/build-module/components/page-patterns/rename-category-menu-item.js.map +1 -1
- package/build-module/components/page-patterns/use-patterns.js +7 -6
- package/build-module/components/page-patterns/use-patterns.js.map +1 -1
- package/build-module/components/page-templates/index.js +85 -72
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/pagination/index.js +52 -42
- package/build-module/components/pagination/index.js.map +1 -1
- package/build-module/components/plugin-template-setting-panel/index.js +4 -2
- package/build-module/components/plugin-template-setting-panel/index.js.map +1 -1
- package/build-module/components/resizable-frame/index.js +51 -35
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/revisions/index.js +31 -21
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/routes/link.js +5 -4
- package/build-module/components/routes/link.js.map +1 -1
- package/build-module/components/save-button/index.js +5 -4
- package/build-module/components/save-button/index.js.map +1 -1
- package/build-module/components/save-hub/index.js +12 -11
- package/build-module/components/save-hub/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +37 -30
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +69 -36
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-button/index.js +4 -4
- package/build-module/components/sidebar-button/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js +58 -48
- package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js +108 -89
- package/build-module/components/sidebar-dataviews/custom-dataviews-list.js.map +1 -1
- package/build-module/components/sidebar-dataviews/dataview-item.js +15 -12
- package/build-module/components/sidebar-dataviews/dataview-item.js.map +1 -1
- package/build-module/components/sidebar-dataviews/default-views.js +49 -1
- package/build-module/components/sidebar-dataviews/default-views.js.map +1 -1
- package/build-module/components/sidebar-dataviews/index.js +23 -22
- package/build-module/components/sidebar-dataviews/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-item/index.js +33 -28
- package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +58 -70
- package/build-module/components/sidebar-navigation-screen/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js +25 -17
- package/build-module/components/sidebar-navigation-screen-details-footer/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/index.js +10 -7
- package/build-module/components/sidebar-navigation-screen-details-panel/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js +5 -4
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +7 -7
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js +5 -4
- package/build-module/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +59 -45
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +47 -22
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +5 -4
- package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +20 -12
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js +63 -35
- package/build-module/components/sidebar-navigation-screen-navigation-menu/more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js +10 -8
- package/build-module/components/sidebar-navigation-screen-navigation-menu/navigation-menu-editor.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +43 -36
- package/build-module/components/sidebar-navigation-screen-navigation-menu/rename-modal.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +19 -12
- package/build-module/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +36 -22
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +50 -40
- package/build-module/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js +14 -9
- package/build-module/components/sidebar-navigation-screen-navigation-menus/navigation-menu-content.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js +12 -10
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.js +64 -77
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/content.js +18 -17
- 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 +8 -5
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +85 -75
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/site-icon/index.js +9 -8
- package/build-module/components/site-icon/index.js.map +1 -1
- package/build-module/components/style-book/index.js +122 -102
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +10 -30
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/table/index.js +24 -15
- package/build-module/components/table/index.js.map +1 -1
- package/build-module/components/template-part-converter/convert-to-regular.js +5 -4
- package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build-module/components/template-part-converter/convert-to-template-part.js +25 -16
- package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build-module/components/template-part-converter/index.js +30 -11
- package/build-module/components/template-part-converter/index.js.map +1 -1
- package/build-module/components/welcome-guide/editor.js +22 -15
- package/build-module/components/welcome-guide/editor.js.map +1 -1
- package/build-module/components/welcome-guide/image.js +14 -12
- package/build-module/components/welcome-guide/image.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +6 -2
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/page.js +20 -13
- package/build-module/components/welcome-guide/page.js.map +1 -1
- package/build-module/components/welcome-guide/styles.js +47 -28
- package/build-module/components/welcome-guide/styles.js.map +1 -1
- package/build-module/components/welcome-guide/template.js +20 -13
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/deprecated.js +4 -4
- package/build-module/deprecated.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +12 -23
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +4 -118
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/hooks/index.js +0 -1
- package/build-module/hooks/index.js.map +1 -1
- package/build-module/hooks/push-changes-to-global-styles/index.js +27 -16
- package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +6 -2
- package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
- package/build-module/index.js +3 -3
- package/build-module/index.js.map +1 -1
- package/build-module/store/private-actions.js +7 -1
- package/build-module/store/private-actions.js.map +1 -1
- package/build-module/store/selectors.js +2 -2
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/template-part-create.js +0 -52
- package/build-module/utils/template-part-create.js.map +1 -1
- package/build-module/utils/use-activate-theme.js +9 -7
- package/build-module/utils/use-activate-theme.js.map +1 -1
- package/build-style/style-rtl.css +486 -981
- package/build-style/style.css +486 -981
- package/package.json +44 -47
- package/src/components/add-new-pattern/index.js +46 -37
- package/src/components/add-new-template/index.js +4 -2
- package/src/components/add-new-template/utils.js +77 -39
- package/src/components/app/index.js +5 -2
- package/src/components/block-editor/style.scss +4 -139
- package/src/components/block-editor/use-editor-iframe-props.js +79 -0
- package/src/components/canvas-loader/index.js +5 -2
- package/src/components/dataviews-actions/index.js +43 -0
- package/src/components/editor/index.js +129 -215
- package/src/components/editor/style.scss +2 -17
- package/src/components/editor-canvas-container/index.js +30 -35
- package/src/components/editor-canvas-container/style.scss +16 -0
- package/src/components/global-styles/background-panel.js +20 -4
- package/src/components/global-styles/color-indicator-wrapper.js +2 -2
- package/src/components/global-styles/color-palette-panel.js +3 -4
- package/src/components/global-styles/font-families.js +25 -18
- package/src/components/global-styles/font-family-item.js +2 -2
- package/src/components/global-styles/font-library-modal/collection-font-variant.js +2 -1
- package/src/components/global-styles/font-library-modal/context.js +6 -44
- package/src/components/global-styles/font-library-modal/font-collection.js +3 -5
- package/src/components/global-styles/font-library-modal/installed-fonts.js +42 -12
- package/src/components/global-styles/font-library-modal/library-font-variant.js +2 -1
- package/src/components/global-styles/font-library-modal/upload-fonts.js +1 -4
- package/src/components/global-styles/font-library-modal/utils/index.js +1 -1
- package/src/components/global-styles/gradients-palette-panel.js +1 -4
- package/src/components/global-styles/hooks.js +10 -36
- package/src/components/global-styles/icon-with-current-color.js +2 -2
- package/src/components/global-styles/palette.js +9 -18
- package/src/components/global-styles/preset-colors.js +18 -0
- package/src/components/global-styles/preview-colors.js +4 -7
- package/src/components/global-styles/root-menu.js +16 -12
- package/src/components/global-styles/screen-block.js +1 -1
- package/src/components/global-styles/screen-color-palette.js +4 -4
- package/src/components/global-styles/screen-colors.js +0 -2
- package/src/components/global-styles/screen-layout.js +9 -2
- package/src/components/global-styles/screen-revisions/index.js +6 -0
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +2 -2
- package/src/components/global-styles/screen-revisions/use-global-styles-revisions.js +1 -0
- package/src/components/global-styles/screen-shadows.js +13 -0
- package/src/components/global-styles/screen-typography.js +1 -1
- package/src/components/global-styles/shadow-utils.js +158 -0
- package/src/components/global-styles/shadows-edit-panel.js +555 -0
- package/src/components/global-styles/shadows-panel.js +147 -0
- package/src/components/global-styles/stories/index.story.js +2 -1
- package/src/components/global-styles/style-variations-container.js +73 -10
- package/src/components/global-styles/style.scss +54 -5
- package/src/components/global-styles/test/shadow-utils.spec.js +251 -0
- package/src/components/global-styles/test/utils.spec.js +59 -0
- package/src/components/global-styles/typography-example.js +2 -1
- package/src/components/global-styles/ui.js +15 -7
- package/src/components/global-styles/utils.js +27 -0
- package/src/components/global-styles/variations/style.scss +17 -30
- package/src/components/global-styles/variations/variation.js +15 -10
- package/src/components/global-styles/variations/variations-color.js +7 -9
- package/src/components/global-styles/variations/variations-panel.js +16 -5
- package/src/components/global-styles/variations/variations-typography.js +2 -1
- package/src/components/global-styles-renderer/index.js +7 -1
- package/src/components/{sidebar-edit-mode/global-styles-sidebar.js → global-styles-sidebar/index.js} +7 -2
- package/src/components/{sidebar-edit-mode → global-styles-sidebar}/style.scss +0 -11
- package/src/components/layout/index.js +10 -10
- package/src/components/layout/router.js +96 -61
- package/src/components/layout/style.scss +10 -6
- package/src/components/{header-edit-mode/more-menu → more-menu}/index.js +1 -1
- package/src/components/page/header.js +17 -13
- package/src/components/page/index.js +3 -7
- package/src/components/page/style.scss +21 -7
- package/src/components/page-pages/index.js +162 -68
- package/src/components/page-pages/style.scss +14 -10
- package/src/components/page-patterns/delete-category-menu-item.js +1 -2
- package/src/components/page-patterns/header.js +45 -33
- package/src/components/page-patterns/index.js +25 -81
- package/src/components/page-patterns/style.scss +21 -14
- package/src/components/page-patterns/use-patterns.js +13 -6
- package/src/components/page-templates/index.js +10 -29
- package/src/components/pagination/index.js +2 -2
- package/src/components/resizable-frame/index.js +17 -5
- package/src/components/revisions/index.js +2 -1
- package/src/components/save-panel/index.js +5 -7
- package/src/components/sidebar/index.js +61 -37
- package/src/components/sidebar-button/index.js +2 -5
- package/src/components/sidebar-dataviews/add-new-view.js +5 -5
- package/src/components/sidebar-dataviews/custom-dataviews-list.js +5 -7
- package/src/components/sidebar-dataviews/dataview-item.js +6 -9
- package/src/components/sidebar-dataviews/default-views.js +61 -1
- package/src/components/sidebar-dataviews/index.js +4 -9
- package/src/components/sidebar-navigation-item/index.js +10 -10
- package/src/components/sidebar-navigation-screen/index.js +7 -31
- package/src/components/sidebar-navigation-screen/style.scss +11 -9
- package/src/components/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.js +2 -2
- package/src/components/sidebar-navigation-screen-global-styles/index.js +10 -3
- package/src/components/sidebar-navigation-screen-main/index.js +14 -4
- package/src/components/sidebar-navigation-screen-navigation-menu/index.js +6 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/more-menu.js +18 -1
- package/src/components/sidebar-navigation-screen-navigation-menu/single-navigation-menu.js +3 -0
- package/src/components/sidebar-navigation-screen-navigation-menu/use-navigation-menu-handlers.js +1 -1
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +8 -4
- package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +6 -13
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +0 -61
- package/src/components/sidebar-navigation-screen-patterns/category-item.js +5 -3
- package/src/components/sidebar-navigation-screen-patterns/index.js +8 -29
- package/src/components/sidebar-navigation-screen-templates-browse/content.js +1 -1
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +3 -2
- package/src/components/site-hub/index.js +14 -15
- package/src/components/site-hub/style.scss +46 -9
- package/src/components/site-icon/index.js +2 -2
- package/src/components/style-book/index.js +8 -7
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +18 -23
- package/src/components/template-part-converter/convert-to-template-part.js +4 -1
- package/src/components/template-part-converter/index.js +16 -3
- package/src/hooks/commands/use-common-commands.js +12 -23
- package/src/hooks/commands/use-edit-mode-commands.js +4 -118
- package/src/hooks/index.js +0 -1
- package/src/hooks/push-changes-to-global-styles/index.js +2 -1
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +7 -2
- package/src/index.js +1 -1
- package/src/store/private-actions.js +9 -1
- package/src/store/selectors.js +2 -2
- package/src/style.scss +1 -17
- package/src/utils/template-part-create.js +0 -67
- package/src/utils/use-activate-theme.js +5 -5
- package/build/components/block-editor/editor-canvas.js +0 -153
- package/build/components/block-editor/editor-canvas.js.map +0 -1
- package/build/components/block-editor/resizable-editor.js +0 -86
- package/build/components/block-editor/resizable-editor.js.map +0 -1
- package/build/components/block-editor/resize-handle.js +0 -57
- package/build/components/block-editor/resize-handle.js.map +0 -1
- package/build/components/block-editor/site-editor-canvas.js +0 -95
- package/build/components/block-editor/site-editor-canvas.js.map +0 -1
- package/build/components/code-editor/index.js +0 -111
- package/build/components/code-editor/index.js.map +0 -1
- package/build/components/create-template-part-modal/index.js +0 -151
- package/build/components/create-template-part-modal/index.js.map +0 -1
- package/build/components/global-styles/global-styles-provider.js +0 -129
- package/build/components/global-styles/global-styles-provider.js.map +0 -1
- package/build/components/header-edit-mode/document-tools/index.js +0 -68
- package/build/components/header-edit-mode/document-tools/index.js.map +0 -1
- package/build/components/header-edit-mode/index.js +0 -150
- package/build/components/header-edit-mode/index.js.map +0 -1
- package/build/components/header-edit-mode/more-menu/index.js.map +0 -1
- package/build/components/header-edit-mode/more-menu/site-export.js.map +0 -1
- package/build/components/header-edit-mode/more-menu/welcome-guide-menu-item.js.map +0 -1
- package/build/components/page-patterns/dataviews-pattern-actions.js +0 -387
- package/build/components/page-patterns/dataviews-pattern-actions.js.map +0 -1
- package/build/components/pattern-modal/duplicate.js +0 -70
- package/build/components/pattern-modal/duplicate.js.map +0 -1
- package/build/components/pattern-modal/index.js +0 -23
- package/build/components/pattern-modal/index.js.map +0 -1
- package/build/components/pattern-modal/rename.js +0 -45
- package/build/components/pattern-modal/rename.js.map +0 -1
- package/build/components/rename-post-menu-item/index.js +0 -109
- package/build/components/rename-post-menu-item/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/default-sidebar.js +0 -52
- package/build/components/sidebar-edit-mode/default-sidebar.js.map +0 -1
- package/build/components/sidebar-edit-mode/global-styles-sidebar.js.map +0 -1
- package/build/components/sidebar-edit-mode/index.js +0 -147
- package/build/components/sidebar-edit-mode/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/page-panels/index.js +0 -129
- package/build/components/sidebar-edit-mode/page-panels/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/page-panels/page-content.js +0 -34
- package/build/components/sidebar-edit-mode/page-panels/page-content.js.map +0 -1
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js +0 -46
- package/build/components/sidebar-edit-mode/page-panels/page-summary.js.map +0 -1
- package/build/components/sidebar-edit-mode/settings-header/index.js +0 -42
- package/build/components/sidebar-edit-mode/settings-header/index.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-panel/hooks.js +0 -86
- package/build/components/sidebar-edit-mode/template-panel/hooks.js.map +0 -1
- package/build/components/sidebar-edit-mode/template-panel/index.js +0 -127
- package/build/components/sidebar-edit-mode/template-panel/index.js.map +0 -1
- package/build/components/sidebar-navigation-screen-page/index.js +0 -163
- package/build/components/sidebar-navigation-screen-page/index.js.map +0 -1
- package/build/components/sidebar-navigation-screen-page/page-details.js +0 -127
- package/build/components/sidebar-navigation-screen-page/page-details.js.map +0 -1
- package/build/components/sidebar-navigation-screen-page/status-label.js +0 -65
- package/build/components/sidebar-navigation-screen-page/status-label.js.map +0 -1
- package/build/components/sidebar-navigation-screen-pattern/index.js +0 -72
- package/build/components/sidebar-navigation-screen-pattern/index.js.map +0 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +0 -38
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +0 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +0 -29
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +0 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +0 -37
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +0 -1
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +0 -45
- package/build/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +0 -1
- package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +0 -88
- package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +0 -1
- package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js +0 -29
- package/build/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map +0 -1
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +0 -138
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +0 -1
- package/build/components/sidebar-navigation-screen-template/home-template-details.js +0 -110
- package/build/components/sidebar-navigation-screen-template/home-template-details.js.map +0 -1
- package/build/components/sidebar-navigation-screen-template/index.js +0 -118
- package/build/components/sidebar-navigation-screen-template/index.js.map +0 -1
- package/build/components/sidebar-navigation-screen-template/template-areas.js +0 -117
- package/build/components/sidebar-navigation-screen-template/template-areas.js.map +0 -1
- package/build/components/start-template-options/index.js +0 -191
- package/build/components/start-template-options/index.js.map +0 -1
- package/build/components/template-actions/index.js +0 -131
- package/build/components/template-actions/index.js.map +0 -1
- package/build/hooks/components.js +0 -10
- package/build/hooks/components.js.map +0 -1
- package/build/utils/get-is-list-page.js +0 -28
- package/build/utils/get-is-list-page.js.map +0 -1
- package/build/utils/math.js +0 -98
- package/build/utils/math.js.map +0 -1
- package/build-module/components/block-editor/editor-canvas.js +0 -145
- package/build-module/components/block-editor/editor-canvas.js.map +0 -1
- package/build-module/components/block-editor/resizable-editor.js +0 -79
- package/build-module/components/block-editor/resizable-editor.js.map +0 -1
- package/build-module/components/block-editor/resize-handle.js +0 -50
- package/build-module/components/block-editor/resize-handle.js.map +0 -1
- package/build-module/components/block-editor/site-editor-canvas.js +0 -86
- package/build-module/components/block-editor/site-editor-canvas.js.map +0 -1
- package/build-module/components/code-editor/index.js +0 -103
- package/build-module/components/code-editor/index.js.map +0 -1
- package/build-module/components/create-template-part-modal/index.js +0 -143
- package/build-module/components/create-template-part-modal/index.js.map +0 -1
- package/build-module/components/global-styles/global-styles-provider.js +0 -120
- package/build-module/components/global-styles/global-styles-provider.js.map +0 -1
- package/build-module/components/header-edit-mode/document-tools/index.js +0 -61
- package/build-module/components/header-edit-mode/document-tools/index.js.map +0 -1
- package/build-module/components/header-edit-mode/index.js +0 -142
- package/build-module/components/header-edit-mode/index.js.map +0 -1
- package/build-module/components/header-edit-mode/more-menu/index.js.map +0 -1
- package/build-module/components/header-edit-mode/more-menu/site-export.js.map +0 -1
- package/build-module/components/header-edit-mode/more-menu/welcome-guide-menu-item.js.map +0 -1
- package/build-module/components/page-patterns/dataviews-pattern-actions.js +0 -380
- package/build-module/components/page-patterns/dataviews-pattern-actions.js.map +0 -1
- package/build-module/components/pattern-modal/duplicate.js +0 -62
- package/build-module/components/pattern-modal/duplicate.js.map +0 -1
- package/build-module/components/pattern-modal/index.js +0 -14
- package/build-module/components/pattern-modal/index.js.map +0 -1
- package/build-module/components/pattern-modal/rename.js +0 -37
- package/build-module/components/pattern-modal/rename.js.map +0 -1
- package/build-module/components/rename-post-menu-item/index.js +0 -102
- package/build-module/components/rename-post-menu-item/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/default-sidebar.js +0 -45
- package/build-module/components/sidebar-edit-mode/default-sidebar.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/global-styles-sidebar.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/index.js +0 -138
- package/build-module/components/sidebar-edit-mode/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/page-panels/index.js +0 -121
- package/build-module/components/sidebar-edit-mode/page-panels/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-content.js +0 -27
- package/build-module/components/sidebar-edit-mode/page-panels/page-content.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js +0 -39
- package/build-module/components/sidebar-edit-mode/page-panels/page-summary.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/settings-header/index.js +0 -35
- package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-panel/hooks.js +0 -79
- package/build-module/components/sidebar-edit-mode/template-panel/hooks.js.map +0 -1
- package/build-module/components/sidebar-edit-mode/template-panel/index.js +0 -119
- package/build-module/components/sidebar-edit-mode/template-panel/index.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-page/index.js +0 -155
- package/build-module/components/sidebar-navigation-screen-page/index.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-page/page-details.js +0 -120
- package/build-module/components/sidebar-navigation-screen-page/page-details.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-page/status-label.js +0 -57
- package/build-module/components/sidebar-navigation-screen-page/status-label.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-pattern/index.js +0 -64
- package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +0 -30
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +0 -20
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +0 -29
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +0 -36
- package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +0 -80
- package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js +0 -22
- package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +0 -130
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-template/home-template-details.js +0 -103
- package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-template/index.js +0 -110
- package/build-module/components/sidebar-navigation-screen-template/index.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-template/template-areas.js +0 -109
- package/build-module/components/sidebar-navigation-screen-template/template-areas.js.map +0 -1
- package/build-module/components/start-template-options/index.js +0 -184
- package/build-module/components/start-template-options/index.js.map +0 -1
- package/build-module/components/template-actions/index.js +0 -123
- package/build-module/components/template-actions/index.js.map +0 -1
- package/build-module/hooks/components.js +0 -7
- package/build-module/hooks/components.js.map +0 -1
- package/build-module/utils/get-is-list-page.js +0 -22
- package/build-module/utils/get-is-list-page.js.map +0 -1
- package/build-module/utils/math.js +0 -92
- package/build-module/utils/math.js.map +0 -1
- package/src/components/block-editor/editor-canvas.js +0 -178
- package/src/components/block-editor/resizable-editor.js +0 -82
- package/src/components/block-editor/resize-handle.js +0 -66
- package/src/components/block-editor/site-editor-canvas.js +0 -107
- package/src/components/code-editor/index.js +0 -94
- package/src/components/code-editor/style.scss +0 -95
- package/src/components/create-template-part-modal/index.js +0 -199
- package/src/components/create-template-part-modal/style.scss +0 -69
- package/src/components/global-styles/global-styles-provider.js +0 -162
- package/src/components/header-edit-mode/document-tools/index.js +0 -68
- package/src/components/header-edit-mode/index.js +0 -190
- package/src/components/header-edit-mode/style.scss +0 -201
- package/src/components/page-patterns/dataviews-pattern-actions.js +0 -439
- package/src/components/pattern-modal/duplicate.js +0 -55
- package/src/components/pattern-modal/index.js +0 -19
- package/src/components/pattern-modal/rename.js +0 -30
- package/src/components/rename-post-menu-item/index.js +0 -138
- package/src/components/sidebar-edit-mode/index.js +0 -173
- package/src/components/sidebar-edit-mode/page-panels/index.js +0 -133
- package/src/components/sidebar-edit-mode/page-panels/page-content.js +0 -29
- package/src/components/sidebar-edit-mode/page-panels/page-summary.js +0 -61
- package/src/components/sidebar-edit-mode/settings-header/index.js +0 -43
- package/src/components/sidebar-edit-mode/settings-header/style.scss +0 -14
- package/src/components/sidebar-edit-mode/template-panel/hooks.js +0 -114
- package/src/components/sidebar-edit-mode/template-panel/index.js +0 -134
- package/src/components/sidebar-edit-mode/template-panel/style.scss +0 -16
- package/src/components/sidebar-navigation-screen-page/index.js +0 -204
- package/src/components/sidebar-navigation-screen-page/page-details.js +0 -161
- package/src/components/sidebar-navigation-screen-page/status-label.js +0 -71
- package/src/components/sidebar-navigation-screen-page/style.scss +0 -69
- package/src/components/sidebar-navigation-screen-pattern/index.js +0 -63
- package/src/components/sidebar-navigation-screen-pattern/style.scss +0 -26
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js +0 -31
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js +0 -21
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js +0 -33
- package/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js +0 -36
- package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js +0 -98
- package/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js +0 -32
- package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +0 -205
- package/src/components/sidebar-navigation-screen-template/home-template-details.js +0 -144
- package/src/components/sidebar-navigation-screen-template/index.js +0 -133
- package/src/components/sidebar-navigation-screen-template/style.scss +0 -53
- package/src/components/sidebar-navigation-screen-template/template-areas.js +0 -135
- package/src/components/start-template-options/index.js +0 -231
- package/src/components/start-template-options/style.scss +0 -55
- package/src/components/template-actions/index.js +0 -165
- package/src/hooks/components.js +0 -11
- package/src/utils/get-is-list-page.js +0 -25
- package/src/utils/math.js +0 -93
- package/src/utils/test/template-part-create.js +0 -63
- /package/src/components/{sidebar-edit-mode → global-styles-sidebar}/default-sidebar.js +0 -0
- /package/src/components/{header-edit-mode/more-menu → more-menu}/site-export.js +0 -0
- /package/src/components/{header-edit-mode/more-menu → more-menu}/welcome-guide-menu-item.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_changeCase","require","_i18n","_coreData","_editor","_data","_hooks","_useEditedEntityRecord","_interopRequireDefault","_useNavigationMenuContent","_sidebarNavigationScreenDetailsFooter","_sidebarNavigationScreenDetailsPanel","_constants","usePatternDetails","postType","postId","getDescription","getTitle","record","useEditedEntityRecord","templatePartAreas","useSelect","select","editorStore","__experimentalGetDefaultTemplatePartAreas","currentTheme","userPatternCategories","getCurrentTheme","getUserPatternCategories","coreStore","addedBy","useAddedBy","isAddedByActiveTheme","type","theme","stylesheet","title","description","text","PATTERN_TYPES","user","sprintf","__","footer","modified","_react","createElement","default","details","TEMPLATE_PART_POST_TYPE","push","label","value","wp_pattern_sync_status","PATTERN_SYNC_TYPES","unsynced","_x","wp_pattern_category","length","patternCategories","Map","forEach","userCategory","set","id","categories","filter","category","get","map","join","templatePartArea","find","area","areaDetailValue","sentenceCase","className","origin","TEMPLATE_ORIGINS","plugin","has_theme_file","isCustomized","content","Fragment","useNavigationMenuContent","SidebarNavigationScreenDetailsPanel","spacing","SidebarNavigationScreenDetailsPanelRow","key","SidebarNavigationScreenDetailsPanelLabel","SidebarNavigationScreenDetailsPanelValue"],"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/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":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,sBAAA,GAAAC,sBAAA,CAAAP,OAAA;AACA,IAAAQ,yBAAA,GAAAD,sBAAA,CAAAP,OAAA;AACA,IAAAS,qCAAA,GAAAF,sBAAA,CAAAP,OAAA;AACA,IAAAU,oCAAA,GAAAV,OAAA;AAMA,IAAAW,UAAA,GAAAX,OAAA;AA1BA;AACA;AACA;;AAGA;AACA;AACA;;AAMA;AACA;AACA;;AAkBe,SAASY,iBAAiBA,CAAEC,QAAQ,EAAEC,MAAM,EAAG;EAC7D,MAAM;IAAEC,cAAc;IAAEC,QAAQ;IAAEC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Module", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = HomeTemplateDetails;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _i18n = require("@wordpress/i18n");
|
|
9
|
-
var _compose = require("@wordpress/compose");
|
|
10
|
-
var _data = require("@wordpress/data");
|
|
11
|
-
var _coreData = require("@wordpress/core-data");
|
|
12
|
-
var _components = require("@wordpress/components");
|
|
13
|
-
var _element = require("@wordpress/element");
|
|
14
|
-
var _sidebarNavigationScreenDetailsPanel = require("../sidebar-navigation-screen-details-panel");
|
|
15
|
-
/**
|
|
16
|
-
* WordPress dependencies
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Internal dependencies
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
const EMPTY_OBJECT = {};
|
|
24
|
-
function HomeTemplateDetails() {
|
|
25
|
-
const {
|
|
26
|
-
editEntityRecord
|
|
27
|
-
} = (0, _data.useDispatch)(_coreData.store);
|
|
28
|
-
const {
|
|
29
|
-
allowCommentsOnNewPosts,
|
|
30
|
-
postsPerPage,
|
|
31
|
-
postsPageTitle,
|
|
32
|
-
postsPageId
|
|
33
|
-
} = (0, _data.useSelect)(select => {
|
|
34
|
-
const {
|
|
35
|
-
getEntityRecord
|
|
36
|
-
} = select(_coreData.store);
|
|
37
|
-
const siteSettings = getEntityRecord('root', 'site');
|
|
38
|
-
const _postsPageRecord = siteSettings?.page_for_posts ? getEntityRecord('postType', 'page', siteSettings?.page_for_posts) : EMPTY_OBJECT;
|
|
39
|
-
return {
|
|
40
|
-
allowCommentsOnNewPosts: siteSettings?.default_comment_status === 'open',
|
|
41
|
-
postsPageTitle: _postsPageRecord?.title?.rendered,
|
|
42
|
-
postsPageId: _postsPageRecord?.id,
|
|
43
|
-
postsPerPage: siteSettings?.posts_per_page
|
|
44
|
-
};
|
|
45
|
-
}, []);
|
|
46
|
-
const [commentsOnNewPostsValue, setCommentsOnNewPostsValue] = (0, _element.useState)('');
|
|
47
|
-
const [postsCountValue, setPostsCountValue] = (0, _element.useState)(1);
|
|
48
|
-
const [postsPageTitleValue, setPostsPageTitleValue] = (0, _element.useState)('');
|
|
49
|
-
|
|
50
|
-
/*
|
|
51
|
-
* This hook serves to set the server-retrieved values,
|
|
52
|
-
* postsPageTitle, allowCommentsOnNewPosts, postsPerPage,
|
|
53
|
-
* to local state.
|
|
54
|
-
*/
|
|
55
|
-
(0, _element.useEffect)(() => {
|
|
56
|
-
setCommentsOnNewPostsValue(allowCommentsOnNewPosts);
|
|
57
|
-
setPostsPageTitleValue(postsPageTitle);
|
|
58
|
-
setPostsCountValue(postsPerPage);
|
|
59
|
-
}, [postsPageTitle, allowCommentsOnNewPosts, postsPerPage]);
|
|
60
|
-
const setAllowCommentsOnNewPosts = newValue => {
|
|
61
|
-
setCommentsOnNewPostsValue(newValue);
|
|
62
|
-
editEntityRecord('root', 'site', undefined, {
|
|
63
|
-
default_comment_status: newValue ? 'open' : null
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
const setPostsPageTitle = newValue => {
|
|
67
|
-
setPostsPageTitleValue(newValue);
|
|
68
|
-
editEntityRecord('postType', 'page', postsPageId, {
|
|
69
|
-
title: newValue
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
const setPostsPerPage = newValue => {
|
|
73
|
-
setPostsCountValue(newValue);
|
|
74
|
-
editEntityRecord('root', 'site', undefined, {
|
|
75
|
-
posts_per_page: newValue
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
|
-
return (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_sidebarNavigationScreenDetailsPanel.SidebarNavigationScreenDetailsPanel, {
|
|
79
|
-
spacing: 6
|
|
80
|
-
}, postsPageId && (0, _react.createElement)(_sidebarNavigationScreenDetailsPanel.SidebarNavigationScreenDetailsPanelRow, null, (0, _react.createElement)(_components.__experimentalInputControl, {
|
|
81
|
-
className: "edit-site-sidebar-navigation-screen__input-control",
|
|
82
|
-
placeholder: (0, _i18n.__)('No Title'),
|
|
83
|
-
size: '__unstable-large',
|
|
84
|
-
value: postsPageTitleValue,
|
|
85
|
-
onChange: (0, _compose.debounce)(setPostsPageTitle, 300),
|
|
86
|
-
label: (0, _i18n.__)('Blog title'),
|
|
87
|
-
help: (0, _i18n.__)('Set the Posts Page title. Appears in search results, and when the page is shared on social media.')
|
|
88
|
-
})), (0, _react.createElement)(_sidebarNavigationScreenDetailsPanel.SidebarNavigationScreenDetailsPanelRow, null, (0, _react.createElement)(_components.__experimentalNumberControl, {
|
|
89
|
-
className: "edit-site-sidebar-navigation-screen__input-control",
|
|
90
|
-
placeholder: 0,
|
|
91
|
-
value: postsCountValue,
|
|
92
|
-
size: '__unstable-large',
|
|
93
|
-
spinControls: "custom",
|
|
94
|
-
step: "1",
|
|
95
|
-
min: "1",
|
|
96
|
-
onChange: setPostsPerPage,
|
|
97
|
-
label: (0, _i18n.__)('Posts per page'),
|
|
98
|
-
help: (0, _i18n.__)('Set the default number of posts to display on blog pages, including categories and tags. Some templates may override this setting.')
|
|
99
|
-
}))), (0, _react.createElement)(_sidebarNavigationScreenDetailsPanel.SidebarNavigationScreenDetailsPanel, {
|
|
100
|
-
title: (0, _i18n.__)('Discussion'),
|
|
101
|
-
spacing: 3
|
|
102
|
-
}, (0, _react.createElement)(_sidebarNavigationScreenDetailsPanel.SidebarNavigationScreenDetailsPanelRow, null, (0, _react.createElement)(_components.CheckboxControl, {
|
|
103
|
-
className: "edit-site-sidebar-navigation-screen__input-control",
|
|
104
|
-
label: (0, _i18n.__)('Allow comments on new posts'),
|
|
105
|
-
help: (0, _i18n.__)('Changes will apply to new posts only. Individual posts may override these settings.'),
|
|
106
|
-
checked: commentsOnNewPostsValue,
|
|
107
|
-
onChange: setAllowCommentsOnNewPosts
|
|
108
|
-
}))));
|
|
109
|
-
}
|
|
110
|
-
//# sourceMappingURL=home-template-details.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_compose","_data","_coreData","_components","_element","_sidebarNavigationScreenDetailsPanel","EMPTY_OBJECT","HomeTemplateDetails","editEntityRecord","useDispatch","coreStore","allowCommentsOnNewPosts","postsPerPage","postsPageTitle","postsPageId","useSelect","select","getEntityRecord","siteSettings","_postsPageRecord","page_for_posts","default_comment_status","title","rendered","id","posts_per_page","commentsOnNewPostsValue","setCommentsOnNewPostsValue","useState","postsCountValue","setPostsCountValue","postsPageTitleValue","setPostsPageTitleValue","useEffect","setAllowCommentsOnNewPosts","newValue","undefined","setPostsPageTitle","setPostsPerPage","_react","createElement","Fragment","SidebarNavigationScreenDetailsPanel","spacing","SidebarNavigationScreenDetailsPanelRow","__experimentalInputControl","className","placeholder","__","size","value","onChange","debounce","label","help","__experimentalNumberControl","spinControls","step","min","CheckboxControl","checked"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-template/home-template-details.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { debounce } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tCheckboxControl,\n\t__experimentalInputControl as InputControl,\n\t__experimentalNumberControl as NumberControl,\n} from '@wordpress/components';\nimport { useState, useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport {\n\tSidebarNavigationScreenDetailsPanel,\n\tSidebarNavigationScreenDetailsPanelRow,\n} from '../sidebar-navigation-screen-details-panel';\n\nconst EMPTY_OBJECT = {};\n\nexport default function HomeTemplateDetails() {\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\n\tconst {\n\t\tallowCommentsOnNewPosts,\n\t\tpostsPerPage,\n\t\tpostsPageTitle,\n\t\tpostsPageId,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEntityRecord } = select( coreStore );\n\t\tconst siteSettings = getEntityRecord( 'root', 'site' );\n\t\tconst _postsPageRecord = siteSettings?.page_for_posts\n\t\t\t? getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'page',\n\t\t\t\t\tsiteSettings?.page_for_posts\n\t\t\t )\n\t\t\t: EMPTY_OBJECT;\n\n\t\treturn {\n\t\t\tallowCommentsOnNewPosts:\n\t\t\t\tsiteSettings?.default_comment_status === 'open',\n\t\t\tpostsPageTitle: _postsPageRecord?.title?.rendered,\n\t\t\tpostsPageId: _postsPageRecord?.id,\n\t\t\tpostsPerPage: siteSettings?.posts_per_page,\n\t\t};\n\t}, [] );\n\n\tconst [ commentsOnNewPostsValue, setCommentsOnNewPostsValue ] =\n\t\tuseState( '' );\n\tconst [ postsCountValue, setPostsCountValue ] = useState( 1 );\n\tconst [ postsPageTitleValue, setPostsPageTitleValue ] = useState( '' );\n\n\t/*\n\t * This hook serves to set the server-retrieved values,\n\t * postsPageTitle, allowCommentsOnNewPosts, postsPerPage,\n\t * to local state.\n\t */\n\tuseEffect( () => {\n\t\tsetCommentsOnNewPostsValue( allowCommentsOnNewPosts );\n\t\tsetPostsPageTitleValue( postsPageTitle );\n\t\tsetPostsCountValue( postsPerPage );\n\t}, [ postsPageTitle, allowCommentsOnNewPosts, postsPerPage ] );\n\n\tconst setAllowCommentsOnNewPosts = ( newValue ) => {\n\t\tsetCommentsOnNewPostsValue( newValue );\n\t\teditEntityRecord( 'root', 'site', undefined, {\n\t\t\tdefault_comment_status: newValue ? 'open' : null,\n\t\t} );\n\t};\n\n\tconst setPostsPageTitle = ( newValue ) => {\n\t\tsetPostsPageTitleValue( newValue );\n\t\teditEntityRecord( 'postType', 'page', postsPageId, {\n\t\t\ttitle: newValue,\n\t\t} );\n\t};\n\n\tconst setPostsPerPage = ( newValue ) => {\n\t\tsetPostsCountValue( newValue );\n\t\teditEntityRecord( 'root', 'site', undefined, {\n\t\t\tposts_per_page: newValue,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationScreenDetailsPanel spacing={ 6 }>\n\t\t\t\t{ postsPageId && (\n\t\t\t\t\t<SidebarNavigationScreenDetailsPanelRow>\n\t\t\t\t\t\t<InputControl\n\t\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__input-control\"\n\t\t\t\t\t\t\tplaceholder={ __( 'No Title' ) }\n\t\t\t\t\t\t\tsize={ '__unstable-large' }\n\t\t\t\t\t\t\tvalue={ postsPageTitleValue }\n\t\t\t\t\t\t\tonChange={ debounce( setPostsPageTitle, 300 ) }\n\t\t\t\t\t\t\tlabel={ __( 'Blog title' ) }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Set the Posts Page title. Appears in search results, and when the page is shared on social media.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t\t) }\n\t\t\t\t<SidebarNavigationScreenDetailsPanelRow>\n\t\t\t\t\t<NumberControl\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__input-control\"\n\t\t\t\t\t\tplaceholder={ 0 }\n\t\t\t\t\t\tvalue={ postsCountValue }\n\t\t\t\t\t\tsize={ '__unstable-large' }\n\t\t\t\t\t\tspinControls=\"custom\"\n\t\t\t\t\t\tstep=\"1\"\n\t\t\t\t\t\tmin=\"1\"\n\t\t\t\t\t\tonChange={ setPostsPerPage }\n\t\t\t\t\t\tlabel={ __( 'Posts per page' ) }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Set the default number of posts to display on blog pages, including categories and tags. Some templates may override this setting.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t</SidebarNavigationScreenDetailsPanel>\n\n\t\t\t<SidebarNavigationScreenDetailsPanel\n\t\t\t\ttitle={ __( 'Discussion' ) }\n\t\t\t\tspacing={ 3 }\n\t\t\t>\n\t\t\t\t<SidebarNavigationScreenDetailsPanelRow>\n\t\t\t\t\t<CheckboxControl\n\t\t\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen__input-control\"\n\t\t\t\t\t\tlabel={ __( 'Allow comments on new posts' ) }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'Changes will apply to new posts only. Individual posts may override these settings.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tchecked={ commentsOnNewPostsValue }\n\t\t\t\t\t\tonChange={ setAllowCommentsOnNewPosts }\n\t\t\t\t\t/>\n\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t</SidebarNavigationScreenDetailsPanel>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAKA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,oCAAA,GAAAN,OAAA;AAjBA;AACA;AACA;;AAYA;AACA;AACA;;AAMA,MAAMO,YAAY,GAAG,CAAC,CAAC;AAER,SAASC,mBAAmBA,CAAA,EAAG;EAC7C,MAAM;IAAEC;EAAiB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,eAAU,CAAC;EAErD,MAAM;IACLC,uBAAuB;IACvBC,YAAY;IACZC,cAAc;IACdC;EACD,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC5B,MAAM;MAAEC;IAAgB,CAAC,GAAGD,MAAM,CAAEN,eAAU,CAAC;IAC/C,MAAMQ,YAAY,GAAGD,eAAe,CAAE,MAAM,EAAE,MAAO,CAAC;IACtD,MAAME,gBAAgB,GAAGD,YAAY,EAAEE,cAAc,GAClDH,eAAe,CACf,UAAU,EACV,MAAM,EACNC,YAAY,EAAEE,cACd,CAAC,GACDd,YAAY;IAEf,OAAO;MACNK,uBAAuB,EACtBO,YAAY,EAAEG,sBAAsB,KAAK,MAAM;MAChDR,cAAc,EAAEM,gBAAgB,EAAEG,KAAK,E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EAAG,GAEb,IAAAJ,MAAA,CAAAC,aAAA,EAACnC,oCAAA,CAAAuC,sCAAsC,QACtC,IAAAL,MAAA,CAAAC,aAAA,EAACrC,WAAA,CAAAwD,eAAe;IACfb,SAAS,EAAC,oDAAoD;IAC9DO,KAAK,EAAG,IAAAL,QAAE,EAAE,6BAA8B,CAAG;IAC7CM,IAAI,EAAG,IAAAN,QAAE,EACR,qFACD,CAAG;IACHY,OAAO,EAAGlC,uBAAyB;IACnCyB,QAAQ,EAAGjB;EAA4B,CACvC,CACsC,CACJ,CACpC,CAAC;AAEL","ignoreList":[]}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = SidebarNavigationScreenTemplate;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _i18n = require("@wordpress/i18n");
|
|
10
|
-
var _data = require("@wordpress/data");
|
|
11
|
-
var _icons = require("@wordpress/icons");
|
|
12
|
-
var _components = require("@wordpress/components");
|
|
13
|
-
var _coreData = require("@wordpress/core-data");
|
|
14
|
-
var _router = require("@wordpress/router");
|
|
15
|
-
var _templateAreas = _interopRequireDefault(require("./template-areas"));
|
|
16
|
-
var _sidebarNavigationScreen = _interopRequireDefault(require("../sidebar-navigation-screen"));
|
|
17
|
-
var _useEditedEntityRecord = _interopRequireDefault(require("../use-edited-entity-record"));
|
|
18
|
-
var _lockUnlock = require("../../lock-unlock");
|
|
19
|
-
var _store = require("../../store");
|
|
20
|
-
var _sidebarButton = _interopRequireDefault(require("../sidebar-button"));
|
|
21
|
-
var _hooks = require("../page-templates/hooks");
|
|
22
|
-
var _templateActions = _interopRequireDefault(require("../template-actions"));
|
|
23
|
-
var _homeTemplateDetails = _interopRequireDefault(require("./home-template-details"));
|
|
24
|
-
var _sidebarNavigationScreenDetailsFooter = _interopRequireDefault(require("../sidebar-navigation-screen-details-footer"));
|
|
25
|
-
/**
|
|
26
|
-
* WordPress dependencies
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Internal dependencies
|
|
31
|
-
*/
|
|
32
|
-
|
|
33
|
-
const {
|
|
34
|
-
useHistory,
|
|
35
|
-
useLocation
|
|
36
|
-
} = (0, _lockUnlock.unlock)(_router.privateApis);
|
|
37
|
-
function useTemplateDetails(postType, postId) {
|
|
38
|
-
const {
|
|
39
|
-
getDescription,
|
|
40
|
-
getTitle,
|
|
41
|
-
record
|
|
42
|
-
} = (0, _useEditedEntityRecord.default)(postType, postId);
|
|
43
|
-
const currentTheme = (0, _data.useSelect)(select => select(_coreData.store).getCurrentTheme(), []);
|
|
44
|
-
const addedBy = (0, _hooks.useAddedBy)(postType, postId);
|
|
45
|
-
const isAddedByActiveTheme = addedBy.type === 'theme' && record.theme === currentTheme?.stylesheet;
|
|
46
|
-
const title = getTitle();
|
|
47
|
-
let descriptionText = getDescription();
|
|
48
|
-
if (!descriptionText && addedBy.text) {
|
|
49
|
-
descriptionText = (0, _i18n.__)('This is a custom template that can be applied manually to any Post or Page.');
|
|
50
|
-
}
|
|
51
|
-
const content = record?.slug === 'home' || record?.slug === 'index' ? (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_homeTemplateDetails.default, null), (0, _react.createElement)(_templateAreas.default, null)) : (0, _react.createElement)(_templateAreas.default, null);
|
|
52
|
-
const footer = record?.modified ? (0, _react.createElement)(_sidebarNavigationScreenDetailsFooter.default, {
|
|
53
|
-
record: record
|
|
54
|
-
}) : null;
|
|
55
|
-
const description = (0, _react.createElement)(_react.Fragment, null, descriptionText, addedBy.text && !isAddedByActiveTheme && (0, _react.createElement)("span", {
|
|
56
|
-
className: "edit-site-sidebar-navigation-screen-template__added-by-description"
|
|
57
|
-
}, (0, _react.createElement)("span", {
|
|
58
|
-
className: "edit-site-sidebar-navigation-screen-template__added-by-description-author"
|
|
59
|
-
}, (0, _react.createElement)("span", {
|
|
60
|
-
className: "edit-site-sidebar-navigation-screen-template__added-by-description-author-icon"
|
|
61
|
-
}, addedBy.imageUrl ? (0, _react.createElement)("img", {
|
|
62
|
-
src: addedBy.imageUrl,
|
|
63
|
-
alt: "",
|
|
64
|
-
width: "24",
|
|
65
|
-
height: "24"
|
|
66
|
-
}) : (0, _react.createElement)(_components.Icon, {
|
|
67
|
-
icon: addedBy.icon
|
|
68
|
-
})), addedBy.text), addedBy.isCustomized && (0, _react.createElement)("span", {
|
|
69
|
-
className: "edit-site-sidebar-navigation-screen-template__added-by-description-customized"
|
|
70
|
-
}, (0, _i18n._x)('(Customized)', 'template'))));
|
|
71
|
-
return {
|
|
72
|
-
title,
|
|
73
|
-
description,
|
|
74
|
-
content,
|
|
75
|
-
footer
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
function SidebarNavigationScreenTemplate() {
|
|
79
|
-
const history = useHistory();
|
|
80
|
-
const {
|
|
81
|
-
params: {
|
|
82
|
-
postType,
|
|
83
|
-
postId
|
|
84
|
-
}
|
|
85
|
-
} = useLocation();
|
|
86
|
-
const {
|
|
87
|
-
setCanvasMode
|
|
88
|
-
} = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_store.store));
|
|
89
|
-
const {
|
|
90
|
-
title,
|
|
91
|
-
content,
|
|
92
|
-
description,
|
|
93
|
-
footer
|
|
94
|
-
} = useTemplateDetails(postType, postId);
|
|
95
|
-
return (0, _react.createElement)(_sidebarNavigationScreen.default, {
|
|
96
|
-
title: title,
|
|
97
|
-
actions: (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_templateActions.default, {
|
|
98
|
-
postType: postType,
|
|
99
|
-
postId: postId,
|
|
100
|
-
toggleProps: {
|
|
101
|
-
as: _sidebarButton.default
|
|
102
|
-
},
|
|
103
|
-
onRemove: () => {
|
|
104
|
-
history.push({
|
|
105
|
-
path: '/' + postType
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
}), (0, _react.createElement)(_sidebarButton.default, {
|
|
109
|
-
onClick: () => setCanvasMode('edit'),
|
|
110
|
-
label: (0, _i18n.__)('Edit'),
|
|
111
|
-
icon: _icons.pencil
|
|
112
|
-
})),
|
|
113
|
-
description: description,
|
|
114
|
-
content: content,
|
|
115
|
-
footer: footer
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_data","_icons","_components","_coreData","_router","_templateAreas","_interopRequireDefault","_sidebarNavigationScreen","_useEditedEntityRecord","_lockUnlock","_store","_sidebarButton","_hooks","_templateActions","_homeTemplateDetails","_sidebarNavigationScreenDetailsFooter","useHistory","useLocation","unlock","routerPrivateApis","useTemplateDetails","postType","postId","getDescription","getTitle","record","useEditedEntityRecord","currentTheme","useSelect","select","coreStore","getCurrentTheme","addedBy","useAddedBy","isAddedByActiveTheme","type","theme","stylesheet","title","descriptionText","text","__","content","slug","_react","createElement","Fragment","default","footer","modified","description","className","imageUrl","src","alt","width","height","Icon","icon","isCustomized","_x","SidebarNavigationScreenTemplate","history","params","setCanvasMode","useDispatch","editSiteStore","actions","toggleProps","as","SidebarButton","onRemove","push","path","onClick","label","pencil"],"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 { Icon } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\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/hooks';\nimport TemplateActions from '../template-actions';\nimport HomeTemplateDetails from './home-template-details';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\n\nconst { useHistory, useLocation } = unlock( routerPrivateApis );\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 history = useHistory();\n\tconst {\n\t\tparams: { postType, postId },\n\t} = useLocation();\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\thistory.push( { path: '/' + postType } );\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":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;A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,CAAC,EACF,IAAAuB,MAAA,CAAAC,aAAA,EAAClC,cAAA,CAAAoC,OAAa;MACb2B,OAAO,EAAGA,CAAA,KAAMV,aAAa,CAAE,MAAO,CAAG;MACzCW,KAAK,EAAG,IAAAlC,QAAE,EAAE,MAAO,CAAG;MACtBiB,IAAI,EAAGkB;IAAQ,CACf,CACA,CACF;IACD1B,WAAW,EAAGA,WAAa;IAC3BR,OAAO,EAAGA,OAAS;IACnBM,MAAM,EAAGA;EAAQ,CACjB,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = TemplateAreas;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _i18n = require("@wordpress/i18n");
|
|
10
|
-
var _data = require("@wordpress/data");
|
|
11
|
-
var _components = require("@wordpress/components");
|
|
12
|
-
var _editor = require("@wordpress/editor");
|
|
13
|
-
var _element = require("@wordpress/element");
|
|
14
|
-
var _htmlEntities = require("@wordpress/html-entities");
|
|
15
|
-
var _sidebarNavigationScreenDetailsPanel = require("../sidebar-navigation-screen-details-panel");
|
|
16
|
-
var _lockUnlock = require("../../lock-unlock");
|
|
17
|
-
var _store = require("../../store");
|
|
18
|
-
var _link = require("../routes/link");
|
|
19
|
-
var _sidebarNavigationItem = _interopRequireDefault(require("../sidebar-navigation-item"));
|
|
20
|
-
var _constants = require("../../utils/constants");
|
|
21
|
-
/**
|
|
22
|
-
* WordPress dependencies
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Internal dependencies
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
function TemplateAreaButton({
|
|
30
|
-
postId,
|
|
31
|
-
area,
|
|
32
|
-
title
|
|
33
|
-
}) {
|
|
34
|
-
const templatePartArea = (0, _data.useSelect)(select => {
|
|
35
|
-
const defaultAreas = select(_editor.store).__experimentalGetDefaultTemplatePartAreas();
|
|
36
|
-
return defaultAreas.find(defaultArea => defaultArea.area === area);
|
|
37
|
-
}, [area]);
|
|
38
|
-
const linkInfo = (0, _link.useLink)({
|
|
39
|
-
postType: _constants.TEMPLATE_PART_POST_TYPE,
|
|
40
|
-
postId
|
|
41
|
-
});
|
|
42
|
-
return (0, _react.createElement)(_sidebarNavigationItem.default, {
|
|
43
|
-
className: "edit-site-sidebar-navigation-screen-template__template-area-button",
|
|
44
|
-
...linkInfo,
|
|
45
|
-
icon: templatePartArea?.icon,
|
|
46
|
-
withChevron: true
|
|
47
|
-
}, (0, _react.createElement)(_components.__experimentalTruncate, {
|
|
48
|
-
limit: 20,
|
|
49
|
-
ellipsizeMode: "tail",
|
|
50
|
-
numberOfLines: 1,
|
|
51
|
-
className: "edit-site-sidebar-navigation-screen-template__template-area-label-text"
|
|
52
|
-
}, (0, _htmlEntities.decodeEntities)(title)));
|
|
53
|
-
}
|
|
54
|
-
function TemplateAreas() {
|
|
55
|
-
const {
|
|
56
|
-
templatePartAreas,
|
|
57
|
-
currentTemplateParts
|
|
58
|
-
} = (0, _data.useSelect)(select => {
|
|
59
|
-
const {
|
|
60
|
-
getSettings,
|
|
61
|
-
getCurrentTemplateTemplateParts
|
|
62
|
-
} = (0, _lockUnlock.unlock)(select(_store.store));
|
|
63
|
-
return {
|
|
64
|
-
templatePartAreas: getSettings()?.defaultTemplatePartAreas,
|
|
65
|
-
currentTemplateParts: getCurrentTemplateTemplateParts()
|
|
66
|
-
};
|
|
67
|
-
}, []);
|
|
68
|
-
|
|
69
|
-
/*
|
|
70
|
-
* Merge data in currentTemplateParts with templatePartAreas,
|
|
71
|
-
* which contains the template icon and fallback labels
|
|
72
|
-
*/
|
|
73
|
-
const templateAreas = (0, _element.useMemo)(() => {
|
|
74
|
-
// Keep track of template part IDs that have already been added to the array.
|
|
75
|
-
const templatePartIds = new Set();
|
|
76
|
-
const filterOutDuplicateTemplateParts = currentTemplatePart => {
|
|
77
|
-
// If the template part has already been added to the array, skip it.
|
|
78
|
-
if (templatePartIds.has(currentTemplatePart.templatePart.id)) {
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
// Add to the array of template part IDs.
|
|
82
|
-
templatePartIds.add(currentTemplatePart.templatePart.id);
|
|
83
|
-
return currentTemplatePart;
|
|
84
|
-
};
|
|
85
|
-
return currentTemplateParts.length && templatePartAreas ? currentTemplateParts.filter(filterOutDuplicateTemplateParts).map(({
|
|
86
|
-
templatePart,
|
|
87
|
-
block
|
|
88
|
-
}) => ({
|
|
89
|
-
...templatePartAreas?.find(({
|
|
90
|
-
area
|
|
91
|
-
}) => area === templatePart?.area),
|
|
92
|
-
...templatePart,
|
|
93
|
-
clientId: block.clientId
|
|
94
|
-
})) : [];
|
|
95
|
-
}, [currentTemplateParts, templatePartAreas]);
|
|
96
|
-
if (!templateAreas.length) {
|
|
97
|
-
return null;
|
|
98
|
-
}
|
|
99
|
-
return (0, _react.createElement)(_sidebarNavigationScreenDetailsPanel.SidebarNavigationScreenDetailsPanel, {
|
|
100
|
-
title: (0, _i18n.__)('Areas'),
|
|
101
|
-
spacing: 3
|
|
102
|
-
}, (0, _react.createElement)(_components.__experimentalItemGroup, null, templateAreas.map(({
|
|
103
|
-
clientId,
|
|
104
|
-
label,
|
|
105
|
-
area,
|
|
106
|
-
theme,
|
|
107
|
-
slug,
|
|
108
|
-
title
|
|
109
|
-
}) => (0, _react.createElement)(_sidebarNavigationScreenDetailsPanel.SidebarNavigationScreenDetailsPanelRow, {
|
|
110
|
-
key: clientId
|
|
111
|
-
}, (0, _react.createElement)(TemplateAreaButton, {
|
|
112
|
-
postId: `${theme}//${slug}`,
|
|
113
|
-
title: title?.rendered || label,
|
|
114
|
-
area: area
|
|
115
|
-
})))));
|
|
116
|
-
}
|
|
117
|
-
//# sourceMappingURL=template-areas.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_i18n","require","_data","_components","_editor","_element","_htmlEntities","_sidebarNavigationScreenDetailsPanel","_lockUnlock","_store","_link","_sidebarNavigationItem","_interopRequireDefault","_constants","TemplateAreaButton","postId","area","title","templatePartArea","useSelect","select","defaultAreas","editorStore","__experimentalGetDefaultTemplatePartAreas","find","defaultArea","linkInfo","useLink","postType","TEMPLATE_PART_POST_TYPE","_react","createElement","default","className","icon","withChevron","__experimentalTruncate","limit","ellipsizeMode","numberOfLines","decodeEntities","TemplateAreas","templatePartAreas","currentTemplateParts","getSettings","getCurrentTemplateTemplateParts","unlock","editSiteStore","defaultTemplatePartAreas","templateAreas","useMemo","templatePartIds","Set","filterOutDuplicateTemplateParts","currentTemplatePart","has","templatePart","id","add","length","filter","map","block","clientId","SidebarNavigationScreenDetailsPanel","__","spacing","__experimentalItemGroup","label","theme","slug","SidebarNavigationScreenDetailsPanelRow","key","rendered"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-template/template-areas.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport {\n\t__experimentalTruncate as Truncate,\n\t__experimentalItemGroup as ItemGroup,\n} from '@wordpress/components';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useMemo } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport {\n\tSidebarNavigationScreenDetailsPanel,\n\tSidebarNavigationScreenDetailsPanelRow,\n} from '../sidebar-navigation-screen-details-panel';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport { useLink } from '../routes/link';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { TEMPLATE_PART_POST_TYPE } from '../../utils/constants';\n\nfunction TemplateAreaButton( { postId, area, title } ) {\n\tconst templatePartArea = useSelect(\n\t\t( select ) => {\n\t\t\tconst defaultAreas =\n\t\t\t\tselect(\n\t\t\t\t\teditorStore\n\t\t\t\t).__experimentalGetDefaultTemplatePartAreas();\n\n\t\t\treturn defaultAreas.find(\n\t\t\t\t( defaultArea ) => defaultArea.area === area\n\t\t\t);\n\t\t},\n\t\t[ area ]\n\t);\n\tconst linkInfo = useLink( {\n\t\tpostType: TEMPLATE_PART_POST_TYPE,\n\t\tpostId,\n\t} );\n\n\treturn (\n\t\t<SidebarNavigationItem\n\t\t\tclassName=\"edit-site-sidebar-navigation-screen-template__template-area-button\"\n\t\t\t{ ...linkInfo }\n\t\t\ticon={ templatePartArea?.icon }\n\t\t\twithChevron\n\t\t>\n\t\t\t<Truncate\n\t\t\t\tlimit={ 20 }\n\t\t\t\tellipsizeMode=\"tail\"\n\t\t\t\tnumberOfLines={ 1 }\n\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-template__template-area-label-text\"\n\t\t\t>\n\t\t\t\t{ decodeEntities( title ) }\n\t\t\t</Truncate>\n\t\t</SidebarNavigationItem>\n\t);\n}\n\nexport default function TemplateAreas() {\n\tconst { templatePartAreas, currentTemplateParts } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getSettings, getCurrentTemplateTemplateParts } = unlock(\n\t\t\t\tselect( editSiteStore )\n\t\t\t);\n\t\t\treturn {\n\t\t\t\ttemplatePartAreas: getSettings()?.defaultTemplatePartAreas,\n\t\t\t\tcurrentTemplateParts: getCurrentTemplateTemplateParts(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\t/*\n\t * Merge data in currentTemplateParts with templatePartAreas,\n\t * which contains the template icon and fallback labels\n\t */\n\tconst templateAreas = useMemo( () => {\n\t\t// Keep track of template part IDs that have already been added to the array.\n\t\tconst templatePartIds = new Set();\n\t\tconst filterOutDuplicateTemplateParts = ( currentTemplatePart ) => {\n\t\t\t// If the template part has already been added to the array, skip it.\n\t\t\tif ( templatePartIds.has( currentTemplatePart.templatePart.id ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Add to the array of template part IDs.\n\t\t\ttemplatePartIds.add( currentTemplatePart.templatePart.id );\n\t\t\treturn currentTemplatePart;\n\t\t};\n\n\t\treturn currentTemplateParts.length && templatePartAreas\n\t\t\t? currentTemplateParts\n\t\t\t\t\t.filter( filterOutDuplicateTemplateParts )\n\t\t\t\t\t.map( ( { templatePart, block } ) => ( {\n\t\t\t\t\t\t...templatePartAreas?.find(\n\t\t\t\t\t\t\t( { area } ) => area === templatePart?.area\n\t\t\t\t\t\t),\n\t\t\t\t\t\t...templatePart,\n\t\t\t\t\t\tclientId: block.clientId,\n\t\t\t\t\t} ) )\n\t\t\t: [];\n\t}, [ currentTemplateParts, templatePartAreas ] );\n\n\tif ( ! templateAreas.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<SidebarNavigationScreenDetailsPanel\n\t\t\ttitle={ __( 'Areas' ) }\n\t\t\tspacing={ 3 }\n\t\t>\n\t\t\t<ItemGroup>\n\t\t\t\t{ templateAreas.map(\n\t\t\t\t\t( { clientId, label, area, theme, slug, title } ) => (\n\t\t\t\t\t\t<SidebarNavigationScreenDetailsPanelRow\n\t\t\t\t\t\t\tkey={ clientId }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<TemplateAreaButton\n\t\t\t\t\t\t\t\tpostId={ `${ theme }//${ slug }` }\n\t\t\t\t\t\t\t\ttitle={ title?.rendered || label }\n\t\t\t\t\t\t\t\tarea={ area }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t\t\t)\n\t\t\t\t) }\n\t\t\t</ItemGroup>\n\t\t</SidebarNavigationScreenDetailsPanel>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAIA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OA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AG;IACvBC,OAAO,EAAG;EAAG,GAEb,IAAApC,MAAA,CAAAC,aAAA,EAAC5B,WAAA,CAAAgE,uBAAS,QACPlB,aAAa,CAACY,GAAG,CAClB,CAAE;IAAEE,QAAQ;IAAEK,KAAK;IAAEpD,IAAI;IAAEqD,KAAK;IAAEC,IAAI;IAAErD;EAAM,CAAC,KAC9C,IAAAa,MAAA,CAAAC,aAAA,EAACxB,oCAAA,CAAAgE,sCAAsC;IACtCC,GAAG,EAAGT;EAAU,GAEhB,IAAAjC,MAAA,CAAAC,aAAA,EAACjB,kBAAkB;IAClBC,MAAM,EAAI,GAAGsD,KAAO,KAAKC,IAAM,EAAG;IAClCrD,KAAK,EAAGA,KAAK,EAAEwD,QAAQ,IAAIL,KAAO;IAClCpD,IAAI,EAAGA;EAAM,CACb,CACsC,CAE1C,CACU,CACyB,CAAC;AAExC","ignoreList":[]}
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = StartTemplateOptions;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _components = require("@wordpress/components");
|
|
9
|
-
var _i18n = require("@wordpress/i18n");
|
|
10
|
-
var _element = require("@wordpress/element");
|
|
11
|
-
var _blockEditor = require("@wordpress/block-editor");
|
|
12
|
-
var _data = require("@wordpress/data");
|
|
13
|
-
var _compose = require("@wordpress/compose");
|
|
14
|
-
var _preferences = require("@wordpress/preferences");
|
|
15
|
-
var _blocks = require("@wordpress/blocks");
|
|
16
|
-
var _coreData = require("@wordpress/core-data");
|
|
17
|
-
var _store = require("../../store");
|
|
18
|
-
var _constants = require("../../utils/constants");
|
|
19
|
-
/**
|
|
20
|
-
* WordPress dependencies
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Internal dependencies
|
|
25
|
-
*/
|
|
26
|
-
|
|
27
|
-
function useFallbackTemplateContent(slug, isCustom = false) {
|
|
28
|
-
return (0, _data.useSelect)(select => {
|
|
29
|
-
const {
|
|
30
|
-
getEntityRecord,
|
|
31
|
-
getDefaultTemplateId
|
|
32
|
-
} = select(_coreData.store);
|
|
33
|
-
const templateId = getDefaultTemplateId({
|
|
34
|
-
slug,
|
|
35
|
-
is_custom: isCustom,
|
|
36
|
-
ignore_empty: true
|
|
37
|
-
});
|
|
38
|
-
return templateId ? getEntityRecord('postType', _constants.TEMPLATE_POST_TYPE, templateId)?.content?.raw : undefined;
|
|
39
|
-
}, [slug, isCustom]);
|
|
40
|
-
}
|
|
41
|
-
function useStartPatterns(fallbackContent) {
|
|
42
|
-
const {
|
|
43
|
-
slug,
|
|
44
|
-
patterns
|
|
45
|
-
} = (0, _data.useSelect)(select => {
|
|
46
|
-
const {
|
|
47
|
-
getEditedPostType,
|
|
48
|
-
getEditedPostId
|
|
49
|
-
} = select(_store.store);
|
|
50
|
-
const {
|
|
51
|
-
getEntityRecord,
|
|
52
|
-
getBlockPatterns
|
|
53
|
-
} = select(_coreData.store);
|
|
54
|
-
const postId = getEditedPostId();
|
|
55
|
-
const postType = getEditedPostType();
|
|
56
|
-
const record = getEntityRecord('postType', postType, postId);
|
|
57
|
-
return {
|
|
58
|
-
slug: record.slug,
|
|
59
|
-
patterns: getBlockPatterns()
|
|
60
|
-
};
|
|
61
|
-
}, []);
|
|
62
|
-
const currentThemeStylesheet = (0, _data.useSelect)(select => select(_coreData.store).getCurrentTheme().stylesheet);
|
|
63
|
-
|
|
64
|
-
// Duplicated from packages/block-library/src/pattern/edit.js.
|
|
65
|
-
function injectThemeAttributeInBlockTemplateContent(block) {
|
|
66
|
-
if (block.innerBlocks.find(innerBlock => innerBlock.name === 'core/template-part')) {
|
|
67
|
-
block.innerBlocks = block.innerBlocks.map(innerBlock => {
|
|
68
|
-
if (innerBlock.name === 'core/template-part' && innerBlock.attributes.theme === undefined) {
|
|
69
|
-
innerBlock.attributes.theme = currentThemeStylesheet;
|
|
70
|
-
}
|
|
71
|
-
return innerBlock;
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
if (block.name === 'core/template-part' && block.attributes.theme === undefined) {
|
|
75
|
-
block.attributes.theme = currentThemeStylesheet;
|
|
76
|
-
}
|
|
77
|
-
return block;
|
|
78
|
-
}
|
|
79
|
-
return (0, _element.useMemo)(() => {
|
|
80
|
-
// filter patterns that are supposed to be used in the current template being edited.
|
|
81
|
-
return [{
|
|
82
|
-
name: 'fallback',
|
|
83
|
-
blocks: (0, _blocks.parse)(fallbackContent),
|
|
84
|
-
title: (0, _i18n.__)('Fallback content')
|
|
85
|
-
}, ...patterns.filter(pattern => {
|
|
86
|
-
return Array.isArray(pattern.templateTypes) && pattern.templateTypes.some(templateType => slug.startsWith(templateType));
|
|
87
|
-
}).map(pattern => {
|
|
88
|
-
return {
|
|
89
|
-
...pattern,
|
|
90
|
-
blocks: (0, _blocks.parse)(pattern.content).map(block => injectThemeAttributeInBlockTemplateContent(block))
|
|
91
|
-
};
|
|
92
|
-
})];
|
|
93
|
-
}, [fallbackContent, slug, patterns]);
|
|
94
|
-
}
|
|
95
|
-
function PatternSelection({
|
|
96
|
-
fallbackContent,
|
|
97
|
-
onChoosePattern,
|
|
98
|
-
postType
|
|
99
|
-
}) {
|
|
100
|
-
const [,, onChange] = (0, _coreData.useEntityBlockEditor)('postType', postType);
|
|
101
|
-
const blockPatterns = useStartPatterns(fallbackContent);
|
|
102
|
-
const shownBlockPatterns = (0, _compose.useAsyncList)(blockPatterns);
|
|
103
|
-
return (0, _react.createElement)(_blockEditor.__experimentalBlockPatternsList, {
|
|
104
|
-
blockPatterns: blockPatterns,
|
|
105
|
-
shownPatterns: shownBlockPatterns,
|
|
106
|
-
onClickPattern: (pattern, blocks) => {
|
|
107
|
-
onChange(blocks, {
|
|
108
|
-
selection: undefined
|
|
109
|
-
});
|
|
110
|
-
onChoosePattern();
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
function StartModal({
|
|
115
|
-
slug,
|
|
116
|
-
isCustom,
|
|
117
|
-
onClose,
|
|
118
|
-
postType
|
|
119
|
-
}) {
|
|
120
|
-
const fallbackContent = useFallbackTemplateContent(slug, isCustom);
|
|
121
|
-
if (!fallbackContent) {
|
|
122
|
-
return null;
|
|
123
|
-
}
|
|
124
|
-
return (0, _react.createElement)(_components.Modal, {
|
|
125
|
-
className: "edit-site-start-template-options__modal",
|
|
126
|
-
title: (0, _i18n.__)('Choose a pattern'),
|
|
127
|
-
closeLabel: (0, _i18n.__)('Cancel'),
|
|
128
|
-
focusOnMount: "firstElement",
|
|
129
|
-
onRequestClose: onClose,
|
|
130
|
-
isFullScreen: true
|
|
131
|
-
}, (0, _react.createElement)("div", {
|
|
132
|
-
className: "edit-site-start-template-options__modal-content"
|
|
133
|
-
}, (0, _react.createElement)(PatternSelection, {
|
|
134
|
-
fallbackContent: fallbackContent,
|
|
135
|
-
slug: slug,
|
|
136
|
-
isCustom: isCustom,
|
|
137
|
-
postType: postType,
|
|
138
|
-
onChoosePattern: () => {
|
|
139
|
-
onClose();
|
|
140
|
-
}
|
|
141
|
-
})), (0, _react.createElement)(_components.Flex, {
|
|
142
|
-
className: "edit-site-start-template-options__modal__actions",
|
|
143
|
-
justify: "flex-end",
|
|
144
|
-
expanded: false
|
|
145
|
-
}, (0, _react.createElement)(_components.FlexItem, null, (0, _react.createElement)(_components.Button, {
|
|
146
|
-
variant: "tertiary",
|
|
147
|
-
onClick: onClose
|
|
148
|
-
}, (0, _i18n.__)('Skip')))));
|
|
149
|
-
}
|
|
150
|
-
const START_TEMPLATE_MODAL_STATES = {
|
|
151
|
-
INITIAL: 'INITIAL',
|
|
152
|
-
CLOSED: 'CLOSED'
|
|
153
|
-
};
|
|
154
|
-
function StartTemplateOptions() {
|
|
155
|
-
const [modalState, setModalState] = (0, _element.useState)(START_TEMPLATE_MODAL_STATES.INITIAL);
|
|
156
|
-
const {
|
|
157
|
-
shouldOpenModal,
|
|
158
|
-
slug,
|
|
159
|
-
isCustom,
|
|
160
|
-
postType
|
|
161
|
-
} = (0, _data.useSelect)(select => {
|
|
162
|
-
const {
|
|
163
|
-
getEditedPostType,
|
|
164
|
-
getEditedPostId
|
|
165
|
-
} = select(_store.store);
|
|
166
|
-
const _postType = getEditedPostType();
|
|
167
|
-
const postId = getEditedPostId();
|
|
168
|
-
const {
|
|
169
|
-
getEditedEntityRecord,
|
|
170
|
-
hasEditsForEntityRecord
|
|
171
|
-
} = select(_coreData.store);
|
|
172
|
-
const templateRecord = getEditedEntityRecord('postType', _postType, postId);
|
|
173
|
-
const hasEdits = hasEditsForEntityRecord('postType', _postType, postId);
|
|
174
|
-
return {
|
|
175
|
-
shouldOpenModal: !hasEdits && '' === templateRecord.content && _constants.TEMPLATE_POST_TYPE === _postType && !select(_preferences.store).get('core/edit-site', 'welcomeGuide'),
|
|
176
|
-
slug: templateRecord.slug,
|
|
177
|
-
isCustom: templateRecord.is_custom,
|
|
178
|
-
postType: _postType
|
|
179
|
-
};
|
|
180
|
-
}, []);
|
|
181
|
-
if (modalState === START_TEMPLATE_MODAL_STATES.INITIAL && !shouldOpenModal || modalState === START_TEMPLATE_MODAL_STATES.CLOSED) {
|
|
182
|
-
return null;
|
|
183
|
-
}
|
|
184
|
-
return (0, _react.createElement)(StartModal, {
|
|
185
|
-
slug: slug,
|
|
186
|
-
isCustom: isCustom,
|
|
187
|
-
postType: postType,
|
|
188
|
-
onClose: () => setModalState(START_TEMPLATE_MODAL_STATES.CLOSED)
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
//# sourceMappingURL=index.js.map
|