@wordpress/editor 12.19.0 → 12.21.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 +4 -0
- package/build/components/entities-saved-states/entity-record-item.js +1 -0
- package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build/components/entities-saved-states/entity-type-list.js +1 -7
- package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build/components/entities-saved-states/index.js +1 -1
- package/build/components/entities-saved-states/index.js.map +1 -1
- package/build/components/index.js +18 -0
- package/build/components/index.js.map +1 -1
- package/build/components/post-comments/index.js +1 -0
- package/build/components/post-comments/index.js.map +1 -1
- package/build/components/post-format/index.js +1 -1
- package/build/components/post-format/index.js.map +1 -1
- package/build/components/post-pending-status/index.js +1 -0
- package/build/components/post-pending-status/index.js.map +1 -1
- package/build/components/post-pingbacks/index.js +1 -0
- package/build/components/post-pingbacks/index.js.map +1 -1
- package/build/components/post-publish-button/index.js +11 -2
- package/build/components/post-publish-button/index.js.map +1 -1
- package/build/components/post-publish-panel/index.js +1 -0
- package/build/components/post-publish-panel/index.js.map +1 -1
- package/build/components/post-publish-panel/maybe-category-panel.js +1 -7
- package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js +1 -1
- package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build/components/post-publish-panel/maybe-tags-panel.js +1 -7
- package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build/components/post-saved-state/index.js +19 -5
- package/build/components/post-saved-state/index.js.map +1 -1
- package/build/components/post-schedule/index.js +13 -16
- package/build/components/post-schedule/index.js.map +1 -1
- package/build/components/post-sticky/index.js +1 -0
- package/build/components/post-sticky/index.js.map +1 -1
- package/build/components/post-taxonomies/check.js +1 -7
- package/build/components/post-taxonomies/check.js.map +1 -1
- package/build/components/post-taxonomies/flat-term-selector.js +3 -1
- package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/hierarchical-term-selector.js +3 -2
- package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build/components/post-taxonomies/index.js +1 -1
- package/build/components/post-taxonomies/index.js.map +1 -1
- package/build/components/post-title/index.js +4 -2
- package/build/components/post-title/index.js.map +1 -1
- package/build/components/post-type-support-check/index.js +1 -7
- package/build/components/post-type-support-check/index.js.map +1 -1
- package/build/components/theme-support-check/index.js +2 -2
- package/build/components/theme-support-check/index.js.map +1 -1
- package/build/components/time-to-read/index.js +2 -6
- package/build/components/time-to-read/index.js.map +1 -1
- package/build/store/selectors.js +1 -6
- package/build/store/selectors.js.map +1 -1
- package/build/store/utils/notice-builder.js +2 -2
- package/build/store/utils/notice-builder.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-record-item.js +1 -0
- package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
- package/build-module/components/entities-saved-states/entity-type-list.js +1 -6
- package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
- package/build-module/components/entities-saved-states/index.js +2 -2
- package/build-module/components/entities-saved-states/index.js.map +1 -1
- package/build-module/components/index.js +3 -1
- package/build-module/components/index.js.map +1 -1
- package/build-module/components/post-comments/index.js +1 -0
- package/build-module/components/post-comments/index.js.map +1 -1
- package/build-module/components/post-format/index.js +2 -2
- package/build-module/components/post-format/index.js.map +1 -1
- package/build-module/components/post-pending-status/index.js +1 -0
- package/build-module/components/post-pending-status/index.js.map +1 -1
- package/build-module/components/post-pingbacks/index.js +1 -0
- package/build-module/components/post-pingbacks/index.js.map +1 -1
- package/build-module/components/post-publish-button/index.js +12 -3
- package/build-module/components/post-publish-button/index.js.map +1 -1
- package/build-module/components/post-publish-panel/index.js +1 -0
- package/build-module/components/post-publish-panel/index.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-category-panel.js +1 -6
- package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js +2 -2
- package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
- package/build-module/components/post-publish-panel/maybe-tags-panel.js +1 -6
- package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
- package/build-module/components/post-saved-state/index.js +19 -5
- package/build-module/components/post-saved-state/index.js.map +1 -1
- package/build-module/components/post-schedule/index.js +12 -17
- package/build-module/components/post-schedule/index.js.map +1 -1
- package/build-module/components/post-sticky/index.js +1 -0
- package/build-module/components/post-sticky/index.js.map +1 -1
- package/build-module/components/post-taxonomies/check.js +1 -6
- package/build-module/components/post-taxonomies/check.js.map +1 -1
- package/build-module/components/post-taxonomies/flat-term-selector.js +3 -2
- package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js +4 -3
- package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
- package/build-module/components/post-taxonomies/index.js +2 -2
- package/build-module/components/post-taxonomies/index.js.map +1 -1
- package/build-module/components/post-title/index.js +3 -2
- package/build-module/components/post-title/index.js.map +1 -1
- package/build-module/components/post-type-support-check/index.js +1 -6
- package/build-module/components/post-type-support-check/index.js.map +1 -1
- package/build-module/components/theme-support-check/index.js +3 -3
- package/build-module/components/theme-support-check/index.js.map +1 -1
- package/build-module/components/time-to-read/index.js +2 -6
- package/build-module/components/time-to-read/index.js.map +1 -1
- package/build-module/store/selectors.js +1 -6
- package/build-module/store/selectors.js.map +1 -1
- package/build-module/store/utils/notice-builder.js +3 -3
- package/build-module/store/utils/notice-builder.js.map +1 -1
- package/build-style/style-rtl.css +0 -4
- package/build-style/style.css +0 -4
- package/package.json +31 -28
- package/src/components/editor-help/test/index.native.js +2 -2
- package/src/components/entities-saved-states/entity-record-item.js +1 -0
- package/src/components/entities-saved-states/entity-type-list.js +1 -7
- package/src/components/entities-saved-states/index.js +2 -3
- package/src/components/index.js +2 -0
- package/src/components/post-comments/index.js +1 -0
- package/src/components/post-format/index.js +2 -2
- package/src/components/post-pending-status/index.js +1 -0
- package/src/components/post-pingbacks/index.js +1 -0
- package/src/components/post-publish-button/index.js +13 -4
- package/src/components/post-publish-panel/index.js +1 -0
- package/src/components/post-publish-panel/maybe-category-panel.js +1 -6
- package/src/components/post-publish-panel/maybe-post-format-panel.js +2 -2
- package/src/components/post-publish-panel/maybe-tags-panel.js +1 -6
- package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +11 -15
- package/src/components/post-saved-state/index.js +15 -3
- package/src/components/post-saved-state/style.scss +0 -4
- package/src/components/post-saved-state/test/__snapshots__/index.js.snap +1 -1
- package/src/components/post-schedule/index.js +16 -20
- package/src/components/post-sticky/index.js +1 -0
- package/src/components/post-taxonomies/check.js +2 -7
- package/src/components/post-taxonomies/flat-term-selector.js +3 -2
- package/src/components/post-taxonomies/hierarchical-term-selector.js +4 -3
- package/src/components/post-taxonomies/index.js +2 -2
- package/src/components/post-text-editor/test/index.js +7 -3
- package/src/components/post-title/index.js +6 -2
- package/src/components/post-type-support-check/index.js +3 -9
- package/src/components/theme-support-check/index.js +5 -3
- package/src/components/time-to-read/index.js +2 -2
- package/src/store/selectors.js +1 -10
- package/src/store/test/selectors.js +2 -56
- package/src/store/utils/notice-builder.js +3 -3
|
@@ -148,7 +148,6 @@ const {
|
|
|
148
148
|
hasEditorUndo,
|
|
149
149
|
hasEditorRedo,
|
|
150
150
|
isEditedPostNew,
|
|
151
|
-
hasChangedContent,
|
|
152
151
|
isEditedPostDirty,
|
|
153
152
|
hasNonPostEntityChanges,
|
|
154
153
|
isCleanNewPost,
|
|
@@ -392,57 +391,6 @@ describe( 'selectors', () => {
|
|
|
392
391
|
} );
|
|
393
392
|
} );
|
|
394
393
|
|
|
395
|
-
describe( 'hasChangedContent', () => {
|
|
396
|
-
it( 'should return false if no dirty blocks nor content property edit', () => {
|
|
397
|
-
const state = {
|
|
398
|
-
editor: {
|
|
399
|
-
present: {
|
|
400
|
-
blocks: {
|
|
401
|
-
isDirty: false,
|
|
402
|
-
},
|
|
403
|
-
edits: {},
|
|
404
|
-
},
|
|
405
|
-
},
|
|
406
|
-
};
|
|
407
|
-
|
|
408
|
-
expect( hasChangedContent( state ) ).toBe( false );
|
|
409
|
-
} );
|
|
410
|
-
|
|
411
|
-
it( 'should return true if dirty blocks', () => {
|
|
412
|
-
const state = {
|
|
413
|
-
editor: {
|
|
414
|
-
present: {
|
|
415
|
-
blocks: {
|
|
416
|
-
isDirty: true,
|
|
417
|
-
value: [],
|
|
418
|
-
},
|
|
419
|
-
edits: {},
|
|
420
|
-
},
|
|
421
|
-
},
|
|
422
|
-
};
|
|
423
|
-
|
|
424
|
-
expect( hasChangedContent( state ) ).toBe( true );
|
|
425
|
-
} );
|
|
426
|
-
|
|
427
|
-
it( 'should return true if content property edit', () => {
|
|
428
|
-
const state = {
|
|
429
|
-
editor: {
|
|
430
|
-
present: {
|
|
431
|
-
blocks: {
|
|
432
|
-
isDirty: false,
|
|
433
|
-
value: [],
|
|
434
|
-
},
|
|
435
|
-
edits: {
|
|
436
|
-
content: 'text mode edited',
|
|
437
|
-
},
|
|
438
|
-
},
|
|
439
|
-
},
|
|
440
|
-
};
|
|
441
|
-
|
|
442
|
-
expect( hasChangedContent( state ) ).toBe( true );
|
|
443
|
-
} );
|
|
444
|
-
} );
|
|
445
|
-
|
|
446
394
|
describe( 'isEditedPostDirty', () => {
|
|
447
395
|
it( 'should return false when blocks state not dirty nor edits exist', () => {
|
|
448
396
|
const state = {
|
|
@@ -1566,11 +1514,9 @@ describe( 'selectors', () => {
|
|
|
1566
1514
|
const state = {
|
|
1567
1515
|
editor: {
|
|
1568
1516
|
present: {
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
isDirty: true,
|
|
1517
|
+
edits: {
|
|
1518
|
+
content: () => 'new-content',
|
|
1572
1519
|
},
|
|
1573
|
-
edits: {},
|
|
1574
1520
|
},
|
|
1575
1521
|
},
|
|
1576
1522
|
currentPost: {
|
|
@@ -11,7 +11,7 @@ import { SAVE_POST_NOTICE_ID, TRASH_POST_NOTICE_ID } from '../constants';
|
|
|
11
11
|
/**
|
|
12
12
|
* External dependencies
|
|
13
13
|
*/
|
|
14
|
-
import { get
|
|
14
|
+
import { get } from 'lodash';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Builds the arguments for a success notification dispatch.
|
|
@@ -34,8 +34,8 @@ export function getNotificationArgumentsForSaveSuccess( data ) {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
const publishStatus = [ 'publish', 'private', 'future' ];
|
|
37
|
-
const isPublished = includes(
|
|
38
|
-
const willPublish = includes(
|
|
37
|
+
const isPublished = publishStatus.includes( previousPost.status );
|
|
38
|
+
const willPublish = publishStatus.includes( post.status );
|
|
39
39
|
|
|
40
40
|
let noticeMessage;
|
|
41
41
|
let shouldShowLink = get( postType, [ 'viewable' ], false );
|