@wordpress/editor 12.2.2 → 12.3.1-next.a55ed9455a.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/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-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-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/provider/index.js +1 -1
- package/build/components/provider/index.js.map +1 -1
- package/build/components/provider/index.native.js +7 -7
- package/build/components/provider/index.native.js.map +1 -1
- package/build/components/provider/use-block-editor-settings.js +0 -6
- package/build/components/provider/use-block-editor-settings.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 +4 -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/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-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-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/provider/index.js +1 -1
- package/build-module/components/provider/index.js.map +1 -1
- package/build-module/components/provider/index.native.js +7 -7
- package/build-module/components/provider/index.native.js.map +1 -1
- package/build-module/components/provider/use-block-editor-settings.js +0 -6
- package/build-module/components/provider/use-block-editor-settings.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 +4 -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 -26
- 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/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/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-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/provider/index.js +1 -1
- package/src/components/provider/index.native.js +7 -7
- package/src/components/provider/use-block-editor-settings.js +1 -14
- package/src/store/selectors.js +8 -9
- package/src/store/test/actions.js +31 -31
- package/src/store/test/selectors.js +1 -1
- package/src/store/utils/notice-builder.js +4 -4
- package/src/utils/url.js +8 -30
- package/src/utils/test/url.js +0 -22
|
@@ -46,19 +46,19 @@ export function getNotificationArgumentsForSaveSuccess( data ) {
|
|
|
46
46
|
noticeMessage = __( 'Draft saved' );
|
|
47
47
|
shouldShowLink = false;
|
|
48
48
|
} else if ( isPublished && ! willPublish ) {
|
|
49
|
-
// If undoing publish status, show specific notice
|
|
49
|
+
// If undoing publish status, show specific notice.
|
|
50
50
|
noticeMessage = postType.labels.item_reverted_to_draft;
|
|
51
51
|
shouldShowLink = false;
|
|
52
52
|
} else if ( ! isPublished && willPublish ) {
|
|
53
53
|
// If publishing or scheduling a post, show the corresponding
|
|
54
|
-
// publish message
|
|
54
|
+
// publish message.
|
|
55
55
|
noticeMessage = {
|
|
56
56
|
publish: postType.labels.item_published,
|
|
57
57
|
private: postType.labels.item_published_privately,
|
|
58
58
|
future: postType.labels.item_scheduled,
|
|
59
59
|
}[ post.status ];
|
|
60
60
|
} else {
|
|
61
|
-
// Generic fallback notice
|
|
61
|
+
// Generic fallback notice.
|
|
62
62
|
noticeMessage = postType.labels.item_updated;
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -98,7 +98,7 @@ export function getNotificationArgumentsForSaveFail( data ) {
|
|
|
98
98
|
const publishStatus = [ 'publish', 'private', 'future' ];
|
|
99
99
|
const isPublished = publishStatus.indexOf( post.status ) !== -1;
|
|
100
100
|
// If the post was being published, we show the corresponding publish error message
|
|
101
|
-
// Unless we publish an "updating failed" message
|
|
101
|
+
// Unless we publish an "updating failed" message.
|
|
102
102
|
const messages = {
|
|
103
103
|
publish: __( 'Publishing failed.' ),
|
|
104
104
|
private: __( 'Publishing failed.' ),
|
package/src/utils/url.js
CHANGED
|
@@ -1,26 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* External dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { deburr, trim } from 'lodash';
|
|
5
|
-
|
|
6
1
|
/**
|
|
7
2
|
* WordPress dependencies
|
|
8
3
|
*/
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Returns the URL of a WPAdmin Page.
|
|
13
|
-
*
|
|
14
|
-
* TODO: This should be moved to a module less specific to the editor.
|
|
15
|
-
*
|
|
16
|
-
* @param {string} page Page to navigate to.
|
|
17
|
-
* @param {Object} query Query Args.
|
|
18
|
-
*
|
|
19
|
-
* @return {string} WPAdmin URL.
|
|
20
|
-
*/
|
|
21
|
-
export function getWPAdminURL( page, query ) {
|
|
22
|
-
return addQueryArgs( page, query );
|
|
23
|
-
}
|
|
4
|
+
import { cleanForSlug as urlCleanForSlug } from '@wordpress/url';
|
|
5
|
+
import deprecated from '@wordpress/deprecated';
|
|
24
6
|
|
|
25
7
|
/**
|
|
26
8
|
* Performs some basic cleanup of a string for use as a post slug
|
|
@@ -39,14 +21,10 @@ export function getWPAdminURL( page, query ) {
|
|
|
39
21
|
* @return {string} Processed string
|
|
40
22
|
*/
|
|
41
23
|
export function cleanForSlug( string ) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
.replace( /[^\p{L}\p{N}_-]+/gu, '' )
|
|
49
|
-
.toLowerCase(),
|
|
50
|
-
'-'
|
|
51
|
-
);
|
|
24
|
+
deprecated( 'wp.editor.cleanForSlug', {
|
|
25
|
+
since: '12.7',
|
|
26
|
+
plugin: 'Gutenberg',
|
|
27
|
+
alternative: 'wp.url.cleanForSlug',
|
|
28
|
+
} );
|
|
29
|
+
return urlCleanForSlug( string );
|
|
52
30
|
}
|
package/src/utils/test/url.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Internal dependencies
|
|
3
|
-
*/
|
|
4
|
-
import { cleanForSlug } from '../url';
|
|
5
|
-
|
|
6
|
-
describe( 'cleanForSlug()', () => {
|
|
7
|
-
it( 'Should return string prepared for use as url slug', () => {
|
|
8
|
-
expect( cleanForSlug( '/Is th@t Déjà_vu? ' ) ).toBe( 'is-tht-deja_vu' );
|
|
9
|
-
} );
|
|
10
|
-
|
|
11
|
-
it( 'Should allow non-latin characters', () => {
|
|
12
|
-
expect( cleanForSlug( 'Καλημέρα Κόσμε' ) ).toBe( 'καλημέρα-κόσμε' );
|
|
13
|
-
} );
|
|
14
|
-
|
|
15
|
-
it( 'Should return an empty string for missing argument', () => {
|
|
16
|
-
expect( cleanForSlug() ).toBe( '' );
|
|
17
|
-
} );
|
|
18
|
-
|
|
19
|
-
it( 'Should return an empty string for falsy argument', () => {
|
|
20
|
-
expect( cleanForSlug( null ) ).toBe( '' );
|
|
21
|
-
} );
|
|
22
|
-
} );
|