@streamscloud/kit 0.70.0 → 0.71.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,7 +1,7 @@
1
1
  <script lang="ts">import { Button } from '../button';
2
2
  import { Spinner } from '../spinner';
3
3
  import { InfiniteScrollLocalization } from './infinite-scroll-localization';
4
- let { loadMore, container = null, rootMargin = '200px', children, loading, retry } = $props();
4
+ let { loadMore, container = null, rootMargin = '200px', children, showLoading = false, loading, retry } = $props();
5
5
  const localization = new InfiniteScrollLocalization();
6
6
  const source = $derived(typeof loadMore === 'function' ? { loadMore, failed: false, canLoadMore: true } : loadMore);
7
7
  let isLoading = $state(false);
@@ -61,7 +61,7 @@ const onRetry = () => {
61
61
  {#if isLoading}
62
62
  {#if loading}
63
63
  {@render loading()}
64
- {:else}
64
+ {:else if showLoading}
65
65
  <div class="infinite-scroll__loading-container">
66
66
  <Spinner timeout={500} />
67
67
  </div>
@@ -79,7 +79,7 @@ const onRetry = () => {
79
79
 
80
80
  <!--
81
81
  @component
82
- Triggers an async `loadMore` callback when a sentinel element scrolls into view, using IntersectionObserver. Re-observes the sentinel on container resize so layout shifts inside the parent re-evaluate visibility (a known IntersectionObserver gotcha). Internal `isLoading` guard prevents overlapping fires while a load is in flight.
82
+ Triggers an async `loadMore` callback when a sentinel element scrolls into view, using IntersectionObserver. Re-observes the sentinel on container resize so layout shifts inside the parent re-evaluate visibility (a known IntersectionObserver gotcha). Internal `isLoading` guard prevents overlapping fires while a load is in flight. No loading indicator by default — opt in with `showLoading` or a `loading` snippet.
83
83
 
84
84
  Pairs with `core/data-loaders` (`CursorDataLoader`, `PageDataLoader`, `CursorDataLoaderWithSearch`) — wire `loadMore={loader.loadMore}` and `{#each loader.items as item}` directly.
85
85
 
@@ -16,13 +16,15 @@ type Props = {
16
16
  /** IntersectionObserver `rootMargin`. Default `'200px'` — fires the load a viewport-screen before reaching the bottom. */
17
17
  rootMargin?: string;
18
18
  children: Snippet;
19
- /** Custom loading indicator snippet. Defaults to the kit `Spinner`. */
19
+ /** Shows the kit `Spinner` while a batch loads. Off by default — the list owner usually renders its own loading state. */
20
+ showLoading?: boolean;
21
+ /** Custom loading indicator snippet. Passing it turns the indicator on regardless of `showLoading`. */
20
22
  loading?: Snippet;
21
23
  /** Manual continue shown while `failed`, taking the callback that retries the failed page. Defaults to a kit `Button`. */
22
24
  retry?: Snippet<[() => void]>;
23
25
  };
24
26
  /**
25
- * Triggers an async `loadMore` callback when a sentinel element scrolls into view, using IntersectionObserver. Re-observes the sentinel on container resize so layout shifts inside the parent re-evaluate visibility (a known IntersectionObserver gotcha). Internal `isLoading` guard prevents overlapping fires while a load is in flight.
27
+ * Triggers an async `loadMore` callback when a sentinel element scrolls into view, using IntersectionObserver. Re-observes the sentinel on container resize so layout shifts inside the parent re-evaluate visibility (a known IntersectionObserver gotcha). Internal `isLoading` guard prevents overlapping fires while a load is in flight. No loading indicator by default — opt in with `showLoading` or a `loading` snippet.
26
28
  *
27
29
  * Pairs with `core/data-loaders` (`CursorDataLoader`, `PageDataLoader`, `CursorDataLoaderWithSearch`) — wire `loadMore={loader.loadMore}` and `{#each loader.items as item}` directly.
28
30
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@streamscloud/kit",
3
- "version": "0.70.0",
3
+ "version": "0.71.0",
4
4
  "author": "StreamsCloud",
5
5
  "repository": {
6
6
  "type": "git",