chore: fix linting errors and export more hooks
This commit is contained in:
parent
28fd9caf4c
commit
4a73ea65fd
@ -194,7 +194,7 @@ const MediaLibrary: FC<TranslatedProps<MediaLibraryProps>> = ({
|
|||||||
|
|
||||||
setSelectedFile(asset);
|
setSelectedFile(asset);
|
||||||
},
|
},
|
||||||
[canInsert, selectedFile?.key],
|
[canInsert, forFolder, selectedFile?.key],
|
||||||
);
|
);
|
||||||
|
|
||||||
const scrollContainerRef = useRef<HTMLDivElement | null>(null);
|
const scrollContainerRef = useRef<HTMLDivElement | null>(null);
|
||||||
|
@ -6,6 +6,10 @@ import useMediaAsset from './lib/hooks/useMediaAsset';
|
|||||||
import useMediaInsert from './lib/hooks/useMediaInsert';
|
import useMediaInsert from './lib/hooks/useMediaInsert';
|
||||||
import useUUID from './lib/hooks/useUUID';
|
import useUUID from './lib/hooks/useUUID';
|
||||||
import Registry from './lib/registry';
|
import Registry from './lib/registry';
|
||||||
|
import useEntries from './lib/hooks/useEntries';
|
||||||
|
import useHasChildErrors from './lib/hooks/useHasChildErrors';
|
||||||
|
import useMediaFiles from './lib/hooks/useMediaFiles';
|
||||||
|
import useFolderSupport from './lib/hooks/useFolderSupport';
|
||||||
|
|
||||||
export * from './backends';
|
export * from './backends';
|
||||||
export * from './interface';
|
export * from './interface';
|
||||||
@ -25,8 +29,13 @@ if (typeof window !== 'undefined') {
|
|||||||
window.useEffect = window.useEffect || useEffect;
|
window.useEffect = window.useEffect || useEffect;
|
||||||
window.useCallback = window.useCallback || useCallback;
|
window.useCallback = window.useCallback || useCallback;
|
||||||
window.h = window.h || createElement;
|
window.h = window.h || createElement;
|
||||||
|
|
||||||
|
window.useEntries = window.useEntries || useEntries;
|
||||||
|
window.useFolderSupport = window.useFolderSupport || useFolderSupport;
|
||||||
|
window.useHasChildErrors = window.useHasChildErrors || useHasChildErrors;
|
||||||
window.useIsMediaAsset = window.useIsMediaAsset || useIsMediaAsset;
|
window.useIsMediaAsset = window.useIsMediaAsset || useIsMediaAsset;
|
||||||
window.useMediaAsset = window.useMediaAsset || useMediaAsset;
|
window.useMediaAsset = window.useMediaAsset || useMediaAsset;
|
||||||
|
window.useMediaFiles = window.useMediaFiles || useMediaFiles;
|
||||||
window.useMediaInsert = window.useMediaInsert || useMediaInsert;
|
window.useMediaInsert = window.useMediaInsert || useMediaInsert;
|
||||||
window.useUUID = window.useUUID || useUUID;
|
window.useUUID = window.useUUID || useUUID;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,8 @@
|
|||||||
|
export { default as useEntries } from './useEntries';
|
||||||
|
export { default as useFolderSupport } from './useFolderSupport';
|
||||||
|
export { default as useHasChildErrors } from './useHasChildErrors';
|
||||||
export { default as useIsMediaAsset } from './useIsMediaAsset';
|
export { default as useIsMediaAsset } from './useIsMediaAsset';
|
||||||
export { default as useMediaAsset } from './useMediaAsset';
|
export { default as useMediaAsset } from './useMediaAsset';
|
||||||
|
export { default as useMediaFiles } from './useMediaFiles';
|
||||||
export { default as useMediaInsert } from './useMediaInsert';
|
export { default as useMediaInsert } from './useMediaInsert';
|
||||||
export { default as useUUID } from './useUUID';
|
export { default as useUUID } from './useUUID';
|
||||||
|
16
packages/core/src/types/global.d.ts
vendored
16
packages/core/src/types/global.d.ts
vendored
@ -3,7 +3,16 @@ export {};
|
|||||||
import type { Config } from '../interface';
|
import type { Config } from '../interface';
|
||||||
import type CmsAPI from '../index';
|
import type CmsAPI from '../index';
|
||||||
import type { createElement, useEffect, useState, useMemo, useCallback } from 'react';
|
import type { createElement, useEffect, useState, useMemo, useCallback } from 'react';
|
||||||
import type { useIsMediaAsset, useMediaAsset, useMediaInsert, useUUID } from '../lib/hooks';
|
import type {
|
||||||
|
useEntries,
|
||||||
|
useFolderSupport,
|
||||||
|
useHasChildErrors,
|
||||||
|
useIsMediaAsset,
|
||||||
|
useMediaAsset,
|
||||||
|
useMediaFiles,
|
||||||
|
useMediaInsert,
|
||||||
|
useUUID,
|
||||||
|
} from '../lib/hooks';
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface Window {
|
interface Window {
|
||||||
@ -15,8 +24,13 @@ declare global {
|
|||||||
useMemo: useMemo;
|
useMemo: useMemo;
|
||||||
useEffect: useEffect;
|
useEffect: useEffect;
|
||||||
useCallback: useCallback;
|
useCallback: useCallback;
|
||||||
|
|
||||||
|
useEntries: useEntries;
|
||||||
|
useFolderSupport: useFolderSupport;
|
||||||
|
useHasChildErrors: useHasChildErrors;
|
||||||
useIsMediaAsset: useIsMediaAsset;
|
useIsMediaAsset: useIsMediaAsset;
|
||||||
useMediaAsset: useMediaAsset;
|
useMediaAsset: useMediaAsset;
|
||||||
|
useMediaFiles: useMediaFiles;
|
||||||
useMediaInsert: useMediaInsert;
|
useMediaInsert: useMediaInsert;
|
||||||
useUUID: useUUID;
|
useUUID: useUUID;
|
||||||
}
|
}
|
||||||
|
@ -294,6 +294,7 @@ const withFileControl = ({ forImage = false }: WithFileControlProps = {}) => {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}, [
|
}, [
|
||||||
|
forFolder,
|
||||||
internalValue,
|
internalValue,
|
||||||
renderedImagesLinks,
|
renderedImagesLinks,
|
||||||
handleOpenMediaLibrary,
|
handleOpenMediaLibrary,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user