@wordpress/edit-site 3.0.7 → 3.0.11
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/build/components/add-new-template/index.js +49 -0
- package/build/components/add-new-template/index.js.map +1 -0
- package/build/components/add-new-template/new-template-part.js +78 -0
- package/build/components/add-new-template/new-template-part.js.map +1 -0
- package/build/components/add-new-template/new-template.js +114 -0
- package/build/components/add-new-template/new-template.js.map +1 -0
- package/build/components/block-editor/block-inspector-button.js +4 -3
- package/build/components/block-editor/block-inspector-button.js.map +1 -1
- package/build/components/block-editor/index.js +12 -8
- package/build/components/block-editor/index.js.map +1 -1
- package/build/components/block-editor/resizable-editor.js +6 -5
- package/build/components/block-editor/resizable-editor.js.map +1 -1
- package/build/components/block-editor/resize-handle.js +6 -4
- package/build/components/block-editor/resize-handle.js.map +1 -1
- package/build/components/create-template-part-modal/index.js +115 -0
- package/build/components/create-template-part-modal/index.js.map +1 -0
- package/build/components/edit-template-part-menu-button/index.js +15 -11
- package/build/components/edit-template-part-menu-button/index.js.map +1 -1
- package/build/components/editor/index.js +25 -20
- package/build/components/editor/index.js.map +1 -1
- package/build/components/error-boundary/index.js +5 -4
- package/build/components/error-boundary/index.js.map +1 -1
- package/build/components/global-styles/border-panel.js +5 -4
- package/build/components/global-styles/border-panel.js.map +1 -1
- package/build/components/global-styles/color-palette-panel.js +33 -9
- package/build/components/global-styles/color-palette-panel.js.map +1 -1
- package/build/components/global-styles/context-menu.js +5 -4
- package/build/components/global-styles/context-menu.js.map +1 -1
- package/build/components/global-styles/dimensions-panel.js +5 -4
- package/build/components/global-styles/dimensions-panel.js.map +1 -1
- package/build/components/global-styles/global-styles-provider.js +11 -46
- package/build/components/global-styles/global-styles-provider.js.map +1 -1
- package/build/components/global-styles/header.js +6 -5
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/hooks.js +34 -30
- package/build/components/global-styles/hooks.js.map +1 -1
- package/build/components/global-styles/index.js +6 -6
- package/build/components/global-styles/navigation-button.js +8 -7
- package/build/components/global-styles/navigation-button.js.map +1 -1
- package/build/components/global-styles/palette.js +13 -9
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/screen-background-color.js +4 -3
- package/build/components/global-styles/screen-background-color.js.map +1 -1
- package/build/components/global-styles/screen-block-list.js +13 -4
- package/build/components/global-styles/screen-block-list.js.map +1 -1
- package/build/components/global-styles/screen-block.js +4 -3
- package/build/components/global-styles/screen-block.js.map +1 -1
- package/build/components/global-styles/screen-color-palette.js +4 -3
- package/build/components/global-styles/screen-color-palette.js.map +1 -1
- package/build/components/global-styles/screen-colors.js +19 -15
- package/build/components/global-styles/screen-colors.js.map +1 -1
- package/build/components/global-styles/screen-layout.js +8 -5
- package/build/components/global-styles/screen-layout.js.map +1 -1
- package/build/components/global-styles/screen-link-color.js +4 -3
- package/build/components/global-styles/screen-link-color.js.map +1 -1
- package/build/components/global-styles/screen-text-color.js +4 -3
- package/build/components/global-styles/screen-text-color.js.map +1 -1
- package/build/components/global-styles/screen-typography.js +4 -3
- package/build/components/global-styles/screen-typography.js.map +1 -1
- package/build/components/global-styles/subtitle.js +4 -3
- package/build/components/global-styles/subtitle.js.map +1 -1
- package/build/components/global-styles/typography-panel.js +10 -8
- package/build/components/global-styles/typography-panel.js.map +1 -1
- package/build/components/global-styles/ui.js +4 -3
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles/use-global-styles-output.js +61 -44
- package/build/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build/components/global-styles/utils.js +4 -3
- package/build/components/global-styles/utils.js.map +1 -1
- package/build/components/header/document-actions/index.js +23 -19
- package/build/components/header/document-actions/index.js.map +1 -1
- package/build/components/header/feature-toggle/index.js +9 -7
- package/build/components/header/feature-toggle/index.js.map +1 -1
- package/build/components/header/index.js +15 -15
- package/build/components/header/index.js.map +1 -1
- package/build/components/header/more-menu/index.js +30 -27
- package/build/components/header/more-menu/index.js.map +1 -1
- package/build/components/header/tools-more-menu-group/index.js +10 -7
- package/build/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build/components/keyboard-shortcuts/index.js +30 -3
- package/build/components/keyboard-shortcuts/index.js.map +1 -1
- package/build/components/list/header.js +50 -0
- package/build/components/list/header.js.map +1 -0
- package/build/components/list/index.js +87 -0
- package/build/components/list/index.js.map +1 -0
- package/build/components/list/table.js +127 -0
- package/build/components/list/table.js.map +1 -0
- package/build/components/list/use-register-shortcuts.js +52 -0
- package/build/components/list/use-register-shortcuts.js.map +1 -0
- package/build/components/main-dashboard-button/index.js +4 -3
- package/build/components/main-dashboard-button/index.js.map +1 -1
- package/build/components/navigate-to-link/index.js +7 -6
- package/build/components/navigate-to-link/index.js.map +1 -1
- package/build/components/navigation-sidebar/index.js +25 -10
- package/build/components/navigation-sidebar/index.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-panel/constants.js +1 -1
- package/build/components/navigation-sidebar/navigation-panel/content-navigation-item.js +4 -3
- package/build/components/navigation-sidebar/navigation-panel/content-navigation-item.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-panel/index.js +37 -55
- package/build/components/navigation-sidebar/navigation-panel/index.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-panel/menus/template-parts-sub.js +6 -5
- package/build/components/navigation-sidebar/navigation-panel/menus/template-parts-sub.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-panel/menus/template-parts.js +26 -20
- package/build/components/navigation-sidebar/navigation-panel/menus/template-parts.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-panel/menus/templates-sub.js +17 -10
- package/build/components/navigation-sidebar/navigation-panel/menus/templates-sub.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-panel/menus/templates.js +11 -5
- package/build/components/navigation-sidebar/navigation-panel/menus/templates.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-panel/navigation-entity-items.js +13 -11
- package/build/components/navigation-sidebar/navigation-panel/navigation-entity-items.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-panel/new-template-dropdown.js +24 -18
- package/build/components/navigation-sidebar/navigation-panel/new-template-dropdown.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-panel/search-results.js +14 -11
- package/build/components/navigation-sidebar/navigation-panel/search-results.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-panel/template-hierarchy.js +8 -5
- package/build/components/navigation-sidebar/navigation-panel/template-hierarchy.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-panel/template-navigation-item.js +4 -3
- package/build/components/navigation-sidebar/navigation-panel/template-navigation-item.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-panel/template-preview.js +5 -4
- package/build/components/navigation-sidebar/navigation-panel/template-preview.js.map +1 -1
- package/build/components/navigation-sidebar/navigation-toggle/index.js +7 -27
- package/build/components/navigation-sidebar/navigation-toggle/index.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/sidebar/constants.js +1 -1
- package/build/components/sidebar/default-sidebar.js +11 -10
- package/build/components/sidebar/default-sidebar.js.map +1 -1
- package/build/components/sidebar/plugin-sidebar/index.js +5 -4
- package/build/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build/components/sidebar/settings-header/index.js +4 -3
- package/build/components/sidebar/settings-header/index.js.map +1 -1
- package/build/components/sidebar/template-card/template-areas.js +17 -13
- package/build/components/sidebar/template-card/template-areas.js.map +1 -1
- package/build/components/template-details/index.js +14 -9
- package/build/components/template-details/index.js.map +1 -1
- package/build/components/template-details/template-areas.js +38 -29
- package/build/components/template-details/template-areas.js.map +1 -1
- package/build/components/template-part-converter/convert-to-regular.js +15 -11
- package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
- package/build/components/template-part-converter/convert-to-template-part.js +29 -86
- package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build/components/welcome-guide/editor.js +58 -0
- package/build/components/welcome-guide/editor.js.map +1 -0
- package/build/components/welcome-guide/image.js +27 -0
- package/build/components/welcome-guide/image.js.map +1 -0
- package/build/components/welcome-guide/index.js +49 -0
- package/build/components/welcome-guide/index.js.map +1 -0
- package/build/components/welcome-guide/styles.js +83 -0
- package/build/components/welcome-guide/styles.js.map +1 -0
- package/build/index.js +40 -16
- package/build/index.js.map +1 -1
- package/build/plugins/index.js +4 -2
- package/build/plugins/index.js.map +1 -1
- package/build/plugins/welcome-guide-menu-item.js +39 -0
- package/build/plugins/welcome-guide-menu-item.js.map +1 -0
- package/build/store/actions.js +24 -24
- package/build/store/actions.js.map +1 -1
- package/build/store/constants.js +1 -1
- package/build/store/defaults.js +4 -1
- package/build/store/defaults.js.map +1 -1
- package/build/store/index.js +5 -3
- package/build/store/index.js.map +1 -1
- package/build/store/reducer.js +36 -14
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +27 -19
- package/build/store/selectors.js.map +1 -1
- package/build/utils/is-template-removable.js +21 -0
- package/build/utils/is-template-removable.js.map +1 -0
- package/build-module/components/add-new-template/index.js +36 -0
- package/build-module/components/add-new-template/index.js.map +1 -0
- package/build-module/components/add-new-template/new-template-part.js +65 -0
- package/build-module/components/add-new-template/new-template-part.js.map +1 -0
- package/build-module/components/add-new-template/new-template.js +97 -0
- package/build-module/components/add-new-template/new-template.js.map +1 -0
- package/build-module/components/block-editor/block-inspector-button.js +4 -3
- package/build-module/components/block-editor/block-inspector-button.js.map +1 -1
- package/build-module/components/block-editor/index.js +12 -8
- package/build-module/components/block-editor/index.js.map +1 -1
- package/build-module/components/block-editor/resizable-editor.js +6 -5
- package/build-module/components/block-editor/resizable-editor.js.map +1 -1
- package/build-module/components/block-editor/resize-handle.js +6 -4
- package/build-module/components/block-editor/resize-handle.js.map +1 -1
- package/build-module/components/create-template-part-modal/index.js +102 -0
- package/build-module/components/create-template-part-modal/index.js.map +1 -0
- package/build-module/components/edit-template-part-menu-button/index.js +15 -11
- package/build-module/components/edit-template-part-menu-button/index.js.map +1 -1
- package/build-module/components/editor/index.js +24 -21
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/error-boundary/index.js +5 -4
- package/build-module/components/error-boundary/index.js.map +1 -1
- package/build-module/components/global-styles/border-panel.js +4 -3
- package/build-module/components/global-styles/border-panel.js.map +1 -1
- package/build-module/components/global-styles/color-palette-panel.js +33 -10
- package/build-module/components/global-styles/color-palette-panel.js.map +1 -1
- package/build-module/components/global-styles/context-menu.js +5 -4
- package/build-module/components/global-styles/context-menu.js.map +1 -1
- package/build-module/components/global-styles/dimensions-panel.js +4 -3
- package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
- package/build-module/components/global-styles/global-styles-provider.js +12 -42
- package/build-module/components/global-styles/global-styles-provider.js.map +1 -1
- package/build-module/components/global-styles/header.js +6 -5
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/hooks.js +32 -28
- package/build-module/components/global-styles/hooks.js.map +1 -1
- package/build-module/components/global-styles/navigation-button.js +8 -7
- package/build-module/components/global-styles/navigation-button.js.map +1 -1
- package/build-module/components/global-styles/palette.js +13 -9
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/screen-background-color.js +4 -3
- package/build-module/components/global-styles/screen-background-color.js.map +1 -1
- package/build-module/components/global-styles/screen-block-list.js +11 -4
- package/build-module/components/global-styles/screen-block-list.js.map +1 -1
- package/build-module/components/global-styles/screen-block.js +4 -3
- package/build-module/components/global-styles/screen-block.js.map +1 -1
- package/build-module/components/global-styles/screen-color-palette.js +4 -3
- package/build-module/components/global-styles/screen-color-palette.js.map +1 -1
- package/build-module/components/global-styles/screen-colors.js +19 -15
- package/build-module/components/global-styles/screen-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-layout.js +4 -3
- package/build-module/components/global-styles/screen-layout.js.map +1 -1
- package/build-module/components/global-styles/screen-link-color.js +4 -3
- package/build-module/components/global-styles/screen-link-color.js.map +1 -1
- package/build-module/components/global-styles/screen-text-color.js +4 -3
- package/build-module/components/global-styles/screen-text-color.js.map +1 -1
- package/build-module/components/global-styles/screen-typography.js +4 -3
- package/build-module/components/global-styles/screen-typography.js.map +1 -1
- package/build-module/components/global-styles/subtitle.js +4 -3
- package/build-module/components/global-styles/subtitle.js.map +1 -1
- package/build-module/components/global-styles/typography-panel.js +9 -7
- package/build-module/components/global-styles/typography-panel.js.map +1 -1
- package/build-module/components/global-styles/ui.js +4 -3
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles/use-global-styles-output.js +60 -43
- package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
- package/build-module/components/global-styles/utils.js +3 -2
- package/build-module/components/global-styles/utils.js.map +1 -1
- package/build-module/components/header/document-actions/index.js +23 -19
- package/build-module/components/header/document-actions/index.js.map +1 -1
- package/build-module/components/header/feature-toggle/index.js +9 -7
- package/build-module/components/header/feature-toggle/index.js.map +1 -1
- package/build-module/components/header/index.js +15 -13
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/header/more-menu/index.js +30 -27
- package/build-module/components/header/more-menu/index.js.map +1 -1
- package/build-module/components/header/tools-more-menu-group/index.js +10 -7
- package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
- package/build-module/components/keyboard-shortcuts/index.js +30 -3
- package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
- package/build-module/components/list/header.js +37 -0
- package/build-module/components/list/header.js.map +1 -0
- package/build-module/components/list/index.js +69 -0
- package/build-module/components/list/index.js.map +1 -0
- package/build-module/components/list/table.js +111 -0
- package/build-module/components/list/table.js.map +1 -0
- package/build-module/components/list/use-register-shortcuts.js +41 -0
- package/build-module/components/list/use-register-shortcuts.js.map +1 -0
- package/build-module/components/main-dashboard-button/index.js +4 -3
- package/build-module/components/main-dashboard-button/index.js.map +1 -1
- package/build-module/components/navigate-to-link/index.js +7 -6
- package/build-module/components/navigate-to-link/index.js.map +1 -1
- package/build-module/components/navigation-sidebar/index.js +25 -8
- package/build-module/components/navigation-sidebar/index.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-panel/content-navigation-item.js +4 -3
- package/build-module/components/navigation-sidebar/navigation-panel/content-navigation-item.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-panel/index.js +39 -55
- package/build-module/components/navigation-sidebar/navigation-panel/index.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-panel/menus/template-parts-sub.js +6 -5
- package/build-module/components/navigation-sidebar/navigation-panel/menus/template-parts-sub.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-panel/menus/template-parts.js +26 -20
- package/build-module/components/navigation-sidebar/navigation-panel/menus/template-parts.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-panel/menus/templates-sub.js +17 -10
- package/build-module/components/navigation-sidebar/navigation-panel/menus/templates-sub.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-panel/menus/templates.js +11 -5
- package/build-module/components/navigation-sidebar/navigation-panel/menus/templates.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-panel/navigation-entity-items.js +13 -11
- package/build-module/components/navigation-sidebar/navigation-panel/navigation-entity-items.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-panel/new-template-dropdown.js +24 -18
- package/build-module/components/navigation-sidebar/navigation-panel/new-template-dropdown.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-panel/search-results.js +14 -11
- package/build-module/components/navigation-sidebar/navigation-panel/search-results.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-panel/template-hierarchy.js +6 -3
- package/build-module/components/navigation-sidebar/navigation-panel/template-hierarchy.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-panel/template-navigation-item.js +4 -3
- package/build-module/components/navigation-sidebar/navigation-panel/template-navigation-item.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-panel/template-preview.js +5 -4
- package/build-module/components/navigation-sidebar/navigation-panel/template-preview.js.map +1 -1
- package/build-module/components/navigation-sidebar/navigation-toggle/index.js +8 -27
- package/build-module/components/navigation-sidebar/navigation-toggle/index.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/sidebar/default-sidebar.js +11 -10
- package/build-module/components/sidebar/default-sidebar.js.map +1 -1
- package/build-module/components/sidebar/plugin-sidebar/index.js +5 -4
- package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
- package/build-module/components/sidebar/settings-header/index.js +4 -3
- package/build-module/components/sidebar/settings-header/index.js.map +1 -1
- package/build-module/components/sidebar/template-card/template-areas.js +17 -13
- package/build-module/components/sidebar/template-card/template-areas.js.map +1 -1
- package/build-module/components/template-details/index.js +14 -9
- package/build-module/components/template-details/index.js.map +1 -1
- package/build-module/components/template-details/template-areas.js +38 -29
- package/build-module/components/template-details/template-areas.js.map +1 -1
- package/build-module/components/template-part-converter/convert-to-regular.js +15 -11
- 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 +29 -86
- package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
- package/build-module/components/welcome-guide/editor.js +45 -0
- package/build-module/components/welcome-guide/editor.js.map +1 -0
- package/build-module/components/welcome-guide/image.js +19 -0
- package/build-module/components/welcome-guide/image.js.map +1 -0
- package/build-module/components/welcome-guide/index.js +35 -0
- package/build-module/components/welcome-guide/index.js.map +1 -0
- package/build-module/components/welcome-guide/styles.js +69 -0
- package/build-module/components/welcome-guide/styles.js.map +1 -0
- package/build-module/index.js +21 -1
- package/build-module/index.js.map +1 -1
- package/build-module/plugins/index.js +3 -2
- package/build-module/plugins/index.js.map +1 -1
- package/build-module/plugins/welcome-guide-menu-item.js +27 -0
- package/build-module/plugins/welcome-guide-menu-item.js.map +1 -0
- package/build-module/store/actions.js +11 -11
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/defaults.js +4 -1
- package/build-module/store/defaults.js.map +1 -1
- package/build-module/store/reducer.js +31 -10
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +17 -10
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/utils/is-template-removable.js +14 -0
- package/build-module/utils/is-template-removable.js.map +1 -0
- package/build-style/style-rtl.css +348 -32
- package/build-style/style.css +348 -32
- package/package.json +27 -27
- package/src/components/add-new-template/index.js +30 -0
- package/src/components/add-new-template/new-template-part.js +66 -0
- package/src/components/add-new-template/new-template.js +116 -0
- package/src/components/add-new-template/style.scss +11 -0
- package/src/components/create-template-part-modal/index.js +132 -0
- package/src/components/{template-part-converter → create-template-part-modal}/style.scss +9 -9
- package/src/components/editor/index.js +22 -15
- package/src/components/editor/style.scss +8 -0
- package/src/components/global-styles/color-palette-panel.js +64 -7
- package/src/components/global-styles/global-styles-provider.js +7 -36
- package/src/components/global-styles/hooks.js +58 -26
- package/src/components/global-styles/screen-block-list.js +11 -1
- package/src/components/global-styles/test/use-global-styles-output.js +2 -2
- package/src/components/global-styles/use-global-styles-output.js +2 -2
- package/src/components/global-styles/utils.js +1 -1
- package/src/components/header/index.js +0 -6
- package/src/components/keyboard-shortcuts/index.js +32 -0
- package/src/components/list/header.js +34 -0
- package/src/components/list/index.js +80 -0
- package/src/components/list/style.scss +113 -0
- package/src/components/list/table.js +132 -0
- package/src/components/list/use-register-shortcuts.js +45 -0
- package/src/components/navigation-sidebar/index.js +31 -8
- package/src/components/navigation-sidebar/navigation-panel/index.js +45 -55
- package/src/components/navigation-sidebar/navigation-panel/style.scss +4 -2
- package/src/components/navigation-sidebar/navigation-toggle/index.js +4 -28
- package/src/components/template-details/index.js +3 -2
- package/src/components/template-part-converter/convert-to-template-part.js +20 -140
- package/src/components/welcome-guide/editor.js +63 -0
- package/src/components/welcome-guide/image.js +11 -0
- package/src/components/welcome-guide/index.js +33 -0
- package/src/components/welcome-guide/style.scss +37 -0
- package/src/components/welcome-guide/styles.js +116 -0
- package/src/index.js +21 -1
- package/src/plugins/index.js +3 -1
- package/src/plugins/welcome-guide-menu-item.js +35 -0
- package/src/store/actions.js +11 -9
- package/src/store/defaults.js +4 -1
- package/src/store/test/actions.js +14 -20
- package/src/style.scss +9 -6
- package/src/utils/is-template-removable.js +13 -0
- package/build/components/header/navigation-link/index.js +0 -86
- package/build/components/header/navigation-link/index.js.map +0 -1
- package/build-module/components/header/navigation-link/index.js +0 -73
- package/build-module/components/header/navigation-link/index.js.map +0 -1
- package/src/components/header/navigation-link/index.js +0 -71
- package/src/components/header/navigation-link/style.scss +0 -69
package/build-module/components/navigation-sidebar/navigation-panel/navigation-entity-items.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/navigation-entity-items.js"],"names":["useDispatch","useSelect","__experimentalNavigationItem","NavigationItem","getPathAndQueryString","store","coreStore","editSiteStore","getEntityTitle","kind","entity","name","title","rendered","NavigationEntityItems","query","entities","select","getEntityRecords","setPage","onActivateItem","type","slug","link","id","path","context","postType","postId","map","key"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,4BAA4B,IAAIC,cAAzC,QAA+D,uBAA/D;AACA,SAASC,qBAAT,QAAsC,gBAAtC;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,SAASD,KAAK,IAAIE,aAAlB,QAAuC,gBAAvC;;AAEA,MAAMC,cAAc,GAAG,CAAEC,IAAF,EAAQC,MAAR;AAAA;;AAAA,SACtB,eAAeD,IAAf,GAAsBC,MAAM,CAACC,IAA7B,GAAoCD,MAApC,aAAoCA,MAApC,wCAAoCA,MAAM,CAAEE,KAA5C,kDAAoC,cAAeC,QAD7B;AAAA,CAAvB;;AAGA,eAAe,SAASC,qBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/navigation-entity-items.js"],"names":["useDispatch","useSelect","__experimentalNavigationItem","NavigationItem","getPathAndQueryString","store","coreStore","editSiteStore","getEntityTitle","kind","entity","name","title","rendered","NavigationEntityItems","query","entities","select","getEntityRecords","setPage","onActivateItem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,MAAAA,OAAO,EAAE;AACRC,QAAAA,QAAQ,EAAEN,IADF;AAERO,QAAAA,MAAM,EAAEJ;AAFA;AAJD,KAAF,CAAP;AASA,GAVD;;AAYA,SAAOR,QAAQ,CAACa,GAAT,CAAgBnB,MAAF,IAAc;AAClC,UAAMoB,GAAG,GAAI,WAAW1B,qBAAqB,CAAEM,MAAM,CAACa,IAAT,CAAiB,EAA9D;AAEA,WACC,cAAC,cAAD;AACC,MAAA,GAAG,EAAGO,GADP;AAEC,MAAA,IAAI,EAAGA,GAFR;AAGC,MAAA,KAAK,EAAGtB,cAAc,CAAEC,IAAF,EAAQC,MAAR,CAHvB;AAIC,MAAA,OAAO,EAAG,MAAMU,cAAc,CAAEV,MAAF;AAJ/B,MADD;AAQA,GAXM,CAAP;AAYA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __experimentalNavigationItem as NavigationItem } from '@wordpress/components';\nimport { getPathAndQueryString } from '@wordpress/url';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../../store';\n\nconst getEntityTitle = ( kind, entity ) =>\n\t'taxonomy' === kind ? entity.name : entity?.title?.rendered;\n\nexport default function NavigationEntityItems( { kind, name, query = {} } ) {\n\tconst entities = useSelect(\n\t\t( select ) => select( coreStore ).getEntityRecords( kind, name, query ),\n\t\t[ kind, name, query ]\n\t);\n\n\tconst { setPage } = useDispatch( editSiteStore );\n\n\tif ( ! entities ) {\n\t\treturn null;\n\t}\n\n\tconst onActivateItem = ( { type, slug, link, id } ) => {\n\t\tsetPage( {\n\t\t\ttype,\n\t\t\tslug,\n\t\t\tpath: getPathAndQueryString( link ),\n\t\t\tcontext: {\n\t\t\t\tpostType: type,\n\t\t\t\tpostId: id,\n\t\t\t},\n\t\t} );\n\t};\n\n\treturn entities.map( ( entity ) => {\n\t\tconst key = `content-${ getPathAndQueryString( entity.link ) }`;\n\n\t\treturn (\n\t\t\t<NavigationItem\n\t\t\t\tkey={ key }\n\t\t\t\titem={ key }\n\t\t\t\ttitle={ getEntityTitle( kind, entity ) }\n\t\t\t\tonClick={ () => onActivateItem( entity ) }\n\t\t\t/>\n\t\t);\n\t} );\n}\n"]}
|
package/build-module/components/navigation-sidebar/navigation-panel/new-template-dropdown.js
CHANGED
|
@@ -78,23 +78,29 @@ export default function NewTemplateDropdown() {
|
|
|
78
78
|
isSmall: true,
|
|
79
79
|
variant: 'tertiary'
|
|
80
80
|
}
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
81
|
+
}, _ref => {
|
|
82
|
+
let {
|
|
83
|
+
onClose
|
|
84
|
+
} = _ref;
|
|
85
|
+
return createElement(NavigableMenu, {
|
|
86
|
+
className: "edit-site-navigation-panel__new-template-popover"
|
|
87
|
+
}, createElement(MenuGroup, {
|
|
88
|
+
label: __('Add Template')
|
|
89
|
+
}, map(missingTemplates, _ref2 => {
|
|
90
|
+
let {
|
|
91
|
+
title,
|
|
92
|
+
description,
|
|
93
|
+
slug
|
|
94
|
+
} = _ref2;
|
|
95
|
+
return createElement(MenuItem, {
|
|
96
|
+
info: description,
|
|
97
|
+
key: slug,
|
|
98
|
+
onClick: () => {
|
|
99
|
+
createTemplate(slug);
|
|
100
|
+
onClose();
|
|
101
|
+
}
|
|
102
|
+
}, title);
|
|
103
|
+
})));
|
|
104
|
+
});
|
|
99
105
|
}
|
|
100
106
|
//# sourceMappingURL=new-template-dropdown.js.map
|
package/build-module/components/navigation-sidebar/navigation-panel/new-template-dropdown.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/new-template-dropdown.js"],"names":["filter","find","includes","map","DropdownMenu","MenuGroup","MenuItem","NavigableMenu","useDispatch","useSelect","__","Icon","plus","store","editorStore","coreStore","getClosestAvailableTemplate","TEMPLATES_NEW_OPTIONS","editSiteStore","NewTemplateDropdown","defaultTemplateTypes","templates","select","__experimentalGetDefaultTemplateTypes","getDefaultTemplateTypes","templateEntities","getEntityRecords","addTemplate","createTemplate","slug","closestAvailableTemplate","title","description","content","raw","excerpt","toString","status","existingTemplateSlugs","missingTemplates","template","length","noArrow","children","isSmall","variant","onClose"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,EAAiBC,IAAjB,EAAuBC,QAAvB,EAAiCC,GAAjC,QAA4C,QAA5C;AAEA;AACA;AACA;;AACA,SACCC,YADD,EAECC,SAFD,EAGCC,QAHD,EAICC,aAJD,QAKO,uBALP;AAMA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,IAAT,EAAeC,IAAf,QAA2B,kBAA3B;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SAASD,KAAK,IAAIE,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,OAAOC,2BAAP,MAAwC,+CAAxC;AACA,SAASC,qBAAT,QAAsC,aAAtC;AACA,SAASJ,KAAK,IAAIK,aAAlB,QAAuC,gBAAvC;AAEA,eAAe,SAASC,mBAAT,GAA+B;AAC7C,QAAM;AAAEC,IAAAA,oBAAF;AAAwBC,IAAAA;AAAxB,MAAsCZ,SAAS,CAAIa,MAAF,IAAc;AACpE,UAAM;AACLC,MAAAA,qCAAqC,EAAEC;AADlC,QAEFF,MAAM,CAAER,WAAF,CAFV;AAGA,UAAMW,gBAAgB,GAAGH,MAAM,CAAEP,SAAF,CAAN,CAAoBW,gBAApB,CACxB,UADwB,EAExB,aAFwB,CAAzB;AAIA,WAAO;AACNN,MAAAA,oBAAoB,EAAEI,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C,MAAAA,QAAQ,EAAE,cAAC,IAAD;AAAM,QAAA,IAAI,EAAG/B;AAAb,QADG;AAEbgC,MAAAA,OAAO,EAAE,IAFI;AAGbC,MAAAA,OAAO,EAAE;AAHI;AAPf,KAaG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/new-template-dropdown.js"],"names":["filter","find","includes","map","DropdownMenu","MenuGroup","MenuItem","NavigableMenu","useDispatch","useSelect","__","Icon","plus","store","editorStore","coreStore","getClosestAvailableTemplate","TEMPLATES_NEW_OPTIONS","editSiteStore","NewTemplateDropdown","defaultTemplateTypes","templates","select","__experimentalGetDefaultTemplateTypes","getDefaultTemplateTypes","templateEntities","getEntityRecords","addTemplate","createTemplate","slug","closestAvailableTemplate","title","description","content","raw","excerpt","toString","status","existingTemplateSlugs","missingTemplates","template","length","noArrow","children","isSmall","variant","onClose"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,EAAiBC,IAAjB,EAAuBC,QAAvB,EAAiCC,GAAjC,QAA4C,QAA5C;AAEA;AACA;AACA;;AACA,SACCC,YADD,EAECC,SAFD,EAGCC,QAHD,EAICC,aAJD,QAKO,uBALP;AAMA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,IAAT,EAAeC,IAAf,QAA2B,kBAA3B;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SAASD,KAAK,IAAIE,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,OAAOC,2BAAP,MAAwC,+CAAxC;AACA,SAASC,qBAAT,QAAsC,aAAtC;AACA,SAASJ,KAAK,IAAIK,aAAlB,QAAuC,gBAAvC;AAEA,eAAe,SAASC,mBAAT,GAA+B;AAC7C,QAAM;AAAEC,IAAAA,oBAAF;AAAwBC,IAAAA;AAAxB,MAAsCZ,SAAS,CAAIa,MAAF,IAAc;AACpE,UAAM;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AC,YAAD;AACC,IAAA,SAAS,EAAC,mDADX;AAEC,IAAA,IAAI,EAAG,IAFR;AAGC,IAAA,KAAK,EAAG/B,EAAE,CAAE,cAAF,CAHX;AAIC,IAAA,YAAY,EAAG;AACdgC,MAAAA,OAAO,EAAE;AADK,KAJhB;AAOC,IAAA,WAAW,EAAG;AACbC,MAAAA,QAAQ,EAAE,cAAC,IAAD;AAAM,QAAA,IAAI,EAAG/B;AAAb,QADG;AAEbgC,MAAAA,OAAO,EAAE,IAFI;AAGbC,MAAAA,OAAO,EAAE;AAHI;AAPf,KAaG;AAAA,QAAE;AAAEC,MAAAA;AAAF,KAAF;AAAA,WACD,cAAC,aAAD;AAAe,MAAA,SAAS,EAAC;AAAzB,OACC,cAAC,SAAD;AAAW,MAAA,KAAK,EAAGpC,EAAE,CAAE,cAAF;AAArB,OACGP,GAAG,CACJoC,gBADI,EAEJ;AAAA,UAAE;AAAER,QAAAA,KAAF;AAASC,QAAAA,WAAT;AAAsBH,QAAAA;AAAtB,OAAF;AAAA,aACC,cAAC,QAAD;AACC,QAAA,IAAI,EAAGG,WADR;AAEC,QAAA,GAAG,EAAGH,IAFP;AAGC,QAAA,OAAO,EAAG,MAAM;AACfD,UAAAA,cAAc,CAAEC,IAAF,CAAd;AACAiB,UAAAA,OAAO;AACP;AANF,SAQGf,KARH,CADD;AAAA,KAFI,CADN,CADD,CADC;AAAA,GAbH,CADD;AAqCA","sourcesContent":["/**\n * External dependencies\n */\nimport { filter, find, includes, map } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tDropdownMenu,\n\tMenuGroup,\n\tMenuItem,\n\tNavigableMenu,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { Icon, plus } from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport getClosestAvailableTemplate from '../../../utils/get-closest-available-template';\nimport { TEMPLATES_NEW_OPTIONS } from './constants';\nimport { store as editSiteStore } from '../../../store';\n\nexport default function NewTemplateDropdown() {\n\tconst { defaultTemplateTypes, templates } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\t__experimentalGetDefaultTemplateTypes: getDefaultTemplateTypes,\n\t\t} = select( editorStore );\n\t\tconst templateEntities = select( coreStore ).getEntityRecords(\n\t\t\t'postType',\n\t\t\t'wp_template'\n\t\t);\n\t\treturn {\n\t\t\tdefaultTemplateTypes: getDefaultTemplateTypes(),\n\t\t\ttemplates: templateEntities,\n\t\t};\n\t}, [] );\n\tconst { addTemplate } = useDispatch( editSiteStore );\n\n\tconst createTemplate = ( slug ) => {\n\t\tconst closestAvailableTemplate = getClosestAvailableTemplate(\n\t\t\tslug,\n\t\t\ttemplates\n\t\t);\n\t\tconst { title, description } = find( defaultTemplateTypes, { slug } );\n\t\taddTemplate( {\n\t\t\tcontent: closestAvailableTemplate.content.raw,\n\t\t\texcerpt: description,\n\t\t\t// Slugs need to be strings, so this is for template `404`\n\t\t\tslug: slug.toString(),\n\t\t\tstatus: 'publish',\n\t\t\ttitle,\n\t\t} );\n\t};\n\n\tconst existingTemplateSlugs = map( templates, 'slug' );\n\n\tconst missingTemplates = filter(\n\t\tdefaultTemplateTypes,\n\t\t( template ) =>\n\t\t\tincludes( TEMPLATES_NEW_OPTIONS, template.slug ) &&\n\t\t\t! includes( existingTemplateSlugs, template.slug )\n\t);\n\n\tif ( ! missingTemplates.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<DropdownMenu\n\t\t\tclassName=\"edit-site-navigation-panel__new-template-dropdown\"\n\t\t\ticon={ null }\n\t\t\tlabel={ __( 'Add Template' ) }\n\t\t\tpopoverProps={ {\n\t\t\t\tnoArrow: false,\n\t\t\t} }\n\t\t\ttoggleProps={ {\n\t\t\t\tchildren: <Icon icon={ plus } />,\n\t\t\t\tisSmall: true,\n\t\t\t\tvariant: 'tertiary',\n\t\t\t} }\n\t\t>\n\t\t\t{ ( { onClose } ) => (\n\t\t\t\t<NavigableMenu className=\"edit-site-navigation-panel__new-template-popover\">\n\t\t\t\t\t<MenuGroup label={ __( 'Add Template' ) }>\n\t\t\t\t\t\t{ map(\n\t\t\t\t\t\t\tmissingTemplates,\n\t\t\t\t\t\t\t( { title, description, slug } ) => (\n\t\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\t\tinfo={ description }\n\t\t\t\t\t\t\t\t\tkey={ slug }\n\t\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\t\tcreateTemplate( slug );\n\t\t\t\t\t\t\t\t\t\tonClose();\n\t\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) }\n\t\t\t\t\t</MenuGroup>\n\t\t\t\t</NavigableMenu>\n\t\t\t) }\n\t\t</DropdownMenu>\n\t);\n}\n"]}
|
|
@@ -20,11 +20,12 @@ import { useSelect } from '@wordpress/data';
|
|
|
20
20
|
import { store as editorStore } from '@wordpress/editor';
|
|
21
21
|
import TemplateNavigationItem from './template-navigation-item';
|
|
22
22
|
import ContentNavigationItem from './content-navigation-item';
|
|
23
|
-
export default function SearchResults({
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
export default function SearchResults(_ref) {
|
|
24
|
+
let {
|
|
25
|
+
items,
|
|
26
|
+
search,
|
|
27
|
+
disableFilter
|
|
28
|
+
} = _ref;
|
|
28
29
|
let itemType = null;
|
|
29
30
|
|
|
30
31
|
if ((items === null || items === void 0 ? void 0 : items.length) > 0) {
|
|
@@ -78,9 +79,10 @@ export default function SearchResults({
|
|
|
78
79
|
return items;
|
|
79
80
|
}
|
|
80
81
|
|
|
81
|
-
return items.filter(
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
return items.filter(_ref2 => {
|
|
83
|
+
let {
|
|
84
|
+
slug
|
|
85
|
+
} = _ref2;
|
|
84
86
|
const {
|
|
85
87
|
title,
|
|
86
88
|
description
|
|
@@ -93,9 +95,10 @@ export default function SearchResults({
|
|
|
93
95
|
return [];
|
|
94
96
|
}
|
|
95
97
|
|
|
96
|
-
return sortBy(itemsFiltered, [
|
|
97
|
-
|
|
98
|
-
|
|
98
|
+
return sortBy(itemsFiltered, [_ref3 => {
|
|
99
|
+
let {
|
|
100
|
+
slug
|
|
101
|
+
} = _ref3;
|
|
99
102
|
const {
|
|
100
103
|
title
|
|
101
104
|
} = itemInfosMap[slug];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/search-results.js"],"names":["map","sortBy","keyBy","useMemo","__experimentalNavigationGroup","NavigationGroup","__","normalizedSearch","useSelect","store","editorStore","TemplateNavigationItem","ContentNavigationItem","SearchResults","items","search","disableFilter","itemType","length","taxonomy","type","itemInfos","select","__experimentalGetTemplateInfo","getTemplateInfo","item","slug","title","name","description","rendered","excerpt","itemInfosMap","itemsFiltered","filter","itemsSorted","ItemComponent","id"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,GAAT,EAAcC,MAAd,EAAsBC,KAAtB,QAAmC,QAAnC;AAEA;AACA;AACA;;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,6BAA6B,IAAIC,eAA1C,QAAiE,uBAAjE;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,SAASC,gBAAT,QAAiC,SAAjC;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,OAAOC,sBAAP,MAAmC,4BAAnC;AACA,OAAOC,qBAAP,MAAkC,2BAAlC;AAEA,eAAe,SAASC,aAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/search-results.js"],"names":["map","sortBy","keyBy","useMemo","__experimentalNavigationGroup","NavigationGroup","__","normalizedSearch","useSelect","store","editorStore","TemplateNavigationItem","ContentNavigationItem","SearchResults","items","search","disableFilter","itemType","length","taxonomy","type","itemInfos","select","__experimentalGetTemplateInfo","getTemplateInfo","item","slug","title","name","description","rendered","excerpt","itemInfosMap","itemsFiltered","filter","itemsSorted","ItemComponent","id"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,GAAT,EAAcC,MAAd,EAAsBC,KAAtB,QAAmC,QAAnC;AAEA;AACA;AACA;;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,6BAA6B,IAAIC,eAA1C,QAAiE,uBAAjE;AACA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,SAASC,gBAAT,QAAiC,SAAjC;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,OAAOC,sBAAP,MAAmC,4BAAnC;AACA,OAAOC,qBAAP,MAAkC,2BAAlC;AAEA,eAAe,SAASC,aAAT,OAA2D;AAAA,MAAnC;AAAEC,IAAAA,KAAF;AAASC,IAAAA,MAAT;AAAiBC,IAAAA;AAAjB,GAAmC;AACzE,MAAIC,QAAQ,GAAG,IAAf;;AACA,MAAK,CAAAH,KAAK,SAAL,IAAAA,KAAK,WAAL,YAAAA,KAAK,CAAEI,MAAP,IAAgB,CAArB,EAAyB;AACxB,QAAKJ,KAAK,CAAE,CAAF,CAAL,CAAWK,QAAhB,EAA2B;AAC1BF,MAAAA,QAAQ,GAAG,UAAX;AACA,KAFD,MAEO;AACNA,MAAAA,QAAQ,GAAGH,KAAK,CAAE,CAAF,CAAL,CAAWM,IAAtB;AACA;AACD;;AAED,QAAMC,SAAS,GAAGb,SAAS,CACxBc,MAAF,IAAc;AACb,QAAKL,QAAQ,KAAK,IAAb,IAAqBH,KAAK,KAAK,IAApC,EAA2C;AAC1C,aAAO,EAAP;AACA;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port { map, sortBy, keyBy } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo } from '@wordpress/element';\nimport { __experimentalNavigationGroup as NavigationGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { normalizedSearch } from './utils';\nimport { useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\nimport TemplateNavigationItem from './template-navigation-item';\nimport ContentNavigationItem from './content-navigation-item';\n\nexport default function SearchResults( { items, search, disableFilter } ) {\n\tlet itemType = null;\n\tif ( items?.length > 0 ) {\n\t\tif ( items[ 0 ].taxonomy ) {\n\t\t\titemType = 'taxonomy';\n\t\t} else {\n\t\t\titemType = items[ 0 ].type;\n\t\t}\n\t}\n\n\tconst itemInfos = useSelect(\n\t\t( select ) => {\n\t\t\tif ( itemType === null || items === null ) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\tif ( itemType === 'wp_template' ) {\n\t\t\t\tconst {\n\t\t\t\t\t__experimentalGetTemplateInfo: getTemplateInfo,\n\t\t\t\t} = select( editorStore );\n\n\t\t\t\treturn items.map( ( item ) => ( {\n\t\t\t\t\tslug: item.slug,\n\t\t\t\t\t...getTemplateInfo( item ),\n\t\t\t\t} ) );\n\t\t\t}\n\n\t\t\tif ( itemType === 'taxonomy' ) {\n\t\t\t\treturn items.map( ( item ) => ( {\n\t\t\t\t\tslug: item.slug,\n\t\t\t\t\ttitle: item.name,\n\t\t\t\t\tdescription: item.description,\n\t\t\t\t} ) );\n\t\t\t}\n\n\t\t\treturn items.map( ( item ) => ( {\n\t\t\t\tslug: item.slug,\n\t\t\t\ttitle: item.title?.rendered,\n\t\t\t\tdescription: item.excerpt?.rendered,\n\t\t\t} ) );\n\t\t},\n\t\t[ items, itemType ]\n\t);\n\tconst itemInfosMap = useMemo( () => keyBy( itemInfos, 'slug' ), [\n\t\titemInfos,\n\t] );\n\n\tconst itemsFiltered = useMemo( () => {\n\t\tif ( items === null || search.length === 0 ) {\n\t\t\treturn [];\n\t\t}\n\n\t\tif ( disableFilter ) {\n\t\t\treturn items;\n\t\t}\n\n\t\treturn items.filter( ( { slug } ) => {\n\t\t\tconst { title, description } = itemInfosMap[ slug ];\n\n\t\t\treturn (\n\t\t\t\tnormalizedSearch( slug, search ) ||\n\t\t\t\tnormalizedSearch( title, search ) ||\n\t\t\t\tnormalizedSearch( description, search )\n\t\t\t);\n\t\t} );\n\t}, [ items, itemInfos, search ] );\n\n\tconst itemsSorted = useMemo( () => {\n\t\tif ( ! itemsFiltered ) {\n\t\t\treturn [];\n\t\t}\n\n\t\treturn sortBy( itemsFiltered, [\n\t\t\t( { slug } ) => {\n\t\t\t\tconst { title } = itemInfosMap[ slug ];\n\t\t\t\treturn ! normalizedSearch( title, search );\n\t\t\t},\n\t\t] );\n\t}, [ itemsFiltered, search ] );\n\n\tconst ItemComponent =\n\t\titemType === 'wp_template' || itemType === 'wp_template_part'\n\t\t\t? TemplateNavigationItem\n\t\t\t: ContentNavigationItem;\n\n\treturn (\n\t\t<NavigationGroup title={ __( 'Search results' ) }>\n\t\t\t{ map( itemsSorted, ( item ) => (\n\t\t\t\t<ItemComponent\n\t\t\t\t\titem={ item }\n\t\t\t\t\tkey={ `${ item.taxonomy || item.type }-${ item.id }` }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</NavigationGroup>\n\t);\n}\n"]}
|
|
@@ -49,9 +49,12 @@ export function getTemplateLocation(slug) {
|
|
|
49
49
|
}
|
|
50
50
|
export function getUnusedTemplates(templates, showOnFront) {
|
|
51
51
|
const templateSlugs = map(templates, 'slug');
|
|
52
|
-
const supersededTemplates = templates.filter(
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
const supersededTemplates = templates.filter(_ref => {
|
|
53
|
+
let {
|
|
54
|
+
slug
|
|
55
|
+
} = _ref;
|
|
56
|
+
return isTemplateSuperseded(slug, templateSlugs, showOnFront);
|
|
57
|
+
});
|
|
55
58
|
return supersededTemplates;
|
|
56
59
|
}
|
|
57
60
|
export function getTemplatesLocationMap(templates) {
|
package/build-module/components/navigation-sidebar/navigation-panel/template-hierarchy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/template-hierarchy.js"],"names":["map","MENU_TEMPLATES","MENU_TEMPLATES_GENERAL","MENU_TEMPLATES_PAGES","MENU_TEMPLATES_POSTS","TEMPLATE_OVERRIDES","TEMPLATES_GENERAL","TEMPLATES_PAGES_PREFIXES","TEMPLATES_POSTS_PREFIXES","TEMPLATES_TOP_LEVEL","isTemplateSuperseded","slug","existingSlugs","showOnFront","every","overrideSlug","includes","getTemplateLocation","isTopLevelTemplate","isGeneralTemplate","isPostsTemplate","some","prefix","startsWith","isPagesTemplate","getUnusedTemplates","templates","templateSlugs","supersededTemplates","filter","getTemplatesLocationMap","reduce","obj","template"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,QAApB;AAEA;AACA;AACA;;AACA,SACCC,cADD,EAECC,sBAFD,EAGCC,oBAHD,EAICC,oBAJD,EAKCC,kBALD,EAMCC,iBAND,EAOCC,wBAPD,EAQCC,wBARD,EASCC,mBATD,QAUO,aAVP;AAYA,OAAO,SAASC,oBAAT,CAA+BC,IAA/B,EAAqCC,aAArC,EAAoDC,WAApD,EAAkE;AACxE,MAAK,CAAER,kBAAkB,CAAEM,IAAF,CAAzB,EAAoC;AACnC,WAAO,KAAP;AACA,GAHuE,CAKxE;AACA;;;AACA,MAAKA,IAAI,KAAK,MAAT,IAAmBE,WAAW,KAAK,OAAxC,EAAkD;AACjD,WAAO,IAAP;AACA;;AAED,SAAOR,kBAAkB,CAAEM,IAAF,CAAlB,CAA2BG,KAA3B,CACJC,YAAF,IACCH,aAAa,CAACI,QAAd,CAAwBD,YAAxB,KACAL,oBAAoB,CAAEK,YAAF,EAAgBH,aAAhB,EAA+BC,WAA/B,CAHf,CAAP;AAKA;AAED,OAAO,SAASI,mBAAT,CAA8BN,IAA9B,EAAqC;AAC3C,QAAMO,kBAAkB,GAAGT,mBAAmB,CAACO,QAApB,CAA8BL,IAA9B,CAA3B;;AACA,MAAKO,kBAAL,EAA0B;AACzB,WAAOjB,cAAP;AACA;;AAED,QAAMkB,iBAAiB,GAAGb,iBAAiB,CAACU,QAAlB,CAA4BL,IAA5B,CAA1B;;AACA,MAAKQ,iBAAL,EAAyB;AACxB,WAAOjB,sBAAP;AACA;;AAED,QAAMkB,eAAe,GAAGZ,wBAAwB,CAACa,IAAzB,CAAiCC,MAAF,IACtDX,IAAI,CAACY,UAAL,CAAiBD,MAAjB,CADuB,CAAxB;;AAGA,MAAKF,eAAL,EAAuB;AACtB,WAAOhB,oBAAP;AACA;;AAED,QAAMoB,eAAe,GAAGjB,wBAAwB,CAACc,IAAzB,CAAiCC,MAAF,IACtDX,IAAI,CAACY,UAAL,CAAiBD,MAAjB,CADuB,CAAxB;;AAGA,MAAKE,eAAL,EAAuB;AACtB,WAAOrB,oBAAP;AACA;;AAED,SAAOD,sBAAP;AACA;AAED,OAAO,SAASuB,kBAAT,CAA6BC,SAA7B,EAAwCb,WAAxC,EAAsD;AAC5D,QAAMc,aAAa,GAAG3B,GAAG,CAAE0B,SAAF,EAAa,MAAb,CAAzB;AACA,QAAME,mBAAmB,GAAGF,SAAS,CAACG,MAAV,CAAkB,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/template-hierarchy.js"],"names":["map","MENU_TEMPLATES","MENU_TEMPLATES_GENERAL","MENU_TEMPLATES_PAGES","MENU_TEMPLATES_POSTS","TEMPLATE_OVERRIDES","TEMPLATES_GENERAL","TEMPLATES_PAGES_PREFIXES","TEMPLATES_POSTS_PREFIXES","TEMPLATES_TOP_LEVEL","isTemplateSuperseded","slug","existingSlugs","showOnFront","every","overrideSlug","includes","getTemplateLocation","isTopLevelTemplate","isGeneralTemplate","isPostsTemplate","some","prefix","startsWith","isPagesTemplate","getUnusedTemplates","templates","templateSlugs","supersededTemplates","filter","getTemplatesLocationMap","reduce","obj","template"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,GAAT,QAAoB,QAApB;AAEA;AACA;AACA;;AACA,SACCC,cADD,EAECC,sBAFD,EAGCC,oBAHD,EAICC,oBAJD,EAKCC,kBALD,EAMCC,iBAND,EAOCC,wBAPD,EAQCC,wBARD,EASCC,mBATD,QAUO,aAVP;AAYA,OAAO,SAASC,oBAAT,CAA+BC,IAA/B,EAAqCC,aAArC,EAAoDC,WAApD,EAAkE;AACxE,MAAK,CAAER,kBAAkB,CAAEM,IAAF,CAAzB,EAAoC;AACnC,WAAO,KAAP;AACA,GAHuE,CAKxE;AACA;;;AACA,MAAKA,IAAI,KAAK,MAAT,IAAmBE,WAAW,KAAK,OAAxC,EAAkD;AACjD,WAAO,IAAP;AACA;;AAED,SAAOR,kBAAkB,CAAEM,IAAF,CAAlB,CAA2BG,KAA3B,CACJC,YAAF,IACCH,aAAa,CAACI,QAAd,CAAwBD,YAAxB,KACAL,oBAAoB,CAAEK,YAAF,EAAgBH,aAAhB,EAA+BC,WAA/B,CAHf,CAAP;AAKA;AAED,OAAO,SAASI,mBAAT,CAA8BN,IAA9B,EAAqC;AAC3C,QAAMO,kBAAkB,GAAGT,mBAAmB,CAACO,QAApB,CAA8BL,IAA9B,CAA3B;;AACA,MAAKO,kBAAL,EAA0B;AACzB,WAAOjB,cAAP;AACA;;AAED,QAAMkB,iBAAiB,GAAGb,iBAAiB,CAACU,QAAlB,CAA4BL,IAA5B,CAA1B;;AACA,MAAKQ,iBAAL,EAAyB;AACxB,WAAOjB,sBAAP;AACA;;AAED,QAAMkB,eAAe,GAAGZ,wBAAwB,CAACa,IAAzB,CAAiCC,MAAF,IACtDX,IAAI,CAACY,UAAL,CAAiBD,MAAjB,CADuB,CAAxB;;AAGA,MAAKF,eAAL,EAAuB;AACtB,WAAOhB,oBAAP;AACA;;AAED,QAAMoB,eAAe,GAAGjB,wBAAwB,CAACc,IAAzB,CAAiCC,MAAF,IACtDX,IAAI,CAACY,UAAL,CAAiBD,MAAjB,CADuB,CAAxB;;AAGA,MAAKE,eAAL,EAAuB;AACtB,WAAOrB,oBAAP;AACA;;AAED,SAAOD,sBAAP;AACA;AAED,OAAO,SAASuB,kBAAT,CAA6BC,SAA7B,EAAwCb,WAAxC,EAAsD;AAC5D,QAAMc,aAAa,GAAG3B,GAAG,CAAE0B,SAAF,EAAa,MAAb,CAAzB;AACA,QAAME,mBAAmB,GAAGF,SAAS,CAACG,MAAV,CAAkB;AAAA,QAAE;AAAElB,MAAAA;AAAF,KAAF;AAAA,WAC7CD,oBAAoB,CAAEC,IAAF,EAAQgB,aAAR,EAAuBd,WAAvB,CADyB;AAAA,GAAlB,CAA5B;AAIA,SAAOe,mBAAP;AACA;AAED,OAAO,SAASE,uBAAT,CAAkCJ,SAAlC,EAA8C;AACpD,SAAOA,SAAS,CAACK,MAAV,CAAkB,CAAEC,GAAF,EAAOC,QAAP,KAAqB;AAC7CD,IAAAA,GAAG,CAAEC,QAAQ,CAACtB,IAAX,CAAH,GAAuBM,mBAAmB,CAAEgB,QAAQ,CAACtB,IAAX,CAA1C;AACA,WAAOqB,GAAP;AACA,GAHM,EAGJ,EAHI,CAAP;AAIA","sourcesContent":["/**\n * External dependencies\n */\nimport { map } from 'lodash';\n\n/**\n * Internal dependencies\n */\nimport {\n\tMENU_TEMPLATES,\n\tMENU_TEMPLATES_GENERAL,\n\tMENU_TEMPLATES_PAGES,\n\tMENU_TEMPLATES_POSTS,\n\tTEMPLATE_OVERRIDES,\n\tTEMPLATES_GENERAL,\n\tTEMPLATES_PAGES_PREFIXES,\n\tTEMPLATES_POSTS_PREFIXES,\n\tTEMPLATES_TOP_LEVEL,\n} from './constants';\n\nexport function isTemplateSuperseded( slug, existingSlugs, showOnFront ) {\n\tif ( ! TEMPLATE_OVERRIDES[ slug ] ) {\n\t\treturn false;\n\t}\n\n\t// `home` template is unused if it is superseded by `front-page`\n\t// or \"show on front\" is set to show a page rather than blog posts.\n\tif ( slug === 'home' && showOnFront !== 'posts' ) {\n\t\treturn true;\n\t}\n\n\treturn TEMPLATE_OVERRIDES[ slug ].every(\n\t\t( overrideSlug ) =>\n\t\t\texistingSlugs.includes( overrideSlug ) ||\n\t\t\tisTemplateSuperseded( overrideSlug, existingSlugs, showOnFront )\n\t);\n}\n\nexport function getTemplateLocation( slug ) {\n\tconst isTopLevelTemplate = TEMPLATES_TOP_LEVEL.includes( slug );\n\tif ( isTopLevelTemplate ) {\n\t\treturn MENU_TEMPLATES;\n\t}\n\n\tconst isGeneralTemplate = TEMPLATES_GENERAL.includes( slug );\n\tif ( isGeneralTemplate ) {\n\t\treturn MENU_TEMPLATES_GENERAL;\n\t}\n\n\tconst isPostsTemplate = TEMPLATES_POSTS_PREFIXES.some( ( prefix ) =>\n\t\tslug.startsWith( prefix )\n\t);\n\tif ( isPostsTemplate ) {\n\t\treturn MENU_TEMPLATES_POSTS;\n\t}\n\n\tconst isPagesTemplate = TEMPLATES_PAGES_PREFIXES.some( ( prefix ) =>\n\t\tslug.startsWith( prefix )\n\t);\n\tif ( isPagesTemplate ) {\n\t\treturn MENU_TEMPLATES_PAGES;\n\t}\n\n\treturn MENU_TEMPLATES_GENERAL;\n}\n\nexport function getUnusedTemplates( templates, showOnFront ) {\n\tconst templateSlugs = map( templates, 'slug' );\n\tconst supersededTemplates = templates.filter( ( { slug } ) =>\n\t\tisTemplateSuperseded( slug, templateSlugs, showOnFront )\n\t);\n\n\treturn supersededTemplates;\n}\n\nexport function getTemplatesLocationMap( templates ) {\n\treturn templates.reduce( ( obj, template ) => {\n\t\tobj[ template.slug ] = getTemplateLocation( template.slug );\n\t\treturn obj;\n\t}, {} );\n}\n"]}
|
package/build-module/components/navigation-sidebar/navigation-panel/template-navigation-item.js
CHANGED
|
@@ -15,9 +15,10 @@ import { store as editorStore } from '@wordpress/editor';
|
|
|
15
15
|
import TemplatePreview from './template-preview';
|
|
16
16
|
import { NavigationPanelPreviewFill } from '../index';
|
|
17
17
|
import { store as editSiteStore } from '../../../store';
|
|
18
|
-
export default function TemplateNavigationItem({
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
export default function TemplateNavigationItem(_ref) {
|
|
19
|
+
let {
|
|
20
|
+
item
|
|
21
|
+
} = _ref;
|
|
21
22
|
const {
|
|
22
23
|
title,
|
|
23
24
|
description
|
package/build-module/components/navigation-sidebar/navigation-panel/template-navigation-item.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/template-navigation-item.js"],"names":["Button","__experimentalNavigationItem","NavigationItem","useDispatch","useSelect","useState","__","store","editorStore","TemplatePreview","NavigationPanelPreviewFill","editSiteStore","TemplateNavigationItem","item","title","description","select","type","__experimentalGetTemplateInfo","rendered","slug","setTemplate","setTemplatePart","setIsNavigationPanelOpened","isPreviewVisible","setIsPreviewVisible","onActivateItem","id","status","content","raw"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,MADD,EAECC,4BAA4B,IAAIC,cAFjC,QAGO,uBAHP;AAIA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AAEA;AACA;AACA;;AACA,OAAOC,eAAP,MAA4B,oBAA5B;AACA,SAASC,0BAAT,QAA2C,UAA3C;AACA,SAASH,KAAK,IAAII,aAAlB,QAAuC,gBAAvC;AAEA,eAAe,SAASC,sBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/template-navigation-item.js"],"names":["Button","__experimentalNavigationItem","NavigationItem","useDispatch","useSelect","useState","__","store","editorStore","TemplatePreview","NavigationPanelPreviewFill","editSiteStore","TemplateNavigationItem","item","title","description","select","type","__experimentalGetTemplateInfo","rendered","slug","setTemplate","setTemplatePart","setIsNavigationPanelOpened","isPreviewVisible","setIsPreviewVisible","onActivateItem","id","status","content","raw"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,MADD,EAECC,4BAA4B,IAAIC,cAFjC,QAGO,uBAHP;AAIA,SAASC,WAAT,EAAsBC,SAAtB,QAAuC,iBAAvC;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AAEA;AACA;AACA;;AACA,OAAOC,eAAP,MAA4B,oBAA5B;AACA,SAASC,0BAAT,QAA2C,UAA3C;AACA,SAASH,KAAK,IAAII,aAAlB,QAAuC,gBAAvC;AAEA,eAAe,SAASC,sBAAT,OAA4C;AAAA,MAAX;AAAEC,IAAAA;AAAF,GAAW;AAC1D,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,MAAyBX,SAAS,CACrCY,MAAF;AAAA;;AAAA,WACC,kBAAkBH,IAAI,CAACI,IAAvB,GACGD,MAAM,CAAER,WAAF,CAAN,CAAsBU,6BAAtB,CAAqDL,IAArD,CADH,GAEG;AACAC,MAAAA,KAAK,EAAE,CAAAD,IAAI,SAAJ,IAAAA,IAAI,WAAJ,2BAAAA,IAAI,CAAEC,KAAN,4DAAaK,QAAb,MAAyBN,IAAzB,aAAyBA,IAAzB,uBAAyBA,IAAI,CAAEO,IAA/B,CADP;AAEAL,MAAAA,WAAW,EAAE;AAFb,KAHJ;AAAA,GADuC,EAQvC,EARuC,CAAxC;AAUA,QAAM;AACLM,IAAAA,WADK;AAELC,IAAAA,eAFK;AAGLC,IAAAA;AAHK,MAIFpB,WAAW,CAAEQ,aAAF,CAJf;AAKA,QAAM,CAAEa,gBAAF,EAAoBC,mBAApB,IAA4CpB,QAAQ,CAAE,KAAF,CAA1D;;AAEA,MAAK,CAAEQ,IAAP,EAAc;AACb,WAAO,IAAP;AACA;;AAED,QAAMa,cAAc,GAAG,MAAM;AAC5B,QAAK,kBAAkBb,IAAI,CAACI,IAA5B,EAAmC;AAClCI,MAAAA,WAAW,CAAER,IAAI,CAACc,EAAP,EAAWd,IAAI,CAACO,IAAhB,CAAX;AACA,KAFD,MAEO;AACNE,MAAAA,eAAe,CAAET,IAAI,CAACc,EAAP,CAAf;AACA;;AACDJ,IAAAA,0BAA0B,CAAE,KAAF,CAA1B;AACA,GAPD;;AASA,SACC,cAAC,cAAD;AACC,IAAA,SAAS,EAAC,2CADX;AAEC,IAAA,IAAI,EAAI,GAAGV,IAAI,CAACI,IAAM,IAAIJ,IAAI,CAACc,EAAI;AAFpC,KAIC,cAAC,MAAD;AACC,IAAA,OAAO,EAAGD,cADX;AAEC,IAAA,YAAY,EAAG,MAAMD,mBAAmB,CAAE,IAAF,CAFzC;AAGC,IAAA,YAAY,EAAG,MAAMA,mBAAmB,CAAE,KAAF;AAHzC,KAKC;AAAM,IAAA,SAAS,EAAC;AAAhB,KACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACG,YAAYZ,IAAI,CAACe,MAAjB,IACD,0BAAMtB,EAAE,CAAE,SAAF,CAAR,CAFF,EAIGQ,KAJH,CADD,EAOGC,WAAW,IACZ;AAAK,IAAA,SAAS,EAAC;AAAf,KACGA,WADH,CARF,CALD,CAJD,EAwBGS,gBAAgB,IACjB,cAAC,0BAAD,QACC,cAAC,eAAD;AAAiB,IAAA,UAAU,EAAGX,IAAI,CAACgB,OAAL,CAAaC;AAA3C,IADD,CAzBF,CADD;AAgCA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\t__experimentalNavigationItem as NavigationItem,\n} from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport TemplatePreview from './template-preview';\nimport { NavigationPanelPreviewFill } from '../index';\nimport { store as editSiteStore } from '../../../store';\n\nexport default function TemplateNavigationItem( { item } ) {\n\tconst { title, description } = useSelect(\n\t\t( select ) =>\n\t\t\t'wp_template' === item.type\n\t\t\t\t? select( editorStore ).__experimentalGetTemplateInfo( item )\n\t\t\t\t: {\n\t\t\t\t\t\ttitle: item?.title?.rendered || item?.slug,\n\t\t\t\t\t\tdescription: '',\n\t\t\t\t },\n\t\t[]\n\t);\n\tconst {\n\t\tsetTemplate,\n\t\tsetTemplatePart,\n\t\tsetIsNavigationPanelOpened,\n\t} = useDispatch( editSiteStore );\n\tconst [ isPreviewVisible, setIsPreviewVisible ] = useState( false );\n\n\tif ( ! item ) {\n\t\treturn null;\n\t}\n\n\tconst onActivateItem = () => {\n\t\tif ( 'wp_template' === item.type ) {\n\t\t\tsetTemplate( item.id, item.slug );\n\t\t} else {\n\t\t\tsetTemplatePart( item.id );\n\t\t}\n\t\tsetIsNavigationPanelOpened( false );\n\t};\n\n\treturn (\n\t\t<NavigationItem\n\t\t\tclassName=\"edit-site-navigation-panel__template-item\"\n\t\t\titem={ `${ item.type }-${ item.id }` }\n\t\t>\n\t\t\t<Button\n\t\t\t\tonClick={ onActivateItem }\n\t\t\t\tonMouseEnter={ () => setIsPreviewVisible( true ) }\n\t\t\t\tonMouseLeave={ () => setIsPreviewVisible( false ) }\n\t\t\t>\n\t\t\t\t<span className=\"edit-site-navigation-panel__info-wrapper\">\n\t\t\t\t\t<div className=\"edit-site-navigation-panel__template-item-title\">\n\t\t\t\t\t\t{ 'draft' === item.status && (\n\t\t\t\t\t\t\t<em>{ __( '[Draft]' ) }</em>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</div>\n\t\t\t\t\t{ description && (\n\t\t\t\t\t\t<div className=\"edit-site-navigation-panel__template-item-description\">\n\t\t\t\t\t\t\t{ description }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</span>\n\t\t\t</Button>\n\n\t\t\t{ isPreviewVisible && (\n\t\t\t\t<NavigationPanelPreviewFill>\n\t\t\t\t\t<TemplatePreview rawContent={ item.content.raw } />\n\t\t\t\t</NavigationPanelPreviewFill>\n\t\t\t) }\n\t\t</NavigationItem>\n\t);\n}\n"]}
|
|
@@ -6,10 +6,11 @@ import { createElement } from "@wordpress/element";
|
|
|
6
6
|
import { parse } from '@wordpress/blocks';
|
|
7
7
|
import { BlockPreview, BlockContextProvider } from '@wordpress/block-editor';
|
|
8
8
|
import { useMemo } from '@wordpress/element';
|
|
9
|
-
export default function TemplatePreview({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
export default function TemplatePreview(_ref) {
|
|
10
|
+
let {
|
|
11
|
+
rawContent,
|
|
12
|
+
blockContext
|
|
13
|
+
} = _ref;
|
|
13
14
|
const blocks = useMemo(() => rawContent ? parse(rawContent) : [], [rawContent]);
|
|
14
15
|
|
|
15
16
|
if (!blocks || blocks.length === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/template-preview.js"],"names":["parse","BlockPreview","BlockContextProvider","useMemo","TemplatePreview","rawContent","blockContext","blocks","length"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,KAAT,QAAsB,mBAAtB;AACA,SAASC,YAAT,EAAuBC,oBAAvB,QAAmD,yBAAnD;AACA,SAASC,OAAT,QAAwB,oBAAxB;AAEA,eAAe,SAASC,eAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-panel/template-preview.js"],"names":["parse","BlockPreview","BlockContextProvider","useMemo","TemplatePreview","rawContent","blockContext","blocks","length"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,KAAT,QAAsB,mBAAtB;AACA,SAASC,YAAT,EAAuBC,oBAAvB,QAAmD,yBAAnD;AACA,SAASC,OAAT,QAAwB,oBAAxB;AAEA,eAAe,SAASC,eAAT,OAAyD;AAAA,MAA/B;AAAEC,IAAAA,UAAF;AAAcC,IAAAA;AAAd,GAA+B;AACvE,QAAMC,MAAM,GAAGJ,OAAO,CAAE,MAAQE,UAAU,GAAGL,KAAK,CAAEK,UAAF,CAAR,GAAyB,EAA7C,EAAmD,CACxEA,UADwE,CAAnD,CAAtB;;AAIA,MAAK,CAAEE,MAAF,IAAYA,MAAM,CAACC,MAAP,KAAkB,CAAnC,EAAuC;AACtC,WAAO,IAAP;AACA;;AAED,MAAKF,YAAL,EAAoB;AACnB,WACC;AAAK,MAAA,SAAS,EAAC;AAAf,OACC,cAAC,oBAAD;AAAsB,MAAA,KAAK,EAAGA;AAA9B,OACC,cAAC,YAAD;AAAc,MAAA,MAAM,EAAGC,MAAvB;AAAgC,MAAA,aAAa,EAAG;AAAhD,MADD,CADD,CADD;AAOA;;AAED,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC,cAAC,YAAD;AAAc,IAAA,MAAM,EAAGA,MAAvB;AAAgC,IAAA,aAAa,EAAG;AAAhD,IADD,CADD;AAKA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { parse } from '@wordpress/blocks';\nimport { BlockPreview, BlockContextProvider } from '@wordpress/block-editor';\nimport { useMemo } from '@wordpress/element';\n\nexport default function TemplatePreview( { rawContent, blockContext } ) {\n\tconst blocks = useMemo( () => ( rawContent ? parse( rawContent ) : [] ), [\n\t\trawContent,\n\t] );\n\n\tif ( ! blocks || blocks.length === 0 ) {\n\t\treturn null;\n\t}\n\n\tif ( blockContext ) {\n\t\treturn (\n\t\t\t<div className=\"edit-site-navigation-panel__preview\">\n\t\t\t\t<BlockContextProvider value={ blockContext }>\n\t\t\t\t\t<BlockPreview blocks={ blocks } viewportWidth={ 1200 } />\n\t\t\t\t</BlockContextProvider>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div className=\"edit-site-navigation-panel__preview\">\n\t\t\t<BlockPreview blocks={ blocks } viewportWidth={ 1200 } />\n\t\t</div>\n\t);\n}\n"]}
|
|
@@ -3,30 +3,23 @@ import { createElement } from "@wordpress/element";
|
|
|
3
3
|
/**
|
|
4
4
|
* WordPress dependencies
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { useSelect } from '@wordpress/data';
|
|
7
7
|
import { Button, Icon, __unstableMotion as motion } from '@wordpress/components';
|
|
8
8
|
import { __ } from '@wordpress/i18n';
|
|
9
9
|
import { wordpress } from '@wordpress/icons';
|
|
10
10
|
import { store as coreDataStore } from '@wordpress/core-data';
|
|
11
11
|
import { useReducedMotion } from '@wordpress/compose';
|
|
12
|
-
/**
|
|
13
|
-
* Internal dependencies
|
|
14
|
-
*/
|
|
15
12
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
13
|
+
function NavigationToggle(_ref) {
|
|
14
|
+
let {
|
|
15
|
+
icon,
|
|
16
|
+
isOpen,
|
|
17
|
+
setIsOpen
|
|
18
|
+
} = _ref;
|
|
22
19
|
const {
|
|
23
20
|
isRequestingSiteIcon,
|
|
24
|
-
navigationPanelMenu,
|
|
25
21
|
siteIconUrl
|
|
26
22
|
} = useSelect(select => {
|
|
27
|
-
const {
|
|
28
|
-
getCurrentTemplateNavigationPanelSubMenu
|
|
29
|
-
} = select(editSiteStore);
|
|
30
23
|
const {
|
|
31
24
|
getEntityRecord,
|
|
32
25
|
isResolving
|
|
@@ -34,24 +27,12 @@ function NavigationToggle({
|
|
|
34
27
|
const siteData = getEntityRecord('root', '__unstableBase', undefined) || {};
|
|
35
28
|
return {
|
|
36
29
|
isRequestingSiteIcon: isResolving('core', 'getEntityRecord', ['root', '__unstableBase', undefined]),
|
|
37
|
-
navigationPanelMenu: getCurrentTemplateNavigationPanelSubMenu(),
|
|
38
30
|
siteIconUrl: siteData.site_icon_url
|
|
39
31
|
};
|
|
40
32
|
}, []);
|
|
41
|
-
const {
|
|
42
|
-
openNavigationPanelToMenu,
|
|
43
|
-
setIsNavigationPanelOpened
|
|
44
|
-
} = useDispatch(editSiteStore);
|
|
45
33
|
const disableMotion = useReducedMotion();
|
|
46
34
|
|
|
47
|
-
const toggleNavigationPanel = () =>
|
|
48
|
-
if (isOpen) {
|
|
49
|
-
setIsNavigationPanelOpened(false);
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
openNavigationPanelToMenu(navigationPanelMenu);
|
|
54
|
-
};
|
|
35
|
+
const toggleNavigationPanel = () => setIsOpen(open => !open);
|
|
55
36
|
|
|
56
37
|
let buttonIcon = createElement(Icon, {
|
|
57
38
|
size: "36px",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-toggle/index.js"],"names":["
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/navigation-sidebar/navigation-toggle/index.js"],"names":["useSelect","Button","Icon","__unstableMotion","motion","__","wordpress","store","coreDataStore","useReducedMotion","NavigationToggle","icon","isOpen","setIsOpen","isRequestingSiteIcon","siteIconUrl","select","getEntityRecord","isResolving","siteData","undefined","site_icon_url","disableMotion","toggleNavigationPanel","open","buttonIcon","effect","expand","scale","borderRadius","transition","type","duration"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,iBAA1B;AACA,SACCC,MADD,EAECC,IAFD,EAGCC,gBAAgB,IAAIC,MAHrB,QAIO,uBAJP;AAKA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,sBAAvC;AACA,SAASC,gBAAT,QAAiC,oBAAjC;;AAEA,SAASC,gBAAT,OAAyD;AAAA,MAA9B;AAAEC,IAAAA,IAAF;AAAQC,IAAAA,MAAR;AAAgBC,IAAAA;AAAhB,GAA8B;AACxD,QAAM;AAAEC,IAAAA,oBAAF;AAAwBC,IAAAA;AAAxB,MAAwCf,SAAS,CAAIgB,MAAF,IAAc;AACtE,UAAM;AAAEC,MAAAA,eAAF;AAAmBC,MAAAA;AAAnB,QAAm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;AAAkB,MAAA,IAAI,EAAGd;AAAzB,MAAb;AACA;;AAED,SACC,cAAC,MAAD,CAAQ,GAAR;AACC,IAAA,SAAS,EACR,iCAAkCC,MAAM,GAAG,UAAH,GAAgB,EAAxD,CAFF;AAIC,IAAA,UAAU,EAAC;AAJZ,KAMC,cAAC,MAAD;AACC,IAAA,SAAS,EAAC,8CADX;AAEC,IAAA,KAAK,EAAGP,EAAE,CAAE,mBAAF,CAFX;AAGC,IAAA,OAAO,EAAGkB,qBAHX;AAIC,IAAA,WAAW;AAJZ,KAMGE,UANH,CAND,CADD;AAiBA;;AAED,eAAef,gBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tIcon,\n\t__unstableMotion as motion,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { wordpress } from '@wordpress/icons';\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { useReducedMotion } from '@wordpress/compose';\n\nfunction NavigationToggle( { icon, isOpen, setIsOpen } ) {\n\tconst { isRequestingSiteIcon, siteIconUrl } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, isResolving } = select( coreDataStore );\n\t\tconst siteData =\n\t\t\tgetEntityRecord( 'root', '__unstableBase', undefined ) || {};\n\n\t\treturn {\n\t\t\tisRequestingSiteIcon: isResolving( 'core', 'getEntityRecord', [\n\t\t\t\t'root',\n\t\t\t\t'__unstableBase',\n\t\t\t\tundefined,\n\t\t\t] ),\n\t\t\tsiteIconUrl: siteData.site_icon_url,\n\t\t};\n\t}, [] );\n\n\tconst disableMotion = useReducedMotion();\n\n\tconst toggleNavigationPanel = () => setIsOpen( ( open ) => ! open );\n\n\tlet buttonIcon = <Icon size=\"36px\" icon={ wordpress } />;\n\n\tconst effect = {\n\t\texpand: {\n\t\t\tscale: 1.7,\n\t\t\tborderRadius: 0,\n\t\t\ttransition: { type: 'tween', duration: '0.2' },\n\t\t},\n\t};\n\n\tif ( siteIconUrl ) {\n\t\tbuttonIcon = (\n\t\t\t<motion.img\n\t\t\t\tvariants={ ! disableMotion && effect }\n\t\t\t\talt={ __( 'Site Icon' ) }\n\t\t\t\tclassName=\"edit-site-navigation-toggle__site-icon\"\n\t\t\t\tsrc={ siteIconUrl }\n\t\t\t/>\n\t\t);\n\t} else if ( isRequestingSiteIcon ) {\n\t\tbuttonIcon = null;\n\t} else if ( icon ) {\n\t\tbuttonIcon = <Icon size=\"36px\" icon={ icon } />;\n\t}\n\n\treturn (\n\t\t<motion.div\n\t\t\tclassName={\n\t\t\t\t'edit-site-navigation-toggle' + ( isOpen ? ' is-open' : '' )\n\t\t\t}\n\t\t\twhileHover=\"expand\"\n\t\t>\n\t\t\t<Button\n\t\t\t\tclassName=\"edit-site-navigation-toggle__button has-icon\"\n\t\t\t\tlabel={ __( 'Toggle navigation' ) }\n\t\t\t\tonClick={ toggleNavigationPanel }\n\t\t\t\tshowTooltip\n\t\t\t>\n\t\t\t\t{ buttonIcon }\n\t\t\t</Button>\n\t\t</motion.div>\n\t);\n}\n\nexport default NavigationToggle;\n"]}
|
|
@@ -12,10 +12,11 @@ import { useSelect } from '@wordpress/data';
|
|
|
12
12
|
import { Button } from '@wordpress/components';
|
|
13
13
|
import { __ } from '@wordpress/i18n';
|
|
14
14
|
import { store as coreStore } from '@wordpress/core-data';
|
|
15
|
-
export default function SaveButton({
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
export default function SaveButton(_ref) {
|
|
16
|
+
let {
|
|
17
|
+
openEntitiesSavedStates,
|
|
18
|
+
isEntitiesSavedStatesOpen
|
|
19
|
+
} = _ref;
|
|
19
20
|
const {
|
|
20
21
|
isDirty,
|
|
21
22
|
isSaving
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"names":["some","useSelect","Button","__","store","coreStore","SaveButton","openEntitiesSavedStates","isEntitiesSavedStatesOpen","isDirty","isSaving","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","dirtyEntityRecords","length","record","kind","name","key","disabled","undefined"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,QAArB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA,eAAe,SAASC,UAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/save-button/index.js"],"names":["some","useSelect","Button","__","store","coreStore","SaveButton","openEntitiesSavedStates","isEntitiesSavedStatesOpen","isDirty","isSaving","select","__experimentalGetDirtyEntityRecords","isSavingEntityRecord","dirtyEntityRecords","length","record","kind","name","key","disabled","undefined"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,IAAT,QAAqB,QAArB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,KAAK,IAAIC,SAAlB,QAAmC,sBAAnC;AAEA,eAAe,SAASC,UAAT,OAGX;AAAA,MAHgC;AACnCC,IAAAA,uBADmC;AAEnCC,IAAAA;AAFmC,GAGhC;AACH,QAAM;AAAEC,IAAAA,OAAF;AAAWC,IAAAA;AAAX,MAAwBT,SAAS,CAAIU,MAAF,IAAc;AACtD,UAAM;AACLC,MAAAA,mCADK;AAELC,MAAAA;AAFK,QAGFF,MAAM,CAAEN,SAAF,CAHV;;AAIA,UAAMS,kBAAkB,GAAGF,mCAAmC,EAA9D;;AACA,WAAO;AACNH,MAAAA,OAAO,EAAEK,kBAAkB,CAACC,MAAnB,GAA4B,CAD/B;AAENL,MAAAA,QAAQ,EAAEV,IAAI,CAAEc,kBAAF,EAAwBE,MAAF,IACnCH,oBAAoB,CAAEG,MAAM,CAACC,IAAT,EAAeD,MAAM,CAACE,IAAtB,EAA4BF,MAAM,CAACG,GAAnC,CADP;AAFR,KAAP;AAMA,GAZsC,EAYpC,EAZoC,CAAvC;AAcA,QAAMC,QAAQ,GAAG,CAAEX,OAAF,IAAaC,QAA9B;AAEA,SACC,8BACC,cAAC,MAAD;AACC,IAAA,OAAO,EAAC,SADT;AAEC,IAAA,SAAS,EAAC,+BAFX;AAGC,qBAAgBU,QAHjB;AAIC,qBAAgBZ,yBAJjB;AAKC,IAAA,QAAQ,EAAGY,QALZ;AAMC,IAAA,MAAM,EAAGV,QANV;AAOC,IAAA,OAAO,EAAGU,QAAQ,GAAGC,SAAH,GAAed;AAPlC,KASGJ,EAAE,CAAE,MAAF,CATL,CADD,CADD;AAeA","sourcesContent":["/**\n * External dependencies\n */\nimport { some } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\n\nexport default function SaveButton( {\n\topenEntitiesSavedStates,\n\tisEntitiesSavedStatesOpen,\n} ) {\n\tconst { isDirty, isSaving } = useSelect( ( select ) => {\n\t\tconst {\n\t\t\t__experimentalGetDirtyEntityRecords,\n\t\t\tisSavingEntityRecord,\n\t\t} = select( coreStore );\n\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\treturn {\n\t\t\tisDirty: dirtyEntityRecords.length > 0,\n\t\t\tisSaving: some( dirtyEntityRecords, ( record ) =>\n\t\t\t\tisSavingEntityRecord( record.kind, record.name, record.key )\n\t\t\t),\n\t\t};\n\t}, [] );\n\n\tconst disabled = ! isDirty || isSaving;\n\n\treturn (\n\t\t<>\n\t\t\t<Button\n\t\t\t\tvariant=\"primary\"\n\t\t\t\tclassName=\"edit-site-save-button__button\"\n\t\t\t\taria-disabled={ disabled }\n\t\t\t\taria-expanded={ isEntitiesSavedStatesOpen }\n\t\t\t\tdisabled={ disabled }\n\t\t\t\tisBusy={ isSaving }\n\t\t\t\tonClick={ disabled ? undefined : openEntitiesSavedStates }\n\t\t\t>\n\t\t\t\t{ __( 'Save' ) }\n\t\t\t</Button>\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -4,16 +4,17 @@ import { createElement, Fragment } from "@wordpress/element";
|
|
|
4
4
|
* WordPress dependencies
|
|
5
5
|
*/
|
|
6
6
|
import { ComplementaryArea, ComplementaryAreaMoreMenuItem } from '@wordpress/interface';
|
|
7
|
-
export default function DefaultSidebar({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
7
|
+
export default function DefaultSidebar(_ref) {
|
|
8
|
+
let {
|
|
9
|
+
className,
|
|
10
|
+
identifier,
|
|
11
|
+
title,
|
|
12
|
+
icon,
|
|
13
|
+
children,
|
|
14
|
+
closeLabel,
|
|
15
|
+
header,
|
|
16
|
+
headerClassName
|
|
17
|
+
} = _ref;
|
|
17
18
|
return createElement(Fragment, null, createElement(ComplementaryArea, {
|
|
18
19
|
className: className,
|
|
19
20
|
scope: "core/edit-site",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/default-sidebar.js"],"names":["ComplementaryArea","ComplementaryAreaMoreMenuItem","DefaultSidebar","className","identifier","title","icon","children","closeLabel","header","headerClassName"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,iBADD,EAECC,6BAFD,QAGO,sBAHP;AAKA,eAAe,SAASC,cAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/default-sidebar.js"],"names":["ComplementaryArea","ComplementaryAreaMoreMenuItem","DefaultSidebar","className","identifier","title","icon","children","closeLabel","header","headerClassName"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,iBADD,EAECC,6BAFD,QAGO,sBAHP;AAKA,eAAe,SAASC,cAAT,OASX;AAAA,MAToC;AACvCC,IAAAA,SADuC;AAEvCC,IAAAA,UAFuC;AAGvCC,IAAAA,KAHuC;AAIvCC,IAAAA,IAJuC;AAKvCC,IAAAA,QALuC;AAMvCC,IAAAA,UANuC;AAOvCC,IAAAA,MAPuC;AAQvCC,IAAAA;AARuC,GASpC;AACH,SACC,8BACC,cAAC,iBAAD;AACC,IAAA,SAAS,EAAGP,SADb;AAEC,IAAA,KAAK,EAAC,gBAFP;AAGC,IAAA,UAAU,EAAGC,UAHd;AAIC,IAAA,KAAK,EAAGC,KAJT;AAKC,IAAA,IAAI,EAAGC,IALR;AAMC,IAAA,UAAU,EAAGE,UANd;AAOC,IAAA,MAAM,EAAGC,MAPV;AAQC,IAAA,eAAe,EAAGC;AARnB,KAUGH,QAVH,CADD,EAaC,cAAC,6BAAD;AACC,IAAA,KAAK,EAAC,gBADP;AAEC,IAAA,UAAU,EAAGH,UAFd;AAGC,IAAA,IAAI,EAAGE;AAHR,KAKGD,KALH,CAbD,CADD;AAuBA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tComplementaryArea,\n\tComplementaryAreaMoreMenuItem,\n} from '@wordpress/interface';\n\nexport default function DefaultSidebar( {\n\tclassName,\n\tidentifier,\n\ttitle,\n\ticon,\n\tchildren,\n\tcloseLabel,\n\theader,\n\theaderClassName,\n} ) {\n\treturn (\n\t\t<>\n\t\t\t<ComplementaryArea\n\t\t\t\tclassName={ className }\n\t\t\t\tscope=\"core/edit-site\"\n\t\t\t\tidentifier={ identifier }\n\t\t\t\ttitle={ title }\n\t\t\t\ticon={ icon }\n\t\t\t\tcloseLabel={ closeLabel }\n\t\t\t\theader={ header }\n\t\t\t\theaderClassName={ headerClassName }\n\t\t\t>\n\t\t\t\t{ children }\n\t\t\t</ComplementaryArea>\n\t\t\t<ComplementaryAreaMoreMenuItem\n\t\t\t\tscope=\"core/edit-site\"\n\t\t\t\tidentifier={ identifier }\n\t\t\t\ticon={ icon }\n\t\t\t>\n\t\t\t\t{ title }\n\t\t\t</ComplementaryAreaMoreMenuItem>\n\t\t</>\n\t);\n}\n"]}
|
|
@@ -71,10 +71,11 @@ import { ComplementaryArea } from '@wordpress/interface';
|
|
|
71
71
|
* ```
|
|
72
72
|
*/
|
|
73
73
|
|
|
74
|
-
export default function PluginSidebarEditSite({
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
export default function PluginSidebarEditSite(_ref) {
|
|
75
|
+
let {
|
|
76
|
+
className,
|
|
77
|
+
...props
|
|
78
|
+
} = _ref;
|
|
78
79
|
return createElement(ComplementaryArea, _extends({
|
|
79
80
|
panelClassName: className,
|
|
80
81
|
className: "edit-site-sidebar",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/plugin-sidebar/index.js"],"names":["ComplementaryArea","PluginSidebarEditSite","className","props"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,iBAAT,QAAkC,sBAAlC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,qBAAT,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/plugin-sidebar/index.js"],"names":["ComplementaryArea","PluginSidebarEditSite","className","props"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,iBAAT,QAAkC,sBAAlC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,eAAe,SAASC,qBAAT,OAA0D;AAAA,MAA1B;AAAEC,IAAAA,SAAF;AAAa,OAAGC;AAAhB,GAA0B;AACxE,SACC,cAAC,iBAAD;AACC,IAAA,cAAc,EAAGD,SADlB;AAEC,IAAA,SAAS,EAAC,mBAFX;AAGC,IAAA,KAAK,EAAC;AAHP,KAIMC,KAJN,EADD;AAQA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { ComplementaryArea } from '@wordpress/interface';\n\n/**\n * Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar.\n * It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`.\n * If you wish to display the sidebar, you can with use the `PluginSidebarMoreMenuItem` component or the `wp.data.dispatch` API:\n *\n * ```js\n * wp.data.dispatch( 'core/edit-site' ).openGeneralSidebar( 'plugin-name/sidebar-name' );\n * ```\n *\n * @see PluginSidebarMoreMenuItem\n *\n * @param {Object} props Element props.\n * @param {string} props.name A string identifying the sidebar. Must be unique for every sidebar registered within the scope of your plugin.\n * @param {string} [props.className] An optional class name added to the sidebar body.\n * @param {string} props.title Title displayed at the top of the sidebar.\n * @param {boolean} [props.isPinnable=true] Whether to allow to pin sidebar to the toolbar. When set to `true` it also automatically renders a corresponding menu item.\n * @param {WPBlockTypeIconRender} [props.icon=inherits from the plugin] The [Dashicon](https://developer.wordpress.org/resource/dashicons/) icon slug string, or an SVG WP element, to be rendered when the sidebar is pinned to toolbar.\n *\n * @example\n * ```js\n * // Using ES5 syntax\n * var __ = wp.i18n.__;\n * var el = wp.element.createElement;\n * var PanelBody = wp.components.PanelBody;\n * var PluginSidebar = wp.editSite.PluginSidebar;\n * var moreIcon = wp.element.createElement( 'svg' ); //... svg element.\n *\n * function MyPluginSidebar() {\n * \treturn el(\n * \t\t\tPluginSidebar,\n * \t\t\t{\n * \t\t\t\tname: 'my-sidebar',\n * \t\t\t\ttitle: 'My sidebar title',\n * \t\t\t\ticon: moreIcon,\n * \t\t\t},\n * \t\t\tel(\n * \t\t\t\tPanelBody,\n * \t\t\t\t{},\n * \t\t\t\t__( 'My sidebar content' )\n * \t\t\t)\n * \t);\n * }\n * ```\n *\n * @example\n * ```jsx\n * // Using ESNext syntax\n * import { __ } from '@wordpress/i18n';\n * import { PanelBody } from '@wordpress/components';\n * import { PluginSidebar } from '@wordpress/edit-site';\n * import { more } from '@wordpress/icons';\n *\n * const MyPluginSidebar = () => (\n * \t<PluginSidebar\n * \t\tname=\"my-sidebar\"\n * \t\ttitle=\"My sidebar title\"\n * \t\ticon={ more }\n * \t>\n * \t\t<PanelBody>\n * \t\t\t{ __( 'My sidebar content' ) }\n * \t\t</PanelBody>\n * \t</PluginSidebar>\n * );\n * ```\n */\nexport default function PluginSidebarEditSite( { className, ...props } ) {\n\treturn (\n\t\t<ComplementaryArea\n\t\t\tpanelClassName={ className }\n\t\t\tclassName=\"edit-site-sidebar\"\n\t\t\tscope=\"core/edit-site\"\n\t\t\t{ ...props }\n\t\t/>\n\t);\n}\n"]}
|
|
@@ -14,9 +14,10 @@ import { store as interfaceStore } from '@wordpress/interface';
|
|
|
14
14
|
import { STORE_NAME } from '../../../store/constants';
|
|
15
15
|
import { SIDEBAR_BLOCK, SIDEBAR_TEMPLATE } from '../constants';
|
|
16
16
|
|
|
17
|
-
const SettingsHeader =
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
const SettingsHeader = _ref => {
|
|
18
|
+
let {
|
|
19
|
+
sidebarName
|
|
20
|
+
} = _ref;
|
|
20
21
|
const {
|
|
21
22
|
enableComplementaryArea
|
|
22
23
|
} = useDispatch(interfaceStore);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/settings-header/index.js"],"names":["Button","__","useDispatch","store","interfaceStore","STORE_NAME","SIDEBAR_BLOCK","SIDEBAR_TEMPLATE","SettingsHeader","sidebarName","enableComplementaryArea","openTemplateSettings","openBlockSettings","templateAriaLabel","templateActiveClass","blockAriaLabel","blockActiveClass"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,QAAuB,uBAAvB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,WAAT,QAA4B,iBAA5B;AACA,SAASC,KAAK,IAAIC,cAAlB,QAAwC,sBAAxC;AAEA;AACA;AACA;;AACA,SAASC,UAAT,QAA2B,0BAA3B;AACA,SAASC,aAAT,EAAwBC,gBAAxB,QAAgD,cAAhD;;AAEA,MAAMC,cAAc,GAAG,
|
|
1
|
+
{"version":3,"sources":["@wordpress/edit-site/src/components/sidebar/settings-header/index.js"],"names":["Button","__","useDispatch","store","interfaceStore","STORE_NAME","SIDEBAR_BLOCK","SIDEBAR_TEMPLATE","SettingsHeader","sidebarName","enableComplementaryArea","openTemplateSettings","openBlockSettings","templateAriaLabel","templateActiveClass","blockAriaLabel","blockActiveClass"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,MAAT,QAAuB,uBAAvB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,WAAT,QAA4B,iBAA5B;AACA,SAASC,KAAK,IAAIC,cAAlB,QAAwC,sBAAxC;AAEA;AACA;AACA;;AACA,SAASC,UAAT,QAA2B,0BAA3B;AACA,SAASC,aAAT,EAAwBC,gBAAxB,QAAgD,cAAhD;;AAEA,MAAMC,cAAc,GAAG,QAAuB;AAAA,MAArB;AAAEC,IAAAA;AAAF,GAAqB;AAC7C,QAAM;AAAEC,IAAAA;AAAF,MAA8BR,WAAW,CAAEE,cAAF,CAA/C;;AACA,QAAMO,oBAAoB,GAAG,MAC5BD,uBAAuB,CAAEL,UAAF,EAAcE,gBAAd,CADxB;;AAEA,QAAMK,iBAAiB,GAAG,MACzBF,uBAAuB,CAAEL,UAAF,EAAcC,aAAd,CADxB;;AAGA,QAAM,CAAEO,iBAAF,EAAqBC,mBAArB,IACLL,WAAW,KAAKF,gBAAhB,GACG;AACA,GAAEN,EAAE,CAAE,qBAAF,CAAJ,EAA+B,WAA/B,CAFH,GAGG;AACA,GAAEA,EAAE,CAAE,UAAF,CAAJ,EAAoB,EAApB,CALJ;AAOA,QAAM,CAAEc,cAAF,EAAkBC,gBAAlB,IACLP,WAAW,KAAKH,aAAhB,GACG;AACA,GAAEL,EAAE,CAAE,kBAAF,CAAJ,EAA4B,WAA5B,CAFH,GAGG;AACA,GAAEA,EAAE,CAAE,OAAF,CAAJ,EAAiB,EAAjB,CALJ;AAOA;;AACA,SACC,0BACC,0BACC,cAAC,MAAD;AACC,IAAA,OAAO,EAAGU,oBADX;AAEC,IAAA,SAAS,EAAI,gCAAgCG,mBAAqB,EAFnE;AAGC,kBAAaD,iBAHd,CAIC;AAJD;AAKC,kBAAaZ,EAAE,CAAE,UAAF;AALhB,KAQE;AACAA,EAAAA,EAAE,CAAE,UAAF,CATJ,CADD,CADD,EAeC,0BACC,cAAC,MAAD;AACC,IAAA,OAAO,EAAGW,iBADX;AAEC,IAAA,SAAS,EAAI,gCAAgCI,gBAAkB,EAFhE;AAGC,kBAAaD,cAHd,CAIC;AAJD;AAKC,kBAAad,EAAE,CAAE,OAAF;AALhB,KAQE;AACAA,EAAAA,EAAE,CAAE,OAAF,CATJ,CADD,CAfD,CADD;AAgCA,CAtDD;;AAwDA,eAAeO,cAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch } from '@wordpress/data';\nimport { store as interfaceStore } from '@wordpress/interface';\n\n/**\n * Internal dependencies\n */\nimport { STORE_NAME } from '../../../store/constants';\nimport { SIDEBAR_BLOCK, SIDEBAR_TEMPLATE } from '../constants';\n\nconst SettingsHeader = ( { sidebarName } ) => {\n\tconst { enableComplementaryArea } = useDispatch( interfaceStore );\n\tconst openTemplateSettings = () =>\n\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_TEMPLATE );\n\tconst openBlockSettings = () =>\n\t\tenableComplementaryArea( STORE_NAME, SIDEBAR_BLOCK );\n\n\tconst [ templateAriaLabel, templateActiveClass ] =\n\t\tsidebarName === SIDEBAR_TEMPLATE\n\t\t\t? // translators: ARIA label for the Template sidebar tab, selected.\n\t\t\t [ __( 'Template (selected)' ), 'is-active' ]\n\t\t\t: // translators: ARIA label for the Template Settings Sidebar tab, not selected.\n\t\t\t [ __( 'Template' ), '' ];\n\n\tconst [ blockAriaLabel, blockActiveClass ] =\n\t\tsidebarName === SIDEBAR_BLOCK\n\t\t\t? // translators: ARIA label for the Block Settings Sidebar tab, selected.\n\t\t\t [ __( 'Block (selected)' ), 'is-active' ]\n\t\t\t: // translators: ARIA label for the Block Settings Sidebar tab, not selected.\n\t\t\t [ __( 'Block' ), '' ];\n\n\t/* Use a list so screen readers will announce how many tabs there are. */\n\treturn (\n\t\t<ul>\n\t\t\t<li>\n\t\t\t\t<Button\n\t\t\t\t\tonClick={ openTemplateSettings }\n\t\t\t\t\tclassName={ `edit-site-sidebar__panel-tab ${ templateActiveClass }` }\n\t\t\t\t\taria-label={ templateAriaLabel }\n\t\t\t\t\t// translators: Data label for the Template Settings Sidebar tab.\n\t\t\t\t\tdata-label={ __( 'Template' ) }\n\t\t\t\t>\n\t\t\t\t\t{\n\t\t\t\t\t\t// translators: Text label for the Template Settings Sidebar tab.\n\t\t\t\t\t\t__( 'Template' )\n\t\t\t\t\t}\n\t\t\t\t</Button>\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\t<Button\n\t\t\t\t\tonClick={ openBlockSettings }\n\t\t\t\t\tclassName={ `edit-site-sidebar__panel-tab ${ blockActiveClass }` }\n\t\t\t\t\taria-label={ blockAriaLabel }\n\t\t\t\t\t// translators: Data label for the Block Settings Sidebar tab.\n\t\t\t\t\tdata-label={ __( 'Block' ) }\n\t\t\t\t>\n\t\t\t\t\t{\n\t\t\t\t\t\t// translators: Text label for the Block Settings Sidebar tab.\n\t\t\t\t\t\t__( 'Block' )\n\t\t\t\t\t}\n\t\t\t\t</Button>\n\t\t\t</li>\n\t\t</ul>\n\t);\n};\n\nexport default SettingsHeader;\n"]}
|
|
@@ -15,10 +15,11 @@ import { __ } from '@wordpress/i18n';
|
|
|
15
15
|
import { store as editSiteStore } from '../../../store';
|
|
16
16
|
import { TEMPLATE_PART_AREA_TO_NAME } from '../../../store/constants';
|
|
17
17
|
|
|
18
|
-
function TemplateAreaItem({
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
function TemplateAreaItem(_ref) {
|
|
19
|
+
let {
|
|
20
|
+
area,
|
|
21
|
+
clientId
|
|
22
|
+
} = _ref;
|
|
22
23
|
const {
|
|
23
24
|
selectBlock,
|
|
24
25
|
toggleBlockHighlight
|
|
@@ -55,14 +56,17 @@ export default function TemplateAreas() {
|
|
|
55
56
|
className: "edit-site-template-card__template-areas-title"
|
|
56
57
|
}, __('Areas')), createElement("ul", {
|
|
57
58
|
className: "edit-site-template-card__template-areas-list"
|
|
58
|
-
}, templateParts.map(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
}, templateParts.map(_ref2 => {
|
|
60
|
+
let {
|
|
61
|
+
templatePart,
|
|
62
|
+
block
|
|
63
|
+
} = _ref2;
|
|
64
|
+
return createElement("li", {
|
|
65
|
+
key: templatePart.slug
|
|
66
|
+
}, createElement(TemplateAreaItem, {
|
|
67
|
+
area: templatePart.area,
|
|
68
|
+
clientId: block.clientId
|
|
69
|
+
}));
|
|
70
|
+
})));
|
|
67
71
|
}
|
|
68
72
|
//# sourceMappingURL=template-areas.js.map
|