@carlonicora/nextjs-jsonapi 2.1.3 → 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-76GLONZJ.js → BlockNoteEditor-5TMQ5YCD.js} +9 -9
- package/dist/{BlockNoteEditor-76GLONZJ.js.map → BlockNoteEditor-5TMQ5YCD.js.map} +1 -1
- package/dist/{BlockNoteEditor-75CHO24E.mjs → BlockNoteEditor-HAUE4EPR.mjs} +2 -2
- package/dist/billing/index.js +310 -310
- package/dist/billing/index.mjs +1 -1
- package/dist/{chunk-BFCCVHJ7.js → chunk-HPKCZMQX.js} +92 -30
- package/dist/chunk-HPKCZMQX.js.map +1 -0
- package/dist/{chunk-KIFJ7JRO.mjs → chunk-PGW2OP3L.mjs} +135 -73
- 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/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-BFCCVHJ7.js.map +0 -1
- package/dist/chunk-KIFJ7JRO.mjs.map +0 -1
- /package/dist/{BlockNoteEditor-75CHO24E.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, "_")}`;
|
|
@@ -14757,25 +14794,50 @@ __name(PageSection, "PageSection");
|
|
|
14757
14794
|
import { useAtomValue } from "jotai";
|
|
14758
14795
|
import { HistoryIcon } from "lucide-react";
|
|
14759
14796
|
import { useTranslations as useTranslations51 } from "next-intl";
|
|
14797
|
+
import { usePathname as usePathname4 } from "next/navigation";
|
|
14760
14798
|
import { jsx as jsx157, jsxs as jsxs90 } from "react/jsx-runtime";
|
|
14761
14799
|
function RecentPagesNavigator() {
|
|
14762
14800
|
const recentPages = useAtomValue(recentPagesAtom);
|
|
14763
14801
|
const t = useTranslations51();
|
|
14764
|
-
const {
|
|
14765
|
-
|
|
14766
|
-
|
|
14767
|
-
|
|
14768
|
-
|
|
14769
|
-
|
|
14770
|
-
/* @__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: [
|
|
14771
14826
|
/* @__PURE__ */ jsx157(DropdownMenuLabel, { children: t(`common.recent_pages`) }),
|
|
14772
14827
|
/* @__PURE__ */ jsx157(DropdownMenuSeparator, {}),
|
|
14773
|
-
|
|
14774
|
-
|
|
14775
|
-
|
|
14776
|
-
|
|
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
|
+
))
|
|
14777
14839
|
] }) })
|
|
14778
|
-
] });
|
|
14840
|
+
] }) });
|
|
14779
14841
|
}
|
|
14780
14842
|
__name(RecentPagesNavigator, "RecentPagesNavigator");
|
|
14781
14843
|
|
|
@@ -14822,7 +14884,7 @@ __name(partitionTabs, "partitionTabs");
|
|
|
14822
14884
|
// src/components/containers/ReactMarkdownContainer.tsx
|
|
14823
14885
|
import { ChevronDown as ChevronDown2, ChevronUp } from "lucide-react";
|
|
14824
14886
|
import { useTranslations as useTranslations52 } from "next-intl";
|
|
14825
|
-
import { useEffect as useEffect40, useRef as
|
|
14887
|
+
import { useEffect as useEffect40, useRef as useRef27, useState as useState50 } from "react";
|
|
14826
14888
|
import ReactMarkdown from "react-markdown";
|
|
14827
14889
|
import remarkGfm from "remark-gfm";
|
|
14828
14890
|
import { jsx as jsx159, jsxs as jsxs92 } from "react/jsx-runtime";
|
|
@@ -14835,7 +14897,7 @@ function ReactMarkdownContainer({
|
|
|
14835
14897
|
const t = useTranslations52("ui.buttons");
|
|
14836
14898
|
const [isExpanded, setIsExpanded] = useState50(false);
|
|
14837
14899
|
const [showExpandButton, setShowExpandButton] = useState50(false);
|
|
14838
|
-
const contentRef =
|
|
14900
|
+
const contentRef = useRef27(null);
|
|
14839
14901
|
useEffect40(() => {
|
|
14840
14902
|
if (collapsible && contentRef.current && !isExpanded) {
|
|
14841
14903
|
const isOverflowing = contentRef.current.scrollHeight > contentRef.current.clientHeight;
|
|
@@ -15384,7 +15446,7 @@ function AllowedUsersDetails({ showTitle, content }) {
|
|
|
15384
15446
|
__name(AllowedUsersDetails, "AllowedUsersDetails");
|
|
15385
15447
|
|
|
15386
15448
|
// src/components/editors/BlockNoteEditorMentionHoverCard.tsx
|
|
15387
|
-
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";
|
|
15388
15450
|
import { createPortal as createPortal3 } from "react-dom";
|
|
15389
15451
|
import { jsx as jsx164 } from "react/jsx-runtime";
|
|
15390
15452
|
function BlockNoteEditorMentionHoverCard({
|
|
@@ -15392,7 +15454,7 @@ function BlockNoteEditorMentionHoverCard({
|
|
|
15392
15454
|
mentionResolveFn
|
|
15393
15455
|
}) {
|
|
15394
15456
|
const [hovered, setHovered] = useState52(null);
|
|
15395
|
-
const closeTimeoutRef =
|
|
15457
|
+
const closeTimeoutRef = useRef28(null);
|
|
15396
15458
|
const scheduleClose = useCallback28(() => {
|
|
15397
15459
|
closeTimeoutRef.current = setTimeout(() => setHovered(null), 200);
|
|
15398
15460
|
}, []);
|
|
@@ -15651,12 +15713,12 @@ var BlockNoteViewerContainer = React28.memo(/* @__PURE__ */ __name(function View
|
|
|
15651
15713
|
}, "ViewerContainer"));
|
|
15652
15714
|
|
|
15653
15715
|
// src/components/pages/PageContainerContentDetails.tsx
|
|
15654
|
-
import { useEffect as useEffect43, useRef as
|
|
15716
|
+
import { useEffect as useEffect43, useRef as useRef29, useState as useState53 } from "react";
|
|
15655
15717
|
import { jsx as jsx168, jsxs as jsxs98 } from "react/jsx-runtime";
|
|
15656
15718
|
function PageContainerContentDetails({ items, section, module, id }) {
|
|
15657
15719
|
const rewriteUrl = useUrlRewriter();
|
|
15658
15720
|
const [isScrolled, setIsScrolled] = useState53(false);
|
|
15659
|
-
const sentinelRef =
|
|
15721
|
+
const sentinelRef = useRef29(null);
|
|
15660
15722
|
useEffect43(() => {
|
|
15661
15723
|
const sentinel = sentinelRef.current;
|
|
15662
15724
|
if (!sentinel) return;
|
|
@@ -15863,13 +15925,13 @@ function JsonApiProvider({ config, children }) {
|
|
|
15863
15925
|
__name(JsonApiProvider, "JsonApiProvider");
|
|
15864
15926
|
|
|
15865
15927
|
// src/client/hooks/useJsonApiGet.ts
|
|
15866
|
-
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";
|
|
15867
15929
|
function useJsonApiGet(params) {
|
|
15868
15930
|
const [data, setData] = useState55(null);
|
|
15869
15931
|
const [loading, setLoading] = useState55(false);
|
|
15870
15932
|
const [error, setError] = useState55(null);
|
|
15871
15933
|
const [response, setResponse] = useState55(null);
|
|
15872
|
-
const isMounted =
|
|
15934
|
+
const isMounted = useRef30(true);
|
|
15873
15935
|
const fetchData = useCallback30(async () => {
|
|
15874
15936
|
if (params.options?.enabled === false) return;
|
|
15875
15937
|
setLoading(true);
|
|
@@ -16673,12 +16735,12 @@ import React30, { memo, useMemo as useMemo30, useState as useState60 } from "rea
|
|
|
16673
16735
|
// src/components/tables/ContentTableSearch.tsx
|
|
16674
16736
|
import { RefreshCw, Search, X as X3 } from "lucide-react";
|
|
16675
16737
|
import { useTranslations as useTranslations57 } from "next-intl";
|
|
16676
|
-
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";
|
|
16677
16739
|
import { jsx as jsx179, jsxs as jsxs101 } from "react/jsx-runtime";
|
|
16678
16740
|
function ContentTableSearch({ data }) {
|
|
16679
16741
|
const t = useTranslations57();
|
|
16680
|
-
const searchTermRef =
|
|
16681
|
-
const inputRef =
|
|
16742
|
+
const searchTermRef = useRef31("");
|
|
16743
|
+
const inputRef = useRef31(null);
|
|
16682
16744
|
const [searchTerm, setSearchTerm] = useState59("");
|
|
16683
16745
|
const [isFocused, setIsFocused] = useState59(false);
|
|
16684
16746
|
const [isSearching, setIsSearching] = useState59(false);
|
|
@@ -16964,12 +17026,12 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
|
|
|
16964
17026
|
}, "ContentListTable"));
|
|
16965
17027
|
|
|
16966
17028
|
// src/components/grids/ContentListGrid.tsx
|
|
16967
|
-
import { useEffect as useEffect51, useRef as
|
|
17029
|
+
import { useEffect as useEffect51, useRef as useRef32 } from "react";
|
|
16968
17030
|
import { Fragment as Fragment29, jsx as jsx181, jsxs as jsxs103 } from "react/jsx-runtime";
|
|
16969
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";
|
|
16970
17032
|
function ContentListGrid(props) {
|
|
16971
17033
|
const { data, ItemComponent, allowSearch, fullWidth, gridClassName } = props;
|
|
16972
|
-
const sentinelRef =
|
|
17034
|
+
const sentinelRef = useRef32(null);
|
|
16973
17035
|
useEffect51(() => {
|
|
16974
17036
|
if (!data.next || !sentinelRef.current) return;
|
|
16975
17037
|
const observer = new IntersectionObserver(
|
|
@@ -17013,14 +17075,14 @@ __name(ContentListGrid, "ContentListGrid");
|
|
|
17013
17075
|
|
|
17014
17076
|
// src/components/fiscal/ItalianFiscalData.tsx
|
|
17015
17077
|
import { useTranslations as useTranslations59 } from "next-intl";
|
|
17016
|
-
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";
|
|
17017
17079
|
import { z as z4 } from "zod";
|
|
17018
17080
|
import { jsx as jsx182, jsxs as jsxs104 } from "react/jsx-runtime";
|
|
17019
17081
|
var ItalianFiscalData = forwardRef8(/* @__PURE__ */ __name(function ItalianFiscalData2({ initialData }, ref) {
|
|
17020
17082
|
const t = useTranslations59();
|
|
17021
|
-
const initialRef =
|
|
17083
|
+
const initialRef = useRef33(initialData);
|
|
17022
17084
|
const [fiscalData, setFiscalData] = useState61(initialData);
|
|
17023
|
-
const fiscalDataRef =
|
|
17085
|
+
const fiscalDataRef = useRef33(initialData);
|
|
17024
17086
|
const [fiscalErrors, setFiscalErrors] = useState61({});
|
|
17025
17087
|
const updateFiscalField = useCallback36((key, value) => {
|
|
17026
17088
|
setFiscalData((prev) => {
|
|
@@ -17745,11 +17807,11 @@ import { useTranslations as useTranslations63 } from "next-intl";
|
|
|
17745
17807
|
import { useState as useState66 } from "react";
|
|
17746
17808
|
|
|
17747
17809
|
// src/features/auth/components/two-factor/TotpInput.tsx
|
|
17748
|
-
import { useEffect as useEffect53, useRef as
|
|
17810
|
+
import { useEffect as useEffect53, useRef as useRef34, useState as useState65 } from "react";
|
|
17749
17811
|
import { jsx as jsx193, jsxs as jsxs111 } from "react/jsx-runtime";
|
|
17750
17812
|
function TotpInput({ onComplete, disabled = false, autoFocus = true, error }) {
|
|
17751
17813
|
const [digits, setDigits] = useState65(["", "", "", "", "", ""]);
|
|
17752
|
-
const inputRefs =
|
|
17814
|
+
const inputRefs = useRef34([]);
|
|
17753
17815
|
useEffect53(() => {
|
|
17754
17816
|
if (autoFocus && inputRefs.current[0]) {
|
|
17755
17817
|
inputRefs.current[0].focus();
|
|
@@ -19238,7 +19300,7 @@ __name(RelevantContentsList, "RelevantContentsList");
|
|
|
19238
19300
|
// src/features/how-to/components/containers/HowToCommand.tsx
|
|
19239
19301
|
import { ArrowRight, LifeBuoyIcon } from "lucide-react";
|
|
19240
19302
|
import { useTranslations as useTranslations81 } from "next-intl";
|
|
19241
|
-
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";
|
|
19242
19304
|
|
|
19243
19305
|
// src/features/how-to/components/containers/HowToCommandViewer.tsx
|
|
19244
19306
|
import { ArrowLeft, BookOpen, MessageSquare } from "lucide-react";
|
|
@@ -19366,7 +19428,7 @@ function HowToCommand({ pathname, extraGroups, onStartChat }) {
|
|
|
19366
19428
|
const t = useTranslations81();
|
|
19367
19429
|
const [dialogOpen, setDialogOpen] = useState80(false);
|
|
19368
19430
|
const [selectedHowTo, setSelectedHowTo] = useState80(null);
|
|
19369
|
-
const searchTermRef =
|
|
19431
|
+
const searchTermRef = useRef35("");
|
|
19370
19432
|
const [searchTerm, setSearchTerm] = useState80("");
|
|
19371
19433
|
const data = useDataListRetriever({
|
|
19372
19434
|
retriever: /* @__PURE__ */ __name((params) => {
|
|
@@ -19676,7 +19738,7 @@ __name(HowToListContainer, "HowToListContainer");
|
|
|
19676
19738
|
// src/features/how-to/components/forms/HowToSelector.tsx
|
|
19677
19739
|
import { CircleX as CircleX3, RefreshCwIcon as RefreshCwIcon4, SearchIcon as SearchIcon7, XIcon as XIcon11 } from "lucide-react";
|
|
19678
19740
|
import { useTranslations as useTranslations85 } from "next-intl";
|
|
19679
|
-
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";
|
|
19680
19742
|
import { Fragment as Fragment44, jsx as jsx222, jsxs as jsxs130 } from "react/jsx-runtime";
|
|
19681
19743
|
function HowToSelector({
|
|
19682
19744
|
id,
|
|
@@ -19688,7 +19750,7 @@ function HowToSelector({
|
|
|
19688
19750
|
}) {
|
|
19689
19751
|
const t = useTranslations85();
|
|
19690
19752
|
const [open, setOpen] = useState81(false);
|
|
19691
|
-
const searchTermRef =
|
|
19753
|
+
const searchTermRef = useRef36("");
|
|
19692
19754
|
const [searchTerm, setSearchTerm] = useState81("");
|
|
19693
19755
|
const [isSearching, setIsSearching] = useState81(false);
|
|
19694
19756
|
const data = useDataListRetriever({
|
|
@@ -19994,7 +20056,7 @@ function AssistantThreadHeader({ assistant, onRename, onDelete }) {
|
|
|
19994
20056
|
__name(AssistantThreadHeader, "AssistantThreadHeader");
|
|
19995
20057
|
|
|
19996
20058
|
// src/features/assistant/components/parts/AssistantThread.tsx
|
|
19997
|
-
import { useEffect as useEffect65, useRef as
|
|
20059
|
+
import { useEffect as useEffect65, useRef as useRef37 } from "react";
|
|
19998
20060
|
|
|
19999
20061
|
// src/features/assistant-message/components/MessageItem.tsx
|
|
20000
20062
|
import { useTranslations as useTranslations96 } from "next-intl";
|
|
@@ -20632,7 +20694,7 @@ function AssistantThread({
|
|
|
20632
20694
|
renderApprovalAction,
|
|
20633
20695
|
renderMention
|
|
20634
20696
|
}) {
|
|
20635
|
-
const endRef =
|
|
20697
|
+
const endRef = useRef37(null);
|
|
20636
20698
|
useEffect65(() => {
|
|
20637
20699
|
endRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
20638
20700
|
}, [messages.length, sending]);
|
|
@@ -21105,10 +21167,10 @@ __name(NotificationsListContainer, "NotificationsListContainer");
|
|
|
21105
21167
|
// src/features/notification/components/modals/NotificationModal.tsx
|
|
21106
21168
|
import { BellIcon } from "lucide-react";
|
|
21107
21169
|
import { useTranslations as useTranslations103 } from "next-intl";
|
|
21108
|
-
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";
|
|
21109
21171
|
import { jsx as jsx247, jsxs as jsxs151 } from "react/jsx-runtime";
|
|
21110
21172
|
function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
21111
|
-
const _instanceId =
|
|
21173
|
+
const _instanceId = useRef38(Math.random().toString(36).substr(2, 9));
|
|
21112
21174
|
const {
|
|
21113
21175
|
notifications,
|
|
21114
21176
|
addNotification,
|
|
@@ -21128,8 +21190,8 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
21128
21190
|
const t = useTranslations103();
|
|
21129
21191
|
const generateUrl = usePageUrlGenerator();
|
|
21130
21192
|
const [newNotifications, setNewNotifications] = useState90(false);
|
|
21131
|
-
const preventAutoClose =
|
|
21132
|
-
const circuitBreakerRef =
|
|
21193
|
+
const preventAutoClose = useRef38(false);
|
|
21194
|
+
const circuitBreakerRef = useRef38({
|
|
21133
21195
|
count: 0,
|
|
21134
21196
|
resetTime: 0,
|
|
21135
21197
|
isOpen: false
|
|
@@ -21159,7 +21221,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
21159
21221
|
useEffect67(() => {
|
|
21160
21222
|
setNewNotifications(unreadCount > 0);
|
|
21161
21223
|
}, [unreadCount]);
|
|
21162
|
-
const processSocketNotificationsRef =
|
|
21224
|
+
const processSocketNotificationsRef = useRef38(null);
|
|
21163
21225
|
const processSocketNotifications = useCallback42(() => {
|
|
21164
21226
|
if (socketNotifications.length === 0) {
|
|
21165
21227
|
return;
|
|
@@ -21320,7 +21382,7 @@ __name(ReferralCodeCapture, "ReferralCodeCapture");
|
|
|
21320
21382
|
|
|
21321
21383
|
// src/features/referral/components/ReferralWidget.tsx
|
|
21322
21384
|
import { Copy as Copy2, Loader2 as Loader26, Mail, Users } from "lucide-react";
|
|
21323
|
-
import { useCallback as useCallback43, useRef as
|
|
21385
|
+
import { useCallback as useCallback43, useRef as useRef39, useState as useState93 } from "react";
|
|
21324
21386
|
|
|
21325
21387
|
// src/features/referral/hooks/useReferralInvite.ts
|
|
21326
21388
|
import { useState as useState91 } from "react";
|
|
@@ -21426,7 +21488,7 @@ function ReferralWidget({
|
|
|
21426
21488
|
const { sendInvite, sending } = useReferralInvite();
|
|
21427
21489
|
const [email, setEmail] = useState93("");
|
|
21428
21490
|
const [copied, setCopied] = useState93(false);
|
|
21429
|
-
const linkInputRef =
|
|
21491
|
+
const linkInputRef = useRef39(null);
|
|
21430
21492
|
const config = getReferralConfig();
|
|
21431
21493
|
const baseUrl = config.referralUrlBase || (typeof window !== "undefined" ? window.location.origin : "");
|
|
21432
21494
|
const referralUrl = stats?.referralCode ? `${baseUrl}${config.referralPath}?${config.urlParamName}=${stats.referralCode}` : "";
|
|
@@ -21714,11 +21776,11 @@ __name(RemoveUserFromRole, "RemoveUserFromRole");
|
|
|
21714
21776
|
// src/features/role/components/forms/UserRoleAdd.tsx
|
|
21715
21777
|
import { PlusCircle as PlusCircle2 } from "lucide-react";
|
|
21716
21778
|
import { useTranslations as useTranslations107 } from "next-intl";
|
|
21717
|
-
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";
|
|
21718
21780
|
import { Fragment as Fragment55, jsx as jsx255, jsxs as jsxs157 } from "react/jsx-runtime";
|
|
21719
21781
|
function UserRoleAdd({ user, refresh }) {
|
|
21720
21782
|
const [open, setOpen] = useState95(false);
|
|
21721
|
-
const inputRef =
|
|
21783
|
+
const inputRef = useRef40(null);
|
|
21722
21784
|
const [searchTerm, setSearchTerm] = useState95("");
|
|
21723
21785
|
const [roles, setRoles] = useState95([]);
|
|
21724
21786
|
const t = useTranslations107();
|
|
@@ -23148,7 +23210,7 @@ __name(WaitlistList, "WaitlistList");
|
|
|
23148
23210
|
// src/features/rbac/components/RbacContainer.tsx
|
|
23149
23211
|
import { Loader2Icon as Loader2Icon4 } from "lucide-react";
|
|
23150
23212
|
import { useTranslations as useTranslations116 } from "next-intl";
|
|
23151
|
-
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";
|
|
23152
23214
|
|
|
23153
23215
|
// src/features/rbac/components/RbacPermissionCell.tsx
|
|
23154
23216
|
import { CheckIcon as CheckIcon9, MinusIcon as MinusIcon2, XIcon as XIcon12 } from "lucide-react";
|
|
@@ -23417,7 +23479,7 @@ var CellButton = memo2(/* @__PURE__ */ __name(function CellButton2({
|
|
|
23417
23479
|
isRoleColumn,
|
|
23418
23480
|
onOpen
|
|
23419
23481
|
}) {
|
|
23420
|
-
const ref =
|
|
23482
|
+
const ref = useRef41(null);
|
|
23421
23483
|
const value = cellValue(tokens, action);
|
|
23422
23484
|
const handleClick = useCallback52(() => {
|
|
23423
23485
|
if (!ref.current) return;
|
|
@@ -23603,7 +23665,7 @@ __name(RbacContainer, "RbacContainer");
|
|
|
23603
23665
|
// src/features/rbac/components/RbacByRoleContainer.tsx
|
|
23604
23666
|
import { Loader2Icon as Loader2Icon5 } from "lucide-react";
|
|
23605
23667
|
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
|
|
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";
|
|
23607
23669
|
import { jsx as jsx279, jsxs as jsxs179 } from "react/jsx-runtime";
|
|
23608
23670
|
function findToken2(tokens, action) {
|
|
23609
23671
|
if (!tokens) return void 0;
|
|
@@ -23624,7 +23686,7 @@ var CellButton3 = memo3(/* @__PURE__ */ __name(function CellButton4({
|
|
|
23624
23686
|
isRoleColumn,
|
|
23625
23687
|
onOpen
|
|
23626
23688
|
}) {
|
|
23627
|
-
const ref =
|
|
23689
|
+
const ref = useRef42(null);
|
|
23628
23690
|
const value = cellValue2(tokens, action);
|
|
23629
23691
|
const handleClick = useCallback53(() => {
|
|
23630
23692
|
if (!ref.current) return;
|
|
@@ -24330,4 +24392,4 @@ export {
|
|
|
24330
24392
|
useOAuthClients,
|
|
24331
24393
|
useOAuthClient
|
|
24332
24394
|
};
|
|
24333
|
-
//# sourceMappingURL=chunk-
|
|
24395
|
+
//# sourceMappingURL=chunk-PGW2OP3L.mjs.map
|