@wordpress/editor 14.38.0 → 14.39.1-next.v.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/document-bar/useEditedSectionDetails.cjs +0 -3
- package/build/components/document-bar/useEditedSectionDetails.cjs.map +2 -2
- package/build/components/editor-interface/index.cjs +33 -9
- package/build/components/editor-interface/index.cjs.map +2 -2
- package/build/components/header/header-skeleton.cjs +100 -0
- package/build/components/header/header-skeleton.cjs.map +7 -0
- package/build/components/header/index.cjs +63 -106
- package/build/components/header/index.cjs.map +3 -3
- package/build/components/media/index.cjs +44 -0
- package/build/components/media/index.cjs.map +7 -0
- package/build/components/media/metadata-panel.cjs +96 -0
- package/build/components/media/metadata-panel.cjs.map +7 -0
- package/build/components/media/preview.cjs +39 -0
- package/build/components/media/preview.cjs.map +7 -0
- package/build/components/more-menu/index.cjs +3 -2
- package/build/components/more-menu/index.cjs.map +2 -2
- package/build/components/post-card-panel/index.cjs +33 -4
- package/build/components/post-card-panel/index.cjs.map +3 -3
- package/build/components/post-content-information/index.cjs +9 -0
- package/build/components/post-content-information/index.cjs.map +2 -2
- package/build/components/post-last-edited-panel/index.cjs +5 -6
- package/build/components/post-last-edited-panel/index.cjs.map +2 -2
- package/build/components/post-last-revision/index.cjs +5 -7
- package/build/components/post-last-revision/index.cjs.map +2 -2
- package/build/components/post-publish-button/label.cjs +6 -1
- package/build/components/post-publish-button/label.cjs.map +2 -2
- package/build/components/post-publish-button/post-publish-button-or-toggle.cjs +8 -3
- package/build/components/post-publish-button/post-publish-button-or-toggle.cjs.map +2 -2
- package/build/components/post-revisions-preview/index.cjs +44 -0
- package/build/components/post-revisions-preview/index.cjs.map +7 -0
- package/build/components/post-revisions-preview/preserve-client-ids.cjs +65 -0
- package/build/components/post-revisions-preview/preserve-client-ids.cjs.map +7 -0
- package/build/components/post-revisions-preview/revisions-canvas.cjs +89 -0
- package/build/components/post-revisions-preview/revisions-canvas.cjs.map +7 -0
- package/build/components/post-revisions-preview/revisions-header.cjs +119 -0
- package/build/components/post-revisions-preview/revisions-header.cjs.map +7 -0
- package/build/components/post-revisions-preview/revisions-slider.cjs +110 -0
- package/build/components/post-revisions-preview/revisions-slider.cjs.map +7 -0
- package/build/components/post-saved-state/index.cjs +8 -2
- package/build/components/post-saved-state/index.cjs.map +2 -2
- package/build/components/post-title/index.cjs +5 -4
- package/build/components/post-title/index.cjs.map +2 -2
- package/build/components/provider/index.cjs +19 -0
- package/build/components/provider/index.cjs.map +3 -3
- package/build/components/provider/use-block-editor-settings.cjs +2 -1
- package/build/components/provider/use-block-editor-settings.cjs.map +2 -2
- package/build/components/revision-author-panel/index.cjs +59 -0
- package/build/components/revision-author-panel/index.cjs.map +7 -0
- package/build/components/revision-created-panel/index.cjs +47 -0
- package/build/components/revision-created-panel/index.cjs.map +7 -0
- package/build/components/sidebar/header.cjs +27 -12
- package/build/components/sidebar/header.cjs.map +3 -3
- package/build/components/sidebar/index.cjs +36 -15
- package/build/components/sidebar/index.cjs.map +3 -3
- package/build/components/sidebar/post-summary.cjs +44 -19
- package/build/components/sidebar/post-summary.cjs.map +3 -3
- package/build/components/start-page-options/index.cjs +1 -1
- package/build/components/start-page-options/index.cjs.map +2 -2
- package/build/dataviews/store/private-actions.cjs +47 -26
- package/build/dataviews/store/private-actions.cjs.map +3 -3
- package/build/store/constants.cjs +3 -0
- package/build/store/constants.cjs.map +2 -2
- package/build/store/private-actions.cjs +40 -0
- package/build/store/private-actions.cjs.map +2 -2
- package/build/store/private-selectors.cjs +33 -2
- package/build/store/private-selectors.cjs.map +2 -2
- package/build/store/reducer.cjs +10 -0
- package/build/store/reducer.cjs.map +2 -2
- package/build/store/selectors.cjs +3 -0
- package/build/store/selectors.cjs.map +2 -2
- package/build/store/utils/notice-builder.cjs +4 -0
- package/build/store/utils/notice-builder.cjs.map +2 -2
- package/build-module/components/document-bar/useEditedSectionDetails.mjs +0 -3
- package/build-module/components/document-bar/useEditedSectionDetails.mjs.map +2 -2
- package/build-module/components/editor-interface/index.mjs +33 -9
- package/build-module/components/editor-interface/index.mjs.map +2 -2
- package/build-module/components/header/header-skeleton.mjs +69 -0
- package/build-module/components/header/header-skeleton.mjs.map +7 -0
- package/build-module/components/header/index.mjs +65 -107
- package/build-module/components/header/index.mjs.map +2 -2
- package/build-module/components/media/index.mjs +8 -0
- package/build-module/components/media/index.mjs.map +7 -0
- package/build-module/components/media/metadata-panel.mjs +65 -0
- package/build-module/components/media/metadata-panel.mjs.map +7 -0
- package/build-module/components/media/preview.mjs +21 -0
- package/build-module/components/media/preview.mjs.map +7 -0
- package/build-module/components/more-menu/index.mjs +3 -2
- package/build-module/components/more-menu/index.mjs.map +2 -2
- package/build-module/components/post-card-panel/index.mjs +35 -5
- package/build-module/components/post-card-panel/index.mjs.map +3 -3
- package/build-module/components/post-content-information/index.mjs +9 -0
- package/build-module/components/post-content-information/index.mjs.map +2 -2
- package/build-module/components/post-last-edited-panel/index.mjs +5 -6
- package/build-module/components/post-last-edited-panel/index.mjs.map +2 -2
- package/build-module/components/post-last-revision/index.mjs +6 -8
- package/build-module/components/post-last-revision/index.mjs.map +2 -2
- package/build-module/components/post-publish-button/label.mjs +6 -1
- package/build-module/components/post-publish-button/label.mjs.map +2 -2
- package/build-module/components/post-publish-button/post-publish-button-or-toggle.mjs +8 -3
- package/build-module/components/post-publish-button/post-publish-button-or-toggle.mjs.map +2 -2
- package/build-module/components/post-revisions-preview/index.mjs +8 -0
- package/build-module/components/post-revisions-preview/index.mjs.map +7 -0
- package/build-module/components/post-revisions-preview/preserve-client-ids.mjs +40 -0
- package/build-module/components/post-revisions-preview/preserve-client-ids.mjs.map +7 -0
- package/build-module/components/post-revisions-preview/revisions-canvas.mjs +61 -0
- package/build-module/components/post-revisions-preview/revisions-canvas.mjs.map +7 -0
- package/build-module/components/post-revisions-preview/revisions-header.mjs +92 -0
- package/build-module/components/post-revisions-preview/revisions-header.mjs.map +7 -0
- package/build-module/components/post-revisions-preview/revisions-slider.mjs +89 -0
- package/build-module/components/post-revisions-preview/revisions-slider.mjs.map +7 -0
- package/build-module/components/post-saved-state/index.mjs +8 -2
- package/build-module/components/post-saved-state/index.mjs.map +2 -2
- package/build-module/components/post-title/index.mjs +5 -4
- package/build-module/components/post-title/index.mjs.map +2 -2
- package/build-module/components/provider/index.mjs +19 -0
- package/build-module/components/provider/index.mjs.map +2 -2
- package/build-module/components/provider/use-block-editor-settings.mjs +2 -1
- package/build-module/components/provider/use-block-editor-settings.mjs.map +2 -2
- package/build-module/components/revision-author-panel/index.mjs +28 -0
- package/build-module/components/revision-author-panel/index.mjs.map +7 -0
- package/build-module/components/revision-created-panel/index.mjs +26 -0
- package/build-module/components/revision-created-panel/index.mjs.map +7 -0
- package/build-module/components/sidebar/header.mjs +22 -7
- package/build-module/components/sidebar/header.mjs.map +2 -2
- package/build-module/components/sidebar/index.mjs +38 -16
- package/build-module/components/sidebar/index.mjs.map +2 -2
- package/build-module/components/sidebar/post-summary.mjs +48 -20
- package/build-module/components/sidebar/post-summary.mjs.map +2 -2
- package/build-module/components/start-page-options/index.mjs +2 -1
- package/build-module/components/start-page-options/index.mjs.map +2 -2
- package/build-module/dataviews/store/private-actions.mjs +59 -27
- package/build-module/dataviews/store/private-actions.mjs.map +2 -2
- package/build-module/store/constants.mjs +2 -0
- package/build-module/store/constants.mjs.map +2 -2
- package/build-module/store/private-actions.mjs +38 -0
- package/build-module/store/private-actions.mjs.map +2 -2
- package/build-module/store/private-selectors.mjs +29 -1
- package/build-module/store/private-selectors.mjs.map +2 -2
- package/build-module/store/reducer.mjs +9 -0
- package/build-module/store/reducer.mjs.map +2 -2
- package/build-module/store/selectors.mjs +4 -0
- package/build-module/store/selectors.mjs.map +2 -2
- package/build-module/store/utils/notice-builder.mjs +4 -0
- package/build-module/store/utils/notice-builder.mjs.map +2 -2
- package/build-style/style-rtl.css +187 -16
- package/build-style/style.css +187 -16
- package/build-types/components/document-bar/useEditedSectionDetails.d.ts.map +1 -1
- package/build-types/components/editor-interface/index.d.ts.map +1 -1
- package/build-types/components/header/header-skeleton.d.ts +17 -0
- package/build-types/components/header/header-skeleton.d.ts.map +1 -0
- package/build-types/components/header/index.d.ts.map +1 -1
- package/build-types/components/media/index.d.ts +3 -0
- package/build-types/components/media/index.d.ts.map +1 -0
- package/build-types/components/media/metadata-panel.d.ts +12 -0
- package/build-types/components/media/metadata-panel.d.ts.map +1 -0
- package/build-types/components/media/preview.d.ts +9 -0
- package/build-types/components/media/preview.d.ts.map +1 -0
- package/build-types/components/more-menu/index.d.ts +3 -1
- package/build-types/components/more-menu/index.d.ts.map +1 -1
- package/build-types/components/post-card-panel/index.d.ts.map +1 -1
- package/build-types/components/post-content-information/index.d.ts.map +1 -1
- package/build-types/components/post-last-edited-panel/index.d.ts.map +1 -1
- package/build-types/components/post-last-revision/index.d.ts.map +1 -1
- package/build-types/components/post-publish-button/label.d.ts.map +1 -1
- package/build-types/components/post-publish-button/post-publish-button-or-toggle.d.ts.map +1 -1
- package/build-types/components/post-revisions-preview/index.d.ts +3 -0
- package/build-types/components/post-revisions-preview/index.d.ts.map +1 -0
- package/build-types/components/post-revisions-preview/preserve-client-ids.d.ts +13 -0
- package/build-types/components/post-revisions-preview/preserve-client-ids.d.ts.map +1 -0
- package/build-types/components/post-revisions-preview/revisions-canvas.d.ts +7 -0
- package/build-types/components/post-revisions-preview/revisions-canvas.d.ts.map +1 -0
- package/build-types/components/post-revisions-preview/revisions-header.d.ts +8 -0
- package/build-types/components/post-revisions-preview/revisions-header.d.ts.map +1 -0
- package/build-types/components/post-revisions-preview/revisions-slider.d.ts +8 -0
- package/build-types/components/post-revisions-preview/revisions-slider.d.ts.map +1 -0
- package/build-types/components/post-saved-state/index.d.ts.map +1 -1
- package/build-types/components/provider/index.d.ts.map +1 -1
- package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
- package/build-types/components/revision-author-panel/index.d.ts +2 -0
- package/build-types/components/revision-author-panel/index.d.ts.map +1 -0
- package/build-types/components/revision-created-panel/index.d.ts +2 -0
- package/build-types/components/revision-created-panel/index.d.ts.map +1 -0
- package/build-types/components/sidebar/index.d.ts.map +1 -1
- package/build-types/components/sidebar/post-summary.d.ts.map +1 -1
- package/build-types/components/start-page-options/index.d.ts.map +1 -1
- package/build-types/dataviews/store/private-actions.d.ts +1 -0
- package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
- package/build-types/store/constants.d.ts +1 -0
- package/build-types/store/constants.d.ts.map +1 -1
- package/build-types/store/private-actions.d.ts +13 -0
- package/build-types/store/private-actions.d.ts.map +1 -1
- package/build-types/store/private-selectors.d.ts +25 -0
- package/build-types/store/private-selectors.d.ts.map +1 -1
- package/build-types/store/reducer.d.ts +11 -0
- package/build-types/store/reducer.d.ts.map +1 -1
- package/build-types/store/selectors.d.ts.map +1 -1
- package/build-types/store/utils/notice-builder.d.ts.map +1 -1
- package/package.json +43 -40
- package/src/components/document-bar/useEditedSectionDetails.js +0 -5
- package/src/components/editor-interface/index.js +39 -9
- package/src/components/header/header-skeleton.js +90 -0
- package/src/components/header/index.js +69 -102
- package/src/components/header/style.scss +4 -0
- package/src/components/media/index.js +2 -0
- package/src/components/media/metadata-panel.js +77 -0
- package/src/components/media/preview.js +35 -0
- package/src/components/more-menu/index.js +2 -1
- package/src/components/post-card-panel/index.js +43 -7
- package/src/components/post-content-information/index.js +11 -0
- package/src/components/post-last-edited-panel/index.js +8 -9
- package/src/components/post-last-revision/index.js +7 -8
- package/src/components/post-publish-button/label.js +9 -0
- package/src/components/post-publish-button/post-publish-button-or-toggle.js +13 -5
- package/src/components/post-revisions-preview/index.js +2 -0
- package/src/components/post-revisions-preview/preserve-client-ids.js +59 -0
- package/src/components/post-revisions-preview/revisions-canvas.js +87 -0
- package/src/components/post-revisions-preview/revisions-header.js +108 -0
- package/src/components/post-revisions-preview/revisions-slider.js +123 -0
- package/src/components/post-revisions-preview/style.scss +22 -0
- package/src/components/post-revisions-preview/test/preserve-client-ids.js +246 -0
- package/src/components/post-saved-state/index.js +8 -0
- package/src/components/post-title/index.js +4 -3
- package/src/components/provider/index.js +26 -0
- package/src/components/provider/use-block-editor-settings.js +2 -3
- package/src/components/revision-author-panel/index.js +36 -0
- package/src/components/revision-created-panel/index.js +36 -0
- package/src/components/sidebar/header.js +35 -14
- package/src/components/sidebar/index.js +40 -13
- package/src/components/sidebar/post-summary.js +45 -11
- package/src/components/sidebar/style.scss +7 -0
- package/src/components/start-page-options/index.js +2 -0
- package/src/dataviews/store/private-actions.ts +79 -33
- package/src/store/constants.ts +1 -0
- package/src/store/private-actions.js +70 -0
- package/src/store/private-selectors.js +54 -0
- package/src/store/reducer.js +17 -0
- package/src/store/selectors.js +6 -0
- package/src/store/test/selectors.js +7 -0
- package/src/store/utils/notice-builder.js +9 -0
- package/src/style.scss +2 -0
|
@@ -300,3 +300,57 @@ export function getShowStylebook( state ) {
|
|
|
300
300
|
export function getCanvasMinHeight( state ) {
|
|
301
301
|
return state.canvasMinHeight;
|
|
302
302
|
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Returns whether the editor is in revisions preview mode.
|
|
306
|
+
*
|
|
307
|
+
* @param {Object} state Global application state.
|
|
308
|
+
* @return {boolean} Whether revisions mode is active.
|
|
309
|
+
*/
|
|
310
|
+
export function isRevisionsMode( state ) {
|
|
311
|
+
return state.revisionId !== null;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Returns the current revision ID in revisions mode.
|
|
316
|
+
*
|
|
317
|
+
* @param {Object} state Global application state.
|
|
318
|
+
* @return {number|null} The revision ID, or null if not in revisions mode.
|
|
319
|
+
*/
|
|
320
|
+
export function getCurrentRevisionId( state ) {
|
|
321
|
+
return state.revisionId;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Returns the current revision object in revisions mode.
|
|
326
|
+
*
|
|
327
|
+
* @param {Object} state Global application state.
|
|
328
|
+
* @return {Object|null|undefined} The revision object, null if loading, or undefined if not in revisions mode.
|
|
329
|
+
*/
|
|
330
|
+
export const getCurrentRevision = createRegistrySelector(
|
|
331
|
+
( select ) => ( state ) => {
|
|
332
|
+
const revisionId = getCurrentRevisionId( state );
|
|
333
|
+
if ( ! revisionId ) {
|
|
334
|
+
return undefined;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
const { type: postType, id: postId } = getCurrentPost( state );
|
|
338
|
+
// - Use getRevisions (plural) instead of getRevision (singular) to
|
|
339
|
+
// avoid a race condition where both API calls complete around the
|
|
340
|
+
// same time and the single revision fetch overwrites the list in the
|
|
341
|
+
// store.
|
|
342
|
+
// - getRevision also needs to be updated to check if there's any
|
|
343
|
+
// received revisions from the collection API call to avoid unnecessary
|
|
344
|
+
// API calls.
|
|
345
|
+
const revisions = select( coreStore ).getRevisions(
|
|
346
|
+
'postType',
|
|
347
|
+
postType,
|
|
348
|
+
postId,
|
|
349
|
+
{ per_page: -1, context: 'edit' }
|
|
350
|
+
);
|
|
351
|
+
if ( ! revisions ) {
|
|
352
|
+
return null;
|
|
353
|
+
}
|
|
354
|
+
return revisions.find( ( r ) => r.id === revisionId ) ?? null;
|
|
355
|
+
}
|
|
356
|
+
);
|
package/src/store/reducer.js
CHANGED
|
@@ -433,6 +433,22 @@ export function canvasMinHeight( state = 0, action ) {
|
|
|
433
433
|
return state;
|
|
434
434
|
}
|
|
435
435
|
|
|
436
|
+
/**
|
|
437
|
+
* Reducer for the revisions preview mode.
|
|
438
|
+
* Stores the current revision ID, or null if not in revisions mode.
|
|
439
|
+
*
|
|
440
|
+
* @param {number|null} state Current revision ID.
|
|
441
|
+
* @param {Object} action Dispatched action.
|
|
442
|
+
* @return {number|null} Updated state.
|
|
443
|
+
*/
|
|
444
|
+
export function revisionId( state = null, action ) {
|
|
445
|
+
switch ( action.type ) {
|
|
446
|
+
case 'SET_CURRENT_REVISION_ID':
|
|
447
|
+
return action.revisionId;
|
|
448
|
+
}
|
|
449
|
+
return state;
|
|
450
|
+
}
|
|
451
|
+
|
|
436
452
|
export default combineReducers( {
|
|
437
453
|
postId,
|
|
438
454
|
postType,
|
|
@@ -455,5 +471,6 @@ export default combineReducers( {
|
|
|
455
471
|
stylesPath,
|
|
456
472
|
showStylebook,
|
|
457
473
|
canvasMinHeight,
|
|
474
|
+
revisionId,
|
|
458
475
|
dataviews: dataviewsReducer,
|
|
459
476
|
} );
|
package/src/store/selectors.js
CHANGED
|
@@ -20,6 +20,7 @@ import { store as preferencesStore } from '@wordpress/preferences';
|
|
|
20
20
|
* Internal dependencies
|
|
21
21
|
*/
|
|
22
22
|
import {
|
|
23
|
+
ATTACHMENT_POST_TYPE,
|
|
23
24
|
EDIT_MERGE_PROPERTIES,
|
|
24
25
|
PERMALINK_POSTNAME_REGEX,
|
|
25
26
|
ONE_MINUTE_IN_MS,
|
|
@@ -486,6 +487,11 @@ export function isEditedPostPublishable( state ) {
|
|
|
486
487
|
//
|
|
487
488
|
// See: <PostPublishButton /> (`isButtonEnabled` assigned by `isSaveable`).
|
|
488
489
|
|
|
490
|
+
// Attachments should only be publishable if they have unsaved changes.
|
|
491
|
+
if ( post.type === ATTACHMENT_POST_TYPE ) {
|
|
492
|
+
return isEditedPostDirty( state );
|
|
493
|
+
}
|
|
494
|
+
|
|
489
495
|
return (
|
|
490
496
|
isEditedPostDirty( state ) ||
|
|
491
497
|
[ 'publish', 'private', 'future' ].indexOf( post.status ) === -1
|
|
@@ -206,6 +206,7 @@ describe( 'selectors', () => {
|
|
|
206
206
|
|
|
207
207
|
beforeEach( () => {
|
|
208
208
|
registerBlockType( 'core/block', {
|
|
209
|
+
apiVersion: 3,
|
|
209
210
|
save: () => null,
|
|
210
211
|
category: 'reusable',
|
|
211
212
|
title: 'Reusable Block Stub',
|
|
@@ -215,6 +216,7 @@ describe( 'selectors', () => {
|
|
|
215
216
|
} );
|
|
216
217
|
|
|
217
218
|
registerBlockType( 'core/test-block-a', {
|
|
219
|
+
apiVersion: 3,
|
|
218
220
|
save: ( props ) => props.attributes.text,
|
|
219
221
|
category: 'design',
|
|
220
222
|
title: 'Test Block A',
|
|
@@ -223,6 +225,7 @@ describe( 'selectors', () => {
|
|
|
223
225
|
} );
|
|
224
226
|
|
|
225
227
|
registerBlockType( 'core/test-block-b', {
|
|
228
|
+
apiVersion: 3,
|
|
226
229
|
save: ( props ) => props.attributes.text,
|
|
227
230
|
category: 'text',
|
|
228
231
|
title: 'Test Block B',
|
|
@@ -234,6 +237,7 @@ describe( 'selectors', () => {
|
|
|
234
237
|
} );
|
|
235
238
|
|
|
236
239
|
registerBlockType( 'core/test-block-c', {
|
|
240
|
+
apiVersion: 3,
|
|
237
241
|
save: ( props ) => props.attributes.text,
|
|
238
242
|
category: 'text',
|
|
239
243
|
title: 'Test Block C',
|
|
@@ -243,6 +247,7 @@ describe( 'selectors', () => {
|
|
|
243
247
|
} );
|
|
244
248
|
|
|
245
249
|
registerBlockType( 'core/freeform', {
|
|
250
|
+
apiVersion: 3,
|
|
246
251
|
save: ( props ) => <RawHTML>{ props.attributes.content }</RawHTML>,
|
|
247
252
|
category: 'text',
|
|
248
253
|
title: 'Test Freeform Content Handler',
|
|
@@ -258,6 +263,7 @@ describe( 'selectors', () => {
|
|
|
258
263
|
} );
|
|
259
264
|
|
|
260
265
|
registerBlockType( 'core/test-default', {
|
|
266
|
+
apiVersion: 3,
|
|
261
267
|
category: 'text',
|
|
262
268
|
title: 'default',
|
|
263
269
|
attributes: {
|
|
@@ -2332,6 +2338,7 @@ describe( 'selectors', () => {
|
|
|
2332
2338
|
originalDefaultBlockName = getDefaultBlockName();
|
|
2333
2339
|
|
|
2334
2340
|
registerBlockType( 'core/default', {
|
|
2341
|
+
apiVersion: 3,
|
|
2335
2342
|
category: 'text',
|
|
2336
2343
|
title: 'default',
|
|
2337
2344
|
attributes: {
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import { ATTACHMENT_POST_TYPE } from '../constants';
|
|
10
|
+
|
|
6
11
|
/**
|
|
7
12
|
* Builds the arguments for a success notification dispatch.
|
|
8
13
|
*
|
|
@@ -32,6 +37,10 @@ export function getNotificationArgumentsForSaveSuccess( data ) {
|
|
|
32
37
|
if ( willTrash ) {
|
|
33
38
|
noticeMessage = postType.labels.item_trashed;
|
|
34
39
|
shouldShowLink = false;
|
|
40
|
+
} else if ( post.type === ATTACHMENT_POST_TYPE ) {
|
|
41
|
+
// Attachments should always show a simple updated message because they don't have a draft state.
|
|
42
|
+
noticeMessage = __( 'Media updated.' );
|
|
43
|
+
shouldShowLink = false;
|
|
35
44
|
} else if ( ! isPublished && ! willPublish ) {
|
|
36
45
|
// If saving a non-published post, don't show notice.
|
|
37
46
|
noticeMessage = __( 'Draft saved.' );
|
package/src/style.scss
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
@use "@wordpress/interface/build-style/style.css" as *;
|
|
3
3
|
@use "@wordpress/global-styles-ui/build-style/style.css" as *;
|
|
4
4
|
@use "@wordpress/dataviews/build-style/style.css" as *;
|
|
5
|
+
@use "@wordpress/media-editor/build-style/style.css" as *;
|
|
5
6
|
@use "./components/autocompleters/style.scss" as *;
|
|
6
7
|
@use "./components/collab-sidebar/style.scss" as *;
|
|
7
8
|
@use "./components/collapsible-block-toolbar/style.scss" as *;
|
|
@@ -35,6 +36,7 @@
|
|
|
35
36
|
@use "./components/post-panel-row/style.scss" as *;
|
|
36
37
|
@use "./components/post-panel-section/style.scss" as *;
|
|
37
38
|
@use "./components/post-publish-panel/style.scss" as *;
|
|
39
|
+
@use "./components/post-revisions-preview/style.scss" as *;
|
|
38
40
|
@use "./components/post-saved-state/style.scss" as *;
|
|
39
41
|
@use "./components/post-schedule/style.scss" as *;
|
|
40
42
|
@use "./components/post-status/style.scss" as *;
|