@linzjs/lui 27.0.0 → 28.0.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/lui.esm.js CHANGED
@@ -42160,13 +42160,15 @@ const transition = (props) => {
42160
42160
  };
42161
42161
 
42162
42162
  /**
42163
- * It captures window events to report a new position.
42163
+ * It captures events on the separator's own window to report a new position,
42164
+ * so resizing also works when the Splitter renders in another window (e.g. a popout).
42164
42165
  * Provides necessary handlers for separator.
42165
42166
  */
42166
42167
  const useMoveSeparator = (separator, resize) => {
42167
42168
  const [resizing, setResizing] = useState(false);
42168
42169
  const values = () => getSeparatorAttributes({ ref: separator });
42169
42170
  useEffect(() => {
42171
+ var _a, _b;
42170
42172
  const move = (e) => {
42171
42173
  var _a;
42172
42174
  const key = values().orientation === 'horizontal' ? 'clientY' : 'clientX';
@@ -42178,13 +42180,14 @@ const useMoveSeparator = (separator, resize) => {
42178
42180
  }
42179
42181
  };
42180
42182
  const mouseup = () => setResizing(false);
42181
- window.addEventListener('mousemove', move);
42182
- window.addEventListener('touchmove', move);
42183
- window.addEventListener('click', mouseup);
42183
+ const ownerWindow = (_b = (_a = separator.current) === null || _a === void 0 ? void 0 : _a.ownerDocument.defaultView) !== null && _b !== void 0 ? _b : window;
42184
+ ownerWindow.addEventListener('mousemove', move);
42185
+ ownerWindow.addEventListener('touchmove', move);
42186
+ ownerWindow.addEventListener('click', mouseup);
42184
42187
  return () => {
42185
- window.removeEventListener('mousemove', move);
42186
- window.removeEventListener('touchmove', move);
42187
- window.removeEventListener('click', mouseup);
42188
+ ownerWindow.removeEventListener('mousemove', move);
42189
+ ownerWindow.removeEventListener('touchmove', move);
42190
+ ownerWindow.removeEventListener('click', mouseup);
42188
42191
  };
42189
42192
  }, [separator, resizing]);
42190
42193
  useEffect(() => {