@papyrus-sdk/ui-react 0.2.14 → 0.2.16

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/base.css CHANGED
@@ -75,7 +75,9 @@
75
75
  background: var(--papyrus-canvas) !important;
76
76
  box-sizing: border-box;
77
77
  flex: 1 1 auto;
78
- overflow: auto;
78
+ overflow-x: hidden;
79
+ overflow-y: scroll;
80
+ scrollbar-gutter: stable;
79
81
  color: var(--papyrus-text);
80
82
  }
81
83
 
package/dist/index.js CHANGED
@@ -2124,6 +2124,7 @@ var Viewer = ({ engine }) => {
2124
2124
  const frameRef = (0, import_react5.useRef)(null);
2125
2125
  const jumpRef = (0, import_react5.useRef)(false);
2126
2126
  const jumpTimerRef = (0, import_react5.useRef)(null);
2127
+ const lastWidthRef = (0, import_react5.useRef)(null);
2127
2128
  const pinchRef = (0, import_react5.useRef)({
2128
2129
  active: false,
2129
2130
  startDistance: 0,
@@ -2174,8 +2175,14 @@ var Viewer = ({ engine }) => {
2174
2175
  const element = viewerRef.current;
2175
2176
  if (!element) return;
2176
2177
  const updateWidth = () => {
2177
- const nextWidth = element.clientWidth;
2178
- if (nextWidth > 0) setAvailableWidth(nextWidth);
2178
+ const rawWidth = element.getBoundingClientRect?.().width ?? element.offsetWidth;
2179
+ const nextWidth = Math.round(rawWidth);
2180
+ if (nextWidth <= 0) return;
2181
+ const previousWidth = lastWidthRef.current;
2182
+ if (previousWidth != null && Math.abs(nextWidth - previousWidth) < 2)
2183
+ return;
2184
+ lastWidthRef.current = nextWidth;
2185
+ setAvailableWidth(nextWidth);
2179
2186
  };
2180
2187
  updateWidth();
2181
2188
  if (typeof ResizeObserver === "undefined") {