@rolster/react-components 18.22.0 → 18.22.1

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.
@@ -2141,7 +2141,7 @@
2141
2141
  .rls-modal__component {
2142
2142
  position: absolute;
2143
2143
  width: auto;
2144
- max-width: calc(100% - var(--rls-sizing-x8));
2144
+ max-width: var(--rlc-modal-max-width, calc(100% - var(--rls-sizing-x8)));
2145
2145
  height: var(--pvt-component-height);
2146
2146
  opacity: var(--pvt-component-opacity);
2147
2147
  visibility: var(--pvt-component-visibility);
@@ -2609,15 +2609,14 @@
2609
2609
  .rls-image-chooser__modal {
2610
2610
  --rlc-image-editor-footer-padding: 0rem var(--rls-sizing-x12)
2611
2611
  var(--rls-sizing-x12) var(--rls-sizing-x12);
2612
- --pvt-modal-max-width: 240rem;
2612
+ --rlc-modal-max-width: calc(100% - var(--rls-sizing-x16));
2613
2613
  width: 100%;
2614
- max-width: var(--pvt-modal-max-width);
2615
2614
  }
2616
2615
  @media only screen and (max-width: 420px) {
2617
2616
  .rls-image-chooser__modal {
2618
2617
  --rlc-image-editor-footer-padding: 0rem var(--rls-sizing-x8)
2619
2618
  var(--rls-sizing-x8) var(--rls-sizing-x8);
2620
- --pvt-modal-max-width: 160rem;
2619
+ --rlc-modal-max-width: 160rem;
2621
2620
  }
2622
2621
  } /*# sourceMappingURL=ImageChooser.css.map */
2623
2622
 
package/dist/cjs/index.js CHANGED
@@ -3480,7 +3480,7 @@ function RlsImageEditor(props) {
3480
3480
  useResize({ refElement: refImage, onResize: onResizeElement });
3481
3481
  const onCropImage = require$$0.useCallback(() => {
3482
3482
  const cropProps = getCropProperties();
3483
- const width = cropProps.width;
3483
+ const width = props.imgWidth || cropProps.width;
3484
3484
  const height = width * getRatioFactor(props.ratio || '1:1');
3485
3485
  refPicture.current.width = width;
3486
3486
  refPicture.current.height = height;
@@ -3500,7 +3500,13 @@ function RlsImageEditor(props) {
3500
3500
  };
3501
3501
  }
3502
3502
  }, props.mimeType || 'image/jpeg', 1);
3503
- }, [props.ratio, props.mimeType, props.onValue, props.formControl]);
3503
+ }, [
3504
+ props.ratio,
3505
+ props.mimeType,
3506
+ props.onValue,
3507
+ props.formControl,
3508
+ props.imgWidth
3509
+ ]);
3504
3510
  const onRestore = require$$0.useCallback(() => {
3505
3511
  const context = refCanvas.current.getContext('2d');
3506
3512
  if (originalImage.current) {
@@ -3561,7 +3567,7 @@ function RlsImageChooser(props) {
3561
3567
  const onCancel = require$$0.useCallback(() => {
3562
3568
  setSrcEditor(undefined);
3563
3569
  }, []);
3564
- return (jsxRuntimeExports.jsxs("div", { className: "rls-image-chooser", children: [jsxRuntimeExports.jsx("div", { className: "rls-image-chooser__avatar", onClick: onSelect, children: src && jsxRuntimeExports.jsx("img", { src: src }) }), srcEditor && (jsxRuntimeExports.jsx(RlsModal, { className: "rls-image-chooser__modal", visible: true, children: jsxRuntimeExports.jsx(RlsImageEditor, { src: srcEditor, formControl: props.formControl, onValue: onEditorValue, children: jsxRuntimeExports.jsx(RlsButton, { type: "flat", rlsTheme: "danger", onClick: onCancel, disabled: props.disabled, children: labels.actionCancel }) }) })), jsxRuntimeExports.jsx("input", { ref: refInput, type: "file", disabled: props.disabled })] }));
3570
+ return (jsxRuntimeExports.jsxs("div", { className: "rls-image-chooser", children: [jsxRuntimeExports.jsx("div", { className: "rls-image-chooser__avatar", onClick: onSelect, children: src && jsxRuntimeExports.jsx("img", { src: src }) }), srcEditor && (jsxRuntimeExports.jsx(RlsModal, { className: "rls-image-chooser__modal", visible: true, children: jsxRuntimeExports.jsx(RlsImageEditor, { src: srcEditor, formControl: props.formControl, imgWidth: props.imgWidth, onValue: onEditorValue, children: jsxRuntimeExports.jsx(RlsButton, { type: "flat", rlsTheme: "danger", onClick: onCancel, disabled: props.disabled, children: labels.actionCancel }) }) })), jsxRuntimeExports.jsx("input", { ref: refInput, type: "file", disabled: props.disabled })] }));
3565
3571
  }
3566
3572
 
3567
3573
  const DURATION_ANIMATION = 240;