@threedddplus/logoeditor 0.0.143 → 0.0.144

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.
@@ -6,4 +6,4 @@ export interface GlobalModalProps {
6
6
  crossOnClick?: () => void;
7
7
  modalStyle?: string;
8
8
  }
9
- export declare const Modal: ({ backdropStyle, children, contentStyle, crossOnClick, modalStyle, }: GlobalModalProps) => React.JSX.Element;
9
+ export declare const Modal: ({ backdropStyle, children, contentStyle, modalStyle, }: GlobalModalProps) => React.JSX.Element;
@@ -2805,22 +2805,41 @@ var fabricSlice = function fabricSlice(set, get) {
2805
2805
  get().fabricCanvas.renderAll();
2806
2806
  },
2807
2807
  applyColorFill: function applyColorFill() {
2808
- var canvasData = get().fabricCanvas.toJSON(['id', 'colorFill']);
2809
- var canvasGetobject = get().fabricCanvas.getObjects();
2810
- canvasData.objects.forEach(function (element, index) {
2811
- if (canvasGetobject && canvasGetobject.length > 0 && canvasGetobject[index].shapeType) {
2812
- element.shapeType = canvasGetobject[index].shapeType;
2813
- element.shapeSize = canvasGetobject[index].shapeSize;
2814
- element.text = canvasGetobject[index].text;
2815
- element.textAlign = canvasGetobject[index].textAlign;
2816
- element.stroke = canvasGetobject[index].stroke;
2817
- element.strokeWidth = canvasGetobject[index].strokeWidth;
2818
- element.fontFamily = canvasGetobject[index].fontFamily;
2819
- }
2820
- element.colorFill = canvasGetobject[index].colorFill;
2821
- element.icon = canvasGetobject[index].icon;
2822
- element.id = canvasGetobject[index].id;
2823
- });
2808
+ /* const canvasGetobject = get().fabricCanvas.getObjects();
2809
+ canvasGetobject.forEach((element: any) => {
2810
+ element?._objects?.forEach((data:any)=>{
2811
+ if( data.group)return;
2812
+ else if(data.fill === undefined){
2813
+ get().popupCanv.remove(data);
2814
+ // get().fabricCanvas.group.remove(data);
2815
+ // data.canvas.remove(data);
2816
+ }
2817
+ console.log(data);
2818
+ })
2819
+ }) */
2820
+ var canvasData = get().fabricCanvas.toJSON(['id', 'colorFill', 'shapeType', 'shapeSize', 'text', 'textAlign', 'stroke', 'strokeWidth', 'fontFamily', 'icon']);
2821
+ // const canvasGetobject = get().fabricCanvas.getObjects();
2822
+ // canvasData.objects.forEach((element: any, index: any) => {
2823
+ // if (
2824
+ // canvasGetobject &&
2825
+ //canvasGetobject.length > 0 &&
2826
+ // canvasGetobject[index].shapeType
2827
+ //) {
2828
+ // element.shapeType = canvasGetobject[index].shapeType;
2829
+ // element.shapeSize = canvasGetobject[index].shapeSize;
2830
+ // element.text = canvasGetobject[index].text;
2831
+ // element.textAlign = canvasGetobject[index].textAlign;
2832
+ // element.stroke = canvasGetobject[index].stroke;
2833
+ // element.strokeWidth = canvasGetobject[index].strokeWidth;
2834
+ // element.fontFamily = canvasGetobject[index].fontFamily;
2835
+ // }
2836
+ //else if(element.colorFill === 'rgb(0,0,0)'){
2837
+ //canvasGetobject.remove(element);
2838
+ //}
2839
+ // element.colorFill = canvasGetobject[index].colorFill;
2840
+ // element.icon = canvasGetobject[index].icon;
2841
+ // element.id = canvasGetobject[index].id;
2842
+ // });
2824
2843
  return canvasData;
2825
2844
  },
