@carlonicora/nextjs-jsonapi 2.1.3 → 2.2.1
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-75CHO24E.mjs → BlockNoteEditor-2LGNETXD.mjs} +4 -4
- package/dist/{BlockNoteEditor-76GLONZJ.js → BlockNoteEditor-EAEGUVFI.js} +19 -19
- package/dist/{BlockNoteEditor-76GLONZJ.js.map → BlockNoteEditor-EAEGUVFI.js.map} +1 -1
- package/dist/billing/index.js +357 -357
- package/dist/billing/index.mjs +3 -3
- package/dist/{chunk-BFCCVHJ7.js → chunk-4I2W336O.js} +831 -765
- package/dist/chunk-4I2W336O.js.map +1 -0
- package/dist/{chunk-MAWTFEY3.mjs → chunk-B34NBMKV.mjs} +2 -2
- package/dist/{chunk-JG7MCYCW.js → chunk-BLKR2Q7F.js} +7 -7
- package/dist/{chunk-JG7MCYCW.js.map → chunk-BLKR2Q7F.js.map} +1 -1
- package/dist/{chunk-6YIZX26T.js → chunk-DQJ5C5TV.js} +10 -2
- package/dist/chunk-DQJ5C5TV.js.map +1 -0
- package/dist/{chunk-KIFJ7JRO.mjs → chunk-OC7F4L7K.mjs} +144 -78
- package/dist/chunk-OC7F4L7K.mjs.map +1 -0
- package/dist/{chunk-P5TMD7GK.mjs → chunk-R57FRJ6H.mjs} +9 -1
- package/dist/chunk-R57FRJ6H.mjs.map +1 -0
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/components/index.d.mts +12 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/components/index.js +4 -4
- package/dist/components/index.mjs +3 -3
- package/dist/contexts/index.js +4 -4
- package/dist/contexts/index.mjs +3 -3
- package/dist/core/index.d.mts +15 -1
- package/dist/core/index.d.ts +15 -1
- package/dist/core/index.js +4 -2
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +3 -1
- package/dist/features/help/index.js +37 -37
- package/dist/features/help/index.mjs +3 -3
- package/dist/features/tokenusage/index.js +71 -71
- package/dist/features/tokenusage/index.mjs +3 -3
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -2
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +1 -1
- package/package.json +1 -1
- package/src/components/containers/RoundPageContainer.tsx +10 -1
- package/src/components/navigations/RecentPagesNavigator.tsx +64 -33
- package/src/components/navigations/__tests__/RecentPagesNavigator.spec.tsx +166 -0
- package/src/features/user/components/details/UserStandaloneDetails.tsx +2 -0
- package/src/features/user/components/forms/UserAvatarEditor.tsx +5 -1
- package/src/hooks/__tests__/usePageTracker.spec.tsx +296 -0
- package/src/hooks/usePageTracker.ts +108 -19
- package/src/utils/index.ts +1 -0
- package/src/utils/isRemoteImageSrc.test.ts +29 -0
- package/src/utils/isRemoteImageSrc.ts +16 -0
- package/dist/chunk-6YIZX26T.js.map +0 -1
- package/dist/chunk-BFCCVHJ7.js.map +0 -1
- package/dist/chunk-KIFJ7JRO.mjs.map +0 -1
- package/dist/chunk-P5TMD7GK.mjs.map +0 -1
- /package/dist/{BlockNoteEditor-75CHO24E.mjs.map → BlockNoteEditor-2LGNETXD.mjs.map} +0 -0
- /package/dist/{chunk-MAWTFEY3.mjs.map → chunk-B34NBMKV.mjs.map} +0 -0
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
useI18nLocale,
|
|
21
21
|
useI18nRouter,
|
|
22
22
|
useI18nTranslations
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-B34NBMKV.mjs";
|
|
24
24
|
import {
|
|
25
25
|
AVAILABLE_OAUTH_SCOPES,
|
|
26
26
|
AssistantActionService,
|
|
@@ -57,6 +57,7 @@ import {
|
|
|
57
57
|
getLastApiTotal,
|
|
58
58
|
getTokenHandler,
|
|
59
59
|
getViewportContext,
|
|
60
|
+
isRemoteImageSrc,
|
|
60
61
|
measureViewport,
|
|
61
62
|
persistViewport,
|
|
62
63
|
rehydrate,
|
|
@@ -68,7 +69,7 @@ import {
|
|
|
68
69
|
useIsMobile,
|
|
69
70
|
validateItalianTaxCode,
|
|
70
71
|
validatePartitaIva
|
|
71
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-R57FRJ6H.mjs";
|
|
72
73
|
import {
|
|
73
74
|
JsonApiContext
|
|
74
75
|
} from "./chunk-VOXD3ZLY.mjs";
|
|
@@ -7830,6 +7831,7 @@ function UserAvatarEditor({ user, file, setFile, resetImage, setResetImage }) {
|
|
|
7830
7831
|
setFile(files[0]);
|
|
7831
7832
|
}
|
|
7832
7833
|
}, [files]);
|
|
7834
|
+
const avatarSrc = file ? URL.createObjectURL(file) : user?.avatar || "";
|
|
7833
7835
|
const dropzone2 = {
|
|
7834
7836
|
multiple: false,
|
|
7835
7837
|
maxSize: 100 * 1024 * 1024,
|
|
@@ -7849,10 +7851,11 @@ function UserAvatarEditor({ user, file, setFile, resetImage, setResetImage }) {
|
|
|
7849
7851
|
children: /* @__PURE__ */ jsx61(FileInput, { className: "bg-muted text-muted-foreground flex h-full w-full flex-col items-center justify-center", children: !resetImage && (file || user?.avatar) ? /* @__PURE__ */ jsx61(
|
|
7850
7852
|
Image,
|
|
7851
7853
|
{
|
|
7852
|
-
src:
|
|
7854
|
+
src: avatarSrc,
|
|
7853
7855
|
alt: t(`common.avatar`),
|
|
7854
7856
|
width: 200,
|
|
7855
|
-
height: 200
|
|
7857
|
+
height: 200,
|
|
7858
|
+
unoptimized: isRemoteImageSrc(avatarSrc)
|
|
7856
7859
|
}
|
|
7857
7860
|
) : /* @__PURE__ */ jsx61(UploadIcon, { className: "my-4 h-8 w-8" }) })
|
|
7858
7861
|
}
|
|
@@ -10165,7 +10168,7 @@ import { useRef as useRef17 } from "react";
|
|
|
10165
10168
|
import dynamic from "next/dynamic";
|
|
10166
10169
|
import React17 from "react";
|
|
10167
10170
|
import { jsx as jsx86 } from "react/jsx-runtime";
|
|
10168
|
-
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-
|
|
10171
|
+
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-2LGNETXD.mjs"), {
|
|
10169
10172
|
ssr: false
|
|
10170
10173
|
});
|
|
10171
10174
|
var BlockNoteEditorContainer = React17.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
|
|
@@ -11800,6 +11803,7 @@ function UserStanadaloneDetails({ user }) {
|
|
|
11800
11803
|
alt: user.name,
|
|
11801
11804
|
width: 800,
|
|
11802
11805
|
height: 600,
|
|
11806
|
+
unoptimized: isRemoteImageSrc(user.avatar),
|
|
11803
11807
|
className: "h-auto w-full rounded-lg object-contain"
|
|
11804
11808
|
}
|
|
11805
11809
|
) }) }),
|
|
@@ -14236,13 +14240,24 @@ __name(useNotificationSync, "useNotificationSync");
|
|
|
14236
14240
|
// src/hooks/usePageTracker.ts
|
|
14237
14241
|
import { useAtom as useAtom2 } from "jotai";
|
|
14238
14242
|
import { usePathname as usePathname2 } from "next/navigation";
|
|
14239
|
-
import { useEffect as useEffect35 } from "react";
|
|
14243
|
+
import { useEffect as useEffect35, useRef as useRef25 } from "react";
|
|
14240
14244
|
var EXCLUDED_ROUTES = ["/", "/login", "/register", "/forgot-password", "/reset-password", "/activate"];
|
|
14245
|
+
function readEntityTitle() {
|
|
14246
|
+
if (typeof document === "undefined") return null;
|
|
14247
|
+
const afterEntityType = document.title.split("]")[1];
|
|
14248
|
+
if (!afterEntityType) return null;
|
|
14249
|
+
return afterEntityType.split("|")[0]?.trim() || null;
|
|
14250
|
+
}
|
|
14251
|
+
__name(readEntityTitle, "readEntityTitle");
|
|
14241
14252
|
function usePageTracker() {
|
|
14242
14253
|
const pathname = usePathname2();
|
|
14243
14254
|
const [_recentPages, setRecentPages] = useAtom2(recentPagesAtom);
|
|
14255
|
+
const previousPathname = useRef25(null);
|
|
14256
|
+
const previousTitle = useRef25(null);
|
|
14244
14257
|
useEffect35(() => {
|
|
14245
14258
|
if (!pathname) return;
|
|
14259
|
+
const arrivedByClientNavigation = previousPathname.current !== null && previousPathname.current !== pathname;
|
|
14260
|
+
previousPathname.current = pathname;
|
|
14246
14261
|
if (EXCLUDED_ROUTES.some((route) => pathname === route || pathname.endsWith(route))) {
|
|
14247
14262
|
return;
|
|
14248
14263
|
}
|
|
@@ -14255,24 +14270,50 @@ function usePageTracker() {
|
|
|
14255
14270
|
const foundModule = trackablePages.find((mod) => mod.pageUrl === `/${moduleName}`);
|
|
14256
14271
|
if (!foundModule) return;
|
|
14257
14272
|
const baseUrl = `/${moduleName}/${entityId}`;
|
|
14258
|
-
|
|
14259
|
-
|
|
14260
|
-
|
|
14261
|
-
|
|
14262
|
-
|
|
14263
|
-
|
|
14264
|
-
|
|
14273
|
+
if (pathParts.length > 2) {
|
|
14274
|
+
setRecentPages((prev) => {
|
|
14275
|
+
const existing = prev.find((page) => page.url === baseUrl);
|
|
14276
|
+
const refreshed = {
|
|
14277
|
+
url: baseUrl,
|
|
14278
|
+
title: existing?.title ?? foundModule.name,
|
|
14279
|
+
moduleType: foundModule.name,
|
|
14280
|
+
timestamp: Date.now()
|
|
14281
|
+
};
|
|
14282
|
+
return [refreshed, ...prev.filter((page) => page.url !== baseUrl)].slice(0, 10);
|
|
14283
|
+
});
|
|
14284
|
+
previousTitle.current = document.title;
|
|
14285
|
+
return;
|
|
14265
14286
|
}
|
|
14266
|
-
|
|
14267
|
-
|
|
14268
|
-
|
|
14269
|
-
|
|
14270
|
-
|
|
14271
|
-
|
|
14272
|
-
|
|
14273
|
-
|
|
14274
|
-
|
|
14287
|
+
let lastRecordedTitle = null;
|
|
14288
|
+
const record = /* @__PURE__ */ __name((pageTitle) => {
|
|
14289
|
+
if (pageTitle === lastRecordedTitle) return;
|
|
14290
|
+
lastRecordedTitle = pageTitle;
|
|
14291
|
+
const newPage = {
|
|
14292
|
+
url: baseUrl,
|
|
14293
|
+
title: pageTitle,
|
|
14294
|
+
moduleType: foundModule.name,
|
|
14295
|
+
timestamp: Date.now()
|
|
14296
|
+
};
|
|
14297
|
+
setRecentPages((prev) => {
|
|
14298
|
+
const filtered = prev.filter((page) => page.url !== newPage.url);
|
|
14299
|
+
return [newPage, ...filtered].slice(0, 10);
|
|
14300
|
+
});
|
|
14301
|
+
}, "record");
|
|
14302
|
+
const titleAlreadyChanged = document.title !== previousTitle.current;
|
|
14303
|
+
const seededTitle = !arrivedByClientNavigation || titleAlreadyChanged ? readEntityTitle() : null;
|
|
14304
|
+
record(seededTitle ?? foundModule.name);
|
|
14305
|
+
previousTitle.current = document.title;
|
|
14306
|
+
if (typeof document === "undefined") return;
|
|
14307
|
+
const observer = new MutationObserver(() => {
|
|
14308
|
+
if (!window.location.pathname.includes(baseUrl)) return;
|
|
14309
|
+
const title = readEntityTitle();
|
|
14310
|
+
if (title) {
|
|
14311
|
+
record(title);
|
|
14312
|
+
previousTitle.current = document.title;
|
|
14313
|
+
}
|
|
14275
14314
|
});
|
|
14315
|
+
observer.observe(document.head, { childList: true, subtree: true, characterData: true });
|
|
14316
|
+
return () => observer.disconnect();
|
|
14276
14317
|
}, [pathname, setRecentPages]);
|
|
14277
14318
|
}
|
|
14278
14319
|
__name(usePageTracker, "usePageTracker");
|
|
@@ -14340,17 +14381,17 @@ function usePushNotifications() {
|
|
|
14340
14381
|
__name(usePushNotifications, "usePushNotifications");
|
|
14341
14382
|
|
|
14342
14383
|
// src/hooks/useSocket.ts
|
|
14343
|
-
import { useEffect as useEffect37, useRef as
|
|
14384
|
+
import { useEffect as useEffect37, useRef as useRef26, useState as useState46 } from "react";
|
|
14344
14385
|
import io from "socket.io-client";
|
|
14345
14386
|
function useSocket({ token }) {
|
|
14346
|
-
const _errorCount =
|
|
14347
|
-
const shouldConnect =
|
|
14348
|
-
const _hookInstanceId =
|
|
14387
|
+
const _errorCount = useRef26(0);
|
|
14388
|
+
const shouldConnect = useRef26(true);
|
|
14389
|
+
const _hookInstanceId = useRef26(Math.random().toString(36).substring(2, 11));
|
|
14349
14390
|
const [socket, setSocket] = useState46(null);
|
|
14350
14391
|
const [isConnected, setIsConnected] = useState46(false);
|
|
14351
14392
|
const [messages, setMessages] = useState46([]);
|
|
14352
14393
|
const [socketNotifications, setSocketNotifications] = useState46([]);
|
|
14353
|
-
const socketRef =
|
|
14394
|
+
const socketRef = useRef26(null);
|
|
14354
14395
|
useEffect37(() => {
|
|
14355
14396
|
if (!token) return;
|
|
14356
14397
|
const globalSocketKey = `__socket_${process.env.NEXT_PUBLIC_API_URL?.replace(/[^a-zA-Z0-9]/g, "_")}`;
|
|
@@ -14757,25 +14798,50 @@ __name(PageSection, "PageSection");
|
|
|
14757
14798
|
import { useAtomValue } from "jotai";
|
|
14758
14799
|
import { HistoryIcon } from "lucide-react";
|
|
14759
14800
|
import { useTranslations as useTranslations51 } from "next-intl";
|
|
14801
|
+
import { usePathname as usePathname4 } from "next/navigation";
|
|
14760
14802
|
import { jsx as jsx157, jsxs as jsxs90 } from "react/jsx-runtime";
|
|
14761
14803
|
function RecentPagesNavigator() {
|
|
14762
14804
|
const recentPages = useAtomValue(recentPagesAtom);
|
|
14763
14805
|
const t = useTranslations51();
|
|
14764
|
-
const {
|
|
14765
|
-
|
|
14766
|
-
|
|
14767
|
-
|
|
14768
|
-
|
|
14769
|
-
|
|
14770
|
-
/* @__PURE__ */
|
|
14806
|
+
const { isMobile } = useSidebar();
|
|
14807
|
+
const pathname = usePathname4();
|
|
14808
|
+
const isCurrentPage = /* @__PURE__ */ __name((url) => !!pathname && (pathname === url || pathname.startsWith(`${url}/`)), "isCurrentPage");
|
|
14809
|
+
const pages = recentPages.filter((page) => !isCurrentPage(page.url));
|
|
14810
|
+
if (pages.length === 0) return null;
|
|
14811
|
+
return /* @__PURE__ */ jsx157(SidebarMenuItem, { children: /* @__PURE__ */ jsxs90(DropdownMenu, { children: [
|
|
14812
|
+
/* @__PURE__ */ jsxs90(
|
|
14813
|
+
DropdownMenuTrigger,
|
|
14814
|
+
{
|
|
14815
|
+
"data-testid": "sidebar-recent-pages",
|
|
14816
|
+
render: /* @__PURE__ */ jsx157(
|
|
14817
|
+
SidebarMenuButton,
|
|
14818
|
+
{
|
|
14819
|
+
className: "text-muted-foreground hover:bg-muted/50 cursor-pointer",
|
|
14820
|
+
tooltip: t(`common.recent_pages`)
|
|
14821
|
+
}
|
|
14822
|
+
),
|
|
14823
|
+
children: [
|
|
14824
|
+
/* @__PURE__ */ jsx157(HistoryIcon, {}),
|
|
14825
|
+
/* @__PURE__ */ jsx157("span", { children: t(`common.recent_pages`) })
|
|
14826
|
+
]
|
|
14827
|
+
}
|
|
14828
|
+
),
|
|
14829
|
+
/* @__PURE__ */ jsx157(DropdownMenuContent, { side: isMobile ? "bottom" : "right", align: "start", className: "w-96", children: /* @__PURE__ */ jsxs90(DropdownMenuGroup, { children: [
|
|
14771
14830
|
/* @__PURE__ */ jsx157(DropdownMenuLabel, { children: t(`common.recent_pages`) }),
|
|
14772
14831
|
/* @__PURE__ */ jsx157(DropdownMenuSeparator, {}),
|
|
14773
|
-
|
|
14774
|
-
|
|
14775
|
-
|
|
14776
|
-
|
|
14832
|
+
pages.map((page, index) => /* @__PURE__ */ jsx157(
|
|
14833
|
+
DropdownMenuItem,
|
|
14834
|
+
{
|
|
14835
|
+
render: /* @__PURE__ */ jsx157(Link, { href: page.url, className: "flex items-center gap-2" }),
|
|
14836
|
+
children: /* @__PURE__ */ jsxs90("div", { className: "flex flex-col", children: [
|
|
14837
|
+
/* @__PURE__ */ jsx157("div", { className: "truncate", children: page.title }),
|
|
14838
|
+
/* @__PURE__ */ jsx157("div", { className: "text-muted-foreground text-xs font-normal", children: t(`entities.${page.moduleType}`, { count: 1 }) })
|
|
14839
|
+
] })
|
|
14840
|
+
},
|
|
14841
|
+
`${page.url}-${index}`
|
|
14842
|
+
))
|
|
14777
14843
|
] }) })
|
|
14778
|
-
] });
|
|
14844
|
+
] }) });
|
|
14779
14845
|
}
|
|
14780
14846
|
__name(RecentPagesNavigator, "RecentPagesNavigator");
|
|
14781
14847
|
|
|
@@ -14822,7 +14888,7 @@ __name(partitionTabs, "partitionTabs");
|
|
|
14822
14888
|
// src/components/containers/ReactMarkdownContainer.tsx
|
|
14823
14889
|
import { ChevronDown as ChevronDown2, ChevronUp } from "lucide-react";
|
|
14824
14890
|
import { useTranslations as useTranslations52 } from "next-intl";
|
|
14825
|
-
import { useEffect as useEffect40, useRef as
|
|
14891
|
+
import { useEffect as useEffect40, useRef as useRef27, useState as useState50 } from "react";
|
|
14826
14892
|
import ReactMarkdown from "react-markdown";
|
|
14827
14893
|
import remarkGfm from "remark-gfm";
|
|
14828
14894
|
import { jsx as jsx159, jsxs as jsxs92 } from "react/jsx-runtime";
|
|
@@ -14835,7 +14901,7 @@ function ReactMarkdownContainer({
|
|
|
14835
14901
|
const t = useTranslations52("ui.buttons");
|
|
14836
14902
|
const [isExpanded, setIsExpanded] = useState50(false);
|
|
14837
14903
|
const [showExpandButton, setShowExpandButton] = useState50(false);
|
|
14838
|
-
const contentRef =
|
|
14904
|
+
const contentRef = useRef27(null);
|
|
14839
14905
|
useEffect40(() => {
|
|
14840
14906
|
if (collapsible && contentRef.current && !isExpanded) {
|
|
14841
14907
|
const isOverflowing = contentRef.current.scrollHeight > contentRef.current.clientHeight;
|
|
@@ -15134,7 +15200,7 @@ function RoundPageContainer({
|
|
|
15134
15200
|
{
|
|
15135
15201
|
"data-testid": "round-page-rail",
|
|
15136
15202
|
className: "hidden shrink-0 border-r p-4 md:flex md:w-56 md:flex-col md:overflow-y-auto",
|
|
15137
|
-
children: /* @__PURE__ */ jsxs94(TabsList, { className: "flex h-auto flex-col items-stretch gap-0.5 bg-transparent p-0", children: [
|
|
15203
|
+
children: /* @__PURE__ */ jsxs94(TabsList, { className: "flex h-auto w-full flex-col items-stretch gap-0.5 bg-transparent p-0", children: [
|
|
15138
15204
|
ungrouped.map((tab) => /* @__PURE__ */ jsx161(TabsTrigger, { value: tabValue(tab), className: railTriggerClass, children: tab.contentLabel ?? tab.label }, tab.label)),
|
|
15139
15205
|
groups.map((group) => /* @__PURE__ */ jsxs94(Fragment23, { children: [
|
|
15140
15206
|
/* @__PURE__ */ jsx161(
|
|
@@ -15384,7 +15450,7 @@ function AllowedUsersDetails({ showTitle, content }) {
|
|
|
15384
15450
|
__name(AllowedUsersDetails, "AllowedUsersDetails");
|
|
15385
15451
|
|
|
15386
15452
|
// src/components/editors/BlockNoteEditorMentionHoverCard.tsx
|
|
15387
|
-
import { useCallback as useCallback28, useEffect as useEffect42, useRef as
|
|
15453
|
+
import { useCallback as useCallback28, useEffect as useEffect42, useRef as useRef28, useState as useState52 } from "react";
|
|
15388
15454
|
import { createPortal as createPortal3 } from "react-dom";
|
|
15389
15455
|
import { jsx as jsx164 } from "react/jsx-runtime";
|
|
15390
15456
|
function BlockNoteEditorMentionHoverCard({
|
|
@@ -15392,7 +15458,7 @@ function BlockNoteEditorMentionHoverCard({
|
|
|
15392
15458
|
mentionResolveFn
|
|
15393
15459
|
}) {
|
|
15394
15460
|
const [hovered, setHovered] = useState52(null);
|
|
15395
|
-
const closeTimeoutRef =
|
|
15461
|
+
const closeTimeoutRef = useRef28(null);
|
|
15396
15462
|
const scheduleClose = useCallback28(() => {
|
|
15397
15463
|
closeTimeoutRef.current = setTimeout(() => setHovered(null), 200);
|
|
15398
15464
|
}, []);
|
|
@@ -15651,12 +15717,12 @@ var BlockNoteViewerContainer = React28.memo(/* @__PURE__ */ __name(function View
|
|
|
15651
15717
|
}, "ViewerContainer"));
|
|
15652
15718
|
|
|
15653
15719
|
// src/components/pages/PageContainerContentDetails.tsx
|
|
15654
|
-
import { useEffect as useEffect43, useRef as
|
|
15720
|
+
import { useEffect as useEffect43, useRef as useRef29, useState as useState53 } from "react";
|
|
15655
15721
|
import { jsx as jsx168, jsxs as jsxs98 } from "react/jsx-runtime";
|
|
15656
15722
|
function PageContainerContentDetails({ items, section, module, id }) {
|
|
15657
15723
|
const rewriteUrl = useUrlRewriter();
|
|
15658
15724
|
const [isScrolled, setIsScrolled] = useState53(false);
|
|
15659
|
-
const sentinelRef =
|
|
15725
|
+
const sentinelRef = useRef29(null);
|
|
15660
15726
|
useEffect43(() => {
|
|
15661
15727
|
const sentinel = sentinelRef.current;
|
|
15662
15728
|
if (!sentinel) return;
|
|
@@ -15863,13 +15929,13 @@ function JsonApiProvider({ config, children }) {
|
|
|
15863
15929
|
__name(JsonApiProvider, "JsonApiProvider");
|
|
15864
15930
|
|
|
15865
15931
|
// src/client/hooks/useJsonApiGet.ts
|
|
15866
|
-
import { useState as useState55, useEffect as useEffect46, useCallback as useCallback30, useRef as
|
|
15932
|
+
import { useState as useState55, useEffect as useEffect46, useCallback as useCallback30, useRef as useRef30 } from "react";
|
|
15867
15933
|
function useJsonApiGet(params) {
|
|
15868
15934
|
const [data, setData] = useState55(null);
|
|
15869
15935
|
const [loading, setLoading] = useState55(false);
|
|
15870
15936
|
const [error, setError] = useState55(null);
|
|
15871
15937
|
const [response, setResponse] = useState55(null);
|
|
15872
|
-
const isMounted =
|
|
15938
|
+
const isMounted = useRef30(true);
|
|
15873
15939
|
const fetchData = useCallback30(async () => {
|
|
15874
15940
|
if (params.options?.enabled === false) return;
|
|
15875
15941
|
setLoading(true);
|
|
@@ -16673,12 +16739,12 @@ import React30, { memo, useMemo as useMemo30, useState as useState60 } from "rea
|
|
|
16673
16739
|
// src/components/tables/ContentTableSearch.tsx
|
|
16674
16740
|
import { RefreshCw, Search, X as X3 } from "lucide-react";
|
|
16675
16741
|
import { useTranslations as useTranslations57 } from "next-intl";
|
|
16676
|
-
import { useCallback as useCallback35, useEffect as useEffect50, useRef as
|
|
16742
|
+
import { useCallback as useCallback35, useEffect as useEffect50, useRef as useRef31, useState as useState59 } from "react";
|
|
16677
16743
|
import { jsx as jsx179, jsxs as jsxs101 } from "react/jsx-runtime";
|
|
16678
16744
|
function ContentTableSearch({ data }) {
|
|
16679
16745
|
const t = useTranslations57();
|
|
16680
|
-
const searchTermRef =
|
|
16681
|
-
const inputRef =
|
|
16746
|
+
const searchTermRef = useRef31("");
|
|
16747
|
+
const inputRef = useRef31(null);
|
|
16682
16748
|
const [searchTerm, setSearchTerm] = useState59("");
|
|
16683
16749
|
const [isFocused, setIsFocused] = useState59(false);
|
|
16684
16750
|
const [isSearching, setIsSearching] = useState59(false);
|
|
@@ -16964,12 +17030,12 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
|
|
|
16964
17030
|
}, "ContentListTable"));
|
|
16965
17031
|
|
|
16966
17032
|
// src/components/grids/ContentListGrid.tsx
|
|
16967
|
-
import { useEffect as useEffect51, useRef as
|
|
17033
|
+
import { useEffect as useEffect51, useRef as useRef32 } from "react";
|
|
16968
17034
|
import { Fragment as Fragment29, jsx as jsx181, jsxs as jsxs103 } from "react/jsx-runtime";
|
|
16969
17035
|
var DEFAULT_GRID_CLASSES = "grid grid-cols-2 gap-4 p-4 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5";
|
|
16970
17036
|
function ContentListGrid(props) {
|
|
16971
17037
|
const { data, ItemComponent, allowSearch, fullWidth, gridClassName } = props;
|
|
16972
|
-
const sentinelRef =
|
|
17038
|
+
const sentinelRef = useRef32(null);
|
|
16973
17039
|
useEffect51(() => {
|
|
16974
17040
|
if (!data.next || !sentinelRef.current) return;
|
|
16975
17041
|
const observer = new IntersectionObserver(
|
|
@@ -17013,14 +17079,14 @@ __name(ContentListGrid, "ContentListGrid");
|
|
|
17013
17079
|
|
|
17014
17080
|
// src/components/fiscal/ItalianFiscalData.tsx
|
|
17015
17081
|
import { useTranslations as useTranslations59 } from "next-intl";
|
|
17016
|
-
import { forwardRef as forwardRef8, useCallback as useCallback36, useImperativeHandle as useImperativeHandle2, useRef as
|
|
17082
|
+
import { forwardRef as forwardRef8, useCallback as useCallback36, useImperativeHandle as useImperativeHandle2, useRef as useRef33, useState as useState61 } from "react";
|
|
17017
17083
|
import { z as z4 } from "zod";
|
|
17018
17084
|
import { jsx as jsx182, jsxs as jsxs104 } from "react/jsx-runtime";
|
|
17019
17085
|
var ItalianFiscalData = forwardRef8(/* @__PURE__ */ __name(function ItalianFiscalData2({ initialData }, ref) {
|
|
17020
17086
|
const t = useTranslations59();
|
|
17021
|
-
const initialRef =
|
|
17087
|
+
const initialRef = useRef33(initialData);
|
|
17022
17088
|
const [fiscalData, setFiscalData] = useState61(initialData);
|
|
17023
|
-
const fiscalDataRef =
|
|
17089
|
+
const fiscalDataRef = useRef33(initialData);
|
|
17024
17090
|
const [fiscalErrors, setFiscalErrors] = useState61({});
|
|
17025
17091
|
const updateFiscalField = useCallback36((key, value) => {
|
|
17026
17092
|
setFiscalData((prev) => {
|
|
@@ -17745,11 +17811,11 @@ import { useTranslations as useTranslations63 } from "next-intl";
|
|
|
17745
17811
|
import { useState as useState66 } from "react";
|
|
17746
17812
|
|
|
17747
17813
|
// src/features/auth/components/two-factor/TotpInput.tsx
|
|
17748
|
-
import { useEffect as useEffect53, useRef as
|
|
17814
|
+
import { useEffect as useEffect53, useRef as useRef34, useState as useState65 } from "react";
|
|
17749
17815
|
import { jsx as jsx193, jsxs as jsxs111 } from "react/jsx-runtime";
|
|
17750
17816
|
function TotpInput({ onComplete, disabled = false, autoFocus = true, error }) {
|
|
17751
17817
|
const [digits, setDigits] = useState65(["", "", "", "", "", ""]);
|
|
17752
|
-
const inputRefs =
|
|
17818
|
+
const inputRefs = useRef34([]);
|
|
17753
17819
|
useEffect53(() => {
|
|
17754
17820
|
if (autoFocus && inputRefs.current[0]) {
|
|
17755
17821
|
inputRefs.current[0].focus();
|
|
@@ -19238,7 +19304,7 @@ __name(RelevantContentsList, "RelevantContentsList");
|
|
|
19238
19304
|
// src/features/how-to/components/containers/HowToCommand.tsx
|
|
19239
19305
|
import { ArrowRight, LifeBuoyIcon } from "lucide-react";
|
|
19240
19306
|
import { useTranslations as useTranslations81 } from "next-intl";
|
|
19241
|
-
import { useCallback as useCallback38, useEffect as useEffect62, useMemo as useMemo33, useRef as
|
|
19307
|
+
import { useCallback as useCallback38, useEffect as useEffect62, useMemo as useMemo33, useRef as useRef35, useState as useState80 } from "react";
|
|
19242
19308
|
|
|
19243
19309
|
// src/features/how-to/components/containers/HowToCommandViewer.tsx
|
|
19244
19310
|
import { ArrowLeft, BookOpen, MessageSquare } from "lucide-react";
|
|
@@ -19366,7 +19432,7 @@ function HowToCommand({ pathname, extraGroups, onStartChat }) {
|
|
|
19366
19432
|
const t = useTranslations81();
|
|
19367
19433
|
const [dialogOpen, setDialogOpen] = useState80(false);
|
|
19368
19434
|
const [selectedHowTo, setSelectedHowTo] = useState80(null);
|
|
19369
|
-
const searchTermRef =
|
|
19435
|
+
const searchTermRef = useRef35("");
|
|
19370
19436
|
const [searchTerm, setSearchTerm] = useState80("");
|
|
19371
19437
|
const data = useDataListRetriever({
|
|
19372
19438
|
retriever: /* @__PURE__ */ __name((params) => {
|
|
@@ -19676,7 +19742,7 @@ __name(HowToListContainer, "HowToListContainer");
|
|
|
19676
19742
|
// src/features/how-to/components/forms/HowToSelector.tsx
|
|
19677
19743
|
import { CircleX as CircleX3, RefreshCwIcon as RefreshCwIcon4, SearchIcon as SearchIcon7, XIcon as XIcon11 } from "lucide-react";
|
|
19678
19744
|
import { useTranslations as useTranslations85 } from "next-intl";
|
|
19679
|
-
import { useCallback as useCallback39, useEffect as useEffect63, useRef as
|
|
19745
|
+
import { useCallback as useCallback39, useEffect as useEffect63, useRef as useRef36, useState as useState81 } from "react";
|
|
19680
19746
|
import { Fragment as Fragment44, jsx as jsx222, jsxs as jsxs130 } from "react/jsx-runtime";
|
|
19681
19747
|
function HowToSelector({
|
|
19682
19748
|
id,
|
|
@@ -19688,7 +19754,7 @@ function HowToSelector({
|
|
|
19688
19754
|
}) {
|
|
19689
19755
|
const t = useTranslations85();
|
|
19690
19756
|
const [open, setOpen] = useState81(false);
|
|
19691
|
-
const searchTermRef =
|
|
19757
|
+
const searchTermRef = useRef36("");
|
|
19692
19758
|
const [searchTerm, setSearchTerm] = useState81("");
|
|
19693
19759
|
const [isSearching, setIsSearching] = useState81(false);
|
|
19694
19760
|
const data = useDataListRetriever({
|
|
@@ -19994,7 +20060,7 @@ function AssistantThreadHeader({ assistant, onRename, onDelete }) {
|
|
|
19994
20060
|
__name(AssistantThreadHeader, "AssistantThreadHeader");
|
|
19995
20061
|
|
|
19996
20062
|
// src/features/assistant/components/parts/AssistantThread.tsx
|
|
19997
|
-
import { useEffect as useEffect65, useRef as
|
|
20063
|
+
import { useEffect as useEffect65, useRef as useRef37 } from "react";
|
|
19998
20064
|
|
|
19999
20065
|
// src/features/assistant-message/components/MessageItem.tsx
|
|
20000
20066
|
import { useTranslations as useTranslations96 } from "next-intl";
|
|
@@ -20632,7 +20698,7 @@ function AssistantThread({
|
|
|
20632
20698
|
renderApprovalAction,
|
|
20633
20699
|
renderMention
|
|
20634
20700
|
}) {
|
|
20635
|
-
const endRef =
|
|
20701
|
+
const endRef = useRef37(null);
|
|
20636
20702
|
useEffect65(() => {
|
|
20637
20703
|
endRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
20638
20704
|
}, [messages.length, sending]);
|
|
@@ -21105,10 +21171,10 @@ __name(NotificationsListContainer, "NotificationsListContainer");
|
|
|
21105
21171
|
// src/features/notification/components/modals/NotificationModal.tsx
|
|
21106
21172
|
import { BellIcon } from "lucide-react";
|
|
21107
21173
|
import { useTranslations as useTranslations103 } from "next-intl";
|
|
21108
|
-
import { Fragment as Fragment51, useCallback as useCallback42, useEffect as useEffect67, useMemo as useMemo38, useRef as
|
|
21174
|
+
import { Fragment as Fragment51, useCallback as useCallback42, useEffect as useEffect67, useMemo as useMemo38, useRef as useRef38, useState as useState90 } from "react";
|
|
21109
21175
|
import { jsx as jsx247, jsxs as jsxs151 } from "react/jsx-runtime";
|
|
21110
21176
|
function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
21111
|
-
const _instanceId =
|
|
21177
|
+
const _instanceId = useRef38(Math.random().toString(36).substr(2, 9));
|
|
21112
21178
|
const {
|
|
21113
21179
|
notifications,
|
|
21114
21180
|
addNotification,
|
|
@@ -21128,8 +21194,8 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
21128
21194
|
const t = useTranslations103();
|
|
21129
21195
|
const generateUrl = usePageUrlGenerator();
|
|
21130
21196
|
const [newNotifications, setNewNotifications] = useState90(false);
|
|
21131
|
-
const preventAutoClose =
|
|
21132
|
-
const circuitBreakerRef =
|
|
21197
|
+
const preventAutoClose = useRef38(false);
|
|
21198
|
+
const circuitBreakerRef = useRef38({
|
|
21133
21199
|
count: 0,
|
|
21134
21200
|
resetTime: 0,
|
|
21135
21201
|
isOpen: false
|
|
@@ -21159,7 +21225,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
21159
21225
|
useEffect67(() => {
|
|
21160
21226
|
setNewNotifications(unreadCount > 0);
|
|
21161
21227
|
}, [unreadCount]);
|
|
21162
|
-
const processSocketNotificationsRef =
|
|
21228
|
+
const processSocketNotificationsRef = useRef38(null);
|
|
21163
21229
|
const processSocketNotifications = useCallback42(() => {
|
|
21164
21230
|
if (socketNotifications.length === 0) {
|
|
21165
21231
|
return;
|
|
@@ -21320,7 +21386,7 @@ __name(ReferralCodeCapture, "ReferralCodeCapture");
|
|
|
21320
21386
|
|
|
21321
21387
|
// src/features/referral/components/ReferralWidget.tsx
|
|
21322
21388
|
import { Copy as Copy2, Loader2 as Loader26, Mail, Users } from "lucide-react";
|
|
21323
|
-
import { useCallback as useCallback43, useRef as
|
|
21389
|
+
import { useCallback as useCallback43, useRef as useRef39, useState as useState93 } from "react";
|
|
21324
21390
|
|
|
21325
21391
|
// src/features/referral/hooks/useReferralInvite.ts
|
|
21326
21392
|
import { useState as useState91 } from "react";
|
|
@@ -21426,7 +21492,7 @@ function ReferralWidget({
|
|
|
21426
21492
|
const { sendInvite, sending } = useReferralInvite();
|
|
21427
21493
|
const [email, setEmail] = useState93("");
|
|
21428
21494
|
const [copied, setCopied] = useState93(false);
|
|
21429
|
-
const linkInputRef =
|
|
21495
|
+
const linkInputRef = useRef39(null);
|
|
21430
21496
|
const config = getReferralConfig();
|
|
21431
21497
|
const baseUrl = config.referralUrlBase || (typeof window !== "undefined" ? window.location.origin : "");
|
|
21432
21498
|
const referralUrl = stats?.referralCode ? `${baseUrl}${config.referralPath}?${config.urlParamName}=${stats.referralCode}` : "";
|
|
@@ -21714,11 +21780,11 @@ __name(RemoveUserFromRole, "RemoveUserFromRole");
|
|
|
21714
21780
|
// src/features/role/components/forms/UserRoleAdd.tsx
|
|
21715
21781
|
import { PlusCircle as PlusCircle2 } from "lucide-react";
|
|
21716
21782
|
import { useTranslations as useTranslations107 } from "next-intl";
|
|
21717
|
-
import { useCallback as useCallback44, useEffect as useEffect71, useRef as
|
|
21783
|
+
import { useCallback as useCallback44, useEffect as useEffect71, useRef as useRef40, useState as useState95 } from "react";
|
|
21718
21784
|
import { Fragment as Fragment55, jsx as jsx255, jsxs as jsxs157 } from "react/jsx-runtime";
|
|
21719
21785
|
function UserRoleAdd({ user, refresh }) {
|
|
21720
21786
|
const [open, setOpen] = useState95(false);
|
|
21721
|
-
const inputRef =
|
|
21787
|
+
const inputRef = useRef40(null);
|
|
21722
21788
|
const [searchTerm, setSearchTerm] = useState95("");
|
|
21723
21789
|
const [roles, setRoles] = useState95([]);
|
|
21724
21790
|
const t = useTranslations107();
|
|
@@ -23148,7 +23214,7 @@ __name(WaitlistList, "WaitlistList");
|
|
|
23148
23214
|
// src/features/rbac/components/RbacContainer.tsx
|
|
23149
23215
|
import { Loader2Icon as Loader2Icon4 } from "lucide-react";
|
|
23150
23216
|
import { useTranslations as useTranslations116 } from "next-intl";
|
|
23151
|
-
import { memo as memo2, useCallback as useCallback52, useEffect as useEffect75, useMemo as useMemo40, useRef as
|
|
23217
|
+
import { memo as memo2, useCallback as useCallback52, useEffect as useEffect75, useMemo as useMemo40, useRef as useRef41, useState as useState103 } from "react";
|
|
23152
23218
|
|
|
23153
23219
|
// src/features/rbac/components/RbacPermissionCell.tsx
|
|
23154
23220
|
import { CheckIcon as CheckIcon9, MinusIcon as MinusIcon2, XIcon as XIcon12 } from "lucide-react";
|
|
@@ -23417,7 +23483,7 @@ var CellButton = memo2(/* @__PURE__ */ __name(function CellButton2({
|
|
|
23417
23483
|
isRoleColumn,
|
|
23418
23484
|
onOpen
|
|
23419
23485
|
}) {
|
|
23420
|
-
const ref =
|
|
23486
|
+
const ref = useRef41(null);
|
|
23421
23487
|
const value = cellValue(tokens, action);
|
|
23422
23488
|
const handleClick = useCallback52(() => {
|
|
23423
23489
|
if (!ref.current) return;
|
|
@@ -23603,7 +23669,7 @@ __name(RbacContainer, "RbacContainer");
|
|
|
23603
23669
|
// src/features/rbac/components/RbacByRoleContainer.tsx
|
|
23604
23670
|
import { Loader2Icon as Loader2Icon5 } from "lucide-react";
|
|
23605
23671
|
import { useTranslations as useTranslations117 } from "next-intl";
|
|
23606
|
-
import { Fragment as Fragment59, memo as memo3, useCallback as useCallback53, useEffect as useEffect76, useMemo as useMemo41, useRef as
|
|
23672
|
+
import { Fragment as Fragment59, memo as memo3, useCallback as useCallback53, useEffect as useEffect76, useMemo as useMemo41, useRef as useRef42, useState as useState104 } from "react";
|
|
23607
23673
|
import { jsx as jsx279, jsxs as jsxs179 } from "react/jsx-runtime";
|
|
23608
23674
|
function findToken2(tokens, action) {
|
|
23609
23675
|
if (!tokens) return void 0;
|
|
@@ -23624,7 +23690,7 @@ var CellButton3 = memo3(/* @__PURE__ */ __name(function CellButton4({
|
|
|
23624
23690
|
isRoleColumn,
|
|
23625
23691
|
onOpen
|
|
23626
23692
|
}) {
|
|
23627
|
-
const ref =
|
|
23693
|
+
const ref = useRef42(null);
|
|
23628
23694
|
const value = cellValue2(tokens, action);
|
|
23629
23695
|
const handleClick = useCallback53(() => {
|
|
23630
23696
|
if (!ref.current) return;
|
|
@@ -24330,4 +24396,4 @@ export {
|
|
|
24330
24396
|
useOAuthClients,
|
|
24331
24397
|
useOAuthClient
|
|
24332
24398
|
};
|
|
24333
|
-
//# sourceMappingURL=chunk-
|
|
24399
|
+
//# sourceMappingURL=chunk-OC7F4L7K.mjs.map
|