@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.
- package/dist/{BlockNoteEditor-SIIMOS7X.js → BlockNoteEditor-UMWHJCPC.js} +15 -15
- package/dist/{BlockNoteEditor-SIIMOS7X.js.map → BlockNoteEditor-UMWHJCPC.js.map} +1 -1
- package/dist/{BlockNoteEditor-F6DZNT6A.mjs → BlockNoteEditor-VJBFJFL2.mjs} +5 -5
- package/dist/JsonApiRequest-FXZCYIER.js +24 -0
- package/dist/{JsonApiRequest-FZAFAES3.js.map → JsonApiRequest-FXZCYIER.js.map} +1 -1
- package/dist/{JsonApiRequest-ARXYJ2AG.mjs → JsonApiRequest-HFWXMKMA.mjs} +2 -2
- package/dist/{chunk-I7OQ5WKX.js → chunk-6YD42BP6.js} +3 -3
- package/dist/{chunk-I7OQ5WKX.js.map → chunk-6YD42BP6.js.map} +1 -1
- package/dist/{chunk-LPBABDEP.js → chunk-AE3J2MAT.js} +45 -38
- package/dist/chunk-AE3J2MAT.js.map +1 -0
- package/dist/{chunk-PH4P2DR6.mjs → chunk-BARJCY4I.mjs} +49 -46
- package/dist/chunk-BARJCY4I.mjs.map +1 -0
- package/dist/{chunk-UVXEP2ED.js → chunk-FPZPD4JI.js} +37 -12
- package/dist/chunk-FPZPD4JI.js.map +1 -0
- package/dist/{chunk-UJEQG3XF.js → chunk-M6JHT4U4.js} +438 -435
- package/dist/chunk-M6JHT4U4.js.map +1 -0
- package/dist/{chunk-33UYFFIK.mjs → chunk-SJIVGCNM.mjs} +2 -2
- package/dist/{chunk-CHNXYTKO.mjs → chunk-TGBXBUWM.mjs} +37 -12
- package/dist/chunk-TGBXBUWM.mjs.map +1 -0
- package/dist/{chunk-MOVONDSX.mjs → chunk-UJY3EIUK.mjs} +12 -5
- package/dist/chunk-UJY3EIUK.mjs.map +1 -0
- package/dist/client/index.js +5 -5
- package/dist/client/index.mjs +4 -4
- package/dist/components/index.d.mts +3 -2
- package/dist/components/index.d.ts +3 -2
- package/dist/components/index.js +5 -5
- package/dist/components/index.mjs +4 -4
- package/dist/contexts/index.js +5 -5
- package/dist/contexts/index.mjs +4 -4
- package/dist/core/index.d.mts +6 -1
- package/dist/core/index.d.ts +6 -1
- package/dist/core/index.js +3 -3
- package/dist/core/index.mjs +2 -2
- package/dist/index.js +4 -4
- package/dist/index.mjs +3 -3
- package/dist/server/index.js +12 -12
- package/dist/server/index.mjs +2 -2
- package/package.json +1 -1
- package/src/components/navigations/ContentTitle.tsx +6 -10
- package/src/components/pages/PageContentContainer.tsx +34 -26
- package/src/core/registry/ModuleRegistry.ts +16 -1
- package/src/core/registry/bootstrapStore.ts +51 -11
- package/src/hooks/useDataListRetriever.ts +9 -11
- package/dist/JsonApiRequest-FZAFAES3.js +0 -24
- package/dist/chunk-CHNXYTKO.mjs.map +0 -1
- package/dist/chunk-LPBABDEP.js.map +0 -1
- package/dist/chunk-MOVONDSX.mjs.map +0 -1
- package/dist/chunk-PH4P2DR6.mjs.map +0 -1
- package/dist/chunk-UJEQG3XF.js.map +0 -1
- package/dist/chunk-UVXEP2ED.js.map +0 -1
- /package/dist/{BlockNoteEditor-F6DZNT6A.mjs.map → BlockNoteEditor-VJBFJFL2.mjs.map} +0 -0
- /package/dist/{JsonApiRequest-ARXYJ2AG.mjs.map → JsonApiRequest-HFWXMKMA.mjs.map} +0 -0
- /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-
|
|
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-
|
|
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
|
-
|
|
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
|
-
|
|
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)
|
|
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
|
|
7324
|
-
|
|
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
|
-
|
|
7326
|
+
/* @__PURE__ */ jsx86("div", { className: `text-primary w-full text-3xl font-semibold`, children: element })
|
|
7327
7327
|
] }),
|
|
7328
|
-
/* @__PURE__ */ jsx86("div", { className:
|
|
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-
|
|
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-
|
|
9471
|
+
return /* @__PURE__ */ jsx121("div", { className: "flex h-[calc(100vh-4rem)] w-full flex-col" });
|
|
9472
9472
|
}
|
|
9473
|
-
return /* @__PURE__ */
|
|
9474
|
-
|
|
9475
|
-
{
|
|
9476
|
-
|
|
9477
|
-
|
|
9478
|
-
|
|
9479
|
-
|
|
9480
|
-
|
|
9481
|
-
|
|
9482
|
-
|
|
9483
|
-
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
-
|
|
9487
|
-
|
|
9488
|
-
|
|
9489
|
-
|
|
9490
|
-
|
|
9491
|
-
|
|
9492
|
-
|
|
9493
|
-
|
|
9494
|
-
|
|
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-
|
|
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-
|
|
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-
|
|
12121
|
+
//# sourceMappingURL=chunk-BARJCY4I.mjs.map
|