@threedddplus/logoeditor 0.0.49 → 0.0.51

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.
@@ -2293,6 +2293,7 @@ var fabricSlice = function fabricSlice(set, get) {
2293
2293
  nameCounter: 0,
2294
2294
  duplicateObject: function duplicateObject() {
2295
2295
  if (get().fabricCanvas.getActiveObject()) {
2296
+ var activeObj = get().fabricCanvas.getActiveObject();
2296
2297
  var clipboard;
2297
2298
  get().fabricCanvas.getActiveObject().clone(function (cloned) {
2298
2299
  clipboard = cloned;
@@ -2300,35 +2301,37 @@ var fabricSlice = function fabricSlice(set, get) {
2300
2301
  clipboard.clone(function (clonedObj) {
2301
2302
  get().fabricCanvas.discardActiveObject();
2302
2303
  clonedObj.set({
2303
- left: clonedObj.left + 20,
2304
- top: clonedObj.top + 20,
2305
2304
  evented: true
2306
2305
  });
2307
2306
  if (clonedObj.type === 'activeSelection') {
2308
2307
  clonedObj.canvas = get().fabricCanvas;
2309
- clonedObj.forEachObject(function (obj) {
2308
+ clonedObj.forEachObject(function (obj, index) {
2309
+ obj.colorFill = activeObj._objects[index].colorFill;
2310
2310
  get().fabricCanvas.add(obj);
2311
2311
  });
2312
2312
  clonedObj.setCoords();
2313
2313
  } else {
2314
+ clonedObj.colorFill = activeObj.colorFill;
2314
2315
  get().fabricCanvas.add(clonedObj);
2315
2316
  }
2316
2317
  clipboard.top += 20;
2317
2318
  clipboard.left += 20;
2318
- // get().fabricCanvas.setActiveObject(clonedObj);
2319
+ get().fabricCanvas.setActiveObject(clonedObj);
2320
+ clonedObj.set({
2321
+ left: clonedObj.left + 20,
2322
+ top: clonedObj.top + 20
2323
+ });
2319
2324
  // get().fabricCanvas.requestRenderAll();
2320
2325
  // clonedObj._objects.map((data) => {
2321
2326
  // get().forStoringAllObject(data);
2322
2327
  // });
2323
2328
  if (clipboard && clipboard._objects && clipboard._objects.length > 0 && clipboard._objects[0]._objects || clipboard._objects && clipboard._objects[0].type === "text") {
2324
2329
  clonedObj._objects.map(function (data) {
2325
- data.icon = use3dddPlus.getState().iconImage;
2330
+ data.icon = data.toDataURL('image/png');
2326
2331
  get().forStoringAllObject(data);
2327
2332
  });
2328
- } else if (clonedObj._objects && clipboard._objects.length > 0) {
2329
- clonedObj._objects[0].icon = use3dddPlus.getState().iconImage;
2330
- get().forStoringAllObject(clonedObj._objects[0]);
2331
2333
  } else {
2334
+ use3dddPlus.getState().forIconCapture();
2332
2335
  clonedObj.icon = use3dddPlus.getState().iconImage;
2333
2336
  get().forStoringAllObject(clonedObj);
2334
2337
  }
@@ -3527,7 +3530,7 @@ var converterSlice = function converterSlice(set, get) {
3527
3530
  // .getState()
3528
3531
  // .popupCanv.getActiveObject()._objects;
3529
3532
  if (use3dddPlus.getState().loadedObject) {
3530
- var objImage = use3dddPlus.getState().loadedObject;
3533
+ var objImage = use3dddPlus.getState().popupCanv.getObjects();
3531
3534
  objImage.forEach(function (ele) {
3532
3535
  var _C = ele.fill === 'transparent' ? ele.fill : ele.fill.includes('#') ? ele.fill : get().RGBToHex(ele.fill);
3533
3536
  if (_C === previousColor) {
@@ -4098,7 +4101,7 @@ var initCanvas = function initCanvas() {
4098
4101
  use3dddPlus.setState({
4099
4102
  activeSelection: canv.getActiveObject()
4100
4103
  });
4101
- canv.getActiveObject().viewportCenter();
4104
+ // canv.getActiveObject().viewportCenter();
4102
4105
  getAllColors();
4103
4106
  };
4104
4107
  var onObjectDeselected = function onObjectDeselected() {
@@ -5109,7 +5112,7 @@ var ToolTip = function ToolTip(_ref) {
5109
5112
  placement: 'top'
5110
5113
  });
5111
5114
  return React.createElement(React.Fragment, null, React.createElement(TooltipReference, Object.assign({}, tooltip, {
5112
- className: className + " flex relative items-center justify-center align-middle w-auto text-sm font-semibold h-5 first:rounded-l last:rounded-r focus:outline-none",
5115
+ className: className + " flex relative items-center justify-center align-middle w-auto text-sm font-semibold first:rounded-l last:rounded-r focus:outline-none",
5113
5116
  "aria-label": label
5114
5117
  }), children),
5115
5118
  //@ts-ignore
@@ -5226,7 +5229,19 @@ var ColorImpl = function ColorImpl(props) {
5226
5229
  setColor(color);
5227
5230
  props.handleChange(props.property, color);
5228
5231
  };
5229
- return React.createElement(React.Fragment, null, React.createElement("div", {
5232
+ var getLable = function getLable(colorCode) {
5233
+ var color = defaultColorNames.find(function (c) {
5234
+ return colorCode === c.color;
5235
+ });
5236
+ if (color && color.name) {
5237
+ return color.name;
5238
+ } else {
5239
+ return colorCode;
5240
+ }
5241
+ };
5242
+ return React.createElement(ToolTip, {
5243
+ label: getLable(props.color)
5244
+ }, React.createElement("div", {
5230
5245
  className: props.mClass
5231
5246
  }, React.createElement("div", {
5232
5247
  className: "border border-gray-600 w-[30px] h-[30px] group",
@@ -5777,13 +5792,14 @@ var PopUpCanvas = function PopUpCanvas() {
5777
5792
  return React.createElement("div", {
5778
5793
  className: "flex flex-row items-center",
5779
5794
  key: index
5795
+ }, React.createElement(ToolTip, {
5796
+ label: item["default"]
5780
5797
  }, React.createElement("div", {
5781
5798
  className: "w-[30px] h-[30px] m-2 border-[1px] border-[#000000]",
5782
5799
  style: {
5783
5800
  background: item["default"]
5784
- },
5785
- title: item["default"]
5786
- }), React.createElement("div", {
5801
+ }
5802
+ })), React.createElement("div", {
5787
5803
  className: "mx-[20px] text-[#c2c2c2]"
5788
5804
  }, React.createElement(CgArrowRight, null)), React.createElement("div", {
5789
5805
  className: "flex flex-row border-[1px] border-[#D6D6D6]"
@@ -7703,8 +7719,11 @@ var Rightmenu = function Rightmenu() {
7703
7719
  colorFill: colorFill
7704
7720
  });
7705
7721
  }
7706
- use3dddPlus.getState().forIconCapture();
7707
- data.icon = use3dddPlus.getState().iconImage;
7722
+ if (data && data.icon) {
7723
+ data.icon = data.toDataURL('image/png');
7724
+ } else {
7725
+ data._objects[0].icon = data.toDataURL('image/png');
7726
+ }
7708
7727
  });
7709
7728
  canvas.renderAll();
7710
7729
  // use3dddPlus.getState().updateModifaction(true);