@wordpress/editor 12.2.1 → 12.4.0-next.e230fbab09.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 +6 -0
- package/build/components/deprecated.js +1 -1
- package/build/components/deprecated.js.map +1 -1
- package/build/components/deprecated.native.js.map +1 -1
- package/build/components/editor-help/index.native.js.map +1 -1
- package/build/components/entities-saved-states/entity-record-item.js +1 -1
- package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js +1 -1
- package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build/components/index.js.map +1 -1
- package/build/components/index.native.js.map +1 -1
- package/build/components/local-autosave-monitor/index.js +5 -5
- package/build/components/local-autosave-monitor/index.js.map +1 -1
- package/build/components/post-featured-image/index.js +4 -4
- package/build/components/post-featured-image/index.js.map +1 -1
- package/build/components/post-last-revision/index.js +3 -3
- package/build/components/post-last-revision/index.js.map +1 -1
- package/build/components/post-locked-modal/index.js +1 -3
- package/build/components/post-locked-modal/index.js.map +1 -1
- package/build/components/post-saved-state/index.js +1 -1
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-schedule/index.js +3 -3
- package/build/components/post-schedule/index.js.map +1 -1
- package/build/components/post-slug/index.js +2 -4
- package/build/components/post-slug/index.js.map +1 -1
- package/build/components/post-switch-to-draft-button/index.js +19 -14
- package/build/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +2 -2
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-title/index.native.js +2 -2
- package/build/components/post-title/index.native.js.map +1 -1
- package/build/components/post-trash/index.js +15 -29
- package/build/components/post-trash/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/provider/index.native.js +24 -15
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +3 -8
- package/build/components/provider/use-block-editor-settings.js.map +1 -1
- package/build/store/actions.js +231 -225
- package/build/store/actions.js.map +1 -1
- package/build/store/actions.native.js +6 -4
- package/build/store/actions.native.js.map +1 -1
- package/build/store/index.js +1 -8
- package/build/store/index.js.map +1 -1
- package/build/store/{controls.js → local-autosave.js} +1 -18
- package/build/store/local-autosave.js.map +1 -0
- package/build/store/reducer.js +0 -2
- package/build/store/reducer.js.map +1 -1
- package/build/store/selectors.js +8 -10
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils/notice-builder.js +9 -4
- package/build/store/utils/notice-builder.js.map +1 -1
- package/build/utils/url.js +9 -26
- package/build/utils/url.js.map +1 -1
- package/build-module/components/deprecated.js +1 -1
- package/build-module/components/deprecated.js.map +1 -1
- package/build-module/components/deprecated.native.js +1 -1
- package/build-module/components/deprecated.native.js.map +1 -1
- package/build-module/components/editor-help/index.native.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-record-item.js +1 -1
- package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +1 -1
- package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
- package/build-module/components/index.js +3 -3
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/index.native.js +3 -3
- package/build-module/components/index.native.js.map +1 -1
- package/build-module/components/local-autosave-monitor/index.js +1 -1
- package/build-module/components/local-autosave-monitor/index.js.map +1 -1
- package/build-module/components/post-featured-image/index.js +4 -4
- package/build-module/components/post-featured-image/index.js.map +1 -1
- package/build-module/components/post-last-revision/index.js +2 -2
- package/build-module/components/post-last-revision/index.js.map +1 -1
- package/build-module/components/post-locked-modal/index.js +1 -2
- package/build-module/components/post-locked-modal/index.js.map +1 -1
- package/build-module/components/post-saved-state/index.js +1 -1
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/index.js +3 -3
- package/build-module/components/post-schedule/index.js.map +1 -1
- package/build-module/components/post-slug/index.js +1 -2
- package/build-module/components/post-slug/index.js.map +1 -1
- package/build-module/components/post-switch-to-draft-button/index.js +22 -16
- package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js +2 -2
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-title/index.native.js +2 -2
- package/build-module/components/post-title/index.native.js.map +1 -1
- package/build-module/components/post-trash/index.js +15 -27
- package/build-module/components/post-trash/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/provider/index.native.js +26 -17
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +3 -8
- package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
- package/build-module/store/actions.js +208 -207
- package/build-module/store/actions.js.map +1 -1
- package/build-module/store/actions.native.js +3 -3
- package/build-module/store/actions.native.js.map +1 -1
- package/build-module/store/index.js +1 -6
- package/build-module/store/index.js.map +1 -1
- package/build-module/store/{controls.js → local-autosave.js} +1 -15
- package/build-module/store/local-autosave.js.map +1 -0
- package/build-module/store/reducer.js +0 -2
- package/build-module/store/reducer.js.map +1 -1
- package/build-module/store/selectors.js +8 -9
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils/notice-builder.js +9 -4
- package/build-module/store/utils/notice-builder.js.map +1 -1
- package/build-module/utils/url.js +8 -25
- package/build-module/utils/url.js.map +1 -1
- package/package.json +26 -27
- package/src/components/deprecated.js +1 -1
- package/src/components/deprecated.native.js +1 -1
- package/src/components/document-outline/test/index.js +1 -1
- package/src/components/editor-help/index.native.js +2 -2
- package/src/components/entities-saved-states/entity-record-item.js +1 -1
- package/src/components/global-keyboard-shortcuts/register-shortcuts.js +1 -1
- package/src/components/index.js +3 -3
- package/src/components/index.native.js +3 -3
- package/src/components/local-autosave-monitor/index.js +4 -1
- package/src/components/post-author/test/check.js +1 -1
- package/src/components/post-featured-image/index.js +4 -4
- package/src/components/post-last-revision/index.js +2 -2
- package/src/components/post-locked-modal/index.js +1 -2
- package/src/components/post-saved-state/index.js +1 -1
- package/src/components/post-saved-state/test/index.js +2 -2
- package/src/components/post-schedule/index.js +3 -3
- package/src/components/post-slug/index.js +1 -2
- package/src/components/post-switch-to-draft-button/index.js +35 -24
- package/src/components/post-taxonomies/hierarchical-term-selector.js +2 -2
- package/src/components/post-text-editor/test/index.js +1 -1
- package/src/components/post-title/index.native.js +2 -2
- package/src/components/post-trash/index.js +12 -24
- package/src/components/provider/index.js +1 -1
- package/src/components/provider/index.native.js +27 -23
- package/src/components/provider/use-block-editor-settings.js +3 -14
- package/src/store/actions.js +137 -249
- package/src/store/actions.native.js +3 -3
- package/src/store/index.js +0 -6
- package/src/store/{controls.js → local-autosave.js} +0 -8
- package/src/store/reducer.js +0 -2
- package/src/store/selectors.js +8 -9
- package/src/store/test/actions.js +244 -416
- package/src/store/test/selectors.js +1 -1
- package/src/store/utils/notice-builder.js +9 -4
- package/src/store/utils/test/notice-builder.js +1 -0
- package/src/utils/url.js +8 -30
- package/build/store/controls.js.map +0 -1
- package/build-module/store/controls.js.map +0 -1
- package/src/utils/test/url.js +0 -22
package/src/store/selectors.js
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
__unstableSerializeAndClean,
|
|
14
14
|
} from '@wordpress/blocks';
|
|
15
15
|
import { isInTheFuture, getDate } from '@wordpress/date';
|
|
16
|
-
import { addQueryArgs } from '@wordpress/url';
|
|
16
|
+
import { addQueryArgs, cleanForSlug } from '@wordpress/url';
|
|
17
17
|
import { createRegistrySelector } from '@wordpress/data';
|
|
18
18
|
import deprecated from '@wordpress/deprecated';
|
|
19
19
|
import { Platform } from '@wordpress/element';
|
|
@@ -32,7 +32,6 @@ import {
|
|
|
32
32
|
AUTOSAVE_PROPERTIES,
|
|
33
33
|
} from './constants';
|
|
34
34
|
import { getPostRawValue } from './reducer';
|
|
35
|
-
import { cleanForSlug } from '../utils/url';
|
|
36
35
|
import { getTemplatePartIcon } from '../utils/get-template-part-icon';
|
|
37
36
|
|
|
38
37
|
/**
|
|
@@ -336,7 +335,7 @@ const getNestedEditedPostProperty = ( state, attributeName ) => {
|
|
|
336
335
|
* @return {*} Post attribute value.
|
|
337
336
|
*/
|
|
338
337
|
export function getEditedPostAttribute( state, attributeName ) {
|
|
339
|
-
// Special cases
|
|
338
|
+
// Special cases.
|
|
340
339
|
switch ( attributeName ) {
|
|
341
340
|
case 'content':
|
|
342
341
|
return getEditedPostContent( state );
|
|
@@ -477,7 +476,7 @@ export function isEditedPostPublishable( state ) {
|
|
|
477
476
|
// TODO: Post being publishable should be superset of condition of post
|
|
478
477
|
// being saveable. Currently this restriction is imposed at UI.
|
|
479
478
|
//
|
|
480
|
-
// See: <PostPublishButton /> (`isButtonEnabled` assigned by `isSaveable`)
|
|
479
|
+
// See: <PostPublishButton /> (`isButtonEnabled` assigned by `isSaveable`).
|
|
481
480
|
|
|
482
481
|
return (
|
|
483
482
|
isEditedPostDirty( state ) ||
|
|
@@ -506,7 +505,7 @@ export function isEditedPostSaveable( state ) {
|
|
|
506
505
|
// See: `isEditedPostPublishable` (includes `isEditedPostDirty` condition)
|
|
507
506
|
// See: <PostSavedState /> (`forceIsDirty` prop)
|
|
508
507
|
// See: <PostPublishButton /> (`forceIsDirty` prop)
|
|
509
|
-
// See: https://github.com/WordPress/gutenberg/pull/4184
|
|
508
|
+
// See: https://github.com/WordPress/gutenberg/pull/4184.
|
|
510
509
|
|
|
511
510
|
return (
|
|
512
511
|
!! getEditedPostAttribute( state, 'title' ) ||
|
|
@@ -643,7 +642,7 @@ export const isEditedPostAutosaveable = createRegistrySelector(
|
|
|
643
642
|
*/
|
|
644
643
|
export function isEditedPostBeingScheduled( state ) {
|
|
645
644
|
const date = getEditedPostAttribute( state, 'date' );
|
|
646
|
-
// Offset the date by one minute (network latency)
|
|
645
|
+
// Offset the date by one minute (network latency).
|
|
647
646
|
const checkedDate = new Date(
|
|
648
647
|
Number( getDate( date ) ) - ONE_MINUTE_IN_MS
|
|
649
648
|
);
|
|
@@ -671,7 +670,7 @@ export function isEditedPostDateFloating( state ) {
|
|
|
671
670
|
// This should be the status of the persisted post
|
|
672
671
|
// It shouldn't use the "edited" status otherwise it breaks the
|
|
673
672
|
// inferred post data floating status
|
|
674
|
-
// See https://github.com/WordPress/gutenberg/issues/28083
|
|
673
|
+
// See https://github.com/WordPress/gutenberg/issues/28083.
|
|
675
674
|
const status = getCurrentPost( state ).status;
|
|
676
675
|
if (
|
|
677
676
|
status === 'draft' ||
|
|
@@ -808,7 +807,7 @@ export function getEditedPostPreviewLink( state ) {
|
|
|
808
807
|
// If the post is draft, ignore the preview link from the autosave record,
|
|
809
808
|
// because the preview could be a stale autosave if the post was switched from
|
|
810
809
|
// published to draft.
|
|
811
|
-
// See: https://github.com/WordPress/gutenberg/pull/37952
|
|
810
|
+
// See: https://github.com/WordPress/gutenberg/pull/37952.
|
|
812
811
|
if ( ! previewLink || 'draft' === getCurrentPost( state ).status ) {
|
|
813
812
|
previewLink = getEditedPostAttribute( state, 'link' );
|
|
814
813
|
if ( previewLink ) {
|
|
@@ -843,7 +842,7 @@ export function getSuggestedPostFormat( state ) {
|
|
|
843
842
|
// so we can derive a suitable post format from it.
|
|
844
843
|
if ( blocks.length === 1 ) {
|
|
845
844
|
name = blocks[ 0 ].name;
|
|
846
|
-
//
|
|
845
|
+
// Check for core/embed `video` and `audio` eligible suggestions.
|
|
847
846
|
if ( name === 'core/embed' ) {
|
|
848
847
|
const provider = blocks[ 0 ].attributes?.providerNameSlug;
|
|
849
848
|
if ( [ 'youtube', 'vimeo' ].includes( provider ) ) {
|