@wordpress/edit-site 5.35.0 → 6.0.1
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 +7 -0
- 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 +87 -71
- 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 +10 -4
- 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/inserter-media-categories.js +1 -1
- package/build/components/block-editor/inserter-media-categories.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 +7 -4
- package/build/components/dataviews-actions/index.js.map +1 -1
- package/build/components/editor/index.js +86 -182
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor/use-editor-title.js +39 -0
- package/build/components/editor/use-editor-title.js.map +1 -0
- 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 +6 -5
- 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 +2 -2
- package/build/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +30 -29
- 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 -37
- 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 -23
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/icon-with-current-color.js +2 -2
- package/build/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build/components/global-styles/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 +3 -4
- package/build/components/global-styles/preset-colors.js.map +1 -1
- package/build/components/global-styles/preview-colors.js +22 -20
- 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 -14
- 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 +81 -70
- 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 +11 -8
- 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 -92
- 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 +27 -22
- package/build/components/global-styles/variations/variation.js.map +1 -1
- package/build/components/global-styles/variations/variations-color.js +18 -13
- 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 +22 -18
- package/build/components/global-styles-sidebar/default-sidebar.js.map +1 -1
- package/build/components/global-styles-sidebar/index.js +36 -26
- package/build/components/global-styles-sidebar/index.js.map +1 -1
- package/build/components/layout/index.js +92 -118
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/router.js +83 -103
- 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 +12 -10
- package/build/components/page/index.js.map +1 -1
- package/build/components/page-pages/index.js +133 -52
- 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 +116 -110
- 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 +78 -59
- package/build/components/page-templates/index.js.map +1 -1
- package/build/components/pagination/index.js +59 -41
- 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 +38 -32
- package/build/components/resizable-frame/index.js.map +1 -1
- package/build/components/revisions/index.js +26 -20
- 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 +34 -28
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar/index.js +14 -11
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-button/index.js +2 -2
- package/build/components/sidebar-button/index.js.map +1 -1
- package/build/components/sidebar-dataviews/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 +18 -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 +27 -25
- package/build/components/sidebar-navigation-item/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen/index.js +51 -39
- 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 +5 -5
- 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 +54 -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 +11 -10
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/more-menu.js +53 -42
- 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 +43 -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 +16 -13
- 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 +27 -23
- 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 +50 -35
- 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 +59 -64
- 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 +4 -4
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/site-hub/index.js +52 -133
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/site-icon/index.js +8 -7
- package/build/components/site-icon/index.js.map +1 -1
- package/build/components/style-book/index.js +115 -99
- 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 +12 -10
- 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 +26 -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 +2 -1
- 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 +34 -13
- 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 +4 -5
- 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 +89 -71
- 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 +11 -4
- 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/inserter-media-categories.js +1 -1
- package/build-module/components/block-editor/inserter-media-categories.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 +7 -4
- package/build-module/components/dataviews-actions/index.js.map +1 -1
- package/build-module/components/editor/index.js +91 -185
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor/use-editor-title.js +31 -0
- package/build-module/components/editor/use-editor-title.js.map +1 -0
- 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 +6 -5
- 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 +2 -2
- package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +31 -29
- 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 -37
- 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 -23
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/icon-with-current-color.js +2 -2
- package/build-module/components/global-styles/icon-with-current-color.js.map +1 -1
- package/build-module/components/global-styles/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 +3 -4
- package/build-module/components/global-styles/preset-colors.js.map +1 -1
- package/build-module/components/global-styles/preview-colors.js +22 -20
- 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 -14
- 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 +82 -70
- 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 +12 -8
- 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 -92
- 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 +27 -22
- package/build-module/components/global-styles/variations/variation.js.map +1 -1
- package/build-module/components/global-styles/variations/variations-color.js +20 -14
- 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 +24 -18
- package/build-module/components/global-styles-sidebar/default-sidebar.js.map +1 -1
- package/build-module/components/global-styles-sidebar/index.js +37 -26
- package/build-module/components/global-styles-sidebar/index.js.map +1 -1
- package/build-module/components/layout/index.js +97 -121
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/router.js +83 -103
- 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 +14 -11
- package/build-module/components/page/index.js.map +1 -1
- package/build-module/components/page-pages/index.js +138 -55
- 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 +117 -110
- 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 +80 -59
- package/build-module/components/page-templates/index.js.map +1 -1
- package/build-module/components/pagination/index.js +60 -41
- 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 +40 -32
- package/build-module/components/resizable-frame/index.js.map +1 -1
- package/build-module/components/revisions/index.js +27 -20
- 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 +35 -28
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +14 -11
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-button/index.js +2 -2
- package/build-module/components/sidebar-button/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/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 +19 -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 +28 -25
- package/build-module/components/sidebar-navigation-item/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen/index.js +53 -39
- 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 +5 -5
- 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 +56 -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 +11 -10
- 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 +55 -42
- 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 +44 -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 +17 -13
- 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 +27 -23
- 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 +52 -35
- 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 +61 -64
- 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 +4 -4
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +56 -136
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/site-icon/index.js +8 -7
- package/build-module/components/site-icon/index.js.map +1 -1
- package/build-module/components/style-book/index.js +116 -99
- 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 +12 -10
- 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 +28 -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 +2 -1
- 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 +34 -13
- 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 +4 -5
- package/build-module/utils/use-activate-theme.js.map +1 -1
- package/build-style/style-rtl.css +327 -634
- package/build-style/style.css +327 -634
- package/package.json +43 -44
- package/src/components/add-new-pattern/index.js +46 -37
- package/src/components/add-new-template/index.js +2 -0
- package/src/components/add-new-template/utils.js +77 -39
- package/src/components/block-editor/inserter-media-categories.js +1 -3
- package/src/components/block-editor/style.scss +12 -136
- 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 +7 -2
- package/src/components/editor/index.js +116 -290
- package/src/components/editor/style.scss +1 -16
- package/src/components/editor/use-editor-title.js +35 -0
- 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 +3 -2
- package/src/components/global-styles/color-palette-panel.js +1 -1
- 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/hooks.js +10 -37
- package/src/components/global-styles/palette.js +9 -18
- 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-css.js +1 -1
- 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 +1 -1
- package/src/components/global-styles/screen-revisions/style.scss +4 -8
- 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/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/ui.js +10 -6
- package/src/components/global-styles/utils.js +27 -0
- package/src/components/global-styles/variations/style.scss +7 -4
- package/src/components/global-styles/variations/variation.js +2 -0
- package/src/components/global-styles/variations/variations-color.js +8 -4
- 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/global-styles-sidebar/index.js +2 -0
- package/src/components/layout/index.js +24 -69
- package/src/components/layout/router.js +64 -79
- package/src/components/layout/style.scss +29 -66
- 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 +1 -5
- package/src/components/page/style.scss +21 -7
- package/src/components/page-pages/index.js +154 -30
- package/src/components/page-pages/style.scss +15 -0
- 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 +29 -63
- package/src/components/page-patterns/style.scss +21 -14
- package/src/components/page-patterns/use-patterns.js +13 -6
- package/src/components/pagination/index.js +21 -16
- package/src/components/resizable-frame/index.js +1 -1
- package/src/components/save-panel/index.js +2 -4
- 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 +8 -4
- 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 +7 -7
- package/src/components/sidebar-navigation-screen/index.js +1 -1
- package/src/components/sidebar-navigation-screen/style.scss +2 -2
- package/src/components/sidebar-navigation-screen-global-styles/index.js +8 -2
- package/src/components/sidebar-navigation-screen-main/index.js +14 -4
- package/src/components/sidebar-navigation-screen-navigation-menu/rename-modal.js +1 -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 +1 -1
- package/src/components/sidebar-navigation-screen-navigation-menus/leaf-more-menu.js +6 -3
- package/src/components/sidebar-navigation-screen-navigation-menus/style.scss +0 -61
- package/src/components/sidebar-navigation-screen-patterns/category-item.js +15 -4
- package/src/components/sidebar-navigation-screen-patterns/index.js +11 -17
- package/src/components/sidebar-navigation-screen-templates-browse/content.js +1 -1
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +1 -1
- package/src/components/site-hub/index.js +56 -148
- package/src/components/site-hub/style.scss +47 -13
- package/src/components/site-icon/style.scss +0 -4
- package/src/components/style-book/index.js +1 -1
- 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/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 +3 -1
- package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +5 -1
- package/src/index.js +1 -1
- package/src/store/private-actions.js +59 -23
- package/src/store/selectors.js +2 -2
- package/src/style.scss +0 -6
- package/src/utils/template-part-create.js +0 -67
- package/src/utils/use-activate-theme.js +2 -2
- package/build/components/block-editor/editor-canvas.js +0 -139
- 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/header-edit-mode/index.js +0 -50
- 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 -311
- 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-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 -67
- 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 -121
- 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/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-module/components/block-editor/editor-canvas.js +0 -131
- 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/header-edit-mode/index.js +0 -42
- 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 -304
- 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-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 -59
- 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 -113
- 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/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/src/components/block-editor/editor-canvas.js +0 -158
- 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/header-edit-mode/index.js +0 -51
- package/src/components/header-edit-mode/style.scss +0 -3
- package/src/components/page-patterns/dataviews-pattern-actions.js +0 -350
- 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-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 -57
- 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 -134
- 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/template-actions/index.js +0 -165
- package/src/hooks/components.js +0 -11
- package/src/utils/get-is-list-page.js +0 -23
- package/src/utils/test/template-part-create.js +0 -63
- /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":["clsx","__","sprintf","dateI18n","getDate","humanTimeDiff","createInterpolateElement","StatusLabel","status","date","short","relateToNow","statusLabel","time","createElement","dateTime","formattedDate","className"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-page/status-label.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { dateI18n, getDate, humanTimeDiff } from '@wordpress/date';\nimport { createInterpolateElement } from '@wordpress/element';\n\nexport default function StatusLabel( { status, date, short } ) {\n\tconst relateToNow = humanTimeDiff( date );\n\tlet statusLabel = status;\n\tswitch ( status ) {\n\t\tcase 'publish':\n\t\t\tstatusLabel = date\n\t\t\t\t? createInterpolateElement(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %s: is the relative time when the post was published. */\n\t\t\t\t\t\t\t__( 'Published <time>%s</time>' ),\n\t\t\t\t\t\t\trelateToNow\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ time: <time dateTime={ date } /> }\n\t\t\t\t )\n\t\t\t\t: __( 'Published' );\n\t\t\tbreak;\n\t\tcase 'future':\n\t\t\tconst formattedDate = dateI18n(\n\t\t\t\tshort ? 'M j' : 'F j',\n\t\t\t\tgetDate( date )\n\t\t\t);\n\t\t\tstatusLabel = date\n\t\t\t\t? createInterpolateElement(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %s: is the formatted date and time on which the post is scheduled to be published. */\n\t\t\t\t\t\t\t__( 'Scheduled: <time>%s</time>' ),\n\t\t\t\t\t\t\tformattedDate\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ time: <time dateTime={ date } /> }\n\t\t\t\t )\n\t\t\t\t: __( 'Scheduled' );\n\t\t\tbreak;\n\t\tcase 'draft':\n\t\t\tstatusLabel = __( 'Draft' );\n\t\t\tbreak;\n\t\tcase 'pending':\n\t\t\tstatusLabel = __( 'Pending' );\n\t\t\tbreak;\n\t\tcase 'private':\n\t\t\tstatusLabel = __( 'Private' );\n\t\t\tbreak;\n\t\tcase 'protected':\n\t\t\tstatusLabel = __( 'Password protected' );\n\t\t\tbreak;\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx(\n\t\t\t\t'edit-site-sidebar-navigation-screen-page__status',\n\t\t\t\t{\n\t\t\t\t\t[ `has-status has-${ status }-status` ]: !! status,\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t{ statusLabel }\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AAC7C,SAASC,QAAQ,EAAEC,OAAO,EAAEC,aAAa,QAAQ,iBAAiB;AAClE,SAASC,wBAAwB,QAAQ,oBAAoB;AAE7D,eAAe,SAASC,WAAWA,CAAE;EAAEC,MAAM;EAAEC,IAAI;EAAEC;AAAM,CAAC,EAAG;EAC9D,MAAMC,WAAW,GAAGN,aAAa,CAAEI,IAAK,CAAC;EACzC,IAAIG,WAAW,GAAGJ,MAAM;EACxB,QAASA,MAAM;IACd,KAAK,SAAS;MACbI,WAAW,GAAGH,IAAI,GACfH,wBAAwB,CACxBJ,OAAO,EACN;MACAD,EAAE,CAAE,2BAA4B,CAAC,EACjCU,WACD,CAAC,EACD;QAAEE,IAAI,EAAEC,aAAA;UAAMC,QAAQ,EAAGN;QAAM,CAAE;MAAE,CACnC,CAAC,GACDR,EAAE,CAAE,WAAY,CAAC;MACpB;IACD,KAAK,QAAQ;MACZ,MAAMe,aAAa,GAAGb,QAAQ,CAC7BO,KAAK,GAAG,KAAK,GAAG,KAAK,EACrBN,OAAO,CAAEK,IAAK,CACf,CAAC;MACDG,WAAW,GAAGH,IAAI,GACfH,wBAAwB,CACxBJ,OAAO,EACN;MACAD,EAAE,CAAE,4BAA6B,CAAC,EAClCe,aACD,CAAC,EACD;QAAEH,IAAI,EAAEC,aAAA;UAAMC,QAAQ,EAAGN;QAAM,CAAE;MAAE,CACnC,CAAC,GACDR,EAAE,CAAE,WAAY,CAAC;MACpB;IACD,KAAK,OAAO;MACXW,WAAW,GAAGX,EAAE,CAAE,OAAQ,CAAC;MAC3B;IACD,KAAK,SAAS;MACbW,WAAW,GAAGX,EAAE,CAAE,SAAU,CAAC;MAC7B;IACD,KAAK,SAAS;MACbW,WAAW,GAAGX,EAAE,CAAE,SAAU,CAAC;MAC7B;IACD,KAAK,WAAW;MACfW,WAAW,GAAGX,EAAE,CAAE,oBAAqB,CAAC;MACxC;EACF;EAEA,OACCa,aAAA;IACCG,SAAS,EAAGjB,IAAI,CACf,kDAAkD,EAClD;MACC,CAAG,kBAAkBQ,MAAQ,SAAQ,GAAI,CAAC,CAAEA;IAC7C,CACD;EAAG,GAEDI,WACE,CAAC;AAER","ignoreList":[]}
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { createElement, Fragment } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { useDispatch } from '@wordpress/data';
|
|
6
|
-
import { __ } from '@wordpress/i18n';
|
|
7
|
-
import { pencil } from '@wordpress/icons';
|
|
8
|
-
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Internal dependencies
|
|
12
|
-
*/
|
|
13
|
-
import SidebarButton from '../sidebar-button';
|
|
14
|
-
import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
15
|
-
import useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-entity-from-url';
|
|
16
|
-
import usePatternDetails from './use-pattern-details';
|
|
17
|
-
import { store as editSiteStore } from '../../store';
|
|
18
|
-
import { unlock } from '../../lock-unlock';
|
|
19
|
-
import TemplateActions from '../template-actions';
|
|
20
|
-
const {
|
|
21
|
-
useLocation,
|
|
22
|
-
useHistory
|
|
23
|
-
} = unlock(routerPrivateApis);
|
|
24
|
-
export default function SidebarNavigationScreenPattern({
|
|
25
|
-
backPath
|
|
26
|
-
}) {
|
|
27
|
-
const history = useHistory();
|
|
28
|
-
const location = useLocation();
|
|
29
|
-
const {
|
|
30
|
-
params: {
|
|
31
|
-
postType,
|
|
32
|
-
postId
|
|
33
|
-
}
|
|
34
|
-
} = location;
|
|
35
|
-
const {
|
|
36
|
-
setCanvasMode
|
|
37
|
-
} = unlock(useDispatch(editSiteStore));
|
|
38
|
-
useInitEditedEntityFromURL();
|
|
39
|
-
const patternDetails = usePatternDetails(postType, postId);
|
|
40
|
-
return createElement(SidebarNavigationScreen, {
|
|
41
|
-
actions: createElement(Fragment, null, createElement(TemplateActions, {
|
|
42
|
-
postType: postType,
|
|
43
|
-
postId: postId,
|
|
44
|
-
toggleProps: {
|
|
45
|
-
as: SidebarButton
|
|
46
|
-
},
|
|
47
|
-
onRemove: () => {
|
|
48
|
-
history.push(backPath);
|
|
49
|
-
}
|
|
50
|
-
}), createElement(SidebarButton, {
|
|
51
|
-
onClick: () => setCanvasMode('edit'),
|
|
52
|
-
label: __('Edit'),
|
|
53
|
-
icon: pencil
|
|
54
|
-
})),
|
|
55
|
-
backPath: backPath,
|
|
56
|
-
...patternDetails
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useDispatch","__","pencil","privateApis","routerPrivateApis","SidebarButton","SidebarNavigationScreen","useInitEditedEntityFromURL","usePatternDetails","store","editSiteStore","unlock","TemplateActions","useLocation","useHistory","SidebarNavigationScreenPattern","backPath","history","location","params","postType","postId","setCanvasMode","patternDetails","createElement","actions","Fragment","toggleProps","as","onRemove","push","onClick","label","icon"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { pencil } from '@wordpress/icons';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarButton from '../sidebar-button';\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-entity-from-url';\nimport usePatternDetails from './use-pattern-details';\nimport { store as editSiteStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport TemplateActions from '../template-actions';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nexport default function SidebarNavigationScreenPattern( { backPath } ) {\n\tconst history = useHistory();\n\tconst location = useLocation();\n\tconst {\n\t\tparams: { postType, postId },\n\t} = location;\n\tconst { setCanvasMode } = unlock( useDispatch( editSiteStore ) );\n\n\tuseInitEditedEntityFromURL();\n\n\tconst patternDetails = usePatternDetails( postType, postId );\n\n\treturn (\n\t\t<SidebarNavigationScreen\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( backPath );\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\tbackPath={ backPath }\n\t\t\t{ ...patternDetails }\n\t\t/>\n\t);\n}\n"],"mappings":";AAAA;AACA;AAC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,CAAC,EACFQ,aAAA,CAACnB,aAAa;MACb0B,OAAO,EAAGA,CAAA,KAAMT,aAAa,CAAE,MAAO,CAAG;MACzCU,KAAK,EAAG/B,EAAE,CAAE,MAAO,CAAG;MACtBgC,IAAI,EAAG/B;IAAQ,CACf,CACA,CACF;IACDc,QAAQ,EAAGA,QAAU;IAAA,GAChBO;EAAc,CACnB,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { __ } from '@wordpress/i18n';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
import SidebarNavigationItem from '../sidebar-navigation-item';
|
|
11
|
-
import useNavigationMenuTitle from './use-navigation-menu-title';
|
|
12
|
-
import { useLink } from '../routes/link';
|
|
13
|
-
import { NAVIGATION_POST_TYPE } from '../../utils/constants';
|
|
14
|
-
export default function TemplatePartNavigationMenuListItem({
|
|
15
|
-
id
|
|
16
|
-
}) {
|
|
17
|
-
const title = useNavigationMenuTitle(id);
|
|
18
|
-
const linkInfo = useLink({
|
|
19
|
-
postId: id,
|
|
20
|
-
postType: NAVIGATION_POST_TYPE
|
|
21
|
-
});
|
|
22
|
-
if (!id || title === undefined) {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
return createElement(SidebarNavigationItem, {
|
|
26
|
-
withChevron: true,
|
|
27
|
-
...linkInfo
|
|
28
|
-
}, title || __('(no title)'));
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=template-part-navigation-menu-list-item.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__","SidebarNavigationItem","useNavigationMenuTitle","useLink","NAVIGATION_POST_TYPE","TemplatePartNavigationMenuListItem","id","title","linkInfo","postId","postType","undefined","createElement","withChevron"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list-item.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport useNavigationMenuTitle from './use-navigation-menu-title';\nimport { useLink } from '../routes/link';\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\n\nexport default function TemplatePartNavigationMenuListItem( { id } ) {\n\tconst title = useNavigationMenuTitle( id );\n\n\tconst linkInfo = useLink( {\n\t\tpostId: id,\n\t\tpostType: NAVIGATION_POST_TYPE,\n\t} );\n\n\tif ( ! id || title === undefined ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<SidebarNavigationItem withChevron { ...linkInfo }>\n\t\t\t{ title || __( '(no title)' ) }\n\t\t</SidebarNavigationItem>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAOC,qBAAqB,MAAM,4BAA4B;AAC9D,OAAOC,sBAAsB,MAAM,6BAA6B;AAChE,SAASC,OAAO,QAAQ,gBAAgB;AACxC,SAASC,oBAAoB,QAAQ,uBAAuB;AAE5D,eAAe,SAASC,kCAAkCA,CAAE;EAAEC;AAAG,CAAC,EAAG;EACpE,MAAMC,KAAK,GAAGL,sBAAsB,CAAEI,EAAG,CAAC;EAE1C,MAAME,QAAQ,GAAGL,OAAO,CAAE;IACzBM,MAAM,EAAEH,EAAE;IACVI,QAAQ,EAAEN;EACX,CAAE,CAAC;EAEH,IAAK,CAAEE,EAAE,IAAIC,KAAK,KAAKI,SAAS,EAAG;IAClC,OAAO,IAAI;EACZ;EAEA,OACCC,aAAA,CAACX,qBAAqB;IAACY,WAAW;IAAA,GAAML;EAAQ,GAC7CD,KAAK,IAAIP,EAAE,CAAE,YAAa,CACN,CAAC;AAE1B","ignoreList":[]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { __experimentalItemGroup as ItemGroup } from '@wordpress/components';
|
|
6
|
-
/**
|
|
7
|
-
* Internal dependencies
|
|
8
|
-
*/
|
|
9
|
-
import TemplatePartNavigationMenuListItem from './template-part-navigation-menu-list-item';
|
|
10
|
-
export default function TemplatePartNavigationMenuList({
|
|
11
|
-
menus
|
|
12
|
-
}) {
|
|
13
|
-
return createElement(ItemGroup, {
|
|
14
|
-
className: "edit-site-sidebar-navigation-screen-template-part-navigation-menu-list"
|
|
15
|
-
}, menus.map(menuId => createElement(TemplatePartNavigationMenuListItem, {
|
|
16
|
-
key: menuId,
|
|
17
|
-
id: menuId
|
|
18
|
-
})));
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=template-part-navigation-menu-list.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__experimentalItemGroup","ItemGroup","TemplatePartNavigationMenuListItem","TemplatePartNavigationMenuList","menus","createElement","className","map","menuId","key","id"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu-list.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\n/**\n * Internal dependencies\n */\nimport TemplatePartNavigationMenuListItem from './template-part-navigation-menu-list-item';\n\nexport default function TemplatePartNavigationMenuList( { menus } ) {\n\treturn (\n\t\t<ItemGroup className=\"edit-site-sidebar-navigation-screen-template-part-navigation-menu-list\">\n\t\t\t{ menus.map( ( menuId ) => (\n\t\t\t\t<TemplatePartNavigationMenuListItem\n\t\t\t\t\tkey={ menuId }\n\t\t\t\t\tid={ menuId }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</ItemGroup>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,uBAAuB,IAAIC,SAAS,QAAQ,uBAAuB;AAC5E;AACA;AACA;AACA,OAAOC,kCAAkC,MAAM,2CAA2C;AAE1F,eAAe,SAASC,8BAA8BA,CAAE;EAAEC;AAAM,CAAC,EAAG;EACnE,OACCC,aAAA,CAACJ,SAAS;IAACK,SAAS,EAAC;EAAwE,GAC1FF,KAAK,CAACG,GAAG,CAAIC,MAAM,IACpBH,aAAA,CAACH,kCAAkC;IAClCO,GAAG,EAAGD,MAAQ;IACdE,EAAE,EAAGF;EAAQ,CACb,CACA,CACQ,CAAC;AAEd","ignoreList":[]}
|
package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { createElement, Fragment } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { __ } from '@wordpress/i18n';
|
|
6
|
-
import { __experimentalHeading as Heading } from '@wordpress/components';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Internal dependencies
|
|
10
|
-
*/
|
|
11
|
-
import NavigationMenuEditor from '../sidebar-navigation-screen-navigation-menu/navigation-menu-editor';
|
|
12
|
-
import useNavigationMenuTitle from './use-navigation-menu-title';
|
|
13
|
-
export default function TemplatePartNavigationMenu({
|
|
14
|
-
id
|
|
15
|
-
}) {
|
|
16
|
-
const title = useNavigationMenuTitle(id);
|
|
17
|
-
if (!id || title === undefined) {
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
return createElement(Fragment, null, createElement(Heading, {
|
|
21
|
-
className: "edit-site-sidebar-navigation-screen-template-part-navigation-menu__title",
|
|
22
|
-
size: "11",
|
|
23
|
-
upperCase: true,
|
|
24
|
-
weight: 500
|
|
25
|
-
}, title || __('Navigation')), createElement(NavigationMenuEditor, {
|
|
26
|
-
navigationMenuId: id
|
|
27
|
-
}));
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=template-part-navigation-menu.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__","__experimentalHeading","Heading","NavigationMenuEditor","useNavigationMenuTitle","TemplatePartNavigationMenu","id","title","undefined","createElement","Fragment","className","size","upperCase","weight","navigationMenuId"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalHeading as Heading } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport NavigationMenuEditor from '../sidebar-navigation-screen-navigation-menu/navigation-menu-editor';\nimport useNavigationMenuTitle from './use-navigation-menu-title';\n\nexport default function TemplatePartNavigationMenu( { id } ) {\n\tconst title = useNavigationMenuTitle( id );\n\n\tif ( ! id || title === undefined ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<Heading\n\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-template-part-navigation-menu__title\"\n\t\t\t\tsize=\"11\"\n\t\t\t\tupperCase\n\t\t\t\tweight={ 500 }\n\t\t\t>\n\t\t\t\t{ title || __( 'Navigation' ) }\n\t\t\t</Heading>\n\t\t\t<NavigationMenuEditor navigationMenuId={ id } />\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,qBAAqB,IAAIC,OAAO,QAAQ,uBAAuB;;AAExE;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,qEAAqE;AACtG,OAAOC,sBAAsB,MAAM,6BAA6B;AAEhE,eAAe,SAASC,0BAA0BA,CAAE;EAAEC;AAAG,CAAC,EAAG;EAC5D,MAAMC,KAAK,GAAGH,sBAAsB,CAAEE,EAAG,CAAC;EAE1C,IAAK,CAAEA,EAAE,IAAIC,KAAK,KAAKC,SAAS,EAAG;IAClC,OAAO,IAAI;EACZ;EAEA,OACCC,aAAA,CAAAC,QAAA,QACCD,aAAA,CAACP,OAAO;IACPS,SAAS,EAAC,0EAA0E;IACpFC,IAAI,EAAC,IAAI;IACTC,SAAS;IACTC,MAAM,EAAG;EAAK,GAEZP,KAAK,IAAIP,EAAE,CAAE,YAAa,CACpB,CAAC,EACVS,aAAA,CAACN,oBAAoB;IAACY,gBAAgB,EAAGT;EAAI,CAAE,CAC9C,CAAC;AAEL","ignoreList":[]}
|
package/build-module/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { createElement, Fragment } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { __ } from '@wordpress/i18n';
|
|
6
|
-
import { __experimentalHeading as Heading } from '@wordpress/components';
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
import TemplatePartNavigationMenu from './template-part-navigation-menu';
|
|
11
|
-
import TemplatePartNavigationMenuList from './template-part-navigation-menu-list';
|
|
12
|
-
export default function TemplatePartNavigationMenus({
|
|
13
|
-
menus
|
|
14
|
-
}) {
|
|
15
|
-
if (!menus.length) {
|
|
16
|
-
return null;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// if there is a single menu then render TemplatePartNavigationMenu
|
|
20
|
-
if (menus.length === 1) {
|
|
21
|
-
return createElement(TemplatePartNavigationMenu, {
|
|
22
|
-
id: menus[0]
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// if there are multiple menus then render TemplatePartNavigationMenuList
|
|
27
|
-
return createElement(Fragment, null, createElement(Heading, {
|
|
28
|
-
className: "edit-site-sidebar-navigation-screen-template-part-navigation-menu__title",
|
|
29
|
-
size: "11",
|
|
30
|
-
upperCase: true,
|
|
31
|
-
weight: 500
|
|
32
|
-
}, __('Navigation')), createElement(TemplatePartNavigationMenuList, {
|
|
33
|
-
menus: menus
|
|
34
|
-
}));
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=template-part-navigation-menus.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__","__experimentalHeading","Heading","TemplatePartNavigationMenu","TemplatePartNavigationMenuList","TemplatePartNavigationMenus","menus","length","createElement","id","Fragment","className","size","upperCase","weight"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/template-part-navigation-menus.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalHeading as Heading } from '@wordpress/components';\n/**\n * Internal dependencies\n */\nimport TemplatePartNavigationMenu from './template-part-navigation-menu';\nimport TemplatePartNavigationMenuList from './template-part-navigation-menu-list';\n\nexport default function TemplatePartNavigationMenus( { menus } ) {\n\tif ( ! menus.length ) {\n\t\treturn null;\n\t}\n\n\t// if there is a single menu then render TemplatePartNavigationMenu\n\tif ( menus.length === 1 ) {\n\t\treturn <TemplatePartNavigationMenu id={ menus[ 0 ] } />;\n\t}\n\n\t// if there are multiple menus then render TemplatePartNavigationMenuList\n\treturn (\n\t\t<>\n\t\t\t<Heading\n\t\t\t\tclassName=\"edit-site-sidebar-navigation-screen-template-part-navigation-menu__title\"\n\t\t\t\tsize=\"11\"\n\t\t\t\tupperCase\n\t\t\t\tweight={ 500 }\n\t\t\t>\n\t\t\t\t{ __( 'Navigation' ) }\n\t\t\t</Heading>\n\t\t\t<TemplatePartNavigationMenuList menus={ menus } />\n\t\t</>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,qBAAqB,IAAIC,OAAO,QAAQ,uBAAuB;AACxE;AACA;AACA;AACA,OAAOC,0BAA0B,MAAM,iCAAiC;AACxE,OAAOC,8BAA8B,MAAM,sCAAsC;AAEjF,eAAe,SAASC,2BAA2BA,CAAE;EAAEC;AAAM,CAAC,EAAG;EAChE,IAAK,CAAEA,KAAK,CAACC,MAAM,EAAG;IACrB,OAAO,IAAI;EACZ;;EAEA;EACA,IAAKD,KAAK,CAACC,MAAM,KAAK,CAAC,EAAG;IACzB,OAAOC,aAAA,CAACL,0BAA0B;MAACM,EAAE,EAAGH,KAAK,CAAE,CAAC;IAAI,CAAE,CAAC;EACxD;;EAEA;EACA,OACCE,aAAA,CAAAE,QAAA,QACCF,aAAA,CAACN,OAAO;IACPS,SAAS,EAAC,0EAA0E;IACpFC,IAAI,EAAC,IAAI;IACTC,SAAS;IACTC,MAAM,EAAG;EAAK,GAEZd,EAAE,CAAE,YAAa,CACX,CAAC,EACVQ,aAAA,CAACJ,8BAA8B;IAACE,KAAK,EAAGA;EAAO,CAAE,CAChD,CAAC;AAEL","ignoreList":[]}
|
package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { createElement } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { parse } from '@wordpress/blocks';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
import TemplatePartNavigationMenus from './template-part-navigation-menus';
|
|
11
|
-
import useEditedEntityRecord from '../use-edited-entity-record';
|
|
12
|
-
import { TEMPLATE_PART_POST_TYPE } from '../../utils/constants';
|
|
13
|
-
function getBlocksFromRecord(record) {
|
|
14
|
-
if (record?.blocks) {
|
|
15
|
-
return record?.blocks;
|
|
16
|
-
}
|
|
17
|
-
return record?.content && typeof record.content !== 'function' ? parse(record.content) : [];
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Retrieves a list of specific blocks from a given tree of blocks.
|
|
22
|
-
*
|
|
23
|
-
* @param {string} targetBlockType The name of the block type to find.
|
|
24
|
-
* @param {Array} blocks A list of blocks from a template part entity.
|
|
25
|
-
*
|
|
26
|
-
* @return {Array} A list of any navigation blocks found in the blocks.
|
|
27
|
-
*/
|
|
28
|
-
function getBlocksOfTypeFromBlocks(targetBlockType, blocks) {
|
|
29
|
-
if (!targetBlockType || !blocks?.length) {
|
|
30
|
-
return [];
|
|
31
|
-
}
|
|
32
|
-
const findInBlocks = _blocks => {
|
|
33
|
-
if (!_blocks) {
|
|
34
|
-
return [];
|
|
35
|
-
}
|
|
36
|
-
const navigationBlocks = [];
|
|
37
|
-
for (const block of _blocks) {
|
|
38
|
-
if (block.name === targetBlockType) {
|
|
39
|
-
navigationBlocks.push(block);
|
|
40
|
-
}
|
|
41
|
-
if (block?.innerBlocks) {
|
|
42
|
-
const innerNavigationBlocks = findInBlocks(block.innerBlocks);
|
|
43
|
-
if (innerNavigationBlocks.length) {
|
|
44
|
-
navigationBlocks.push(...innerNavigationBlocks);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return navigationBlocks;
|
|
49
|
-
};
|
|
50
|
-
return findInBlocks(blocks);
|
|
51
|
-
}
|
|
52
|
-
export default function useNavigationMenuContent(postType, postId) {
|
|
53
|
-
const {
|
|
54
|
-
record
|
|
55
|
-
} = useEditedEntityRecord(postType, postId);
|
|
56
|
-
|
|
57
|
-
// Only managing navigation menus in template parts is supported
|
|
58
|
-
// to match previous behaviour. This could potentially be expanded
|
|
59
|
-
// to patterns as well.
|
|
60
|
-
if (postType !== TEMPLATE_PART_POST_TYPE) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
const blocks = getBlocksFromRecord(record);
|
|
64
|
-
const navigationBlocks = getBlocksOfTypeFromBlocks('core/navigation', blocks);
|
|
65
|
-
if (!navigationBlocks.length) {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
const navigationMenuIds = navigationBlocks?.map(block => block.attributes.ref);
|
|
69
|
-
|
|
70
|
-
// Dedupe the Navigation blocks, as you can have multiple navigation blocks in the template.
|
|
71
|
-
// Also, filter out undefined values, as blocks don't have an id when initially added.
|
|
72
|
-
const uniqueNavigationMenuIds = [...new Set(navigationMenuIds)].filter(menuId => menuId);
|
|
73
|
-
if (!uniqueNavigationMenuIds?.length) {
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
return createElement(TemplatePartNavigationMenus, {
|
|
77
|
-
menus: uniqueNavigationMenuIds
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
//# sourceMappingURL=use-navigation-menu-content.js.map
|
package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["parse","TemplatePartNavigationMenus","useEditedEntityRecord","TEMPLATE_PART_POST_TYPE","getBlocksFromRecord","record","blocks","content","getBlocksOfTypeFromBlocks","targetBlockType","length","findInBlocks","_blocks","navigationBlocks","block","name","push","innerBlocks","innerNavigationBlocks","useNavigationMenuContent","postType","postId","navigationMenuIds","map","attributes","ref","uniqueNavigationMenuIds","Set","filter","menuId","createElement","menus"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-content.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { parse } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport TemplatePartNavigationMenus from './template-part-navigation-menus';\nimport useEditedEntityRecord from '../use-edited-entity-record';\nimport { TEMPLATE_PART_POST_TYPE } from '../../utils/constants';\n\nfunction getBlocksFromRecord( record ) {\n\tif ( record?.blocks ) {\n\t\treturn record?.blocks;\n\t}\n\n\treturn record?.content && typeof record.content !== 'function'\n\t\t? parse( record.content )\n\t\t: [];\n}\n\n/**\n * Retrieves a list of specific blocks from a given tree of blocks.\n *\n * @param {string} targetBlockType The name of the block type to find.\n * @param {Array} blocks A list of blocks from a template part entity.\n *\n * @return {Array} A list of any navigation blocks found in the blocks.\n */\nfunction getBlocksOfTypeFromBlocks( targetBlockType, blocks ) {\n\tif ( ! targetBlockType || ! blocks?.length ) {\n\t\treturn [];\n\t}\n\n\tconst findInBlocks = ( _blocks ) => {\n\t\tif ( ! _blocks ) {\n\t\t\treturn [];\n\t\t}\n\n\t\tconst navigationBlocks = [];\n\n\t\tfor ( const block of _blocks ) {\n\t\t\tif ( block.name === targetBlockType ) {\n\t\t\t\tnavigationBlocks.push( block );\n\t\t\t}\n\n\t\t\tif ( block?.innerBlocks ) {\n\t\t\t\tconst innerNavigationBlocks = findInBlocks( block.innerBlocks );\n\n\t\t\t\tif ( innerNavigationBlocks.length ) {\n\t\t\t\t\tnavigationBlocks.push( ...innerNavigationBlocks );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn navigationBlocks;\n\t};\n\n\treturn findInBlocks( blocks );\n}\n\nexport default function useNavigationMenuContent( postType, postId ) {\n\tconst { record } = useEditedEntityRecord( postType, postId );\n\n\t// Only managing navigation menus in template parts is supported\n\t// to match previous behaviour. This could potentially be expanded\n\t// to patterns as well.\n\tif ( postType !== TEMPLATE_PART_POST_TYPE ) {\n\t\treturn;\n\t}\n\n\tconst blocks = getBlocksFromRecord( record );\n\tconst navigationBlocks = getBlocksOfTypeFromBlocks(\n\t\t'core/navigation',\n\t\tblocks\n\t);\n\n\tif ( ! navigationBlocks.length ) {\n\t\treturn;\n\t}\n\n\tconst navigationMenuIds = navigationBlocks?.map(\n\t\t( block ) => block.attributes.ref\n\t);\n\n\t// Dedupe the Navigation blocks, as you can have multiple navigation blocks in the template.\n\t// Also, filter out undefined values, as blocks don't have an id when initially added.\n\tconst uniqueNavigationMenuIds = [ ...new Set( navigationMenuIds ) ].filter(\n\t\t( menuId ) => menuId\n\t);\n\n\tif ( ! uniqueNavigationMenuIds?.length ) {\n\t\treturn;\n\t}\n\n\treturn <TemplatePartNavigationMenus menus={ uniqueNavigationMenuIds } />;\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,KAAK,QAAQ,mBAAmB;;AAEzC;AACA;AACA;AACA,OAAOC,2BAA2B,MAAM,kCAAkC;AAC1E,OAAOC,qBAAqB,MAAM,6BAA6B;AAC/D,SAASC,uBAAuB,QAAQ,uBAAuB;AAE/D,SAASC,mBAAmBA,CAAEC,MAAM,EAAG;EACtC,IAAKA,MAAM,E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AMQ,gBAAgB,GAAGL,yBAAyB,CACjD,iBAAiB,EACjBF,MACD,CAAC;EAED,IAAK,CAAEO,gBAAgB,CAACH,MAAM,EAAG;IAChC;EACD;EAEA,MAAMY,iBAAiB,GAAGT,gBAAgB,EAAEU,GAAG,CAC5CT,KAAK,IAAMA,KAAK,CAACU,UAAU,CAACC,GAC/B,CAAC;;EAED;EACA;EACA,MAAMC,uBAAuB,GAAG,CAAE,GAAG,IAAIC,GAAG,CAAEL,iBAAkB,CAAC,CAAE,CAACM,MAAM,CACvEC,MAAM,IAAMA,MACf,CAAC;EAED,IAAK,CAAEH,uBAAuB,EAAEhB,MAAM,EAAG;IACxC;EACD;EAEA,OAAOoB,aAAA,CAAC7B,2BAA2B;IAAC8B,KAAK,EAAGL;EAAyB,CAAE,CAAC;AACzE","ignoreList":[]}
|
package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WordPress dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { useSelect } from '@wordpress/data';
|
|
5
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal dependencies
|
|
9
|
-
*/
|
|
10
|
-
import { NAVIGATION_POST_TYPE } from '../../utils/constants';
|
|
11
|
-
export default function useNavigationMenuTitle(id) {
|
|
12
|
-
return useSelect(select => {
|
|
13
|
-
if (!id) {
|
|
14
|
-
return undefined;
|
|
15
|
-
}
|
|
16
|
-
const editedRecord = select(coreStore).getEditedEntityRecord('postType', NAVIGATION_POST_TYPE, id);
|
|
17
|
-
|
|
18
|
-
// Do not display a 'trashed' navigation menu.
|
|
19
|
-
return editedRecord.status === 'trash' ? undefined : editedRecord.title;
|
|
20
|
-
}, [id]);
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=use-navigation-menu-title.js.map
|
package/build-module/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["useSelect","store","coreStore","NAVIGATION_POST_TYPE","useNavigationMenuTitle","id","select","undefined","editedRecord","getEditedEntityRecord","status","title"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/use-navigation-menu-title.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { NAVIGATION_POST_TYPE } from '../../utils/constants';\n\nexport default function useNavigationMenuTitle( id ) {\n\treturn useSelect(\n\t\t( select ) => {\n\t\t\tif ( ! id ) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\n\t\t\tconst editedRecord = select( coreStore ).getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tNAVIGATION_POST_TYPE,\n\t\t\t\tid\n\t\t\t);\n\n\t\t\t// Do not display a 'trashed' navigation menu.\n\t\t\treturn editedRecord.status === 'trash'\n\t\t\t\t? undefined\n\t\t\t\t: editedRecord.title;\n\t\t},\n\t\t[ id ]\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASC,oBAAoB,QAAQ,uBAAuB;AAE5D,eAAe,SAASC,sBAAsBA,CAAEC,EAAE,EAAG;EACpD,OAAOL,SAAS,CACbM,MAAM,IAAM;IACb,IAAK,CAAED,EAAE,EAAG;MACX,OAAOE,SAAS;IACjB;IAEA,MAAMC,YAAY,GAAGF,MAAM,CAAEJ,SAAU,CAAC,CAACO,qBAAqB,CAC7D,UAAU,EACVN,oBAAoB,EACpBE,EACD,CAAC;;IAED;IACA,OAAOG,YAAY,CAACE,MAAM,KAAK,OAAO,GACnCH,SAAS,GACTC,YAAY,CAACG,KAAK;EACtB,CAAC,EACD,CAAEN,EAAE,CACL,CAAC;AACF","ignoreList":[]}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { createElement, Fragment } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* External dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { sentenceCase } from 'change-case';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* WordPress dependencies
|
|
9
|
-
*/
|
|
10
|
-
import { __, _x, sprintf } from '@wordpress/i18n';
|
|
11
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
12
|
-
import { store as editorStore } from '@wordpress/editor';
|
|
13
|
-
import { useSelect } from '@wordpress/data';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Internal dependencies
|
|
17
|
-
*/
|
|
18
|
-
import { useAddedBy } from '../page-templates/hooks';
|
|
19
|
-
import useEditedEntityRecord from '../use-edited-entity-record';
|
|
20
|
-
import useNavigationMenuContent from './use-navigation-menu-content';
|
|
21
|
-
import SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';
|
|
22
|
-
import { SidebarNavigationScreenDetailsPanel, SidebarNavigationScreenDetailsPanelRow, SidebarNavigationScreenDetailsPanelLabel, SidebarNavigationScreenDetailsPanelValue } from '../sidebar-navigation-screen-details-panel';
|
|
23
|
-
import { PATTERN_TYPES, TEMPLATE_PART_POST_TYPE, PATTERN_SYNC_TYPES, TEMPLATE_ORIGINS } from '../../utils/constants';
|
|
24
|
-
export default function usePatternDetails(postType, postId) {
|
|
25
|
-
const {
|
|
26
|
-
getDescription,
|
|
27
|
-
getTitle,
|
|
28
|
-
record
|
|
29
|
-
} = useEditedEntityRecord(postType, postId);
|
|
30
|
-
const templatePartAreas = useSelect(select => select(editorStore).__experimentalGetDefaultTemplatePartAreas(), []);
|
|
31
|
-
const {
|
|
32
|
-
currentTheme,
|
|
33
|
-
userPatternCategories
|
|
34
|
-
} = useSelect(select => {
|
|
35
|
-
const {
|
|
36
|
-
getCurrentTheme,
|
|
37
|
-
getUserPatternCategories
|
|
38
|
-
} = select(coreStore);
|
|
39
|
-
return {
|
|
40
|
-
currentTheme: getCurrentTheme(),
|
|
41
|
-
userPatternCategories: getUserPatternCategories()
|
|
42
|
-
};
|
|
43
|
-
}, []);
|
|
44
|
-
const addedBy = useAddedBy(postType, postId);
|
|
45
|
-
const isAddedByActiveTheme = addedBy.type === 'theme' && record.theme === currentTheme?.stylesheet;
|
|
46
|
-
const title = getTitle();
|
|
47
|
-
let description = getDescription();
|
|
48
|
-
if (!description && addedBy.text) {
|
|
49
|
-
description = postType === PATTERN_TYPES.user ? sprintf(
|
|
50
|
-
// translators: %s: pattern title e.g: "Header".
|
|
51
|
-
__('This is the %s pattern.'), getTitle()) : sprintf(
|
|
52
|
-
// translators: %s: template part title e.g: "Header".
|
|
53
|
-
__('This is the %s template part.'), getTitle());
|
|
54
|
-
}
|
|
55
|
-
if (!description && postType === PATTERN_TYPES.user && record?.title) {
|
|
56
|
-
description = sprintf(
|
|
57
|
-
// translators: %s: user created pattern title e.g. "Footer".
|
|
58
|
-
__('This is the %s pattern.'), record.title);
|
|
59
|
-
}
|
|
60
|
-
const footer = record?.modified ? createElement(SidebarNavigationScreenDetailsFooter, {
|
|
61
|
-
record: record
|
|
62
|
-
}) : null;
|
|
63
|
-
const details = [];
|
|
64
|
-
if (postType === PATTERN_TYPES.user || postType === TEMPLATE_PART_POST_TYPE) {
|
|
65
|
-
details.push({
|
|
66
|
-
label: __('Syncing'),
|
|
67
|
-
value: record.wp_pattern_sync_status === PATTERN_SYNC_TYPES.unsynced ? _x('Not synced', 'Text that indicates that the pattern is not synchronized') : _x('Synced', 'Text that indicates that the pattern is synchronized')
|
|
68
|
-
});
|
|
69
|
-
if (record.wp_pattern_category?.length === 0) {
|
|
70
|
-
details.push({
|
|
71
|
-
label: __('Categories'),
|
|
72
|
-
value: __('Uncategorized')
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
if (record.wp_pattern_category?.length > 0) {
|
|
76
|
-
const patternCategories = new Map();
|
|
77
|
-
userPatternCategories.forEach(userCategory => patternCategories.set(userCategory.id, userCategory));
|
|
78
|
-
const categories = record.wp_pattern_category.filter(category => patternCategories.get(category)).map(category => patternCategories.get(category).label);
|
|
79
|
-
details.push({
|
|
80
|
-
label: __('Categories'),
|
|
81
|
-
value: categories.length > 0 ? categories.join(', ') : ''
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
if (postType === TEMPLATE_PART_POST_TYPE) {
|
|
86
|
-
const templatePartArea = templatePartAreas.find(area => area.area === record.area);
|
|
87
|
-
let areaDetailValue = templatePartArea?.label;
|
|
88
|
-
if (!areaDetailValue) {
|
|
89
|
-
areaDetailValue = record.area ? sprintf(
|
|
90
|
-
// translators: %s: Sentenced cased template part area e.g: "My custom area".
|
|
91
|
-
__('%s (removed)'), sentenceCase(record.area)) : __('None');
|
|
92
|
-
}
|
|
93
|
-
details.push({
|
|
94
|
-
label: __('Area'),
|
|
95
|
-
value: areaDetailValue
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
if (postType === TEMPLATE_PART_POST_TYPE && addedBy.text && !isAddedByActiveTheme) {
|
|
99
|
-
details.push({
|
|
100
|
-
label: __('Added by'),
|
|
101
|
-
value: createElement("span", {
|
|
102
|
-
className: "edit-site-sidebar-navigation-screen-pattern__added-by-description-author"
|
|
103
|
-
}, addedBy.text)
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
if (postType === TEMPLATE_PART_POST_TYPE && addedBy.text && (record.origin === TEMPLATE_ORIGINS.plugin || record.has_theme_file === true)) {
|
|
107
|
-
details.push({
|
|
108
|
-
label: __('Customized'),
|
|
109
|
-
value: createElement("span", {
|
|
110
|
-
className: "edit-site-sidebar-navigation-screen-pattern__added-by-description-customized"
|
|
111
|
-
}, addedBy.isCustomized ? __('Yes') : __('No'))
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
const content = createElement(Fragment, null, useNavigationMenuContent(postType, postId), !!details.length && createElement(SidebarNavigationScreenDetailsPanel, {
|
|
115
|
-
spacing: 5,
|
|
116
|
-
title: __('Details')
|
|
117
|
-
}, details.map(({
|
|
118
|
-
label,
|
|
119
|
-
value
|
|
120
|
-
}) => createElement(SidebarNavigationScreenDetailsPanelRow, {
|
|
121
|
-
key: label
|
|
122
|
-
}, createElement(SidebarNavigationScreenDetailsPanelLabel, null, label), createElement(SidebarNavigationScreenDetailsPanelValue, null, value)))));
|
|
123
|
-
return {
|
|
124
|
-
title,
|
|
125
|
-
description,
|
|
126
|
-
content,
|
|
127
|
-
footer
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
//# sourceMappingURL=use-pattern-details.js.map
|
package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["sentenceCase","__","_x","sprintf","store","coreStore","editorStore","useSelect","useAddedBy","useEditedEntityRecord","useNavigationMenuContent","SidebarNavigationScreenDetailsFooter","SidebarNavigationScreenDetailsPanel","SidebarNavigationScreenDetailsPanelRow","SidebarNavigationScreenDetailsPanelLabel","SidebarNavigationScreenDetailsPanelValue","PATTERN_TYPES","TEMPLATE_PART_POST_TYPE","PATTERN_SYNC_TYPES","TEMPLATE_ORIGINS","usePatternDetails","postType","postId","getDescription","getTitle","record","templatePartAreas","select","__experimentalGetDefaultTemplatePartAreas","currentTheme","userPatternCategories","getCurrentTheme","getUserPatternCategories","addedBy","isAddedByActiveTheme","type","theme","stylesheet","title","description","text","user","footer","modified","createElement","details","push","label","value","wp_pattern_sync_status","unsynced","wp_pattern_category","length","patternCategories","Map","forEach","userCategory","set","id","categories","filter","category","get","map","join","templatePartArea","find","area","areaDetailValue","className","origin","plugin","has_theme_file","isCustomized","content","Fragment","spacing","key"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { sentenceCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as editorStore } from '@wordpress/editor';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { useAddedBy } from '../page-templates/hooks';\nimport useEditedEntityRecord from '../use-edited-entity-record';\nimport useNavigationMenuContent from './use-navigation-menu-content';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\nimport {\n\tSidebarNavigationScreenDetailsPanel,\n\tSidebarNavigationScreenDetailsPanelRow,\n\tSidebarNavigationScreenDetailsPanelLabel,\n\tSidebarNavigationScreenDetailsPanelValue,\n} from '../sidebar-navigation-screen-details-panel';\nimport {\n\tPATTERN_TYPES,\n\tTEMPLATE_PART_POST_TYPE,\n\tPATTERN_SYNC_TYPES,\n\tTEMPLATE_ORIGINS,\n} from '../../utils/constants';\n\nexport default function usePatternDetails( postType, postId ) {\n\tconst { getDescription, getTitle, record } = useEditedEntityRecord(\n\t\tpostType,\n\t\tpostId\n\t);\n\tconst templatePartAreas = useSelect(\n\t\t( select ) =>\n\t\t\tselect( editorStore ).__experimentalGetDefaultTemplatePartAreas(),\n\t\t[]\n\t);\n\tconst { currentTheme, userPatternCategories } = useSelect( ( select ) => {\n\t\tconst { getCurrentTheme, getUserPatternCategories } =\n\t\t\tselect( coreStore );\n\n\t\treturn {\n\t\t\tcurrentTheme: getCurrentTheme(),\n\t\t\tuserPatternCategories: getUserPatternCategories(),\n\t\t};\n\t}, [] );\n\n\tconst addedBy = useAddedBy( postType, postId );\n\tconst isAddedByActiveTheme =\n\t\taddedBy.type === 'theme' && record.theme === currentTheme?.stylesheet;\n\tconst title = getTitle();\n\tlet description = getDescription();\n\n\tif ( ! description && addedBy.text ) {\n\t\tdescription =\n\t\t\tpostType === PATTERN_TYPES.user\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t// translators: %s: pattern title e.g: \"Header\".\n\t\t\t\t\t\t__( 'This is the %s pattern.' ),\n\t\t\t\t\t\tgetTitle()\n\t\t\t\t )\n\t\t\t\t: sprintf(\n\t\t\t\t\t\t// translators: %s: template part title e.g: \"Header\".\n\t\t\t\t\t\t__( 'This is the %s template part.' ),\n\t\t\t\t\t\tgetTitle()\n\t\t\t\t );\n\t}\n\n\tif ( ! description && postType === PATTERN_TYPES.user && record?.title ) {\n\t\tdescription = sprintf(\n\t\t\t// translators: %s: user created pattern title e.g. \"Footer\".\n\t\t\t__( 'This is the %s pattern.' ),\n\t\t\trecord.title\n\t\t);\n\t}\n\n\tconst footer = record?.modified ? (\n\t\t<SidebarNavigationScreenDetailsFooter record={ record } />\n\t) : null;\n\n\tconst details = [];\n\n\tif (\n\t\tpostType === PATTERN_TYPES.user ||\n\t\tpostType === TEMPLATE_PART_POST_TYPE\n\t) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Syncing' ),\n\t\t\tvalue:\n\t\t\t\trecord.wp_pattern_sync_status === PATTERN_SYNC_TYPES.unsynced\n\t\t\t\t\t? _x(\n\t\t\t\t\t\t\t'Not synced',\n\t\t\t\t\t\t\t'Text that indicates that the pattern is not synchronized'\n\t\t\t\t\t )\n\t\t\t\t\t: _x(\n\t\t\t\t\t\t\t'Synced',\n\t\t\t\t\t\t\t'Text that indicates that the pattern is synchronized'\n\t\t\t\t\t ),\n\t\t} );\n\n\t\tif ( record.wp_pattern_category?.length === 0 ) {\n\t\t\tdetails.push( {\n\t\t\t\tlabel: __( 'Categories' ),\n\t\t\t\tvalue: __( 'Uncategorized' ),\n\t\t\t} );\n\t\t}\n\t\tif ( record.wp_pattern_category?.length > 0 ) {\n\t\t\tconst patternCategories = new Map();\n\t\t\tuserPatternCategories.forEach( ( userCategory ) =>\n\t\t\t\tpatternCategories.set( userCategory.id, userCategory )\n\t\t\t);\n\n\t\t\tconst categories = record.wp_pattern_category\n\t\t\t\t.filter( ( category ) => patternCategories.get( category ) )\n\t\t\t\t.map( ( category ) => patternCategories.get( category ).label );\n\n\t\t\tdetails.push( {\n\t\t\t\tlabel: __( 'Categories' ),\n\t\t\t\tvalue: categories.length > 0 ? categories.join( ', ' ) : '',\n\t\t\t} );\n\t\t}\n\t}\n\n\tif ( postType === TEMPLATE_PART_POST_TYPE ) {\n\t\tconst templatePartArea = templatePartAreas.find(\n\t\t\t( area ) => area.area === record.area\n\t\t);\n\n\t\tlet areaDetailValue = templatePartArea?.label;\n\n\t\tif ( ! areaDetailValue ) {\n\t\t\tareaDetailValue = record.area\n\t\t\t\t? sprintf(\n\t\t\t\t\t\t// translators: %s: Sentenced cased template part area e.g: \"My custom area\".\n\t\t\t\t\t\t__( '%s (removed)' ),\n\t\t\t\t\t\tsentenceCase( record.area )\n\t\t\t\t )\n\t\t\t\t: __( 'None' );\n\t\t}\n\n\t\tdetails.push( { label: __( 'Area' ), value: areaDetailValue } );\n\t}\n\n\tif (\n\t\tpostType === TEMPLATE_PART_POST_TYPE &&\n\t\taddedBy.text &&\n\t\t! isAddedByActiveTheme\n\t) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Added by' ),\n\t\t\tvalue: (\n\t\t\t\t<span className=\"edit-site-sidebar-navigation-screen-pattern__added-by-description-author\">\n\t\t\t\t\t{ addedBy.text }\n\t\t\t\t</span>\n\t\t\t),\n\t\t} );\n\t}\n\n\tif (\n\t\tpostType === TEMPLATE_PART_POST_TYPE &&\n\t\taddedBy.text &&\n\t\t( record.origin === TEMPLATE_ORIGINS.plugin ||\n\t\t\trecord.has_theme_file === true )\n\t) {\n\t\tdetails.push( {\n\t\t\tlabel: __( 'Customized' ),\n\t\t\tvalue: (\n\t\t\t\t<span className=\"edit-site-sidebar-navigation-screen-pattern__added-by-description-customized\">\n\t\t\t\t\t{ addedBy.isCustomized ? __( 'Yes' ) : __( 'No' ) }\n\t\t\t\t</span>\n\t\t\t),\n\t\t} );\n\t}\n\n\tconst content = (\n\t\t<>\n\t\t\t{ useNavigationMenuContent( postType, postId ) }\n\t\t\t{ !! details.length && (\n\t\t\t\t<SidebarNavigationScreenDetailsPanel\n\t\t\t\t\tspacing={ 5 }\n\t\t\t\t\ttitle={ __( 'Details' ) }\n\t\t\t\t>\n\t\t\t\t\t{ details.map( ( { label, value } ) => (\n\t\t\t\t\t\t<SidebarNavigationScreenDetailsPanelRow key={ label }>\n\t\t\t\t\t\t\t<SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t</SidebarNavigationScreenDetailsPanelLabel>\n\t\t\t\t\t\t\t<SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t\t\t\t{ value }\n\t\t\t\t\t\t\t</SidebarNavigationScreenDetailsPanelValue>\n\t\t\t\t\t\t</SidebarNavigationScreenDetailsPanelRow>\n\t\t\t\t\t) ) }\n\t\t\t\t</SidebarNavigationScreenDetailsPanel>\n\t\t\t) }\n\t\t</>\n\t);\n\n\treturn { title, description, content, footer };\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,YAAY,QAAQ,aAAa;;AAE1C;AACA;AACA;AACA,SAASC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACjD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASD,KAAK,IAAIE,WAAW,QAAQ,mBAAmB;AACxD,SAASC,SAAS,QAAQ,iBAAiB;;AAE3C;AACA;AACA;AACA,SAASC,UAAU,QAAQ,yBAAyB;AACpD,OAAOC,qBAAqB,MAAM,6BAA6B;AAC/D,OAAOC,wBAAwB,MAAM,+BAA+B;AACpE,OAAOC,oCAAoC,MAAM,6CAA6C;AAC9F,SACCC,mCAAmC,EACnCC,sCAAsC,EACtCC,wCAAwC,EACxCC,wCAAwC,QAClC,4CAA4C;AACnD,SACCC,aAAa,EACbC,uBAAuB,EACvBC,kBAAkB,EAClBC,gBAAgB,QACV,uBAAuB;AAE9B,eAAe,SAASC,iBAAiBA,CAAEC,QAAQ,EAAEC,MAAM,EAAG;EAC7D,MAAM;IAAEC,cAAc;IAAEC,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AAE,CAAE,YAAa,CAAC;MACzB+C,KAAK,EACJJ,aAAA;QAAMyB,SAAS,EAAC;MAA8E,GAC3FpC,OAAO,CAACwC,YAAY,GAAGxE,EAAE,CAAE,KAAM,CAAC,GAAGA,EAAE,CAAE,IAAK,CAC3C;IAER,CAAE,CAAC;EACJ;EAEA,MAAMyE,OAAO,GACZ9B,aAAA,CAAA+B,QAAA,QACGjE,wBAAwB,CAAEW,QAAQ,EAAEC,MAAO,CAAC,EAC5C,CAAC,CAAEuB,OAAO,CAACO,MAAM,IAClBR,aAAA,CAAChC,mCAAmC;IACnCgE,OAAO,EAAG,CAAG;IACbtC,KAAK,EAAGrC,EAAE,CAAE,SAAU;EAAG,GAEvB4C,OAAO,CAACkB,GAAG,CAAE,CAAE;IAAEhB,KAAK;IAAEC;EAAM,CAAC,KAChCJ,aAAA,CAAC/B,sCAAsC;IAACgE,GAAG,EAAG9B;EAAO,GACpDH,aAAA,CAAC9B,wCAAwC,QACtCiC,KACuC,CAAC,EAC3CH,aAAA,CAAC7B,wCAAwC,QACtCiC,KACuC,CACH,CACvC,CACkC,CAErC,CACF;EAED,OAAO;IAAEV,KAAK;IAAEC,WAAW;IAAEmC,OAAO;IAAEhC;EAAO,CAAC;AAC/C","ignoreList":[]}
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { createElement, Fragment } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* WordPress dependencies
|
|
4
|
-
*/
|
|
5
|
-
import { __ } from '@wordpress/i18n';
|
|
6
|
-
import { debounce } from '@wordpress/compose';
|
|
7
|
-
import { useSelect, useDispatch } from '@wordpress/data';
|
|
8
|
-
import { store as coreStore } from '@wordpress/core-data';
|
|
9
|
-
import { CheckboxControl, __experimentalInputControl as InputControl, __experimentalNumberControl as NumberControl } from '@wordpress/components';
|
|
10
|
-
import { useState, useEffect } from '@wordpress/element';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Internal dependencies
|
|
14
|
-
*/
|
|
15
|
-
import { SidebarNavigationScreenDetailsPanel, SidebarNavigationScreenDetailsPanelRow } from '../sidebar-navigation-screen-details-panel';
|
|
16
|
-
const EMPTY_OBJECT = {};
|
|
17
|
-
export default function HomeTemplateDetails() {
|
|
18
|
-
const {
|
|
19
|
-
editEntityRecord
|
|
20
|
-
} = useDispatch(coreStore);
|
|
21
|
-
const {
|
|
22
|
-
allowCommentsOnNewPosts,
|
|
23
|
-
postsPerPage,
|
|
24
|
-
postsPageTitle,
|
|
25
|
-
postsPageId
|
|
26
|
-
} = useSelect(select => {
|
|
27
|
-
const {
|
|
28
|
-
getEntityRecord
|
|
29
|
-
} = select(coreStore);
|
|
30
|
-
const siteSettings = getEntityRecord('root', 'site');
|
|
31
|
-
const _postsPageRecord = siteSettings?.page_for_posts ? getEntityRecord('postType', 'page', siteSettings?.page_for_posts) : EMPTY_OBJECT;
|
|
32
|
-
return {
|
|
33
|
-
allowCommentsOnNewPosts: siteSettings?.default_comment_status === 'open',
|
|
34
|
-
postsPageTitle: _postsPageRecord?.title?.rendered,
|
|
35
|
-
postsPageId: _postsPageRecord?.id,
|
|
36
|
-
postsPerPage: siteSettings?.posts_per_page
|
|
37
|
-
};
|
|
38
|
-
}, []);
|
|
39
|
-
const [commentsOnNewPostsValue, setCommentsOnNewPostsValue] = useState('');
|
|
40
|
-
const [postsCountValue, setPostsCountValue] = useState(1);
|
|
41
|
-
const [postsPageTitleValue, setPostsPageTitleValue] = useState('');
|
|
42
|
-
|
|
43
|
-
/*
|
|
44
|
-
* This hook serves to set the server-retrieved values,
|
|
45
|
-
* postsPageTitle, allowCommentsOnNewPosts, postsPerPage,
|
|
46
|
-
* to local state.
|
|
47
|
-
*/
|
|
48
|
-
useEffect(() => {
|
|
49
|
-
setCommentsOnNewPostsValue(allowCommentsOnNewPosts);
|
|
50
|
-
setPostsPageTitleValue(postsPageTitle);
|
|
51
|
-
setPostsCountValue(postsPerPage);
|
|
52
|
-
}, [postsPageTitle, allowCommentsOnNewPosts, postsPerPage]);
|
|
53
|
-
const setAllowCommentsOnNewPosts = newValue => {
|
|
54
|
-
setCommentsOnNewPostsValue(newValue);
|
|
55
|
-
editEntityRecord('root', 'site', undefined, {
|
|
56
|
-
default_comment_status: newValue ? 'open' : null
|
|
57
|
-
});
|
|
58
|
-
};
|
|
59
|
-
const setPostsPageTitle = newValue => {
|
|
60
|
-
setPostsPageTitleValue(newValue);
|
|
61
|
-
editEntityRecord('postType', 'page', postsPageId, {
|
|
62
|
-
title: newValue
|
|
63
|
-
});
|
|
64
|
-
};
|
|
65
|
-
const setPostsPerPage = newValue => {
|
|
66
|
-
setPostsCountValue(newValue);
|
|
67
|
-
editEntityRecord('root', 'site', undefined, {
|
|
68
|
-
posts_per_page: newValue
|
|
69
|
-
});
|
|
70
|
-
};
|
|
71
|
-
return createElement(Fragment, null, createElement(SidebarNavigationScreenDetailsPanel, {
|
|
72
|
-
spacing: 6
|
|
73
|
-
}, postsPageId && createElement(SidebarNavigationScreenDetailsPanelRow, null, createElement(InputControl, {
|
|
74
|
-
className: "edit-site-sidebar-navigation-screen__input-control",
|
|
75
|
-
placeholder: __('No Title'),
|
|
76
|
-
size: '__unstable-large',
|
|
77
|
-
value: postsPageTitleValue,
|
|
78
|
-
onChange: debounce(setPostsPageTitle, 300),
|
|
79
|
-
label: __('Blog title'),
|
|
80
|
-
help: __('Set the Posts Page title. Appears in search results, and when the page is shared on social media.')
|
|
81
|
-
})), createElement(SidebarNavigationScreenDetailsPanelRow, null, createElement(NumberControl, {
|
|
82
|
-
className: "edit-site-sidebar-navigation-screen__input-control",
|
|
83
|
-
placeholder: 0,
|
|
84
|
-
value: postsCountValue,
|
|
85
|
-
size: '__unstable-large',
|
|
86
|
-
spinControls: "custom",
|
|
87
|
-
step: "1",
|
|
88
|
-
min: "1",
|
|
89
|
-
onChange: setPostsPerPage,
|
|
90
|
-
label: __('Posts per page'),
|
|
91
|
-
help: __('Set the default number of posts to display on blog pages, including categories and tags. Some templates may override this setting.')
|
|
92
|
-
}))), createElement(SidebarNavigationScreenDetailsPanel, {
|
|
93
|
-
title: __('Discussion'),
|
|
94
|
-
spacing: 3
|
|
95
|
-
}, createElement(SidebarNavigationScreenDetailsPanelRow, null, createElement(CheckboxControl, {
|
|
96
|
-
className: "edit-site-sidebar-navigation-screen__input-control",
|
|
97
|
-
label: __('Allow comments on new posts'),
|
|
98
|
-
help: __('Changes will apply to new posts only. Individual posts may override these settings.'),
|
|
99
|
-
checked: commentsOnNewPostsValue,
|
|
100
|
-
onChange: setAllowCommentsOnNewPosts
|
|
101
|
-
}))));
|
|
102
|
-
}
|
|
103
|
-
//# sourceMappingURL=home-template-details.js.map
|
package/build-module/components/sidebar-navigation-screen-template/home-template-details.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["__","debounce","useSelect","useDispatch","store","coreStore","CheckboxControl","__experimentalInputControl","InputControl","__experimentalNumberControl","NumberControl","useState","useEffect","SidebarNavigationScreenDetailsPanel","SidebarNavigationScreenDetailsPanelRow","EMPTY_OBJECT","HomeTemplateDetails","editEntityRecord","allowCommentsOnNewPosts","postsPerPage","postsPageTitle","postsPageId","select","getEntityRecord","siteSettings","_postsPageRecord","page_for_posts","default_comment_status","title","rendered","id","posts_per_page","commentsOnNewPostsValue","setCommentsOnNewPostsValue","postsCountValue","setPostsCountValue","postsPageTitleValue","setPostsPageTitleValue","setAllowCommentsOnNewPosts","newValue","undefined","setPostsPageTitle","setPostsPerPage","createElement","Fragment","spacing","className","placeholder","size","value","onChange","label","help","spinControls","step","min","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":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SACCC,eAAe,EACfC,0BAA0B,IAAIC,YAAY,EAC1CC,2BAA2B,IAAIC,aAAa,QACtC,uBAAuB;AAC9B,SAASC,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;;AAExD;AACA;AACA;AACA,SACCC,mCAAmC,EACnCC,sCAAsC,QAChC,4CAA4C;AAEnD,MAAMC,YAAY,GAAG,CAAC,CAAC;A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