Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ function getPostType( name ) {
postType = 'page';
} else if ( name === 'post-item' || name === 'posts' ) {
postType = 'post';
} else if ( name === 'attachment-item' ) {
postType = ATTACHMENT_POST_TYPE;
}

return postType;
Expand Down

This file was deleted.

2 changes: 0 additions & 2 deletions packages/edit-site/src/components/site-editor-routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@ import { templatesRoute } from './templates';
import { templateItemRoute } from './template-item';
import { pagesRoute } from './pages';
import { pageItemRoute } from './page-item';
import { attachmentItemRoute } from './attachment-item';
import { stylebookRoute } from './stylebook';
import { notFoundRoute } from './notfound';

const routes = [
...( window?.__experimentalMediaEditor ? [ attachmentItemRoute ] : [] ),
pageItemRoute,
pagesRoute,
templateItemRoute,
Expand Down
16 changes: 2 additions & 14 deletions packages/editor/src/components/editor-interface/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import SavePublishPanels from '../save-publish-panels';
import TextEditor from '../text-editor';
import VisualEditor from '../visual-editor';
import StylesCanvas from '../styles-canvas';
import { MediaPreview } from '../media';

const interfaceLabels = {
/* translators: accessibility text for the editor top bar landmark region. */
Expand Down Expand Up @@ -83,7 +82,6 @@ export default function EditorInterface( {
mode,
postId,
postType,
isAttachment,
isInserterOpened,
isListViewOpened,
isDistractionFree,
Expand Down Expand Up @@ -130,9 +128,6 @@ export default function EditorInterface( {
postTypeLabel: getPostTypeLabel(),
stylesPath: getStylesPath(),
showStylebook: getShowStylebook(),
isAttachment:
getCurrentPostType() === 'attachment' &&
window?.__experimentalMediaEditor,
isRevisionsMode: _isRevisionsMode(),
showDiff: isShowingRevisionDiff(),
};
Expand All @@ -147,12 +142,9 @@ export default function EditorInterface( {
const secondarySidebarLabel = isListViewOpened
? __( 'Document Overview' )
: __( 'Block Library' );
const shouldShowMediaEditor = !! isAttachment;
const shouldShowStylesCanvas =
! isAttachment &&
( showStylebook || stylesPath?.startsWith( '/revisions' ) );
const shouldShowBlockEditor =
! shouldShowMediaEditor && ! shouldShowStylesCanvas;
showStylebook || stylesPath?.startsWith( '/revisions' );
const shouldShowBlockEditor = ! shouldShowStylesCanvas;

// Local state for save panel.
// Note 'truthy' callback implies an open panel.
Expand Down Expand Up @@ -211,7 +203,6 @@ export default function EditorInterface( {
}
editorNotices={ <Notices /> }
secondarySidebar={
! isAttachment &&
! isPreviewMode &&
mode === 'visual' &&
( ( isInserterOpened && <InserterSidebar /> ) ||
Expand All @@ -224,9 +215,6 @@ export default function EditorInterface( {
content={
<>
{ ! isDistractionFree && ! isPreviewMode && <Notices /> }
{ shouldShowMediaEditor && (
<MediaPreview { ...iframeProps } />
) }
{ shouldShowStylesCanvas && <StylesCanvas /> }
{ shouldShowBlockEditor && (
<>
Expand Down
18 changes: 6 additions & 12 deletions packages/editor/src/components/header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ function Header( {
hasBlockSelection,
hasSectionRootClientId,
isStylesCanvasActive,
isAttachment,
} = useSelect( ( select ) => {
const { get: getPreference } = select( preferencesStore );
const {
Expand Down Expand Up @@ -78,9 +77,6 @@ function Header( {
isStylesCanvasActive:
!! getStylesPath()?.startsWith( '/revisions' ) ||
getShowStylebook(),
isAttachment:
getCurrentPostType() === ATTACHMENT_POST_TYPE &&
window?.__experimentalMediaEditor,
};
}, [] );

Expand Down Expand Up @@ -109,13 +105,11 @@ function Header( {
<HeaderSkeleton
toolbar={
<>
{ ! isAttachment && (
<DocumentTools
disableBlockTools={
isStylesCanvasActive || isTextEditor
}
/>
) }
<DocumentTools
disableBlockTools={
isStylesCanvasActive || isTextEditor
}
/>
{ hasFixedToolbar && isLargeViewport && (
<CollapsibleBlockToolbar
isCollapsed={ isBlockToolsCollapsed }
Expand Down Expand Up @@ -183,7 +177,7 @@ function Header( {
/>
) }
{ customSaveButton }
{ ! isAttachment && <MoreMenu /> }
<MoreMenu />
</>
}
/>
Expand Down
2 changes: 0 additions & 2 deletions packages/editor/src/components/media/index.js

This file was deleted.

77 changes: 0 additions & 77 deletions packages/editor/src/components/media/metadata-panel.js

This file was deleted.

35 changes: 0 additions & 35 deletions packages/editor/src/components/media/preview.js

This file was deleted.

11 changes: 0 additions & 11 deletions packages/editor/src/components/post-publish-button/label.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { useViewportMatch } from '@wordpress/compose';
* Internal dependencies
*/
import { store as editorStore } from '../../store';
import { ATTACHMENT_POST_TYPE } from '../../store/constants';

/**
* Renders the label for the publish button.
Expand All @@ -28,7 +27,6 @@ export default function PublishButtonLabel() {
hasNonPostEntityChanges,
postStatusHasChanged,
postStatus,
postType,
isPostSavingLocked,
} = useSelect( ( select ) => {
const {
Expand All @@ -37,7 +35,6 @@ export default function PublishButtonLabel() {
isSavingPost,
isPublishingPost,
getCurrentPost,
getCurrentPostType,
isAutosavingPost,
getPostEdits,
getEditedPostAttribute,
Expand All @@ -49,7 +46,6 @@ export default function PublishButtonLabel() {
isPublishing: isPublishingPost(),
hasPublishAction:
getCurrentPost()._links?.[ 'wp:action-publish' ] ?? false,
postType: getCurrentPostType(),
isAutosaving: isAutosavingPost(),
hasNonPostEntityChanges:
select( editorStore ).hasNonPostEntityChanges(),
Expand All @@ -70,13 +66,6 @@ export default function PublishButtonLabel() {
return __( 'Saving…' );
}
if ( ! hasPublishAction ) {
// For attachments, always show "Save" since they don't have a publish workflow
if (
postType === ATTACHMENT_POST_TYPE &&
window?.__experimentalMediaEditor
) {
return __( 'Save' );
}
// TODO: this is because "Submit for review" string is too long in some languages.
// @see https://github.com/WordPress/gutenberg/issues/10475
return isSmallerThanMediumViewport
Expand Down
26 changes: 0 additions & 26 deletions packages/editor/src/components/provider/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import { createBlock } from '@wordpress/blocks';
*/
import withRegistryProvider from './with-registry-provider';
import { store as editorStore } from '../../store';
import { ATTACHMENT_POST_TYPE } from '../../store/constants';
import useBlockEditorSettings from './use-block-editor-settings';
import { unlock } from '../../lock-unlock';
import DisableNonPageContentBlocks from './disable-non-page-content-blocks';
Expand Down Expand Up @@ -401,31 +400,6 @@ export const ExperimentalEditorProvider = withRegistryProvider(
return null;
}

const isAttachment =
post.type === ATTACHMENT_POST_TYPE &&
window?.__experimentalMediaEditor;

// Early return for attachments - no block editor needed
if ( isAttachment ) {
return (
<EntityProvider kind="root" type="site">
<EntityProvider
kind="postType"
type={ post.type }
id={ post.id }
>
{ children }
{ ! settings.isPreviewMode && (
<>
<EditorKeyboardShortcuts />
<KeyboardShortcutHelpModal />
</>
) }
</EntityProvider>
</EntityProvider>
);
}

return (
<EntityProvider kind="root" type="site">
<EntityProvider
Expand Down
Loading
Loading