chore: remove external media library integrations

This commit is contained in:
Daniel Lautzenheiser
2023-04-12 22:27:15 -04:00
parent 1849729bab
commit 56dc4a1d64
30 changed files with 139 additions and 1057 deletions

View File

@ -9,10 +9,8 @@ import {
changeDraftFieldValidation,
} from '@staticcms/core/actions/entries';
import {
clearMediaControl as clearMediaControlAction,
openMediaLibrary as openMediaLibraryAction,
removeInsertedMedia as removeInsertedMediaAction,
removeMediaControl as removeMediaControlAction,
} from '@staticcms/core/actions/mediaLibrary';
import { query as queryAction } from '@staticcms/core/actions/search';
import useMemoCompare from '@staticcms/core/lib/hooks/useMemoCompare';
@ -41,7 +39,6 @@ import type { ComponentType } from 'react';
import type { ConnectedProps } from 'react-redux';
const EditorControl = ({
clearMediaControl,
collection,
config: configState,
entry,
@ -57,7 +54,6 @@ const EditorControl = ({
parentPath,
query,
removeInsertedMedia,
removeMediaControl,
t,
value,
forList = false,
@ -169,10 +165,8 @@ const EditorControl = ({
locale,
mediaPaths,
onChange: handleChangeDraftField,
clearMediaControl,
openMediaLibrary,
removeInsertedMedia,
removeMediaControl,
path,
query,
t,
@ -203,10 +197,8 @@ const EditorControl = ({
locale,
mediaPaths,
handleChangeDraftField,
clearMediaControl,
openMediaLibrary,
removeInsertedMedia,
removeMediaControl,
path,
query,
finalValue,
@ -254,8 +246,6 @@ function mapStateToProps(state: RootState, ownProps: EditorControlOwnProps) {
const mapDispatchToProps = {
changeDraftField: changeDraftFieldAction,
openMediaLibrary: openMediaLibraryAction,
clearMediaControl: clearMediaControlAction,
removeMediaControl: removeMediaControlAction,
removeInsertedMedia: removeInsertedMediaAction,
query: queryAction,
};

View File

@ -484,7 +484,7 @@ const MediaLibrary: FC<TranslatedProps<MediaLibraryProps>> = ({
px-5
pt-4
`,
config?.media_library_folder_support &&
config?.media_library?.folder_support &&
`
pb-4
border-b
@ -517,7 +517,7 @@ const MediaLibrary: FC<TranslatedProps<MediaLibraryProps>> = ({
placeholder={t('mediaLibrary.mediaLibraryModal.search')}
disabled={!dynamicSearchActive && !hasFilteredFiles}
/>
{config?.media_library_folder_support ? (
{config?.media_library?.folder_support ? (
<div className="flex gap-1.5 items-center">
<IconButton
onClick={handleHome}
@ -565,7 +565,7 @@ const MediaLibrary: FC<TranslatedProps<MediaLibraryProps>> = ({
) : null}
</div>
</div>
{config?.media_library_folder_support ? (
{config?.media_library?.folder_support ? (
<div
className="
flex

View File

@ -164,7 +164,7 @@ const MediaLibraryCardGrid: FC<MediaLibraryCardGridProps> = props => {
overflow-hidden
`,
isDialog && 'rounded-b-lg',
!config?.media_library_folder_support && 'pt-[20px]',
!config?.media_library?.folder_support && 'pt-[20px]',
)}
style={{
width,
@ -180,7 +180,7 @@ const MediaLibraryCardGrid: FC<MediaLibraryCardGridProps> = props => {
rowHeight={() => rowHeightWithGutter}
width={width}
height={
height - (!config?.media_library_folder_support ? MEDIA_LIBRARY_PADDING : 0)
height - (!config?.media_library?.folder_support ? MEDIA_LIBRARY_PADDING : 0)
}
itemData={
{