@threedddplus/logoeditor 0.0.114 → 0.0.115
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.ts +0 -1
- package/dist/logoeditor.cjs.development.js +35 -106
- 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 +35 -106
- package/dist/logoeditor.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/logoeditor.esm.js
CHANGED
@@ -33,7 +33,6 @@ import Select, { components } from 'react-select';
|
|
33
33
|
import { FloatingLabel } from 'flowbite-react';
|
34
34
|
import { ChromePicker } from 'react-color';
|
35
35
|
import 'react-toastify/dist/ReactToastify.css';
|
36
|
-
import { createRoot } from 'react-dom/client';
|
37
36
|
|
38
37
|
function _regeneratorRuntime() {
|
39
38
|
_regeneratorRuntime = function () {
|
@@ -3044,7 +3043,7 @@ var fabricSlice = function fabricSlice(set, get) {
|
|
3044
3043
|
}
|
3045
3044
|
});
|
3046
3045
|
var canvas = use3dddPlus.getState().popupCanv;
|
3047
|
-
var gridSize =
|
3046
|
+
var gridSize = 83; // Size of each grid cell
|
3048
3047
|
var canvasWidth = canvas.width;
|
3049
3048
|
var canvasHeight = canvas.height;
|
3050
3049
|
var numCols = Math.ceil(canvasWidth / gridSize);
|
@@ -3999,6 +3998,9 @@ var converterSlice = function converterSlice(set, get) {
|
|
3999
3998
|
}
|
4000
3999
|
//@ts-ignore
|
4001
4000
|
var objImage = loadedObject == null ? void 0 : loadedObject._objects;
|
4001
|
+
if (!objImage) {
|
4002
|
+
objImage = [loadedObject];
|
4003
|
+
}
|
4002
4004
|
var _Fills = [];
|
4003
4005
|
var fillCounts = {};
|
4004
4006
|
var colorObjects = {};
|
@@ -4106,7 +4108,7 @@ var converterSlice = function converterSlice(set, get) {
|
|
4106
4108
|
//@ts-ignore
|
4107
4109
|
setControlVisible: false
|
4108
4110
|
});
|
4109
|
-
loadedObject.id = use3dddPlus.getState().guid();
|
4111
|
+
// loadedObject.id = use3dddPlus.getState().guid();
|
4110
4112
|
// loadedObject = new fabric.Group(objImage, options);
|
4111
4113
|
(_use3dddPlus$getState = use3dddPlus.getState().popupCanv) == null ? void 0 : _use3dddPlus$getState.clear();
|
4112
4114
|
// use3dddPlus
|
@@ -4128,7 +4130,7 @@ var converterSlice = function converterSlice(set, get) {
|
|
4128
4130
|
// }
|
4129
4131
|
// );
|
4130
4132
|
// const canvas = use3dddPlus.getState().popupCanv;
|
4131
|
-
var gridSize =
|
4133
|
+
var gridSize = 83; // Size of each grid cell
|
4132
4134
|
// var canvasWidth = canvas.width;
|
4133
4135
|
// var canvasHeight = canvas.height;
|
4134
4136
|
var numCols = Math.ceil(canvasWidth / gridSize);
|
@@ -4246,47 +4248,6 @@ var converterSlice = function converterSlice(set, get) {
|
|
4246
4248
|
});
|
4247
4249
|
},
|
4248
4250
|
processImage: processImage,
|
4249
|
-
// return new Promise((resolve, reject) => {
|
4250
|
-
// if (data) {
|
4251
|
-
// const reader = new FileReader();
|
4252
|
-
// reader.onload = async () => {
|
4253
|
-
// const buffer = reader.result;
|
4254
|
-
// try {
|
4255
|
-
// const _B = await get().convertPdfToImages(buffer);
|
4256
|
-
// resolve(_B);
|
4257
|
-
// } catch (error) {
|
4258
|
-
// reject(error);
|
4259
|
-
// }
|
4260
|
-
// };
|
4261
|
-
// reader.readAsArrayBuffer(data);
|
4262
|
-
// } else {
|
4263
|
-
// reject(new Error('No data provided.'));
|
4264
|
-
// }
|
4265
|
-
// });
|
4266
|
-
// },
|
4267
|
-
// convertPdfToImages: async (buffer) => {
|
4268
|
-
// const pdf = await pdfjsLib.getDocument({ data: new Uint8Array(buffer) })
|
4269
|
-
// .promise;
|
4270
|
-
// const scale = 2;
|
4271
|
-
// for (let pageNum = 1; pageNum <= pdf.numPages; pageNum++) {
|
4272
|
-
// const page = await pdf.getPage(pageNum);
|
4273
|
-
// const viewport = page.getViewport({ scale });
|
4274
|
-
// const canvasEl = document.createElement('canvas');
|
4275
|
-
// canvasEl.width = viewport.width;
|
4276
|
-
// canvasEl.height = viewport.height;
|
4277
|
-
// const context = canvasEl.getContext('2d');
|
4278
|
-
// await page.render({
|
4279
|
-
// canvasContext: context,
|
4280
|
-
// viewport,
|
4281
|
-
// background: 'rgba(0,0,0,0)',
|
4282
|
-
// }).promise;
|
4283
|
-
// // let objectURL = URL.createObjectURL(canvasEl);
|
4284
|
-
// const imageUrl = canvasEl.toDataURL();
|
4285
|
-
// return imageUrl;
|
4286
|
-
// // svgConverter(imageUrl);
|
4287
|
-
// /* */
|
4288
|
-
// }
|
4289
|
-
// },
|
4290
4251
|
tiffConvert: function () {
|
4291
4252
|
var _tiffConvert = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
|
4292
4253
|
var tiffParser, canvasEl, arrayBuffer, tiffCanvas, imageUrl;
|
@@ -4440,27 +4401,6 @@ var converterSlice = function converterSlice(set, get) {
|
|
4440
4401
|
changeSVGColor: function changeSVGColor(property, color) {
|
4441
4402
|
use3dddPlus.getState().popUpCanvasUpdateModification(true);
|
4442
4403
|
var fillColor = _extends({}, use3dddPlus.getState().colorFill);
|
4443
|
-
// const previousColor = fillColor[property];
|
4444
|
-
//const SelectedObjet = use3dddPlus.getState().activeSelection;
|
4445
|
-
// console.log("Color_CHANGING--->",SelectedObjet.colorFill);
|
4446
|
-
// let _newObj = SelectedObjet.colorFill;
|
4447
|
-
/* Object.entries(_newObj).forEach(([key, value]) => {
|
4448
|
-
if(`${value}` === previousColor){
|
4449
|
-
console.log(`${key}: ${value}` , previousColor);
|
4450
|
-
_newObj[`${key}`] = color;
|
4451
|
-
}
|
4452
|
-
// console.log(`${key}: ${value}`)
|
4453
|
-
});*/
|
4454
|
-
// const sel = new fabric.ActiveSelection(popupCanvas.getObjects(), {
|
4455
|
-
// popupCanvas: popupCanvas,
|
4456
|
-
// });
|
4457
|
-
// popupCanvas.setActiveObject(sel);
|
4458
|
-
// popupCanvas.requestRenderAll();
|
4459
|
-
// let objImage = SelectedObjet._objects;if(use3dddPlus.getState().popupCanv.getActiveObject()){
|
4460
|
-
// if(use3dddPlus.getState().popupCanv.getActiveObject()){
|
4461
|
-
// let objImage = use3dddPlus
|
4462
|
-
// .getState()
|
4463
|
-
// .popupCanv.getActiveObject()._objects;
|
4464
4404
|
if (use3dddPlus.getState().loadedObject) {
|
4465
4405
|
// let objImage1 = use3dddPlus.getState().popupCanv.getObjects();
|
4466
4406
|
var objImage = use3dddPlus.getState().popupCanv.getObjects();
|
@@ -6947,7 +6887,7 @@ var PopUpCanvas = function PopUpCanvas() {
|
|
6947
6887
|
}
|
6948
6888
|
});
|
6949
6889
|
var canvas = use3dddPlus.getState().popupCanv;
|
6950
|
-
var gridSize =
|
6890
|
+
var gridSize = 83; // Size of each grid cell
|
6951
6891
|
var canvasWidth = canvas.width;
|
6952
6892
|
var canvasHeight = canvas.height;
|
6953
6893
|
var numCols = Math.ceil(canvasWidth / gridSize);
|
@@ -7166,7 +7106,7 @@ var PopUpCanvas = function PopUpCanvas() {
|
|
7166
7106
|
className: "border border-[#E11A38] p-1 bg-white mr-2 text-[#E11A38] "
|
7167
7107
|
}, React.createElement(EyeDropper, null)), React.createElement("span", {
|
7168
7108
|
className: "text-[#E11A38] text-[13px] font-bold "
|
7169
|
-
}, "Use the eyedropper tool
|
7109
|
+
}, "Use the eyedropper tool by clicking on a color you wish to remove from your image.")))), React.createElement("div", {
|
7170
7110
|
className: "text-left flex-1 h-[100%] px-[25px] pt-[31px] pb-[5px] w-[30%]"
|
7171
7111
|
}, React.createElement("div", {
|
7172
7112
|
className: "flex flex-col gap-y-3 h-full"
|
@@ -9258,7 +9198,7 @@ var Properties = function Properties(_ref2) {
|
|
9258
9198
|
_context5.next = 42;
|
9259
9199
|
break;
|
9260
9200
|
}
|
9261
|
-
if (!(textSelected.text
|
9201
|
+
if (!(textSelected.text == '' || textSelected.text.trim() == '')) {
|
9262
9202
|
_context5.next = 27;
|
9263
9203
|
break;
|
9264
9204
|
}
|
@@ -9325,7 +9265,7 @@ var Properties = function Properties(_ref2) {
|
|
9325
9265
|
return _context5.abrupt("return");
|
9326
9266
|
case 48:
|
9327
9267
|
_context5.t0 = shapeType;
|
9328
|
-
_context5.next = _context5.t0 === 'None' ? 51 : _context5.t0 === 'Arc' ?
|
9268
|
+
_context5.next = _context5.t0 === 'None' ? 51 : _context5.t0 === 'Arc' ? 76 : _context5.t0 === 'Bridge' ? 80 : _context5.t0 === 'Bowtie' ? 85 : _context5.t0 === 'Vertical Arch' ? 90 : _context5.t0 === 'Reverse Vertical Arch' ? 94 : 98;
|
9329
9269
|
break;
|
9330
9270
|
case 51:
|
9331
9271
|
setShapeSizeVal(0);
|
@@ -9356,13 +9296,15 @@ var Properties = function Properties(_ref2) {
|
|
9356
9296
|
colorFill: textSelected.colorFill,
|
9357
9297
|
fontWeight: fontWeight
|
9358
9298
|
});
|
9359
|
-
_text.left = textSelected.left;
|
9360
|
-
_text.top = textSelected.top;
|
9361
9299
|
_text.scaleX = textSelected.scaleX * (textSelected.width / _text.width);
|
9362
9300
|
_text.scaleY = textSelected.scaleY * (textSelected.width / _text.width);
|
9363
9301
|
window['textObj'] = _text;
|
9364
9302
|
_text.setCoords();
|
9365
9303
|
_text.id = textSelected.id;
|
9304
|
+
// set rotation angle & position
|
9305
|
+
_text.rotate(textSelected.angle);
|
9306
|
+
_text.left = textSelected.left;
|
9307
|
+
_text.top = textSelected.top;
|
9366
9308
|
// delete the active text object
|
9367
9309
|
canvas.remove(textSelected);
|
9368
9310
|
textSelected._removeCacheCanvas();
|
@@ -9385,15 +9327,15 @@ var Properties = function Properties(_ref2) {
|
|
9385
9327
|
canvas.renderAll();
|
9386
9328
|
// cancel performing further functions & return back from function
|
9387
9329
|
return _context5.abrupt("return");
|
9388
|
-
case
|
9330
|
+
case 76:
|
9389
9331
|
setShapeSizeVal(50);
|
9390
9332
|
textSelected.shapeType = 'Arc';
|
9391
9333
|
p.warp({
|
9392
9334
|
type: 'WARP_ARC',
|
9393
9335
|
bend: 50 / 100
|
9394
9336
|
});
|
9395
|
-
return _context5.abrupt("break",
|
9396
|
-
case
|
9337
|
+
return _context5.abrupt("break", 99);
|
9338
|
+
case 80:
|
9397
9339
|
setShapeSizeVal(-25);
|
9398
9340
|
bridgeShapeChange();
|
9399
9341
|
textSelected.shapeType = 'Bridge';
|
@@ -9401,8 +9343,8 @@ var Properties = function Properties(_ref2) {
|
|
9401
9343
|
type: 'WARP_ARC_LOWER',
|
9402
9344
|
bend: bridgeshapeBendSize / 100 || 0
|
9403
9345
|
});
|
9404
|
-
return _context5.abrupt("break",
|
9405
|
-
case
|
9346
|
+
return _context5.abrupt("break", 99);
|
9347
|
+
case 85:
|
9406
9348
|
setShapeSizeVal(-12);
|
9407
9349
|
bridgeShapeChange();
|
9408
9350
|
textSelected.shapeType = 'Bowtie';
|
@@ -9410,26 +9352,26 @@ var Properties = function Properties(_ref2) {
|
|
9410
9352
|
type: 'WARP_BULGE',
|
9411
9353
|
bend: bowtieshapeBendSize / 100 || 0
|
9412
9354
|
});
|
9413
|
-
return _context5.abrupt("break",
|
9414
|
-
case
|
9355
|
+
return _context5.abrupt("break", 99);
|
9356
|
+
case 90:
|
9415
9357
|
setShapeSizeVal(35);
|
9416
9358
|
textSelected.shapeType = 'Vertical Arch';
|
9417
9359
|
p.warp({
|
9418
9360
|
type: 'WARP_ARCH',
|
9419
9361
|
bend: 35 / 100
|
9420
9362
|
});
|
9421
|
-
return _context5.abrupt("break",
|
9422
|
-
case
|
9363
|
+
return _context5.abrupt("break", 99);
|
9364
|
+
case 94:
|
9423
9365
|
setShapeSizeVal(-35);
|
9424
9366
|
textSelected.shapeType = 'Reverse Vertical Arch';
|
9425
9367
|
p.warp({
|
9426
9368
|
type: 'WARP_ARCH',
|
9427
9369
|
bend: -35 / 100
|
9428
9370
|
});
|
9429
|
-
return _context5.abrupt("break",
|
9430
|
-
case 97:
|
9431
|
-
return _context5.abrupt("break", 98);
|
9371
|
+
return _context5.abrupt("break", 99);
|
9432
9372
|
case 98:
|
9373
|
+
return _context5.abrupt("break", 99);
|
9374
|
+
case 99:
|
9433
9375
|
// take out the update path with shape type deformation
|
9434
9376
|
fabricPath = new fabric.Path(p.output());
|
9435
9377
|
textSelected['pathData'] = pathData;
|
@@ -9456,8 +9398,6 @@ var Properties = function Properties(_ref2) {
|
|
9456
9398
|
fabricPath['id'] = textSelected.id;
|
9457
9399
|
//@ts-ignore
|
9458
9400
|
dims = fabricPath._calcDimensions(); // Set the same position scale matching with existing text
|
9459
|
-
fabricPath.left = textSelected.left;
|
9460
|
-
fabricPath.top = textSelected.top;
|
9461
9401
|
fabricPath.width = textSelected.width;
|
9462
9402
|
fabricPath.height = textSelected.height;
|
9463
9403
|
fabricPath.scaleX = textSelected.scaleX * (textSelected.width / dims.width);
|
@@ -9465,8 +9405,10 @@ var Properties = function Properties(_ref2) {
|
|
9465
9405
|
fabricPath.setCoords();
|
9466
9406
|
fabricPath.width = dims.width;
|
9467
9407
|
fabricPath.height = dims.height;
|
9468
|
-
//
|
9469
|
-
|
9408
|
+
// set rotation angle & position
|
9409
|
+
fabricPath.rotate(textSelected.angle);
|
9410
|
+
fabricPath.left = textSelected.left;
|
9411
|
+
fabricPath.top = textSelected.top;
|
9470
9412
|
// delete the text object
|
9471
9413
|
canvas.remove(textSelected);
|
9472
9414
|
// set active object as path text
|
@@ -9498,8 +9440,6 @@ var Properties = function Properties(_ref2) {
|
|
9498
9440
|
newTextPath['fontStyle'] = textSelected.fontStyle;
|
9499
9441
|
newTextPath['text'] = textSelected.text;
|
9500
9442
|
// set same position & scale
|
9501
|
-
newTextPath['left'] = textSelected.left;
|
9502
|
-
newTextPath['top'] = textSelected.top;
|
9503
9443
|
newTextPath['width'] = textSelected.width;
|
9504
9444
|
newTextPath['height'] = textSelected.height;
|
9505
9445
|
//@ts-ignore
|
@@ -9507,6 +9447,10 @@ var Properties = function Properties(_ref2) {
|
|
9507
9447
|
newTextPath['scaleX'] = textSelected.scaleX * (textSelected.width / _dims.width);
|
9508
9448
|
newTextPath['scaleY'] = textSelected.scaleY * (textSelected.width / _dims.width);
|
9509
9449
|
newTextPath['id'] = textSelected.id;
|
9450
|
+
// set rotation angle & position
|
9451
|
+
newTextPath.rotate(textSelected.angle);
|
9452
|
+
newTextPath['left'] = textSelected.left;
|
9453
|
+
newTextPath['top'] = textSelected.top;
|
9510
9454
|
// delete the active text object
|
9511
9455
|
activeObj = canvas.getActiveObject();
|
9512
9456
|
canvas.remove(activeObj);
|
@@ -9529,7 +9473,7 @@ var Properties = function Properties(_ref2) {
|
|
9529
9473
|
}
|
9530
9474
|
canvas.renderAll();
|
9531
9475
|
reduceFontSize();
|
9532
|
-
case
|
9476
|
+
case 104:
|
9533
9477
|
case "end":
|
9534
9478
|
return _context5.stop();
|
9535
9479
|
}
|
@@ -14785,20 +14729,5 @@ var LogoEditor = function LogoEditor(_ref) {
|
|
14785
14729
|
}))));
|
14786
14730
|
};
|
14787
14731
|
|
14788
|
-
var container = /*#__PURE__*/document.getElementById('root');
|
14789
|
-
var root = /*#__PURE__*/createRoot(container); // createRoot(container!) if you use TypeScript
|
14790
|
-
root.render(React.createElement(LogoEditor, {
|
14791
|
-
stepperId: 1,
|
14792
|
-
onApply: undefined,
|
14793
|
-
customLogoColorList: undefined,
|
14794
|
-
defaultColorList: undefined,
|
14795
|
-
logoData: undefined,
|
14796
|
-
customerId: undefined,
|
14797
|
-
onSaveLogo: undefined,
|
14798
|
-
onClose: function onClose() {
|
14799
|
-
console.log('1212i');
|
14800
|
-
}
|
14801
|
-
}));
|
14802
|
-
|
14803
14732
|
export { index$1 as Components, LogoEditor, index as services, use3dddPlus };
|
14804
14733
|
//# sourceMappingURL=logoeditor.esm.js.map
|