@mcurros2/microm 1.1.346-0 → 1.1.348-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.css.map +1 -1
- package/dist/index.d.ts +33 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +256 -233
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1022,15 +1022,6 @@ export const UseImportDataDefaultProps: {
|
|
|
1022
1022
|
noFileProcessLabel: string;
|
|
1023
1023
|
errorImportingDataLabel: string;
|
|
1024
1024
|
};
|
|
1025
|
-
export type PreviewFileTypes = 'image' | 'pdf' | 'other';
|
|
1026
|
-
export const getFileType: (file_name: string) => PreviewFileTypes;
|
|
1027
|
-
export interface FilePreviewProps {
|
|
1028
|
-
documentURL: string;
|
|
1029
|
-
onClose: () => void;
|
|
1030
|
-
closeText: string;
|
|
1031
|
-
filePreviewError?: string;
|
|
1032
|
-
}
|
|
1033
|
-
export function ImagePreview({ documentURL, onClose, closeText }: FilePreviewProps): JSX.Element;
|
|
1034
1025
|
export interface ImageCropOptions {
|
|
1035
1026
|
aspectRatio?: number;
|
|
1036
1027
|
}
|
|
@@ -1056,7 +1047,7 @@ export interface BrowserImageProcessingOptions {
|
|
|
1056
1047
|
outputFormat?: string;
|
|
1057
1048
|
jpegBackgroundColor?: string;
|
|
1058
1049
|
}
|
|
1059
|
-
interface ResolvedBrowserImageProcessingOptions {
|
|
1050
|
+
export interface ResolvedBrowserImageProcessingOptions {
|
|
1060
1051
|
exifOrientation: boolean;
|
|
1061
1052
|
crop: false | Required<ImageCropOptions>;
|
|
1062
1053
|
resize: false | Required<ImageResizeOptions>;
|
|
@@ -1066,6 +1057,26 @@ interface ResolvedBrowserImageProcessingOptions {
|
|
|
1066
1057
|
jpegBackgroundColor: string;
|
|
1067
1058
|
}
|
|
1068
1059
|
export const BrowserImageProcessingDefaults: ResolvedBrowserImageProcessingOptions;
|
|
1060
|
+
export function resolveImageProcessingOptions(options?: BrowserImageProcessingOptions): ResolvedBrowserImageProcessingOptions;
|
|
1061
|
+
export function getSupportedImageMimeType(fileName: string, declaredType?: string): string | undefined;
|
|
1062
|
+
export function isSupportedImageFile(fileName: string, declaredType?: string): boolean;
|
|
1063
|
+
export function getImageOutputSettings(file: File, options: ResolvedBrowserImageProcessingOptions): {
|
|
1064
|
+
sourceFormat: string;
|
|
1065
|
+
outputFormat: string;
|
|
1066
|
+
shouldCompress: boolean;
|
|
1067
|
+
quality: number | undefined;
|
|
1068
|
+
};
|
|
1069
|
+
export function canvasToProcessedFile(canvas: HTMLCanvasElement, source: File, options: ResolvedBrowserImageProcessingOptions): Promise<File>;
|
|
1070
|
+
export function processImageFileAutomatically(file: File, options: ResolvedBrowserImageProcessingOptions): Promise<File>;
|
|
1071
|
+
export type PreviewFileTypes = 'image' | 'pdf' | 'other';
|
|
1072
|
+
export const getFileType: (file_name: string) => PreviewFileTypes;
|
|
1073
|
+
export interface FilePreviewProps {
|
|
1074
|
+
documentURL: string;
|
|
1075
|
+
onClose: () => void;
|
|
1076
|
+
closeText: string;
|
|
1077
|
+
filePreviewError?: string;
|
|
1078
|
+
}
|
|
1079
|
+
export function ImagePreview({ documentURL, onClose, closeText }: FilePreviewProps): JSX.Element;
|
|
1069
1080
|
export const PDFPreviewDefaultProps: Partial<FilePreviewProps>;
|
|
1070
1081
|
export function PDFPreview(props: FilePreviewProps): JSX.Element;
|
|
1071
1082
|
export class FileStoreClientDef extends EntityDefinition {
|
|
@@ -1122,6 +1133,12 @@ export class FileStoreProcessDef extends EntityDefinition {
|
|
|
1122
1133
|
export class FileStoreProcess extends Entity<FileStoreProcessDef> {
|
|
1123
1134
|
constructor(client: MicroMClient, parentKeys?: {});
|
|
1124
1135
|
}
|
|
1136
|
+
export interface FullImagePreviewProps {
|
|
1137
|
+
source: HTMLCanvasElement;
|
|
1138
|
+
rotation: number;
|
|
1139
|
+
label: string;
|
|
1140
|
+
}
|
|
1141
|
+
export function FullImagePreview({ source, rotation, label }: FullImagePreviewProps): JSX.Element;
|
|
1125
1142
|
export interface ImageEditorProps {
|
|
1126
1143
|
sourceFile: File;
|
|
1127
1144
|
options: ResolvedBrowserImageProcessingOptions;
|
|
@@ -1133,6 +1150,7 @@ export interface ImageEditorProps {
|
|
|
1133
1150
|
rotateCounterClockwiseLabel?: string;
|
|
1134
1151
|
}
|
|
1135
1152
|
export const ImageEditorDefaultProps: Partial<ImageEditorProps>;
|
|
1153
|
+
export const ImageEditor: (props: ImageEditorProps) => JSX.Element;
|
|
1136
1154
|
export interface UploadProgressReport {
|
|
1137
1155
|
errorMessage?: string;
|
|
1138
1156
|
status_id: string;
|
|
@@ -1147,8 +1165,6 @@ export interface UploadProgressReport {
|
|
|
1147
1165
|
}
|
|
1148
1166
|
export interface UseFileUploadSnapshot {
|
|
1149
1167
|
files: readonly UploadProgressReport[];
|
|
1150
|
-
/** @deprecated Use files instead. */
|
|
1151
|
-
uploadProgress: Record<string, UploadProgressReport>;
|
|
1152
1168
|
fileProcessID: string;
|
|
1153
1169
|
maxIndividualFileSize?: number;
|
|
1154
1170
|
maxTotalFilesSize?: number;
|
|
@@ -1181,10 +1197,7 @@ export type ValidateFileReturnType = {
|
|
|
1181
1197
|
error: boolean;
|
|
1182
1198
|
message?: string;
|
|
1183
1199
|
};
|
|
1184
|
-
export type UploadCompletionResult = ValidateFileReturnType
|
|
1185
|
-
/** @deprecated Uploaded files now remain in the canonical files list until deleted. */
|
|
1186
|
-
removeFromQueue?: boolean;
|
|
1187
|
-
};
|
|
1200
|
+
export type UploadCompletionResult = ValidateFileReturnType;
|
|
1188
1201
|
export type ImageEditorConfigurationProps = Partial<Pick<ImageEditorProps, 'saveLabel' | 'cancelLabel' | 'rotateClockwiseLabel' | 'rotateCounterClockwiseLabel'>>;
|
|
1189
1202
|
export interface UseFileUploadProps {
|
|
1190
1203
|
client: MicroMClient;
|
|
@@ -1208,6 +1221,7 @@ export interface UseFileUploadProps {
|
|
|
1208
1221
|
onBeforeUpload?: (file: File) => Promise<boolean>;
|
|
1209
1222
|
onBeforeReplace?: (currentFile: UploadProgressReport, replacementFile?: File) => Promise<boolean>;
|
|
1210
1223
|
onUploadComplete?: (report: UploadProgressReport) => Promise<UploadCompletionResult | void>;
|
|
1224
|
+
onDeleteComplete?: (fileGUID: string) => Promise<void> | void;
|
|
1211
1225
|
thumbnailMaxSize?: number;
|
|
1212
1226
|
thumbnailQuality?: number;
|
|
1213
1227
|
loadFilesOnMount?: boolean;
|
|
@@ -1240,13 +1254,12 @@ export const FileUploaderDefaultProps: Partial<FileUploaderProps>;
|
|
|
1240
1254
|
export function FileUploader(props: FileUploaderProps): JSX.Element;
|
|
1241
1255
|
export interface FilesUploadFormProps extends UseFileUploadProps {
|
|
1242
1256
|
fileProcessColumn: EntityColumn<string>;
|
|
1243
|
-
onOK?: (fileprocess_id: string,
|
|
1257
|
+
onOK?: (fileprocess_id: string, files: readonly UploadProgressReport[]) => void;
|
|
1244
1258
|
onDelete?: (fileGUID: string) => boolean | Promise<boolean>;
|
|
1245
1259
|
helpMessage?: string;
|
|
1246
1260
|
uploaderProps?: Omit<FileUploaderProps, 'uploadAPI' | 'editor'>;
|
|
1247
1261
|
okLabel?: string;
|
|
1248
1262
|
showOKButton?: boolean;
|
|
1249
|
-
/** Reuse an existing hook instance instead of creating an uploader owned by this form. */
|
|
1250
1263
|
uploadAPI?: UseFileUploadReturnType;
|
|
1251
1264
|
}
|
|
1252
1265
|
export const FilesUploadFormDefaultProps: Partial<FilesUploadFormProps>;
|
|
@@ -1254,7 +1267,7 @@ export function FilesUploadForm(props: FilesUploadFormProps): JSX.Element;
|
|
|
1254
1267
|
export interface ModalFileUploadProps {
|
|
1255
1268
|
client: MicroMClient;
|
|
1256
1269
|
fileProcessColumn: EntityColumn<string>;
|
|
1257
|
-
onOK?: (fileprocess_id: string,
|
|
1270
|
+
onOK?: (fileprocess_id: string, files: readonly UploadProgressReport[]) => void;
|
|
1258
1271
|
onCancel?: () => void;
|
|
1259
1272
|
onClosed?: () => void;
|
|
1260
1273
|
modalProps?: ModalSettings;
|
|
@@ -2617,6 +2630,7 @@ export interface useAvatarUploaderProps {
|
|
|
2617
2630
|
maxFileSize?: number;
|
|
2618
2631
|
editor?: boolean;
|
|
2619
2632
|
imageProcessing?: AvatarImageProcessingOptions;
|
|
2633
|
+
onDeleteComplete?: (fileGUID: string) => Promise<void> | void;
|
|
2620
2634
|
}
|
|
2621
2635
|
export type AvatarUploaderLabels = {
|
|
2622
2636
|
modalTitle?: string;
|