@mcurros2/microm 1.1.100-0 → 1.1.102-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.
package/dist/index.js CHANGED
@@ -3302,9 +3302,7 @@ function $885862093ea04ea3$export$6d892edbc3527d79(props) {
3302
3302
  padding: 0,
3303
3303
  minInlineSize: "unset"
3304
3304
  },
3305
- children: (0, $b4te3$reactjsxruntime.jsx)((0, $b4te3$mantinecore.ScrollArea), {
3306
- children: children
3307
- })
3305
+ children: children
3308
3306
  }),
3309
3307
  showErrors && status.error && (0, $b4te3$reactjsxruntime.jsxs)((0, $d50o9.AlertError), {
3310
3308
  mt: "md",
@@ -3492,6 +3490,8 @@ var $jNUqj = parcelRequire("jNUqj");
3492
3490
  var $8tnwL = parcelRequire("8tnwL");
3493
3491
 
3494
3492
  var $8SZSR = parcelRequire("8SZSR");
3493
+
3494
+ var $lwxCY = parcelRequire("lwxCY");
3495
3495
  $parcel$exportWildcard(module.exports, $d50o9);
3496
3496
  $parcel$exportWildcard(module.exports, $i6yJ4);
3497
3497
  $parcel$exportWildcard(module.exports, $gLcPf);
@@ -3560,6 +3560,7 @@ $parcel$exportWildcard(module.exports, $cSyOF);
3560
3560
  $parcel$exportWildcard(module.exports, $jNUqj);
3561
3561
  $parcel$exportWildcard(module.exports, $8tnwL);
3562
3562
  $parcel$exportWildcard(module.exports, $8SZSR);
3563
+ $parcel$exportWildcard(module.exports, $lwxCY);
3563
3564
 
3564
3565
  });
3565
3566
  parcelRegister("d50o9", function(module, exports) {
@@ -47871,6 +47872,75 @@ const $0dfe00414db620c5$export$523d4cd6cd71a35c = (validationFunction)=>{
47871
47872
 
47872
47873
 
47873
47874
 
47875
+ parcelRegister("lwxCY", function(module, exports) {
47876
+
47877
+ $parcel$export(module.exports, "useAncestorResize", function () { return $fab6abe4da65ff17$export$d994cf386c6f1d98; });
47878
+
47879
+ function $fab6abe4da65ff17$var$parseUnit(value, ancestorWidth, ancestorHeight, baseFontSize) {
47880
+ if (value.endsWith("px")) return parseFloat(value);
47881
+ if (value.endsWith("vw")) return window.innerWidth * parseFloat(value) / 100;
47882
+ if (value.endsWith("vh")) return window.innerHeight * parseFloat(value) / 100;
47883
+ if (value.endsWith("rem")) return parseFloat(value) * baseFontSize;
47884
+ if (value.endsWith("em")) return parseFloat(value) * baseFontSize;
47885
+ if (value.endsWith("%")) return parseFloat(value) / 100 * (ancestorWidth || ancestorHeight);
47886
+ return parseFloat(value);
47887
+ }
47888
+ function $fab6abe4da65ff17$export$d994cf386c6f1d98(minSize = {
47889
+ width: "300px",
47890
+ height: "400px"
47891
+ }) {
47892
+ const ref = (0, $b4te3$react.useRef)(null);
47893
+ const [size, setSize] = (0, $b4te3$react.useState)({
47894
+ width: 0,
47895
+ height: 0
47896
+ });
47897
+ (0, $b4te3$react.useEffect)(()=>{
47898
+ var _a;
47899
+ if (!ref.current) return;
47900
+ const findFirstScrollableAncestor = (el)=>{
47901
+ while(el){
47902
+ const overflowY = getComputedStyle(el).overflowY;
47903
+ if (overflowY === "auto" || overflowY === "scroll") return el;
47904
+ el = el.parentElement;
47905
+ }
47906
+ return null;
47907
+ };
47908
+ const ancestor = (_a = findFirstScrollableAncestor(ref.current.parentElement)) !== null && _a !== void 0 ? _a : ref.current.parentElement;
47909
+ if (!ancestor) {
47910
+ console.warn("cant resize, noancestor");
47911
+ return;
47912
+ }
47913
+ const baseFontSize = parseFloat(getComputedStyle(document.documentElement).fontSize);
47914
+ const minWidth = $fab6abe4da65ff17$var$parseUnit(minSize.width, ancestor.clientWidth, ancestor.clientHeight, baseFontSize);
47915
+ const minHeight = $fab6abe4da65ff17$var$parseUnit(minSize.height, ancestor.clientWidth, ancestor.clientHeight, baseFontSize);
47916
+ const resize = ()=>{
47917
+ const width = ancestor.clientWidth;
47918
+ const height = ancestor.clientHeight;
47919
+ setSize({
47920
+ width: Math.max(minWidth, width),
47921
+ height: Math.max(minHeight, height)
47922
+ });
47923
+ };
47924
+ const observer = new ResizeObserver(resize);
47925
+ observer.observe(ancestor);
47926
+ window.addEventListener("resize", resize);
47927
+ resize();
47928
+ return ()=>{
47929
+ observer.disconnect();
47930
+ window.removeEventListener("resize", resize);
47931
+ };
47932
+ }, [
47933
+ minSize.width,
47934
+ minSize.height
47935
+ ]);
47936
+ return {
47937
+ ref: ref,
47938
+ size: size
47939
+ };
47940
+ }
47941
+
47942
+ });
47943
+
47874
47944
 
47875
47945
 
47876
47946
  parcelRegister("8xtCs", function(module, exports) {