@floegence/floe-webapp-core 0.54.1 → 0.55.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.
- package/dist/components/ui/Dialog.js +15 -15
- package/dist/full.js +115 -113
- package/dist/hooks/useResizeObserver.d.ts +2 -1
- package/dist/hooks/useResizeObserver.js +22 -18
- package/dist/index.js +67 -65
- package/dist/styles.css +1 -1
- package/dist/utils/fitScale.d.ts +10 -0
- package/dist/utils/fitScale.js +9 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface FitScaleSize {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
}
|
|
5
|
+
/** Fit local content dimensions without capping enlargement or rounding scale. */
|
|
6
|
+
export declare function calculateFitScale(options: {
|
|
7
|
+
content: FitScaleSize;
|
|
8
|
+
viewport: FitScaleSize;
|
|
9
|
+
mode: 'contain' | 'width';
|
|
10
|
+
}): number | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
function c(n) {
|
|
2
|
+
const { content: t, viewport: i, mode: r } = n;
|
|
3
|
+
if (![t.width, t.height, i.width, i.height].every((h) => Number.isFinite(h) && h > 0)) return null;
|
|
4
|
+
const e = r === "width" ? i.width / t.width : Math.min(i.width / t.width, i.height / t.height);
|
|
5
|
+
return Number.isFinite(e) && e > 0 ? e : null;
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
c as calculateFitScale
|
|
9
|
+
};
|
package/dist/utils/index.d.ts
CHANGED