@wordpress/edit-site 6.6.1 → 6.7.1-next.5368f64a9.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/add-new-template/add-custom-template-modal-content.js +7 -13
- package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build/components/add-new-template/index.js +7 -10
- package/build/components/add-new-template/index.js.map +1 -1
- package/build/components/block-editor/use-site-editor-settings.js +0 -24
- package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build/components/editor/index.js +6 -3
- package/build/components/editor/index.js.map +1 -1
- package/build/components/editor-canvas-container/index.js +4 -1
- package/build/components/editor-canvas-container/index.js.map +1 -1
- package/build/components/error-boundary/warning.js +4 -1
- package/build/components/error-boundary/warning.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-card.js +5 -2
- package/build/components/global-styles/font-library-modal/font-card.js.map +1 -1
- package/build/components/global-styles/font-library-modal/font-collection.js +27 -19
- package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build/components/global-styles/font-library-modal/installed-fonts.js +21 -8
- package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js +4 -1
- package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build/components/global-styles/font-sizes/font-size.js +10 -11
- package/build/components/global-styles/font-sizes/font-size.js.map +1 -1
- package/build/components/global-styles/font-sizes/font-sizes.js +4 -6
- package/build/components/global-styles/font-sizes/font-sizes.js.map +1 -1
- package/build/components/global-styles/header.js +1 -8
- package/build/components/global-styles/header.js.map +1 -1
- package/build/components/global-styles/navigation-button.js +1 -1
- package/build/components/global-styles/navigation-button.js.map +1 -1
- package/build/components/global-styles/palette.js +4 -1
- package/build/components/global-styles/palette.js.map +1 -1
- package/build/components/global-styles/preset-colors.js +1 -1
- package/build/components/global-styles/preset-colors.js.map +1 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js +4 -1
- package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build/components/global-styles/shadows-edit-panel.js +20 -10
- package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build/components/global-styles/typeset-button.js +5 -4
- package/build/components/global-styles/typeset-button.js.map +1 -1
- package/build/components/layout/index.js +1 -2
- package/build/components/layout/index.js.map +1 -1
- package/build/components/page-patterns/fields.js +5 -2
- package/build/components/page-patterns/fields.js.map +1 -1
- package/build/components/pagination/index.js +4 -4
- package/build/components/pagination/index.js.map +1 -1
- package/build/components/save-panel/index.js +4 -1
- package/build/components/save-panel/index.js.map +1 -1
- package/build/components/sidebar-button/index.js +4 -1
- package/build/components/sidebar-button/index.js.map +1 -1
- package/build/components/sidebar-dataviews/add-new-view.js +8 -2
- package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build/components/site-hub/index.js +30 -14
- package/build/components/site-hub/index.js.map +1 -1
- package/build/components/style-book/index.js +3 -9
- package/build/components/style-book/index.js.map +1 -1
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -4
- package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +12 -12
- package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build/components/welcome-guide/template.js +20 -9
- package/build/components/welcome-guide/template.js.map +1 -1
- package/build/hooks/commands/use-common-commands.js +2 -4
- package/build/hooks/commands/use-common-commands.js.map +1 -1
- package/build/index.js +8 -1
- package/build/index.js.map +1 -1
- package/build/posts.js +2 -1
- package/build/posts.js.map +1 -1
- package/build-module/components/add-new-template/add-custom-template-modal-content.js +7 -13
- package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
- package/build-module/components/add-new-template/index.js +7 -10
- package/build-module/components/add-new-template/index.js.map +1 -1
- package/build-module/components/block-editor/use-site-editor-settings.js +0 -23
- package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
- package/build-module/components/editor/index.js +6 -3
- package/build-module/components/editor/index.js.map +1 -1
- package/build-module/components/editor-canvas-container/index.js +4 -1
- package/build-module/components/editor-canvas-container/index.js.map +1 -1
- package/build-module/components/error-boundary/warning.js +4 -1
- package/build-module/components/error-boundary/warning.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-card.js +7 -4
- package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/font-collection.js +29 -21
- package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js +24 -11
- package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js +4 -1
- package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
- package/build-module/components/global-styles/font-sizes/font-size.js +15 -16
- package/build-module/components/global-styles/font-sizes/font-size.js.map +1 -1
- package/build-module/components/global-styles/font-sizes/font-sizes.js +4 -6
- package/build-module/components/global-styles/font-sizes/font-sizes.js.map +1 -1
- package/build-module/components/global-styles/header.js +2 -9
- package/build-module/components/global-styles/header.js.map +1 -1
- package/build-module/components/global-styles/navigation-button.js +2 -2
- package/build-module/components/global-styles/navigation-button.js.map +1 -1
- package/build-module/components/global-styles/palette.js +4 -1
- package/build-module/components/global-styles/palette.js.map +1 -1
- package/build-module/components/global-styles/preset-colors.js +1 -1
- package/build-module/components/global-styles/preset-colors.js.map +1 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +4 -1
- package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
- package/build-module/components/global-styles/shadows-edit-panel.js +20 -10
- package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
- package/build-module/components/global-styles/typeset-button.js +6 -5
- package/build-module/components/global-styles/typeset-button.js.map +1 -1
- package/build-module/components/layout/index.js +1 -2
- package/build-module/components/layout/index.js.map +1 -1
- package/build-module/components/page-patterns/fields.js +5 -2
- package/build-module/components/page-patterns/fields.js.map +1 -1
- package/build-module/components/pagination/index.js +5 -5
- package/build-module/components/pagination/index.js.map +1 -1
- package/build-module/components/save-panel/index.js +4 -1
- package/build-module/components/save-panel/index.js.map +1 -1
- package/build-module/components/sidebar-button/index.js +4 -1
- package/build-module/components/sidebar-button/index.js.map +1 -1
- package/build-module/components/sidebar-dataviews/add-new-view.js +8 -2
- package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
- package/build-module/components/site-hub/index.js +30 -14
- package/build-module/components/site-hub/index.js.map +1 -1
- package/build-module/components/style-book/index.js +3 -9
- 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 +3 -4
- package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +12 -12
- package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
- package/build-module/components/welcome-guide/template.js +19 -9
- package/build-module/components/welcome-guide/template.js.map +1 -1
- package/build-module/hooks/commands/use-common-commands.js +2 -4
- package/build-module/hooks/commands/use-common-commands.js.map +1 -1
- package/build-module/index.js +8 -1
- package/build-module/index.js.map +1 -1
- package/build-module/posts.js +2 -1
- package/build-module/posts.js.map +1 -1
- package/build-style/posts-rtl.css +90 -87
- package/build-style/posts.css +90 -87
- package/build-style/style-rtl.css +94 -103
- package/build-style/style.css +94 -103
- package/package.json +41 -41
- package/src/components/add-new-template/add-custom-template-modal-content.js +6 -12
- package/src/components/add-new-template/index.js +6 -8
- package/src/components/add-new-template/style.scss +1 -2
- package/src/components/block-editor/use-site-editor-settings.js +0 -18
- package/src/components/editor/index.js +4 -2
- package/src/components/editor-canvas-container/index.js +2 -0
- package/src/components/editor-canvas-container/style.scss +1 -1
- package/src/components/error-boundary/warning.js +6 -1
- package/src/components/global-styles/font-library-modal/font-card.js +5 -3
- package/src/components/global-styles/font-library-modal/font-collection.js +45 -27
- package/src/components/global-styles/font-library-modal/installed-fonts.js +36 -14
- package/src/components/global-styles/font-library-modal/upload-fonts.js +2 -0
- package/src/components/global-styles/font-sizes/font-size.js +18 -18
- package/src/components/global-styles/font-sizes/font-sizes.js +9 -11
- package/src/components/global-styles/header.js +2 -7
- package/src/components/global-styles/navigation-button.js +2 -4
- package/src/components/global-styles/palette.js +2 -0
- package/src/components/global-styles/preset-colors.js +1 -1
- package/src/components/global-styles/screen-revisions/revisions-buttons.js +2 -0
- package/src/components/global-styles/screen-revisions/style.scss +1 -1
- package/src/components/global-styles/shadows-edit-panel.js +23 -13
- package/src/components/global-styles/style.scss +5 -5
- package/src/components/global-styles/typeset-button.js +10 -3
- package/src/components/global-styles/variations/style.scss +1 -2
- package/src/components/layout/index.js +0 -2
- package/src/components/layout/style.scss +2 -24
- package/src/components/page/style.scss +5 -1
- package/src/components/page-patterns/fields.js +3 -1
- package/src/components/page-patterns/style.scss +2 -11
- package/src/components/page-templates/style.scss +1 -2
- package/src/components/pagination/index.js +5 -5
- package/src/components/post-list/style.scss +1 -1
- package/src/components/save-panel/index.js +2 -0
- package/src/components/sidebar-button/index.js +2 -0
- package/src/components/sidebar-dataviews/add-new-view.js +4 -0
- package/src/components/sidebar-dataviews/style.scss +1 -1
- package/src/components/sidebar-navigation-item/style.scss +0 -1
- package/src/components/sidebar-navigation-screen/style.scss +0 -1
- package/src/components/site-hub/index.js +18 -12
- package/src/components/style-book/index.js +5 -11
- package/src/components/style-book/style.scss +2 -2
- package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -4
- package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +15 -12
- package/src/components/welcome-guide/template.js +12 -18
- package/src/hooks/commands/use-common-commands.js +3 -5
- package/src/index.js +8 -0
- package/src/posts.js +1 -0
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { useSelect } from '@wordpress/data';
|
|
5
5
|
import { useMemo } from '@wordpress/element';
|
|
6
|
-
import { privateApis as editorPrivateApis } from '@wordpress/editor';
|
|
7
6
|
import { privateApis as routerPrivateApis } from '@wordpress/router';
|
|
8
7
|
import { usePrevious } from '@wordpress/compose';
|
|
9
8
|
|
|
@@ -15,7 +14,6 @@ import { unlock } from '../../lock-unlock';
|
|
|
15
14
|
import useNavigateToEntityRecord from './use-navigate-to-entity-record';
|
|
16
15
|
import { FOCUSABLE_ENTITIES } from '../../utils/constants';
|
|
17
16
|
|
|
18
|
-
const { useBlockEditorSettings } = unlock( editorPrivateApis );
|
|
19
17
|
const { useLocation, useHistory } = unlock( routerPrivateApis );
|
|
20
18
|
|
|
21
19
|
function useNavigateToPreviousEntityRecord() {
|
|
@@ -83,19 +81,3 @@ export function useSpecificEditorSettings() {
|
|
|
83
81
|
|
|
84
82
|
return defaultEditorSettings;
|
|
85
83
|
}
|
|
86
|
-
|
|
87
|
-
export default function useSiteEditorSettings() {
|
|
88
|
-
const defaultEditorSettings = useSpecificEditorSettings();
|
|
89
|
-
const { postType, postId } = useSelect( ( select ) => {
|
|
90
|
-
const { getEditedPostType, getEditedPostId } = unlock(
|
|
91
|
-
select( editSiteStore )
|
|
92
|
-
);
|
|
93
|
-
const usedPostType = getEditedPostType();
|
|
94
|
-
const usedPostId = getEditedPostId();
|
|
95
|
-
return {
|
|
96
|
-
postType: usedPostType,
|
|
97
|
-
postId: usedPostId,
|
|
98
|
-
};
|
|
99
|
-
}, [] );
|
|
100
|
-
return useBlockEditorSettings( defaultEditorSettings, postType, postId );
|
|
101
|
-
}
|
|
@@ -66,13 +66,13 @@ const toggleHomeIconVariants = {
|
|
|
66
66
|
|
|
67
67
|
const siteIconVariants = {
|
|
68
68
|
edit: {
|
|
69
|
-
clipPath: 'inset(0% round
|
|
69
|
+
clipPath: 'inset(0% round 0px)',
|
|
70
70
|
},
|
|
71
71
|
hover: {
|
|
72
72
|
clipPath: 'inset( 22% round 2px )',
|
|
73
73
|
},
|
|
74
74
|
tap: {
|
|
75
|
-
clipPath: 'inset(0% round
|
|
75
|
+
clipPath: 'inset(0% round 0px)',
|
|
76
76
|
},
|
|
77
77
|
};
|
|
78
78
|
|
|
@@ -258,6 +258,8 @@ export default function EditSiteEditor( { isPostsList = false } ) {
|
|
|
258
258
|
whileTap="tap"
|
|
259
259
|
>
|
|
260
260
|
<Button
|
|
261
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
262
|
+
__next40pxDefaultSize={ false }
|
|
261
263
|
label={ __( 'Open Navigation' ) }
|
|
262
264
|
showTooltip
|
|
263
265
|
tooltipPosition="middle right"
|
|
@@ -136,6 +136,8 @@ function EditorCanvasContainer( {
|
|
|
136
136
|
>
|
|
137
137
|
{ shouldShowCloseButton && (
|
|
138
138
|
<Button
|
|
139
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
140
|
+
__next40pxDefaultSize={ false }
|
|
139
141
|
className="edit-site-editor-canvas-container__close-button"
|
|
140
142
|
icon={ closeSmall }
|
|
141
143
|
label={ closeButtonLabel || __( 'Close' ) }
|
|
@@ -9,7 +9,12 @@ import { useCopyToClipboard } from '@wordpress/compose';
|
|
|
9
9
|
function CopyButton( { text, children } ) {
|
|
10
10
|
const ref = useCopyToClipboard( text );
|
|
11
11
|
return (
|
|
12
|
-
<Button
|
|
12
|
+
<Button
|
|
13
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
14
|
+
__next40pxDefaultSize={ false }
|
|
15
|
+
variant="secondary"
|
|
16
|
+
ref={ ref }
|
|
17
|
+
>
|
|
13
18
|
{ children }
|
|
14
19
|
</Button>
|
|
15
20
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
-
import { _n, sprintf } from '@wordpress/i18n';
|
|
4
|
+
import { _n, sprintf, isRTL } from '@wordpress/i18n';
|
|
5
5
|
import {
|
|
6
6
|
__experimentalUseNavigator as useNavigator,
|
|
7
7
|
__experimentalText as Text,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
* Internal dependencies
|
|
16
16
|
*/
|
|
17
17
|
import FontDemo from './font-demo';
|
|
18
|
-
import { chevronRight } from '@wordpress/icons';
|
|
18
|
+
import { chevronLeft, chevronRight } from '@wordpress/icons';
|
|
19
19
|
|
|
20
20
|
function FontCard( { font, onClick, variantsText, navigatorPath } ) {
|
|
21
21
|
const variantsCount = font.fontFace?.length || 1;
|
|
@@ -28,6 +28,8 @@ function FontCard( { font, onClick, variantsText, navigatorPath } ) {
|
|
|
28
28
|
|
|
29
29
|
return (
|
|
30
30
|
<Button
|
|
31
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
32
|
+
__next40pxDefaultSize={ false }
|
|
31
33
|
onClick={ () => {
|
|
32
34
|
onClick();
|
|
33
35
|
if ( navigatorPath ) {
|
|
@@ -55,7 +57,7 @@ function FontCard( { font, onClick, variantsText, navigatorPath } ) {
|
|
|
55
57
|
</Text>
|
|
56
58
|
</FlexItem>
|
|
57
59
|
<FlexItem>
|
|
58
|
-
<Icon icon={ chevronRight } />
|
|
60
|
+
<Icon icon={ isRTL() ? chevronLeft : chevronRight } />
|
|
59
61
|
</FlexItem>
|
|
60
62
|
</Flex>
|
|
61
63
|
</Flex>
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
__experimentalVStack as VStack,
|
|
16
16
|
__experimentalNavigatorProvider as NavigatorProvider,
|
|
17
17
|
__experimentalNavigatorScreen as NavigatorScreen,
|
|
18
|
-
|
|
18
|
+
__experimentalNavigatorBackButton as NavigatorBackButton,
|
|
19
19
|
__experimentalHeading as Heading,
|
|
20
20
|
Notice,
|
|
21
21
|
SelectControl,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
CheckboxControl,
|
|
29
29
|
} from '@wordpress/components';
|
|
30
30
|
import { debounce } from '@wordpress/compose';
|
|
31
|
-
import { sprintf, __, _x } from '@wordpress/i18n';
|
|
31
|
+
import { sprintf, __, _x, isRTL } from '@wordpress/i18n';
|
|
32
32
|
import { moreVertical, chevronLeft, chevronRight } from '@wordpress/icons';
|
|
33
33
|
|
|
34
34
|
/**
|
|
@@ -376,14 +376,16 @@ function FontCollection( { slug } ) {
|
|
|
376
376
|
</li>
|
|
377
377
|
) ) }
|
|
378
378
|
</ul>
|
|
379
|
-
{ /* eslint-enable jsx-a11y/no-redundant-roles */ }
|
|
379
|
+
{ /* eslint-enable jsx-a11y/no-redundant-roles */ }
|
|
380
380
|
</div>
|
|
381
381
|
</NavigatorScreen>
|
|
382
382
|
|
|
383
383
|
<NavigatorScreen path="/fontFamily">
|
|
384
384
|
<Flex justify="flex-start">
|
|
385
|
-
<
|
|
386
|
-
icon={
|
|
385
|
+
<NavigatorBackButton
|
|
386
|
+
icon={
|
|
387
|
+
isRTL() ? chevronRight : chevronLeft
|
|
388
|
+
}
|
|
387
389
|
size="small"
|
|
388
390
|
onClick={ () => {
|
|
389
391
|
setSelectedFont( null );
|
|
@@ -425,26 +427,40 @@ function FontCollection( { slug } ) {
|
|
|
425
427
|
__nextHasNoMarginBottom
|
|
426
428
|
/>
|
|
427
429
|
<VStack spacing={ 0 }>
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
430
|
+
{ /*
|
|
431
|
+
* Disable reason: The `list` ARIA role is redundant but
|
|
432
|
+
* Safari+VoiceOver won't announce the list otherwise.
|
|
433
|
+
*/
|
|
434
|
+
/* eslint-disable jsx-a11y/no-redundant-roles */ }
|
|
435
|
+
<ul
|
|
436
|
+
role="list"
|
|
437
|
+
className="font-library-modal__fonts-list"
|
|
438
|
+
>
|
|
439
|
+
{ getSortedFontFaces( selectedFont ).map(
|
|
440
|
+
( face, i ) => (
|
|
441
|
+
<li
|
|
442
|
+
key={ `face${ i }` }
|
|
443
|
+
className="font-library-modal__fonts-list-item"
|
|
444
|
+
>
|
|
445
|
+
<CollectionFontVariant
|
|
446
|
+
font={ selectedFont }
|
|
447
|
+
face={ face }
|
|
448
|
+
handleToggleVariant={
|
|
449
|
+
handleToggleVariant
|
|
450
|
+
}
|
|
451
|
+
selected={ isFontFontFaceInOutline(
|
|
452
|
+
selectedFont.slug,
|
|
453
|
+
selectedFont.fontFace
|
|
454
|
+
? face
|
|
455
|
+
: null, // If the font has no fontFace, we want to check if the font is in the outline
|
|
456
|
+
fontToInstallOutline
|
|
457
|
+
) }
|
|
458
|
+
/>
|
|
459
|
+
</li>
|
|
460
|
+
)
|
|
461
|
+
) }
|
|
462
|
+
</ul>
|
|
463
|
+
{ /* eslint-enable jsx-a11y/no-redundant-roles */ }
|
|
448
464
|
</VStack>
|
|
449
465
|
<Spacer margin={ 16 } />
|
|
450
466
|
</NavigatorScreen>
|
|
@@ -456,6 +472,8 @@ function FontCollection( { slug } ) {
|
|
|
456
472
|
className="font-library-modal__footer"
|
|
457
473
|
>
|
|
458
474
|
<Button
|
|
475
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
476
|
+
__next40pxDefaultSize={ false }
|
|
459
477
|
variant="primary"
|
|
460
478
|
onClick={ handleInstall }
|
|
461
479
|
isBusy={ isInstalling }
|
|
@@ -482,7 +500,7 @@ function FontCollection( { slug } ) {
|
|
|
482
500
|
disabled={ page === 1 }
|
|
483
501
|
showTooltip
|
|
484
502
|
accessibleWhenDisabled
|
|
485
|
-
icon={ chevronLeft }
|
|
503
|
+
icon={ isRTL() ? chevronRight : chevronLeft }
|
|
486
504
|
tooltipPosition="top"
|
|
487
505
|
/>
|
|
488
506
|
<HStack
|
|
@@ -533,7 +551,7 @@ function FontCollection( { slug } ) {
|
|
|
533
551
|
onClick={ () => setPage( page + 1 ) }
|
|
534
552
|
disabled={ page === totalPages }
|
|
535
553
|
accessibleWhenDisabled
|
|
536
|
-
icon={ chevronRight }
|
|
554
|
+
icon={ isRTL() ? chevronLeft : chevronRight }
|
|
537
555
|
tooltipPosition="top"
|
|
538
556
|
/>
|
|
539
557
|
</HStack>
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
__experimentalHeading as Heading,
|
|
9
9
|
__experimentalNavigatorProvider as NavigatorProvider,
|
|
10
10
|
__experimentalNavigatorScreen as NavigatorScreen,
|
|
11
|
-
|
|
11
|
+
__experimentalNavigatorBackButton as NavigatorBackButton,
|
|
12
12
|
__experimentalUseNavigator as useNavigator,
|
|
13
13
|
__experimentalSpacer as Spacer,
|
|
14
14
|
__experimentalText as Text,
|
|
@@ -21,8 +21,8 @@ import {
|
|
|
21
21
|
import { useEntityRecord, store as coreStore } from '@wordpress/core-data';
|
|
22
22
|
import { useSelect } from '@wordpress/data';
|
|
23
23
|
import { useContext, useEffect, useState } from '@wordpress/element';
|
|
24
|
-
import { __, _x, sprintf } from '@wordpress/i18n';
|
|
25
|
-
import { chevronLeft } from '@wordpress/icons';
|
|
24
|
+
import { __, _x, sprintf, isRTL } from '@wordpress/i18n';
|
|
25
|
+
import { chevronLeft, chevronRight } from '@wordpress/icons';
|
|
26
26
|
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
27
27
|
|
|
28
28
|
/**
|
|
@@ -353,8 +353,10 @@ function InstalledFonts() {
|
|
|
353
353
|
/>
|
|
354
354
|
|
|
355
355
|
<Flex justify="flex-start">
|
|
356
|
-
<
|
|
357
|
-
icon={
|
|
356
|
+
<NavigatorBackButton
|
|
357
|
+
icon={
|
|
358
|
+
isRTL() ? chevronRight : chevronLeft
|
|
359
|
+
}
|
|
358
360
|
size="small"
|
|
359
361
|
onClick={ () => {
|
|
360
362
|
handleSetLibraryFontSelected( null );
|
|
@@ -399,15 +401,31 @@ function InstalledFonts() {
|
|
|
399
401
|
__nextHasNoMarginBottom
|
|
400
402
|
/>
|
|
401
403
|
<Spacer margin={ 8 } />
|
|
402
|
-
{
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
404
|
+
{ /*
|
|
405
|
+
* Disable reason: The `list` ARIA role is redundant but
|
|
406
|
+
* Safari+VoiceOver won't announce the list otherwise.
|
|
407
|
+
*/
|
|
408
|
+
/* eslint-disable jsx-a11y/no-redundant-roles */ }
|
|
409
|
+
<ul
|
|
410
|
+
role="list"
|
|
411
|
+
className="font-library-modal__fonts-list"
|
|
412
|
+
>
|
|
413
|
+
{ getFontFacesToDisplay(
|
|
414
|
+
libraryFontSelected
|
|
415
|
+
).map( ( face, i ) => (
|
|
416
|
+
<li
|
|
417
|
+
key={ `face${ i }` }
|
|
418
|
+
className="font-library-modal__fonts-list-item"
|
|
419
|
+
>
|
|
420
|
+
<LibraryFontVariant
|
|
421
|
+
font={ libraryFontSelected }
|
|
422
|
+
face={ face }
|
|
423
|
+
key={ `face${ i }` }
|
|
424
|
+
/>
|
|
425
|
+
</li>
|
|
426
|
+
) ) }
|
|
427
|
+
</ul>
|
|
428
|
+
{ /* eslint-enable jsx-a11y/no-redundant-roles */ }
|
|
411
429
|
</VStack>
|
|
412
430
|
</NavigatorScreen>
|
|
413
431
|
</NavigatorProvider>
|
|
@@ -419,6 +437,8 @@ function InstalledFonts() {
|
|
|
419
437
|
{ isInstalling && <ProgressBar /> }
|
|
420
438
|
{ shouldDisplayDeleteButton && (
|
|
421
439
|
<Button
|
|
440
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
441
|
+
__next40pxDefaultSize={ false }
|
|
422
442
|
isDestructive
|
|
423
443
|
variant="tertiary"
|
|
424
444
|
onClick={ handleUninstallClick }
|
|
@@ -427,6 +447,8 @@ function InstalledFonts() {
|
|
|
427
447
|
</Button>
|
|
428
448
|
) }
|
|
429
449
|
<Button
|
|
450
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
451
|
+
__next40pxDefaultSize={ false }
|
|
430
452
|
variant="primary"
|
|
431
453
|
onClick={ handleUpdate }
|
|
432
454
|
disabled={ ! fontFamiliesHasChanges }
|
|
@@ -230,6 +230,8 @@ function UploadFonts() {
|
|
|
230
230
|
onChange={ onFilesUpload }
|
|
231
231
|
render={ ( { openFileDialog } ) => (
|
|
232
232
|
<Button
|
|
233
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
234
|
+
__next40pxDefaultSize={ false }
|
|
233
235
|
className="font-library-modal__upload-area"
|
|
234
236
|
onClick={ openFileDialog }
|
|
235
237
|
>
|
|
@@ -21,18 +21,15 @@ import { useState } from '@wordpress/element';
|
|
|
21
21
|
* Internal dependencies
|
|
22
22
|
*/
|
|
23
23
|
import { unlock } from '../../../lock-unlock';
|
|
24
|
-
const {
|
|
25
|
-
DropdownMenuV2: DropdownMenu,
|
|
26
|
-
DropdownMenuItemV2: DropdownMenuItem,
|
|
27
|
-
DropdownMenuItemLabelV2: DropdownMenuItemLabel,
|
|
28
|
-
} = unlock( componentsPrivateApis );
|
|
29
|
-
const { useGlobalSetting } = unlock( blockEditorPrivateApis );
|
|
30
24
|
import ScreenHeader from '../header';
|
|
31
25
|
import FontSizePreview from './font-size-preview';
|
|
32
26
|
import ConfirmDeleteFontSizeDialog from './confirm-delete-font-size-dialog';
|
|
33
27
|
import RenameFontSizeDialog from './rename-font-size-dialog';
|
|
34
28
|
import SizeControl from '../size-control';
|
|
35
29
|
|
|
30
|
+
const { DropdownMenuV2 } = unlock( componentsPrivateApis );
|
|
31
|
+
const { useGlobalSetting } = unlock( blockEditorPrivateApis );
|
|
32
|
+
|
|
36
33
|
function FontSize() {
|
|
37
34
|
const [ isDeleteConfirmOpen, setIsDeleteConfirmOpen ] = useState( false );
|
|
38
35
|
const [ isRenameDialogOpen, setIsRenameDialogOpen ] = useState( false );
|
|
@@ -47,14 +44,17 @@ function FontSize() {
|
|
|
47
44
|
'typography.fontSizes'
|
|
48
45
|
);
|
|
49
46
|
|
|
47
|
+
const [ globalFluid ] = useGlobalSetting( 'typography.fluid' );
|
|
48
|
+
|
|
50
49
|
// Get the font sizes from the origin, default to empty array.
|
|
51
50
|
const sizes = fontSizes[ origin ] ?? [];
|
|
52
51
|
|
|
53
52
|
// Get the font size by slug.
|
|
54
53
|
const fontSize = sizes.find( ( size ) => size.slug === slug );
|
|
55
54
|
|
|
56
|
-
// Whether
|
|
57
|
-
const isFluid =
|
|
55
|
+
// Whether the font size is fluid. If not defined, use the global fluid value of the theme.
|
|
56
|
+
const isFluid =
|
|
57
|
+
fontSize.fluid !== undefined ? !! fontSize.fluid : !! globalFluid;
|
|
58
58
|
|
|
59
59
|
// Whether custom fluid values are used.
|
|
60
60
|
const isCustomFluid = typeof fontSize.fluid === 'object';
|
|
@@ -160,7 +160,7 @@ function FontSize() {
|
|
|
160
160
|
marginBottom={ 0 }
|
|
161
161
|
paddingX={ 4 }
|
|
162
162
|
>
|
|
163
|
-
<
|
|
163
|
+
<DropdownMenuV2
|
|
164
164
|
trigger={
|
|
165
165
|
<Button
|
|
166
166
|
size="small"
|
|
@@ -169,21 +169,21 @@ function FontSize() {
|
|
|
169
169
|
/>
|
|
170
170
|
}
|
|
171
171
|
>
|
|
172
|
-
<
|
|
172
|
+
<DropdownMenuV2.Item
|
|
173
173
|
onClick={ toggleRenameDialog }
|
|
174
174
|
>
|
|
175
|
-
<
|
|
175
|
+
<DropdownMenuV2.ItemLabel>
|
|
176
176
|
{ __( 'Rename' ) }
|
|
177
|
-
</
|
|
178
|
-
</
|
|
179
|
-
<
|
|
177
|
+
</DropdownMenuV2.ItemLabel>
|
|
178
|
+
</DropdownMenuV2.Item>
|
|
179
|
+
<DropdownMenuV2.Item
|
|
180
180
|
onClick={ toggleDeleteConfirm }
|
|
181
181
|
>
|
|
182
|
-
<
|
|
182
|
+
<DropdownMenuV2.ItemLabel>
|
|
183
183
|
{ __( 'Delete' ) }
|
|
184
|
-
</
|
|
185
|
-
</
|
|
186
|
-
</
|
|
184
|
+
</DropdownMenuV2.ItemLabel>
|
|
185
|
+
</DropdownMenuV2.Item>
|
|
186
|
+
</DropdownMenuV2>
|
|
187
187
|
</Spacer>
|
|
188
188
|
</FlexItem>
|
|
189
189
|
) }
|
|
@@ -27,11 +27,7 @@ import { useState } from '@wordpress/element';
|
|
|
27
27
|
* Internal dependencies
|
|
28
28
|
*/
|
|
29
29
|
import { unlock } from '../../../lock-unlock';
|
|
30
|
-
const {
|
|
31
|
-
DropdownMenuV2: DropdownMenu,
|
|
32
|
-
DropdownMenuItemV2: DropdownMenuItem,
|
|
33
|
-
DropdownMenuItemLabelV2: DropdownMenuItemLabel,
|
|
34
|
-
} = unlock( componentsPrivateApis );
|
|
30
|
+
const { DropdownMenuV2 } = unlock( componentsPrivateApis );
|
|
35
31
|
const { useGlobalSetting } = unlock( blockEditorPrivateApis );
|
|
36
32
|
import Subtitle from '../subtitle';
|
|
37
33
|
import { NavigationButtonAsItem } from '../navigation-button';
|
|
@@ -85,7 +81,7 @@ function FontSizeGroup( {
|
|
|
85
81
|
/>
|
|
86
82
|
) }
|
|
87
83
|
{ !! handleResetFontSizes && (
|
|
88
|
-
<
|
|
84
|
+
<DropdownMenuV2
|
|
89
85
|
trigger={
|
|
90
86
|
<Button
|
|
91
87
|
size="small"
|
|
@@ -96,14 +92,16 @@ function FontSizeGroup( {
|
|
|
96
92
|
/>
|
|
97
93
|
}
|
|
98
94
|
>
|
|
99
|
-
<
|
|
100
|
-
|
|
95
|
+
<DropdownMenuV2.Item
|
|
96
|
+
onClick={ toggleResetDialog }
|
|
97
|
+
>
|
|
98
|
+
<DropdownMenuV2.ItemLabel>
|
|
101
99
|
{ origin === 'custom'
|
|
102
100
|
? __( 'Remove font size presets' )
|
|
103
101
|
: __( 'Reset font size presets' ) }
|
|
104
|
-
</
|
|
105
|
-
</
|
|
106
|
-
</
|
|
102
|
+
</DropdownMenuV2.ItemLabel>
|
|
103
|
+
</DropdownMenuV2.Item>
|
|
104
|
+
</DropdownMenuV2>
|
|
107
105
|
) }
|
|
108
106
|
</FlexItem>
|
|
109
107
|
</HStack>
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
__experimentalSpacer as Spacer,
|
|
8
8
|
__experimentalHeading as Heading,
|
|
9
9
|
__experimentalView as View,
|
|
10
|
-
|
|
10
|
+
__experimentalNavigatorBackButton as NavigatorBackButton,
|
|
11
11
|
} from '@wordpress/components';
|
|
12
12
|
import { isRTL, __ } from '@wordpress/i18n';
|
|
13
13
|
import { chevronRight, chevronLeft } from '@wordpress/icons';
|
|
@@ -18,12 +18,7 @@ function ScreenHeader( { title, description, onBack } ) {
|
|
|
18
18
|
<View>
|
|
19
19
|
<Spacer marginBottom={ 0 } paddingX={ 4 } paddingY={ 3 }>
|
|
20
20
|
<HStack spacing={ 2 }>
|
|
21
|
-
<
|
|
22
|
-
style={
|
|
23
|
-
// TODO: This style override is also used in ToolsPanelHeader.
|
|
24
|
-
// It should be supported out-of-the-box by Button.
|
|
25
|
-
{ minWidth: 24, padding: 0 }
|
|
26
|
-
}
|
|
21
|
+
<NavigatorBackButton
|
|
27
22
|
icon={ isRTL() ? chevronRight : chevronLeft }
|
|
28
23
|
size="small"
|
|
29
24
|
label={ __( 'Back' ) }
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
5
|
__experimentalNavigatorButton as NavigatorButton,
|
|
6
|
-
|
|
6
|
+
__experimentalNavigatorBackButton as NavigatorBackButton,
|
|
7
7
|
__experimentalItem as Item,
|
|
8
8
|
FlexItem,
|
|
9
9
|
__experimentalHStack as HStack,
|
|
@@ -33,9 +33,7 @@ function NavigationButtonAsItem( props ) {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
function NavigationBackButtonAsItem( props ) {
|
|
36
|
-
return
|
|
37
|
-
<NavigatorToParentButton as={ GenericNavigationButton } { ...props } />
|
|
38
|
-
);
|
|
36
|
+
return <NavigatorBackButton as={ GenericNavigationButton } { ...props } />;
|
|
39
37
|
}
|
|
40
38
|
|
|
41
39
|
export { NavigationButtonAsItem, NavigationBackButtonAsItem };
|
|
@@ -87,6 +87,8 @@ function Palette( { name } ) {
|
|
|
87
87
|
{ window.__experimentalEnableColorRandomizer &&
|
|
88
88
|
themeColors?.length > 0 && (
|
|
89
89
|
<Button
|
|
90
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
91
|
+
__next40pxDefaultSize={ false }
|
|
90
92
|
variant="secondary"
|
|
91
93
|
icon={ shuffle }
|
|
92
94
|
onClick={ randomizeThemeColors }
|
|
@@ -5,7 +5,7 @@ import { useStylesPreviewColors } from './hooks';
|
|
|
5
5
|
|
|
6
6
|
export default function PresetColors() {
|
|
7
7
|
const { paletteColors } = useStylesPreviewColors();
|
|
8
|
-
return paletteColors.slice( 0,
|
|
8
|
+
return paletteColors.slice( 0, 4 ).map( ( { slug, color }, index ) => (
|
|
9
9
|
<div
|
|
10
10
|
key={ `${ slug }-${ index }` }
|
|
11
11
|
style={ {
|
|
@@ -162,6 +162,8 @@ function RevisionsButtons( {
|
|
|
162
162
|
aria-current={ isSelected }
|
|
163
163
|
>
|
|
164
164
|
<Button
|
|
165
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
166
|
+
__next40pxDefaultSize={ false }
|
|
165
167
|
className="edit-site-global-styles-screen-revisions__revision-button"
|
|
166
168
|
accessibleWhenDisabled
|
|
167
169
|
disabled={ isSelected }
|
|
@@ -55,11 +55,7 @@ import {
|
|
|
55
55
|
} from './shadow-utils';
|
|
56
56
|
|
|
57
57
|
const { useGlobalSetting } = unlock( blockEditorPrivateApis );
|
|
58
|
-
const {
|
|
59
|
-
DropdownMenuV2: DropdownMenu,
|
|
60
|
-
DropdownMenuItemV2: DropdownMenuItem,
|
|
61
|
-
DropdownMenuItemLabelV2: DropdownMenuItemLabel,
|
|
62
|
-
} = unlock( componentsPrivateApis );
|
|
58
|
+
const { DropdownMenuV2 } = unlock( componentsPrivateApis );
|
|
63
59
|
|
|
64
60
|
const customShadowMenuItems = [
|
|
65
61
|
{
|
|
@@ -151,7 +147,7 @@ export default function ShadowsEditPanel() {
|
|
|
151
147
|
<ScreenHeader title={ selectedShadow.name } />
|
|
152
148
|
<FlexItem>
|
|
153
149
|
<Spacer marginTop={ 2 } marginBottom={ 0 } paddingX={ 4 }>
|
|
154
|
-
<
|
|
150
|
+
<DropdownMenuV2
|
|
155
151
|
trigger={
|
|
156
152
|
<Button
|
|
157
153
|
size="small"
|
|
@@ -164,7 +160,7 @@ export default function ShadowsEditPanel() {
|
|
|
164
160
|
? customShadowMenuItems
|
|
165
161
|
: presetShadowMenuItems
|
|
166
162
|
).map( ( item ) => (
|
|
167
|
-
<
|
|
163
|
+
<DropdownMenuV2.Item
|
|
168
164
|
key={ item.action }
|
|
169
165
|
onClick={ () => onMenuClick( item.action ) }
|
|
170
166
|
disabled={
|
|
@@ -173,12 +169,12 @@ export default function ShadowsEditPanel() {
|
|
|
173
169
|
baseSelectedShadow.shadow
|
|
174
170
|
}
|
|
175
171
|
>
|
|
176
|
-
<
|
|
172
|
+
<DropdownMenuV2.ItemLabel>
|
|
177
173
|
{ item.label }
|
|
178
|
-
</
|
|
179
|
-
</
|
|
174
|
+
</DropdownMenuV2.ItemLabel>
|
|
175
|
+
</DropdownMenuV2.Item>
|
|
180
176
|
) ) }
|
|
181
|
-
</
|
|
177
|
+
</DropdownMenuV2>
|
|
182
178
|
</Spacer>
|
|
183
179
|
</FlexItem>
|
|
184
180
|
</HStack>
|
|
@@ -238,6 +234,8 @@ export default function ShadowsEditPanel() {
|
|
|
238
234
|
>
|
|
239
235
|
<FlexItem>
|
|
240
236
|
<Button
|
|
237
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
238
|
+
__next40pxDefaultSize={ false }
|
|
241
239
|
variant="tertiary"
|
|
242
240
|
onClick={ () =>
|
|
243
241
|
setIsRenameModalVisible( false )
|
|
@@ -247,7 +245,12 @@ export default function ShadowsEditPanel() {
|
|
|
247
245
|
</Button>
|
|
248
246
|
</FlexItem>
|
|
249
247
|
<FlexItem>
|
|
250
|
-
<Button
|
|
248
|
+
<Button
|
|
249
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
250
|
+
__next40pxDefaultSize={ false }
|
|
251
|
+
variant="primary"
|
|
252
|
+
type="submit"
|
|
253
|
+
>
|
|
251
254
|
{ __( 'Save' ) }
|
|
252
255
|
</Button>
|
|
253
256
|
</FlexItem>
|
|
@@ -377,7 +380,12 @@ function ShadowItem( { shadow, onChange, canRemove, onRemove } ) {
|
|
|
377
380
|
return (
|
|
378
381
|
<HStack align="center" justify="flex-start" spacing={ 0 }>
|
|
379
382
|
<FlexItem style={ { flexGrow: 1 } }>
|
|
380
|
-
<Button
|
|
383
|
+
<Button
|
|
384
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
385
|
+
__next40pxDefaultSize={ false }
|
|
386
|
+
icon={ shadowIcon }
|
|
387
|
+
{ ...toggleProps }
|
|
388
|
+
>
|
|
381
389
|
{ shadowObj.inset
|
|
382
390
|
? __( 'Inner shadow' )
|
|
383
391
|
: __( 'Drop shadow' ) }
|
|
@@ -386,6 +394,8 @@ function ShadowItem( { shadow, onChange, canRemove, onRemove } ) {
|
|
|
386
394
|
{ canRemove && (
|
|
387
395
|
<FlexItem>
|
|
388
396
|
<Button
|
|
397
|
+
// TODO: Switch to `true` (40px size) if possible
|
|
398
|
+
__next40pxDefaultSize={ false }
|
|
389
399
|
icon={ reset }
|
|
390
400
|
{ ...removeButtonProps }
|
|
391
401
|
/>
|