@carlonicora/nextjs-jsonapi 1.10.0 → 1.12.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.
Files changed (53) hide show
  1. package/dist/{BlockNoteEditor-SIIMOS7X.js → BlockNoteEditor-UMWHJCPC.js} +15 -15
  2. package/dist/{BlockNoteEditor-SIIMOS7X.js.map → BlockNoteEditor-UMWHJCPC.js.map} +1 -1
  3. package/dist/{BlockNoteEditor-F6DZNT6A.mjs → BlockNoteEditor-VJBFJFL2.mjs} +5 -5
  4. package/dist/JsonApiRequest-FXZCYIER.js +24 -0
  5. package/dist/{JsonApiRequest-FZAFAES3.js.map → JsonApiRequest-FXZCYIER.js.map} +1 -1
  6. package/dist/{JsonApiRequest-ARXYJ2AG.mjs → JsonApiRequest-HFWXMKMA.mjs} +2 -2
  7. package/dist/{chunk-I7OQ5WKX.js → chunk-6YD42BP6.js} +3 -3
  8. package/dist/{chunk-I7OQ5WKX.js.map → chunk-6YD42BP6.js.map} +1 -1
  9. package/dist/{chunk-LPBABDEP.js → chunk-AE3J2MAT.js} +45 -38
  10. package/dist/chunk-AE3J2MAT.js.map +1 -0
  11. package/dist/{chunk-PH4P2DR6.mjs → chunk-BARJCY4I.mjs} +49 -46
  12. package/dist/chunk-BARJCY4I.mjs.map +1 -0
  13. package/dist/{chunk-UVXEP2ED.js → chunk-FPZPD4JI.js} +37 -12
  14. package/dist/chunk-FPZPD4JI.js.map +1 -0
  15. package/dist/{chunk-UJEQG3XF.js → chunk-M6JHT4U4.js} +438 -435
  16. package/dist/chunk-M6JHT4U4.js.map +1 -0
  17. package/dist/{chunk-33UYFFIK.mjs → chunk-SJIVGCNM.mjs} +2 -2
  18. package/dist/{chunk-CHNXYTKO.mjs → chunk-TGBXBUWM.mjs} +37 -12
  19. package/dist/chunk-TGBXBUWM.mjs.map +1 -0
  20. package/dist/{chunk-MOVONDSX.mjs → chunk-UJY3EIUK.mjs} +12 -5
  21. package/dist/chunk-UJY3EIUK.mjs.map +1 -0
  22. package/dist/client/index.js +5 -5
  23. package/dist/client/index.mjs +4 -4
  24. package/dist/components/index.d.mts +3 -2
  25. package/dist/components/index.d.ts +3 -2
  26. package/dist/components/index.js +5 -5
  27. package/dist/components/index.mjs +4 -4
  28. package/dist/contexts/index.js +5 -5
  29. package/dist/contexts/index.mjs +4 -4
  30. package/dist/core/index.d.mts +6 -1
  31. package/dist/core/index.d.ts +6 -1
  32. package/dist/core/index.js +3 -3
  33. package/dist/core/index.mjs +2 -2
  34. package/dist/index.js +4 -4
  35. package/dist/index.mjs +3 -3
  36. package/dist/server/index.js +12 -12
  37. package/dist/server/index.mjs +2 -2
  38. package/package.json +1 -1
  39. package/src/components/navigations/ContentTitle.tsx +6 -10
  40. package/src/components/pages/PageContentContainer.tsx +34 -26
  41. package/src/core/registry/ModuleRegistry.ts +16 -1
  42. package/src/core/registry/bootstrapStore.ts +51 -11
  43. package/src/hooks/useDataListRetriever.ts +9 -11
  44. package/dist/JsonApiRequest-FZAFAES3.js +0 -24
  45. package/dist/chunk-CHNXYTKO.mjs.map +0 -1
  46. package/dist/chunk-LPBABDEP.js.map +0 -1
  47. package/dist/chunk-MOVONDSX.mjs.map +0 -1
  48. package/dist/chunk-PH4P2DR6.mjs.map +0 -1
  49. package/dist/chunk-UJEQG3XF.js.map +0 -1
  50. package/dist/chunk-UVXEP2ED.js.map +0 -1
  51. /package/dist/{BlockNoteEditor-F6DZNT6A.mjs.map → BlockNoteEditor-VJBFJFL2.mjs.map} +0 -0
  52. /package/dist/{JsonApiRequest-ARXYJ2AG.mjs.map → JsonApiRequest-HFWXMKMA.mjs.map} +0 -0
  53. /package/dist/{chunk-33UYFFIK.mjs.map → chunk-SJIVGCNM.mjs.map} +0 -0
