@oxog/scrollex 1.1.0 → 1.2.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.
@@ -1,5 +1,5 @@
1
- import { VirtualItem, Plugin, ScrollPosition, Range } from '../index.cjs';
2
- export { A as AutoMeasurerAPI, j as AutoMeasurerOptions, n as GridRendererAPI, o as GridRendererOptions, I as InfiniteLoaderAPI, p as InfiniteLoaderOptions, L as ListRendererAPI, u as ListRendererOptions, v as LoadDirection, H as ScrollControllerAPI, J as ScrollControllerOptions, a1 as autoMeasurerPlugin, a2 as gridRendererPlugin, a3 as infiniteLoaderPlugin, a4 as listRendererPlugin, a5 as scrollControllerPlugin } from '../scroll-controller-D5AV1E2p.cjs';
1
+ import { $ as VirtualItem, P as Plugin, W as ScrollPosition, R as Range } from '../scroll-controller-U4Zov88U.cjs';
2
+ export { A as AutoMeasurerAPI, j as AutoMeasurerOptions, n as GridRendererAPI, o as GridRendererOptions, I as InfiniteLoaderAPI, p as InfiniteLoaderOptions, L as ListRendererAPI, u as ListRendererOptions, v as LoadDirection, H as ScrollControllerAPI, J as ScrollControllerOptions, a1 as autoMeasurerPlugin, a2 as gridRendererPlugin, a3 as infiniteLoaderPlugin, a4 as listRendererPlugin, a5 as scrollControllerPlugin } from '../scroll-controller-U4Zov88U.cjs';
3
3
  import 'react';
4
4
 
5
5
  /**
@@ -634,5 +634,4 @@ interface DebugPanelOverlayProps {
634
634
  */
635
635
  declare function DebugPanelOverlay({ plugin, className, style, }: DebugPanelOverlayProps): React.ReactElement | null;
636
636
 
637
- export { DebugPanelOverlay, bidirectional, debugPanel, dragToReorder, keyboardNav, masonryRenderer, scrollRestoration, stickyHeaders };
638
- export type { BidirectionalAPI, BidirectionalOptions, DebugPanelAPI, DebugPanelOptions, DebugPanelOverlayProps, DebugPanelPosition, DebugPanelState, DebugPanelTab, DebugPanelTheme, DragAxis, DragEventLike, DragHandleProps, DragToReorderAPI, DragToReorderOptions, DropIndicatorStyle, EventLogEntry, KeyboardNavAPI, KeyboardNavOptions, KeyboardNavOrientation, MasonryRendererAPI, MasonryRendererOptions, PerformanceStats, SavedScrollState, ScrollRestorationAPI, ScrollRestorationOptions, ScrollRestorationStorage, StickyHeadersAPI, StickyHeadersOptions };
637
+ export { type BidirectionalAPI, type BidirectionalOptions, type DebugPanelAPI, type DebugPanelOptions, DebugPanelOverlay, type DebugPanelOverlayProps, type DebugPanelPosition, type DebugPanelState, type DebugPanelTab, type DebugPanelTheme, type DragAxis, type DragEventLike, type DragHandleProps, type DragToReorderAPI, type DragToReorderOptions, type DropIndicatorStyle, type EventLogEntry, type KeyboardNavAPI, type KeyboardNavOptions, type KeyboardNavOrientation, type MasonryRendererAPI, type MasonryRendererOptions, type PerformanceStats, type SavedScrollState, type ScrollRestorationAPI, type ScrollRestorationOptions, type ScrollRestorationStorage, type StickyHeadersAPI, type StickyHeadersOptions, bidirectional, debugPanel, dragToReorder, keyboardNav, masonryRenderer, scrollRestoration, stickyHeaders };
@@ -1,5 +1,5 @@
1
- import { VirtualItem, Plugin, ScrollPosition, Range } from '../index.js';
2
- export { A as AutoMeasurerAPI, j as AutoMeasurerOptions, n as GridRendererAPI, o as GridRendererOptions, I as InfiniteLoaderAPI, p as InfiniteLoaderOptions, L as ListRendererAPI, u as ListRendererOptions, v as LoadDirection, H as ScrollControllerAPI, J as ScrollControllerOptions, a1 as autoMeasurerPlugin, a2 as gridRendererPlugin, a3 as infiniteLoaderPlugin, a4 as listRendererPlugin, a5 as scrollControllerPlugin } from '../scroll-controller-D5AV1E2p.js';
1
+ import { $ as VirtualItem, P as Plugin, W as ScrollPosition, R as Range } from '../scroll-controller-U4Zov88U.js';
2
+ export { A as AutoMeasurerAPI, j as AutoMeasurerOptions, n as GridRendererAPI, o as GridRendererOptions, I as InfiniteLoaderAPI, p as InfiniteLoaderOptions, L as ListRendererAPI, u as ListRendererOptions, v as LoadDirection, H as ScrollControllerAPI, J as ScrollControllerOptions, a1 as autoMeasurerPlugin, a2 as gridRendererPlugin, a3 as infiniteLoaderPlugin, a4 as listRendererPlugin, a5 as scrollControllerPlugin } from '../scroll-controller-U4Zov88U.js';
3
3
  import 'react';
4
4
 
5
5
  /**
@@ -634,5 +634,4 @@ interface DebugPanelOverlayProps {
634
634
  */
635
635
  declare function DebugPanelOverlay({ plugin, className, style, }: DebugPanelOverlayProps): React.ReactElement | null;
