@carlonicora/nextjs-jsonapi 2.1.2 → 2.2.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-FYO6TV4X.js → BlockNoteEditor-5TMQ5YCD.js} +9 -9
- package/dist/{BlockNoteEditor-FYO6TV4X.js.map → BlockNoteEditor-5TMQ5YCD.js.map} +1 -1
- package/dist/{BlockNoteEditor-DYQ5BLQI.mjs → BlockNoteEditor-HAUE4EPR.mjs} +2 -2
- package/dist/billing/index.js +310 -310
- package/dist/billing/index.mjs +1 -1
- package/dist/{chunk-TEJDX7X7.js → chunk-HPKCZMQX.js} +96 -31
- package/dist/chunk-HPKCZMQX.js.map +1 -0
- package/dist/{chunk-B3ELVSTL.mjs → chunk-PGW2OP3L.mjs} +139 -74
- package/dist/chunk-PGW2OP3L.mjs.map +1 -0
- package/dist/client/index.js +2 -2
- package/dist/client/index.mjs +1 -1
- package/dist/components/index.d.mts +12 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/components/index.js +2 -2
- package/dist/components/index.mjs +1 -1
- package/dist/contexts/index.js +2 -2
- package/dist/contexts/index.mjs +1 -1
- package/dist/features/help/index.js +31 -31
- package/dist/features/help/index.mjs +1 -1
- package/dist/features/tokenusage/index.js +56 -56
- package/dist/features/tokenusage/index.mjs +1 -1
- package/package.json +1 -1
- package/src/components/navigations/Header.tsx +5 -2
- package/src/components/navigations/RecentPagesNavigator.tsx +64 -33
- package/src/components/navigations/__tests__/RecentPagesNavigator.spec.tsx +166 -0
- package/src/hooks/__tests__/usePageTracker.spec.tsx +296 -0
- package/src/hooks/usePageTracker.ts +108 -19
- package/dist/chunk-B3ELVSTL.mjs.map +0 -1
- package/dist/chunk-TEJDX7X7.js.map +0 -1
- /package/dist/{BlockNoteEditor-DYQ5BLQI.mjs.map → BlockNoteEditor-HAUE4EPR.mjs.map} +0 -0
|
@@ -10165,7 +10165,7 @@ import { useRef as useRef17 } from "react";
|
|
|
10165
10165
|
import dynamic from "next/dynamic";
|
|
10166
10166
|
import React17 from "react";
|
|
10167
10167
|
import { jsx as jsx86 } from "react/jsx-runtime";
|
|
10168
|
-
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-
|
|
10168
|
+
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-HAUE4EPR.mjs"), {
|
|
10169
10169
|
ssr: false
|
|
10170
10170
|
});
|
|
10171
10171
|
var BlockNoteEditorContainer = React17.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
|
|
@@ -14236,13 +14236,24 @@ __name(useNotificationSync, "useNotificationSync");
|
|
|
14236
14236
|
// src/hooks/usePageTracker.ts
|
|
14237
14237
|
import { useAtom as useAtom2 } from "jotai";
|
|
14238
14238
|
import { usePathname as usePathname2 } from "next/navigation";
|
|
14239
|
-
import { useEffect as useEffect35 } from "react";
|
|
14239
|
+
import { useEffect as useEffect35, useRef as useRef25 } from "react";
|
|
14240
14240
|
var EXCLUDED_ROUTES = ["/", "/login", "/register", "/forgot-password", "/reset-password", "/activate"];
|
|
14241
|
+
function readEntityTitle() {
|
|
14242
|
+
if (typeof document === "undefined") return null;
|
|
14243
|
+
const afterEntityType = document.title.split("]")[1];
|
|
14244
|
+
if (!afterEntityType) return null;
|
|
14245
|
+
return afterEntityType.split("|")[0]?.trim() || null;
|
|
14246
|
+
}
|
|
14247
|
+
__name(readEntityTitle, "readEntityTitle");
|
|
14241
14248
|
function usePageTracker() {
|
|
14242
14249
|
const pathname = usePathname2();
|
|
14243
14250
|
const [_recentPages, setRecentPages] = useAtom2(recentPagesAtom);
|
|
14251
|
+
const previousPathname = useRef25(null);
|
|
14252
|
+
const previousTitle = useRef25(null);
|
|
14244
14253
|
useEffect35(() => {
|
|
14245
14254
|
if (!pathname) return;
|
|
14255
|
+
const arrivedByClientNavigation = previousPathname.current !== null && previousPathname.current !== pathname;
|
|
14256
|
+
previousPathname.current = pathname;
|
|
14246
14257
|
if (EXCLUDED_ROUTES.some((route) => pathname === route || pathname.endsWith(route))) {
|
|
14247
14258
|
return;
|
|
14248
14259
|
}
|
|
@@ -14255,24 +14266,50 @@ function usePageTracker() {
|
|
|
14255
14266
|
const foundModule = trackablePages.find((mod) => mod.pageUrl === `/${moduleName}`);
|
|
14256
14267
|
if (!foundModule) return;
|
|
14257
14268
|
const baseUrl = `/${moduleName}/${entityId}`;
|
|
14258
|
-
|
|
14259
|
-
|
|
14260
|
-
|
|
14261
|
-
|
|
14262
|
-
|
|
14263
|
-
|
|
14264
|
-
|
|
14269
|
+
if (pathParts.length > 2) {
|
|
14270
|
+
setRecentPages((prev) => {
|
|
14271
|
+
const existing = prev.find((page) => page.url === baseUrl);
|
|
14272
|
+
const refreshed = {
|
|
14273
|
+
url: baseUrl,
|
|
14274
|
+
title: existing?.title ?? foundModule.name,
|
|
14275
|
+
moduleType: foundModule.name,
|
|
14276
|
+
timestamp: Date.now()
|
|
14277
|
+
};
|
|
14278
|
+
return [refreshed, ...prev.filter((page) => page.url !== baseUrl)].slice(0, 10);
|
|
14279
|
+
});
|
|
14280
|
+
previousTitle.current = document.title;
|
|
14281
|
+
return;
|
|
14265
14282
|
}
|
|
14266
|
-
|
|
14267
|
-
|
|
14268
|
-
|
|
14269
|
-
|
|
14270
|
-
|
|
14271
|
-
|
|
14272
|
-
|
|
14273
|
-
|
|
14274
|
-
|
|
14283
|
+
let lastRecordedTitle = null;
|
|
14284
|
+
const record = /* @__PURE__ */ __name((pageTitle) => {
|
|
14285
|
+
if (pageTitle === lastRecordedTitle) return;
|
|
14286
|
+
lastRecordedTitle = pageTitle;
|
|
14287
|
+
const newPage = {
|
|
14288
|
+
url: baseUrl,
|
|
14289
|
+
title: pageTitle,
|
|
14290
|
+
moduleType: foundModule.name,
|
|
14291
|
+
timestamp: Date.now()
|
|
14292
|
+
};
|
|
14293
|
+
setRecentPages((prev) => {
|
|
14294
|
+
const filtered = prev.filter((page) => page.url !== newPage.url);
|
|
14295
|
+
return [newPage, ...filtered].slice(0, 10);
|
|
14296
|
+
});
|
|
14297
|
+
}, "record");
|
|
14298
|
+
const titleAlreadyChanged = document.title !== previousTitle.current;
|
|
14299
|
+
const seededTitle = !arrivedByClientNavigation || titleAlreadyChanged ? readEntityTitle() : null;
|
|
14300
|
+
record(seededTitle ?? foundModule.name);
|
|
14301
|
+
previousTitle.current = document.title;
|
|
14302
|
+
if (typeof document === "undefined") return;
|
|
14303
|
+
const observer = new MutationObserver(() => {
|
|
14304
|
+
if (!window.location.pathname.includes(baseUrl)) return;
|
|
14305
|
+
const title = readEntityTitle();
|
|
14306
|
+
if (title) {
|
|
14307
|
+
record(title);
|
|
14308
|
+
previousTitle.current = document.title;
|
|
14309
|
+
}
|
|
14275
14310
|
});
|
|
14311
|
+
observer.observe(document.head, { childList: true, subtree: true, characterData: true });
|
|
14312
|
+
return () => observer.disconnect();
|
|
14276
14313
|
}, [pathname, setRecentPages]);
|
|
14277
14314
|
}
|
|
14278
14315
|
__name(usePageTracker, "usePageTracker");
|
|
@@ -14340,17 +14377,17 @@ function usePushNotifications() {
|
|
|
14340
14377
|
__name(usePushNotifications, "usePushNotifications");
|
|
14341
14378
|
|
|
14342
14379
|
// src/hooks/useSocket.ts
|
|
14343
|
-
import { useEffect as useEffect37, useRef as
|
|
14380
|
+
import { useEffect as useEffect37, useRef as useRef26, useState as useState46 } from "react";
|
|
14344
14381
|
import io from "socket.io-client";
|
|
14345
14382
|
function useSocket({ token }) {
|
|
14346
|
-
const _errorCount =
|
|
14347
|
-
const shouldConnect =
|
|
14348
|
-
const _hookInstanceId =
|
|
14383
|
+
const _errorCount = useRef26(0);
|
|
14384
|
+
const shouldConnect = useRef26(true);
|
|
14385
|
+
const _hookInstanceId = useRef26(Math.random().toString(36).substring(2, 11));
|
|
14349
14386
|
const [socket, setSocket] = useState46(null);
|
|
14350
14387
|
const [isConnected, setIsConnected] = useState46(false);
|
|
14351
14388
|
const [messages, setMessages] = useState46([]);
|
|
14352
14389
|
const [socketNotifications, setSocketNotifications] = useState46([]);
|
|
14353
|
-
const socketRef =
|
|
14390
|
+
const socketRef = useRef26(null);
|
|
14354
14391
|
useEffect37(() => {
|
|
14355
14392
|
if (!token) return;
|
|
14356
14393
|
const globalSocketKey = `__socket_${process.env.NEXT_PUBLIC_API_URL?.replace(/[^a-zA-Z0-9]/g, "_")}`;
|
|
@@ -14615,7 +14652,10 @@ function Header({ children, mobileChildren, leftContent, logo, className }) {
|
|
|
14615
14652
|
/* @__PURE__ */ jsx153(SidebarTrigger, { "aria-label": "Toggle sidebar", id: "sidebar-trigger" }),
|
|
14616
14653
|
leftContent,
|
|
14617
14654
|
/* @__PURE__ */ jsx153("div", { className: "flex w-full flex-row items-center justify-start", children: /* @__PURE__ */ jsx153(BreadcrumbNavigation, { items: breadcrumbs, rootLabel: rootLabel ?? void 0 }) }),
|
|
14618
|
-
isMobile ? mobileChildren && /* @__PURE__ */ jsx153("div", { className: "flex shrink-0 flex-row items-center justify-end gap-x-2 whitespace-nowrap", children: mobileChildren }) : children &&
|
|
14655
|
+
isMobile ? mobileChildren && /* @__PURE__ */ jsx153("div", { className: "flex shrink-0 flex-row items-center justify-end gap-x-2 whitespace-nowrap", children: mobileChildren }) : children && // No fixed width: the widget slot sizes to its content and the
|
|
14656
|
+
// breadcrumb (w-full, above) takes the rest. A `w-64` cap here
|
|
14657
|
+
// clipped consumers whose widget set outgrew 256px.
|
|
14658
|
+
/* @__PURE__ */ jsx153("div", { className: "flex shrink-0 flex-row items-center justify-end gap-x-4 whitespace-nowrap", children })
|
|
14619
14659
|
] })
|
|
14620
14660
|
}
|
|
14621
14661
|
)
|
|
@@ -14754,25 +14794,50 @@ __name(PageSection, "PageSection");
|
|
|
14754
14794
|
import { useAtomValue } from "jotai";
|
|
14755
14795
|
import { HistoryIcon } from "lucide-react";
|
|
14756
14796
|
import { useTranslations as useTranslations51 } from "next-intl";
|
|
14797
|
+
import { usePathname as usePathname4 } from "next/navigation";
|
|
14757
14798
|
import { jsx as jsx157, jsxs as jsxs90 } from "react/jsx-runtime";
|
|
14758
14799
|
function RecentPagesNavigator() {
|
|
14759
14800
|
const recentPages = useAtomValue(recentPagesAtom);
|
|
14760
14801
|
const t = useTranslations51();
|
|
14761
|
-
const {
|
|
14762
|
-
|
|
14763
|
-
|
|
14764
|
-
|
|
14765
|
-
|
|
14766
|
-
|
|
14767
|
-
/* @__PURE__ */
|
|
14802
|
+
const { isMobile } = useSidebar();
|
|
14803
|
+
const pathname = usePathname4();
|
|
14804
|
+
const isCurrentPage = /* @__PURE__ */ __name((url) => !!pathname && (pathname === url || pathname.startsWith(`${url}/`)), "isCurrentPage");
|
|
14805
|
+
const pages = recentPages.filter((page) => !isCurrentPage(page.url));
|
|
14806
|
+
if (pages.length === 0) return null;
|
|
14807
|
+
return /* @__PURE__ */ jsx157(SidebarMenuItem, { children: /* @__PURE__ */ jsxs90(DropdownMenu, { children: [
|
|
14808
|
+
/* @__PURE__ */ jsxs90(
|
|
14809
|
+
DropdownMenuTrigger,
|
|
14810
|
+
{
|
|
14811
|
+
"data-testid": "sidebar-recent-pages",
|
|
14812
|
+
render: /* @__PURE__ */ jsx157(
|
|
14813
|
+
SidebarMenuButton,
|
|
14814
|
+
{
|
|
14815
|
+
className: "text-muted-foreground hover:bg-muted/50 cursor-pointer",
|
|
14816
|
+
tooltip: t(`common.recent_pages`)
|
|
14817
|
+
}
|
|
14818
|
+
),
|
|
14819
|
+
children: [
|
|
14820
|
+
/* @__PURE__ */ jsx157(HistoryIcon, {}),
|
|
14821
|
+
/* @__PURE__ */ jsx157("span", { children: t(`common.recent_pages`) })
|
|
14822
|
+
]
|
|
14823
|
+
}
|
|
14824
|
+
),
|
|
14825
|
+
/* @__PURE__ */ jsx157(DropdownMenuContent, { side: isMobile ? "bottom" : "right", align: "start", className: "w-96", children: /* @__PURE__ */ jsxs90(DropdownMenuGroup, { children: [
|
|
14768
14826
|
/* @__PURE__ */ jsx157(DropdownMenuLabel, { children: t(`common.recent_pages`) }),
|
|
14769
14827
|
/* @__PURE__ */ jsx157(DropdownMenuSeparator, {}),
|
|
14770
|
-
|
|
14771
|
-
|
|
14772
|
-
|
|
14773
|
-
|
|
14828
|
+
pages.map((page, index) => /* @__PURE__ */ jsx157(
|
|
14829
|
+
DropdownMenuItem,
|
|
14830
|
+
{
|
|
14831
|
+
render: /* @__PURE__ */ jsx157(Link, { href: page.url, className: "flex items-center gap-2" }),
|
|
14832
|
+
children: /* @__PURE__ */ jsxs90("div", { className: "flex flex-col", children: [
|
|
14833
|
+
/* @__PURE__ */ jsx157("div", { className: "truncate", children: page.title }),
|
|
14834
|
+
/* @__PURE__ */ jsx157("div", { className: "text-muted-foreground text-xs font-normal", children: t(`entities.${page.moduleType}`, { count: 1 }) })
|
|
14835
|
+
] })
|
|
14836
|
+
},
|
|
14837
|
+
`${page.url}-${index}`
|
|
14838
|
+
))
|
|
14774
14839
|
] }) })
|
|
14775
|
-
] });
|
|
14840
|
+
] }) });
|
|
14776
14841
|
}
|
|
14777
14842
|
__name(RecentPagesNavigator, "RecentPagesNavigator");
|
|
14778
14843
|
|
|
@@ -14819,7 +14884,7 @@ __name(partitionTabs, "partitionTabs");
|
|
|
14819
14884
|
// src/components/containers/ReactMarkdownContainer.tsx
|
|
14820
14885
|
import { ChevronDown as ChevronDown2, ChevronUp } from "lucide-react";
|
|
14821
14886
|
import { useTranslations as useTranslations52 } from "next-intl";
|
|
14822
|
-
import { useEffect as useEffect40, useRef as
|
|
14887
|
+
import { useEffect as useEffect40, useRef as useRef27, useState as useState50 } from "react";
|
|
14823
14888
|
import ReactMarkdown from "react-markdown";
|
|
14824
14889
|
import remarkGfm from "remark-gfm";
|
|
14825
14890
|
import { jsx as jsx159, jsxs as jsxs92 } from "react/jsx-runtime";
|
|
@@ -14832,7 +14897,7 @@ function ReactMarkdownContainer({
|
|
|
14832
14897
|
const t = useTranslations52("ui.buttons");
|
|
14833
14898
|
const [isExpanded, setIsExpanded] = useState50(false);
|
|
14834
14899
|
const [showExpandButton, setShowExpandButton] = useState50(false);
|
|
14835
|
-
const contentRef =
|
|
14900
|
+
const contentRef = useRef27(null);
|
|
14836
14901
|
useEffect40(() => {
|
|
14837
14902
|
if (collapsible && contentRef.current && !isExpanded) {
|
|
14838
14903
|
const isOverflowing = contentRef.current.scrollHeight > contentRef.current.clientHeight;
|
|
@@ -15381,7 +15446,7 @@ function AllowedUsersDetails({ showTitle, content }) {
|
|
|
15381
15446
|
__name(AllowedUsersDetails, "AllowedUsersDetails");
|
|
15382
15447
|
|
|
15383
15448
|
// src/components/editors/BlockNoteEditorMentionHoverCard.tsx
|
|
15384
|
-
import { useCallback as useCallback28, useEffect as useEffect42, useRef as
|
|
15449
|
+
import { useCallback as useCallback28, useEffect as useEffect42, useRef as useRef28, useState as useState52 } from "react";
|
|
15385
15450
|
import { createPortal as createPortal3 } from "react-dom";
|
|
15386
15451
|
import { jsx as jsx164 } from "react/jsx-runtime";
|
|
15387
15452
|
function BlockNoteEditorMentionHoverCard({
|
|
@@ -15389,7 +15454,7 @@ function BlockNoteEditorMentionHoverCard({
|
|
|
15389
15454
|
mentionResolveFn
|
|
15390
15455
|
}) {
|
|
15391
15456
|
const [hovered, setHovered] = useState52(null);
|
|
15392
|
-
const closeTimeoutRef =
|
|
15457
|
+
const closeTimeoutRef = useRef28(null);
|
|
15393
15458
|
const scheduleClose = useCallback28(() => {
|
|
15394
15459
|
closeTimeoutRef.current = setTimeout(() => setHovered(null), 200);
|
|
15395
15460
|
}, []);
|
|
@@ -15648,12 +15713,12 @@ var BlockNoteViewerContainer = React28.memo(/* @__PURE__ */ __name(function View
|
|
|
15648
15713
|
}, "ViewerContainer"));
|
|
15649
15714
|
|
|
15650
15715
|
// src/components/pages/PageContainerContentDetails.tsx
|
|
15651
|
-
import { useEffect as useEffect43, useRef as
|
|
15716
|
+
import { useEffect as useEffect43, useRef as useRef29, useState as useState53 } from "react";
|
|
15652
15717
|
import { jsx as jsx168, jsxs as jsxs98 } from "react/jsx-runtime";
|
|
15653
15718
|
function PageContainerContentDetails({ items, section, module, id }) {
|
|
15654
15719
|
const rewriteUrl = useUrlRewriter();
|
|
15655
15720
|
const [isScrolled, setIsScrolled] = useState53(false);
|
|
15656
|
-
const sentinelRef =
|
|
15721
|
+
const sentinelRef = useRef29(null);
|
|
15657
15722
|
useEffect43(() => {
|
|
15658
15723
|
const sentinel = sentinelRef.current;
|
|
15659
15724
|
if (!sentinel) return;
|
|
@@ -15860,13 +15925,13 @@ function JsonApiProvider({ config, children }) {
|
|
|
15860
15925
|
__name(JsonApiProvider, "JsonApiProvider");
|
|
15861
15926
|
|
|
15862
15927
|
// src/client/hooks/useJsonApiGet.ts
|
|
15863
|
-
import { useState as useState55, useEffect as useEffect46, useCallback as useCallback30, useRef as
|
|
15928
|
+
import { useState as useState55, useEffect as useEffect46, useCallback as useCallback30, useRef as useRef30 } from "react";
|
|
15864
15929
|
function useJsonApiGet(params) {
|
|
15865
15930
|
const [data, setData] = useState55(null);
|
|
15866
15931
|
const [loading, setLoading] = useState55(false);
|
|
15867
15932
|
const [error, setError] = useState55(null);
|
|
15868
15933
|
const [response, setResponse] = useState55(null);
|
|
15869
|
-
const isMounted =
|
|
15934
|
+
const isMounted = useRef30(true);
|
|
15870
15935
|
const fetchData = useCallback30(async () => {
|
|
15871
15936
|
if (params.options?.enabled === false) return;
|
|
15872
15937
|
setLoading(true);
|
|
@@ -16670,12 +16735,12 @@ import React30, { memo, useMemo as useMemo30, useState as useState60 } from "rea
|
|
|
16670
16735
|
// src/components/tables/ContentTableSearch.tsx
|
|
16671
16736
|
import { RefreshCw, Search, X as X3 } from "lucide-react";
|
|
16672
16737
|
import { useTranslations as useTranslations57 } from "next-intl";
|
|
16673
|
-
import { useCallback as useCallback35, useEffect as useEffect50, useRef as
|
|
16738
|
+
import { useCallback as useCallback35, useEffect as useEffect50, useRef as useRef31, useState as useState59 } from "react";
|
|
16674
16739
|
import { jsx as jsx179, jsxs as jsxs101 } from "react/jsx-runtime";
|
|
16675
16740
|
function ContentTableSearch({ data }) {
|
|
16676
16741
|
const t = useTranslations57();
|
|
16677
|
-
const searchTermRef =
|
|
16678
|
-
const inputRef =
|
|
16742
|
+
const searchTermRef = useRef31("");
|
|
16743
|
+
const inputRef = useRef31(null);
|
|
16679
16744
|
const [searchTerm, setSearchTerm] = useState59("");
|
|
16680
16745
|
const [isFocused, setIsFocused] = useState59(false);
|
|
16681
16746
|
const [isSearching, setIsSearching] = useState59(false);
|
|
@@ -16961,12 +17026,12 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
|
|
|
16961
17026
|
}, "ContentListTable"));
|
|
16962
17027
|
|
|
16963
17028
|
// src/components/grids/ContentListGrid.tsx
|
|
16964
|
-
import { useEffect as useEffect51, useRef as
|
|
17029
|
+
import { useEffect as useEffect51, useRef as useRef32 } from "react";
|
|
16965
17030
|
import { Fragment as Fragment29, jsx as jsx181, jsxs as jsxs103 } from "react/jsx-runtime";
|
|
16966
17031
|
var DEFAULT_GRID_CLASSES = "grid grid-cols-2 gap-4 p-4 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5";
|
|
16967
17032
|
function ContentListGrid(props) {
|
|
16968
17033
|
const { data, ItemComponent, allowSearch, fullWidth, gridClassName } = props;
|
|
16969
|
-
const sentinelRef =
|
|
17034
|
+
const sentinelRef = useRef32(null);
|
|
16970
17035
|
useEffect51(() => {
|
|
16971
17036
|
if (!data.next || !sentinelRef.current) return;
|
|
16972
17037
|
const observer = new IntersectionObserver(
|
|
@@ -17010,14 +17075,14 @@ __name(ContentListGrid, "ContentListGrid");
|
|
|
17010
17075
|
|
|
17011
17076
|
// src/components/fiscal/ItalianFiscalData.tsx
|
|
17012
17077
|
import { useTranslations as useTranslations59 } from "next-intl";
|
|
17013
|
-
import { forwardRef as forwardRef8, useCallback as useCallback36, useImperativeHandle as useImperativeHandle2, useRef as
|
|
17078
|
+
import { forwardRef as forwardRef8, useCallback as useCallback36, useImperativeHandle as useImperativeHandle2, useRef as useRef33, useState as useState61 } from "react";
|
|
17014
17079
|
import { z as z4 } from "zod";
|
|
17015
17080
|
import { jsx as jsx182, jsxs as jsxs104 } from "react/jsx-runtime";
|
|
17016
17081
|
var ItalianFiscalData = forwardRef8(/* @__PURE__ */ __name(function ItalianFiscalData2({ initialData }, ref) {
|
|
17017
17082
|
const t = useTranslations59();
|
|
17018
|
-
const initialRef =
|
|
17083
|
+
const initialRef = useRef33(initialData);
|
|
17019
17084
|
const [fiscalData, setFiscalData] = useState61(initialData);
|
|
17020
|
-
const fiscalDataRef =
|
|
17085
|
+
const fiscalDataRef = useRef33(initialData);
|
|
17021
17086
|
const [fiscalErrors, setFiscalErrors] = useState61({});
|
|
17022
17087
|
const updateFiscalField = useCallback36((key, value) => {
|
|
17023
17088
|
setFiscalData((prev) => {
|
|
@@ -17742,11 +17807,11 @@ import { useTranslations as useTranslations63 } from "next-intl";
|
|
|
17742
17807
|
import { useState as useState66 } from "react";
|
|
17743
17808
|
|
|
17744
17809
|
// src/features/auth/components/two-factor/TotpInput.tsx
|
|
17745
|
-
import { useEffect as useEffect53, useRef as
|
|
17810
|
+
import { useEffect as useEffect53, useRef as useRef34, useState as useState65 } from "react";
|
|
17746
17811
|
import { jsx as jsx193, jsxs as jsxs111 } from "react/jsx-runtime";
|
|
17747
17812
|
function TotpInput({ onComplete, disabled = false, autoFocus = true, error }) {
|
|
17748
17813
|
const [digits, setDigits] = useState65(["", "", "", "", "", ""]);
|
|
17749
|
-
const inputRefs =
|
|
17814
|
+
const inputRefs = useRef34([]);
|
|
17750
17815
|
useEffect53(() => {
|
|
17751
17816
|
if (autoFocus && inputRefs.current[0]) {
|
|
17752
17817
|
inputRefs.current[0].focus();
|
|
@@ -19235,7 +19300,7 @@ __name(RelevantContentsList, "RelevantContentsList");
|
|
|
19235
19300
|
// src/features/how-to/components/containers/HowToCommand.tsx
|
|
19236
19301
|
import { ArrowRight, LifeBuoyIcon } from "lucide-react";
|
|
19237
19302
|
import { useTranslations as useTranslations81 } from "next-intl";
|
|
19238
|
-
import { useCallback as useCallback38, useEffect as useEffect62, useMemo as useMemo33, useRef as
|
|
19303
|
+
import { useCallback as useCallback38, useEffect as useEffect62, useMemo as useMemo33, useRef as useRef35, useState as useState80 } from "react";
|
|
19239
19304
|
|
|
19240
19305
|
// src/features/how-to/components/containers/HowToCommandViewer.tsx
|
|
19241
19306
|
import { ArrowLeft, BookOpen, MessageSquare } from "lucide-react";
|
|
@@ -19363,7 +19428,7 @@ function HowToCommand({ pathname, extraGroups, onStartChat }) {
|
|
|
19363
19428
|
const t = useTranslations81();
|
|
19364
19429
|
const [dialogOpen, setDialogOpen] = useState80(false);
|
|
19365
19430
|
const [selectedHowTo, setSelectedHowTo] = useState80(null);
|
|
19366
|
-
const searchTermRef =
|
|
19431
|
+
const searchTermRef = useRef35("");
|
|
19367
19432
|
const [searchTerm, setSearchTerm] = useState80("");
|
|
19368
19433
|
const data = useDataListRetriever({
|
|
19369
19434
|
retriever: /* @__PURE__ */ __name((params) => {
|
|
@@ -19673,7 +19738,7 @@ __name(HowToListContainer, "HowToListContainer");
|
|
|
19673
19738
|
// src/features/how-to/components/forms/HowToSelector.tsx
|
|
19674
19739
|
import { CircleX as CircleX3, RefreshCwIcon as RefreshCwIcon4, SearchIcon as SearchIcon7, XIcon as XIcon11 } from "lucide-react";
|
|
19675
19740
|
import { useTranslations as useTranslations85 } from "next-intl";
|
|
19676
|
-
import { useCallback as useCallback39, useEffect as useEffect63, useRef as
|
|
19741
|
+
import { useCallback as useCallback39, useEffect as useEffect63, useRef as useRef36, useState as useState81 } from "react";
|
|
19677
19742
|
import { Fragment as Fragment44, jsx as jsx222, jsxs as jsxs130 } from "react/jsx-runtime";
|
|
19678
19743
|
function HowToSelector({
|
|
19679
19744
|
id,
|
|
@@ -19685,7 +19750,7 @@ function HowToSelector({
|
|
|
19685
19750
|
}) {
|
|
19686
19751
|
const t = useTranslations85();
|
|
19687
19752
|
const [open, setOpen] = useState81(false);
|
|
19688
|
-
const searchTermRef =
|
|
19753
|
+
const searchTermRef = useRef36("");
|
|
19689
19754
|
const [searchTerm, setSearchTerm] = useState81("");
|
|
19690
19755
|
const [isSearching, setIsSearching] = useState81(false);
|
|
19691
19756
|
const data = useDataListRetriever({
|
|
@@ -19991,7 +20056,7 @@ function AssistantThreadHeader({ assistant, onRename, onDelete }) {
|
|
|
19991
20056
|
__name(AssistantThreadHeader, "AssistantThreadHeader");
|
|
19992
20057
|
|
|
19993
20058
|
// src/features/assistant/components/parts/AssistantThread.tsx
|
|
19994
|
-
import { useEffect as useEffect65, useRef as
|
|
20059
|
+
import { useEffect as useEffect65, useRef as useRef37 } from "react";
|
|
19995
20060
|
|
|
19996
20061
|
// src/features/assistant-message/components/MessageItem.tsx
|
|
19997
20062
|
import { useTranslations as useTranslations96 } from "next-intl";
|
|
@@ -20629,7 +20694,7 @@ function AssistantThread({
|
|
|
20629
20694
|
renderApprovalAction,
|
|
20630
20695
|
renderMention
|
|
20631
20696
|
}) {
|
|
20632
|
-
const endRef =
|
|
20697
|
+
const endRef = useRef37(null);
|
|
20633
20698
|
useEffect65(() => {
|
|
20634
20699
|
endRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
20635
20700
|
}, [messages.length, sending]);
|
|
@@ -21102,10 +21167,10 @@ __name(NotificationsListContainer, "NotificationsListContainer");
|
|
|
21102
21167
|
// src/features/notification/components/modals/NotificationModal.tsx
|
|
21103
21168
|
import { BellIcon } from "lucide-react";
|
|
21104
21169
|
import { useTranslations as useTranslations103 } from "next-intl";
|
|
21105
|
-
import { Fragment as Fragment51, useCallback as useCallback42, useEffect as useEffect67, useMemo as useMemo38, useRef as
|
|
21170
|
+
import { Fragment as Fragment51, useCallback as useCallback42, useEffect as useEffect67, useMemo as useMemo38, useRef as useRef38, useState as useState90 } from "react";
|
|
21106
21171
|
import { jsx as jsx247, jsxs as jsxs151 } from "react/jsx-runtime";
|
|
21107
21172
|
function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
21108
|
-
const _instanceId =
|
|
21173
|
+
const _instanceId = useRef38(Math.random().toString(36).substr(2, 9));
|
|
21109
21174
|
const {
|
|
21110
21175
|
notifications,
|
|
21111
21176
|
addNotification,
|
|
@@ -21125,8 +21190,8 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
21125
21190
|
const t = useTranslations103();
|
|
21126
21191
|
const generateUrl = usePageUrlGenerator();
|
|
21127
21192
|
const [newNotifications, setNewNotifications] = useState90(false);
|
|
21128
|
-
const preventAutoClose =
|
|
21129
|
-
const circuitBreakerRef =
|
|
21193
|
+
const preventAutoClose = useRef38(false);
|
|
21194
|
+
const circuitBreakerRef = useRef38({
|
|
21130
21195
|
count: 0,
|
|
21131
21196
|
resetTime: 0,
|
|
21132
21197
|
isOpen: false
|
|
@@ -21156,7 +21221,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
21156
21221
|
useEffect67(() => {
|
|
21157
21222
|
setNewNotifications(unreadCount > 0);
|
|
21158
21223
|
}, [unreadCount]);
|
|
21159
|
-
const processSocketNotificationsRef =
|
|
21224
|
+
const processSocketNotificationsRef = useRef38(null);
|
|
21160
21225
|
const processSocketNotifications = useCallback42(() => {
|
|
21161
21226
|
if (socketNotifications.length === 0) {
|
|
21162
21227
|
return;
|
|
@@ -21317,7 +21382,7 @@ __name(ReferralCodeCapture, "ReferralCodeCapture");
|
|
|
21317
21382
|
|
|
21318
21383
|
// src/features/referral/components/ReferralWidget.tsx
|
|
21319
21384
|
import { Copy as Copy2, Loader2 as Loader26, Mail, Users } from "lucide-react";
|
|
21320
|
-
import { useCallback as useCallback43, useRef as
|
|
21385
|
+
import { useCallback as useCallback43, useRef as useRef39, useState as useState93 } from "react";
|
|
21321
21386
|
|
|
21322
21387
|
// src/features/referral/hooks/useReferralInvite.ts
|
|
21323
21388
|
import { useState as useState91 } from "react";
|
|
@@ -21423,7 +21488,7 @@ function ReferralWidget({
|
|
|
21423
21488
|
const { sendInvite, sending } = useReferralInvite();
|
|
21424
21489
|
const [email, setEmail] = useState93("");
|
|
21425
21490
|
const [copied, setCopied] = useState93(false);
|
|
21426
|
-
const linkInputRef =
|
|
21491
|
+
const linkInputRef = useRef39(null);
|
|
21427
21492
|
const config = getReferralConfig();
|
|
21428
21493
|
const baseUrl = config.referralUrlBase || (typeof window !== "undefined" ? window.location.origin : "");
|
|
21429
21494
|
const referralUrl = stats?.referralCode ? `${baseUrl}${config.referralPath}?${config.urlParamName}=${stats.referralCode}` : "";
|
|
@@ -21711,11 +21776,11 @@ __name(RemoveUserFromRole, "RemoveUserFromRole");
|
|
|
21711
21776
|
// src/features/role/components/forms/UserRoleAdd.tsx
|
|
21712
21777
|
import { PlusCircle as PlusCircle2 } from "lucide-react";
|
|
21713
21778
|
import { useTranslations as useTranslations107 } from "next-intl";
|
|
21714
|
-
import { useCallback as useCallback44, useEffect as useEffect71, useRef as
|
|
21779
|
+
import { useCallback as useCallback44, useEffect as useEffect71, useRef as useRef40, useState as useState95 } from "react";
|
|
21715
21780
|
import { Fragment as Fragment55, jsx as jsx255, jsxs as jsxs157 } from "react/jsx-runtime";
|
|
21716
21781
|
function UserRoleAdd({ user, refresh }) {
|
|
21717
21782
|
const [open, setOpen] = useState95(false);
|
|
21718
|
-
const inputRef =
|
|
21783
|
+
const inputRef = useRef40(null);
|
|
21719
21784
|
const [searchTerm, setSearchTerm] = useState95("");
|
|
21720
21785
|
const [roles, setRoles] = useState95([]);
|
|
21721
21786
|
const t = useTranslations107();
|
|
@@ -23145,7 +23210,7 @@ __name(WaitlistList, "WaitlistList");
|
|
|
23145
23210
|
// src/features/rbac/components/RbacContainer.tsx
|
|
23146
23211
|
import { Loader2Icon as Loader2Icon4 } from "lucide-react";
|
|
23147
23212
|
import { useTranslations as useTranslations116 } from "next-intl";
|
|
23148
|
-
import { memo as memo2, useCallback as useCallback52, useEffect as useEffect75, useMemo as useMemo40, useRef as
|
|
23213
|
+
import { memo as memo2, useCallback as useCallback52, useEffect as useEffect75, useMemo as useMemo40, useRef as useRef41, useState as useState103 } from "react";
|
|
23149
23214
|
|
|
23150
23215
|
// src/features/rbac/components/RbacPermissionCell.tsx
|
|
23151
23216
|
import { CheckIcon as CheckIcon9, MinusIcon as MinusIcon2, XIcon as XIcon12 } from "lucide-react";
|
|
@@ -23414,7 +23479,7 @@ var CellButton = memo2(/* @__PURE__ */ __name(function CellButton2({
|
|
|
23414
23479
|
isRoleColumn,
|
|
23415
23480
|
onOpen
|
|
23416
23481
|
}) {
|
|
23417
|
-
const ref =
|
|
23482
|
+
const ref = useRef41(null);
|
|
23418
23483
|
const value = cellValue(tokens, action);
|
|
23419
23484
|
const handleClick = useCallback52(() => {
|
|
23420
23485
|
if (!ref.current) return;
|
|
@@ -23600,7 +23665,7 @@ __name(RbacContainer, "RbacContainer");
|
|
|
23600
23665
|
// src/features/rbac/components/RbacByRoleContainer.tsx
|
|
23601
23666
|
import { Loader2Icon as Loader2Icon5 } from "lucide-react";
|
|
23602
23667
|
import { useTranslations as useTranslations117 } from "next-intl";
|
|
23603
|
-
import { Fragment as Fragment59, memo as memo3, useCallback as useCallback53, useEffect as useEffect76, useMemo as useMemo41, useRef as
|
|
23668
|
+
import { Fragment as Fragment59, memo as memo3, useCallback as useCallback53, useEffect as useEffect76, useMemo as useMemo41, useRef as useRef42, useState as useState104 } from "react";
|
|
23604
23669
|
import { jsx as jsx279, jsxs as jsxs179 } from "react/jsx-runtime";
|
|
23605
23670
|
function findToken2(tokens, action) {
|
|
23606
23671
|
if (!tokens) return void 0;
|
|
@@ -23621,7 +23686,7 @@ var CellButton3 = memo3(/* @__PURE__ */ __name(function CellButton4({
|
|
|
23621
23686
|
isRoleColumn,
|
|
23622
23687
|
onOpen
|
|
23623
23688
|
}) {
|
|
23624
|
-
const ref =
|
|
23689
|
+
const ref = useRef42(null);
|
|
23625
23690
|
const value = cellValue2(tokens, action);
|
|
23626
23691
|
const handleClick = useCallback53(() => {
|
|
23627
23692
|
if (!ref.current) return;
|
|
@@ -24327,4 +24392,4 @@ export {
|
|
|
24327
24392
|
useOAuthClients,
|
|
24328
24393
|
useOAuthClient
|
|
24329
24394
|
};
|
|
24330
|
-
//# sourceMappingURL=chunk-
|
|
24395
|
+
//# sourceMappingURL=chunk-PGW2OP3L.mjs.map
|