@@ -9,7 +9,7 @@ import {
9
9
  useI18nLocale,
10
10
  useI18nRouter,
11
11
  useI18nTranslations
12
- } from "./chunk-33UYFFIK.mjs";
12
+ } from "./chunk-SJIVGCNM.mjs";
13
13
  import {
14
14
  AuthService,
15
15
  ClientAbstractService,
@@ -30,7 +30,7 @@ import {
30
30
  rehydrate,
31
31
  useComposedRefs,
32
32
  useIsMobile
33
- } from "./chunk-MOVONDSX.mjs";
33
+ } from "./chunk-UJY3EIUK.mjs";
34
34
  import {
35
35
  __name
36
36
  } from "./chunk-PAWJFY3S.mjs";
@@ -209,18 +209,16 @@ function useDataListRetriever(params) {
209
209
  );
210
210
  const fetchData = useCallback2(
211
211
  async (fetchParams) => {
212
- if (ready === false) {
213
- return;
214
- }
215
- if (isFetchingRef.current && !fetchParams?.callNext && !fetchParams?.callPrevious) {
216
- return;
217
- }
212
+ if (ready === false) return;
213
+ if (isFetchingRef.current && !fetchParams?.callNext && !fetchParams?.callPrevious) return;
218
214
  const thisRequestId = ++requestIdRef.current;
219
215
  isFetchingRef.current = true;
220
- if (stableParams.requiresSearch === true && fetchParams?.isRefine !== true && fetchParams?.isRefresh !== true)
216
+ if (stableParams.requiresSearch === true && fetchParams?.isRefine !== true && fetchParams?.isRefresh !== true) {
221
217
  return;
222
- if (!nextPage && !previousPage && isLoaded && fetchParams?.callNext !== true && fetchParams?.callPrevious !== true && params.search === searchTermRef.current)
218
+ }
219
+ if (!nextPage && !previousPage && isLoaded && fetchParams?.callNext !== true && fetchParams?.callPrevious !== true && params.search === searchTermRef.current) {
223
220
  return;
221
+ }
224
222
  const currentSearchTerm = searchTermRef.current;
225
223
  setIsLoaded(false);
226
224
  try {
@@ -313,7 +311,9 @@ function useDataListRetriever(params) {
313
311
  }, [ready, fetchData]);
314
312
  const loadNext = useCallback2(
315
313
  async (onlyNewRecords) => {
316
- if (nextPage) fetchData({ isRefresh: onlyNewRecords, callNext: true });
314
+ if (nextPage) {
315
+ fetchData({ isRefresh: onlyNewRecords, callNext: true });
316
+ }
317
317
  },
318
318
  [fetchData, nextPage]
319
319
  );
@@ -7320,12 +7320,12 @@ function ContentTitle({ type, element, functions, className }) {
7320
7320
  setClientFunctions(functions);
7321
7321
  }, [functions]);
7322
7322
  if (!element) return null;
7323
- return /* @__PURE__ */ jsxs41("div", { className: cn(`mb-4 flex w-full flex-col`, className), children: [
7324
- (type || isClient) && /* @__PURE__ */ jsxs41("div", { className: "flex flex-row items-center justify-between gap-x-4", children: [
7323
+ return /* @__PURE__ */ jsxs41("div", { className: cn(`mb-4 flex items-center justify-between gap-x-4 w-full`, className), children: [
7324
+ /* @__PURE__ */ jsxs41("div", { className: "flex flex-col w-full", children: [
7325
7325
  type && /* @__PURE__ */ jsx86("div", { className: `text-muted-foreground text-xl font-light`, children: type }),
7326
- isClient && clientFunctions && /* @__PURE__ */ jsx86("div", { className: "flex flex-row items-center justify-start", children: clientFunctions })
7326
+ /* @__PURE__ */ jsx86("div", { className: `text-primary w-full text-3xl font-semibold`, children: element })
7327
7327
  ] }),
7328
- /* @__PURE__ */ jsx86("div", { className: `text-primary w-full text-3xl font-semibold`, children: element })
7328
+ isClient && clientFunctions && /* @__PURE__ */ jsx86("div", { className: "flex flex-row items-center justify-start", children: clientFunctions })
7329
7329
  ] });
7330
7330
  }
7331
7331
  __name(ContentTitle, "ContentTitle");
@@ -7594,7 +7594,7 @@ __name(AllowedUsersDetails, "AllowedUsersDetails");
7594
7594
  import dynamic from "next/dynamic";
7595
7595
  import React37 from "react";
7596
7596
  import { jsx as jsx96 } from "react/jsx-runtime";
7597
- var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-F6DZNT6A.mjs"), {
7597
+ var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-VJBFJFL2.mjs"), {
7598
7598
  ssr: false
7599
7599
  });
7600
7600
  var BlockNoteEditorContainer = React37.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
@@ -9460,7 +9460,7 @@ __name(PageContainerContentDetails, "PageContainerContentDetails");
9460
9460
  // src/components/pages/PageContentContainer.tsx
9461
9461
  import { useEffect as useEffect29, useState as useState37 } from "react";
9462
9462
  import { jsx as jsx121, jsxs as jsxs73 } from "react/jsx-runtime";
9463
- function PageContentContainer({ details, footer, content }) {
9463
+ function PageContentContainer({ header, details, footer, content }) {
9464
9464
  const [mounted, setMounted] = useState37(false);
9465
9465
  const isMobile = useIsMobile();
9466
9466
  useEffect29(() => {
@@ -9468,33 +9468,36 @@ function PageContentContainer({ details, footer, content }) {
9468
9468
  }, []);
9469
9469
  const isReady = mounted && isMobile !== void 0;
9470
9470
  if (!isReady) {
9471
- return /* @__PURE__ */ jsx121("div", { className: "flex h-[calc(100vh-(--spacing(16)))] w-full" });
9471
+ return /* @__PURE__ */ jsx121("div", { className: "flex h-[calc(100vh-4rem)] w-full flex-col" });
9472
9472
  }
9473
- return /* @__PURE__ */ jsx121("div", { className: "flex h-[calc(100vh-(--spacing(16)))] w-full transition-opacity duration-150 animate-in fade-in", children: /* @__PURE__ */ jsxs73(
9474
- ResizablePanelGroup,
9475
- {
9476
- direction: isMobile ? "vertical" : "horizontal",
9477
- className: "items-stretch",
9478
- autoSaveId: isMobile ? void 0 : "page-content-layout",
9479
- children: [
9480
- /* @__PURE__ */ jsx121(
9481
- ResizablePanel,
9482
- {
9483
- id: "left-panel",
9484
- defaultSize: isMobile ? 10 : 32,
9485
- minSize: isMobile ? 10 : 20,
9486
- maxSize: isMobile ? 90 : 40,
9487
- children: /* @__PURE__ */ jsxs73("div", { className: `@container flex h-full flex-col ${isMobile ? "pb-4" : "pr-4"}`, children: [
9488
- /* @__PURE__ */ jsx121("div", { className: "flex-1 overflow-y-auto", children: details }),
9489
- footer && /* @__PURE__ */ jsx121("div", { className: "flex flex-col gap-y-2 pt-2 pb-2", children: footer })
9490
- ] })
9491
- }
9492
- ),
9493
- /* @__PURE__ */ jsx121(ResizableHandle, { withHandle: true }),
9494
- /* @__PURE__ */ jsx121(ResizablePanel, { id: "right-panel", className: isMobile ? "pt-4" : "pl-4", children: /* @__PURE__ */ jsx121("div", { className: "h-full overflow-y-auto", children: content }) })
9495
- ]
9496
- }
9497
- ) });
9473
+ return /* @__PURE__ */ jsxs73("div", { className: "flex h-[calc(100vh-4rem)] w-full flex-col transition-opacity duration-150 animate-in fade-in", children: [
9474
+ header && /* @__PURE__ */ jsx121("div", { className: "mb-4 flex w-full shrink-0 border-b", children: header }),
9475
+ /* @__PURE__ */ jsx121("div", { className: "min-h-0 flex-1", children: details || footer ? /* @__PURE__ */ jsxs73(
9476
+ ResizablePanelGroup,
9477
+ {
9478
+ direction: isMobile ? "vertical" : "horizontal",
9479
+ className: "h-full items-stretch",
9480
+ autoSaveId: isMobile ? void 0 : "page-content-layout",
9481
+ children: [
9482
+ /* @__PURE__ */ jsx121(
9483
+ ResizablePanel,
9484
+ {
9485
+ id: "left-panel",
9486
+ defaultSize: isMobile ? 10 : 32,
9487
+ minSize: isMobile ? 10 : 20,
9488
+ maxSize: isMobile ? 90 : 40,
9489
+ children: /* @__PURE__ */ jsxs73("div", { className: `@container flex h-full flex-col ${isMobile ? "pb-4" : "pr-4"}`, children: [
9490
+ /* @__PURE__ */ jsx121("div", { className: "flex-1 overflow-y-auto", children: details }),
9491
+ footer && /* @__PURE__ */ jsx121("div", { className: "flex flex-col gap-y-2 pt-2 pb-2", children: footer })
9492
+ ] })
9493
+ }
9494
+ ),
9495
+ /* @__PURE__ */ jsx121(ResizableHandle, { withHandle: true }),
9496
+ /* @__PURE__ */ jsx121(ResizablePanel, { id: "right-panel", className: isMobile ? "pt-4" : "pl-4", children: /* @__PURE__ */ jsx121("div", { className: "h-full overflow-y-auto", children: content }) })
9497
+ ]
9498
+ }
9499
+ ) : /* @__PURE__ */ jsx121("div", { className: "h-full overflow-y-auto", children: content }) })
9500
+ ] });
9498
9501
  }
9499
9502
  __name(PageContentContainer, "PageContentContainer");
9500
9503
 
@@ -9615,7 +9618,7 @@ function useJsonApiGet(params) {
9615
9618
  setLoading(true);
9616
9619
  setError(null);
9617
9620
  try {
9618
- const { JsonApiGet } = await import("./JsonApiRequest-ARXYJ2AG.mjs");
9621
+ const { JsonApiGet } = await import("./JsonApiRequest-HFWXMKMA.mjs");
9619
9622
  const language = navigator.language.split("-")[0] || "en";
9620
9623
  const apiResponse = await JsonApiGet({
9621
9624
  classKey: params.classKey,
@@ -9720,7 +9723,7 @@ function useJsonApiMutation(config) {
9720
9723
  setLoading(true);
9721
9724
  setError(null);
9722
9725
  try {
9723
- const { JsonApiPost, JsonApiPut, JsonApiPatch, JsonApiDelete } = await import("./JsonApiRequest-ARXYJ2AG.mjs");
9726
+ const { JsonApiPost, JsonApiPut, JsonApiPatch, JsonApiDelete } = await import("./JsonApiRequest-HFWXMKMA.mjs");
9724
9727
  const language = navigator.language.split("-")[0] || "en";
9725
9728
  let apiResponse;
9726
9729
  switch (config.method) {
@@ -12115,4 +12118,4 @@ export {
12115
12118
  useUserTableStructure,
12116
12119
  useContentTableStructure
12117
12120
  };
12118
- //# sourceMappingURL=chunk-PH4P2DR6.mjs.map
12121
+ //# sourceMappingURL=chunk-BARJCY4I.mjs.map