636
636
 
637
- export { DebugPanelOverlay, bidirectional, debugPanel, dragToReorder, keyboardNav, masonryRenderer, scrollRestoration, stickyHeaders };
638
- export type { BidirectionalAPI, BidirectionalOptions, DebugPanelAPI, DebugPanelOptions, DebugPanelOverlayProps, DebugPanelPosition, DebugPanelState, DebugPanelTab, DebugPanelTheme, DragAxis, DragEventLike, DragHandleProps, DragToReorderAPI, DragToReorderOptions, DropIndicatorStyle, EventLogEntry, KeyboardNavAPI, KeyboardNavOptions, KeyboardNavOrientation, MasonryRendererAPI, MasonryRendererOptions, PerformanceStats, SavedScrollState, ScrollRestorationAPI, ScrollRestorationOptions, ScrollRestorationStorage, StickyHeadersAPI, StickyHeadersOptions };
637
+ export { type BidirectionalAPI, type BidirectionalOptions, type DebugPanelAPI, type DebugPanelOptions, DebugPanelOverlay, type DebugPanelOverlayProps, type DebugPanelPosition, type DebugPanelState, type DebugPanelTab, type DebugPanelTheme, type DragAxis, type DragEventLike, type DragHandleProps, type DragToReorderAPI, type DragToReorderOptions, type DropIndicatorStyle, type EventLogEntry, type KeyboardNavAPI, type KeyboardNavOptions, type KeyboardNavOrientation, type MasonryRendererAPI, type MasonryRendererOptions, type PerformanceStats, type SavedScrollState, type ScrollRestorationAPI, type ScrollRestorationOptions, type ScrollRestorationStorage, type StickyHeadersAPI, type StickyHeadersOptions, bidirectional, debugPanel, dragToReorder, keyboardNav, masonryRenderer, scrollRestoration, stickyHeaders };
@@ -1,5 +1,5 @@
1
- import { normalizeColumnCount, debounce, autoColumnCount } from '../chunk-CIB3EBBJ.js';
2
- export { autoMeasurerPlugin, gridRendererPlugin, infiniteLoaderPlugin, listRendererPlugin, scrollControllerPlugin } from '../chunk-CIB3EBBJ.js';
1
+ import { normalizeColumnCount, debounce, autoColumnCount } from '../chunk-2AWRSNQN.js';
2
+ export { autoMeasurerPlugin, gridRendererPlugin, infiniteLoaderPlugin, listRendererPlugin, scrollControllerPlugin } from '../chunk-2AWRSNQN.js';
3
3
  import { useMemo, useCallback, useState, useEffect } from 'react';
4
4
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
5
5
 
@@ -569,8 +569,9 @@ function scrollRestoration(options) {
569
569
  };
570
570
  if (includeIndex) {
571
571
  const keyboardNav2 = kernel.getPlugin("keyboard-nav");
572
- if (keyboardNav2?.api?.getFocusedIndex) {
573
- const focusedIndex = keyboardNav2.api.getFocusedIndex();
572
+ const navApi = keyboardNav2?.api;
573
+ if (navApi?.getFocusedIndex) {
574
+ const focusedIndex = navApi.getFocusedIndex();
574
575
  if (focusedIndex !== null) {
575
576
  state.focusedIndex = focusedIndex;
576
577
  }
@@ -606,8 +607,9 @@ function scrollRestoration(options) {
606
607
  kernel.scrollTo(kernel.getOptions().direction === "horizontal" ? state.scrollLeft : state.scrollTop);
607
608
  if (includeIndex && state.focusedIndex !== void 0) {
608
609
  const keyboardNav2 = kernel.getPlugin("keyboard-nav");
609
- if (keyboardNav2?.api?.setFocusedIndex) {
610
- keyboardNav2.api.setFocusedIndex(state.focusedIndex);
610
+ const navApi = keyboardNav2?.api;
611
+ if (navApi?.setFocusedIndex) {
612
+ navApi.setFocusedIndex(state.focusedIndex);
611
613
  }
612
614
  }
613
615
  return true;
@@ -622,7 +624,7 @@ function scrollRestoration(options) {
622
624
  const horizontal = kernel.getOptions().direction === "horizontal";
623
625
  const viewport = kernel.getViewport();
624
626
  const target = horizontal ? state.scrollLeft : state.scrollTop;
625
- const maxScroll = kernel.getTotalSize() - (horizontal ? viewport.width : viewport.height);
627
+ const maxScroll = kernel.getTotalSize() + (kernel.getOptions().scrollMargin ?? 0) - (horizontal ? viewport.width : viewport.height);
626
628
  if (target > maxScroll + 1) {
627
629
  awaitingContent = true;
628
630
  return;
@@ -1129,7 +1131,7 @@ function debugPanel(options = {}) {
1129
1131
  const horizontal = kernel.getOptions().direction === "horizontal";
1130
1132
  const viewport = kernel.getViewport();
1131
1133
  const scrollOffset = horizontal ? scrollPos.scrollLeft : scrollPos.scrollTop;
1132
- const maxScroll = kernel.getTotalSize() - (horizontal ? viewport.width : viewport.height);
1134
+ const maxScroll = kernel.getTotalSize() + (kernel.getOptions().scrollMargin ?? 0) - (horizontal ? viewport.width : viewport.height);
1133
1135
  state.stats = {
1134
1136
  ...state.stats,
1135
1137
  memoryUsage,