This commit is contained in:
2025-11-12 17:02:27 +01:00
parent d2e27c12a2
commit b812d748ea
44 changed files with 221 additions and 356 deletions
+2 -11
View File
@@ -4,10 +4,6 @@ export const DOCUMENT_VIEWER_PORTRAIT_HEIGHT_RATIO = 0.4;
const PORTRAIT_RATIO_STYLE_ID = 'document-viewer-portrait-ratio-style';
const ensurePortraitRatioStyle = () => {
if (typeof document === 'undefined') {
return;
}
const cssValue = String(DOCUMENT_VIEWER_PORTRAIT_HEIGHT_RATIO);
const cssText = `:root { --document-viewer-portrait-height-ratio: ${cssValue}; }`;
@@ -23,12 +19,7 @@ const ensurePortraitRatioStyle = () => {
}
};
const computeStackedLayoutBreakpoint = () => {
if (typeof window === 'undefined') {
return 900;
}
return window.innerWidth / 2;
};
const computeStackedLayoutBreakpoint = () => window.innerWidth / 2;
export const useViewerLayoutMode = (ref, dependency) => {
const [isStacked, setIsStacked] = useState(false);
@@ -61,7 +52,7 @@ export const useViewerLayoutMode = (ref, dependency) => {
measure();
if (typeof ResizeObserver === 'undefined') {
if (!('ResizeObserver' in window)) {
window.addEventListener('resize', measure);
return () => {
if (frame) {