@scalably/ui 0.11.2 → 0.11.4
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.cts +25 -6
- package/dist/index.d.ts +25 -6
- package/dist/index.esm.js +20 -20
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +20 -20
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1099,7 +1099,9 @@ interface FileUploadProps {
|
|
|
1099
1099
|
imageCropAspect?: number;
|
|
1100
1100
|
/**
|
|
1101
1101
|
* Called when an image is cropped.
|
|
1102
|
-
* Provides the cropped Blob
|
|
1102
|
+
* Provides the cropped Blob and a data URL for immediate preview.
|
|
1103
|
+
* By default, the cropper preserves the source format when possible
|
|
1104
|
+
* (e.g. PNG stays PNG; JPEG stays JPEG).
|
|
1103
1105
|
*
|
|
1104
1106
|
* **Note:** When using custom zone sizing with `className`, update the file's
|
|
1105
1107
|
* `preview` property with the `dataUrl` to ensure the preview renders at the
|
|
@@ -1173,10 +1175,20 @@ interface ImageCropModalProps {
|
|
|
1173
1175
|
onClose: () => void;
|
|
1174
1176
|
/** Image source (File object URL or data URL) */
|
|
1175
1177
|
imageSrc: string;
|
|
1178
|
+
/**
|
|
1179
|
+
* MIME type of the source image when known (e.g. from an input `File.type`).
|
|
1180
|
+
* Used to preserve the original format on export when possible.
|
|
1181
|
+
*/
|
|
1182
|
+
sourceMimeType?: string;
|
|
1176
1183
|
/** Aspect ratio constraint (width/height), undefined = free */
|
|
1177
1184
|
aspect?: number;
|
|
1178
1185
|
/** Called when crop is confirmed with final result */
|
|
1179
1186
|
onConfirm: (croppedBlob: Blob, dataUrl: string) => void;
|
|
1187
|
+
/**
|
|
1188
|
+
* Optional action to explicitly keep the original image (no crop).
|
|
1189
|
+
* If provided, a "Use original" button will be shown in the footer.
|
|
1190
|
+
*/
|
|
1191
|
+
onUseOriginal?: () => void;
|
|
1180
1192
|
/** Crop shape */
|
|
1181
1193
|
cropShape?: "rect" | "round";
|
|
1182
1194
|
/** Show grid overlay */
|
|
@@ -1184,6 +1196,7 @@ interface ImageCropModalProps {
|
|
|
1184
1196
|
/** Customizable content */
|
|
1185
1197
|
title?: string;
|
|
1186
1198
|
cancelButtonText?: string;
|
|
1199
|
+
useOriginalButtonText?: string;
|
|
1187
1200
|
saveButtonText?: string;
|
|
1188
1201
|
}
|
|
1189
1202
|
/**
|
|
@@ -1191,7 +1204,7 @@ interface ImageCropModalProps {
|
|
|
1191
1204
|
* Manages all crop state and generates the final Blob only when the user clicks "Save".
|
|
1192
1205
|
*/
|
|
1193
1206
|
declare const ImageCropModal: {
|
|
1194
|
-
({ isOpen, onClose, imageSrc, aspect, onConfirm, cropShape, showGrid, title, cancelButtonText, saveButtonText, }: ImageCropModalProps): react_jsx_runtime.JSX.Element | null;
|
|
1207
|
+
({ isOpen, onClose, imageSrc, sourceMimeType, aspect, onConfirm, onUseOriginal, cropShape, showGrid, title, cancelButtonText, useOriginalButtonText, saveButtonText, }: ImageCropModalProps): react_jsx_runtime.JSX.Element | null;
|
|
1195
1208
|
displayName: string;
|
|
1196
1209
|
};
|
|
1197
1210
|
|
|
@@ -1211,8 +1224,8 @@ interface GetCroppedImgOptions {
|
|
|
1211
1224
|
vertical: boolean;
|
|
1212
1225
|
};
|
|
1213
1226
|
/** Output image format (default: 'image/jpeg') */
|
|
1214
|
-
outputFormat?: "image/jpeg" | "image/png";
|
|
1215
|
-
/** Output quality for JPEG (0-1, default:
|
|
1227
|
+
outputFormat?: "image/jpeg" | "image/png" | "image/webp";
|
|
1228
|
+
/** Output quality for JPEG/WebP (0-1, default: 1). Ignored for PNG. */
|
|
1216
1229
|
outputQuality?: number;
|
|
1217
1230
|
}
|
|
1218
1231
|
/**
|
|
@@ -1238,7 +1251,7 @@ interface CroppedImageResult {
|
|
|
1238
1251
|
* pixelCrop: { x: 100, y: 100, width: 300, height: 300 },
|
|
1239
1252
|
* rotation: 90,
|
|
1240
1253
|
* outputFormat: 'image/jpeg',
|
|
1241
|
-
* outputQuality:
|
|
1254
|
+
* outputQuality: 1
|
|
1242
1255
|
* });
|
|
1243
1256
|
* if (result) {
|
|
1244
1257
|
* // Use result.blob for upload
|
|
@@ -2874,6 +2887,12 @@ interface RichTextEditorProps {
|
|
|
2874
2887
|
* user can then confirm insertion with "Save".
|
|
2875
2888
|
*/
|
|
2876
2889
|
onImageUpload?: (file: File) => Promise<string>;
|
|
2890
|
+
/**
|
|
2891
|
+
* Message shown when `onImageUpload` fails. Use a string for fixed copy, or
|
|
2892
|
+
* a function `(error) => string` to derive text from the rejection reason.
|
|
2893
|
+
* When omitted, the editor uses a default English message.
|
|
2894
|
+
*/
|
|
2895
|
+
imageUploadErrorMessage?: string | ((error: unknown) => string);
|
|
2877
2896
|
/**
|
|
2878
2897
|
* Controls how users are allowed to provide image sources.
|
|
2879
2898
|
*
|
|
@@ -3059,7 +3078,7 @@ interface RichTextEditorProps {
|
|
|
3059
3078
|
* @see RichTextViewer - Read-only viewer component for displaying rich text content
|
|
3060
3079
|
*/
|
|
3061
3080
|
declare const RichTextEditor: {
|
|
3062
|
-
({ value, onChange, label, error, helperText, placeholder, minHeight, simple, disabled, "data-testid": dataTestId, containerClassName, borderContainerClassName, toolbarClassName, contentClassName, editorClassName, labelClassName, messageContainerClassName, onImageUpload, imageSourceMode, maxCharacters, onMaxLengthExceed, immediatelyRender, stickyToolbar, stickyOffset, hideToolbar, withBorder, enableBubbleMenu, enableFloatingMenu, floatingMenuTriggers, plusMenuYOffset, }: RichTextEditorProps): react_jsx_runtime.JSX.Element;
|
|
3081
|
+
({ value, onChange, label, error, helperText, placeholder, minHeight, simple, disabled, "data-testid": dataTestId, containerClassName, borderContainerClassName, toolbarClassName, contentClassName, editorClassName, labelClassName, messageContainerClassName, onImageUpload, imageUploadErrorMessage, imageSourceMode, maxCharacters, onMaxLengthExceed, immediatelyRender, stickyToolbar, stickyOffset, hideToolbar, withBorder, enableBubbleMenu, enableFloatingMenu, floatingMenuTriggers, plusMenuYOffset, }: RichTextEditorProps): react_jsx_runtime.JSX.Element;
|
|
3063
3082
|
displayName: string;
|
|
3064
3083
|
};
|
|
3065
3084
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1099,7 +1099,9 @@ interface FileUploadProps {
|
|
|
1099
1099
|
imageCropAspect?: number;
|
|
1100
1100
|
/**
|
|
1101
1101
|
* Called when an image is cropped.
|
|
1102
|
-
* Provides the cropped Blob
|
|
1102
|
+
* Provides the cropped Blob and a data URL for immediate preview.
|
|
1103
|
+
* By default, the cropper preserves the source format when possible
|
|
1104
|
+
* (e.g. PNG stays PNG; JPEG stays JPEG).
|
|
1103
1105
|
*
|
|
1104
1106
|
* **Note:** When using custom zone sizing with `className`, update the file's
|
|
1105
1107
|
* `preview` property with the `dataUrl` to ensure the preview renders at the
|
|
@@ -1173,10 +1175,20 @@ interface ImageCropModalProps {
|
|
|
1173
1175
|
onClose: () => void;
|
|
1174
1176
|
/** Image source (File object URL or data URL) */
|
|
1175
1177
|
imageSrc: string;
|
|
1178
|
+
/**
|
|
1179
|
+
* MIME type of the source image when known (e.g. from an input `File.type`).
|
|
1180
|
+
* Used to preserve the original format on export when possible.
|
|
1181
|
+
*/
|
|
1182
|
+
sourceMimeType?: string;
|
|
1176
1183
|
/** Aspect ratio constraint (width/height), undefined = free */
|
|
1177
1184
|
aspect?: number;
|
|
1178
1185
|
/** Called when crop is confirmed with final result */
|
|
1179
1186
|
onConfirm: (croppedBlob: Blob, dataUrl: string) => void;
|
|
1187
|
+
/**
|
|
1188
|
+
* Optional action to explicitly keep the original image (no crop).
|
|
1189
|
+
* If provided, a "Use original" button will be shown in the footer.
|
|
1190
|
+
*/
|
|
1191
|
+
onUseOriginal?: () => void;
|
|
1180
1192
|
/** Crop shape */
|
|
1181
1193
|
cropShape?: "rect" | "round";
|
|
1182
1194
|
/** Show grid overlay */
|
|
@@ -1184,6 +1196,7 @@ interface ImageCropModalProps {
|
|
|
1184
1196
|
/** Customizable content */
|
|
1185
1197
|
title?: string;
|
|
1186
1198
|
cancelButtonText?: string;
|
|
1199
|
+
useOriginalButtonText?: string;
|
|
1187
1200
|
saveButtonText?: string;
|
|
1188
1201
|
}
|
|
1189
1202
|
/**
|
|
@@ -1191,7 +1204,7 @@ interface ImageCropModalProps {
|
|
|
1191
1204
|
* Manages all crop state and generates the final Blob only when the user clicks "Save".
|
|
1192
1205
|
*/
|
|
1193
1206
|
declare const ImageCropModal: {
|
|
1194
|
-
({ isOpen, onClose, imageSrc, aspect, onConfirm, cropShape, showGrid, title, cancelButtonText, saveButtonText, }: ImageCropModalProps): react_jsx_runtime.JSX.Element | null;
|
|
1207
|
+
({ isOpen, onClose, imageSrc, sourceMimeType, aspect, onConfirm, onUseOriginal, cropShape, showGrid, title, cancelButtonText, useOriginalButtonText, saveButtonText, }: ImageCropModalProps): react_jsx_runtime.JSX.Element | null;
|
|
1195
1208
|
displayName: string;
|
|
1196
1209
|
};
|
|
1197
1210
|
|
|
@@ -1211,8 +1224,8 @@ interface GetCroppedImgOptions {
|
|
|
1211
1224
|
vertical: boolean;
|
|
1212
1225
|
};
|
|
1213
1226
|
/** Output image format (default: 'image/jpeg') */
|
|
1214
|
-
outputFormat?: "image/jpeg" | "image/png";
|
|
1215
|
-
/** Output quality for JPEG (0-1, default:
|
|
1227
|
+
outputFormat?: "image/jpeg" | "image/png" | "image/webp";
|
|
1228
|
+
/** Output quality for JPEG/WebP (0-1, default: 1). Ignored for PNG. */
|
|
1216
1229
|
outputQuality?: number;
|
|
1217
1230
|
}
|
|
1218
1231
|
/**
|
|
@@ -1238,7 +1251,7 @@ interface CroppedImageResult {
|
|
|
1238
1251
|
* pixelCrop: { x: 100, y: 100, width: 300, height: 300 },
|
|
1239
1252
|
* rotation: 90,
|
|
1240
1253
|
* outputFormat: 'image/jpeg',
|
|
1241
|
-
* outputQuality:
|
|
1254
|
+
* outputQuality: 1
|
|
1242
1255
|
* });
|
|
1243
1256
|
* if (result) {
|
|
1244
1257
|
* // Use result.blob for upload
|
|
@@ -2874,6 +2887,12 @@ interface RichTextEditorProps {
|
|
|
2874
2887
|
* user can then confirm insertion with "Save".
|
|
2875
2888
|
*/
|
|
2876
2889
|
onImageUpload?: (file: File) => Promise<string>;
|
|
2890
|
+
/**
|
|
2891
|
+
* Message shown when `onImageUpload` fails. Use a string for fixed copy, or
|
|
2892
|
+
* a function `(error) => string` to derive text from the rejection reason.
|
|
2893
|
+
* When omitted, the editor uses a default English message.
|
|
2894
|
+
*/
|
|
2895
|
+
imageUploadErrorMessage?: string | ((error: unknown) => string);
|
|
2877
2896
|
/**
|
|
2878
2897
|
* Controls how users are allowed to provide image sources.
|
|
2879
2898
|
*
|
|
@@ -3059,7 +3078,7 @@ interface RichTextEditorProps {
|
|
|
3059
3078
|
* @see RichTextViewer - Read-only viewer component for displaying rich text content
|
|
3060
3079
|
*/
|
|
3061
3080
|
declare const RichTextEditor: {
|
|
3062
|
-
({ value, onChange, label, error, helperText, placeholder, minHeight, simple, disabled, "data-testid": dataTestId, containerClassName, borderContainerClassName, toolbarClassName, contentClassName, editorClassName, labelClassName, messageContainerClassName, onImageUpload, imageSourceMode, maxCharacters, onMaxLengthExceed, immediatelyRender, stickyToolbar, stickyOffset, hideToolbar, withBorder, enableBubbleMenu, enableFloatingMenu, floatingMenuTriggers, plusMenuYOffset, }: RichTextEditorProps): react_jsx_runtime.JSX.Element;
|
|
3081
|
+
({ value, onChange, label, error, helperText, placeholder, minHeight, simple, disabled, "data-testid": dataTestId, containerClassName, borderContainerClassName, toolbarClassName, contentClassName, editorClassName, labelClassName, messageContainerClassName, onImageUpload, imageUploadErrorMessage, imageSourceMode, maxCharacters, onMaxLengthExceed, immediatelyRender, stickyToolbar, stickyOffset, hideToolbar, withBorder, enableBubbleMenu, enableFloatingMenu, floatingMenuTriggers, plusMenuYOffset, }: RichTextEditorProps): react_jsx_runtime.JSX.Element;
|
|
3063
3082
|
displayName: string;
|
|
3064
3083
|
};
|
|
3065
3084
|
|