@wordpress/edit-site 7.0.0 → 7.1.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/canvas-loader/index.cjs +8 -3
- package/build/components/canvas-loader/index.cjs.map +3 -3
- package/build/components/editor/use-editor-title.cjs +1 -2
- package/build/components/editor/use-editor-title.cjs.map +3 -3
- package/build/components/save-button/index.cjs +3 -3
- package/build/components/save-button/index.cjs.map +3 -3
- package/build/components/save-panel/index.cjs +7 -4
- package/build/components/save-panel/index.cjs.map +3 -3
- package/build/components/sidebar-navigation-screen-patterns/index.cjs +3 -2
- package/build/components/sidebar-navigation-screen-patterns/index.cjs.map +3 -3
- package/build/components/site-editor-routes/styles.cjs +17 -12
- package/build/components/site-editor-routes/styles.cjs.map +2 -2
- package/build-module/components/canvas-loader/index.mjs +9 -7
- package/build-module/components/canvas-loader/index.mjs.map +2 -2
- package/build-module/components/editor/use-editor-title.mjs +5 -3
- package/build-module/components/editor/use-editor-title.mjs.map +2 -2
- package/build-module/components/save-button/index.mjs +6 -6
- package/build-module/components/save-button/index.mjs.map +2 -2
- package/build-module/components/save-panel/index.mjs +9 -7
- package/build-module/components/save-panel/index.mjs.map +2 -2
- package/build-module/components/sidebar-navigation-screen-patterns/index.mjs +2 -1
- package/build-module/components/sidebar-navigation-screen-patterns/index.mjs.map +2 -2
- package/build-module/components/site-editor-routes/styles.mjs +17 -12
- package/build-module/components/site-editor-routes/styles.mjs.map +2 -2
- package/build-style/style-rtl.css +19 -8
- package/build-style/style.css +19 -8
- package/package.json +48 -49
- package/src/components/canvas-loader/index.js +6 -10
- package/src/components/canvas-loader/style.scss +3 -4
- package/src/components/editor/use-editor-title.js +5 -3
- package/src/components/save-button/index.js +6 -6
- package/src/components/save-panel/index.js +9 -7
- package/src/components/sidebar-navigation-screen-patterns/index.js +2 -1
- package/src/components/site-editor-routes/styles.js +19 -11
|
@@ -4,13 +4,12 @@
|
|
|
4
4
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
5
5
|
import { Button } from '@wordpress/components';
|
|
6
6
|
import { __, _n, sprintf } from '@wordpress/i18n';
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
store as coreStore,
|
|
9
|
+
privateApis as coreDataPrivateApis,
|
|
10
|
+
} from '@wordpress/core-data';
|
|
8
11
|
import { displayShortcut } from '@wordpress/keycodes';
|
|
9
12
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
10
|
-
import {
|
|
11
|
-
useEntitiesSavedStatesIsDirty,
|
|
12
|
-
store as editorStore,
|
|
13
|
-
} from '@wordpress/editor';
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
15
|
* Internal dependencies
|
|
@@ -23,6 +22,7 @@ import {
|
|
|
23
22
|
import { unlock } from '../../lock-unlock';
|
|
24
23
|
|
|
25
24
|
const { useLocation } = unlock( routerPrivateApis );
|
|
25
|
+
const { useEntitiesSavedStatesIsDirty } = unlock( coreDataPrivateApis );
|
|
26
26
|
|
|
27
27
|
export default function SaveButton( {
|
|
28
28
|
className = 'edit-site-save-button__button',
|
|
@@ -35,7 +35,7 @@ export default function SaveButton( {
|
|
|
35
35
|
} ) {
|
|
36
36
|
const { params } = useLocation();
|
|
37
37
|
const { setIsSaveViewOpened } = useDispatch( editSiteStore );
|
|
38
|
-
const { saveDirtyEntities } = unlock( useDispatch(
|
|
38
|
+
const { saveDirtyEntities } = unlock( useDispatch( coreStore ) );
|
|
39
39
|
const { dirtyEntityRecords } = useEntitiesSavedStatesIsDirty();
|
|
40
40
|
const { isSaving, isSaveViewOpen, previewingThemeName } = useSelect(
|
|
41
41
|
( select ) => {
|
|
@@ -8,14 +8,12 @@ import clsx from 'clsx';
|
|
|
8
8
|
*/
|
|
9
9
|
import { NavigableRegion } from '@wordpress/admin-ui';
|
|
10
10
|
import { Button, Modal } from '@wordpress/components';
|
|
11
|
-
import {
|
|
12
|
-
EntitiesSavedStates,
|
|
13
|
-
useEntitiesSavedStatesIsDirty,
|
|
14
|
-
privateApis,
|
|
15
|
-
} from '@wordpress/editor';
|
|
16
11
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
17
12
|
import { __, sprintf } from '@wordpress/i18n';
|
|
18
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
store as coreStore,
|
|
15
|
+
privateApis as coreDataPrivateApis,
|
|
16
|
+
} from '@wordpress/core-data';
|
|
19
17
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
20
18
|
import { useEffect } from '@wordpress/element';
|
|
21
19
|
|
|
@@ -28,8 +26,12 @@ import { useActivateTheme } from '../../utils/use-activate-theme';
|
|
|
28
26
|
import { useActualCurrentTheme } from '../../utils/use-actual-current-theme';
|
|
29
27
|
import { isPreviewingTheme } from '../../utils/is-previewing-theme';
|
|
30
28
|
|
|
31
|
-
const { EntitiesSavedStatesExtensible } = unlock( privateApis );
|
|
32
29
|
const { useLocation } = unlock( routerPrivateApis );
|
|
30
|
+
const {
|
|
31
|
+
EntitiesSavedStatesExtensible,
|
|
32
|
+
EntitiesSavedStates,
|
|
33
|
+
useEntitiesSavedStatesIsDirty,
|
|
34
|
+
} = unlock( coreDataPrivateApis );
|
|
33
35
|
|
|
34
36
|
const EntitiesSavedStatesForPreview = ( {
|
|
35
37
|
onClose,
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
__experimentalItemGroup as ItemGroup,
|
|
6
6
|
__experimentalItem as Item,
|
|
7
7
|
} from '@wordpress/components';
|
|
8
|
-
import { getTemplatePartIcon } from '@wordpress/editor';
|
|
9
8
|
import { useMemo } from '@wordpress/element';
|
|
10
9
|
import { __ } from '@wordpress/i18n';
|
|
11
10
|
import { file } from '@wordpress/icons';
|
|
12
11
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
12
|
+
import { privateApis as coreDataPrivateApis } from '@wordpress/core-data';
|
|
13
13
|
import { useViewConfig } from '@wordpress/views';
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -30,6 +30,7 @@ import { unlock } from '../../lock-unlock';
|
|
|
30
30
|
const VIEW_CONFIG_FIELDS = [ 'view_list' ];
|
|
31
31
|
|
|
32
32
|
const { useLocation } = unlock( routerPrivateApis );
|
|
33
|
+
const { getTemplatePartIcon } = unlock( coreDataPrivateApis );
|
|
33
34
|
|
|
34
35
|
function CategoriesGroup( {
|
|
35
36
|
templatePartViews,
|
|
@@ -14,12 +14,12 @@ import SidebarNavigationScreenGlobalStyles from '../sidebar-navigation-screen-gl
|
|
|
14
14
|
import SidebarGlobalStyles from '../sidebar-global-styles';
|
|
15
15
|
|
|
16
16
|
const { useLocation, useHistory } = unlock( routerPrivateApis );
|
|
17
|
-
const { StyleBookPreview } = unlock( editorPrivateApis );
|
|
17
|
+
const { StyleBookPreview, useGlobalStyles } = unlock( editorPrivateApis );
|
|
18
18
|
|
|
19
|
-
function
|
|
19
|
+
function StyleBookPreviewArea( { siteData } ) {
|
|
20
20
|
const { path, query } = useLocation();
|
|
21
21
|
const history = useHistory();
|
|
22
|
-
const
|
|
22
|
+
const { user: userConfig } = useGlobalStyles();
|
|
23
23
|
|
|
24
24
|
// Get section from URL query params
|
|
25
25
|
const section = query.section ?? '/';
|
|
@@ -31,14 +31,22 @@ function StylesPreviewArea( { siteData } ) {
|
|
|
31
31
|
);
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
34
|
+
return (
|
|
35
|
+
<StyleBookPreview
|
|
36
|
+
path={ section }
|
|
37
|
+
onPathChange={ onChangeSection }
|
|
38
|
+
settings={ siteData.editorSettings }
|
|
39
|
+
// Without userConfig the preview falls back to the static `settings` styles and unsaved global styles edits are not shown.
|
|
40
|
+
userConfig={ userConfig }
|
|
41
|
+
/>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function StylesPreviewArea( { siteData } ) {
|
|
46
|
+
const { query } = useLocation();
|
|
47
|
+
|
|
48
|
+
if ( query.preview === 'stylebook' ) {
|
|
49
|
+
return <StyleBookPreviewArea siteData={ siteData } />;
|
|
42
50
|
}
|
|
43
51
|
|
|
44
52
|
return <Editor />;
|