2826
2845
  setDefaultColorFill: function setDefaultColorFill(dcf) {
@@ -4764,7 +4783,6 @@ var SEARCHBAR_BORDER_COLOR = 'border-[#bebebe]';
4764
4783
  var CANVAS_MENU_TEXT = 'text-[#353535]';
4765
4784
  var TAG_BG_COLOR = 'bg-[#FCE8EB]';
4766
4785
  var TAG_TEXT_COLOR = 'text-[#e11a38]';
4767
- var SAVERACK_TEXT_COLOR = 'text-[#707070]';
4768
4786
  var SAVEBUTTON_BG_COLOR = 'bg-[#E11A38]';
4769
4787
  var EDIT_DESIGN_INFO_TEXT_COLOR_1 = 'text-[#E11A38]';
4770
4788
  var EDIT_DESIGN_INFO_TEXT_COLOR_3 = 'text-[#353535]';
@@ -7672,22 +7690,13 @@ var Modal = function Modal(_ref) {
7672
7690
  var backdropStyle = _ref.backdropStyle,
7673
7691
  children = _ref.children,
7674
7692
  contentStyle = _ref.contentStyle,
7675
- crossOnClick = _ref.crossOnClick,
7676
7693
  modalStyle = _ref.modalStyle;
7677
7694
  return React__default.createElement("div", null, React__default.createElement("div", {
7678
7695
  className: backdropStyle + " absolute top-0 left-0 h-screen w-full " + BACKDROP_BLUR + " " + BACKDROP_BLUR_BG_COLOR
7679
7696
  }), React__default.createElement("dialog", {
7680
7697
  open: true,
7681
7698
  className: contentStyle + " absolute shadow-[0 2px 8px rgba(0, 0, 0, 0.26)] ml-[auto] md:mr-[0%] mr-[auto]"
7682
- }, React__default.createElement(IconButton, {
7683
- label: '',
7684
- icon: React__default.createElement(rx.RxCross2, {
7685
- strokeWidth: 1,
7686
- onClick: crossOnClick
7687
- }),
7688
- className: "z-10 pointer-events-auto cursor-pointer " + SAVERACK_TEXT_COLOR + " font-bold !absolute right-[0.6875rem] top-[0.6875rem] px-[0.75rem] py-[1.25rem] hover:bg-[#E11A38] hover:text-[#ffffff] hover:rounded-none",
7689
- size: "1.2rem"
7690
- }), React__default.createElement("div", {
7699
+ }, React__default.createElement("div", {
7691
7700
  className: "flex flex-col justify-center gap-[1.75rem] " + modalStyle
7692
7701
  }, children)));
7693
7702
  };
@@ -14507,6 +14516,16 @@ var SaveDesign = function SaveDesign(_ref) {
14507
14516
  canvasGetobject.forEach(function (obj) {
14508
14517
  if (obj.type === 'line') {
14509
14518
  canvas.remove(obj);
14519
+ } else {
14520
+ var _obj$_objects;
14521
+ obj == null ? void 0 : (_obj$_objects = obj._objects) == null ? void 0 : _obj$_objects.forEach(function (ele) {
14522
+ if (ele.fill === undefined) {
14523
+ ele.set({
14524
+ scaleX: 0,
14525
+ scaleY: 0
14526
+ });
14527
+ }
14528
+ });
14510
14529
  }
14511
14530
  });
14512
14531
  // saving all path text data (text with shapes applied)
@@ -14547,7 +14566,7 @@ var SaveDesign = function SaveDesign(_ref) {
14547
14566
  }
14548
14567
  }
14549
14568
  }
14550
- dataCh = JSON.stringify(canvasData);
14569
+ dataCh = JSON.stringify(canvasData); // console.log('SAVE-->',dataCh);
14551
14570
  _context.next = 16;
14552
14571
  return uploadLogoConfig(dataCh, use3dddPlus.getState().customerId);
14553
14572
  case 16: