@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/es/index.js CHANGED
@@ -3478,7 +3478,7 @@ function RlsImageEditor(props) {
3478
3478
  useResize({ refElement: refImage, onResize: onResizeElement });
3479
3479
  const onCropImage = useCallback(() => {
3480
3480
  const cropProps = getCropProperties();
3481
- const width = cropProps.width;
3481
+ const width = props.imgWidth || cropProps.width;
3482
3482
  const height = width * getRatioFactor(props.ratio || '1:1');
3483
3483
  refPicture.current.width = width;
3484
3484
  refPicture.current.height = height;
@@ -3498,7 +3498,13 @@ function RlsImageEditor(props) {
3498
3498
  };
3499
3499
  }
3500
3500
  }, props.mimeType || 'image/jpeg', 1);
3501
- }, [props.ratio, props.mimeType, props.onValue, props.formControl]);
3501
+ }, [
3502
+ props.ratio,
3503
+ props.mimeType,
3504
+ props.onValue,
3505
+ props.formControl,
3506
+ props.imgWidth
3507
+ ]);
3502
3508
  const onRestore = useCallback(() => {
3503
3509
  const context = refCanvas.current.getContext('2d');
3504
3510
  if (originalImage.current) {
@@ -3559,7 +3565,7 @@ function RlsImageChooser(props) {
3559
3565
  const onCancel = useCallback(() => {
3560
3566
  setSrcEditor(undefined);
3561
3567
  }, []);
3562
- 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 })] }));
3568
+ 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 })] }));
3563
3569
  }
3564
3570
 
3565
3571
  const DURATION_ANIMATION = 240;