@wordpress/edit-site 6.0.4 → 6.0.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/editor/index.js +2 -0
- package/build/components/editor/index.js.map +1 -1
- package/build/components/global-styles/shadows-edit-panel.js +1 -2
- package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build/components/layout/index.js +16 -8
- package/build/components/layout/index.js.map +1 -1
- package/build/components/layout/router.js +15 -10
- package/build/components/layout/router.js.map +1 -1
- package/build/components/revisions/index.js +10 -7
- package/build/components/revisions/index.js.map +1 -1
- package/build/components/site-hub/index.js +81 -1
- package/build/components/site-hub/index.js.map +1 -1
- package/build/store/private-actions.js +7 -2
- package/build/store/private-actions.js.map +1 -1
- package/build-module/components/editor/index.js +2 -0
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/global-styles/shadows-edit-panel.js +1 -2
- package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build-module/components/layout/index.js +14 -8
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/layout/router.js +15 -10
- package/build-module/components/layout/router.js.map +1 -1
- package/build-module/components/revisions/index.js +10 -7
- package/build-module/components/revisions/index.js.map +1 -1
- package/build-module/components/site-hub/index.js +81 -1
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/store/private-actions.js +7 -2
- package/build-module/store/private-actions.js.map +1 -1
- package/build-style/style-rtl.css +17 -13
- package/build-style/style.css +17 -13
- package/package.json +11 -11
- package/src/components/editor/index.js +2 -0
- package/src/components/global-styles/shadows-edit-panel.js +1 -2
- package/src/components/layout/index.js +13 -4
- package/src/components/layout/router.js +23 -15
- package/src/components/layout/style.scss +12 -0
- package/src/components/page-pages/style.scss +1 -1
- package/src/components/page-patterns/style.scss +1 -8
- package/src/components/page-templates/style.scss +1 -6
- package/src/components/revisions/index.js +9 -1
- package/src/components/sidebar/style.scss +6 -0
- package/src/components/site-hub/index.js +84 -1
- package/src/store/private-actions.js +7 -3
|
@@ -11,11 +11,12 @@ import { Button, __experimentalHStack as HStack } from '@wordpress/components';
|
|
|
11
11
|
import { __ } from '@wordpress/i18n';
|
|
12
12
|
import { store as coreStore } from '@wordpress/core-data';
|
|
13
13
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
14
|
-
import { memo, forwardRef } from '@wordpress/element';
|
|
14
|
+
import { memo, forwardRef, useContext } from '@wordpress/element';
|
|
15
15
|
import { search } from '@wordpress/icons';
|
|
16
16
|
import { store as commandsStore } from '@wordpress/commands';
|
|
17
17
|
import { displayShortcut } from '@wordpress/keycodes';
|
|
18
18
|
import { filterURLForDisplay } from '@wordpress/url';
|
|
19
|
+
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* Internal dependencies
|
|
@@ -23,6 +24,10 @@ import { filterURLForDisplay } from '@wordpress/url';
|
|
|
23
24
|
import { store as editSiteStore } from '../../store';
|
|
24
25
|
import SiteIcon from '../site-icon';
|
|
25
26
|
import { unlock } from '../../lock-unlock';
|
|
27
|
+
const {
|
|
28
|
+
useHistory
|
|
29
|
+
} = unlock(routerPrivateApis);
|
|
30
|
+
import { SidebarNavigationContext } from '../sidebar';
|
|
26
31
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
32
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
33
|
const SiteHub = memo(forwardRef(({
|
|
@@ -99,4 +104,79 @@ const SiteHub = memo(forwardRef(({
|
|
|
99
104
|
});
|
|
100
105
|
}));
|
|
101
106
|
export default SiteHub;
|
|
107
|
+
export const SiteHubMobile = memo(forwardRef(({
|
|
108
|
+
isTransparent
|
|
109
|
+
}, ref) => {
|
|
110
|
+
const history = useHistory();
|
|
111
|
+
const {
|
|
112
|
+
navigate
|
|
113
|
+
} = useContext(SidebarNavigationContext);
|
|
114
|
+
const {
|
|
115
|
+
homeUrl,
|
|
116
|
+
siteTitle
|
|
117
|
+
} = useSelect(select => {
|
|
118
|
+
const {
|
|
119
|
+
getSite,
|
|
120
|
+
getUnstableBase // Site index.
|
|
121
|
+
} = select(coreStore);
|
|
122
|
+
const _site = getSite();
|
|
123
|
+
return {
|
|
124
|
+
homeUrl: getUnstableBase()?.home,
|
|
125
|
+
siteTitle: !_site?.title && !!_site?.url ? filterURLForDisplay(_site?.url) : _site?.title
|
|
126
|
+
};
|
|
127
|
+
}, []);
|
|
128
|
+
const {
|
|
129
|
+
open: openCommandCenter
|
|
130
|
+
} = useDispatch(commandsStore);
|
|
131
|
+
return /*#__PURE__*/_jsx("div", {
|
|
132
|
+
className: "edit-site-site-hub",
|
|
133
|
+
children: /*#__PURE__*/_jsxs(HStack, {
|
|
134
|
+
justify: "flex-start",
|
|
135
|
+
spacing: "0",
|
|
136
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
137
|
+
className: clsx('edit-site-site-hub__view-mode-toggle-container', {
|
|
138
|
+
'has-transparent-background': isTransparent
|
|
139
|
+
}),
|
|
140
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
141
|
+
ref: ref,
|
|
142
|
+
label: __('Go to Site Editor'),
|
|
143
|
+
className: "edit-site-layout__view-mode-toggle",
|
|
144
|
+
style: {
|
|
145
|
+
transform: 'scale(0.5)',
|
|
146
|
+
borderRadius: 4
|
|
147
|
+
},
|
|
148
|
+
onClick: () => {
|
|
149
|
+
history.push({});
|
|
150
|
+
navigate('back');
|
|
151
|
+
},
|
|
152
|
+
children: /*#__PURE__*/_jsx(SiteIcon, {
|
|
153
|
+
className: "edit-site-layout__view-mode-toggle-icon"
|
|
154
|
+
})
|
|
155
|
+
})
|
|
156
|
+
}), /*#__PURE__*/_jsxs(HStack, {
|
|
157
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
158
|
+
className: "edit-site-site-hub__title",
|
|
159
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
160
|
+
variant: "link",
|
|
161
|
+
href: homeUrl,
|
|
162
|
+
target: "_blank",
|
|
163
|
+
label: __('View site (opens in a new tab)'),
|
|
164
|
+
children: decodeEntities(siteTitle)
|
|
165
|
+
})
|
|
166
|
+
}), /*#__PURE__*/_jsx(HStack, {
|
|
167
|
+
spacing: 0,
|
|
168
|
+
expanded: false,
|
|
169
|
+
className: "edit-site-site-hub__actions",
|
|
170
|
+
children: /*#__PURE__*/_jsx(Button, {
|
|
171
|
+
className: "edit-site-site-hub_toggle-command-center",
|
|
172
|
+
icon: search,
|
|
173
|
+
onClick: () => openCommandCenter(),
|
|
174
|
+
label: __('Open command palette'),
|
|
175
|
+
shortcut: displayShortcut.primary('k')
|
|
176
|
+
})
|
|
177
|
+
})]
|
|
178
|
+
})]
|
|
179
|
+
})
|
|
180
|
+
});
|
|
181
|
+
}));
|
|
102
182
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["clsx","useSelect","useDispatch","Button","__experimentalHStack","HStack","__","store","coreStore","decodeEntities","memo","forwardRef","search","commandsStore","displayShortcut","filterURLForDisplay","editSiteStore","SiteIcon","unlock","jsx","_jsx","jsxs","_jsxs","SiteHub","isTransparent","ref","dashboardLink","homeUrl","siteTitle","select","getSettings","getSite","getUnstableBase","_site","__experimentalDashboardLink","home","title","url","open","openCommandCenter","className","children","justify","spacing","href","label","style","transform","borderRadius","variant","target","expanded","icon","onClick","shortcut","primary"],"sources":["@wordpress/edit-site/src/components/site-hub/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button, __experimentalHStack as HStack } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { memo, forwardRef } from '@wordpress/element';\nimport { search } from '@wordpress/icons';\nimport { store as commandsStore } from '@wordpress/commands';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { filterURLForDisplay } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport SiteIcon from '../site-icon';\nimport { unlock } from '../../lock-unlock';\n\nconst SiteHub = memo(\n\tforwardRef( ( { isTransparent }, ref ) => {\n\t\tconst { dashboardLink, homeUrl, siteTitle } = useSelect( ( select ) => {\n\t\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\n\t\t\tconst {\n\t\t\t\tgetSite,\n\t\t\t\tgetUnstableBase, // Site index.\n\t\t\t} = select( coreStore );\n\t\t\tconst _site = getSite();\n\t\t\treturn {\n\t\t\t\tdashboardLink:\n\t\t\t\t\tgetSettings().__experimentalDashboardLink || 'index.php',\n\t\t\t\thomeUrl: getUnstableBase()?.home,\n\t\t\t\tsiteTitle:\n\t\t\t\t\t! _site?.title && !! _site?.url\n\t\t\t\t\t\t? filterURLForDisplay( _site?.url )\n\t\t\t\t\t\t: _site?.title,\n\t\t\t};\n\t\t}, [] );\n\t\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\n\t\treturn (\n\t\t\t<div className=\"edit-site-site-hub\">\n\t\t\t\t<HStack justify=\"flex-start\" spacing=\"0\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'edit-site-site-hub__view-mode-toggle-container',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'has-transparent-background': isTransparent,\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\t\t<Button\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\thref={ dashboardLink }\n\t\t\t\t\t\t\tlabel={ __( 'Go to the Dashboard' ) }\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__view-mode-toggle\"\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\ttransform: 'scale(0.5)',\n\t\t\t\t\t\t\t\tborderRadius: 4,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<SiteIcon className=\"edit-site-layout__view-mode-toggle-icon\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<HStack>\n\t\t\t\t\t\t<div className=\"edit-site-site-hub__title\">\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\t\thref={ homeUrl }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\tlabel={ __( 'View site (opens in a new tab)' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ decodeEntities( siteTitle ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\tspacing={ 0 }\n\t\t\t\t\t\t\texpanded={ false }\n\t\t\t\t\t\t\tclassName=\"edit-site-site-hub__actions\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tclassName=\"edit-site-site-hub_toggle-command-center\"\n\t\t\t\t\t\t\t\ticon={ search }\n\t\t\t\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\t\t\t\tlabel={ __( 'Open command palette' ) }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</HStack>\n\t\t\t\t</HStack>\n\t\t\t</div>\n\t\t);\n\t} )\n);\n\nexport default SiteHub;\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,MAAM,EAAEC,oBAAoB,IAAIC,MAAM,QAAQ,uBAAuB;AAC9E,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,cA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QAAQ,EAAGxC,eAAe,CAACyC,OAAO,CAAE,GAAI;UAAG,CAC3C;QAAC,CACK,CAAC;MAAA,CACF,CAAC;IAAA,CACF;EAAC,CACL,CAAC;AAER,CAAE,CACH,CAAC;AAED,eAAehC,OAAO","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["clsx","useSelect","useDispatch","Button","__experimentalHStack","HStack","__","store","coreStore","decodeEntities","memo","forwardRef","useContext","search","commandsStore","displayShortcut","filterURLForDisplay","privateApis","routerPrivateApis","editSiteStore","SiteIcon","unlock","useHistory","SidebarNavigationContext","jsx","_jsx","jsxs","_jsxs","SiteHub","isTransparent","ref","dashboardLink","homeUrl","siteTitle","select","getSettings","getSite","getUnstableBase","_site","__experimentalDashboardLink","home","title","url","open","openCommandCenter","className","children","justify","spacing","href","label","style","transform","borderRadius","variant","target","expanded","icon","onClick","shortcut","primary","SiteHubMobile","history","navigate","push"],"sources":["@wordpress/edit-site/src/components/site-hub/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { Button, __experimentalHStack as HStack } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { memo, forwardRef, useContext } from '@wordpress/element';\nimport { search } from '@wordpress/icons';\nimport { store as commandsStore } from '@wordpress/commands';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { filterURLForDisplay } from '@wordpress/url';\nimport { privateApis as routerPrivateApis } from '@wordpress/router';\n\n/**\n * Internal dependencies\n */\nimport { store as editSiteStore } from '../../store';\nimport SiteIcon from '../site-icon';\nimport { unlock } from '../../lock-unlock';\nconst { useHistory } = unlock( routerPrivateApis );\nimport { SidebarNavigationContext } from '../sidebar';\n\nconst SiteHub = memo(\n\tforwardRef( ( { isTransparent }, ref ) => {\n\t\tconst { dashboardLink, homeUrl, siteTitle } = useSelect( ( select ) => {\n\t\t\tconst { getSettings } = unlock( select( editSiteStore ) );\n\n\t\t\tconst {\n\t\t\t\tgetSite,\n\t\t\t\tgetUnstableBase, // Site index.\n\t\t\t} = select( coreStore );\n\t\t\tconst _site = getSite();\n\t\t\treturn {\n\t\t\t\tdashboardLink:\n\t\t\t\t\tgetSettings().__experimentalDashboardLink || 'index.php',\n\t\t\t\thomeUrl: getUnstableBase()?.home,\n\t\t\t\tsiteTitle:\n\t\t\t\t\t! _site?.title && !! _site?.url\n\t\t\t\t\t\t? filterURLForDisplay( _site?.url )\n\t\t\t\t\t\t: _site?.title,\n\t\t\t};\n\t\t}, [] );\n\t\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\n\t\treturn (\n\t\t\t<div className=\"edit-site-site-hub\">\n\t\t\t\t<HStack justify=\"flex-start\" spacing=\"0\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'edit-site-site-hub__view-mode-toggle-container',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'has-transparent-background': isTransparent,\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\t\t<Button\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\thref={ dashboardLink }\n\t\t\t\t\t\t\tlabel={ __( 'Go to the Dashboard' ) }\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__view-mode-toggle\"\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\ttransform: 'scale(0.5)',\n\t\t\t\t\t\t\t\tborderRadius: 4,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<SiteIcon className=\"edit-site-layout__view-mode-toggle-icon\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<HStack>\n\t\t\t\t\t\t<div className=\"edit-site-site-hub__title\">\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\t\thref={ homeUrl }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\tlabel={ __( 'View site (opens in a new tab)' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ decodeEntities( siteTitle ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\tspacing={ 0 }\n\t\t\t\t\t\t\texpanded={ false }\n\t\t\t\t\t\t\tclassName=\"edit-site-site-hub__actions\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tclassName=\"edit-site-site-hub_toggle-command-center\"\n\t\t\t\t\t\t\t\ticon={ search }\n\t\t\t\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\t\t\t\tlabel={ __( 'Open command palette' ) }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</HStack>\n\t\t\t\t</HStack>\n\t\t\t</div>\n\t\t);\n\t} )\n);\n\nexport default SiteHub;\n\nexport const SiteHubMobile = memo(\n\tforwardRef( ( { isTransparent }, ref ) => {\n\t\tconst history = useHistory();\n\t\tconst { navigate } = useContext( SidebarNavigationContext );\n\n\t\tconst { homeUrl, siteTitle } = useSelect( ( select ) => {\n\t\t\tconst {\n\t\t\t\tgetSite,\n\t\t\t\tgetUnstableBase, // Site index.\n\t\t\t} = select( coreStore );\n\t\t\tconst _site = getSite();\n\t\t\treturn {\n\t\t\t\thomeUrl: getUnstableBase()?.home,\n\t\t\t\tsiteTitle:\n\t\t\t\t\t! _site?.title && !! _site?.url\n\t\t\t\t\t\t? filterURLForDisplay( _site?.url )\n\t\t\t\t\t\t: _site?.title,\n\t\t\t};\n\t\t}, [] );\n\t\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\n\t\treturn (\n\t\t\t<div className=\"edit-site-site-hub\">\n\t\t\t\t<HStack justify=\"flex-start\" spacing=\"0\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t'edit-site-site-hub__view-mode-toggle-container',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'has-transparent-background': isTransparent,\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\t\t<Button\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\tlabel={ __( 'Go to Site Editor' ) }\n\t\t\t\t\t\t\tclassName=\"edit-site-layout__view-mode-toggle\"\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\ttransform: 'scale(0.5)',\n\t\t\t\t\t\t\t\tborderRadius: 4,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\thistory.push( {} );\n\t\t\t\t\t\t\t\tnavigate( 'back' );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<SiteIcon className=\"edit-site-layout__view-mode-toggle-icon\" />\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t<HStack>\n\t\t\t\t\t\t<div className=\"edit-site-site-hub__title\">\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\t\t\thref={ homeUrl }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\tlabel={ __( 'View site (opens in a new tab)' ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ decodeEntities( siteTitle ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<HStack\n\t\t\t\t\t\t\tspacing={ 0 }\n\t\t\t\t\t\t\texpanded={ false }\n\t\t\t\t\t\t\tclassName=\"edit-site-site-hub__actions\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tclassName=\"edit-site-site-hub_toggle-command-center\"\n\t\t\t\t\t\t\t\ticon={ search }\n\t\t\t\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\t\t\t\tlabel={ __( 'Open command palette' ) }\n\t\t\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</HStack>\n\t\t\t\t\t</HStack>\n\t\t\t\t</HStack>\n\t\t\t</div>\n\t\t);\n\t} )\n);\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,IAAI,MAAM,MAAM;;AAEvB;AACA;AACA;AACA,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,MAAM,EAAEC,oBAAoB,IAAIC,MAAM,QAAQ,uBAAuB;AAC9E,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,cAAc,QAAQ,0BAA0B;AACzD,SAASC,IAAI,EAAEC,UAAU,EAAEC,UAAU,QAAQ,oBAAoB;AACjE,SAASC,MAAM,QAAQ,kBAAkB;AACzC,SAASN,KAAK,IAAIO,aAAa,QAAQ,qBAAqB;AAC5D,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,mBAAmB,QAAQ,gBAAgB;AACpD,SAASC,WAAW,IAAIC,iBAAiB,QAAQ,mBAAmB;;AAEpE;AACA;AACA;AACA,SAASX,KAAK,IAAIY,aAAa,QAAQ,aAAa;AACpD,OAAOC,QAAQ,MAAM,cAAc;AACnC,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,MAAM;EAAEC;AAAW,CAAC,GAAGD,MAAM,CAAEH,iBAAkB,CAAC;AAClD,SAASK,wBAAwB,QAAQ,YAAY;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAAA,SAAAC,IAAA,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D;MAAC,CACL,CAAC,eAENlB,KAAA,CAACtB,MAAM;QAAAyC,QAAA,gBACNrB,IAAA;UAAKoB,SAAS,EAAC,2BAA2B;UAAAC,QAAA,eACzCrB,IAAA,CAACtB,MAAM;YACNmD,OAAO,EAAC,MAAM;YACdL,IAAI,EAAGjB,OAAS;YAChBuB,MAAM,EAAC,QAAQ;YACfL,KAAK,EAAG5C,EAAE,CAAE,gCAAiC,CAAG;YAAAwC,QAAA,EAE9CrC,cAAc,CAAEwB,SAAU;UAAC,CACtB;QAAC,CACL,CAAC,eACNR,IAAA,CAACpB,MAAM;UACN2C,OAAO,EAAG,CAAG;UACbQ,QAAQ,EAAG,KAAO;UAClBX,SAAS,EAAC,6BAA6B;UAAAC,QAAA,eAEvCrB,IAAA,CAACtB,MAAM;YACN0C,SAAS,EAAC,0CAA0C;YACpDY,IAAI,EAAG5C,MAAQ;YACf6C,OAAO,EAAGA,CAAA,KAAMd,iBAAiB,CAAC,CAAG;YACrCM,KAAK,EAAG5C,EAAE,CAAE,sBAAuB,CAAG;YACtCqD,QAAQ,EAAG5C,eAAe,CAAC6C,OAAO,CAAE,GAAI;UAAG,CAC3C;QAAC,CACK,CAAC;MAAA,CACF,CAAC;IAAA,CACF;EAAC,CACL,CAAC;AAER,CAAE,CACH,CAAC","ignoreList":[]}
|
|
@@ -14,9 +14,9 @@ export const setCanvasMode = mode => ({
|
|
|
14
14
|
registry,
|
|
15
15
|
dispatch
|
|
16
16
|
}) => {
|
|
17
|
+
const isMediumOrBigger = window.matchMedia('(min-width: 782px)').matches;
|
|
17
18
|
const switchCanvasMode = () => {
|
|
18
19
|
registry.batch(() => {
|
|
19
|
-
const isMediumOrBigger = window.matchMedia('(min-width: 782px)').matches;
|
|
20
20
|
registry.dispatch(blockEditorStore).clearSelectedBlock();
|
|
21
21
|
registry.dispatch(editorStore).setDeviceType('Desktop');
|
|
22
22
|
registry.dispatch(blockEditorStore).__unstableSetEditorMode('edit');
|
|
@@ -41,7 +41,12 @@ export const setCanvasMode = mode => ({
|
|
|
41
41
|
registry.dispatch(editorStore).setIsInserterOpened(false);
|
|
42
42
|
});
|
|
43
43
|
};
|
|
44
|
-
|
|
44
|
+
|
|
45
|
+
/*
|
|
46
|
+
* Skip transition in mobile, otherwise it crashes the browser.
|
|
47
|
+
* See: https://github.com/WordPress/gutenberg/pull/63002.
|
|
48
|
+
*/
|
|
49
|
+
if (!isMediumOrBigger || !document.startViewTransition) {
|
|
45
50
|
switchCanvasMode();
|
|
46
51
|
} else {
|
|
47
52
|
document.documentElement.classList.add(`canvas-mode-${mode}-transition`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["store","blockEditorStore","preferencesStore","editorStore","setCanvasMode","mode","registry","dispatch","
|
|
1
|
+
{"version":3,"names":["store","blockEditorStore","preferencesStore","editorStore","setCanvasMode","mode","registry","dispatch","isMediumOrBigger","window","matchMedia","matches","switchCanvasMode","batch","clearSelectedBlock","setDeviceType","__unstableSetEditorMode","isPublishSidebarOpened","select","type","isEditMode","closePublishSidebar","get","setIsListViewOpened","setIsInserterOpened","document","startViewTransition","documentElement","classList","add","transition","finished","finally","remove","setEditorCanvasContainerView","view"],"sources":["@wordpress/edit-site/src/store/private-actions.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Action that switches the canvas mode.\n *\n * @param {?string} mode Canvas mode.\n */\nexport const setCanvasMode =\n\t( mode ) =>\n\t( { registry, dispatch } ) => {\n\t\tconst isMediumOrBigger =\n\t\t\twindow.matchMedia( '(min-width: 782px)' ).matches;\n\t\tconst switchCanvasMode = () => {\n\t\t\tregistry.batch( () => {\n\t\t\t\tregistry.dispatch( blockEditorStore ).clearSelectedBlock();\n\t\t\t\tregistry.dispatch( editorStore ).setDeviceType( 'Desktop' );\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( blockEditorStore )\n\t\t\t\t\t.__unstableSetEditorMode( 'edit' );\n\t\t\t\tconst isPublishSidebarOpened = registry\n\t\t\t\t\t.select( editorStore )\n\t\t\t\t\t.isPublishSidebarOpened();\n\t\t\t\tdispatch( {\n\t\t\t\t\ttype: 'SET_CANVAS_MODE',\n\t\t\t\t\tmode,\n\t\t\t\t} );\n\t\t\t\tconst isEditMode = mode === 'edit';\n\t\t\t\tif ( isPublishSidebarOpened && ! isEditMode ) {\n\t\t\t\t\tregistry.dispatch( editorStore ).closePublishSidebar();\n\t\t\t\t}\n\n\t\t\t\t// Check if the block list view should be open by default.\n\t\t\t\t// If `distractionFree` mode is enabled, the block list view should not be open.\n\t\t\t\t// This behavior is disabled for small viewports.\n\t\t\t\tif (\n\t\t\t\t\tisMediumOrBigger &&\n\t\t\t\t\tisEditMode &&\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.select( preferencesStore )\n\t\t\t\t\t\t.get( 'core', 'showListViewByDefault' ) &&\n\t\t\t\t\t! registry\n\t\t\t\t\t\t.select( preferencesStore )\n\t\t\t\t\t\t.get( 'core', 'distractionFree' )\n\t\t\t\t) {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( editorStore )\n\t\t\t\t\t\t.setIsListViewOpened( true );\n\t\t\t\t} else {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( editorStore )\n\t\t\t\t\t\t.setIsListViewOpened( false );\n\t\t\t\t}\n\t\t\t\tregistry.dispatch( editorStore ).setIsInserterOpened( false );\n\t\t\t} );\n\t\t};\n\n\t\t/*\n\t\t * Skip transition in mobile, otherwise it crashes the browser.\n\t\t * See: https://github.com/WordPress/gutenberg/pull/63002.\n\t\t */\n\t\tif ( ! isMediumOrBigger || ! document.startViewTransition ) {\n\t\t\tswitchCanvasMode();\n\t\t} else {\n\t\t\tdocument.documentElement.classList.add(\n\t\t\t\t`canvas-mode-${ mode }-transition`\n\t\t\t);\n\t\t\tconst transition = document.startViewTransition( () =>\n\t\t\t\tswitchCanvasMode()\n\t\t\t);\n\t\t\ttransition.finished.finally( () => {\n\t\t\t\tdocument.documentElement.classList.remove(\n\t\t\t\t\t`canvas-mode-${ mode }-transition`\n\t\t\t\t);\n\t\t\t} );\n\t\t}\n\t};\n\n/**\n * Action that switches the editor canvas container view.\n *\n * @param {?string} view Editor canvas container view.\n */\nexport const setEditorCanvasContainerView =\n\t( view ) =>\n\t( { dispatch } ) => {\n\t\tdispatch( {\n\t\t\ttype: 'SET_EDITOR_CANVAS_CONTAINER_VIEW',\n\t\t\tview,\n\t\t} );\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASD,KAAK,IAAIE,gBAAgB,QAAQ,wBAAwB;AAClE,SAASF,KAAK,IAAIG,WAAW,QAAQ,mBAAmB;;AAExD;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,aAAa,GACvBC,IAAI,IACN,CAAE;EAAEC,QAAQ;EAAEC;AAAS,CAAC,KAAM;EAC7B,MAAMC,gBAAgB,GACrBC,MAAM,CAACC,UAAU,CAAE,oBAAqB,CAAC,CAACC,OAAO;EAClD,MAAMC,gBAAgB,GAAGA,CAAA,KAAM;IAC9BN,QAAQ,CAACO,KAAK,CAAE,MAAM;MACrBP,QAAQ,CAACC,QAAQ,CAAEN,gBAAiB,CAAC,CAACa,kBAAkB,CAAC,CAAC;MAC1DR,QAAQ,CAACC,QAAQ,CAAEJ,WAAY,CAAC,CAACY,aAAa,CAAE,SAAU,CAAC;MAC3DT,QAAQ,CACNC,QAAQ,CAAEN,gBAAiB,CAAC,CAC5Be,uBAAuB,CAAE,MAAO,CAAC;MACnC,MAAMC,sBAAsB,GAAGX,QAAQ,CACrCY,MAAM,CAAEf,WAAY,CAAC,CACrBc,sBAAsB,CAAC,CAAC;MAC1BV,QAAQ,CAAE;QACTY,IAAI,EAAE,iBAAiB;QACvBd;MACD,CAAE,CAAC;MACH,MAAMe,UAAU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AAM6B,4BAA4B,GACtCC,IAAI,IACN,CAAE;EAAE5B;AAAS,CAAC,KAAM;EACnBA,QAAQ,CAAE;IACTY,IAAI,EAAE,kCAAkC;IACxCgB;EACD,CAAE,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
@@ -434,7 +434,6 @@
|
|
|
434
434
|
aspect-ratio: 1/1;
|
|
435
435
|
background-color: #f0f0f0;
|
|
436
436
|
border-radius: 4px;
|
|
437
|
-
overflow: hidden;
|
|
438
437
|
position: relative;
|
|
439
438
|
}
|
|
440
439
|
.dataviews-view-grid .dataviews-view-grid__media img {
|
|
@@ -826,7 +825,7 @@
|
|
|
826
825
|
padding: 0 12px;
|
|
827
826
|
height: 32px;
|
|
828
827
|
background: #f0f0f0;
|
|
829
|
-
color: #
|
|
828
|
+
color: #2f2f2f;
|
|
830
829
|
position: relative;
|
|
831
830
|
display: flex;
|
|
832
831
|
align-items: center;
|
|
@@ -1704,7 +1703,7 @@
|
|
|
1704
1703
|
overflow: hidden;
|
|
1705
1704
|
height: 100%;
|
|
1706
1705
|
width: 100%;
|
|
1707
|
-
border-radius:
|
|
1706
|
+
border-radius: 4px;
|
|
1708
1707
|
}
|
|
1709
1708
|
.page-pages-preview-field__button:focus-visible {
|
|
1710
1709
|
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
@@ -1754,10 +1753,6 @@
|
|
|
1754
1753
|
display: flex;
|
|
1755
1754
|
flex-direction: column;
|
|
1756
1755
|
height: 100%;
|
|
1757
|
-
border-radius: 3px 3px 0 0;
|
|
1758
|
-
}
|
|
1759
|
-
.edit-site-page-patterns-dataviews .page-patterns-preview-field.is-viewtype-grid .block-editor-block-preview__container {
|
|
1760
|
-
border-radius: 3px 3px 0 0;
|
|
1761
1756
|
}
|
|
1762
1757
|
.edit-site-page-patterns-dataviews .page-patterns-preview-field.is-viewtype-table {
|
|
1763
1758
|
width: 96px;
|
|
@@ -1776,7 +1771,7 @@
|
|
|
1776
1771
|
cursor: pointer;
|
|
1777
1772
|
overflow: hidden;
|
|
1778
1773
|
height: 100%;
|
|
1779
|
-
border-radius:
|
|
1774
|
+
border-radius: 4px;
|
|
1780
1775
|
}
|
|
1781
1776
|
.edit-site-page-patterns-dataviews .page-patterns-preview-field .page-patterns-preview-field__button:focus-visible {
|
|
1782
1777
|
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
@@ -1868,7 +1863,6 @@
|
|
|
1868
1863
|
display: flex;
|
|
1869
1864
|
flex-direction: column;
|
|
1870
1865
|
height: 100%;
|
|
1871
|
-
border-radius: 3px 3px 0 0;
|
|
1872
1866
|
}
|
|
1873
1867
|
.page-templates-preview-field .page-templates-preview-field__button {
|
|
1874
1868
|
box-shadow: none;
|
|
@@ -1879,7 +1873,7 @@
|
|
|
1879
1873
|
cursor: pointer;
|
|
1880
1874
|
overflow: hidden;
|
|
1881
1875
|
height: 100%;
|
|
1882
|
-
border-radius:
|
|
1876
|
+
border-radius: 4px;
|
|
1883
1877
|
}
|
|
1884
1878
|
.page-templates-preview-field .page-templates-preview-field__button:focus-visible {
|
|
1885
1879
|
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
@@ -1891,9 +1885,6 @@
|
|
|
1891
1885
|
.page-templates-preview-field.is-viewtype-grid .block-editor-block-preview__container {
|
|
1892
1886
|
height: 100%;
|
|
1893
1887
|
}
|
|
1894
|
-
.page-templates-preview-field.is-viewtype-grid .page-templates-preview-field__button {
|
|
1895
|
-
border-radius: 3px 3px 0 0;
|
|
1896
|
-
}
|
|
1897
1888
|
.page-templates-preview-field.is-viewtype-table {
|
|
1898
1889
|
border-radius: 2px;
|
|
1899
1890
|
position: relative;
|
|
@@ -2129,6 +2120,17 @@
|
|
|
2129
2120
|
position: relative;
|
|
2130
2121
|
width: 100%;
|
|
2131
2122
|
z-index: 2;
|
|
2123
|
+
/*
|
|
2124
|
+
* The SiteHubMobile component is displayed
|
|
2125
|
+
* for pages that do not have a sidebar,
|
|
2126
|
+
* yet it needs the Sidebar component for the React context.
|
|
2127
|
+
*
|
|
2128
|
+
* This removes the padding in this scenario.
|
|
2129
|
+
* See https://github.com/WordPress/gutenberg/pull/63118
|
|
2130
|
+
*/
|
|
2131
|
+
}
|
|
2132
|
+
.edit-site-layout__mobile .edit-site-sidebar__screen-wrapper {
|
|
2133
|
+
padding: 0;
|
|
2132
2134
|
}
|
|
2133
2135
|
|
|
2134
2136
|
.edit-site-layout__canvas-container {
|
|
@@ -2332,6 +2334,8 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
2332
2334
|
.edit-site-sidebar__content {
|
|
2333
2335
|
flex-grow: 1;
|
|
2334
2336
|
overflow-y: auto;
|
|
2337
|
+
overflow-x: hidden;
|
|
2338
|
+
contain: content;
|
|
2335
2339
|
}
|
|
2336
2340
|
|
|
2337
2341
|
@keyframes slide-from-right {
|
package/build-style/style.css
CHANGED
|
@@ -434,7 +434,6 @@
|
|
|
434
434
|
aspect-ratio: 1/1;
|
|
435
435
|
background-color: #f0f0f0;
|
|
436
436
|
border-radius: 4px;
|
|
437
|
-
overflow: hidden;
|
|
438
437
|
position: relative;
|
|
439
438
|
}
|
|
440
439
|
.dataviews-view-grid .dataviews-view-grid__media img {
|
|
@@ -826,7 +825,7 @@
|
|
|
826
825
|
padding: 0 12px;
|
|
827
826
|
height: 32px;
|
|
828
827
|
background: #f0f0f0;
|
|
829
|
-
color: #
|
|
828
|
+
color: #2f2f2f;
|
|
830
829
|
position: relative;
|
|
831
830
|
display: flex;
|
|
832
831
|
align-items: center;
|
|
@@ -1705,7 +1704,7 @@
|
|
|
1705
1704
|
overflow: hidden;
|
|
1706
1705
|
height: 100%;
|
|
1707
1706
|
width: 100%;
|
|
1708
|
-
border-radius:
|
|
1707
|
+
border-radius: 4px;
|
|
1709
1708
|
}
|
|
1710
1709
|
.page-pages-preview-field__button:focus-visible {
|
|
1711
1710
|
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
@@ -1755,10 +1754,6 @@
|
|
|
1755
1754
|
display: flex;
|
|
1756
1755
|
flex-direction: column;
|
|
1757
1756
|
height: 100%;
|
|
1758
|
-
border-radius: 3px 3px 0 0;
|
|
1759
|
-
}
|
|
1760
|
-
.edit-site-page-patterns-dataviews .page-patterns-preview-field.is-viewtype-grid .block-editor-block-preview__container {
|
|
1761
|
-
border-radius: 3px 3px 0 0;
|
|
1762
1757
|
}
|
|
1763
1758
|
.edit-site-page-patterns-dataviews .page-patterns-preview-field.is-viewtype-table {
|
|
1764
1759
|
width: 96px;
|
|
@@ -1777,7 +1772,7 @@
|
|
|
1777
1772
|
cursor: pointer;
|
|
1778
1773
|
overflow: hidden;
|
|
1779
1774
|
height: 100%;
|
|
1780
|
-
border-radius:
|
|
1775
|
+
border-radius: 4px;
|
|
1781
1776
|
}
|
|
1782
1777
|
.edit-site-page-patterns-dataviews .page-patterns-preview-field .page-patterns-preview-field__button:focus-visible {
|
|
1783
1778
|
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
@@ -1869,7 +1864,6 @@
|
|
|
1869
1864
|
display: flex;
|
|
1870
1865
|
flex-direction: column;
|
|
1871
1866
|
height: 100%;
|
|
1872
|
-
border-radius: 3px 3px 0 0;
|
|
1873
1867
|
}
|
|
1874
1868
|
.page-templates-preview-field .page-templates-preview-field__button {
|
|
1875
1869
|
box-shadow: none;
|
|
@@ -1880,7 +1874,7 @@
|
|
|
1880
1874
|
cursor: pointer;
|
|
1881
1875
|
overflow: hidden;
|
|
1882
1876
|
height: 100%;
|
|
1883
|
-
border-radius:
|
|
1877
|
+
border-radius: 4px;
|
|
1884
1878
|
}
|
|
1885
1879
|
.page-templates-preview-field .page-templates-preview-field__button:focus-visible {
|
|
1886
1880
|
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
|
|
@@ -1892,9 +1886,6 @@
|
|
|
1892
1886
|
.page-templates-preview-field.is-viewtype-grid .block-editor-block-preview__container {
|
|
1893
1887
|
height: 100%;
|
|
1894
1888
|
}
|
|
1895
|
-
.page-templates-preview-field.is-viewtype-grid .page-templates-preview-field__button {
|
|
1896
|
-
border-radius: 3px 3px 0 0;
|
|
1897
|
-
}
|
|
1898
1889
|
.page-templates-preview-field.is-viewtype-table {
|
|
1899
1890
|
border-radius: 2px;
|
|
1900
1891
|
position: relative;
|
|
@@ -2130,6 +2121,17 @@
|
|
|
2130
2121
|
position: relative;
|
|
2131
2122
|
width: 100%;
|
|
2132
2123
|
z-index: 2;
|
|
2124
|
+
/*
|
|
2125
|
+
* The SiteHubMobile component is displayed
|
|
2126
|
+
* for pages that do not have a sidebar,
|
|
2127
|
+
* yet it needs the Sidebar component for the React context.
|
|
2128
|
+
*
|
|
2129
|
+
* This removes the padding in this scenario.
|
|
2130
|
+
* See https://github.com/WordPress/gutenberg/pull/63118
|
|
2131
|
+
*/
|
|
2132
|
+
}
|
|
2133
|
+
.edit-site-layout__mobile .edit-site-sidebar__screen-wrapper {
|
|
2134
|
+
padding: 0;
|
|
2133
2135
|
}
|
|
2134
2136
|
|
|
2135
2137
|
.edit-site-layout__canvas-container {
|
|
@@ -2333,6 +2335,8 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
|
|
|
2333
2335
|
.edit-site-sidebar__content {
|
|
2334
2336
|
flex-grow: 1;
|
|
2335
2337
|
overflow-y: auto;
|
|
2338
|
+
overflow-x: hidden;
|
|
2339
|
+
contain: content;
|
|
2336
2340
|
}
|
|
2337
2341
|
|
|
2338
2342
|
@keyframes slide-from-right {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/edit-site",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.6",
|
|
4
4
|
"description": "Edit Site Page module for WordPress.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -32,20 +32,20 @@
|
|
|
32
32
|
"@wordpress/a11y": "^4.0.1",
|
|
33
33
|
"@wordpress/api-fetch": "^7.0.1",
|
|
34
34
|
"@wordpress/blob": "^4.0.1",
|
|
35
|
-
"@wordpress/block-editor": "^13.0.
|
|
36
|
-
"@wordpress/block-library": "^9.0.
|
|
35
|
+
"@wordpress/block-editor": "^13.0.5",
|
|
36
|
+
"@wordpress/block-library": "^9.0.6",
|
|
37
37
|
"@wordpress/blocks": "^13.0.3",
|
|
38
38
|
"@wordpress/commands": "^1.0.3",
|
|
39
39
|
"@wordpress/components": "^28.0.3",
|
|
40
40
|
"@wordpress/compose": "^7.0.1",
|
|
41
|
-
"@wordpress/core-commands": "^1.0.
|
|
42
|
-
"@wordpress/core-data": "^7.0.
|
|
41
|
+
"@wordpress/core-commands": "^1.0.5",
|
|
42
|
+
"@wordpress/core-data": "^7.0.5",
|
|
43
43
|
"@wordpress/data": "^10.0.2",
|
|
44
|
-
"@wordpress/dataviews": "^2.0.
|
|
44
|
+
"@wordpress/dataviews": "^2.0.4",
|
|
45
45
|
"@wordpress/date": "^5.0.1",
|
|
46
46
|
"@wordpress/deprecated": "^4.0.1",
|
|
47
47
|
"@wordpress/dom": "^4.0.1",
|
|
48
|
-
"@wordpress/editor": "^14.0.
|
|
48
|
+
"@wordpress/editor": "^14.0.5",
|
|
49
49
|
"@wordpress/element": "^6.0.1",
|
|
50
50
|
"@wordpress/escape-html": "^3.0.1",
|
|
51
51
|
"@wordpress/hooks": "^4.0.1",
|
|
@@ -55,18 +55,18 @@
|
|
|
55
55
|
"@wordpress/keyboard-shortcuts": "^5.0.2",
|
|
56
56
|
"@wordpress/keycodes": "^4.0.1",
|
|
57
57
|
"@wordpress/notices": "^5.0.2",
|
|
58
|
-
"@wordpress/patterns": "^2.0.
|
|
58
|
+
"@wordpress/patterns": "^2.0.5",
|
|
59
59
|
"@wordpress/plugins": "^7.0.3",
|
|
60
60
|
"@wordpress/preferences": "^4.0.3",
|
|
61
61
|
"@wordpress/primitives": "^4.0.1",
|
|
62
62
|
"@wordpress/priority-queue": "^3.0.1",
|
|
63
63
|
"@wordpress/private-apis": "^1.0.2",
|
|
64
|
-
"@wordpress/reusable-blocks": "^5.0.
|
|
64
|
+
"@wordpress/reusable-blocks": "^5.0.5",
|
|
65
65
|
"@wordpress/router": "^1.0.2",
|
|
66
66
|
"@wordpress/style-engine": "^2.0.2",
|
|
67
67
|
"@wordpress/url": "^4.0.1",
|
|
68
68
|
"@wordpress/viewport": "^6.0.2",
|
|
69
|
-
"@wordpress/widgets": "^4.0.
|
|
69
|
+
"@wordpress/widgets": "^4.0.5",
|
|
70
70
|
"@wordpress/wordcount": "^4.0.1",
|
|
71
71
|
"change-case": "^4.1.2",
|
|
72
72
|
"clsx": "^2.1.1",
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"publishConfig": {
|
|
83
83
|
"access": "public"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "38063ae466e1b62d400b910136757a4cafdbe7fa"
|
|
86
86
|
}
|
|
@@ -41,6 +41,7 @@ import {
|
|
|
41
41
|
useHasEditorCanvasContainer,
|
|
42
42
|
} from '../editor-canvas-container';
|
|
43
43
|
import SaveButton from '../save-button';
|
|
44
|
+
import SavePanel from '../save-panel';
|
|
44
45
|
import SiteEditorMoreMenu from '../more-menu';
|
|
45
46
|
import SiteIcon from '../site-icon';
|
|
46
47
|
import useEditorIframeProps from '../block-editor/use-editor-iframe-props';
|
|
@@ -205,6 +206,7 @@ export default function EditSiteEditor( { isLoading } ) {
|
|
|
205
206
|
customSaveButton={
|
|
206
207
|
_isPreviewingTheme && <SaveButton size="compact" />
|
|
207
208
|
}
|
|
209
|
+
customSavePanel={ _isPreviewingTheme && <SavePanel /> }
|
|
208
210
|
forceDisableBlockTools={ ! hasDefaultEditorCanvasView }
|
|
209
211
|
title={
|
|
210
212
|
! hasDefaultEditorCanvasView
|
|
@@ -371,8 +371,7 @@ function ShadowItem( { shadow, onChange, canRemove, onRemove } ) {
|
|
|
371
371
|
'edit-site-global-styles__shadow-editor__remove-button',
|
|
372
372
|
{ 'is-open': isOpen }
|
|
373
373
|
),
|
|
374
|
-
|
|
375
|
-
tooltip: __( 'Remove shadow' ),
|
|
374
|
+
label: __( 'Remove shadow' ),
|
|
376
375
|
};
|
|
377
376
|
|
|
378
377
|
return (
|
|
@@ -42,11 +42,10 @@ import {
|
|
|
42
42
|
import ErrorBoundary from '../error-boundary';
|
|
43
43
|
import { store as editSiteStore } from '../../store';
|
|
44
44
|
import useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-entity-from-url';
|
|
45
|
-
import SiteHub from '../site-hub';
|
|
45
|
+
import { default as SiteHub, SiteHubMobile } from '../site-hub';
|
|
46
46
|
import ResizableFrame from '../resizable-frame';
|
|
47
47
|
import useSyncCanvasModeWithURL from '../sync-state-with-url/use-sync-canvas-mode-with-url';
|
|
48
48
|
import { unlock } from '../../lock-unlock';
|
|
49
|
-
import SavePanel from '../save-panel';
|
|
50
49
|
import KeyboardShortcutsRegister from '../keyboard-shortcuts/register';
|
|
51
50
|
import KeyboardShortcutsGlobal from '../keyboard-shortcuts/global';
|
|
52
51
|
import { useCommonCommands } from '../../hooks/commands/use-common-commands';
|
|
@@ -56,6 +55,7 @@ import useLayoutAreas from './router';
|
|
|
56
55
|
import useMovingAnimation from './animation';
|
|
57
56
|
import SidebarContent from '../sidebar';
|
|
58
57
|
import SaveHub from '../save-hub';
|
|
58
|
+
import SavePanel from '../save-panel';
|
|
59
59
|
|
|
60
60
|
const { useCommands } = unlock( coreCommandsPrivateApis );
|
|
61
61
|
const { useCommandContext } = unlock( commandsPrivateApis );
|
|
@@ -209,6 +209,7 @@ export default function Layout() {
|
|
|
209
209
|
{ areas.sidebar }
|
|
210
210
|
</SidebarContent>
|
|
211
211
|
<SaveHub />
|
|
212
|
+
<SavePanel />
|
|
212
213
|
</motion.div>
|
|
213
214
|
) }
|
|
214
215
|
</AnimatePresence>
|
|
@@ -219,6 +220,16 @@ export default function Layout() {
|
|
|
219
220
|
|
|
220
221
|
{ isMobileViewport && areas.mobile && (
|
|
221
222
|
<div className="edit-site-layout__mobile">
|
|
223
|
+
{ canvasMode !== 'edit' && (
|
|
224
|
+
<SidebarContent routeKey={ routeKey }>
|
|
225
|
+
<SiteHubMobile
|
|
226
|
+
ref={ toggleRef }
|
|
227
|
+
isTransparent={
|
|
228
|
+
isResizableFrameOversized
|
|
229
|
+
}
|
|
230
|
+
/>
|
|
231
|
+
</SidebarContent>
|
|
232
|
+
) }
|
|
222
233
|
{ areas.mobile }
|
|
223
234
|
</div>
|
|
224
235
|
) }
|
|
@@ -282,8 +293,6 @@ export default function Layout() {
|
|
|
282
293
|
</div>
|
|
283
294
|
) }
|
|
284
295
|
</div>
|
|
285
|
-
|
|
286
|
-
<SavePanel />
|
|
287
296
|
</div>
|
|
288
297
|
</>
|
|
289
298
|
);
|
|
@@ -77,6 +77,7 @@ export default function useLayoutAreas() {
|
|
|
77
77
|
const isSiteEditorLoading = useIsSiteEditorLoading();
|
|
78
78
|
const { params } = useLocation();
|
|
79
79
|
const { postType, postId, path, layout, isCustom, canvas } = params;
|
|
80
|
+
const hasEditCanvasMode = canvas === 'edit';
|
|
80
81
|
useRedirectOldPaths();
|
|
81
82
|
|
|
82
83
|
// Page list
|
|
@@ -93,15 +94,14 @@ export default function useLayoutAreas() {
|
|
|
93
94
|
/>
|
|
94
95
|
),
|
|
95
96
|
content: <PagePages />,
|
|
96
|
-
preview: ( isListLayout ||
|
|
97
|
+
preview: ( isListLayout || hasEditCanvasMode ) && (
|
|
97
98
|
<Editor isLoading={ isSiteEditorLoading } />
|
|
98
99
|
),
|
|
99
|
-
mobile:
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
),
|
|
100
|
+
mobile: hasEditCanvasMode ? (
|
|
101
|
+
<Editor isLoading={ isSiteEditorLoading } />
|
|
102
|
+
) : (
|
|
103
|
+
<PagePages />
|
|
104
|
+
),
|
|
105
105
|
},
|
|
106
106
|
widths: {
|
|
107
107
|
content: isListLayout ? 380 : undefined,
|
|
@@ -119,10 +119,14 @@ export default function useLayoutAreas() {
|
|
|
119
119
|
<SidebarNavigationScreenTemplatesBrowse backPath={ {} } />
|
|
120
120
|
),
|
|
121
121
|
content: <PageTemplates />,
|
|
122
|
-
preview: ( isListLayout ||
|
|
122
|
+
preview: ( isListLayout || hasEditCanvasMode ) && (
|
|
123
123
|
<Editor isLoading={ isSiteEditorLoading } />
|
|
124
124
|
),
|
|
125
|
-
mobile:
|
|
125
|
+
mobile: hasEditCanvasMode ? (
|
|
126
|
+
<Editor isLoading={ isSiteEditorLoading } />
|
|
127
|
+
) : (
|
|
128
|
+
<PageTemplates />
|
|
129
|
+
),
|
|
126
130
|
},
|
|
127
131
|
widths: {
|
|
128
132
|
content: isListLayout ? 380 : undefined,
|
|
@@ -139,8 +143,12 @@ export default function useLayoutAreas() {
|
|
|
139
143
|
areas: {
|
|
140
144
|
sidebar: <SidebarNavigationScreenPatterns backPath={ {} } />,
|
|
141
145
|
content: <PagePatterns />,
|
|
142
|
-
mobile:
|
|
143
|
-
|
|
146
|
+
mobile: hasEditCanvasMode ? (
|
|
147
|
+
<Editor isLoading={ isSiteEditorLoading } />
|
|
148
|
+
) : (
|
|
149
|
+
<PagePatterns />
|
|
150
|
+
),
|
|
151
|
+
preview: hasEditCanvasMode && (
|
|
144
152
|
<Editor isLoading={ isSiteEditorLoading } />
|
|
145
153
|
),
|
|
146
154
|
},
|
|
@@ -156,7 +164,7 @@ export default function useLayoutAreas() {
|
|
|
156
164
|
<SidebarNavigationScreenGlobalStyles backPath={ {} } />
|
|
157
165
|
),
|
|
158
166
|
preview: <Editor isLoading={ isSiteEditorLoading } />,
|
|
159
|
-
mobile:
|
|
167
|
+
mobile: hasEditCanvasMode && (
|
|
160
168
|
<Editor isLoading={ isSiteEditorLoading } />
|
|
161
169
|
),
|
|
162
170
|
},
|
|
@@ -175,7 +183,7 @@ export default function useLayoutAreas() {
|
|
|
175
183
|
/>
|
|
176
184
|
),
|
|
177
185
|
preview: <Editor isLoading={ isSiteEditorLoading } />,
|
|
178
|
-
mobile:
|
|
186
|
+
mobile: hasEditCanvasMode && (
|
|
179
187
|
<Editor isLoading={ isSiteEditorLoading } />
|
|
180
188
|
),
|
|
181
189
|
},
|
|
@@ -188,7 +196,7 @@ export default function useLayoutAreas() {
|
|
|
188
196
|
<SidebarNavigationScreenNavigationMenus backPath={ {} } />
|
|
189
197
|
),
|
|
190
198
|
preview: <Editor isLoading={ isSiteEditorLoading } />,
|
|
191
|
-
mobile:
|
|
199
|
+
mobile: hasEditCanvasMode && (
|
|
192
200
|
<Editor isLoading={ isSiteEditorLoading } />
|
|
193
201
|
),
|
|
194
202
|
},
|
|
@@ -201,7 +209,7 @@ export default function useLayoutAreas() {
|
|
|
201
209
|
areas: {
|
|
202
210
|
sidebar: <SidebarNavigationScreenMain />,
|
|
203
211
|
preview: <Editor isLoading={ isSiteEditorLoading } />,
|
|
204
|
-
mobile:
|
|
212
|
+
mobile: hasEditCanvasMode && (
|
|
205
213
|
<Editor isLoading={ isSiteEditorLoading } />
|
|
206
214
|
),
|
|
207
215
|
},
|
|
@@ -56,6 +56,18 @@
|
|
|
56
56
|
position: relative;
|
|
57
57
|
width: 100%;
|
|
58
58
|
z-index: z-index(".edit-site-layout__canvas-container");
|
|
59
|
+
|
|
60
|
+
/*
|
|
61
|
+
* The SiteHubMobile component is displayed
|
|
62
|
+
* for pages that do not have a sidebar,
|
|
63
|
+
* yet it needs the Sidebar component for the React context.
|
|
64
|
+
*
|
|
65
|
+
* This removes the padding in this scenario.
|
|
66
|
+
* See https://github.com/WordPress/gutenberg/pull/63118
|
|
67
|
+
*/
|
|
68
|
+
.edit-site-sidebar__screen-wrapper {
|
|
69
|
+
padding: 0;
|
|
70
|
+
}
|
|
59
71
|
}
|
|
60
72
|
|
|
61
73
|
.edit-site-layout__canvas-container {
|