@wordpress/editor 14.16.0 → 14.17.1
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/README.md +19 -19
- package/build/components/document-outline/check.js +3 -3
- package/build/components/document-outline/check.js.map +1 -1
- package/build/components/header/index.js +11 -6
- package/build/components/header/index.js.map +1 -1
- package/build/components/page-attributes/check.js +3 -3
- package/build/components/page-attributes/check.js.map +1 -1
- package/build/components/post-pending-status/check.js +3 -3
- package/build/components/post-pending-status/check.js.map +1 -1
- package/build/components/post-schedule/check.js +3 -3
- package/build/components/post-schedule/check.js.map +1 -1
- package/build/components/post-sticky/check.js +3 -3
- package/build/components/post-sticky/check.js.map +1 -1
- package/build/components/post-taxonomies/check.js +1 -1
- package/build/components/post-taxonomies/check.js.map +1 -1
- package/build/components/post-trash/check.js +3 -3
- package/build/components/post-trash/check.js.map +1 -1
- package/build/components/post-type-support-check/index.js +6 -6
- package/build/components/post-type-support-check/index.js.map +1 -1
- package/build/components/post-url/check.js +3 -3
- package/build/components/post-url/check.js.map +1 -1
- package/build/components/preferences-modal/index.js +1 -1
- package/build/components/preferences-modal/index.js.map +1 -1
- package/build/components/provider/index.js +1 -1
- package/build/components/provider/index.js.map +1 -1
- package/build/components/start-page-options/index.js +15 -6
- package/build/components/start-page-options/index.js.map +1 -1
- package/build/components/theme-support-check/index.js +4 -4
- package/build/components/theme-support-check/index.js.map +1 -1
- package/build/private-apis.js +2 -0
- package/build/private-apis.js.map +1 -1
- package/build/store/selectors.js +4 -4
- package/build/store/selectors.js.map +1 -1
- package/build-module/components/document-outline/check.js +3 -3
- package/build-module/components/document-outline/check.js.map +1 -1
- package/build-module/components/header/index.js +11 -6
- package/build-module/components/header/index.js.map +1 -1
- package/build-module/components/page-attributes/check.js +3 -3
- package/build-module/components/page-attributes/check.js.map +1 -1
- package/build-module/components/post-pending-status/check.js +3 -3
- package/build-module/components/post-pending-status/check.js.map +1 -1
- package/build-module/components/post-schedule/check.js +3 -3
- package/build-module/components/post-schedule/check.js.map +1 -1
- package/build-module/components/post-sticky/check.js +3 -3
- package/build-module/components/post-sticky/check.js.map +1 -1
- package/build-module/components/post-taxonomies/check.js +1 -1
- package/build-module/components/post-taxonomies/check.js.map +1 -1
- package/build-module/components/post-trash/check.js +3 -3
- package/build-module/components/post-trash/check.js.map +1 -1
- package/build-module/components/post-type-support-check/index.js +6 -6
- package/build-module/components/post-type-support-check/index.js.map +1 -1
- package/build-module/components/post-url/check.js +3 -3
- package/build-module/components/post-url/check.js.map +1 -1
- package/build-module/components/preferences-modal/index.js +1 -1
- package/build-module/components/preferences-modal/index.js.map +1 -1
- package/build-module/components/provider/index.js +1 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/start-page-options/index.js +15 -6
- package/build-module/components/start-page-options/index.js.map +1 -1
- package/build-module/components/theme-support-check/index.js +4 -4
- package/build-module/components/theme-support-check/index.js.map +1 -1
- package/build-module/private-apis.js +3 -1
- package/build-module/private-apis.js.map +1 -1
- package/build-module/store/selectors.js +4 -4
- package/build-module/store/selectors.js.map +1 -1
- package/build-style/style-rtl.css +11 -23
- package/build-style/style.css +11 -23
- package/build-types/components/document-outline/check.d.ts +5 -5
- package/build-types/components/document-outline/check.d.ts.map +1 -1
- package/build-types/components/header/index.d.ts.map +1 -1
- package/build-types/components/page-attributes/check.d.ts +5 -5
- package/build-types/components/page-attributes/check.d.ts.map +1 -1
- package/build-types/components/post-pending-status/check.d.ts +5 -5
- package/build-types/components/post-pending-status/check.d.ts.map +1 -1
- package/build-types/components/post-schedule/check.d.ts +5 -5
- package/build-types/components/post-schedule/check.d.ts.map +1 -1
- package/build-types/components/post-sticky/check.d.ts +5 -5
- package/build-types/components/post-sticky/check.d.ts.map +1 -1
- package/build-types/components/post-taxonomies/check.d.ts +2 -2
- package/build-types/components/post-taxonomies/check.d.ts.map +1 -1
- package/build-types/components/post-trash/check.d.ts +5 -5
- package/build-types/components/post-trash/check.d.ts.map +1 -1
- package/build-types/components/post-type-support-check/index.d.ts +8 -8
- package/build-types/components/post-type-support-check/index.d.ts.map +1 -1
- package/build-types/components/post-url/check.d.ts +5 -5
- package/build-types/components/post-url/check.d.ts.map +1 -1
- package/build-types/components/start-page-options/index.d.ts.map +1 -1
- package/build-types/components/theme-support-check/index.d.ts +6 -6
- package/build-types/components/theme-support-check/index.d.ts.map +1 -1
- package/build-types/private-apis.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts +4 -4
- package/build-types/store/selectors.d.ts.map +1 -1
- package/package.json +37 -37
- package/src/components/document-bar/style.scss +4 -2
- package/src/components/document-outline/check.js +3 -3
- package/src/components/document-tools/style.scss +3 -2
- package/src/components/header/index.js +18 -21
- package/src/components/page-attributes/check.js +3 -3
- package/src/components/post-featured-image/style.scss +4 -2
- package/src/components/post-pending-status/check.js +3 -3
- package/src/components/post-publish-panel/style.scss +5 -3
- package/src/components/post-schedule/check.js +3 -3
- package/src/components/post-sticky/check.js +3 -3
- package/src/components/post-taxonomies/check.js +1 -1
- package/src/components/post-text-editor/style.scss +4 -2
- package/src/components/post-trash/check.js +3 -3
- package/src/components/post-type-support-check/index.js +6 -6
- package/src/components/post-url/check.js +3 -3
- package/src/components/preferences-modal/index.js +1 -1
- package/src/components/provider/index.js +2 -2
- package/src/components/start-page-options/index.js +20 -12
- package/src/components/theme-support-check/index.js +4 -4
- package/src/private-apis.js +7 -1
- package/src/store/selectors.js +4 -4
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -78,12 +78,14 @@
|
|
|
78
78
|
|
|
79
79
|
.editor-post-featured-image__actions {
|
|
80
80
|
&:not(.editor-post-featured-image__actions-missing-image) {
|
|
81
|
-
@include reduce-motion("transition");
|
|
82
81
|
bottom: 0;
|
|
83
82
|
opacity: 0; // Use opacity instead of visibility so that the buttons remain in the tab order.
|
|
84
83
|
padding: $grid-unit-10;
|
|
85
84
|
position: absolute;
|
|
86
|
-
|
|
85
|
+
|
|
86
|
+
@media not (prefers-reduced-motion) {
|
|
87
|
+
transition: opacity 50ms ease-out;
|
|
88
|
+
}
|
|
87
89
|
|
|
88
90
|
.editor-post-featured-image__action {
|
|
89
91
|
backdrop-filter: blur(16px) saturate(180%);
|
|
@@ -13,10 +13,10 @@ import { store as editorStore } from '../../store';
|
|
|
13
13
|
* If the post is already published or the user doesn't have the
|
|
14
14
|
* capability to publish, it returns null.
|
|
15
15
|
*
|
|
16
|
-
* @param {Object}
|
|
17
|
-
* @param {React.
|
|
16
|
+
* @param {Object} props Component properties.
|
|
17
|
+
* @param {React.ReactNode} props.children Children to be rendered.
|
|
18
18
|
*
|
|
19
|
-
* @return {React.
|
|
19
|
+
* @return {React.ReactNode} The rendered child elements or null if the post is already published or the user doesn't have the capability to publish.
|
|
20
20
|
*/
|
|
21
21
|
export function PostPendingStatusCheck( { children } ) {
|
|
22
22
|
const { hasPublishAction, isPublished } = useSelect( ( select ) => {
|
|
@@ -210,9 +210,11 @@
|
|
|
210
210
|
left: auto;
|
|
211
211
|
width: $sidebar-width + $border-width;
|
|
212
212
|
border-left: $border-width solid $gray-300;
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
213
|
+
|
|
214
|
+
@media not (prefers-reduced-motion) {
|
|
215
|
+
transform: translateX(+100%);
|
|
216
|
+
animation: editor-post-publish-panel__slide-in-animation 0.1s forwards;
|
|
217
|
+
}
|
|
216
218
|
|
|
217
219
|
body.is-fullscreen-mode & {
|
|
218
220
|
top: 0;
|
|
@@ -11,10 +11,10 @@ import { store as editorStore } from '../../store';
|
|
|
11
11
|
/**
|
|
12
12
|
* Wrapper component that renders its children only if post has a publish action.
|
|
13
13
|
*
|
|
14
|
-
* @param {Object}
|
|
15
|
-
* @param {React.
|
|
14
|
+
* @param {Object} props Props.
|
|
15
|
+
* @param {React.ReactNode} props.children Children to be rendered.
|
|
16
16
|
*
|
|
17
|
-
* @return {React.
|
|
17
|
+
* @return {React.ReactNode} - The component to be rendered or null if there is no publish action.
|
|
18
18
|
*/
|
|
19
19
|
export default function PostScheduleCheck( { children } ) {
|
|
20
20
|
const hasPublishAction = useSelect( ( select ) => {
|
|
@@ -11,10 +11,10 @@ import { store as editorStore } from '../../store';
|
|
|
11
11
|
/**
|
|
12
12
|
* Wrapper component that renders its children only if post has a sticky action.
|
|
13
13
|
*
|
|
14
|
-
* @param {Object}
|
|
15
|
-
* @param {React.
|
|
14
|
+
* @param {Object} props Props.
|
|
15
|
+
* @param {React.ReactNode} props.children Children to be rendered.
|
|
16
16
|
*
|
|
17
|
-
* @return {React.
|
|
17
|
+
* @return {React.ReactNode} The component to be rendered or null if post type is not 'post' or hasStickyAction is false.
|
|
18
18
|
*/
|
|
19
19
|
export default function PostStickyCheck( { children } ) {
|
|
20
20
|
const { hasStickyAction, postType } = useSelect( ( select ) => {
|
|
@@ -15,7 +15,7 @@ import { store as editorStore } from '../../store';
|
|
|
15
15
|
* @param {Object} props The component props.
|
|
16
16
|
* @param {React.ReactNode} props.children The children components to render.
|
|
17
17
|
*
|
|
18
|
-
* @return {React.
|
|
18
|
+
* @return {React.ReactNode} The rendered children components or null if the current post type has no taxonomies.
|
|
19
19
|
*/
|
|
20
20
|
export default function PostTaxonomiesCheck( { children } ) {
|
|
21
21
|
const hasTaxonomies = useSelect( ( select ) => {
|
|
@@ -10,8 +10,10 @@ textarea.editor-post-text-editor {
|
|
|
10
10
|
font-family: $editor-html-font;
|
|
11
11
|
line-height: 2.4;
|
|
12
12
|
min-height: 200px;
|
|
13
|
-
|
|
14
|
-
@
|
|
13
|
+
|
|
14
|
+
@media not (prefers-reduced-motion) {
|
|
15
|
+
transition: border 0.1s ease-out, box-shadow 0.1s linear;
|
|
16
|
+
}
|
|
15
17
|
|
|
16
18
|
// Same padding as title.
|
|
17
19
|
padding: $grid-unit-20;
|
|
@@ -13,10 +13,10 @@ import { GLOBAL_POST_TYPES } from '../../store/constants';
|
|
|
13
13
|
/**
|
|
14
14
|
* Wrapper component that renders its children only if the post can be trashed.
|
|
15
15
|
*
|
|
16
|
-
* @param {Object}
|
|
17
|
-
* @param {React.
|
|
16
|
+
* @param {Object} props The component props.
|
|
17
|
+
* @param {React.ReactNode} props.children The child components.
|
|
18
18
|
*
|
|
19
|
-
* @return {React.
|
|
19
|
+
* @return {React.ReactNode} The rendered child components or null if the post can't be trashed.
|
|
20
20
|
*/
|
|
21
21
|
export default function PostTrashCheck( { children } ) {
|
|
22
22
|
const { canTrashPost } = useSelect( ( select ) => {
|
|
@@ -13,13 +13,13 @@ import { store as editorStore } from '../../store';
|
|
|
13
13
|
* A component which renders its own children only if the current editor post
|
|
14
14
|
* type supports one of the given `supportKeys` prop.
|
|
15
15
|
*
|
|
16
|
-
* @param {Object}
|
|
17
|
-
* @param {React.
|
|
18
|
-
*
|
|
19
|
-
* @param {(string|string[])}
|
|
20
|
-
*
|
|
16
|
+
* @param {Object} props Props.
|
|
17
|
+
* @param {React.ReactNode} props.children Children to be rendered if post
|
|
18
|
+
* type supports.
|
|
19
|
+
* @param {(string|string[])} props.supportKeys String or string array of keys
|
|
20
|
+
* to test.
|
|
21
21
|
*
|
|
22
|
-
* @return {React.
|
|
22
|
+
* @return {React.ReactNode} The component to be rendered.
|
|
23
23
|
*/
|
|
24
24
|
function PostTypeSupportCheck( { children, supportKeys } ) {
|
|
25
25
|
const postType = useSelect( ( select ) => {
|
|
@@ -12,10 +12,10 @@ import { store as editorStore } from '../../store';
|
|
|
12
12
|
/**
|
|
13
13
|
* Check if the post URL is valid and visible.
|
|
14
14
|
*
|
|
15
|
-
* @param {Object}
|
|
16
|
-
* @param {React.
|
|
15
|
+
* @param {Object} props The component props.
|
|
16
|
+
* @param {React.ReactNode} props.children The child components.
|
|
17
17
|
*
|
|
18
|
-
* @return {React.
|
|
18
|
+
* @return {React.ReactNode} The child components if the post URL is valid and visible, otherwise null.
|
|
19
19
|
*/
|
|
20
20
|
export default function PostURLCheck( { children } ) {
|
|
21
21
|
const isVisible = useSelect( ( select ) => {
|
|
@@ -250,7 +250,7 @@ function PreferencesModalContents( { extraSections = {} } ) {
|
|
|
250
250
|
scope="core"
|
|
251
251
|
featureName="keepCaretInsideBlock"
|
|
252
252
|
help={ __(
|
|
253
|
-
'Keeps the text cursor within
|
|
253
|
+
'Keeps the text cursor within blocks while navigating with arrow keys, preventing it from moving to other blocks and enhancing accessibility for keyboard users.'
|
|
254
254
|
) }
|
|
255
255
|
label={ __(
|
|
256
256
|
'Contain text cursor inside block'
|
|
@@ -198,8 +198,8 @@ export const ExperimentalEditorProvider = withRegistryProvider(
|
|
|
198
198
|
|
|
199
199
|
const _defaultMode = Array.isArray( postTypeSupports?.editor )
|
|
200
200
|
? postTypeSupports.editor.find(
|
|
201
|
-
( features ) => '
|
|
202
|
-
)?.
|
|
201
|
+
( features ) => 'default-mode' in features
|
|
202
|
+
)?.[ 'default-mode' ]
|
|
203
203
|
: undefined;
|
|
204
204
|
const hasDefaultMode = RENDERING_MODES.includes( _defaultMode );
|
|
205
205
|
|
|
@@ -12,13 +12,8 @@ import { store as interfaceStore } from '@wordpress/interface';
|
|
|
12
12
|
import { store as editorStore } from '../../store';
|
|
13
13
|
|
|
14
14
|
export default function StartPageOptions() {
|
|
15
|
-
const { postId,
|
|
16
|
-
const {
|
|
17
|
-
isEditedPostDirty,
|
|
18
|
-
isEditedPostEmpty,
|
|
19
|
-
getCurrentPostId,
|
|
20
|
-
getCurrentPostType,
|
|
21
|
-
} = select( editorStore );
|
|
15
|
+
const { postId, enabled } = useSelect( ( select ) => {
|
|
16
|
+
const { getCurrentPostId, getCurrentPostType } = select( editorStore );
|
|
22
17
|
const preferencesModalActive =
|
|
23
18
|
select( interfaceStore ).isModalActive( 'editor/preferences' );
|
|
24
19
|
const choosePatternModalEnabled = select( preferencesStore ).get(
|
|
@@ -27,24 +22,37 @@ export default function StartPageOptions() {
|
|
|
27
22
|
);
|
|
28
23
|
return {
|
|
29
24
|
postId: getCurrentPostId(),
|
|
30
|
-
|
|
25
|
+
enabled:
|
|
31
26
|
choosePatternModalEnabled &&
|
|
32
27
|
! preferencesModalActive &&
|
|
33
|
-
! isEditedPostDirty() &&
|
|
34
|
-
isEditedPostEmpty() &&
|
|
35
28
|
'page' === getCurrentPostType(),
|
|
36
29
|
};
|
|
37
30
|
}, [] );
|
|
31
|
+
const { isEditedPostDirty, isEditedPostEmpty } = useSelect( editorStore );
|
|
38
32
|
const { setIsInserterOpened } = useDispatch( editorStore );
|
|
39
33
|
|
|
40
34
|
useEffect( () => {
|
|
41
|
-
if (
|
|
35
|
+
if ( ! enabled ) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const isFreshPage = ! isEditedPostDirty() && isEditedPostEmpty();
|
|
40
|
+
if ( isFreshPage ) {
|
|
42
41
|
setIsInserterOpened( {
|
|
43
42
|
tab: 'patterns',
|
|
44
43
|
category: 'core/starter-content',
|
|
45
44
|
} );
|
|
46
45
|
}
|
|
47
|
-
|
|
46
|
+
|
|
47
|
+
// Note: The `postId` ensures the effect re-runs when pages are switched without remounting the component.
|
|
48
|
+
// Examples: changing pages in the List View, creating a new page via Command Palette.
|
|
49
|
+
}, [
|
|
50
|
+
postId,
|
|
51
|
+
enabled,
|
|
52
|
+
setIsInserterOpened,
|
|
53
|
+
isEditedPostDirty,
|
|
54
|
+
isEditedPostEmpty,
|
|
55
|
+
] );
|
|
48
56
|
|
|
49
57
|
return null;
|
|
50
58
|
}
|
|
@@ -12,11 +12,11 @@ import { store as editorStore } from '../../store';
|
|
|
12
12
|
/**
|
|
13
13
|
* Checks if the current theme supports specific features and renders the children if supported.
|
|
14
14
|
*
|
|
15
|
-
* @param {Object}
|
|
16
|
-
* @param {React.
|
|
17
|
-
* @param {string|string[]}
|
|
15
|
+
* @param {Object} props The component props.
|
|
16
|
+
* @param {React.ReactNode} props.children The children to render if the theme supports the specified features.
|
|
17
|
+
* @param {string|string[]} props.supportKeys The key(s) of the theme support(s) to check.
|
|
18
18
|
*
|
|
19
|
-
* @return {React.
|
|
19
|
+
* @return {React.ReactNode} The rendered children if the theme supports the specified features, otherwise null.
|
|
20
20
|
*/
|
|
21
21
|
export default function ThemeSupportCheck( { children, supportKeys } ) {
|
|
22
22
|
const { postType, themeSupports } = useSelect( ( select ) => {
|
package/src/private-apis.js
CHANGED
|
@@ -23,7 +23,11 @@ import {
|
|
|
23
23
|
mergeBaseAndUserConfigs,
|
|
24
24
|
GlobalStylesProvider,
|
|
25
25
|
} from './components/global-styles-provider';
|
|
26
|
-
import {
|
|
26
|
+
import {
|
|
27
|
+
CreateTemplatePartModal,
|
|
28
|
+
patternTitleField,
|
|
29
|
+
templateTitleField,
|
|
30
|
+
} from '@wordpress/fields';
|
|
27
31
|
import { registerCoreBlockBindingsSources } from './bindings/api';
|
|
28
32
|
import { getTemplateInfo } from './utils/get-template-info';
|
|
29
33
|
|
|
@@ -32,6 +36,8 @@ const { store: interfaceStore, ...remainingInterfaceApis } = interfaceApis;
|
|
|
32
36
|
export const privateApis = {};
|
|
33
37
|
lock( privateApis, {
|
|
34
38
|
CreateTemplatePartModal,
|
|
39
|
+
patternTitleField,
|
|
40
|
+
templateTitleField,
|
|
35
41
|
BackButton,
|
|
36
42
|
EntitiesSavedStatesExtensible,
|
|
37
43
|
Editor,
|
package/src/store/selectors.js
CHANGED
|
@@ -1220,10 +1220,10 @@ export const isEditorPanelOpened = createRegistrySelector(
|
|
|
1220
1220
|
/**
|
|
1221
1221
|
* Returns the current selection start.
|
|
1222
1222
|
*
|
|
1223
|
+
* @deprecated since Gutenberg 10.0.0.
|
|
1224
|
+
*
|
|
1223
1225
|
* @param {Object} state
|
|
1224
1226
|
* @return {WPBlockSelection} The selection start.
|
|
1225
|
-
*
|
|
1226
|
-
* @deprecated since Gutenberg 10.0.0.
|
|
1227
1227
|
*/
|
|
1228
1228
|
export function getEditorSelectionStart( state ) {
|
|
1229
1229
|
deprecated( "select('core/editor').getEditorSelectionStart", {
|
|
@@ -1236,10 +1236,10 @@ export function getEditorSelectionStart( state ) {
|
|
|
1236
1236
|
/**
|
|
1237
1237
|
* Returns the current selection end.
|
|
1238
1238
|
*
|
|
1239
|
+
* @deprecated since Gutenberg 10.0.0.
|
|
1240
|
+
*
|
|
1239
1241
|
* @param {Object} state
|
|
1240
1242
|
* @return {WPBlockSelection} The selection end.
|
|
1241
|
-
*
|
|
1242
|
-
* @deprecated since Gutenberg 10.0.0.
|
|
1243
1243
|
*/
|
|
1244
1244
|
export function getEditorSelectionEnd( state ) {
|
|
1245
1245
|
deprecated( "select('core/editor').getEditorSelectionStart", {
|