@cloudparker/moldex.js 0.0.111 → 0.0.112

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.
@@ -1,7 +1,7 @@
1
1
  import { type DialogProps, type DialogSize, type InputFieldProps } from '../../views';
2
2
  import { type CropperDialogPropsType } from '../../views/core/dialog/components/cropper-dialog/cropper-dialog.svelte';
3
3
  import type { PickerDialogProps } from '../../views/core/dialog/components/picker-dialog/picker-dialog.svelte';
4
- import { type ImageCapttures, type OutputImageFormats } from '../utils/image-service';
4
+ import { ImageCapttureEnum, type ImageCapttures, type OutputImageFormats } from '../utils/image-service';
5
5
  export declare enum DialogSizeEnum {
6
6
  XS = "xs",
7
7
  SM = "sm",
@@ -98,10 +98,15 @@ export declare function openImagePickerDialog<T extends File | File[]>(accepts?:
98
98
  outputFormat?: OutputImageFormats;
99
99
  quality?: number;
100
100
  }): Promise<T | null>;
101
- export declare function openImagePickerDialogWithCropper({ outputFormat, outputWidth, outputQuality, outputAspectRatio, dialogSize, }?: {
101
+ export declare function openImagePickerDialogWithCropper({ outputFormat, outputWidth, outputQuality, outputAspectRatio, dialogSize, capture, maxHeight, maxSizeInBytes, maxWidth, quality }?: {
102
102
  outputFormat?: OutputImageFormats;
103
103
  outputWidth?: number;
104
104
  outputQuality?: number;
105
105
  outputAspectRatio?: number;
106
106
  dialogSize?: DialogSize;
107
+ capture?: ImageCapttureEnum;
108
+ maxWidth?: number;
109
+ maxHeight?: number;
110
+ maxSizeInBytes?: number;
111
+ quality?: number;
107
112
  }): Promise<File | null>;
@@ -8,7 +8,7 @@ import TextFieldDialog from '../../views/core/dialog/components/text-field-dialo
8
8
  import TextareaFieldDialog from '../../views/core/dialog/components/textarea-field-dialog/textarea-field-dialog.svelte';
9
9
  import { mount } from 'svelte';
10
10
  import { getDialogSize, isMobileScreen } from '../screen/screen-service';
11
- import { cropImageFile, FilePickerAccepts, OutputImageFormatEnum, processImageFile } from '../utils/image-service';
11
+ import { cropImageFile, FilePickerAccepts, ImageCapttureEnum, OutputImageFormatEnum, processImageFile } from '../utils/image-service';
12
12
  export var DialogSizeEnum;
13
13
  (function (DialogSizeEnum) {
14
14
  DialogSizeEnum["XS"] = "xs";
@@ -343,8 +343,14 @@ export async function openImagePickerDialog(accepts = 'image/*', options = {}) {
343
343
  }
344
344
  });
345
345
  }
346
- export async function openImagePickerDialogWithCropper({ outputFormat = OutputImageFormatEnum.WEBP, outputWidth = 800, outputQuality = 0.6, outputAspectRatio = 1, dialogSize = DialogSizeEnum.MD, } = {}) {
347
- const file = (await openFilePickerDialog(FilePickerAccepts.image));
346
+ export async function openImagePickerDialogWithCropper({ outputFormat = OutputImageFormatEnum.WEBP, outputWidth = 800, outputQuality = 0.6, outputAspectRatio = 1, dialogSize = DialogSizeEnum.MD, capture, maxHeight, maxSizeInBytes, maxWidth, quality } = {}) {
347
+ const file = (await openImagePickerDialog(FilePickerAccepts.image, {
348
+ capture,
349
+ maxHeight,
350
+ maxSizeInBytes,
351
+ maxWidth,
352
+ quality
353
+ }));
348
354
  let croppedFile = await cropImageFile({ inputImageFile: file, outputFormat, outputWidth, outputQuality, outputAspectRatio, dialogSize });
349
355
  return croppedFile;
350
356
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudparker/moldex.js",
3
- "version": "0.0.111",
3
+ "version": "0.0.112",
4
4
  "author": "cloudparker.com",
5
5
  "license": "MIT",
6
6
  "keywords": [