@mcurros2/microm 1.1.337-0 → 1.1.339-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/dist/index.d.ts +42 -54
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +403 -289
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1031,6 +1031,41 @@ export interface FilePreviewProps {
|
|
|
1031
1031
|
filePreviewError?: string;
|
|
1032
1032
|
}
|
|
1033
1033
|
export function ImagePreview({ documentURL, onClose, closeText }: FilePreviewProps): JSX.Element;
|
|
1034
|
+
export interface ImageCropOptions {
|
|
1035
|
+
aspectRatio?: number;
|
|
1036
|
+
}
|
|
1037
|
+
export interface ImageResizeOptions {
|
|
1038
|
+
maxWidth?: number;
|
|
1039
|
+
maxHeight?: number;
|
|
1040
|
+
allowUpscale?: boolean;
|
|
1041
|
+
}
|
|
1042
|
+
export interface ImageManualRotationOptions {
|
|
1043
|
+
stepDegrees?: 90 | -90;
|
|
1044
|
+
}
|
|
1045
|
+
export interface ImageCompressionOptions {
|
|
1046
|
+
thresholdBytes?: number;
|
|
1047
|
+
quality?: number;
|
|
1048
|
+
fallbackFormat?: string;
|
|
1049
|
+
}
|
|
1050
|
+
export interface BrowserImageProcessingOptions {
|
|
1051
|
+
exifOrientation?: boolean;
|
|
1052
|
+
crop?: boolean | ImageCropOptions;
|
|
1053
|
+
resize?: boolean | ImageResizeOptions;
|
|
1054
|
+
manualRotation?: boolean | ImageManualRotationOptions;
|
|
1055
|
+
compression?: boolean | ImageCompressionOptions;
|
|
1056
|
+
outputFormat?: string;
|
|
1057
|
+
jpegBackgroundColor?: string;
|
|
1058
|
+
}
|
|
1059
|
+
interface ResolvedBrowserImageProcessingOptions {
|
|
1060
|
+
exifOrientation: boolean;
|
|
1061
|
+
crop: false | Required<ImageCropOptions>;
|
|
1062
|
+
resize: false | Required<ImageResizeOptions>;
|
|
1063
|
+
manualRotation: false | Required<ImageManualRotationOptions>;
|
|
1064
|
+
compression: false | Required<ImageCompressionOptions>;
|
|
1065
|
+
outputFormat?: string;
|
|
1066
|
+
jpegBackgroundColor: string;
|
|
1067
|
+
}
|
|
1068
|
+
export const BrowserImageProcessingDefaults: ResolvedBrowserImageProcessingOptions;
|
|
1034
1069
|
export const PDFPreviewDefaultProps: Partial<FilePreviewProps>;
|
|
1035
1070
|
export function PDFPreview(props: FilePreviewProps): JSX.Element;
|
|
1036
1071
|
export class CategoriesDef extends EntityDefinition {
|
|
@@ -1694,52 +1729,6 @@ export class MicromEntitiesTypesDef extends EntityDefinition {
|
|
|
1694
1729
|
};
|
|
1695
1730
|
constructor();
|
|
1696
1731
|
}
|
|
1697
|
-
export type BrowserImageFormat = 'image/jpeg' | 'image/png' | 'image/webp';
|
|
1698
|
-
export interface ImageCropOptions {
|
|
1699
|
-
aspectRatio?: number;
|
|
1700
|
-
}
|
|
1701
|
-
export interface ImageResizeOptions {
|
|
1702
|
-
maxWidth?: number;
|
|
1703
|
-
maxHeight?: number;
|
|
1704
|
-
allowUpscale?: boolean;
|
|
1705
|
-
}
|
|
1706
|
-
export interface ImageManualRotationOptions {
|
|
1707
|
-
stepDegrees?: 90 | -90;
|
|
1708
|
-
}
|
|
1709
|
-
export interface ImageCompressionOptions {
|
|
1710
|
-
thresholdBytes?: number;
|
|
1711
|
-
quality?: number;
|
|
1712
|
-
fallbackFormat?: BrowserImageFormat;
|
|
1713
|
-
}
|
|
1714
|
-
export interface BrowserImageProcessingOptions {
|
|
1715
|
-
exifOrientation?: boolean;
|
|
1716
|
-
crop?: boolean | ImageCropOptions;
|
|
1717
|
-
resize?: boolean | ImageResizeOptions;
|
|
1718
|
-
manualRotation?: boolean | ImageManualRotationOptions;
|
|
1719
|
-
compression?: boolean | ImageCompressionOptions;
|
|
1720
|
-
outputFormat?: BrowserImageFormat;
|
|
1721
|
-
jpegBackgroundColor?: string;
|
|
1722
|
-
}
|
|
1723
|
-
export interface ResolvedBrowserImageProcessingOptions {
|
|
1724
|
-
exifOrientation: boolean;
|
|
1725
|
-
crop: false | Required<ImageCropOptions>;
|
|
1726
|
-
resize: false | Required<ImageResizeOptions>;
|
|
1727
|
-
manualRotation: false | Required<ImageManualRotationOptions>;
|
|
1728
|
-
compression: false | Required<ImageCompressionOptions>;
|
|
1729
|
-
outputFormat?: BrowserImageFormat;
|
|
1730
|
-
jpegBackgroundColor: string;
|
|
1731
|
-
}
|
|
1732
|
-
export const BrowserImageProcessingDefaults: ResolvedBrowserImageProcessingOptions;
|
|
1733
|
-
export function resolveImageProcessingOptions(options?: BrowserImageProcessingOptions): ResolvedBrowserImageProcessingOptions;
|
|
1734
|
-
export function hasInteractiveImageProcessing(options: ResolvedBrowserImageProcessingOptions): boolean;
|
|
1735
|
-
export function getImageOutputSettings(file: File, options: ResolvedBrowserImageProcessingOptions): {
|
|
1736
|
-
sourceFormat: BrowserImageFormat;
|
|
1737
|
-
outputFormat: BrowserImageFormat;
|
|
1738
|
-
shouldCompress: boolean;
|
|
1739
|
-
quality: number | undefined;
|
|
1740
|
-
};
|
|
1741
|
-
export function canvasToProcessedFile(canvas: HTMLCanvasElement, source: File, options: ResolvedBrowserImageProcessingOptions): Promise<File>;
|
|
1742
|
-
export function processImageFileAutomatically(file: File, options: ResolvedBrowserImageProcessingOptions): Promise<File>;
|
|
1743
1732
|
interface ImageEditorProps {
|
|
1744
1733
|
sourceFile: File;
|
|
1745
1734
|
options: ResolvedBrowserImageProcessingOptions;
|
|
@@ -1753,6 +1742,7 @@ interface ImageEditorProps {
|
|
|
1753
1742
|
export const ImageEditorDefaultProps: Partial<ImageEditorProps>;
|
|
1754
1743
|
export interface UseFileUploadReturnType {
|
|
1755
1744
|
uploadFiles: (selectedFiles: File[]) => Promise<UploadProgressReport[]>;
|
|
1745
|
+
editImage: (report: UploadProgressReport) => Promise<UploadProgressReport | null>;
|
|
1756
1746
|
deleteFile: (file_id: string, fileGUID: string) => Promise<DBStatusResult>;
|
|
1757
1747
|
downloadFile: (fileUrl: string, fileName?: string) => Promise<void>;
|
|
1758
1748
|
uploadProgress: Record<string, UploadProgressReport>;
|
|
@@ -1772,7 +1762,6 @@ export type ValidateFileReturnType = {
|
|
|
1772
1762
|
message?: string;
|
|
1773
1763
|
};
|
|
1774
1764
|
export type UploadCompletionResult = ValidateFileReturnType & {
|
|
1775
|
-
rollbackUploadedFile?: boolean;
|
|
1776
1765
|
removeFromQueue?: boolean;
|
|
1777
1766
|
};
|
|
1778
1767
|
export interface UseFileUploadProps {
|
|
@@ -1787,7 +1776,7 @@ export interface UseFileUploadProps {
|
|
|
1787
1776
|
unspecifiedErrorWhenUploadingFileText?: string;
|
|
1788
1777
|
totalUploadExceedsMaximumSizeText?: string;
|
|
1789
1778
|
onCancel?: () => void;
|
|
1790
|
-
editor?:
|
|
1779
|
+
editor?: boolean;
|
|
1791
1780
|
onValidateFile?: (file: File) => Promise<ValidateFileReturnType>;
|
|
1792
1781
|
onProcessFile?: (file: File) => Promise<File | null>;
|
|
1793
1782
|
onBeforeUpload?: (file: File) => Promise<boolean>;
|
|
@@ -1836,6 +1825,8 @@ export interface FileUploaderProps extends Omit<DropzoneProps, 'children' | 'onD
|
|
|
1836
1825
|
showCancelButton?: boolean;
|
|
1837
1826
|
cancelLabel?: string;
|
|
1838
1827
|
parentFormAPI?: UseEntityFormReturnType;
|
|
1828
|
+
editor?: boolean;
|
|
1829
|
+
editImageLabel?: string;
|
|
1839
1830
|
}
|
|
1840
1831
|
export const FileUploaderDefaultProps: Partial<FileUploaderProps>;
|
|
1841
1832
|
export function FileUploader(props: FileUploaderProps): JSX.Element;
|
|
@@ -1844,11 +1835,9 @@ export interface FilesUploadFormProps extends UseFileUploadProps {
|
|
|
1844
1835
|
onOK?: (fileprocess_id: string, uploadProgress: Record<string, UploadProgressReport>) => void;
|
|
1845
1836
|
onDelete?: (file_id: string) => boolean;
|
|
1846
1837
|
helpMessage?: string;
|
|
1847
|
-
uploaderProps?: Omit<FileUploaderProps, 'uploadAPI' | 'abortSignal'>;
|
|
1838
|
+
uploaderProps?: Omit<FileUploaderProps, 'uploadAPI' | 'abortSignal' | 'editor'>;
|
|
1848
1839
|
okLabel?: string;
|
|
1849
1840
|
showOKButton?: boolean;
|
|
1850
|
-
editor?: 'none' | 'image';
|
|
1851
|
-
onValidateFile?: (file: File) => Promise<ValidateFileReturnType>;
|
|
1852
1841
|
}
|
|
1853
1842
|
export const FilesUploadFormDefaultProps: Partial<FilesUploadFormProps>;
|
|
1854
1843
|
export function FilesUploadForm(props: FilesUploadFormProps): JSX.Element;
|
|
@@ -1861,7 +1850,7 @@ export interface ModalFileUploadProps {
|
|
|
1861
1850
|
modalProps?: ModalSettings;
|
|
1862
1851
|
modalTitle?: string;
|
|
1863
1852
|
filesUploadFormProps: Omit<FilesUploadFormProps, 'fileProcessColumn' | 'uploaderProps' | 'client' | 'onOK' | 'onCancel'>;
|
|
1864
|
-
uploaderProps?: Omit<FileUploaderProps, 'uploadAPI' | 'abortSignal'>;
|
|
1853
|
+
uploaderProps?: Omit<FileUploaderProps, 'uploadAPI' | 'abortSignal' | 'editor'>;
|
|
1865
1854
|
}
|
|
1866
1855
|
export const UseFileUploadFormOpenDefaultProps: Partial<ModalFileUploadProps>;
|
|
1867
1856
|
export function useFilesUploadForm(): (props: ModalFileUploadProps) => Promise<void>;
|
|
@@ -3132,7 +3121,6 @@ export function useMenuContent(props: UseMenuContentProps): UseMenuContentResult
|
|
|
3132
3121
|
export type UseMenuContentReturnType = UseMenuContentResult;
|
|
3133
3122
|
export function normalizeTextToLowercaseWithoutAccents(value: string): string;
|
|
3134
3123
|
export function caseInsensitveAccentInsensitiveFilter(query: string, actions: SpotlightAction[]): SpotlightAction[];
|
|
3135
|
-
export type AvatarImageFormat = BrowserImageFormat;
|
|
3136
3124
|
export type AvatarImageProcessingOptions = BrowserImageProcessingOptions;
|
|
3137
3125
|
export interface useAvatarUploaderProps {
|
|
3138
3126
|
client: MicroMClient;
|
|
@@ -3142,6 +3130,7 @@ export interface useAvatarUploaderProps {
|
|
|
3142
3130
|
labels?: AvatarUploaderLabels;
|
|
3143
3131
|
parentFormAPI?: UseEntityFormReturnType;
|
|
3144
3132
|
maxFileSize?: number;
|
|
3133
|
+
editor?: boolean;
|
|
3145
3134
|
imageProcessing?: AvatarImageProcessingOptions;
|
|
3146
3135
|
}
|
|
3147
3136
|
export type AvatarUploaderLabels = {
|
|
@@ -3158,7 +3147,6 @@ export type AvatarUploaderLabels = {
|
|
|
3158
3147
|
replaceMessage?: string;
|
|
3159
3148
|
replaceConfirmLabel?: string;
|
|
3160
3149
|
replaceCancelLabel?: string;
|
|
3161
|
-
replacementFailedMessage?: string;
|
|
3162
3150
|
};
|
|
3163
3151
|
export const AvatarUploaderDefaultProps: Partial<useAvatarUploaderProps>;
|
|
3164
3152
|
export interface AvatarUploaderAPI {
|