labellife-design-tool 2.3.8 → 2.4.0

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.
@@ -21,7 +21,7 @@ var FormatAlignLeftIcon = require('@mui/icons-material/FormatAlignLeft');
21
21
  var FormatAlignCenterIcon = require('@mui/icons-material/FormatAlignCenter');
22
22
  var FormatAlignRightIcon = require('@mui/icons-material/FormatAlignRight');
23
23
  var OpacityIcon = require('@mui/icons-material/Opacity');
24
- require('@mui/icons-material/Crop');
24
+ var CropIcon = require('@mui/icons-material/Crop');
25
25
  var ArrowUpwardIcon = require('@mui/icons-material/ArrowUpward');
26
26
  var ArrowDownwardIcon = require('@mui/icons-material/ArrowDownward');
27
27
  var AutoAwesomeIcon = require('@mui/icons-material/AutoAwesome');
@@ -757,6 +757,13 @@ var ImageToolbar = mobxReactLite.observer(function (_ref5) {
757
757
  store.history.addUndoState();
758
758
  setFlipAnchor(null);
759
759
  };
760
+ var handleCrop = function handleCrop() {
761
+ if (!element._naturalWidth || !element._naturalHeight) return;
762
+ element.enterCropMode();
763
+ if (element._cropModeEnabled) {
764
+ store.openToolbarPanel('crop');
765
+ }
766
+ };
760
767
  var handleFitToPage = function handleFitToPage() {
761
768
  element.set({
762
769
  x: 0,
@@ -886,6 +893,16 @@ var ImageToolbar = mobxReactLite.observer(function (_ref5) {
886
893
  } : {}),
887
894
  onClick: handleMask,
888
895
  children: hasMask ? t('toolbar.removeMask', 'Remove mask') : t('toolbar.clip', 'Apply mask')
896
+ }), /*#__PURE__*/jsxRuntime.jsx(material.Button, {
897
+ size: "small",
898
+ sx: toolbarBtnSx,
899
+ startIcon: /*#__PURE__*/jsxRuntime.jsx(CropIcon, {
900
+ sx: {
901
+ fontSize: '16px !important'
902
+ }
903
+ }),
904
+ onClick: handleCrop,
905
+ children: t('toolbar.crop', 'Crop')
889
906
  })]
890
907
  });
891
908
  });