labellife-design-tool 2.3.7 → 2.3.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.
@@ -17,7 +17,7 @@ import FormatAlignLeftIcon from '@mui/icons-material/FormatAlignLeft';
17
17
  import FormatAlignCenterIcon from '@mui/icons-material/FormatAlignCenter';
18
18
  import FormatAlignRightIcon from '@mui/icons-material/FormatAlignRight';
19
19
  import OpacityIcon from '@mui/icons-material/Opacity';
20
- import '@mui/icons-material/Crop';
20
+ import CropIcon from '@mui/icons-material/Crop';
21
21
  import ArrowUpwardIcon from '@mui/icons-material/ArrowUpward';
22
22
  import ArrowDownwardIcon from '@mui/icons-material/ArrowDownward';
23
23
  import AutoAwesomeIcon from '@mui/icons-material/AutoAwesome';
@@ -753,6 +753,13 @@ var ImageToolbar = observer(function (_ref5) {
753
753
  store.history.addUndoState();
754
754
  setFlipAnchor(null);
755
755
  };
756
+ var handleCrop = function handleCrop() {
757
+ if (!element._naturalWidth || !element._naturalHeight) return;
758
+ element.enterCropMode();
759
+ if (element._cropModeEnabled) {
760
+ store.openToolbarPanel('crop');
761
+ }
762
+ };
756
763
  var handleFitToPage = function handleFitToPage() {
757
764
  element.set({
758
765
  x: 0,
@@ -882,6 +889,16 @@ var ImageToolbar = observer(function (_ref5) {
882
889
  } : {}),
883
890
  onClick: handleMask,
884
891
  children: hasMask ? t('toolbar.removeMask', 'Remove mask') : t('toolbar.clip', 'Apply mask')
892
+ }), /*#__PURE__*/jsx(Button, {
893
+ size: "small",
894
+ sx: toolbarBtnSx,
895
+ startIcon: /*#__PURE__*/jsx(CropIcon, {
896
+ sx: {
897
+ fontSize: '16px !important'
898
+ }
899
+ }),
900
+ onClick: handleCrop,
901
+ children: t('toolbar.crop', 'Crop')
885
902
  })]
886
903
  });
887
904
  });