@wordpress/edit-site 5.12.4 → 5.12.6
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/new-template.js +1 -1
- package/build/components/add-new-template/new-template.js.map +1 -1
- package/build/components/block-editor/editor-canvas.js +1 -1
- package/build/components/block-editor/editor-canvas.js.map +1 -1
- package/build/components/create-pattern-modal/index.js +7 -7
- package/build/components/create-pattern-modal/index.js.map +1 -1
- package/build/components/header-edit-mode/document-actions/index.js +9 -1
- package/build/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build/components/page/index.js +3 -1
- package/build/components/page/index.js.map +1 -1
- package/build/components/page-main/index.js +8 -4
- package/build/components/page-main/index.js.map +1 -1
- package/build/components/{page-library → page-patterns}/grid-item.js +52 -27
- package/build/components/page-patterns/grid-item.js.map +1 -0
- package/build/components/{page-library → page-patterns}/grid.js +1 -1
- package/build/components/page-patterns/grid.js.map +1 -0
- package/build/components/{page-library → page-patterns}/index.js +6 -6
- package/build/components/page-patterns/index.js.map +1 -0
- package/build/components/{page-library → page-patterns}/no-patterns.js +1 -1
- package/build/components/page-patterns/no-patterns.js.map +1 -0
- package/build/components/{page-library → page-patterns}/patterns-list.js +6 -6
- package/build/components/page-patterns/patterns-list.js.map +1 -0
- package/build/components/page-patterns/search-items.js.map +1 -0
- package/build/components/{page-library/use-library-settings.js → page-patterns/use-pattern-settings.js} +3 -3
- package/build/components/page-patterns/use-pattern-settings.js.map +1 -0
- package/build/components/{page-library → page-patterns}/use-patterns.js +12 -2
- package/build/components/page-patterns/use-patterns.js.map +1 -0
- package/build/components/{page-library → page-patterns}/utils.js +3 -3
- package/build/components/page-patterns/utils.js.map +1 -0
- package/build/components/page-template-parts/index.js +102 -0
- package/build/components/page-template-parts/index.js.map +1 -0
- package/build/components/sidebar/index.js +6 -6
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-edit-mode/settings-header/index.js +7 -1
- package/build/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-global-styles/index.js +20 -8
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +2 -2
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js +2 -4
- package/build/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js +16 -4
- package/build/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pages/index.js +1 -1
- package/build/components/sidebar-navigation-screen-pages/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/index.js +13 -8
- package/build/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js +23 -0
- package/build/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/category-item.js +3 -3
- package/build/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -0
- package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/index.js +55 -15
- package/build/components/sidebar-navigation-screen-patterns/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -0
- package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js +30 -0
- package/build/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +1 -0
- package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-pattern-categories.js +2 -20
- package/build/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -0
- package/build/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -0
- package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-theme-patterns.js +1 -1
- package/build/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -0
- package/build/components/sidebar-navigation-screen-templates/index.js +11 -63
- package/build/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-templates-browse/index.js +4 -2
- package/build/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-path-with-url.js +1 -1
- package/build/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build/components/welcome-guide/editor.js +1 -1
- package/build/components/welcome-guide/editor.js.map +1 -1
- package/build/components/welcome-guide/index.js +5 -1
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/page.js +70 -0
- package/build/components/welcome-guide/page.js.map +1 -0
- package/build/components/welcome-guide/styles.js +1 -1
- package/build/components/welcome-guide/styles.js.map +1 -1
- package/build/components/welcome-guide/template.js +71 -0
- package/build/components/welcome-guide/template.js.map +1 -0
- package/build/hooks/commands/use-common-commands.js +17 -2
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/hooks/commands/use-edit-mode-commands.js +2 -1
- package/build/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build/index.js +2 -0
- package/build/index.js.map +1 -1
- package/build/store/actions.js +5 -2
- package/build/store/actions.js.map +1 -1
- package/build/utils/get-is-list-page.js +2 -2
- package/build/utils/get-is-list-page.js.map +1 -1
- package/build-module/components/add-new-template/new-template.js +2 -2
- package/build-module/components/add-new-template/new-template.js.map +1 -1
- package/build-module/components/block-editor/editor-canvas.js +1 -1
- package/build-module/components/block-editor/editor-canvas.js.map +1 -1
- package/build-module/components/create-pattern-modal/index.js +7 -7
- package/build-module/components/create-pattern-modal/index.js.map +1 -1
- package/build-module/components/header-edit-mode/document-actions/index.js +10 -2
- package/build-module/components/header-edit-mode/document-actions/index.js.map +1 -1
- package/build-module/components/page/index.js +2 -1
- package/build-module/components/page/index.js.map +1 -1
- package/build-module/components/page-main/index.js +6 -3
- package/build-module/components/page-main/index.js.map +1 -1
- package/build-module/components/{page-library → page-patterns}/grid-item.js +56 -29
- package/build-module/components/page-patterns/grid-item.js.map +1 -0
- package/build-module/components/{page-library → page-patterns}/grid.js +1 -1
- package/build-module/components/page-patterns/grid.js.map +1 -0
- package/build-module/components/{page-library → page-patterns}/index.js +5 -5
- package/build-module/components/page-patterns/index.js.map +1 -0
- package/build-module/components/{page-library → page-patterns}/no-patterns.js +1 -1
- package/build-module/components/page-patterns/no-patterns.js.map +1 -0
- package/build-module/components/{page-library → page-patterns}/patterns-list.js +6 -6
- package/build-module/components/page-patterns/patterns-list.js.map +1 -0
- package/build-module/components/page-patterns/search-items.js.map +1 -0
- package/build-module/components/{page-library/use-library-settings.js → page-patterns/use-pattern-settings.js} +2 -2
- package/build-module/components/page-patterns/use-pattern-settings.js.map +1 -0
- package/build-module/components/{page-library → page-patterns}/use-patterns.js +12 -2
- package/build-module/components/page-patterns/use-patterns.js.map +1 -0
- package/build-module/components/{page-library → page-patterns}/utils.js +3 -3
- package/build-module/components/page-patterns/utils.js.map +1 -0
- package/build-module/components/page-template-parts/index.js +81 -0
- package/build-module/components/page-template-parts/index.js.map +1 -0
- package/build-module/components/sidebar/index.js +5 -5
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-edit-mode/settings-header/index.js +6 -1
- package/build-module/components/sidebar-edit-mode/settings-header/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +19 -8
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +2 -2
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js +2 -4
- package/build-module/components/sidebar-navigation-screen-navigation-menu/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js +15 -5
- package/build-module/components/sidebar-navigation-screen-navigation-menus/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pages/index.js +2 -2
- package/build-module/components/sidebar-navigation-screen-pages/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/index.js +12 -7
- package/build-module/components/sidebar-navigation-screen-pattern/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js +21 -0
- package/build-module/components/sidebar-navigation-screen-pattern/use-pattern-details.js.map +1 -1
- package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/category-item.js +3 -3
- package/build-module/components/sidebar-navigation-screen-patterns/category-item.js.map +1 -0
- package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/index.js +54 -16
- package/build-module/components/sidebar-navigation-screen-patterns/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-patterns/use-default-pattern-categories.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js +20 -0
- package/build-module/components/sidebar-navigation-screen-patterns/use-my-patterns.js.map +1 -0
- package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-pattern-categories.js +2 -17
- package/build-module/components/sidebar-navigation-screen-patterns/use-pattern-categories.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-patterns/use-template-part-areas.js.map +1 -0
- package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-theme-patterns.js +1 -1
- package/build-module/components/sidebar-navigation-screen-patterns/use-theme-patterns.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-templates/index.js +12 -62
- package/build-module/components/sidebar-navigation-screen-templates/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js +4 -2
- package/build-module/components/sidebar-navigation-screen-templates-browse/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js +1 -1
- package/build-module/components/sync-state-with-url/use-sync-path-with-url.js.map +1 -1
- package/build-module/components/welcome-guide/editor.js +1 -1
- package/build-module/components/welcome-guide/editor.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +3 -1
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/page.js +59 -0
- package/build-module/components/welcome-guide/page.js.map +1 -0
- package/build-module/components/welcome-guide/styles.js +1 -1
- package/build-module/components/welcome-guide/styles.js.map +1 -1
- package/build-module/components/welcome-guide/template.js +60 -0
- package/build-module/components/welcome-guide/template.js.map +1 -0
- package/build-module/hooks/commands/use-common-commands.js +16 -2
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +2 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +1 -1
- package/build-module/index.js +2 -0
- package/build-module/index.js.map +1 -1
- package/build-module/store/actions.js +5 -2
- package/build-module/store/actions.js.map +1 -1
- package/build-module/utils/get-is-list-page.js +2 -2
- package/build-module/utils/get-is-list-page.js.map +1 -1
- package/build-style/style-rtl.css +43 -26
- package/build-style/style.css +43 -26
- package/package.json +19 -19
- package/src/components/add-new-template/new-template.js +2 -2
- package/src/components/block-editor/editor-canvas.js +3 -1
- package/src/components/create-pattern-modal/index.js +10 -11
- package/src/components/header-edit-mode/document-actions/index.js +9 -1
- package/src/components/page/index.js +5 -1
- package/src/components/page-main/index.js +6 -3
- package/src/components/{page-library → page-patterns}/grid-item.js +74 -24
- package/src/components/{page-library → page-patterns}/grid.js +1 -1
- package/src/components/{page-library → page-patterns}/index.js +5 -5
- package/src/components/{page-library → page-patterns}/no-patterns.js +1 -1
- package/src/components/{page-library → page-patterns}/patterns-list.js +6 -6
- package/src/components/{page-library → page-patterns}/style.scss +16 -12
- package/src/components/{page-library/use-library-settings.js → page-patterns/use-pattern-settings.js} +1 -1
- package/src/components/{page-library → page-patterns}/use-patterns.js +11 -2
- package/src/components/{page-library → page-patterns}/utils.js +3 -3
- package/src/components/page-template-parts/index.js +105 -0
- package/src/components/sidebar/index.js +6 -6
- package/src/components/sidebar-edit-mode/settings-header/index.js +7 -2
- package/src/components/sidebar-navigation-screen-global-styles/index.js +26 -15
- package/src/components/sidebar-navigation-screen-main/index.js +2 -2
- package/src/components/sidebar-navigation-screen-navigation-menu/index.js +2 -6
- package/src/components/sidebar-navigation-screen-navigation-menus/index.js +12 -4
- package/src/components/sidebar-navigation-screen-pages/index.js +2 -2
- package/src/components/sidebar-navigation-screen-pattern/index.js +13 -6
- package/src/components/sidebar-navigation-screen-pattern/style.scss +4 -0
- package/src/components/sidebar-navigation-screen-pattern/use-pattern-details.js +43 -1
- package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/category-item.js +3 -3
- package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/index.js +75 -22
- package/src/components/sidebar-navigation-screen-patterns/style.scss +3 -0
- package/src/components/sidebar-navigation-screen-patterns/use-my-patterns.js +23 -0
- package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-pattern-categories.js +1 -18
- package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-theme-patterns.js +1 -1
- package/src/components/sidebar-navigation-screen-templates/index.js +15 -82
- package/src/components/sidebar-navigation-screen-templates-browse/index.js +2 -0
- package/src/components/sync-state-with-url/use-sync-path-with-url.js +1 -1
- package/src/components/welcome-guide/editor.js +1 -1
- package/src/components/welcome-guide/index.js +4 -0
- package/src/components/welcome-guide/page.js +75 -0
- package/src/components/welcome-guide/style.scss +15 -1
- package/src/components/welcome-guide/styles.js +1 -1
- package/src/components/welcome-guide/template.js +82 -0
- package/src/hooks/commands/use-common-commands.js +13 -1
- package/src/hooks/commands/use-edit-mode-commands.js +5 -1
- package/src/index.js +2 -0
- package/src/store/actions.js +8 -1
- package/src/style.scss +2 -2
- package/src/utils/get-is-list-page.js +4 -3
- package/build/components/page-library/grid-item.js.map +0 -1
- package/build/components/page-library/grid.js.map +0 -1
- package/build/components/page-library/index.js.map +0 -1
- package/build/components/page-library/no-patterns.js.map +0 -1
- package/build/components/page-library/patterns-list.js.map +0 -1
- package/build/components/page-library/search-items.js.map +0 -1
- package/build/components/page-library/use-library-settings.js.map +0 -1
- package/build/components/page-library/use-patterns.js.map +0 -1
- package/build/components/page-library/utils.js.map +0 -1
- package/build/components/sidebar-navigation-screen-library/category-item.js.map +0 -1
- package/build/components/sidebar-navigation-screen-library/index.js.map +0 -1
- package/build/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +0 -1
- package/build/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +0 -1
- package/build/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +0 -1
- package/build/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +0 -1
- package/build-module/components/page-library/grid-item.js.map +0 -1
- package/build-module/components/page-library/grid.js.map +0 -1
- package/build-module/components/page-library/index.js.map +0 -1
- package/build-module/components/page-library/no-patterns.js.map +0 -1
- package/build-module/components/page-library/patterns-list.js.map +0 -1
- package/build-module/components/page-library/search-items.js.map +0 -1
- package/build-module/components/page-library/use-library-settings.js.map +0 -1
- package/build-module/components/page-library/use-patterns.js.map +0 -1
- package/build-module/components/page-library/utils.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-library/category-item.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-library/index.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-library/use-default-pattern-categories.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-library/use-pattern-categories.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-library/use-template-part-areas.js.map +0 -1
- package/build-module/components/sidebar-navigation-screen-library/use-theme-patterns.js.map +0 -1
- package/src/components/sidebar-navigation-screen-library/style.scss +0 -3
- /package/build/components/{page-library → page-patterns}/search-items.js +0 -0
- /package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-default-pattern-categories.js +0 -0
- /package/build/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-template-part-areas.js +0 -0
- /package/build-module/components/{page-library → page-patterns}/search-items.js +0 -0
- /package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-default-pattern-categories.js +0 -0
- /package/build-module/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-template-part-areas.js +0 -0
- /package/src/components/{page-library → page-patterns}/search-items.js +0 -0
- /package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-default-pattern-categories.js +0 -0
- /package/src/components/{sidebar-navigation-screen-library → sidebar-navigation-screen-patterns}/use-template-part-areas.js +0 -0
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
chevronLeftSmall as chevronLeftSmallIcon,
|
|
21
21
|
page as pageIcon,
|
|
22
22
|
navigation as navigationIcon,
|
|
23
|
+
symbol,
|
|
23
24
|
} from '@wordpress/icons';
|
|
24
25
|
import { displayShortcut } from '@wordpress/keycodes';
|
|
25
26
|
import { useState, useEffect, useRef } from '@wordpress/element';
|
|
@@ -118,10 +119,17 @@ function TemplateDocumentActions( { className, onBack } ) {
|
|
|
118
119
|
|
|
119
120
|
const entityLabel = getEntityLabel( record.type );
|
|
120
121
|
|
|
122
|
+
let typeIcon = icon;
|
|
123
|
+
if ( record.type === 'wp_navigation' ) {
|
|
124
|
+
typeIcon = navigationIcon;
|
|
125
|
+
} else if ( record.type === 'wp_block' ) {
|
|
126
|
+
typeIcon = symbol;
|
|
127
|
+
}
|
|
128
|
+
|
|
121
129
|
return (
|
|
122
130
|
<BaseDocumentActions
|
|
123
131
|
className={ className }
|
|
124
|
-
icon={
|
|
132
|
+
icon={ typeIcon }
|
|
125
133
|
onBack={ onBack }
|
|
126
134
|
>
|
|
127
135
|
<VisuallyHidden as="span">
|
|
@@ -7,6 +7,7 @@ import classnames from 'classnames';
|
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
9
|
import { NavigableRegion } from '@wordpress/interface';
|
|
10
|
+
import { EditorSnackbars } from '@wordpress/editor';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Internal dependencies
|
|
@@ -32,7 +33,10 @@ export default function Page( {
|
|
|
32
33
|
actions={ actions }
|
|
33
34
|
/>
|
|
34
35
|
) }
|
|
35
|
-
<div className="edit-site-page-content">
|
|
36
|
+
<div className="edit-site-page-content">
|
|
37
|
+
{ children }
|
|
38
|
+
<EditorSnackbars />
|
|
39
|
+
</div>
|
|
36
40
|
</NavigableRegion>
|
|
37
41
|
);
|
|
38
42
|
}
|
|
@@ -6,8 +6,9 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
|
6
6
|
/**
|
|
7
7
|
* Internal dependencies
|
|
8
8
|
*/
|
|
9
|
+
import PagePatterns from '../page-patterns';
|
|
10
|
+
import PageTemplateParts from '../page-template-parts';
|
|
9
11
|
import PageTemplates from '../page-templates';
|
|
10
|
-
import PageLibrary from '../page-library';
|
|
11
12
|
import { unlock } from '../../lock-unlock';
|
|
12
13
|
|
|
13
14
|
const { useLocation } = unlock( routerPrivateApis );
|
|
@@ -19,8 +20,10 @@ export default function PageMain() {
|
|
|
19
20
|
|
|
20
21
|
if ( path === '/wp_template/all' ) {
|
|
21
22
|
return <PageTemplates />;
|
|
22
|
-
} else if ( path === '/
|
|
23
|
-
return <
|
|
23
|
+
} else if ( path === '/wp_template_part/all' ) {
|
|
24
|
+
return <PageTemplateParts />;
|
|
25
|
+
} else if ( path === '/patterns' ) {
|
|
26
|
+
return <PagePatterns />;
|
|
24
27
|
}
|
|
25
28
|
|
|
26
29
|
return null;
|
|
@@ -15,12 +15,20 @@ import {
|
|
|
15
15
|
__experimentalHeading as Heading,
|
|
16
16
|
__experimentalHStack as HStack,
|
|
17
17
|
__unstableCompositeItem as CompositeItem,
|
|
18
|
+
Tooltip,
|
|
19
|
+
Flex,
|
|
18
20
|
} from '@wordpress/components';
|
|
19
|
-
import { useInstanceId } from '@wordpress/compose';
|
|
20
21
|
import { useDispatch } from '@wordpress/data';
|
|
21
|
-
import { useState } from '@wordpress/element';
|
|
22
|
+
import { useState, useId } from '@wordpress/element';
|
|
22
23
|
import { __, sprintf } from '@wordpress/i18n';
|
|
23
|
-
import {
|
|
24
|
+
import {
|
|
25
|
+
Icon,
|
|
26
|
+
header,
|
|
27
|
+
footer,
|
|
28
|
+
symbolFilled,
|
|
29
|
+
moreHorizontal,
|
|
30
|
+
lockSmall,
|
|
31
|
+
} from '@wordpress/icons';
|
|
24
32
|
import { store as noticesStore } from '@wordpress/notices';
|
|
25
33
|
import { store as reusableBlocksStore } from '@wordpress/reusable-blocks';
|
|
26
34
|
import { DELETE, BACKSPACE } from '@wordpress/keycodes';
|
|
@@ -31,9 +39,10 @@ import { DELETE, BACKSPACE } from '@wordpress/keycodes';
|
|
|
31
39
|
import { PATTERNS, USER_PATTERNS } from './utils';
|
|
32
40
|
import { useLink } from '../routes/link';
|
|
33
41
|
|
|
42
|
+
const THEME_PATTERN_TOOLTIP = __( 'Theme patterns cannot be edited.' );
|
|
43
|
+
|
|
34
44
|
export default function GridItem( { categoryId, composite, icon, item } ) {
|
|
35
|
-
const
|
|
36
|
-
const descriptionId = `edit-site-library__pattern-description-${ instanceId }`;
|
|
45
|
+
const descriptionId = useId();
|
|
37
46
|
const [ isDeleteDialogOpen, setIsDeleteDialogOpen ] = useState( false );
|
|
38
47
|
|
|
39
48
|
const { __experimentalDeleteReusableBlock } =
|
|
@@ -46,7 +55,6 @@ export default function GridItem( { categoryId, composite, icon, item } ) {
|
|
|
46
55
|
postId: item.type === USER_PATTERNS ? item.id : item.name,
|
|
47
56
|
categoryId,
|
|
48
57
|
categoryType: item.type,
|
|
49
|
-
canvas: 'view',
|
|
50
58
|
} );
|
|
51
59
|
|
|
52
60
|
const onKeyDown = ( event ) => {
|
|
@@ -56,10 +64,10 @@ export default function GridItem( { categoryId, composite, icon, item } ) {
|
|
|
56
64
|
};
|
|
57
65
|
|
|
58
66
|
const isEmpty = ! item.blocks?.length;
|
|
59
|
-
const patternClassNames = classnames( 'edit-site-
|
|
67
|
+
const patternClassNames = classnames( 'edit-site-patterns__pattern', {
|
|
60
68
|
'is-placeholder': isEmpty,
|
|
61
69
|
} );
|
|
62
|
-
const previewClassNames = classnames( 'edit-site-
|
|
70
|
+
const previewClassNames = classnames( 'edit-site-patterns__preview', {
|
|
63
71
|
'is-inactive': item.type === PATTERNS,
|
|
64
72
|
} );
|
|
65
73
|
|
|
@@ -79,14 +87,26 @@ export default function GridItem( { categoryId, composite, icon, item } ) {
|
|
|
79
87
|
};
|
|
80
88
|
|
|
81
89
|
const isUserPattern = item.type === USER_PATTERNS;
|
|
82
|
-
|
|
90
|
+
const ariaDescriptions = [];
|
|
83
91
|
if ( isUserPattern ) {
|
|
84
92
|
// User patterns don't have descriptions, but can be edited and deleted, so include some help text.
|
|
85
|
-
|
|
86
|
-
'Press Enter to edit, or Delete to delete the pattern.'
|
|
93
|
+
ariaDescriptions.push(
|
|
94
|
+
__( 'Press Enter to edit, or Delete to delete the pattern.' )
|
|
87
95
|
);
|
|
88
96
|
} else if ( item.description ) {
|
|
89
|
-
|
|
97
|
+
ariaDescriptions.push( item.description );
|
|
98
|
+
}
|
|
99
|
+
if ( item.type === PATTERNS ) {
|
|
100
|
+
ariaDescriptions.push( THEME_PATTERN_TOOLTIP );
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
let itemIcon = icon;
|
|
104
|
+
if ( categoryId === 'header' ) {
|
|
105
|
+
itemIcon = header;
|
|
106
|
+
} else if ( categoryId === 'footer' ) {
|
|
107
|
+
itemIcon = footer;
|
|
108
|
+
} else if ( categoryId === 'uncategorized' ) {
|
|
109
|
+
itemIcon = symbolFilled;
|
|
90
110
|
}
|
|
91
111
|
|
|
92
112
|
return (
|
|
@@ -101,43 +121,73 @@ export default function GridItem( { categoryId, composite, icon, item } ) {
|
|
|
101
121
|
onKeyDown={ isUserPattern ? onKeyDown : undefined }
|
|
102
122
|
aria-label={ item.title }
|
|
103
123
|
aria-describedby={
|
|
104
|
-
|
|
124
|
+
ariaDescriptions.length
|
|
125
|
+
? ariaDescriptions.join( ' ' )
|
|
126
|
+
: undefined
|
|
105
127
|
}
|
|
106
128
|
>
|
|
107
129
|
{ isEmpty && __( 'Empty pattern' ) }
|
|
108
130
|
{ ! isEmpty && <BlockPreview blocks={ item.blocks } /> }
|
|
109
131
|
</CompositeItem>
|
|
110
|
-
{ ariaDescription
|
|
132
|
+
{ ariaDescriptions.map( ( ariaDescription, index ) => (
|
|
111
133
|
<div
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
id={ descriptionId }
|
|
134
|
+
key={ index }
|
|
135
|
+
hidden
|
|
136
|
+
id={ `${ descriptionId }-${ index }` }
|
|
115
137
|
>
|
|
116
138
|
{ ariaDescription }
|
|
117
139
|
</div>
|
|
118
|
-
) }
|
|
140
|
+
) ) }
|
|
119
141
|
<HStack
|
|
120
142
|
aria-hidden="true"
|
|
121
|
-
className="edit-site-
|
|
143
|
+
className="edit-site-patterns__footer"
|
|
122
144
|
justify="space-between"
|
|
123
145
|
>
|
|
124
146
|
<HStack
|
|
125
147
|
alignment="center"
|
|
126
148
|
justify="left"
|
|
127
149
|
spacing={ 3 }
|
|
128
|
-
className="edit-site-
|
|
150
|
+
className="edit-site-patterns__pattern-title"
|
|
129
151
|
>
|
|
130
|
-
{ icon &&
|
|
131
|
-
|
|
152
|
+
{ icon && (
|
|
153
|
+
<Icon
|
|
154
|
+
className="edit-site-patterns__pattern-icon"
|
|
155
|
+
icon={ itemIcon }
|
|
156
|
+
/>
|
|
157
|
+
) }
|
|
158
|
+
<Flex
|
|
159
|
+
as={ Heading }
|
|
160
|
+
level={ 5 }
|
|
161
|
+
gap={ 0 }
|
|
162
|
+
justify="left"
|
|
163
|
+
>
|
|
164
|
+
{ item.title }
|
|
165
|
+
{ item.type === PATTERNS && (
|
|
166
|
+
<Tooltip
|
|
167
|
+
position="top center"
|
|
168
|
+
text={ __(
|
|
169
|
+
'Theme patterns cannot be edited.'
|
|
170
|
+
) }
|
|
171
|
+
>
|
|
172
|
+
<span className="edit-site-patterns__pattern-lock-icon">
|
|
173
|
+
<Icon
|
|
174
|
+
style={ { fill: 'currentcolor' } }
|
|
175
|
+
icon={ lockSmall }
|
|
176
|
+
size={ 24 }
|
|
177
|
+
/>
|
|
178
|
+
</span>
|
|
179
|
+
</Tooltip>
|
|
180
|
+
) }
|
|
181
|
+
</Flex>
|
|
132
182
|
</HStack>
|
|
133
183
|
{ item.type === USER_PATTERNS && (
|
|
134
184
|
<DropdownMenu
|
|
135
185
|
icon={ moreHorizontal }
|
|
136
186
|
label={ __( 'Actions' ) }
|
|
137
|
-
className="edit-site-
|
|
187
|
+
className="edit-site-patterns__dropdown"
|
|
138
188
|
popoverProps={ { placement: 'bottom-end' } }
|
|
139
189
|
toggleProps={ {
|
|
140
|
-
className: 'edit-site-
|
|
190
|
+
className: 'edit-site-patterns__button',
|
|
141
191
|
isSmall: true,
|
|
142
192
|
describedBy: sprintf(
|
|
143
193
|
/* translators: %s: pattern name */
|
|
@@ -11,16 +11,16 @@ import { getQueryArgs } from '@wordpress/url';
|
|
|
11
11
|
import { DEFAULT_CATEGORY, DEFAULT_TYPE } from './utils';
|
|
12
12
|
import Page from '../page';
|
|
13
13
|
import PatternsList from './patterns-list';
|
|
14
|
-
import
|
|
14
|
+
import usePatternSettings from './use-pattern-settings';
|
|
15
15
|
import { unlock } from '../../lock-unlock';
|
|
16
16
|
|
|
17
17
|
const { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );
|
|
18
18
|
|
|
19
|
-
export default function
|
|
19
|
+
export default function PagePatterns() {
|
|
20
20
|
const { categoryType, categoryId } = getQueryArgs( window.location.href );
|
|
21
21
|
const type = categoryType || DEFAULT_TYPE;
|
|
22
22
|
const category = categoryId || DEFAULT_CATEGORY;
|
|
23
|
-
const settings =
|
|
23
|
+
const settings = usePatternSettings();
|
|
24
24
|
|
|
25
25
|
// Wrap everything in a block editor provider.
|
|
26
26
|
// This ensures 'styles' that are needed for the previews are synced
|
|
@@ -28,8 +28,8 @@ export default function PageLibrary() {
|
|
|
28
28
|
return (
|
|
29
29
|
<ExperimentalBlockEditorProvider settings={ settings }>
|
|
30
30
|
<Page
|
|
31
|
-
className="edit-site-
|
|
32
|
-
title={ __( '
|
|
31
|
+
className="edit-site-patterns"
|
|
32
|
+
title={ __( 'Patterns content' ) }
|
|
33
33
|
hideTitleFromUI
|
|
34
34
|
>
|
|
35
35
|
<PatternsList type={ type } categoryId={ category } />
|
|
@@ -51,19 +51,19 @@ export default function PatternsList( { categoryId, type } ) {
|
|
|
51
51
|
icon={ isRTL() ? chevronRight : chevronLeft }
|
|
52
52
|
label={ __( 'Back' ) }
|
|
53
53
|
onClick={ () => {
|
|
54
|
-
// Go back in history if we came from the
|
|
54
|
+
// Go back in history if we came from the Patterns page.
|
|
55
55
|
// Otherwise push a stack onto the history.
|
|
56
|
-
if ( location.state?.backPath === '/
|
|
56
|
+
if ( location.state?.backPath === '/patterns' ) {
|
|
57
57
|
history.back();
|
|
58
58
|
} else {
|
|
59
|
-
history.push( { path: '/
|
|
59
|
+
history.push( { path: '/patterns' } );
|
|
60
60
|
}
|
|
61
61
|
} }
|
|
62
62
|
/>
|
|
63
63
|
) }
|
|
64
64
|
<FlexBlock>
|
|
65
65
|
<SearchControl
|
|
66
|
-
className="edit-site-
|
|
66
|
+
className="edit-site-patterns__search"
|
|
67
67
|
onChange={ ( value ) => setFilterValue( value ) }
|
|
68
68
|
placeholder={ __( 'Search patterns' ) }
|
|
69
69
|
label={ __( 'Search patterns' ) }
|
|
@@ -75,7 +75,7 @@ export default function PatternsList( { categoryId, type } ) {
|
|
|
75
75
|
{ isResolving && __( 'Loading' ) }
|
|
76
76
|
{ ! isResolving && !! syncedPatterns.length && (
|
|
77
77
|
<>
|
|
78
|
-
<VStack className="edit-site-
|
|
78
|
+
<VStack className="edit-site-patterns__section-header">
|
|
79
79
|
<Heading level={ 4 }>{ __( 'Synced' ) }</Heading>
|
|
80
80
|
<Text variant="muted" as="p">
|
|
81
81
|
{ __(
|
|
@@ -93,7 +93,7 @@ export default function PatternsList( { categoryId, type } ) {
|
|
|
93
93
|
) }
|
|
94
94
|
{ ! isResolving && !! unsyncedPatterns.length && (
|
|
95
95
|
<>
|
|
96
|
-
<VStack className="edit-site-
|
|
96
|
+
<VStack className="edit-site-patterns__section-header">
|
|
97
97
|
<Heading level={ 4 }>{ __( 'Standard' ) }</Heading>
|
|
98
98
|
<Text variant="muted" as="p">
|
|
99
99
|
{ __(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.edit-site-
|
|
1
|
+
.edit-site-patterns {
|
|
2
2
|
background: rgba(0, 0, 0, 0.05);
|
|
3
3
|
margin: $header-height 0 0;
|
|
4
4
|
.components-text {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
.edit-site-
|
|
17
|
+
.edit-site-patterns__grid {
|
|
18
18
|
column-gap: $grid-unit-30;
|
|
19
19
|
@include break-large() {
|
|
20
20
|
column-count: 2;
|
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
padding-top: $border-width-focus-fallback;
|
|
26
26
|
margin-bottom: $grid-unit-40;
|
|
27
27
|
|
|
28
|
-
.edit-site-
|
|
28
|
+
.edit-site-patterns__pattern {
|
|
29
29
|
break-inside: avoid-column;
|
|
30
30
|
display: flex;
|
|
31
31
|
flex-direction: column;
|
|
32
32
|
margin-bottom: $grid-unit-60;
|
|
33
33
|
|
|
34
|
-
.edit-site-
|
|
34
|
+
.edit-site-patterns__preview {
|
|
35
35
|
border-radius: $radius-block-ui;
|
|
36
36
|
cursor: pointer;
|
|
37
37
|
overflow: hidden;
|
|
@@ -48,12 +48,12 @@
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
.edit-site-
|
|
52
|
-
.edit-site-
|
|
51
|
+
.edit-site-patterns__footer,
|
|
52
|
+
.edit-site-patterns__button {
|
|
53
53
|
color: $gray-600;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
&.is-placeholder .edit-site-
|
|
56
|
+
&.is-placeholder .edit-site-patterns__preview {
|
|
57
57
|
min-height: $grid-unit-80;
|
|
58
58
|
color: $gray-600;
|
|
59
59
|
border: 1px dashed $gray-800;
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
.edit-site-
|
|
70
|
+
.edit-site-patterns__preview {
|
|
71
71
|
flex: 1;
|
|
72
72
|
margin-bottom: $grid-unit-20;
|
|
73
73
|
}
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
|
|
76
76
|
// The increased specificity here is to overcome component styles
|
|
77
77
|
// without relying on internal component class names.
|
|
78
|
-
.edit-site-
|
|
78
|
+
.edit-site-patterns__search {
|
|
79
79
|
&#{&} input[type="search"] {
|
|
80
80
|
background: $gray-800;
|
|
81
81
|
color: $gray-200;
|
|
@@ -90,16 +90,20 @@
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
.edit-site-
|
|
93
|
+
.edit-site-patterns__pattern-title {
|
|
94
94
|
color: $gray-600;
|
|
95
95
|
|
|
96
|
-
|
|
96
|
+
.edit-site-patterns__pattern-icon {
|
|
97
97
|
border-radius: $grid-unit-05;
|
|
98
98
|
background: var(--wp-block-synced-color);
|
|
99
99
|
fill: $white;
|
|
100
100
|
}
|
|
101
|
+
|
|
102
|
+
.edit-site-patterns__pattern-lock-icon {
|
|
103
|
+
display: inline-flex;
|
|
104
|
+
}
|
|
101
105
|
}
|
|
102
106
|
|
|
103
|
-
.edit-site-
|
|
107
|
+
.edit-site-patterns__no-results {
|
|
104
108
|
color: $gray-600;
|
|
105
109
|
}
|
|
@@ -12,7 +12,7 @@ import { unlock } from '../../lock-unlock';
|
|
|
12
12
|
import { store as editSiteStore } from '../../store';
|
|
13
13
|
import { filterOutDuplicatesByName } from './utils';
|
|
14
14
|
|
|
15
|
-
export default function
|
|
15
|
+
export default function usePatternSettings() {
|
|
16
16
|
const storedSettings = useSelect( ( select ) => {
|
|
17
17
|
const { getSettings } = unlock( select( editSiteStore ) );
|
|
18
18
|
return getSettings();
|
|
@@ -38,6 +38,15 @@ const templatePartToPattern = ( templatePart ) => ( {
|
|
|
38
38
|
templatePart,
|
|
39
39
|
} );
|
|
40
40
|
|
|
41
|
+
const templatePartCategories = [ 'header', 'footer', 'sidebar' ];
|
|
42
|
+
const templatePartHasCategory = ( item, category ) => {
|
|
43
|
+
if ( category === 'uncategorized' ) {
|
|
44
|
+
return ! templatePartCategories.includes( item.templatePart.area );
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return item.templatePart.area === category;
|
|
48
|
+
};
|
|
49
|
+
|
|
41
50
|
const useTemplatePartsAsPatterns = (
|
|
42
51
|
categoryId,
|
|
43
52
|
postType = TEMPLATE_PARTS,
|
|
@@ -83,7 +92,7 @@ const useTemplatePartsAsPatterns = (
|
|
|
83
92
|
|
|
84
93
|
return searchItems( templateParts, filterValue, {
|
|
85
94
|
categoryId,
|
|
86
|
-
hasCategory:
|
|
95
|
+
hasCategory: templatePartHasCategory,
|
|
87
96
|
} );
|
|
88
97
|
}, [ templateParts, filterValue, categoryId ] );
|
|
89
98
|
|
|
@@ -145,7 +154,7 @@ const reusableBlockToPattern = ( reusableBlock ) => ( {
|
|
|
145
154
|
categories: reusableBlock.wp_pattern,
|
|
146
155
|
id: reusableBlock.id,
|
|
147
156
|
name: reusableBlock.slug,
|
|
148
|
-
syncStatus: reusableBlock.meta?.sync_status,
|
|
157
|
+
syncStatus: reusableBlock.meta?.sync_status || SYNC_TYPES.full,
|
|
149
158
|
title: reusableBlock.title.raw,
|
|
150
159
|
type: reusableBlock.type,
|
|
151
160
|
reusableBlock,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export const DEFAULT_CATEGORY = '
|
|
2
|
-
export const DEFAULT_TYPE = '
|
|
1
|
+
export const DEFAULT_CATEGORY = 'my-patterns';
|
|
2
|
+
export const DEFAULT_TYPE = 'wp_block';
|
|
3
3
|
export const PATTERNS = 'pattern';
|
|
4
4
|
export const TEMPLATE_PARTS = 'wp_template_part';
|
|
5
5
|
export const USER_PATTERNS = 'wp_block';
|
|
6
|
-
export const USER_PATTERN_CATEGORY = '
|
|
6
|
+
export const USER_PATTERN_CATEGORY = 'my-patterns';
|
|
7
7
|
|
|
8
8
|
export const CORE_PATTERN_SOURCES = [
|
|
9
9
|
'core',
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
VisuallyHidden,
|
|
6
|
+
__experimentalHeading as Heading,
|
|
7
|
+
__experimentalVStack as VStack,
|
|
8
|
+
} from '@wordpress/components';
|
|
9
|
+
import { __ } from '@wordpress/i18n';
|
|
10
|
+
import { useSelect } from '@wordpress/data';
|
|
11
|
+
import { store as coreStore, useEntityRecords } from '@wordpress/core-data';
|
|
12
|
+
import { decodeEntities } from '@wordpress/html-entities';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Internal dependencies
|
|
16
|
+
*/
|
|
17
|
+
import Page from '../page';
|
|
18
|
+
import Table from '../table';
|
|
19
|
+
import Link from '../routes/link';
|
|
20
|
+
import AddedBy from '../list/added-by';
|
|
21
|
+
import TemplateActions from '../template-actions';
|
|
22
|
+
import AddNewTemplate from '../add-new-template';
|
|
23
|
+
import { store as editSiteStore } from '../../store';
|
|
24
|
+
|
|
25
|
+
export default function PageTemplateParts() {
|
|
26
|
+
const { records: templateParts } = useEntityRecords(
|
|
27
|
+
'postType',
|
|
28
|
+
'wp_template_part',
|
|
29
|
+
{
|
|
30
|
+
per_page: -1,
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
const { canCreate } = useSelect( ( select ) => {
|
|
35
|
+
const { supportsTemplatePartsMode } =
|
|
36
|
+
select( editSiteStore ).getSettings();
|
|
37
|
+
return {
|
|
38
|
+
postType: select( coreStore ).getPostType( 'wp_template_part' ),
|
|
39
|
+
canCreate: ! supportsTemplatePartsMode,
|
|
40
|
+
};
|
|
41
|
+
} );
|
|
42
|
+
|
|
43
|
+
const columns = [
|
|
44
|
+
{
|
|
45
|
+
header: __( 'Template Part' ),
|
|
46
|
+
cell: ( templatePart ) => (
|
|
47
|
+
<VStack>
|
|
48
|
+
<Heading level={ 5 }>
|
|
49
|
+
<Link
|
|
50
|
+
params={ {
|
|
51
|
+
postId: templatePart.id,
|
|
52
|
+
postType: templatePart.type,
|
|
53
|
+
canvas: 'view',
|
|
54
|
+
} }
|
|
55
|
+
state={ { backPath: '/wp_template_part/all' } }
|
|
56
|
+
>
|
|
57
|
+
{ decodeEntities(
|
|
58
|
+
templatePart.title?.rendered ||
|
|
59
|
+
templatePart.slug
|
|
60
|
+
) }
|
|
61
|
+
</Link>
|
|
62
|
+
</Heading>
|
|
63
|
+
</VStack>
|
|
64
|
+
),
|
|
65
|
+
maxWidth: 400,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
header: __( 'Added by' ),
|
|
69
|
+
cell: ( templatePart ) => (
|
|
70
|
+
<AddedBy
|
|
71
|
+
postType={ templatePart.type }
|
|
72
|
+
postId={ templatePart.id }
|
|
73
|
+
/>
|
|
74
|
+
),
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
header: <VisuallyHidden>{ __( 'Actions' ) }</VisuallyHidden>,
|
|
78
|
+
cell: ( templatePart ) => (
|
|
79
|
+
<TemplateActions
|
|
80
|
+
postType={ templatePart.type }
|
|
81
|
+
postId={ templatePart.id }
|
|
82
|
+
/>
|
|
83
|
+
),
|
|
84
|
+
},
|
|
85
|
+
];
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<Page
|
|
89
|
+
title={ __( 'Template Parts' ) }
|
|
90
|
+
actions={
|
|
91
|
+
canCreate && (
|
|
92
|
+
<AddNewTemplate
|
|
93
|
+
templateType={ 'wp_template_part' }
|
|
94
|
+
showIcon={ false }
|
|
95
|
+
toggleProps={ { variant: 'primary' } }
|
|
96
|
+
/>
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
>
|
|
100
|
+
{ templateParts && (
|
|
101
|
+
<Table data={ templateParts } columns={ columns } />
|
|
102
|
+
) }
|
|
103
|
+
</Page>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
@@ -12,9 +12,9 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
|
12
12
|
* Internal dependencies
|
|
13
13
|
*/
|
|
14
14
|
import SidebarNavigationScreenMain from '../sidebar-navigation-screen-main';
|
|
15
|
-
import SidebarNavigationScreenLibrary from '../sidebar-navigation-screen-library';
|
|
16
15
|
import SidebarNavigationScreenTemplates from '../sidebar-navigation-screen-templates';
|
|
17
16
|
import SidebarNavigationScreenTemplate from '../sidebar-navigation-screen-template';
|
|
17
|
+
import SidebarNavigationScreenPatterns from '../sidebar-navigation-screen-patterns';
|
|
18
18
|
import SidebarNavigationScreenPattern from '../sidebar-navigation-screen-pattern';
|
|
19
19
|
import useSyncPathWithURL, {
|
|
20
20
|
getPathFromURL,
|
|
@@ -56,15 +56,15 @@ function SidebarScreens() {
|
|
|
56
56
|
<NavigatorScreen path="/:postType(wp_template)">
|
|
57
57
|
<SidebarNavigationScreenTemplates />
|
|
58
58
|
</NavigatorScreen>
|
|
59
|
-
<NavigatorScreen path="/
|
|
60
|
-
<
|
|
59
|
+
<NavigatorScreen path="/patterns">
|
|
60
|
+
<SidebarNavigationScreenPatterns />
|
|
61
|
+
</NavigatorScreen>
|
|
62
|
+
<NavigatorScreen path="/:postType(wp_template|wp_template_part)/all">
|
|
63
|
+
<SidebarNavigationScreenTemplatesBrowse />
|
|
61
64
|
</NavigatorScreen>
|
|
62
65
|
<NavigatorScreen path="/:postType(wp_template_part|wp_block)/:postId">
|
|
63
66
|
<SidebarNavigationScreenPattern />
|
|
64
67
|
</NavigatorScreen>
|
|
65
|
-
<NavigatorScreen path="/:postType(wp_template)/all">
|
|
66
|
-
<SidebarNavigationScreenTemplatesBrowse />
|
|
67
|
-
</NavigatorScreen>
|
|
68
68
|
<NavigatorScreen path="/:postType(wp_template)/:postId">
|
|
69
69
|
<SidebarNavigationScreenTemplate />
|
|
70
70
|
</NavigatorScreen>
|
|
@@ -18,6 +18,12 @@ import { STORE_NAME } from '../../../store/constants';
|
|
|
18
18
|
import { SIDEBAR_BLOCK, SIDEBAR_TEMPLATE } from '../constants';
|
|
19
19
|
import { store as editSiteStore } from '../../../store';
|
|
20
20
|
|
|
21
|
+
const entityLabels = {
|
|
22
|
+
wp_navigation: __( 'Navigation' ),
|
|
23
|
+
wp_block: __( 'Pattern' ),
|
|
24
|
+
wp_template: __( 'Template' ),
|
|
25
|
+
};
|
|
26
|
+
|
|
21
27
|
const SettingsHeader = ( { sidebarName } ) => {
|
|
22
28
|
const { hasPageContentFocus, entityType } = useSelect( ( select ) => {
|
|
23
29
|
const { getEditedPostType, hasPageContentFocus: _hasPageContentFocus } =
|
|
@@ -29,8 +35,7 @@ const SettingsHeader = ( { sidebarName } ) => {
|
|
|
29
35
|
};
|
|
30
36
|
} );
|
|
31
37
|
|
|
32
|
-
const entityLabel =
|
|
33
|
-
entityType === 'wp_navigation' ? __( 'Navigation' ) : __( 'Template' );
|
|
38
|
+
const entityLabel = entityLabels[ entityType ] || entityLabels.wp_template;
|
|
34
39
|
|
|
35
40
|
const { enableComplementaryArea } = useDispatch( interfaceStore );
|
|
36
41
|
const openTemplateSettings = () =>
|