@tradly/asset 1.0.8 → 1.0.10
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.
|
@@ -25,13 +25,14 @@ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; } // Helper: compr
|
|
|
25
25
|
var compressImage = function compressImage(file) {
|
|
26
26
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
27
27
|
_ref$maxWidth = _ref.maxWidth,
|
|
28
|
-
maxWidth = _ref$maxWidth === void 0 ?
|
|
28
|
+
maxWidth = _ref$maxWidth === void 0 ? 1600 : _ref$maxWidth,
|
|
29
29
|
_ref$maxHeight = _ref.maxHeight,
|
|
30
|
-
maxHeight = _ref$maxHeight === void 0 ?
|
|
30
|
+
maxHeight = _ref$maxHeight === void 0 ? 1600 : _ref$maxHeight,
|
|
31
31
|
_ref$quality = _ref.quality,
|
|
32
|
-
quality = _ref$quality === void 0 ? 0.
|
|
32
|
+
quality = _ref$quality === void 0 ? 0.9 : _ref$quality,
|
|
33
33
|
_ref$convertPngToJpeg = _ref.convertPngToJpeg,
|
|
34
34
|
convertPngToJpeg = _ref$convertPngToJpeg === void 0 ? false : _ref$convertPngToJpeg;
|
|
35
|
+
console.log("compressImage", file, maxWidth, maxHeight, quality, convertPngToJpeg);
|
|
35
36
|
return new Promise(function (resolve) {
|
|
36
37
|
// Non-image or SVG: skip compression to avoid losing vector quality
|
|
37
38
|
if (!file.type.startsWith("image/") || file.type === "image/svg+xml") {
|
|
@@ -138,7 +139,7 @@ var FileUpload = function FileUpload(_ref2) {
|
|
|
138
139
|
return compressImage(file, {
|
|
139
140
|
maxWidth: 1600,
|
|
140
141
|
maxHeight: 1600,
|
|
141
|
-
quality: 0.
|
|
142
|
+
quality: 0.9
|
|
142
143
|
});
|
|
143
144
|
}));
|
|
144
145
|
case 2:
|
|
@@ -19,13 +19,14 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
19
19
|
var compressImage = function compressImage(file) {
|
|
20
20
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
21
21
|
_ref$maxWidth = _ref.maxWidth,
|
|
22
|
-
maxWidth = _ref$maxWidth === void 0 ?
|
|
22
|
+
maxWidth = _ref$maxWidth === void 0 ? 1600 : _ref$maxWidth,
|
|
23
23
|
_ref$maxHeight = _ref.maxHeight,
|
|
24
|
-
maxHeight = _ref$maxHeight === void 0 ?
|
|
24
|
+
maxHeight = _ref$maxHeight === void 0 ? 1600 : _ref$maxHeight,
|
|
25
25
|
_ref$quality = _ref.quality,
|
|
26
|
-
quality = _ref$quality === void 0 ? 0.
|
|
26
|
+
quality = _ref$quality === void 0 ? 0.9 : _ref$quality,
|
|
27
27
|
_ref$convertPngToJpeg = _ref.convertPngToJpeg,
|
|
28
28
|
convertPngToJpeg = _ref$convertPngToJpeg === void 0 ? false : _ref$convertPngToJpeg;
|
|
29
|
+
console.log("compressImage", file, maxWidth, maxHeight, quality, convertPngToJpeg);
|
|
29
30
|
return new Promise(function (resolve) {
|
|
30
31
|
// Non-image or SVG: skip compression to avoid losing vector quality
|
|
31
32
|
if (!file.type.startsWith("image/") || file.type === "image/svg+xml") {
|
|
@@ -132,7 +133,7 @@ var FileUpload = function FileUpload(_ref2) {
|
|
|
132
133
|
return compressImage(file, {
|
|
133
134
|
maxWidth: 1600,
|
|
134
135
|
maxHeight: 1600,
|
|
135
|
-
quality: 0.
|
|
136
|
+
quality: 0.9
|
|
136
137
|
});
|
|
137
138
|
}));
|
|
138
139
|
case 2:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tradly/asset",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "A reusable media gallery component for uploading and selecting images, videos, and files with Tradly authentication",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|