@wordpress/edit-site 6.11.0 → 6.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/components/app/index.js +0 -2
- package/build/components/app/index.js.map +1 -1
- package/build/components/block-editor/use-editor-iframe-props.js +6 -8
- package/build/components/block-editor/use-editor-iframe-props.js.map +1 -1
- package/build/components/editor/index.js +9 -4
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor/use-editor-title.js +29 -12
- package/build/components/editor/use-editor-title.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +24 -22
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/shadows-edit-panel.js +2 -3
- package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build/components/global-styles/ui.js +42 -2
- package/build/components/global-styles/ui.js.map +1 -1
- package/build/components/global-styles-renderer/index.js +6 -8
- package/build/components/global-styles-renderer/index.js.map +1 -1
- package/build/components/layout/hooks.js +1 -10
- package/build/components/layout/hooks.js.map +1 -1
- package/build/components/layout/index.js +1 -0
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page-patterns/fields.js +3 -7
- package/build/components/page-patterns/fields.js.map +1 -1
- package/build/components/page-templates/fields.js +1 -2
- package/build/components/page-templates/fields.js.map +1 -1
- package/build/components/post-edit/index.js +14 -8
- package/build/components/post-edit/index.js.map +1 -1
- package/build/components/post-fields/index.js +3 -197
- package/build/components/post-fields/index.js.map +1 -1
- package/build/components/post-list/index.js +11 -1
- package/build/components/post-list/index.js.map +1 -1
- package/build/components/sidebar/index.js +11 -3
- package/build/components/sidebar/index.js.map +1 -1
- package/build/components/sidebar-global-styles-wrapper/index.js +129 -0
- package/build/components/sidebar-global-styles-wrapper/index.js.map +1 -0
- package/build/components/sidebar-navigation-screen-global-styles/index.js +14 -72
- package/build/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build/components/sidebar-navigation-screen-main/index.js +43 -42
- package/build/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build/components/site-editor-routes/styles-edit.js +6 -1
- package/build/components/site-editor-routes/styles-edit.js.map +1 -1
- package/build/components/site-editor-routes/styles-view.js +8 -2
- package/build/components/site-editor-routes/styles-view.js.map +1 -1
- package/build/components/site-hub/index.js +19 -6
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/style-book/constants.js +10 -3
- package/build/components/style-book/constants.js.map +1 -1
- package/build/components/style-book/examples.js +71 -1
- package/build/components/style-book/examples.js.map +1 -1
- package/build/components/style-book/index.js +70 -11
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +32 -32
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/welcome-guide/index.js +4 -2
- package/build/components/welcome-guide/index.js.map +1 -1
- package/build/components/welcome-guide/page.js +1 -9
- package/build/components/welcome-guide/page.js.map +1 -1
- package/build/components/welcome-guide/template.js +1 -12
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +15 -15
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/posts.js +1 -0
- package/build/posts.js.map +1 -1
- package/build-module/components/app/index.js +0 -2
- package/build-module/components/app/index.js.map +1 -1
- package/build-module/components/block-editor/use-editor-iframe-props.js +6 -8
- package/build-module/components/block-editor/use-editor-iframe-props.js.map +1 -1
- package/build-module/components/editor/index.js +9 -4
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor/use-editor-title.js +29 -12
- package/build-module/components/editor/use-editor-title.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +25 -23
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/shadows-edit-panel.js +2 -3
- package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build-module/components/global-styles/ui.js +43 -3
- package/build-module/components/global-styles/ui.js.map +1 -1
- package/build-module/components/global-styles-renderer/index.js +6 -8
- package/build-module/components/global-styles-renderer/index.js.map +1 -1
- package/build-module/components/layout/hooks.js +1 -9
- package/build-module/components/layout/hooks.js.map +1 -1
- package/build-module/components/layout/index.js +1 -0
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page-patterns/fields.js +4 -8
- package/build-module/components/page-patterns/fields.js.map +1 -1
- package/build-module/components/page-templates/fields.js +1 -2
- package/build-module/components/page-templates/fields.js.map +1 -1
- package/build-module/components/post-edit/index.js +14 -8
- package/build-module/components/post-edit/index.js.map +1 -1
- package/build-module/components/post-fields/index.js +7 -202
- package/build-module/components/post-fields/index.js.map +1 -1
- package/build-module/components/post-list/index.js +11 -1
- package/build-module/components/post-list/index.js.map +1 -1
- package/build-module/components/sidebar/index.js +11 -3
- package/build-module/components/sidebar/index.js.map +1 -1
- package/build-module/components/sidebar-global-styles-wrapper/index.js +121 -0
- package/build-module/components/sidebar-global-styles-wrapper/index.js.map +1 -0
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js +15 -73
- package/build-module/components/sidebar-navigation-screen-global-styles/index.js.map +1 -1
- package/build-module/components/sidebar-navigation-screen-main/index.js +43 -43
- package/build-module/components/sidebar-navigation-screen-main/index.js.map +1 -1
- package/build-module/components/site-editor-routes/styles-edit.js +6 -1
- package/build-module/components/site-editor-routes/styles-edit.js.map +1 -1
- package/build-module/components/site-editor-routes/styles-view.js +8 -2
- package/build-module/components/site-editor-routes/styles-view.js.map +1 -1
- package/build-module/components/site-hub/index.js +19 -6
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/style-book/constants.js +10 -3
- package/build-module/components/style-book/constants.js.map +1 -1
- package/build-module/components/style-book/examples.js +71 -1
- package/build-module/components/style-book/examples.js.map +1 -1
- package/build-module/components/style-book/index.js +71 -12
- package/build-module/components/style-book/index.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +32 -32
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/welcome-guide/index.js +4 -2
- package/build-module/components/welcome-guide/index.js.map +1 -1
- package/build-module/components/welcome-guide/page.js +1 -9
- package/build-module/components/welcome-guide/page.js.map +1 -1
- package/build-module/components/welcome-guide/template.js +1 -11
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +15 -15
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/index.js +1 -0
- package/build-module/index.js.map +1 -1
- package/build-module/posts.js +1 -0
- package/build-module/posts.js.map +1 -1
- package/build-style/posts-rtl.css +54 -5
- package/build-style/posts.css +54 -5
- package/build-style/style-rtl.css +109 -28
- package/build-style/style.css +109 -28
- package/package.json +3 -4
- package/src/components/app/index.js +0 -2
- package/src/components/block-editor/use-editor-iframe-props.js +2 -3
- package/src/components/editor/index.js +16 -4
- package/src/components/editor/use-editor-title.js +37 -13
- package/src/components/editor-canvas-container/style.scss +0 -1
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +28 -31
- package/src/components/global-styles/screen-revisions/style.scss +11 -17
- package/src/components/global-styles/shadows-edit-panel.js +4 -2
- package/src/components/global-styles/ui.js +42 -2
- package/src/components/global-styles-renderer/index.js +4 -10
- package/src/components/layout/hooks.js +1 -7
- package/src/components/layout/index.js +6 -1
- package/src/components/page-patterns/fields.js +6 -12
- package/src/components/page-patterns/style.scss +0 -5
- package/src/components/page-templates/fields.js +2 -3
- package/src/components/post-edit/index.js +38 -30
- package/src/components/post-edit/style.scss +7 -0
- package/src/components/post-fields/index.js +19 -273
- package/src/components/post-list/index.js +9 -3
- package/src/components/post-list/style.scss +29 -3
- package/src/components/sidebar/index.js +23 -7
- package/src/components/sidebar-global-styles-wrapper/index.js +150 -0
- package/src/components/sidebar-global-styles-wrapper/style.scss +35 -0
- package/src/components/sidebar-navigation-item/style.scss +2 -2
- package/src/components/sidebar-navigation-screen-global-styles/index.js +13 -88
- package/src/components/sidebar-navigation-screen-main/index.js +46 -45
- package/src/components/site-editor-routes/styles-edit.js +10 -1
- package/src/components/site-editor-routes/styles-view.js +11 -1
- package/src/components/site-hub/index.js +33 -16
- package/src/components/site-icon/style.scss +16 -0
- package/src/components/style-book/constants.ts +11 -3
- package/src/components/style-book/examples.tsx +105 -1
- package/src/components/style-book/index.js +86 -8
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +54 -64
- package/src/components/welcome-guide/index.js +3 -3
- package/src/components/welcome-guide/page.js +1 -7
- package/src/components/welcome-guide/template.js +1 -8
- package/src/hooks/commands/use-common-commands.js +253 -246
- package/src/index.js +1 -0
- package/src/posts.js +1 -0
- package/src/style.scss +2 -3
- package/build/components/async/index.js +0 -51
- package/build/components/async/index.js.map +0 -1
- package/build/components/use-edited-entity-record/index.js +0 -60
- package/build/components/use-edited-entity-record/index.js.map +0 -1
- package/build/hooks/commands/use-edit-mode-commands.js +0 -179
- package/build/hooks/commands/use-edit-mode-commands.js.map +0 -1
- package/build-module/components/async/index.js +0 -44
- package/build-module/components/async/index.js.map +0 -1
- package/build-module/components/use-edited-entity-record/index.js +0 -53
- package/build-module/components/use-edited-entity-record/index.js.map +0 -1
- package/build-module/hooks/commands/use-edit-mode-commands.js +0 -171
- package/build-module/hooks/commands/use-edit-mode-commands.js.map +0 -1
- package/src/components/async/index.js +0 -43
- package/src/components/use-edited-entity-record/index.js +0 -58
- package/src/hooks/commands/use-edit-mode-commands.js +0 -168
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
import { useMemo, useState } from '@wordpress/element';
|
|
6
|
+
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
7
|
+
import { useViewportMatch } from '@wordpress/compose';
|
|
8
|
+
import { Button, privateApis as componentsPrivateApis } from '@wordpress/components';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Internal dependencies
|
|
12
|
+
*/
|
|
13
|
+
import GlobalStylesUI from '../global-styles/ui';
|
|
14
|
+
import Page from '../page';
|
|
15
|
+
import { unlock } from '../../lock-unlock';
|
|
16
|
+
import StyleBook from '../style-book';
|
|
17
|
+
import { STYLE_BOOK_COLOR_GROUPS } from '../style-book/constants';
|
|
18
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
19
|
+
const {
|
|
20
|
+
useLocation,
|
|
21
|
+
useHistory
|
|
22
|
+
} = unlock(routerPrivateApis);
|
|
23
|
+
const {
|
|
24
|
+
Menu
|
|
25
|
+
} = unlock(componentsPrivateApis);
|
|
26
|
+
const GLOBAL_STYLES_PATH_PREFIX = '/wp_global_styles';
|
|
27
|
+
const GlobalStylesPageActions = ({
|
|
28
|
+
isStyleBookOpened,
|
|
29
|
+
setIsStyleBookOpened
|
|
30
|
+
}) => {
|
|
31
|
+
return /*#__PURE__*/_jsxs(Menu, {
|
|
32
|
+
trigger: /*#__PURE__*/_jsx(Button, {
|
|
33
|
+
__next40pxDefaultSize: true,
|
|
34
|
+
variant: "tertiary",
|
|
35
|
+
size: "compact",
|
|
36
|
+
children: __('Preview')
|
|
37
|
+
}),
|
|
38
|
+
children: [/*#__PURE__*/_jsxs(Menu.RadioItem, {
|
|
39
|
+
value: true,
|
|
40
|
+
checked: isStyleBookOpened,
|
|
41
|
+
name: "styles-preview-actions",
|
|
42
|
+
onChange: () => setIsStyleBookOpened(true),
|
|
43
|
+
defaultChecked: true,
|
|
44
|
+
children: [/*#__PURE__*/_jsx(Menu.ItemLabel, {
|
|
45
|
+
children: __('Style book')
|
|
46
|
+
}), /*#__PURE__*/_jsx(Menu.ItemHelpText, {
|
|
47
|
+
children: __('Preview blocks and styles.')
|
|
48
|
+
})]
|
|
49
|
+
}), /*#__PURE__*/_jsxs(Menu.RadioItem, {
|
|
50
|
+
value: false,
|
|
51
|
+
checked: !isStyleBookOpened,
|
|
52
|
+
name: "styles-preview-actions",
|
|
53
|
+
onChange: () => setIsStyleBookOpened(false),
|
|
54
|
+
children: [/*#__PURE__*/_jsx(Menu.ItemLabel, {
|
|
55
|
+
children: __('Site')
|
|
56
|
+
}), /*#__PURE__*/_jsx(Menu.ItemHelpText, {
|
|
57
|
+
children: __('Preview your site.')
|
|
58
|
+
})]
|
|
59
|
+
})]
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
export default function GlobalStylesUIWrapper() {
|
|
63
|
+
const {
|
|
64
|
+
params
|
|
65
|
+
} = useLocation();
|
|
66
|
+
const history = useHistory();
|
|
67
|
+
const {
|
|
68
|
+
canvas = 'view'
|
|
69
|
+
} = params;
|
|
70
|
+
const [isStyleBookOpened, setIsStyleBookOpened] = useState(false);
|
|
71
|
+
const isMobileViewport = useViewportMatch('medium', '<');
|
|
72
|
+
const pathWithPrefix = params.path;
|
|
73
|
+
const [path, onPathChange] = useMemo(() => {
|
|
74
|
+
const processedPath = pathWithPrefix.substring(GLOBAL_STYLES_PATH_PREFIX.length);
|
|
75
|
+
return [processedPath ? processedPath : '/', newPath => {
|
|
76
|
+
history.push({
|
|
77
|
+
path: !newPath || newPath === '/' ? GLOBAL_STYLES_PATH_PREFIX : `${GLOBAL_STYLES_PATH_PREFIX}${newPath}`
|
|
78
|
+
});
|
|
79
|
+
}];
|
|
80
|
+
}, [pathWithPrefix, history]);
|
|
81
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
82
|
+
children: [/*#__PURE__*/_jsx(Page, {
|
|
83
|
+
actions: !isMobileViewport ? /*#__PURE__*/_jsx(GlobalStylesPageActions, {
|
|
84
|
+
isStyleBookOpened: isStyleBookOpened,
|
|
85
|
+
setIsStyleBookOpened: setIsStyleBookOpened
|
|
86
|
+
}) : null,
|
|
87
|
+
className: "edit-site-styles",
|
|
88
|
+
title: __('Styles'),
|
|
89
|
+
children: /*#__PURE__*/_jsx(GlobalStylesUI, {
|
|
90
|
+
path: path,
|
|
91
|
+
onPathChange: onPathChange
|
|
92
|
+
})
|
|
93
|
+
}), canvas === 'view' && isStyleBookOpened && /*#__PURE__*/_jsx(StyleBook, {
|
|
94
|
+
enableResizing: false,
|
|
95
|
+
showCloseButton: false,
|
|
96
|
+
showTabs: false,
|
|
97
|
+
isSelected: blockName =>
|
|
98
|
+
// Match '/blocks/core%2Fbutton' and
|
|
99
|
+
// '/blocks/core%2Fbutton/typography', but not
|
|
100
|
+
// '/blocks/core%2Fbuttons'.
|
|
101
|
+
path === `/wp_global_styles/blocks/${encodeURIComponent(blockName)}` || path.startsWith(`/wp_global_styles/blocks/${encodeURIComponent(blockName)}/`),
|
|
102
|
+
path: path,
|
|
103
|
+
onSelect: blockName => {
|
|
104
|
+
if (STYLE_BOOK_COLOR_GROUPS.find(group => group.slug === blockName)) {
|
|
105
|
+
// Go to color palettes Global Styles.
|
|
106
|
+
onPathChange('/colors/palette');
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
if (blockName === 'typography') {
|
|
110
|
+
// Go to typography Global Styles.
|
|
111
|
+
onPathChange('/typography');
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Now go to the selected block.
|
|
116
|
+
onPathChange(`/blocks/${encodeURIComponent(blockName)}`);
|
|
117
|
+
}
|
|
118
|
+
})]
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["__","useMemo","useState","privateApis","routerPrivateApis","useViewportMatch","Button","componentsPrivateApis","GlobalStylesUI","Page","unlock","StyleBook","STYLE_BOOK_COLOR_GROUPS","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","useLocation","useHistory","Menu","GLOBAL_STYLES_PATH_PREFIX","GlobalStylesPageActions","isStyleBookOpened","setIsStyleBookOpened","trigger","__next40pxDefaultSize","variant","size","children","RadioItem","value","checked","name","onChange","defaultChecked","ItemLabel","ItemHelpText","GlobalStylesUIWrapper","params","history","canvas","isMobileViewport","pathWithPrefix","path","onPathChange","processedPath","substring","length","newPath","push","actions","className","title","enableResizing","showCloseButton","showTabs","isSelected","blockName","encodeURIComponent","startsWith","onSelect","find","group","slug"],"sources":["@wordpress/edit-site/src/components/sidebar-global-styles-wrapper/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useMemo, useState } from '@wordpress/element';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tButton,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport GlobalStylesUI from '../global-styles/ui';\nimport Page from '../page';\nimport { unlock } from '../../lock-unlock';\nimport StyleBook from '../style-book';\nimport { STYLE_BOOK_COLOR_GROUPS } from '../style-book/constants';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\nconst { Menu } = unlock( componentsPrivateApis );\nconst GLOBAL_STYLES_PATH_PREFIX = '/wp_global_styles';\n\nconst GlobalStylesPageActions = ( {\n\tisStyleBookOpened,\n\tsetIsStyleBookOpened,\n} ) => {\n\treturn (\n\t\t<Menu\n\t\t\ttrigger={\n\t\t\t\t<Button __next40pxDefaultSize variant=\"tertiary\" size=\"compact\">\n\t\t\t\t\t{ __( 'Preview' ) }\n\t\t\t\t</Button>\n\t\t\t}\n\t\t>\n\t\t\t<Menu.RadioItem\n\t\t\t\tvalue\n\t\t\t\tchecked={ isStyleBookOpened }\n\t\t\t\tname=\"styles-preview-actions\"\n\t\t\t\tonChange={ () => setIsStyleBookOpened( true ) }\n\t\t\t\tdefaultChecked\n\t\t\t>\n\t\t\t\t<Menu.ItemLabel>{ __( 'Style book' ) }</Menu.ItemLabel>\n\t\t\t\t<Menu.ItemHelpText>\n\t\t\t\t\t{ __( 'Preview blocks and styles.' ) }\n\t\t\t\t</Menu.ItemHelpText>\n\t\t\t</Menu.RadioItem>\n\t\t\t<Menu.RadioItem\n\t\t\t\tvalue={ false }\n\t\t\t\tchecked={ ! isStyleBookOpened }\n\t\t\t\tname=\"styles-preview-actions\"\n\t\t\t\tonChange={ () => setIsStyleBookOpened( false ) }\n\t\t\t>\n\t\t\t\t<Menu.ItemLabel>{ __( 'Site' ) }</Menu.ItemLabel>\n\t\t\t\t<Menu.ItemHelpText>\n\t\t\t\t\t{ __( 'Preview your site.' ) }\n\t\t\t\t</Menu.ItemHelpText>\n\t\t\t</Menu.RadioItem>\n\t\t</Menu>\n\t);\n};\n\nexport default function GlobalStylesUIWrapper() {\n\tconst { params } = useLocation();\n\tconst history = useHistory();\n\tconst { canvas = 'view' } = params;\n\tconst [ isStyleBookOpened, setIsStyleBookOpened ] = useState( false );\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst pathWithPrefix = params.path;\n\tconst [ path, onPathChange ] = useMemo( () => {\n\t\tconst processedPath = pathWithPrefix.substring(\n\t\t\tGLOBAL_STYLES_PATH_PREFIX.length\n\t\t);\n\t\treturn [\n\t\t\tprocessedPath ? processedPath : '/',\n\t\t\t( newPath ) => {\n\t\t\t\thistory.push( {\n\t\t\t\t\tpath:\n\t\t\t\t\t\t! newPath || newPath === '/'\n\t\t\t\t\t\t\t? GLOBAL_STYLES_PATH_PREFIX\n\t\t\t\t\t\t\t: `${ GLOBAL_STYLES_PATH_PREFIX }${ newPath }`,\n\t\t\t\t} );\n\t\t\t},\n\t\t];\n\t}, [ pathWithPrefix, history ] );\n\n\treturn (\n\t\t<>\n\t\t\t<Page\n\t\t\t\tactions={\n\t\t\t\t\t! isMobileViewport ? (\n\t\t\t\t\t\t<GlobalStylesPageActions\n\t\t\t\t\t\t\tisStyleBookOpened={ isStyleBookOpened }\n\t\t\t\t\t\t\tsetIsStyleBookOpened={ setIsStyleBookOpened }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) : null\n\t\t\t\t}\n\t\t\t\tclassName=\"edit-site-styles\"\n\t\t\t\ttitle={ __( 'Styles' ) }\n\t\t\t>\n\t\t\t\t<GlobalStylesUI path={ path } onPathChange={ onPathChange } />\n\t\t\t</Page>\n\t\t\t{ canvas === 'view' && isStyleBookOpened && (\n\t\t\t\t<StyleBook\n\t\t\t\t\tenableResizing={ false }\n\t\t\t\t\tshowCloseButton={ false }\n\t\t\t\t\tshowTabs={ false }\n\t\t\t\t\tisSelected={ ( blockName ) =>\n\t\t\t\t\t\t// Match '/blocks/core%2Fbutton' and\n\t\t\t\t\t\t// '/blocks/core%2Fbutton/typography', but not\n\t\t\t\t\t\t// '/blocks/core%2Fbuttons'.\n\t\t\t\t\t\tpath ===\n\t\t\t\t\t\t\t`/wp_global_styles/blocks/${ encodeURIComponent(\n\t\t\t\t\t\t\t\tblockName\n\t\t\t\t\t\t\t) }` ||\n\t\t\t\t\t\tpath.startsWith(\n\t\t\t\t\t\t\t`/wp_global_styles/blocks/${ encodeURIComponent(\n\t\t\t\t\t\t\t\tblockName\n\t\t\t\t\t\t\t) }/`\n\t\t\t\t\t\t)\n\t\t\t\t\t}\n\t\t\t\t\tpath={ path }\n\t\t\t\t\tonSelect={ ( blockName ) => {\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tSTYLE_BOOK_COLOR_GROUPS.find(\n\t\t\t\t\t\t\t\t( group ) => group.slug === blockName\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t// Go to color palettes Global Styles.\n\t\t\t\t\t\t\tonPathChange( '/colors/palette' );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( blockName === 'typography' ) {\n\t\t\t\t\t\t\t// Go to typography Global Styles.\n\t\t\t\t\t\t\tonPathChange( '/typography' );\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Now go to the selected block.\n\t\t\t\t\t\tonPathChange(\n\t\t\t\t\t\t\t`/blocks/${ encodeURIComponent( blockName ) }`\n\t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E,iBAAkB,CAAC;UACjC;QACD;QACA,IAAKa,SAAS,KAAK,YAAY,EAAG;UACjC;UACAb,YAAY,CAAE,aAAc,CAAC;UAC7B;QACD;;QAEA;QACAA,YAAY,CACX,WAAYc,kBAAkB,CAAED,SAAU,CAAC,EAC5C,CAAC;MACF;IAAG,CACH,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
@@ -2,12 +2,9 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import { edit, seen } from '@wordpress/icons';
|
|
6
5
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
7
6
|
import { store as coreStore } from '@wordpress/core-data';
|
|
8
|
-
import { useViewportMatch } from '@wordpress/compose';
|
|
9
7
|
import { useCallback } from '@wordpress/element';
|
|
10
|
-
import { store as editorStore } from '@wordpress/editor';
|
|
11
8
|
import { store as preferencesStore } from '@wordpress/preferences';
|
|
12
9
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
13
10
|
|
|
@@ -17,22 +14,16 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
|
17
14
|
import SidebarNavigationScreen from '../sidebar-navigation-screen';
|
|
18
15
|
import { unlock } from '../../lock-unlock';
|
|
19
16
|
import { store as editSiteStore } from '../../store';
|
|
20
|
-
import SidebarButton from '../sidebar-button';
|
|
21
17
|
import SidebarNavigationItem from '../sidebar-navigation-item';
|
|
22
|
-
import StyleBook from '../style-book';
|
|
23
18
|
import useGlobalStylesRevisions from '../global-styles/screen-revisions/use-global-styles-revisions';
|
|
24
19
|
import SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';
|
|
25
|
-
import
|
|
26
|
-
import { jsx as _jsx, Fragment as _Fragment
|
|
20
|
+
import { MainSidebarNavigationContent } from '../sidebar-navigation-screen-main';
|
|
21
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
27
22
|
const {
|
|
28
23
|
useLocation,
|
|
29
24
|
useHistory
|
|
30
25
|
} = unlock(routerPrivateApis);
|
|
31
26
|
export function SidebarNavigationItemGlobalStyles(props) {
|
|
32
|
-
const {
|
|
33
|
-
openGeneralSidebar
|
|
34
|
-
} = useDispatch(editSiteStore);
|
|
35
|
-
const history = useHistory();
|
|
36
27
|
const {
|
|
37
28
|
params
|
|
38
29
|
} = useLocation();
|
|
@@ -43,34 +34,19 @@ export function SidebarNavigationItemGlobalStyles(props) {
|
|
|
43
34
|
params: {
|
|
44
35
|
path: '/wp_global_styles'
|
|
45
36
|
},
|
|
46
|
-
uid: "global-styles-navigation-item"
|
|
37
|
+
uid: "global-styles-navigation-item",
|
|
38
|
+
"aria-current": params.path && params.path.startsWith('/wp_global_styles')
|
|
47
39
|
});
|
|
48
40
|
}
|
|
49
41
|
return /*#__PURE__*/_jsx(SidebarNavigationItem, {
|
|
50
|
-
...props
|
|
51
|
-
onClick: () => {
|
|
52
|
-
// Switch to edit mode.
|
|
53
|
-
history.push({
|
|
54
|
-
...params,
|
|
55
|
-
canvas: 'edit'
|
|
56
|
-
}, undefined, {
|
|
57
|
-
transition: 'canvas-mode-edit-transition'
|
|
58
|
-
});
|
|
59
|
-
// Open global styles sidebar.
|
|
60
|
-
openGeneralSidebar('edit-site/global-styles');
|
|
61
|
-
}
|
|
42
|
+
...props
|
|
62
43
|
});
|
|
63
44
|
}
|
|
64
|
-
export default function SidebarNavigationScreenGlobalStyles({
|
|
65
|
-
backPath
|
|
66
|
-
}) {
|
|
45
|
+
export default function SidebarNavigationScreenGlobalStyles() {
|
|
67
46
|
const history = useHistory();
|
|
68
47
|
const {
|
|
69
48
|
params
|
|
70
49
|
} = useLocation();
|
|
71
|
-
const {
|
|
72
|
-
canvas = 'view'
|
|
73
|
-
} = params;
|
|
74
50
|
const {
|
|
75
51
|
revisions,
|
|
76
52
|
isLoading: isLoadingRevisions
|
|
@@ -78,21 +54,13 @@ export default function SidebarNavigationScreenGlobalStyles({
|
|
|
78
54
|
const {
|
|
79
55
|
openGeneralSidebar
|
|
80
56
|
} = useDispatch(editSiteStore);
|
|
81
|
-
const {
|
|
82
|
-
setIsListViewOpened
|
|
83
|
-
} = useDispatch(editorStore);
|
|
84
|
-
const isMobileViewport = useViewportMatch('medium', '<');
|
|
85
57
|
const {
|
|
86
58
|
setEditorCanvasContainerView
|
|
87
59
|
} = unlock(useDispatch(editSiteStore));
|
|
88
60
|
const {
|
|
89
|
-
isStyleBookOpened,
|
|
90
61
|
revisionsCount
|
|
91
62
|
} = useSelect(select => {
|
|
92
63
|
var _globalStyles$_links$;
|
|
93
|
-
const {
|
|
94
|
-
getEditorCanvasContainerView
|
|
95
|
-
} = unlock(select(editSiteStore));
|
|
96
64
|
const {
|
|
97
65
|
getEntityRecord,
|
|
98
66
|
__experimentalGetCurrentGlobalStylesId
|
|
@@ -100,7 +68,6 @@ export default function SidebarNavigationScreenGlobalStyles({
|
|
|
100
68
|
const globalStylesId = __experimentalGetCurrentGlobalStylesId();
|
|
101
69
|
const globalStyles = globalStylesId ? getEntityRecord('root', 'globalStyles', globalStylesId) : undefined;
|
|
102
70
|
return {
|
|
103
|
-
isStyleBookOpened: 'style-book' === getEditorCanvasContainerView(),
|
|
104
71
|
revisionsCount: (_globalStyles$_links$ = globalStyles?._links?.['version-history']?.[0]?.count) !== null && _globalStyles$_links$ !== void 0 ? _globalStyles$_links$ : 0
|
|
105
72
|
};
|
|
106
73
|
}, []);
|
|
@@ -116,14 +83,6 @@ export default function SidebarNavigationScreenGlobalStyles({
|
|
|
116
83
|
});
|
|
117
84
|
return Promise.all([setPreference('core', 'distractionFree', false), openGeneralSidebar('edit-site/global-styles')]);
|
|
118
85
|
}, [history, params, openGeneralSidebar, setPreference]);
|
|
119
|
-
const openStyleBook = useCallback(async () => {
|
|
120
|
-
await openGlobalStyles();
|
|
121
|
-
// Open the Style Book once the canvas mode is set to edit,
|
|
122
|
-
// and the global styles sidebar is open. This ensures that
|
|
123
|
-
// the Style Book is not prematurely closed.
|
|
124
|
-
setEditorCanvasContainerView('style-book');
|
|
125
|
-
setIsListViewOpened(false);
|
|
126
|
-
}, [openGlobalStyles, setEditorCanvasContainerView, setIsListViewOpened]);
|
|
127
86
|
const openRevisions = useCallback(async () => {
|
|
128
87
|
await openGlobalStyles();
|
|
129
88
|
// Open the global styles revisions once the canvas mode is set to edit,
|
|
@@ -137,36 +96,19 @@ export default function SidebarNavigationScreenGlobalStyles({
|
|
|
137
96
|
const hasRevisions = revisionsCount > 0;
|
|
138
97
|
const modifiedDateTime = revisions?.[0]?.modified;
|
|
139
98
|
const shouldShowGlobalStylesFooter = hasRevisions && !isLoadingRevisions && modifiedDateTime;
|
|
140
|
-
return /*#__PURE__*/
|
|
141
|
-
children:
|
|
142
|
-
title: __('
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
content: /*#__PURE__*/_jsx(
|
|
99
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
100
|
+
children: /*#__PURE__*/_jsx(SidebarNavigationScreen, {
|
|
101
|
+
title: __('Design'),
|
|
102
|
+
isRoot: true,
|
|
103
|
+
description: __('Customize the appearance of your website using the block editor.'),
|
|
104
|
+
content: /*#__PURE__*/_jsx(MainSidebarNavigationContent, {
|
|
105
|
+
activeItem: "styles-navigation-item"
|
|
106
|
+
}),
|
|
146
107
|
footer: shouldShowGlobalStylesFooter && /*#__PURE__*/_jsx(SidebarNavigationScreenDetailsFooter, {
|
|
147
108
|
record: revisions?.[0],
|
|
148
109
|
onClick: openRevisions
|
|
149
|
-
}),
|
|
150
|
-
actions: /*#__PURE__*/_jsxs(_Fragment, {
|
|
151
|
-
children: [!isMobileViewport && /*#__PURE__*/_jsx(SidebarButton, {
|
|
152
|
-
icon: seen,
|
|
153
|
-
label: __('Style Book'),
|
|
154
|
-
onClick: () => setEditorCanvasContainerView(!isStyleBookOpened ? 'style-book' : undefined),
|
|
155
|
-
isPressed: isStyleBookOpened
|
|
156
|
-
}), /*#__PURE__*/_jsx(SidebarButton, {
|
|
157
|
-
icon: edit,
|
|
158
|
-
label: __('Edit styles'),
|
|
159
|
-
onClick: async () => await openGlobalStyles()
|
|
160
|
-
})]
|
|
161
110
|
})
|
|
162
|
-
})
|
|
163
|
-
enableResizing: false,
|
|
164
|
-
isSelected: () => false,
|
|
165
|
-
onClick: openStyleBook,
|
|
166
|
-
onSelect: openStyleBook,
|
|
167
|
-
showCloseButton: false,
|
|
168
|
-
showTabs: false
|
|
169
|
-
})]
|
|
111
|
+
})
|
|
170
112
|
});
|
|
171
113
|
}
|
|
172
114
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__","edit","seen","useSelect","useDispatch","store","coreStore","useViewportMatch","useCallback","editorStore","preferencesStore","privateApis","routerPrivateApis","SidebarNavigationScreen","unlock","editSiteStore","SidebarButton","SidebarNavigationItem","StyleBook","useGlobalStylesRevisions","SidebarNavigationScreenDetailsFooter","SidebarNavigationScreenGlobalStylesContent","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","useLocation","useHistory","SidebarNavigationItemGlobalStyles","props","openGeneralSidebar","history","params","hasGlobalStyleVariations","select","__experimentalGetCurrentThemeGlobalStylesVariations","length","path","uid","onClick","push","canvas","undefined","transition","SidebarNavigationScreenGlobalStyles","backPath","revisions","isLoading","isLoadingRevisions","setIsListViewOpened","isMobileViewport","setEditorCanvasContainerView","isStyleBookOpened","revisionsCount","_globalStyles$_links$","getEditorCanvasContainerView","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","_links","count","set","setPreference","openGlobalStyles","Promise","all","openStyleBook","openRevisions","hasRevisions","modifiedDateTime","modified","shouldShowGlobalStylesFooter","children","title","description","content","footer","record","actions","icon","label","isPressed","enableResizing","isSelected","onSelect","showCloseButton","showTabs"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { edit, seen } from '@wordpress/icons';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useCallback } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport SidebarButton from '../sidebar-button';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport StyleBook from '../style-book';\nimport useGlobalStylesRevisions from '../global-styles/screen-revisions/use-global-styles-revisions';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\nimport SidebarNavigationScreenGlobalStylesContent from './content';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nexport function SidebarNavigationItemGlobalStyles( props ) {\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst history = useHistory();\n\tconst { params } = useLocation();\n\tconst hasGlobalStyleVariations = useSelect(\n\t\t( select ) =>\n\t\t\t!! select(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations()?.length,\n\t\t[]\n\t);\n\tif ( hasGlobalStyleVariations ) {\n\t\treturn (\n\t\t\t<SidebarNavigationItem\n\t\t\t\t{ ...props }\n\t\t\t\tparams={ { path: '/wp_global_styles' } }\n\t\t\t\tuid=\"global-styles-navigation-item\"\n\t\t\t/>\n\t\t);\n\t}\n\treturn (\n\t\t<SidebarNavigationItem\n\t\t\t{ ...props }\n\t\t\tonClick={ () => {\n\t\t\t\t// Switch to edit mode.\n\t\t\t\thistory.push(\n\t\t\t\t\t{\n\t\t\t\t\t\t...params,\n\t\t\t\t\t\tcanvas: 'edit',\n\t\t\t\t\t},\n\t\t\t\t\tundefined,\n\t\t\t\t\t{\n\t\t\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\t// Open global styles sidebar.\n\t\t\t\topenGeneralSidebar( 'edit-site/global-styles' );\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nexport default function SidebarNavigationScreenGlobalStyles( { backPath } ) {\n\tconst history = useHistory();\n\tconst { params } = useLocation();\n\tconst { canvas = 'view' } = params;\n\tconst { revisions, isLoading: isLoadingRevisions } =\n\t\tuseGlobalStylesRevisions();\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst { setIsListViewOpened } = useDispatch( editorStore );\n\tconst isMobileViewport = useViewportMatch( 'medium', '<' );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { isStyleBookOpened, revisionsCount } = useSelect( ( select ) => {\n\t\tconst { getEditorCanvasContainerView } = unlock(\n\t\t\tselect( editSiteStore )\n\t\t);\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\t\treturn {\n\t\t\tisStyleBookOpened: 'style-book' === getEditorCanvasContainerView(),\n\t\t\trevisionsCount:\n\t\t\t\tglobalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0,\n\t\t};\n\t}, [] );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst openGlobalStyles = useCallback( async () => {\n\t\thistory.push(\n\t\t\t{\n\t\t\t\t...params,\n\t\t\t\tcanvas: 'edit',\n\t\t\t},\n\t\t\tundefined,\n\t\t\t{\n\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t}\n\t\t);\n\t\treturn Promise.all( [\n\t\t\tsetPreference( 'core', 'distractionFree', false ),\n\t\t\topenGeneralSidebar( 'edit-site/global-styles' ),\n\t\t] );\n\t}, [ history, params, openGeneralSidebar, setPreference ] );\n\n\tconst openStyleBook = useCallback( async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the Style Book once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. This ensures that\n\t\t// the Style Book is not prematurely closed.\n\t\tsetEditorCanvasContainerView( 'style-book' );\n\t\tsetIsListViewOpened( false );\n\t}, [\n\t\topenGlobalStyles,\n\t\tsetEditorCanvasContainerView,\n\t\tsetIsListViewOpened,\n\t] );\n\n\tconst openRevisions = useCallback( async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the global styles revisions once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. The global styles UI is responsible\n\t\t// for redirecting to the revisions screen once the editor canvas container\n\t\t// has been set to 'global-styles-revisions'.\n\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t}, [ openGlobalStyles, setEditorCanvasContainerView ] );\n\n\t// If there are no revisions, do not render a footer.\n\tconst hasRevisions = revisionsCount > 0;\n\tconst modifiedDateTime = revisions?.[ 0 ]?.modified;\n\tconst shouldShowGlobalStylesFooter =\n\t\thasRevisions && ! isLoadingRevisions && modifiedDateTime;\n\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationScreen\n\t\t\t\ttitle={ __( 'Styles' ) }\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Choose a different style combination for the theme styles.'\n\t\t\t\t) }\n\t\t\t\tbackPath={ backPath }\n\t\t\t\tcontent={ <SidebarNavigationScreenGlobalStylesContent /> }\n\t\t\t\tfooter={\n\t\t\t\t\tshouldShowGlobalStylesFooter && (\n\t\t\t\t\t\t<SidebarNavigationScreenDetailsFooter\n\t\t\t\t\t\t\trecord={ revisions?.[ 0 ] }\n\t\t\t\t\t\t\tonClick={ openRevisions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tactions={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ ! isMobileViewport && (\n\t\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\t\ticon={ seen }\n\t\t\t\t\t\t\t\tlabel={ __( 'Style Book' ) }\n\t\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\t\tsetEditorCanvasContainerView(\n\t\t\t\t\t\t\t\t\t\t! isStyleBookOpened\n\t\t\t\t\t\t\t\t\t\t\t? 'style-book'\n\t\t\t\t\t\t\t\t\t\t\t: undefined\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\tisPressed={ isStyleBookOpened }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<SidebarButton\n\t\t\t\t\t\t\ticon={ edit }\n\t\t\t\t\t\t\tlabel={ __( 'Edit styles' ) }\n\t\t\t\t\t\t\tonClick={ async () => await openGlobalStyles() }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ isStyleBookOpened && ! isMobileViewport && canvas === 'view' && (\n\t\t\t\t<StyleBook\n\t\t\t\t\tenableResizing={ false }\n\t\t\t\t\tisSelected={ () => false }\n\t\t\t\t\tonClick={ openStyleBook }\n\t\t\t\t\tonSelect={ openStyleBook }\n\t\t\t\t\tshowCloseButton={ false }\n\t\t\t\t\tshowTabs={ false }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,IAAI,EAAEC,IAAI,QAAQ,kBAAkB;AAC7C,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASH,KAAK,IAAII,WAAW,QAAQ,mBAAmB;AACxD,SAASJ,KAAK,IAAIK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AAG4B,aAAe;MACzBkB,QAAQ,EAAGlB,aAAe;MAC1BmB,eAAe,EAAG,KAAO;MACzBC,QAAQ,EAAG;IAAO,CAClB,CACD;EAAA,CACA,CAAC;AAEL","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["__","useSelect","useDispatch","store","coreStore","useCallback","preferencesStore","privateApis","routerPrivateApis","SidebarNavigationScreen","unlock","editSiteStore","SidebarNavigationItem","useGlobalStylesRevisions","SidebarNavigationScreenDetailsFooter","MainSidebarNavigationContent","jsx","_jsx","Fragment","_Fragment","useLocation","useHistory","SidebarNavigationItemGlobalStyles","props","params","hasGlobalStyleVariations","select","__experimentalGetCurrentThemeGlobalStylesVariations","length","path","uid","startsWith","SidebarNavigationScreenGlobalStyles","history","revisions","isLoading","isLoadingRevisions","openGeneralSidebar","setEditorCanvasContainerView","revisionsCount","_globalStyles$_links$","getEntityRecord","__experimentalGetCurrentGlobalStylesId","globalStylesId","globalStyles","undefined","_links","count","set","setPreference","openGlobalStyles","push","canvas","transition","Promise","all","openRevisions","hasRevisions","modifiedDateTime","modified","shouldShowGlobalStylesFooter","children","title","isRoot","description","content","activeItem","footer","record","onClick"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-global-styles/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useCallback } from '@wordpress/element';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport useGlobalStylesRevisions from '../global-styles/screen-revisions/use-global-styles-revisions';\nimport SidebarNavigationScreenDetailsFooter from '../sidebar-navigation-screen-details-footer';\nimport { MainSidebarNavigationContent } from '../sidebar-navigation-screen-main';\n\nconst { useLocation, useHistory } = unlock( routerPrivateApis );\n\nexport function SidebarNavigationItemGlobalStyles( props ) {\n\tconst { params } = useLocation();\n\tconst hasGlobalStyleVariations = useSelect(\n\t\t( select ) =>\n\t\t\t!! select(\n\t\t\t\tcoreStore\n\t\t\t).__experimentalGetCurrentThemeGlobalStylesVariations()?.length,\n\t\t[]\n\t);\n\tif ( hasGlobalStyleVariations ) {\n\t\treturn (\n\t\t\t<SidebarNavigationItem\n\t\t\t\t{ ...props }\n\t\t\t\tparams={ { path: '/wp_global_styles' } }\n\t\t\t\tuid=\"global-styles-navigation-item\"\n\t\t\t\taria-current={\n\t\t\t\t\tparams.path && params.path.startsWith( '/wp_global_styles' )\n\t\t\t\t}\n\t\t\t/>\n\t\t);\n\t}\n\treturn <SidebarNavigationItem { ...props } />;\n}\n\nexport default function SidebarNavigationScreenGlobalStyles() {\n\tconst history = useHistory();\n\tconst { params } = useLocation();\n\tconst { revisions, isLoading: isLoadingRevisions } =\n\t\tuseGlobalStylesRevisions();\n\tconst { openGeneralSidebar } = useDispatch( editSiteStore );\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\tconst { revisionsCount } = useSelect( ( select ) => {\n\t\tconst { getEntityRecord, __experimentalGetCurrentGlobalStylesId } =\n\t\t\tselect( coreStore );\n\t\tconst globalStylesId = __experimentalGetCurrentGlobalStylesId();\n\t\tconst globalStyles = globalStylesId\n\t\t\t? getEntityRecord( 'root', 'globalStyles', globalStylesId )\n\t\t\t: undefined;\n\t\treturn {\n\t\t\trevisionsCount:\n\t\t\t\tglobalStyles?._links?.[ 'version-history' ]?.[ 0 ]?.count ?? 0,\n\t\t};\n\t}, [] );\n\tconst { set: setPreference } = useDispatch( preferencesStore );\n\n\tconst openGlobalStyles = useCallback( async () => {\n\t\thistory.push(\n\t\t\t{\n\t\t\t\t...params,\n\t\t\t\tcanvas: 'edit',\n\t\t\t},\n\t\t\tundefined,\n\t\t\t{\n\t\t\t\ttransition: 'canvas-mode-edit-transition',\n\t\t\t}\n\t\t);\n\t\treturn Promise.all( [\n\t\t\tsetPreference( 'core', 'distractionFree', false ),\n\t\t\topenGeneralSidebar( 'edit-site/global-styles' ),\n\t\t] );\n\t}, [ history, params, openGeneralSidebar, setPreference ] );\n\n\tconst openRevisions = useCallback( async () => {\n\t\tawait openGlobalStyles();\n\t\t// Open the global styles revisions once the canvas mode is set to edit,\n\t\t// and the global styles sidebar is open. The global styles UI is responsible\n\t\t// for redirecting to the revisions screen once the editor canvas container\n\t\t// has been set to 'global-styles-revisions'.\n\t\tsetEditorCanvasContainerView( 'global-styles-revisions' );\n\t}, [ openGlobalStyles, setEditorCanvasContainerView ] );\n\n\t// If there are no revisions, do not render a footer.\n\tconst hasRevisions = revisionsCount > 0;\n\tconst modifiedDateTime = revisions?.[ 0 ]?.modified;\n\tconst shouldShowGlobalStylesFooter =\n\t\thasRevisions && ! isLoadingRevisions && modifiedDateTime;\n\treturn (\n\t\t<>\n\t\t\t<SidebarNavigationScreen\n\t\t\t\ttitle={ __( 'Design' ) }\n\t\t\t\tisRoot\n\t\t\t\tdescription={ __(\n\t\t\t\t\t'Customize the appearance of your website using the block editor.'\n\t\t\t\t) }\n\t\t\t\tcontent={\n\t\t\t\t\t<MainSidebarNavigationContent activeItem=\"styles-navigation-item\" />\n\t\t\t\t}\n\t\t\t\tfooter={\n\t\t\t\t\tshouldShowGlobalStylesFooter && (\n\t\t\t\t\t\t<SidebarNavigationScreenDetailsFooter\n\t\t\t\t\t\t\trecord={ revisions?.[ 0 ] }\n\t\t\t\t\t\t\tonClick={ openRevisions }\n\t\t\t\t\t\t/>\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,KAAK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A0B,CAAC,CAC9C,CAAC;EACJ,CAAC,EAAE,CAAEJ,OAAO,EAAET,MAAM,EAAEa,kBAAkB,EAAEY,aAAa,CAAG,CAAC;EAE3D,MAAMO,aAAa,GAAGnD,WAAW,CAAE,YAAY;IAC9C,MAAM6C,gBAAgB,CAAC,CAAC;IACxB;IACA;IACA;IACA;IACAZ,4BAA4B,CAAE,yBAA0B,CAAC;EAC1D,CAAC,EAAE,CAAEY,gBAAgB,EAAEZ,4BAA4B,CAAG,CAAC;;EAEvD;EACA,MAAMmB,YAAY,GAAGlB,cAAc,GAAG,CAAC;EACvC,MAAMmB,gBAAgB,GAAGxB,SAAS,GAAI,CAAC,CAAE,EAAEyB,QAAQ;EACnD,MAAMC,4BAA4B,GACjCH,YAAY,IAAI,CAAErB,kBAAkB,IAAIsB,gBAAgB;EACzD,oBACCzC,IAAA,CAAAE,SAAA;IAAA0C,QAAA,eACC5C,IAAA,CAACR,uBAAuB;MACvBqD,KAAK,EAAG9D,EAAE,CAAE,QAAS,CAAG;MACxB+D,MAAM;MACNC,WAAW,EAAGhE,EAAE,CACf,kEACD,CAAG;MACHiE,OAAO,eACNhD,IAAA,CAACF,4BAA4B;QAACmD,UAAU,EAAC;MAAwB,CAAE,CACnE;MACDC,MAAM,EACLP,4BAA4B,iBAC3B3C,IAAA,CAACH,oCAAoC;QACpCsD,MAAM,EAAGlC,SAAS,GAAI,CAAC,CAAI;QAC3BmC,OAAO,EAAGb;MAAe,CACzB;IAEF,CACD;EAAC,CACD,CAAC;AAEL","ignoreList":[]}
|
|
@@ -16,7 +16,48 @@ import { SidebarNavigationItemGlobalStyles } from '../sidebar-navigation-screen-
|
|
|
16
16
|
import { unlock } from '../../lock-unlock';
|
|
17
17
|
import { store as editSiteStore } from '../../store';
|
|
18
18
|
import { NAVIGATION_POST_TYPE, TEMPLATE_POST_TYPE, PATTERN_TYPES } from '../../utils/constants';
|
|
19
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
19
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
+
export function MainSidebarNavigationContent() {
|
|
21
|
+
return /*#__PURE__*/_jsxs(ItemGroup, {
|
|
22
|
+
children: [/*#__PURE__*/_jsx(SidebarNavigationItem, {
|
|
23
|
+
uid: "navigation-navigation-item",
|
|
24
|
+
params: {
|
|
25
|
+
postType: NAVIGATION_POST_TYPE
|
|
26
|
+
},
|
|
27
|
+
withChevron: true,
|
|
28
|
+
icon: navigation,
|
|
29
|
+
children: __('Navigation')
|
|
30
|
+
}), /*#__PURE__*/_jsx(SidebarNavigationItemGlobalStyles, {
|
|
31
|
+
uid: "styles-navigation-item",
|
|
32
|
+
icon: styles,
|
|
33
|
+
children: __('Styles')
|
|
34
|
+
}), /*#__PURE__*/_jsx(SidebarNavigationItem, {
|
|
35
|
+
uid: "page-navigation-item",
|
|
36
|
+
params: {
|
|
37
|
+
postType: 'page'
|
|
38
|
+
},
|
|
39
|
+
withChevron: true,
|
|
40
|
+
icon: page,
|
|
41
|
+
children: __('Pages')
|
|
42
|
+
}), /*#__PURE__*/_jsx(SidebarNavigationItem, {
|
|
43
|
+
uid: "template-navigation-item",
|
|
44
|
+
params: {
|
|
45
|
+
postType: TEMPLATE_POST_TYPE
|
|
46
|
+
},
|
|
47
|
+
withChevron: true,
|
|
48
|
+
icon: layout,
|
|
49
|
+
children: __('Templates')
|
|
50
|
+
}), /*#__PURE__*/_jsx(SidebarNavigationItem, {
|
|
51
|
+
uid: "patterns-navigation-item",
|
|
52
|
+
params: {
|
|
53
|
+
postType: PATTERN_TYPES.user
|
|
54
|
+
},
|
|
55
|
+
withChevron: true,
|
|
56
|
+
icon: symbol,
|
|
57
|
+
children: __('Patterns')
|
|
58
|
+
})]
|
|
59
|
+
});
|
|
60
|
+
}
|
|
20
61
|
export default function SidebarNavigationScreenMain() {
|
|
21
62
|
const {
|
|
22
63
|
setEditorCanvasContainerView
|
|
@@ -30,48 +71,7 @@ export default function SidebarNavigationScreenMain() {
|
|
|
30
71
|
isRoot: true,
|
|
31
72
|
title: __('Design'),
|
|
32
73
|
description: __('Customize the appearance of your website using the block editor.'),
|
|
33
|
-
content: /*#__PURE__*/_jsx(
|
|
34
|
-
children: /*#__PURE__*/_jsxs(ItemGroup, {
|
|
35
|
-
children: [/*#__PURE__*/_jsx(SidebarNavigationItem, {
|
|
36
|
-
uid: "navigation-navigation-item",
|
|
37
|
-
params: {
|
|
38
|
-
postType: NAVIGATION_POST_TYPE
|
|
39
|
-
},
|
|
40
|
-
withChevron: true,
|
|
41
|
-
icon: navigation,
|
|
42
|
-
children: __('Navigation')
|
|
43
|
-
}), /*#__PURE__*/_jsx(SidebarNavigationItemGlobalStyles, {
|
|
44
|
-
uid: "styles-navigation-item",
|
|
45
|
-
withChevron: true,
|
|
46
|
-
icon: styles,
|
|
47
|
-
children: __('Styles')
|
|
48
|
-
}), /*#__PURE__*/_jsx(SidebarNavigationItem, {
|
|
49
|
-
uid: "page-navigation-item",
|
|
50
|
-
params: {
|
|
51
|
-
postType: 'page'
|
|
52
|
-
},
|
|
53
|
-
withChevron: true,
|
|
54
|
-
icon: page,
|
|
55
|
-
children: __('Pages')
|
|
56
|
-
}), /*#__PURE__*/_jsx(SidebarNavigationItem, {
|
|
57
|
-
uid: "template-navigation-item",
|
|
58
|
-
params: {
|
|
59
|
-
postType: TEMPLATE_POST_TYPE
|
|
60
|
-
},
|
|
61
|
-
withChevron: true,
|
|
62
|
-
icon: layout,
|
|
63
|
-
children: __('Templates')
|
|
64
|
-
}), /*#__PURE__*/_jsx(SidebarNavigationItem, {
|
|
65
|
-
uid: "patterns-navigation-item",
|
|
66
|
-
params: {
|
|
67
|
-
postType: PATTERN_TYPES.user
|
|
68
|
-
},
|
|
69
|
-
withChevron: true,
|
|
70
|
-
icon: symbol,
|
|
71
|
-
children: __('Patterns')
|
|
72
|
-
})]
|
|
73
|
-
})
|
|
74
|
-
})
|
|
74
|
+
content: /*#__PURE__*/_jsx(MainSidebarNavigationContent, {})
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
77
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__experimentalItemGroup","ItemGroup","__","layout","symbol","navigation","styles","page","useDispatch","useEffect","SidebarNavigationScreen","SidebarNavigationItem","SidebarNavigationItemGlobalStyles","unlock","store","editSiteStore","NAVIGATION_POST_TYPE","TEMPLATE_POST_TYPE","PATTERN_TYPES","jsx","_jsx","jsxs","_jsxs","
|
|
1
|
+
{"version":3,"names":["__experimentalItemGroup","ItemGroup","__","layout","symbol","navigation","styles","page","useDispatch","useEffect","SidebarNavigationScreen","SidebarNavigationItem","SidebarNavigationItemGlobalStyles","unlock","store","editSiteStore","NAVIGATION_POST_TYPE","TEMPLATE_POST_TYPE","PATTERN_TYPES","jsx","_jsx","jsxs","_jsxs","MainSidebarNavigationContent","children","uid","params","postType","withChevron","icon","user","SidebarNavigationScreenMain","setEditorCanvasContainerView","undefined","isRoot","title","description","content"],"sources":["@wordpress/edit-site/src/components/sidebar-navigation-screen-main/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalItemGroup as ItemGroup } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { layout, symbol, navigation, styles, page } from '@wordpress/icons';\nimport { useDispatch } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport SidebarNavigationScreen from '../sidebar-navigation-screen';\nimport SidebarNavigationItem from '../sidebar-navigation-item';\nimport { SidebarNavigationItemGlobalStyles } from '../sidebar-navigation-screen-global-styles';\nimport { unlock } from '../../lock-unlock';\nimport { store as editSiteStore } from '../../store';\nimport {\n\tNAVIGATION_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n\tPATTERN_TYPES,\n} from '../../utils/constants';\n\nexport function MainSidebarNavigationContent() {\n\treturn (\n\t\t<ItemGroup>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"navigation-navigation-item\"\n\t\t\t\tparams={ { postType: NAVIGATION_POST_TYPE } }\n\t\t\t\twithChevron\n\t\t\t\ticon={ navigation }\n\t\t\t>\n\t\t\t\t{ __( 'Navigation' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t<SidebarNavigationItemGlobalStyles\n\t\t\t\tuid=\"styles-navigation-item\"\n\t\t\t\ticon={ styles }\n\t\t\t>\n\t\t\t\t{ __( 'Styles' ) }\n\t\t\t</SidebarNavigationItemGlobalStyles>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"page-navigation-item\"\n\t\t\t\tparams={ { postType: 'page' } }\n\t\t\t\twithChevron\n\t\t\t\ticon={ page }\n\t\t\t>\n\t\t\t\t{ __( 'Pages' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"template-navigation-item\"\n\t\t\t\tparams={ { postType: TEMPLATE_POST_TYPE } }\n\t\t\t\twithChevron\n\t\t\t\ticon={ layout }\n\t\t\t>\n\t\t\t\t{ __( 'Templates' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t\t<SidebarNavigationItem\n\t\t\t\tuid=\"patterns-navigation-item\"\n\t\t\t\tparams={ { postType: PATTERN_TYPES.user } }\n\t\t\t\twithChevron\n\t\t\t\ticon={ symbol }\n\t\t\t>\n\t\t\t\t{ __( 'Patterns' ) }\n\t\t\t</SidebarNavigationItem>\n\t\t</ItemGroup>\n\t);\n}\n\nexport default function SidebarNavigationScreenMain() {\n\tconst { setEditorCanvasContainerView } = unlock(\n\t\tuseDispatch( editSiteStore )\n\t);\n\n\t// Clear the editor canvas container view when accessing the main navigation screen.\n\tuseEffect( () => {\n\t\tsetEditorCanvasContainerView( undefined );\n\t}, [ setEditorCanvasContainerView ] );\n\n\treturn (\n\t\t<SidebarNavigationScreen\n\t\t\tisRoot\n\t\t\ttitle={ __( 'Design' ) }\n\t\t\tdescription={ __(\n\t\t\t\t'Customize the appearance of your website using the block editor.'\n\t\t\t) }\n\t\t\t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AM;MAAAiB,QAAA,EAEXtB,EAAE,CAAE,OAAQ;IAAC,CACO,CAAC,eACxBkB,IAAA,CAACT,qBAAqB;MACrBc,GAAG,EAAC,0BAA0B;MAC9BC,MAAM,EAAG;QAAEC,QAAQ,EAAEV;MAAmB,CAAG;MAC3CW,WAAW;MACXC,IAAI,EAAG1B,MAAQ;MAAAqB,QAAA,EAEbtB,EAAE,CAAE,WAAY;IAAC,CACG,CAAC,eACxBkB,IAAA,CAACT,qBAAqB;MACrBc,GAAG,EAAC,0BAA0B;MAC9BC,MAAM,EAAG;QAAEC,QAAQ,EAAET,aAAa,CAACY;MAAK,CAAG;MAC3CF,WAAW;MACXC,IAAI,EAAGzB,MAAQ;MAAAoB,QAAA,EAEbtB,EAAE,CAAE,UAAW;IAAC,CACI,CAAC;EAAA,CACd,CAAC;AAEd;AAEA,eAAe,SAAS6B,2BAA2BA,CAAA,EAAG;EACrD,MAAM;IAAEC;EAA6B,CAAC,GAAGnB,MAAM,CAC9CL,WAAW,CAAEO,aAAc,CAC5B,CAAC;;EAED;EACAN,SAAS,CAAE,MAAM;IAChBuB,4BAA4B,CAAEC,SAAU,CAAC;EAC1C,CAAC,EAAE,CAAED,4BAA4B,CAAG,CAAC;EAErC,oBACCZ,IAAA,CAACV,uBAAuB;IACvBwB,MAAM;IACNC,KAAK,EAAGjC,EAAE,CAAE,QAAS,CAAG;IACxBkC,WAAW,EAAGlC,EAAE,CACf,kEACD,CAAG;IACHmC,OAAO,eAAGjB,IAAA,CAACG,4BAA4B,IAAE;EAAG,CAC5C,CAAC;AAEJ","ignoreList":[]}
|
|
@@ -3,18 +3,23 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import Editor from '../editor';
|
|
5
5
|
import SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-global-styles';
|
|
6
|
+
import GlobalStylesUIWrapper from '../sidebar-global-styles-wrapper';
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
8
|
export const stylesEditRoute = {
|
|
8
9
|
name: 'styles-edit',
|
|
9
10
|
match: params => {
|
|
10
|
-
return params.path
|
|
11
|
+
return params.path && params.path.startsWith('/wp_global_styles') && params.canvas !== 'edit';
|
|
11
12
|
},
|
|
12
13
|
areas: {
|
|
14
|
+
content: /*#__PURE__*/_jsx(GlobalStylesUIWrapper, {}),
|
|
13
15
|
sidebar: /*#__PURE__*/_jsx(SidebarNavigationScreenGlobalStyles, {
|
|
14
16
|
backPath: {}
|
|
15
17
|
}),
|
|
16
18
|
preview: /*#__PURE__*/_jsx(Editor, {}),
|
|
17
19
|
mobile: /*#__PURE__*/_jsx(Editor, {})
|
|
20
|
+
},
|
|
21
|
+
widths: {
|
|
22
|
+
content: 380
|
|
18
23
|
}
|
|
19
24
|
};
|
|
20
25
|
//# sourceMappingURL=styles-edit.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Editor","SidebarNavigationScreenGlobalStyles","jsx","_jsx","stylesEditRoute","name","match","params","path","canvas","areas","sidebar","backPath","preview","mobile"],"sources":["@wordpress/edit-site/src/components/site-editor-routes/styles-edit.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport Editor from '../editor';\nimport SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-global-styles';\n\nexport const stylesEditRoute = {\n\tname: 'styles-edit',\n\tmatch: ( params ) => {\n\t\treturn
|
|
1
|
+
{"version":3,"names":["Editor","SidebarNavigationScreenGlobalStyles","GlobalStylesUIWrapper","jsx","_jsx","stylesEditRoute","name","match","params","path","startsWith","canvas","areas","content","sidebar","backPath","preview","mobile","widths"],"sources":["@wordpress/edit-site/src/components/site-editor-routes/styles-edit.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport Editor from '../editor';\nimport SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-global-styles';\nimport GlobalStylesUIWrapper from '../sidebar-global-styles-wrapper';\n\nexport const stylesEditRoute = {\n\tname: 'styles-edit',\n\tmatch: ( params ) => {\n\t\treturn (\n\t\t\tparams.path &&\n\t\t\tparams.path.startsWith( '/wp_global_styles' ) &&\n\t\t\tparams.canvas !== 'edit'\n\t\t);\n\t},\n\tareas: {\n\t\tcontent: <GlobalStylesUIWrapper />,\n\t\tsidebar: <SidebarNavigationScreenGlobalStyles backPath={ {} } />,\n\t\tpreview: <Editor />,\n\t\tmobile: <Editor />,\n\t},\n\twidths: {\n\t\tcontent: 380,\n\t},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,MAAM,MAAM,WAAW;AAC9B,OAAOC,mCAAmC,MAAM,4CAA4C;AAC5F,OAAOC,qBAAqB,MAAM,kCAAkC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAErE,OAAO,MAAMC,eAAe,GAAG;EAC9BC,IAAI,EAAE,aAAa;EACnBC,KAAK,EAAIC,MAAM,IAAM;IACpB,OACCA,MAAM,CAACC,IAAI,IACXD,MAAM,CAACC,IAAI,CAACC,UAAU,CAAE,mBAAoB,CAAC,IAC7CF,MAAM,CAACG,MAAM,KAAK,MAAM;EAE1B,CAAC;EACDC,KAAK,EAAE;IACNC,OAAO,eAAET,IAAA,CAACF,qBAAqB,IAAE,CAAC;IAClCY,OAAO,eAAEV,IAAA,CAACH,mCAAmC;MAACc,QAAQ,EAAG,CAAC;IAAG,CAAE,CAAC;IAChEC,OAAO,eAAEZ,IAAA,CAACJ,MAAM,IAAE,CAAC;IACnBiB,MAAM,eAAEb,IAAA,CAACJ,MAAM,IAAE;EAClB,CAAC;EACDkB,MAAM,EAAE;IACPL,OAAO,EAAE;EACV;AACD,CAAC","ignoreList":[]}
|
|
@@ -3,17 +3,23 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import Editor from '../editor';
|
|
5
5
|
import SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-global-styles';
|
|
6
|
+
import GlobalStylesUIWrapper from '../sidebar-global-styles-wrapper';
|
|
6
7
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
8
|
export const stylesViewRoute = {
|
|
8
9
|
name: 'styles-view',
|
|
9
10
|
match: params => {
|
|
10
|
-
return params.path
|
|
11
|
+
return params.path && params.path.startsWith('/wp_global_styles') && params.canvas !== 'edit';
|
|
11
12
|
},
|
|
12
13
|
areas: {
|
|
14
|
+
content: /*#__PURE__*/_jsx(GlobalStylesUIWrapper, {}),
|
|
13
15
|
sidebar: /*#__PURE__*/_jsx(SidebarNavigationScreenGlobalStyles, {
|
|
14
16
|
backPath: {}
|
|
15
17
|
}),
|
|
16
|
-
preview: /*#__PURE__*/_jsx(Editor, {})
|
|
18
|
+
preview: /*#__PURE__*/_jsx(Editor, {}),
|
|
19
|
+
mobile: /*#__PURE__*/_jsx(GlobalStylesUIWrapper, {})
|
|
20
|
+
},
|
|
21
|
+
widths: {
|
|
22
|
+
content: 380
|
|
17
23
|
}
|
|
18
24
|
};
|
|
19
25
|
//# sourceMappingURL=styles-view.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Editor","SidebarNavigationScreenGlobalStyles","jsx","_jsx","stylesViewRoute","name","match","params","path","canvas","areas","sidebar","backPath","preview"],"sources":["@wordpress/edit-site/src/components/site-editor-routes/styles-view.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport Editor from '../editor';\nimport SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-global-styles';\n\nexport const stylesViewRoute = {\n\tname: 'styles-view',\n\tmatch: ( params ) => {\n\t\treturn
|
|
1
|
+
{"version":3,"names":["Editor","SidebarNavigationScreenGlobalStyles","GlobalStylesUIWrapper","jsx","_jsx","stylesViewRoute","name","match","params","path","startsWith","canvas","areas","content","sidebar","backPath","preview","mobile","widths"],"sources":["@wordpress/edit-site/src/components/site-editor-routes/styles-view.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport Editor from '../editor';\nimport SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-global-styles';\nimport GlobalStylesUIWrapper from '../sidebar-global-styles-wrapper';\n\nexport const stylesViewRoute = {\n\tname: 'styles-view',\n\tmatch: ( params ) => {\n\t\treturn (\n\t\t\tparams.path &&\n\t\t\tparams.path.startsWith( '/wp_global_styles' ) &&\n\t\t\tparams.canvas !== 'edit'\n\t\t);\n\t},\n\tareas: {\n\t\tcontent: <GlobalStylesUIWrapper />,\n\t\tsidebar: <SidebarNavigationScreenGlobalStyles backPath={ {} } />,\n\t\tpreview: <Editor />,\n\t\tmobile: <GlobalStylesUIWrapper />,\n\t},\n\twidths: {\n\t\tcontent: 380,\n\t},\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,MAAM,MAAM,WAAW;AAC9B,OAAOC,mCAAmC,MAAM,4CAA4C;AAC5F,OAAOC,qBAAqB,MAAM,kCAAkC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAErE,OAAO,MAAMC,eAAe,GAAG;EAC9BC,IAAI,EAAE,aAAa;EACnBC,KAAK,EAAIC,MAAM,IAAM;IACpB,OACCA,MAAM,CAACC,IAAI,IACXD,MAAM,CAACC,IAAI,CAACC,UAAU,CAAE,mBAAoB,CAAC,IAC7CF,MAAM,CAACG,MAAM,KAAK,MAAM;EAE1B,CAAC;EACDC,KAAK,EAAE;IACNC,OAAO,eAAET,IAAA,CAACF,qBAAqB,IAAE,CAAC;IAClCY,OAAO,eAAEV,IAAA,CAACH,mCAAmC;MAACc,QAAQ,EAAG,CAAC;IAAG,CAAE,CAAC;IAChEC,OAAO,eAAEZ,IAAA,CAACJ,MAAM,IAAE,CAAC;IACnBiB,MAAM,eAAEb,IAAA,CAACF,qBAAqB,IAAE;EACjC,CAAC;EACDgB,MAAM,EAAE;IACPL,OAAO,EAAE;EACV;AACD,CAAC","ignoreList":[]}
|
|
@@ -117,14 +117,22 @@ export const SiteHubMobile = memo(forwardRef(({
|
|
|
117
117
|
navigate
|
|
118
118
|
} = useContext(SidebarNavigationContext);
|
|
119
119
|
const {
|
|
120
|
+
dashboardLink,
|
|
121
|
+
isBlockTheme,
|
|
120
122
|
homeUrl,
|
|
121
123
|
siteTitle
|
|
122
124
|
} = useSelect(select => {
|
|
123
125
|
const {
|
|
124
|
-
|
|
126
|
+
getSettings
|
|
127
|
+
} = unlock(select(editSiteStore));
|
|
128
|
+
const {
|
|
129
|
+
getEntityRecord,
|
|
130
|
+
getCurrentTheme
|
|
125
131
|
} = select(coreStore);
|
|
126
132
|
const _site = getEntityRecord('root', 'site');
|
|
127
133
|
return {
|
|
134
|
+
dashboardLink: getSettings().__experimentalDashboardLink || 'index.php',
|
|
135
|
+
isBlockTheme: getCurrentTheme()?.is_block_theme,
|
|
128
136
|
homeUrl: getEntityRecord('root', '__unstableBase')?.home,
|
|
129
137
|
siteTitle: !_site?.title && !!_site?.url ? filterURLForDisplay(_site?.url) : _site?.title
|
|
130
138
|
};
|
|
@@ -144,16 +152,21 @@ export const SiteHubMobile = memo(forwardRef(({
|
|
|
144
152
|
children: /*#__PURE__*/_jsx(Button, {
|
|
145
153
|
__next40pxDefaultSize: true,
|
|
146
154
|
ref: ref,
|
|
147
|
-
label: __('Go to Site Editor'),
|
|
148
155
|
className: "edit-site-layout__view-mode-toggle",
|
|
149
156
|
style: {
|
|
150
157
|
transform: 'scale(0.5)',
|
|
151
158
|
borderRadius: 4
|
|
152
159
|
},
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}
|
|
160
|
+
...(!isBlockTheme ? {
|
|
161
|
+
href: dashboardLink,
|
|
162
|
+
label: __('Go to the Dashboard')
|
|
163
|
+
} : {
|
|
164
|
+
onClick: () => {
|
|
165
|
+
history.push({});
|
|
166
|
+
navigate('back');
|
|
167
|
+
},
|
|
168
|
+
label: __('Go to Site Editor')
|
|
169
|
+
}),
|
|
157
170
|
children: /*#__PURE__*/_jsx(SiteIcon, {
|
|
158
171
|
className: "edit-site-layout__view-mode-toggle-icon"
|
|
159
172
|
})
|