@threedddplus/logoeditor 0.0.8 → 0.0.9
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 +39 -15
- 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 +39 -15
- 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));
|
@@ -6344,7 +6349,8 @@ var ColorPicker = function ColorPicker() {
|
|
6344
6349
|
})));
|
6345
6350
|
};
|
6346
6351
|
|
6347
|
-
var MiddleMenu = function MiddleMenu() {
|
6352
|
+
var MiddleMenu = function MiddleMenu(_ref) {
|
6353
|
+
var onApply = _ref.onApply;
|
6348
6354
|
var _use3dddPlus = use3dddPlus(function (state) {
|
6349
6355
|
return [state.selectedStepper, state.toggleSaveDesign, state.loadingLogo];
|
6350
6356
|
}, shallow),
|
@@ -6360,7 +6366,9 @@ var MiddleMenu = function MiddleMenu() {
|
|
6360
6366
|
className: "flex w-[70%] h-[100%]"
|
6361
6367
|
}, React.createElement(canvas, null)), toggleSaveDesign.status && React.createElement(SaveDesign, null), React.createElement("div", {
|
6362
6368
|
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,
|
6369
|
+
}, React.createElement(Rightmenu, null))), selectedStepper === 1 && React.createElement(UploadLogo, null), selectedStepper === 4 && React.createElement(AddMascot, null), selectedStepper === 2 && React.createElement(MyLogo$1, {
|
6370
|
+
onApply: onApply
|
6371
|
+
}), selectedStepper === 5 && React.createElement(ColorPicker, null));
|
6364
6372
|
};
|
6365
6373
|
|
6366
6374
|
// import { Modal } from './components';
|
@@ -6371,14 +6379,34 @@ var MiddleMenu = function MiddleMenu() {
|
|
6371
6379
|
* A custom App component. Neat!
|
6372
6380
|
*/
|
6373
6381
|
var LogoEditor = function LogoEditor(_ref) {
|
6374
|
-
var stepperId = _ref.stepperId
|
6382
|
+
var stepperId = _ref.stepperId,
|
6383
|
+
onApply = _ref.onApply,
|
6384
|
+
customLogoColorList = _ref.customLogoColorList,
|
6385
|
+
defaultColorList = _ref.defaultColorList,
|
6386
|
+
logoData = _ref.logoData;
|
6375
6387
|
var _use3dddPlus = use3dddPlus(function (state) {
|
6376
|
-
return [state.setSelectedStepper];
|
6388
|
+
return [state.setSelectedStepper, state.myLogoHandler];
|
6377
6389
|
}),
|
6378
|
-
setSelectedStepper = _use3dddPlus[0]
|
6390
|
+
setSelectedStepper = _use3dddPlus[0],
|
6391
|
+
myLogoHandler = _use3dddPlus[1];
|
6379
6392
|
React.useEffect(function () {
|
6380
6393
|
setSelectedStepper(stepperId);
|
6394
|
+
if (stepperId == undefined) {
|
6395
|
+
myLogoHandler(logoData);
|
6396
|
+
console.log('logoData', logoData);
|
6397
|
+
}
|
6381
6398
|
}, [stepperId]);
|
6399
|
+
React.useEffect(function () {
|
6400
|
+
use3dddPlus.setState({
|
6401
|
+
customUploadLogoColorList: customLogoColorList
|
6402
|
+
});
|
6403
|
+
}, [customLogoColorList]);
|
6404
|
+
React.useEffect(function () {
|
6405
|
+
use3dddPlus.setState({
|
6406
|
+
defaultColorList: defaultColorList
|
6407
|
+
});
|
6408
|
+
}, [defaultColorList]);
|
6409
|
+
console.log('defaultColorList', defaultColorList);
|
6382
6410
|
return (
|
6383
6411
|
// <Modal
|
6384
6412
|
// backdropStyle={`z-[7]`}
|
@@ -6392,16 +6420,12 @@ var LogoEditor = function LogoEditor(_ref) {
|
|
6392
6420
|
className: "lg:w-[10%]"
|
6393
6421
|
}, React.createElement(LeftMenu, null)), React.createElement("div", {
|
6394
6422
|
className: " flex h-full w-[90%]"
|
6395
|
-
}, React.createElement(MiddleMenu,
|
6423
|
+
}, React.createElement(MiddleMenu, {
|
6424
|
+
onApply: onApply
|
6425
|
+
})))
|
6396
6426
|
// </Modal>
|
6397
6427
|
);
|
6398
6428
|
};
|
6399
6429
|
|
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
6430
|
export { index$1 as Components, LogoEditor, index as services, use3dddPlus };
|
6407
6431
|
//# sourceMappingURL=logoeditor.esm.js.map
|