@carlonicora/nextjs-jsonapi 4.2.1 → 4.2.3

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.
@@ -6921,17 +6921,17 @@ function useDataListRetriever(params) {
6921
6921
  return;
6922
6922
  }
6923
6923
  if (isFetchingRef.current && !fetchParams?.callNext && !fetchParams?.callPrevious) return;
6924
- if (fetchParams?.callNext || fetchParams?.callPrevious) {
6925
- isPaginatingRef.current = true;
6926
- }
6927
- const thisRequestId = ++requestIdRef.current;
6928
- isFetchingRef.current = true;
6929
6924
  if (stableParams.requiresSearch === true && fetchParams?.isRefine !== true && fetchParams?.isRefresh !== true) {
6930
6925
  return;
6931
6926
  }
6932
- if (!nextPage && !previousPage && isLoaded && fetchParams?.callNext !== true && fetchParams?.callPrevious !== true && params.search === searchTermRef.current) {
6927
+ if (fetchParams?.force !== true && !nextPage && !previousPage && isLoaded && fetchParams?.callNext !== true && fetchParams?.callPrevious !== true && params.search === searchTermRef.current) {
6933
6928
  return;
6934
6929
  }
6930
+ if (fetchParams?.callNext || fetchParams?.callPrevious) {
6931
+ isPaginatingRef.current = true;
6932
+ }
6933
+ const thisRequestId = ++requestIdRef.current;
6934
+ isFetchingRef.current = true;
6935
6935
  const currentSearchTerm = searchTermRef.current;
6936
6936
  setIsLoaded(false);
6937
6937
  try {
@@ -7035,6 +7035,19 @@ function useDataListRetriever(params) {
7035
7035
  fetchData({ isRefresh: true });
7036
7036
  }
7037
7037
  }, [ready, fetchData]);
7038
+ const fetchDataRef = useRef8(fetchData);
7039
+ const isLoadedRef = useRef8(isLoaded);
7040
+ useEffect6(() => {
7041
+ fetchDataRef.current = fetchData;
7042
+ isLoadedRef.current = isLoaded;
7043
+ });
7044
+ const wasHiddenRef = useRef8(false);
7045
+ useEffect6(() => {
7046
+ if (wasHiddenRef.current && isLoadedRef.current) fetchDataRef.current({ isRefresh: true, force: true });
7047
+ return () => {
7048
+ wasHiddenRef.current = true;
7049
+ };
7050
+ }, []);
7038
7051
  const loadNext = useCallback9(
7039
7052
  async (onlyNewRecords) => {
7040
7053
  if (nextPage) {
@@ -10671,7 +10684,7 @@ import { useRef as useRef18 } from "react";
10671
10684
  import dynamic from "next/dynamic";
10672
10685
  import React18 from "react";
10673
10686
  import { jsx as jsx90 } from "react/jsx-runtime";
10674
- var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-HXAHDJA7.mjs"), {
10687
+ var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-NTKPWYWW.mjs"), {
10675
10688
  ssr: false
10676
10689
  });
10677
10690
  var BlockNoteEditorContainer = React18.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
@@ -18521,6 +18534,12 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
18521
18534
  data: tableData,
18522
18535
  columns: tableColumns,
18523
18536
  getCoreRowModel: getCoreRowModel(),
18537
+ // Pagination is server-side (the data retriever), never TanStack's. Left on,
18538
+ // every core-row-model rebuild queues resetPageIndex -> setState -> re-render,
18539
+ // and the table generators rebuild their columns on every render, so it never
18540
+ // settles: a render loop that starves other updates (the current user never
18541
+ // committed, leaving the sidebar empty).
18542
+ autoResetPageIndex: false,
18524
18543
  ...props.renderExpandedRow && {
18525
18544
  getExpandedRowModel: getExpandedRowModel(),
18526
18545
  // Key rows by record id so an expansion stays with its record when a search or filter reorders the rows.
@@ -28269,4 +28288,4 @@ export {
28269
28288
  useOAuthClients,
28270
28289
  useOAuthClient
28271
28290
  };
28272
- //# sourceMappingURL=chunk-2VXDZRYY.mjs.map
28291
+ //# sourceMappingURL=chunk-NCWCC56Q.mjs.map