@threedddplus/logoeditor 0.0.8 → 0.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.
- package/dist/components/middleMenu/middleMenu.d.ts +3 -1
- package/dist/components/myLogo/myLogo.d.ts +3 -1
- package/dist/index.d.ts +5 -1
- package/dist/logoeditor.cjs.development.js +43 -17
- 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 +43 -17
- package/dist/logoeditor.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/logoeditor.esm.js
CHANGED
@@ -6,7 +6,6 @@ import CryptoJS from 'crypto-js';
|
|
6
6
|
import { fabric } from 'fabric';
|
7
7
|
import AWS from 'aws-sdk';
|
8
8
|
import ImageTracer from 'imagetracerjs';
|
9
|
-
import { createRoot } from 'react-dom/client';
|
10
9
|
import { Button as Button$1, useTooltipState, TooltipReference, Tooltip, Input } from 'reakit';
|
11
10
|
import { IconContext } from 'react-icons';
|
12
11
|
import { IoMdCheckmarkCircle } from 'react-icons/io';
|
@@ -4956,7 +4955,8 @@ var Loader = function Loader(_ref) {
|
|
4956
4955
|
}));
|
4957
4956
|
};
|
4958
4957
|
|
4959
|
-
var MyLogo$1 = function MyLogo() {
|
4958
|
+
var MyLogo$1 = function MyLogo(_ref) {
|
4959
|
+
var onApply = _ref.onApply;
|
4960
4960
|
var _React$useState = React.useState(),
|
4961
4961
|
logoSelected = _React$useState[0],
|
4962
4962
|
setLogoSelected = _React$useState[1];
|
@@ -4981,7 +4981,12 @@ var MyLogo$1 = function MyLogo() {
|
|
4981
4981
|
};
|
4982
4982
|
|
4983
4983
|
var handleApplyLogo = function handleApplyLogo(logo) {
|
4984
|
+
if (logo) {
|
4985
|
+
onApply();
|
4986
|
+
// setLogoSelected(logo);
|
4987
|
+
}
|
4984
4988
|
};
|
4989
|
+
|
4985
4990
|
return React.createElement(React.Fragment, null, React.createElement("div", {
|
4986
4991
|
className: "bg-[#F7F7F7] absolute z-100 w-[90%] h-full pr-[56px]"
|
4987
4992
|
}, React.createElement("div", {
|
@@ -5042,7 +5047,7 @@ var MyLogo$1 = function MyLogo() {
|
|
5042
5047
|
}
|
5043
5048
|
}, "Edit"), React.createElement("button", {
|
5044
5049
|
onClick: function onClick() {
|
5045
|
-
return handleApplyLogo();
|
5050
|
+
return handleApplyLogo(logoData);
|
5046
5051
|
},
|
5047
5052
|
className: "border p-3 w-[160px] " + (logoSelected ? 'border-[#e11a38] text-[#e11a38]' : 'bg-[black] text-white font-bold')
|
5048
5053
|
}, "Apply"))), loading && React.createElement(Loader, null));
|
@@ -6090,7 +6095,7 @@ var SaveDesign = function SaveDesign() {
|
|
6090
6095
|
};
|
6091
6096
|
var onSaveHandler = /*#__PURE__*/function () {
|
6092
6097
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
6093
|
-
var dataURL, canvasData, dataCh, S3UrlPath, raw;
|
6098
|
+
var dataURL, canvasData, dataCh, S3UrlPath, canvasSvg, raw;
|
6094
6099
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
6095
6100
|
while (1) switch (_context.prev = _context.next) {
|
6096
6101
|
case 0:
|
@@ -6110,18 +6115,20 @@ var SaveDesign = function SaveDesign() {
|
|
6110
6115
|
return uploadLogoConfig(dataCh, 117015);
|
6111
6116
|
case 7:
|
6112
6117
|
S3UrlPath = _context.sent;
|
6118
|
+
canvasSvg = canvas.toSVG();
|
6113
6119
|
raw = JSON.stringify({
|
6114
6120
|
customer_id: 117015,
|
6115
6121
|
tag: designTag.join(''),
|
6116
6122
|
name: designName,
|
6117
6123
|
base64_image: dataURL,
|
6124
|
+
svg_image: canvasSvg,
|
6118
6125
|
logo_config_url: S3UrlPath
|
6119
6126
|
});
|
6120
6127
|
saveLogo(raw).then(function () {
|
6121
6128
|
closeModal('', false, '', {});
|
6122
6129
|
alert('Logo Saved Successfully');
|
6123
6130
|
});
|
6124
|
-
case
|
6131
|
+
case 11:
|
6125
6132
|
case "end":
|
6126
6133
|
return _context.stop();
|
6127
6134
|
}
|
@@ -6344,7 +6351,8 @@ var ColorPicker = function ColorPicker() {
|
|
6344
6351
|
})));
|
6345
6352
|
};
|
6346
6353
|
|
6347
|
-
var MiddleMenu = function MiddleMenu() {
|
6354
|
+
var MiddleMenu = function MiddleMenu(_ref) {
|
6355
|
+
var onApply = _ref.onApply;
|
6348
6356
|
var _use3dddPlus = use3dddPlus(function (state) {
|
6349
6357
|
return [state.selectedStepper, state.toggleSaveDesign, state.loadingLogo];
|
6350
6358
|
}, shallow),
|
@@ -6360,7 +6368,9 @@ var MiddleMenu = function MiddleMenu() {
|
|
6360
6368
|
className: "flex w-[70%] h-[100%]"
|
6361
6369
|
}, React.createElement(canvas, null)), toggleSaveDesign.status && React.createElement(SaveDesign, null), React.createElement("div", {
|
6362
6370
|
className: "flex-1 z-10 h-[100%] "
|
6363
|
-
}, React.createElement(Rightmenu, null))), selectedStepper === 1 && React.createElement(UploadLogo, null), selectedStepper === 4 && React.createElement(AddMascot, null), selectedStepper === 2 && React.createElement(MyLogo$1,
|
6371
|
+
}, React.createElement(Rightmenu, null))), selectedStepper === 1 && React.createElement(UploadLogo, null), selectedStepper === 4 && React.createElement(AddMascot, null), selectedStepper === 2 && React.createElement(MyLogo$1, {
|
6372
|
+
onApply: onApply
|
6373
|
+
}), selectedStepper === 5 && React.createElement(ColorPicker, null));
|
6364
6374
|
};
|
6365
6375
|
|
6366
6376
|
// import { Modal } from './components';
|
@@ -6371,14 +6381,34 @@ var MiddleMenu = function MiddleMenu() {
|
|
6371
6381
|
* A custom App component. Neat!
|
6372
6382
|
*/
|
6373
6383
|
var LogoEditor = function LogoEditor(_ref) {
|
6374
|
-
var stepperId = _ref.stepperId
|
6384
|
+
var stepperId = _ref.stepperId,
|
6385
|
+
onApply = _ref.onApply,
|
6386
|
+
customLogoColorList = _ref.customLogoColorList,
|
6387
|
+
defaultColorList = _ref.defaultColorList,
|
6388
|
+
logoData = _ref.logoData;
|
6375
6389
|
var _use3dddPlus = use3dddPlus(function (state) {
|
6376
|
-
return [state.setSelectedStepper];
|
6390
|
+
return [state.setSelectedStepper, state.myLogoHandler];
|
6377
6391
|
}),
|
6378
|
-
setSelectedStepper = _use3dddPlus[0]
|
6392
|
+
setSelectedStepper = _use3dddPlus[0],
|
6393
|
+
myLogoHandler = _use3dddPlus[1];
|
6379
6394
|
React.useEffect(function () {
|
6380
6395
|
setSelectedStepper(stepperId);
|
6396
|
+
if (stepperId == undefined) {
|
6397
|
+
myLogoHandler(logoData);
|
6398
|
+
console.log('logoData', logoData);
|
6399
|
+
}
|
6381
6400
|
}, [stepperId]);
|
6401
|
+
React.useEffect(function () {
|
6402
|
+
use3dddPlus.setState({
|
6403
|
+
customUploadLogoColorList: customLogoColorList
|
6404
|
+
});
|
6405
|
+
}, [customLogoColorList]);
|
6406
|
+
React.useEffect(function () {
|
6407
|
+
use3dddPlus.setState({
|
6408
|
+
defaultColorList: defaultColorList
|
6409
|
+
});
|
6410
|
+
}, [defaultColorList]);
|
6411
|
+
console.log('defaultColorList', defaultColorList);
|
6382
6412
|
return (
|
6383
6413
|
// <Modal
|
6384
6414
|
// backdropStyle={`z-[7]`}
|
@@ -6392,16 +6422,12 @@ var LogoEditor = function LogoEditor(_ref) {
|
|
6392
6422
|
className: "lg:w-[10%]"
|
6393
6423
|
}, React.createElement(LeftMenu, null)), React.createElement("div", {
|
6394
6424
|
className: " flex h-full w-[90%]"
|
6395
|
-
}, React.createElement(MiddleMenu,
|
6425
|
+
}, React.createElement(MiddleMenu, {
|
6426
|
+
onApply: onApply
|
6427
|
+
})))
|
6396
6428
|
// </Modal>
|
6397
6429
|
);
|
6398
6430
|
};
|
6399
6431
|
|
6400
|
-
var container = /*#__PURE__*/document.getElementById('root');
|
6401
|
-
var root = /*#__PURE__*/createRoot(container); // createRoot(container!) if you use TypeScript
|
6402
|
-
root.render(React.createElement(LogoEditor, {
|
6403
|
-
stepperId: 1
|
6404
|
-
}));
|
6405
|
-
|
6406
6432
|
export { index$1 as Components, LogoEditor, index as services, use3dddPlus };
|
6407
6433
|
//# sourceMappingURL=logoeditor.esm.js.map
|