@threedddplus/logoeditor 0.0.122 → 0.0.123
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/logoeditor.cjs.development.js +25 -18
- package/dist/logoeditor.cjs.development.js.map +1 -1
- package/dist/logoeditor.cjs.production.min.js +1 -1
- package/dist/logoeditor.cjs.production.min.js.map +1 -1
- package/dist/logoeditor.esm.js +25 -18
- package/dist/logoeditor.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/logoeditor.esm.js
CHANGED
@@ -7341,7 +7341,7 @@ var UploadLogo = function UploadLogo() {
|
|
7341
7341
|
|
7342
7342
|
var svgConverter = /*#__PURE__*/function () {
|
7343
7343
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
|
7344
|
-
var ext, tiffData, aiToSvg, formData, response;
|
7344
|
+
var ext, tiffData, aiToSvg, formData, response, blob, imageUrl;
|
7345
7345
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
7346
7346
|
while (1) switch (_context.prev = _context.next) {
|
7347
7347
|
case 0:
|
@@ -7355,7 +7355,7 @@ var UploadLogo = function UploadLogo() {
|
|
7355
7355
|
break;
|
7356
7356
|
}
|
7357
7357
|
imageToSVG(data, ext, true);
|
7358
|
-
_context.next =
|
7358
|
+
_context.next = 36;
|
7359
7359
|
break;
|
7360
7360
|
case 6:
|
7361
7361
|
if (!(ext === 'tif' || ext === 'tiff')) {
|
@@ -7367,7 +7367,7 @@ var UploadLogo = function UploadLogo() {
|
|
7367
7367
|
case 9:
|
7368
7368
|
tiffData = _context.sent;
|
7369
7369
|
imageToSVG(tiffData, ext);
|
7370
|
-
_context.next =
|
7370
|
+
_context.next = 36;
|
7371
7371
|
break;
|
7372
7372
|
case 13:
|
7373
7373
|
if (!(ext === 'ai' || ext === 'pdf')) {
|
@@ -7391,7 +7391,7 @@ var UploadLogo = function UploadLogo() {
|
|
7391
7391
|
loading: false
|
7392
7392
|
});
|
7393
7393
|
});
|
7394
|
-
_context.next =
|
7394
|
+
_context.next = 36;
|
7395
7395
|
break;
|
7396
7396
|
case 21:
|
7397
7397
|
formData = new FormData();
|
@@ -7408,27 +7408,34 @@ var UploadLogo = function UploadLogo() {
|
|
7408
7408
|
.then((res) => {console.log(res);})
|
7409
7409
|
.catch((err) => {console.log(err)});*/
|
7410
7410
|
_context.next = 25;
|
7411
|
-
return fetch('https://
|
7411
|
+
return fetch('https://imagesharpher-f4b4o225iq-ue.a.run.app/upload', {
|
7412
7412
|
method: 'POST',
|
7413
|
-
headers:
|
7414
|
-
user: 'vks34swmmj4s8wg',
|
7415
|
-
pass: 'f9ivolvk1mc5khc7ja53bp2rst5d4cuk5q02oqfoj3mn1ag3sig2'
|
7416
|
-
}
|
7413
|
+
/*headers :{
|
7414
|
+
user: 'vks34swmmj4s8wg',
|
7415
|
+
pass: 'f9ivolvk1mc5khc7ja53bp2rst5d4cuk5q02oqfoj3mn1ag3sig2',
|
7416
|
+
},*/
|
7417
7417
|
body: formData
|
7418
7418
|
});
|
7419
7419
|
case 25:
|
7420
7420
|
response = _context.sent;
|
7421
|
-
if (response.ok) {
|
7422
|
-
|
7423
|
-
|
7424
|
-
// const imageUrl = URL.createObjectURL(blob);
|
7425
|
-
// imageToSVG(imageUrl, ext);
|
7426
|
-
} else {
|
7427
|
-
alert('Failed to process the image');
|
7421
|
+
if (!response.ok) {
|
7422
|
+
_context.next = 35;
|
7423
|
+
break;
|
7428
7424
|
}
|
7429
|
-
|
7425
|
+
console.log(response);
|
7426
|
+
_context.next = 30;
|
7427
|
+
return response.blob();
|
7428
|
+
case 30:
|
7429
|
+
blob = _context.sent;
|
7430
|
+
imageUrl = URL.createObjectURL(blob);
|
7431
|
+
imageToSVG(imageUrl, ext);
|
7432
|
+
_context.next = 36;
|
7433
|
+
break;
|
7434
|
+
case 35:
|
7435
|
+
alert('Failed to process the image');
|
7436
|
+
case 36:
|
7430
7437
|
setSelectedFile(null);
|
7431
|
-
case
|
7438
|
+
case 37:
|
7432
7439
|
case "end":
|
7433
7440
|
return _context.stop();
|
7434
7441
|
}
|