@carlonicora/nextjs-jsonapi 1.83.0 → 1.84.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-47TYA25C.js → BlockNoteEditor-PJWPR4IU.js} +6 -6
- package/dist/{BlockNoteEditor-47TYA25C.js.map → BlockNoteEditor-PJWPR4IU.js.map} +1 -1
- package/dist/{BlockNoteEditor-MA3MRV74.mjs → BlockNoteEditor-ZNACEXKX.mjs} +2 -2
- package/dist/billing/index.js +299 -299
- package/dist/billing/index.mjs +1 -1
- package/dist/{chunk-KWFEQXPF.js → chunk-B7ZH2R62.js} +104 -94
- package/dist/chunk-B7ZH2R62.js.map +1 -0
- package/dist/{chunk-M4KMRVEE.mjs → chunk-CPXN5OGI.mjs} +144 -134
- package/dist/chunk-CPXN5OGI.mjs.map +1 -0
- package/dist/client/index.js +2 -2
- package/dist/client/index.mjs +1 -1
- 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/package.json +1 -1
- package/src/components/containers/RoundPageContainer.tsx +15 -2
- package/dist/chunk-KWFEQXPF.js.map +0 -1
- package/dist/chunk-M4KMRVEE.mjs.map +0 -1
- /package/dist/{BlockNoteEditor-MA3MRV74.mjs.map → BlockNoteEditor-ZNACEXKX.mjs.map} +0 -0
|
@@ -9200,7 +9200,7 @@ __name(FormCheckbox, "FormCheckbox");
|
|
|
9200
9200
|
import dynamic from "next/dynamic";
|
|
9201
9201
|
import React14 from "react";
|
|
9202
9202
|
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
9203
|
-
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-
|
|
9203
|
+
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-ZNACEXKX.mjs"), {
|
|
9204
9204
|
ssr: false
|
|
9205
9205
|
});
|
|
9206
9206
|
var BlockNoteEditorContainer = React14.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
|
|
@@ -13329,8 +13329,10 @@ __name(RoundPageContainerTitle, "RoundPageContainerTitle");
|
|
|
13329
13329
|
|
|
13330
13330
|
// src/components/containers/RoundPageContainer.tsx
|
|
13331
13331
|
import { useSearchParams } from "next/navigation";
|
|
13332
|
-
import { useState as useState46 } from "react";
|
|
13332
|
+
import { useCallback as useCallback25, useEffect as useEffect38, useState as useState46 } from "react";
|
|
13333
13333
|
import { Fragment as Fragment22, jsx as jsx147, jsxs as jsxs87 } from "react/jsx-runtime";
|
|
13334
|
+
var DETAILS_COOKIE_NAME = "round_page_details_state";
|
|
13335
|
+
var DETAILS_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
13334
13336
|
function RoundPageContainer({
|
|
13335
13337
|
module,
|
|
13336
13338
|
id,
|
|
@@ -13342,7 +13344,15 @@ function RoundPageContainer({
|
|
|
13342
13344
|
}) {
|
|
13343
13345
|
const headerChildren = useHeaderChildren();
|
|
13344
13346
|
const headerLeftContent = useHeaderLeftContent();
|
|
13345
|
-
const [showDetails,
|
|
13347
|
+
const [showDetails, setShowDetailsState] = useState46(false);
|
|
13348
|
+
useEffect38(() => {
|
|
13349
|
+
const match = document.cookie.split("; ").find((row) => row.startsWith(`${DETAILS_COOKIE_NAME}=`));
|
|
13350
|
+
if (match?.split("=")[1] === "true") setShowDetailsState(true);
|
|
13351
|
+
}, []);
|
|
13352
|
+
const setShowDetails = useCallback25((value) => {
|
|
13353
|
+
setShowDetailsState(value);
|
|
13354
|
+
document.cookie = `${DETAILS_COOKIE_NAME}=${value}; path=/; max-age=${DETAILS_COOKIE_MAX_AGE}`;
|
|
13355
|
+
}, []);
|
|
13346
13356
|
const searchParams = useSearchParams();
|
|
13347
13357
|
const section = searchParams.get("section");
|
|
13348
13358
|
const rewriteUrl = useUrlRewriter();
|
|
@@ -13460,13 +13470,13 @@ function AllowedUsersDetails({ showTitle, content }) {
|
|
|
13460
13470
|
__name(AllowedUsersDetails, "AllowedUsersDetails");
|
|
13461
13471
|
|
|
13462
13472
|
// src/components/pages/PageContainerContentDetails.tsx
|
|
13463
|
-
import { useEffect as
|
|
13473
|
+
import { useEffect as useEffect39, useRef as useRef22, useState as useState47 } from "react";
|
|
13464
13474
|
import { jsx as jsx150, jsxs as jsxs90 } from "react/jsx-runtime";
|
|
13465
13475
|
function PageContainerContentDetails({ items, section, module, id }) {
|
|
13466
13476
|
const rewriteUrl = useUrlRewriter();
|
|
13467
13477
|
const [isScrolled, setIsScrolled] = useState47(false);
|
|
13468
13478
|
const sentinelRef = useRef22(null);
|
|
13469
|
-
|
|
13479
|
+
useEffect39(() => {
|
|
13470
13480
|
const sentinel = sentinelRef.current;
|
|
13471
13481
|
if (!sentinel) return;
|
|
13472
13482
|
const observer = new IntersectionObserver(
|
|
@@ -13499,13 +13509,13 @@ function PageContainerContentDetails({ items, section, module, id }) {
|
|
|
13499
13509
|
__name(PageContainerContentDetails, "PageContainerContentDetails");
|
|
13500
13510
|
|
|
13501
13511
|
// src/components/pages/PageContentContainer.tsx
|
|
13502
|
-
import { useEffect as
|
|
13512
|
+
import { useEffect as useEffect40, useState as useState48 } from "react";
|
|
13503
13513
|
import { useDefaultLayout } from "react-resizable-panels";
|
|
13504
13514
|
import { jsx as jsx151, jsxs as jsxs91 } from "react/jsx-runtime";
|
|
13505
13515
|
function PageContentContainer({ header, details, footer, content, fullBleed }) {
|
|
13506
13516
|
const [mounted, setMounted] = useState48(false);
|
|
13507
13517
|
const isMobile = useIsMobile();
|
|
13508
|
-
|
|
13518
|
+
useEffect40(() => {
|
|
13509
13519
|
setMounted(true);
|
|
13510
13520
|
}, []);
|
|
13511
13521
|
const isReady = mounted && isMobile !== void 0;
|
|
@@ -13641,10 +13651,10 @@ var cellUrl = /* @__PURE__ */ __name((params) => {
|
|
|
13641
13651
|
}, "cellUrl");
|
|
13642
13652
|
|
|
13643
13653
|
// src/client/context/JsonApiProvider.tsx
|
|
13644
|
-
import { useEffect as
|
|
13654
|
+
import { useEffect as useEffect41, useMemo as useMemo19 } from "react";
|
|
13645
13655
|
import { jsx as jsx156 } from "react/jsx-runtime";
|
|
13646
13656
|
function JsonApiProvider({ config, children }) {
|
|
13647
|
-
|
|
13657
|
+
useEffect41(() => {
|
|
13648
13658
|
if (config.bootstrapper) {
|
|
13649
13659
|
config.bootstrapper();
|
|
13650
13660
|
}
|
|
@@ -13655,14 +13665,14 @@ function JsonApiProvider({ config, children }) {
|
|
|
13655
13665
|
__name(JsonApiProvider, "JsonApiProvider");
|
|
13656
13666
|
|
|
13657
13667
|
// src/client/hooks/useJsonApiGet.ts
|
|
13658
|
-
import { useState as useState49, useEffect as
|
|
13668
|
+
import { useState as useState49, useEffect as useEffect42, useCallback as useCallback26, useRef as useRef23 } from "react";
|
|
13659
13669
|
function useJsonApiGet(params) {
|
|
13660
13670
|
const [data, setData] = useState49(null);
|
|
13661
13671
|
const [loading, setLoading] = useState49(false);
|
|
13662
13672
|
const [error, setError] = useState49(null);
|
|
13663
13673
|
const [response, setResponse] = useState49(null);
|
|
13664
13674
|
const isMounted = useRef23(true);
|
|
13665
|
-
const fetchData =
|
|
13675
|
+
const fetchData = useCallback26(async () => {
|
|
13666
13676
|
if (params.options?.enabled === false) return;
|
|
13667
13677
|
setLoading(true);
|
|
13668
13678
|
setError(null);
|
|
@@ -13691,7 +13701,7 @@ function useJsonApiGet(params) {
|
|
|
13691
13701
|
}
|
|
13692
13702
|
}
|
|
13693
13703
|
}, [params.classKey, params.endpoint, params.companyId, params.options?.enabled]);
|
|
13694
|
-
const fetchNextPage =
|
|
13704
|
+
const fetchNextPage = useCallback26(async () => {
|
|
13695
13705
|
if (!response?.nextPage) return;
|
|
13696
13706
|
setLoading(true);
|
|
13697
13707
|
try {
|
|
@@ -13712,7 +13722,7 @@ function useJsonApiGet(params) {
|
|
|
13712
13722
|
}
|
|
13713
13723
|
}
|
|
13714
13724
|
}, [response]);
|
|
13715
|
-
const fetchPreviousPage =
|
|
13725
|
+
const fetchPreviousPage = useCallback26(async () => {
|
|
13716
13726
|
if (!response?.prevPage) return;
|
|
13717
13727
|
setLoading(true);
|
|
13718
13728
|
try {
|
|
@@ -13733,7 +13743,7 @@ function useJsonApiGet(params) {
|
|
|
13733
13743
|
}
|
|
13734
13744
|
}
|
|
13735
13745
|
}, [response]);
|
|
13736
|
-
|
|
13746
|
+
useEffect42(() => {
|
|
13737
13747
|
isMounted.current = true;
|
|
13738
13748
|
fetchData();
|
|
13739
13749
|
return () => {
|
|
@@ -13755,19 +13765,19 @@ function useJsonApiGet(params) {
|
|
|
13755
13765
|
__name(useJsonApiGet, "useJsonApiGet");
|
|
13756
13766
|
|
|
13757
13767
|
// src/client/hooks/useJsonApiMutation.ts
|
|
13758
|
-
import { useState as useState50, useCallback as
|
|
13768
|
+
import { useState as useState50, useCallback as useCallback27 } from "react";
|
|
13759
13769
|
function useJsonApiMutation(config) {
|
|
13760
13770
|
const [data, setData] = useState50(null);
|
|
13761
13771
|
const [loading, setLoading] = useState50(false);
|
|
13762
13772
|
const [error, setError] = useState50(null);
|
|
13763
13773
|
const [response, setResponse] = useState50(null);
|
|
13764
|
-
const reset =
|
|
13774
|
+
const reset = useCallback27(() => {
|
|
13765
13775
|
setData(null);
|
|
13766
13776
|
setLoading(false);
|
|
13767
13777
|
setError(null);
|
|
13768
13778
|
setResponse(null);
|
|
13769
13779
|
}, []);
|
|
13770
|
-
const mutate =
|
|
13780
|
+
const mutate = useCallback27(
|
|
13771
13781
|
async (params) => {
|
|
13772
13782
|
setLoading(true);
|
|
13773
13783
|
setError(null);
|
|
@@ -14164,7 +14174,7 @@ var useContentTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
14164
14174
|
|
|
14165
14175
|
// src/features/oauth/hooks/useOAuthClients.ts
|
|
14166
14176
|
import { useAtom as useAtom3, useSetAtom } from "jotai";
|
|
14167
|
-
import { useCallback as
|
|
14177
|
+
import { useCallback as useCallback28, useEffect as useEffect43 } from "react";
|
|
14168
14178
|
|
|
14169
14179
|
// src/features/oauth/atoms/oauth.atoms.ts
|
|
14170
14180
|
import { atom } from "jotai";
|
|
@@ -14226,7 +14236,7 @@ function useOAuthClients() {
|
|
|
14226
14236
|
const [error, setError] = useAtom3(oauthClientsErrorAtom);
|
|
14227
14237
|
const addClient = useSetAtom(addOAuthClientAtom);
|
|
14228
14238
|
const setNewClientSecret = useSetAtom(setNewClientSecretAtom);
|
|
14229
|
-
const fetchClients =
|
|
14239
|
+
const fetchClients = useCallback28(async () => {
|
|
14230
14240
|
setIsLoading(true);
|
|
14231
14241
|
setError(null);
|
|
14232
14242
|
try {
|
|
@@ -14239,10 +14249,10 @@ function useOAuthClients() {
|
|
|
14239
14249
|
setIsLoading(false);
|
|
14240
14250
|
}
|
|
14241
14251
|
}, [setClients, setIsLoading, setError]);
|
|
14242
|
-
|
|
14252
|
+
useEffect43(() => {
|
|
14243
14253
|
fetchClients();
|
|
14244
14254
|
}, [fetchClients]);
|
|
14245
|
-
const createClient =
|
|
14255
|
+
const createClient = useCallback28(
|
|
14246
14256
|
async (data) => {
|
|
14247
14257
|
setIsLoading(true);
|
|
14248
14258
|
setError(null);
|
|
@@ -14279,7 +14289,7 @@ __name(useOAuthClients, "useOAuthClients");
|
|
|
14279
14289
|
|
|
14280
14290
|
// src/features/oauth/hooks/useOAuthClient.ts
|
|
14281
14291
|
import { useAtomValue as useAtomValue2, useSetAtom as useSetAtom2 } from "jotai";
|
|
14282
|
-
import { useCallback as
|
|
14292
|
+
import { useCallback as useCallback29, useEffect as useEffect44, useState as useState51 } from "react";
|
|
14283
14293
|
function useOAuthClient(clientId) {
|
|
14284
14294
|
const storedClient = useAtomValue2(oauthClientByIdAtom(clientId));
|
|
14285
14295
|
const updateClientInStore = useSetAtom2(updateOAuthClientAtom);
|
|
@@ -14289,7 +14299,7 @@ function useOAuthClient(clientId) {
|
|
|
14289
14299
|
const [isLoading, setIsLoading] = useState51(false);
|
|
14290
14300
|
const [error, setError] = useState51(null);
|
|
14291
14301
|
const client = storedClient || fetchedClient;
|
|
14292
|
-
const fetchClient =
|
|
14302
|
+
const fetchClient = useCallback29(async () => {
|
|
14293
14303
|
if (!clientId) return;
|
|
14294
14304
|
setIsLoading(true);
|
|
14295
14305
|
setError(null);
|
|
@@ -14303,12 +14313,12 @@ function useOAuthClient(clientId) {
|
|
|
14303
14313
|
setIsLoading(false);
|
|
14304
14314
|
}
|
|
14305
14315
|
}, [clientId]);
|
|
14306
|
-
|
|
14316
|
+
useEffect44(() => {
|
|
14307
14317
|
if (!storedClient && clientId) {
|
|
14308
14318
|
fetchClient();
|
|
14309
14319
|
}
|
|
14310
14320
|
}, [storedClient, clientId, fetchClient]);
|
|
14311
|
-
const update =
|
|
14321
|
+
const update = useCallback29(
|
|
14312
14322
|
async (data) => {
|
|
14313
14323
|
if (!clientId) throw new Error("No client ID");
|
|
14314
14324
|
setIsLoading(true);
|
|
@@ -14328,7 +14338,7 @@ function useOAuthClient(clientId) {
|
|
|
14328
14338
|
},
|
|
14329
14339
|
[clientId, updateClientInStore]
|
|
14330
14340
|
);
|
|
14331
|
-
const deleteClient =
|
|
14341
|
+
const deleteClient = useCallback29(async () => {
|
|
14332
14342
|
if (!clientId) throw new Error("No client ID");
|
|
14333
14343
|
setIsLoading(true);
|
|
14334
14344
|
setError(null);
|
|
@@ -14344,7 +14354,7 @@ function useOAuthClient(clientId) {
|
|
|
14344
14354
|
setIsLoading(false);
|
|
14345
14355
|
}
|
|
14346
14356
|
}, [clientId, removeClientFromStore]);
|
|
14347
|
-
const regenerateSecret =
|
|
14357
|
+
const regenerateSecret = useCallback29(async () => {
|
|
14348
14358
|
if (!clientId) throw new Error("No client ID");
|
|
14349
14359
|
setIsLoading(true);
|
|
14350
14360
|
setError(null);
|
|
@@ -14377,13 +14387,13 @@ function useOAuthClient(clientId) {
|
|
|
14377
14387
|
__name(useOAuthClient, "useOAuthClient");
|
|
14378
14388
|
|
|
14379
14389
|
// src/features/oauth/hooks/useOAuthConsent.ts
|
|
14380
|
-
import { useCallback as
|
|
14390
|
+
import { useCallback as useCallback30, useEffect as useEffect45, useState as useState52 } from "react";
|
|
14381
14391
|
function useOAuthConsent(params) {
|
|
14382
14392
|
const [clientInfo, setClientInfo] = useState52(null);
|
|
14383
14393
|
const [isLoading, setIsLoading] = useState52(true);
|
|
14384
14394
|
const [error, setError] = useState52(null);
|
|
14385
14395
|
const [isSubmitting, setIsSubmitting] = useState52(false);
|
|
14386
|
-
|
|
14396
|
+
useEffect45(() => {
|
|
14387
14397
|
const fetchInfo = /* @__PURE__ */ __name(async () => {
|
|
14388
14398
|
if (!params.clientId || !params.redirectUri || !params.scope) {
|
|
14389
14399
|
setError(new Error("Missing required authorization parameters"));
|
|
@@ -14411,7 +14421,7 @@ function useOAuthConsent(params) {
|
|
|
14411
14421
|
params.codeChallenge,
|
|
14412
14422
|
params.codeChallengeMethod
|
|
14413
14423
|
]);
|
|
14414
|
-
const approve =
|
|
14424
|
+
const approve = useCallback30(async () => {
|
|
14415
14425
|
setIsSubmitting(true);
|
|
14416
14426
|
setError(null);
|
|
14417
14427
|
try {
|
|
@@ -14425,7 +14435,7 @@ function useOAuthConsent(params) {
|
|
|
14425
14435
|
setIsSubmitting(false);
|
|
14426
14436
|
}
|
|
14427
14437
|
}, [params]);
|
|
14428
|
-
const deny =
|
|
14438
|
+
const deny = useCallback30(async () => {
|
|
14429
14439
|
setIsSubmitting(true);
|
|
14430
14440
|
setError(null);
|
|
14431
14441
|
try {
|
|
@@ -14463,7 +14473,7 @@ import { memo, useMemo as useMemo25, useState as useState54 } from "react";
|
|
|
14463
14473
|
// src/components/tables/ContentTableSearch.tsx
|
|
14464
14474
|
import { RefreshCw, Search, X as X3 } from "lucide-react";
|
|
14465
14475
|
import { useTranslations as useTranslations55 } from "next-intl";
|
|
14466
|
-
import { useCallback as
|
|
14476
|
+
import { useCallback as useCallback31, useEffect as useEffect46, useRef as useRef24, useState as useState53 } from "react";
|
|
14467
14477
|
import { jsx as jsx160, jsxs as jsxs93 } from "react/jsx-runtime";
|
|
14468
14478
|
function ContentTableSearch({ data }) {
|
|
14469
14479
|
const t = useTranslations55();
|
|
@@ -14473,7 +14483,7 @@ function ContentTableSearch({ data }) {
|
|
|
14473
14483
|
const [isFocused, setIsFocused] = useState53(false);
|
|
14474
14484
|
const [isSearching, setIsSearching] = useState53(false);
|
|
14475
14485
|
const isExpanded = isFocused || searchTerm.length > 0;
|
|
14476
|
-
const search =
|
|
14486
|
+
const search = useCallback31(
|
|
14477
14487
|
async (searchedTerm) => {
|
|
14478
14488
|
try {
|
|
14479
14489
|
if (searchedTerm === searchTermRef.current) return;
|
|
@@ -14486,7 +14496,7 @@ function ContentTableSearch({ data }) {
|
|
|
14486
14496
|
[searchTermRef, data]
|
|
14487
14497
|
);
|
|
14488
14498
|
const updateSearchTerm = useDebounce2(search, 500);
|
|
14489
|
-
|
|
14499
|
+
useEffect46(() => {
|
|
14490
14500
|
setIsSearching(true);
|
|
14491
14501
|
updateSearchTerm(searchTerm);
|
|
14492
14502
|
}, [updateSearchTerm, searchTerm]);
|
|
@@ -14668,13 +14678,13 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
|
|
|
14668
14678
|
}, "ContentListTable"));
|
|
14669
14679
|
|
|
14670
14680
|
// src/components/grids/ContentListGrid.tsx
|
|
14671
|
-
import { useEffect as
|
|
14681
|
+
import { useEffect as useEffect47, useRef as useRef25 } from "react";
|
|
14672
14682
|
import { Fragment as Fragment27, jsx as jsx162, jsxs as jsxs95 } from "react/jsx-runtime";
|
|
14673
14683
|
var DEFAULT_GRID_CLASSES = "grid grid-cols-2 gap-4 p-4 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5";
|
|
14674
14684
|
function ContentListGrid(props) {
|
|
14675
14685
|
const { data, ItemComponent, allowSearch, fullWidth, gridClassName } = props;
|
|
14676
14686
|
const sentinelRef = useRef25(null);
|
|
14677
|
-
|
|
14687
|
+
useEffect47(() => {
|
|
14678
14688
|
if (!data.next || !sentinelRef.current) return;
|
|
14679
14689
|
const observer = new IntersectionObserver(
|
|
14680
14690
|
(entries) => {
|
|
@@ -14768,7 +14778,7 @@ __name(validateItalianTaxCode, "validateItalianTaxCode");
|
|
|
14768
14778
|
|
|
14769
14779
|
// src/components/fiscal/ItalianFiscalData.tsx
|
|
14770
14780
|
import { useTranslations as useTranslations56 } from "next-intl";
|
|
14771
|
-
import { forwardRef as forwardRef8, useCallback as
|
|
14781
|
+
import { forwardRef as forwardRef8, useCallback as useCallback32, useImperativeHandle as useImperativeHandle2, useRef as useRef26, useState as useState55 } from "react";
|
|
14772
14782
|
import { z as z4 } from "zod";
|
|
14773
14783
|
import { jsx as jsx163, jsxs as jsxs96 } from "react/jsx-runtime";
|
|
14774
14784
|
var ItalianFiscalData = forwardRef8(/* @__PURE__ */ __name(function ItalianFiscalData2({ initialData }, ref) {
|
|
@@ -14777,7 +14787,7 @@ var ItalianFiscalData = forwardRef8(/* @__PURE__ */ __name(function ItalianFisca
|
|
|
14777
14787
|
const [fiscalData, setFiscalData] = useState55(initialData);
|
|
14778
14788
|
const fiscalDataRef = useRef26(initialData);
|
|
14779
14789
|
const [fiscalErrors, setFiscalErrors] = useState55({});
|
|
14780
|
-
const updateFiscalField =
|
|
14790
|
+
const updateFiscalField = useCallback32((key, value) => {
|
|
14781
14791
|
setFiscalData((prev) => {
|
|
14782
14792
|
const next = { ...prev, [key]: value };
|
|
14783
14793
|
fiscalDataRef.current = next;
|
|
@@ -14889,7 +14899,7 @@ import { Loader2 as Loader23 } from "lucide-react";
|
|
|
14889
14899
|
import { useTranslations as useTranslations58 } from "next-intl";
|
|
14890
14900
|
import Image7 from "next/image";
|
|
14891
14901
|
import { useSearchParams as useSearchParams2 } from "next/navigation";
|
|
14892
|
-
import { useEffect as
|
|
14902
|
+
import { useEffect as useEffect48, useState as useState56 } from "react";
|
|
14893
14903
|
import { useForm as useForm5 } from "react-hook-form";
|
|
14894
14904
|
import { v4 as v45 } from "uuid";
|
|
14895
14905
|
import { z as z5 } from "zod";
|
|
@@ -14967,7 +14977,7 @@ function Register() {
|
|
|
14967
14977
|
registrationMode === "waitlist" && !!inviteCode
|
|
14968
14978
|
);
|
|
14969
14979
|
const [referralCode, setReferralCode2] = useState56(null);
|
|
14970
|
-
|
|
14980
|
+
useEffect48(() => {
|
|
14971
14981
|
const code = getReferralCode();
|
|
14972
14982
|
setReferralCode2(code);
|
|
14973
14983
|
}, []);
|
|
@@ -15000,7 +15010,7 @@ function Register() {
|
|
|
15000
15010
|
marketingConsent: false
|
|
15001
15011
|
}
|
|
15002
15012
|
});
|
|
15003
|
-
|
|
15013
|
+
useEffect48(() => {
|
|
15004
15014
|
async function validateInvite() {
|
|
15005
15015
|
if (registrationMode !== "waitlist" || !inviteCode) {
|
|
15006
15016
|
return;
|
|
@@ -15301,7 +15311,7 @@ __name(InnerAuthContainer, "InnerAuthContainer");
|
|
|
15301
15311
|
// src/features/auth/components/two-factor/TwoFactorSettings.tsx
|
|
15302
15312
|
import { ShieldAlert, ShieldCheck } from "lucide-react";
|
|
15303
15313
|
import { useTranslations as useTranslations65 } from "next-intl";
|
|
15304
|
-
import { useCallback as
|
|
15314
|
+
import { useCallback as useCallback33, useEffect as useEffect50, useState as useState65 } from "react";
|
|
15305
15315
|
import { v4 as v48 } from "uuid";
|
|
15306
15316
|
|
|
15307
15317
|
// src/features/auth/components/two-factor/BackupCodesDialog.tsx
|
|
@@ -15412,12 +15422,12 @@ import { useTranslations as useTranslations60 } from "next-intl";
|
|
|
15412
15422
|
import { useState as useState60 } from "react";
|
|
15413
15423
|
|
|
15414
15424
|
// src/features/auth/components/two-factor/TotpInput.tsx
|
|
15415
|
-
import { useEffect as
|
|
15425
|
+
import { useEffect as useEffect49, useRef as useRef27, useState as useState59 } from "react";
|
|
15416
15426
|
import { jsx as jsx169, jsxs as jsxs100 } from "react/jsx-runtime";
|
|
15417
15427
|
function TotpInput({ onComplete, disabled = false, autoFocus = true, error }) {
|
|
15418
15428
|
const [digits, setDigits] = useState59(["", "", "", "", "", ""]);
|
|
15419
15429
|
const inputRefs = useRef27([]);
|
|
15420
|
-
|
|
15430
|
+
useEffect49(() => {
|
|
15421
15431
|
if (autoFocus && inputRefs.current[0]) {
|
|
15422
15432
|
inputRefs.current[0].focus();
|
|
15423
15433
|
}
|
|
@@ -15905,7 +15915,7 @@ function TwoFactorSettings() {
|
|
|
15905
15915
|
const [isLoading, setIsLoading] = useState65(true);
|
|
15906
15916
|
const [isEnabling, setIsEnabling] = useState65(false);
|
|
15907
15917
|
const [passkeyDialogOpen, setPasskeyDialogOpen] = useState65(false);
|
|
15908
|
-
const loadStatus =
|
|
15918
|
+
const loadStatus = useCallback33(async () => {
|
|
15909
15919
|
try {
|
|
15910
15920
|
const [statusData, authenticatorsList, passkeysList] = await Promise.all([
|
|
15911
15921
|
TwoFactorService.getStatus(),
|
|
@@ -15921,7 +15931,7 @@ function TwoFactorSettings() {
|
|
|
15921
15931
|
setIsLoading(false);
|
|
15922
15932
|
}
|
|
15923
15933
|
}, [t]);
|
|
15924
|
-
|
|
15934
|
+
useEffect50(() => {
|
|
15925
15935
|
loadStatus();
|
|
15926
15936
|
}, [loadStatus]);
|
|
15927
15937
|
const handleRefresh = /* @__PURE__ */ __name(() => {
|
|
@@ -16111,7 +16121,7 @@ __name(LandingComponent, "LandingComponent");
|
|
|
16111
16121
|
import { zodResolver as zodResolver6 } from "@hookform/resolvers/zod";
|
|
16112
16122
|
import { useTranslations as useTranslations67 } from "next-intl";
|
|
16113
16123
|
import Image10 from "next/image";
|
|
16114
|
-
import { useEffect as
|
|
16124
|
+
import { useEffect as useEffect51, useState as useState66 } from "react";
|
|
16115
16125
|
import { useForm as useForm6 } from "react-hook-form";
|
|
16116
16126
|
import { z as z6 } from "zod";
|
|
16117
16127
|
import { Fragment as Fragment33, jsx as jsx179, jsxs as jsxs109 } from "react/jsx-runtime";
|
|
@@ -16120,7 +16130,7 @@ function AcceptInvitation() {
|
|
|
16120
16130
|
const [showConfirmation, setShowConfirmation] = useState66(false);
|
|
16121
16131
|
const [error, setError] = useState66(void 0);
|
|
16122
16132
|
const t = useTranslations67();
|
|
16123
|
-
|
|
16133
|
+
useEffect51(() => {
|
|
16124
16134
|
async function validateCode(code) {
|
|
16125
16135
|
try {
|
|
16126
16136
|
const payload = {
|
|
@@ -16213,14 +16223,14 @@ __name(AcceptInvitation, "AcceptInvitation");
|
|
|
16213
16223
|
// src/features/auth/components/forms/ActivateAccount.tsx
|
|
16214
16224
|
import { useTranslations as useTranslations68 } from "next-intl";
|
|
16215
16225
|
import Image11 from "next/image";
|
|
16216
|
-
import { useEffect as
|
|
16226
|
+
import { useEffect as useEffect52, useState as useState67 } from "react";
|
|
16217
16227
|
import { Fragment as Fragment34, jsx as jsx180, jsxs as jsxs110 } from "react/jsx-runtime";
|
|
16218
16228
|
function ActivateAccount() {
|
|
16219
16229
|
const { setComponentType, params, setParams } = useAuthContext();
|
|
16220
16230
|
const [showConfirmation, setShowConfirmation] = useState67(false);
|
|
16221
16231
|
const [error, setError] = useState67(void 0);
|
|
16222
16232
|
const t = useTranslations68();
|
|
16223
|
-
|
|
16233
|
+
useEffect52(() => {
|
|
16224
16234
|
async function ActivateAccount2(code) {
|
|
16225
16235
|
try {
|
|
16226
16236
|
const payload = {
|
|
@@ -16261,12 +16271,12 @@ function ActivateAccount() {
|
|
|
16261
16271
|
__name(ActivateAccount, "ActivateAccount");
|
|
16262
16272
|
|
|
16263
16273
|
// src/features/auth/components/forms/Cookies.tsx
|
|
16264
|
-
import { useEffect as
|
|
16274
|
+
import { useEffect as useEffect53, useState as useState68 } from "react";
|
|
16265
16275
|
function Cookies({ dehydratedAuth, page }) {
|
|
16266
16276
|
const { setUser } = useCurrentUserContext();
|
|
16267
16277
|
const router = useI18nRouter();
|
|
16268
16278
|
const [hasSaved, setHasSaved] = useState68(false);
|
|
16269
|
-
|
|
16279
|
+
useEffect53(() => {
|
|
16270
16280
|
if (hasSaved) return;
|
|
16271
16281
|
async function saveTokenOnServer() {
|
|
16272
16282
|
await AuthService.saveToken({ dehydratedAuth });
|
|
@@ -16361,7 +16371,7 @@ import { zodResolver as zodResolver8 } from "@hookform/resolvers/zod";
|
|
|
16361
16371
|
import { useTranslations as useTranslations70 } from "next-intl";
|
|
16362
16372
|
import Image13 from "next/image";
|
|
16363
16373
|
import { useRouter, useSearchParams as useSearchParams3 } from "next/navigation";
|
|
16364
|
-
import { useEffect as
|
|
16374
|
+
import { useEffect as useEffect54, useState as useState70 } from "react";
|
|
16365
16375
|
import { useForm as useForm8 } from "react-hook-form";
|
|
16366
16376
|
import { z as z8 } from "zod";
|
|
16367
16377
|
import { Fragment as Fragment36, jsx as jsx182, jsxs as jsxs112 } from "react/jsx-runtime";
|
|
@@ -16375,7 +16385,7 @@ function Login() {
|
|
|
16375
16385
|
const searchParams = useSearchParams3();
|
|
16376
16386
|
const callbackUrl = searchParams.get("callbackUrl");
|
|
16377
16387
|
const [referralCode, setReferralCode2] = useState70(null);
|
|
16378
|
-
|
|
16388
|
+
useEffect54(() => {
|
|
16379
16389
|
const cookies = document.cookie.split("; ");
|
|
16380
16390
|
for (const cookie of cookies) {
|
|
16381
16391
|
const [name, value] = cookie.split("=");
|
|
@@ -16494,7 +16504,7 @@ function Login() {
|
|
|
16494
16504
|
__name(Login, "Login");
|
|
16495
16505
|
|
|
16496
16506
|
// src/features/auth/components/forms/Logout.tsx
|
|
16497
|
-
import { useEffect as
|
|
16507
|
+
import { useEffect as useEffect55 } from "react";
|
|
16498
16508
|
|
|
16499
16509
|
// src/features/auth/utils/clearClientStorage.ts
|
|
16500
16510
|
function clearClientStorage(keys) {
|
|
@@ -16509,7 +16519,7 @@ __name(clearClientStorage, "clearClientStorage");
|
|
|
16509
16519
|
import { Fragment as Fragment37, jsx as jsx183 } from "react/jsx-runtime";
|
|
16510
16520
|
function Logout({ storageKeys }) {
|
|
16511
16521
|
const generateUrl = usePageUrlGenerator();
|
|
16512
|
-
|
|
16522
|
+
useEffect55(() => {
|
|
16513
16523
|
const logOut = /* @__PURE__ */ __name(async () => {
|
|
16514
16524
|
if (storageKeys?.length) {
|
|
16515
16525
|
clearClientStorage(storageKeys);
|
|
@@ -16525,7 +16535,7 @@ __name(Logout, "Logout");
|
|
|
16525
16535
|
|
|
16526
16536
|
// src/features/auth/components/forms/RefreshUser.tsx
|
|
16527
16537
|
import { deleteCookie, getCookie } from "cookies-next";
|
|
16528
|
-
import { useEffect as
|
|
16538
|
+
import { useEffect as useEffect56 } from "react";
|
|
16529
16539
|
function RefreshUser() {
|
|
16530
16540
|
const { setUser } = useCurrentUserContext();
|
|
16531
16541
|
const loadFullUser = /* @__PURE__ */ __name(async () => {
|
|
@@ -16545,7 +16555,7 @@ function RefreshUser() {
|
|
|
16545
16555
|
deleteCookie("reloadData");
|
|
16546
16556
|
}
|
|
16547
16557
|
}, "loadFullUser");
|
|
16548
|
-
|
|
16558
|
+
useEffect56(() => {
|
|
16549
16559
|
const reloadData = getCookie("reloadData");
|
|
16550
16560
|
if (reloadData !== void 0) loadFullUser();
|
|
16551
16561
|
}, []);
|
|
@@ -16557,7 +16567,7 @@ __name(RefreshUser, "RefreshUser");
|
|
|
16557
16567
|
import { zodResolver as zodResolver9 } from "@hookform/resolvers/zod";
|
|
16558
16568
|
import { useTranslations as useTranslations71 } from "next-intl";
|
|
16559
16569
|
import Image14 from "next/image";
|
|
16560
|
-
import { useEffect as
|
|
16570
|
+
import { useEffect as useEffect57, useState as useState71 } from "react";
|
|
16561
16571
|
import { useForm as useForm9 } from "react-hook-form";
|
|
16562
16572
|
import { z as z9 } from "zod";
|
|
16563
16573
|
import { Fragment as Fragment38, jsx as jsx184, jsxs as jsxs113 } from "react/jsx-runtime";
|
|
@@ -16566,7 +16576,7 @@ function ResetPassword() {
|
|
|
16566
16576
|
const [showConfirmation, setShowConfirmation] = useState71(false);
|
|
16567
16577
|
const [error, setError] = useState71(void 0);
|
|
16568
16578
|
const t = useTranslations71();
|
|
16569
|
-
|
|
16579
|
+
useEffect57(() => {
|
|
16570
16580
|
async function validateResetPasswordCode(code) {
|
|
16571
16581
|
try {
|
|
16572
16582
|
const payload = {
|
|
@@ -16905,7 +16915,7 @@ __name(RelevantContentsList, "RelevantContentsList");
|
|
|
16905
16915
|
// src/features/how-to/components/containers/HowToCommand.tsx
|
|
16906
16916
|
import { ArrowRight, LifeBuoyIcon } from "lucide-react";
|
|
16907
16917
|
import { useTranslations as useTranslations78 } from "next-intl";
|
|
16908
|
-
import { useCallback as
|
|
16918
|
+
import { useCallback as useCallback34, useEffect as useEffect58, useMemo as useMemo28, useRef as useRef28, useState as useState74 } from "react";
|
|
16909
16919
|
|
|
16910
16920
|
// src/features/how-to/components/containers/HowToCommandViewer.tsx
|
|
16911
16921
|
import { ArrowLeft, BookOpen, MessageSquare } from "lucide-react";
|
|
@@ -17057,7 +17067,7 @@ function HowToCommand({ pathname, extraGroups, onStartChat }) {
|
|
|
17057
17067
|
});
|
|
17058
17068
|
return { relevantHowTos: relevant, otherHowTos: other };
|
|
17059
17069
|
}, [data.data, pathname]);
|
|
17060
|
-
const search =
|
|
17070
|
+
const search = useCallback34(
|
|
17061
17071
|
async (searchedTerm) => {
|
|
17062
17072
|
if (searchedTerm === searchTermRef.current) return;
|
|
17063
17073
|
searchTermRef.current = searchedTerm;
|
|
@@ -17066,16 +17076,16 @@ function HowToCommand({ pathname, extraGroups, onStartChat }) {
|
|
|
17066
17076
|
[searchTermRef, data]
|
|
17067
17077
|
);
|
|
17068
17078
|
const updateSearchTerm = useDebounce2(search, 500);
|
|
17069
|
-
|
|
17079
|
+
useEffect58(() => {
|
|
17070
17080
|
updateSearchTerm(searchTerm);
|
|
17071
17081
|
}, [updateSearchTerm, searchTerm]);
|
|
17072
|
-
|
|
17082
|
+
useEffect58(() => {
|
|
17073
17083
|
if (!dialogOpen) {
|
|
17074
17084
|
setSearchTerm("");
|
|
17075
17085
|
searchTermRef.current = "";
|
|
17076
17086
|
}
|
|
17077
17087
|
}, [dialogOpen]);
|
|
17078
|
-
|
|
17088
|
+
useEffect58(() => {
|
|
17079
17089
|
const down = /* @__PURE__ */ __name((e) => {
|
|
17080
17090
|
if (e.key === "k" && (e.metaKey || e.ctrlKey)) {
|
|
17081
17091
|
e.preventDefault();
|
|
@@ -17375,7 +17385,7 @@ __name(HowToMultiSelector, "HowToMultiSelector");
|
|
|
17375
17385
|
// src/features/how-to/components/forms/HowToSelector.tsx
|
|
17376
17386
|
import { CircleX as CircleX2, RefreshCwIcon as RefreshCwIcon3, SearchIcon as SearchIcon6, XIcon as XIcon10 } from "lucide-react";
|
|
17377
17387
|
import { useTranslations as useTranslations83 } from "next-intl";
|
|
17378
|
-
import { useCallback as
|
|
17388
|
+
import { useCallback as useCallback35, useEffect as useEffect59, useRef as useRef29, useState as useState75 } from "react";
|
|
17379
17389
|
import { Fragment as Fragment42, jsx as jsx199, jsxs as jsxs119 } from "react/jsx-runtime";
|
|
17380
17390
|
function HowToSelector({
|
|
17381
17391
|
id,
|
|
@@ -17397,7 +17407,7 @@ function HowToSelector({
|
|
|
17397
17407
|
retrieverParams: {},
|
|
17398
17408
|
module: Modules.HowTo
|
|
17399
17409
|
});
|
|
17400
|
-
const search =
|
|
17410
|
+
const search = useCallback35(
|
|
17401
17411
|
async (searchedTerm) => {
|
|
17402
17412
|
try {
|
|
17403
17413
|
if (searchedTerm === searchTermRef.current) return;
|
|
@@ -17411,7 +17421,7 @@ function HowToSelector({
|
|
|
17411
17421
|
[searchTermRef, data]
|
|
17412
17422
|
);
|
|
17413
17423
|
const updateSearchTerm = useDebounce2(search, 500);
|
|
17414
|
-
|
|
17424
|
+
useEffect59(() => {
|
|
17415
17425
|
setIsSearching(true);
|
|
17416
17426
|
updateSearchTerm(searchTerm);
|
|
17417
17427
|
}, [updateSearchTerm, searchTerm]);
|
|
@@ -17681,7 +17691,7 @@ function AssistantThreadHeader({ assistant, onRename, onDelete }) {
|
|
|
17681
17691
|
__name(AssistantThreadHeader, "AssistantThreadHeader");
|
|
17682
17692
|
|
|
17683
17693
|
// src/features/assistant/components/parts/AssistantThread.tsx
|
|
17684
|
-
import { useEffect as
|
|
17694
|
+
import { useEffect as useEffect61, useRef as useRef30 } from "react";
|
|
17685
17695
|
|
|
17686
17696
|
// src/features/assistant-message/components/MessageItem.tsx
|
|
17687
17697
|
import { useTranslations as useTranslations93 } from "next-intl";
|
|
@@ -17690,7 +17700,7 @@ import ReactMarkdown3 from "react-markdown";
|
|
|
17690
17700
|
import remarkGfm3 from "remark-gfm";
|
|
17691
17701
|
|
|
17692
17702
|
// src/features/assistant-message/components/parts/MessageSourcesContainer.tsx
|
|
17693
|
-
import { useEffect as
|
|
17703
|
+
import { useEffect as useEffect60, useMemo as useMemo31, useState as useState81 } from "react";
|
|
17694
17704
|
|
|
17695
17705
|
// src/features/assistant-message/components/parts/MessageSourcesPanel.tsx
|
|
17696
17706
|
import { useMemo as useMemo30, useState as useState80 } from "react";
|
|
@@ -18102,7 +18112,7 @@ function MessageSourcesContainer({ message, isLatestAssistant, onSelectFollowUp
|
|
|
18102
18112
|
return parts.sort().join("|");
|
|
18103
18113
|
}, [groups]);
|
|
18104
18114
|
const [resolved, setResolved] = useState81([]);
|
|
18105
|
-
|
|
18115
|
+
useEffect60(() => {
|
|
18106
18116
|
if (groups.size === 0) {
|
|
18107
18117
|
setResolved([]);
|
|
18108
18118
|
return;
|
|
@@ -18245,7 +18255,7 @@ __name(AssistantStatusLine, "AssistantStatusLine");
|
|
|
18245
18255
|
import { jsx as jsx215, jsxs as jsxs132 } from "react/jsx-runtime";
|
|
18246
18256
|
function AssistantThread({ messages, sending, status, onSelectFollowUp, failedMessageIds, onRetry }) {
|
|
18247
18257
|
const endRef = useRef30(null);
|
|
18248
|
-
|
|
18258
|
+
useEffect61(() => {
|
|
18249
18259
|
endRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
18250
18260
|
}, [messages.length, sending]);
|
|
18251
18261
|
return /* @__PURE__ */ jsxs132("div", { className: "flex-1 min-w-0 overflow-x-hidden overflow-y-auto px-6 py-5", children: [
|
|
@@ -18438,7 +18448,7 @@ __name(NotificationsListContainer, "NotificationsListContainer");
|
|
|
18438
18448
|
// src/features/notification/components/modals/NotificationModal.tsx
|
|
18439
18449
|
import { BellIcon } from "lucide-react";
|
|
18440
18450
|
import { useTranslations as useTranslations97 } from "next-intl";
|
|
18441
|
-
import { Fragment as Fragment47, useCallback as
|
|
18451
|
+
import { Fragment as Fragment47, useCallback as useCallback36, useEffect as useEffect62, useMemo as useMemo32, useRef as useRef31, useState as useState82 } from "react";
|
|
18442
18452
|
import { jsx as jsx220, jsxs as jsxs137 } from "react/jsx-runtime";
|
|
18443
18453
|
function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
18444
18454
|
const _instanceId = useRef31(Math.random().toString(36).substr(2, 9));
|
|
@@ -18468,7 +18478,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
18468
18478
|
resetTime: 0,
|
|
18469
18479
|
isOpen: false
|
|
18470
18480
|
});
|
|
18471
|
-
const checkCircuitBreaker =
|
|
18481
|
+
const checkCircuitBreaker = useCallback36(() => {
|
|
18472
18482
|
const now = Date.now();
|
|
18473
18483
|
const breaker = circuitBreakerRef.current;
|
|
18474
18484
|
if (now > breaker.resetTime) {
|
|
@@ -18490,14 +18500,14 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
18490
18500
|
unreadIds: unreadNotifications2.map((notif) => notif.id)
|
|
18491
18501
|
};
|
|
18492
18502
|
}, [notifications]);
|
|
18493
|
-
|
|
18503
|
+
useEffect62(() => {
|
|
18494
18504
|
setNewNotifications(unreadCount > 0);
|
|
18495
18505
|
}, [unreadCount]);
|
|
18496
|
-
|
|
18506
|
+
useEffect62(() => {
|
|
18497
18507
|
if (lastLoaded === 0) loadNotifications();
|
|
18498
18508
|
}, [lastLoaded, loadNotifications]);
|
|
18499
18509
|
const processSocketNotificationsRef = useRef31(null);
|
|
18500
|
-
const processSocketNotifications =
|
|
18510
|
+
const processSocketNotifications = useCallback36(() => {
|
|
18501
18511
|
if (socketNotifications.length === 0) {
|
|
18502
18512
|
return;
|
|
18503
18513
|
}
|
|
@@ -18536,7 +18546,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
18536
18546
|
generateUrl,
|
|
18537
18547
|
checkCircuitBreaker
|
|
18538
18548
|
]);
|
|
18539
|
-
|
|
18549
|
+
useEffect62(() => {
|
|
18540
18550
|
if (processSocketNotificationsRef.current) {
|
|
18541
18551
|
clearTimeout(processSocketNotificationsRef.current);
|
|
18542
18552
|
}
|
|
@@ -18613,7 +18623,7 @@ __name(PushNotificationProvider, "PushNotificationProvider");
|
|
|
18613
18623
|
|
|
18614
18624
|
// src/features/referral/components/ReferralCodeCapture.tsx
|
|
18615
18625
|
import { useSearchParams as useSearchParams5 } from "next/navigation";
|
|
18616
|
-
import { useEffect as
|
|
18626
|
+
import { useEffect as useEffect63 } from "react";
|
|
18617
18627
|
|
|
18618
18628
|
// src/features/referral/utils/referral-cookie.ts
|
|
18619
18629
|
function setReferralCode(code) {
|
|
@@ -18638,7 +18648,7 @@ __name(getReferralCode2, "getReferralCode");
|
|
|
18638
18648
|
// src/features/referral/components/ReferralCodeCapture.tsx
|
|
18639
18649
|
function ReferralCodeCapture() {
|
|
18640
18650
|
const searchParams = useSearchParams5();
|
|
18641
|
-
|
|
18651
|
+
useEffect63(() => {
|
|
18642
18652
|
if (!isReferralEnabled()) {
|
|
18643
18653
|
return;
|
|
18644
18654
|
}
|
|
@@ -18657,7 +18667,7 @@ __name(ReferralCodeCapture, "ReferralCodeCapture");
|
|
|
18657
18667
|
|
|
18658
18668
|
// src/features/referral/components/ReferralWidget.tsx
|
|
18659
18669
|
import { Copy as Copy2, Loader2 as Loader25, Mail, Users } from "lucide-react";
|
|
18660
|
-
import { useCallback as
|
|
18670
|
+
import { useCallback as useCallback37, useRef as useRef32, useState as useState85 } from "react";
|
|
18661
18671
|
|
|
18662
18672
|
// src/features/referral/hooks/useReferralInvite.ts
|
|
18663
18673
|
import { useState as useState83 } from "react";
|
|
@@ -18686,12 +18696,12 @@ function useReferralInvite() {
|
|
|
18686
18696
|
__name(useReferralInvite, "useReferralInvite");
|
|
18687
18697
|
|
|
18688
18698
|
// src/features/referral/hooks/useReferralStats.ts
|
|
18689
|
-
import { useEffect as
|
|
18699
|
+
import { useEffect as useEffect64, useState as useState84 } from "react";
|
|
18690
18700
|
function useReferralStats() {
|
|
18691
18701
|
const [stats, setStats] = useState84(null);
|
|
18692
18702
|
const [loading, setLoading] = useState84(true);
|
|
18693
18703
|
const [error, setError] = useState84(null);
|
|
18694
|
-
|
|
18704
|
+
useEffect64(() => {
|
|
18695
18705
|
if (!isReferralEnabled()) {
|
|
18696
18706
|
setLoading(false);
|
|
18697
18707
|
return;
|
|
@@ -18770,7 +18780,7 @@ function ReferralWidget({
|
|
|
18770
18780
|
if (!isReferralEnabled()) {
|
|
18771
18781
|
return null;
|
|
18772
18782
|
}
|
|
18773
|
-
const handleCopyLink =
|
|
18783
|
+
const handleCopyLink = useCallback37(async () => {
|
|
18774
18784
|
if (!referralUrl) return;
|
|
18775
18785
|
const success = await copyToClipboard(referralUrl);
|
|
18776
18786
|
if (success) {
|
|
@@ -18782,7 +18792,7 @@ function ReferralWidget({
|
|
|
18782
18792
|
showError(t.copyError);
|
|
18783
18793
|
}
|
|
18784
18794
|
}, [referralUrl, t.copiedMessage, t.copyError, onLinkCopied]);
|
|
18785
|
-
const handleSendInvite =
|
|
18795
|
+
const handleSendInvite = useCallback37(async () => {
|
|
18786
18796
|
if (!email || !email.includes("@")) {
|
|
18787
18797
|
showError(t.invalidEmail);
|
|
18788
18798
|
return;
|
|
@@ -18798,7 +18808,7 @@ function ReferralWidget({
|
|
|
18798
18808
|
onInviteError?.(error2);
|
|
18799
18809
|
}
|
|
18800
18810
|
}, [email, sendInvite, t.inviteSent, t.inviteError, t.invalidEmail, onInviteSent, onInviteError]);
|
|
18801
|
-
const handleEmailKeyDown =
|
|
18811
|
+
const handleEmailKeyDown = useCallback37(
|
|
18802
18812
|
(e) => {
|
|
18803
18813
|
if (e.key === "Enter" && !sending) {
|
|
18804
18814
|
e.preventDefault();
|
|
@@ -18975,13 +18985,13 @@ __name(FormRoles, "FormRoles");
|
|
|
18975
18985
|
|
|
18976
18986
|
// src/features/role/components/forms/RemoveUserFromRole.tsx
|
|
18977
18987
|
import { useTranslations as useTranslations100 } from "next-intl";
|
|
18978
|
-
import { useEffect as
|
|
18988
|
+
import { useEffect as useEffect65, useState as useState86 } from "react";
|
|
18979
18989
|
import { Fragment as Fragment50, jsx as jsx227, jsxs as jsxs142 } from "react/jsx-runtime";
|
|
18980
18990
|
function RemoveUserFromRole({ role, user, refresh }) {
|
|
18981
18991
|
const [open, setOpen] = useState86(false);
|
|
18982
18992
|
const [canRemove, setCanRemove] = useState86(false);
|
|
18983
18993
|
const t = useTranslations100();
|
|
18984
|
-
|
|
18994
|
+
useEffect65(() => {
|
|
18985
18995
|
async function checkCompanyAdminDeletability() {
|
|
18986
18996
|
const roleUsers = await UserService.findAllUsersByRole({
|
|
18987
18997
|
roleId: role.id
|
|
@@ -19051,7 +19061,7 @@ __name(RemoveUserFromRole, "RemoveUserFromRole");
|
|
|
19051
19061
|
// src/features/role/components/forms/UserRoleAdd.tsx
|
|
19052
19062
|
import { PlusCircle as PlusCircle2 } from "lucide-react";
|
|
19053
19063
|
import { useTranslations as useTranslations101 } from "next-intl";
|
|
19054
|
-
import { useCallback as
|
|
19064
|
+
import { useCallback as useCallback38, useEffect as useEffect66, useRef as useRef33, useState as useState87 } from "react";
|
|
19055
19065
|
import { Fragment as Fragment51, jsx as jsx228, jsxs as jsxs143 } from "react/jsx-runtime";
|
|
19056
19066
|
function UserRoleAdd({ user, refresh }) {
|
|
19057
19067
|
const [open, setOpen] = useState87(false);
|
|
@@ -19081,7 +19091,7 @@ function UserRoleAdd({ user, refresh }) {
|
|
|
19081
19091
|
);
|
|
19082
19092
|
refresh();
|
|
19083
19093
|
}, "addUserToRole");
|
|
19084
|
-
const searchRoles =
|
|
19094
|
+
const searchRoles = useCallback38(
|
|
19085
19095
|
async (term) => {
|
|
19086
19096
|
setRoles(
|
|
19087
19097
|
await RoleService.findAllRolesUserNotIn({
|
|
@@ -19093,10 +19103,10 @@ function UserRoleAdd({ user, refresh }) {
|
|
|
19093
19103
|
[searchTerm, user]
|
|
19094
19104
|
);
|
|
19095
19105
|
const updateSearchTerm = useDebounce2(searchRoles, 500);
|
|
19096
|
-
|
|
19106
|
+
useEffect66(() => {
|
|
19097
19107
|
if (open) updateSearchTerm(searchTerm);
|
|
19098
19108
|
}, [open, searchTerm]);
|
|
19099
|
-
|
|
19109
|
+
useEffect66(() => {
|
|
19100
19110
|
if (open) searchRoles("");
|
|
19101
19111
|
}, [open]);
|
|
19102
19112
|
return /* @__PURE__ */ jsxs143(Fragment51, { children: [
|
|
@@ -19191,7 +19201,7 @@ function UserRolesList({ user }) {
|
|
|
19191
19201
|
__name(UserRolesList, "UserRolesList");
|
|
19192
19202
|
|
|
19193
19203
|
// src/features/oauth/components/OAuthRedirectUriInput.tsx
|
|
19194
|
-
import { useCallback as
|
|
19204
|
+
import { useCallback as useCallback39 } from "react";
|
|
19195
19205
|
import { Plus as Plus2, Trash2 as Trash23 } from "lucide-react";
|
|
19196
19206
|
import { jsx as jsx231, jsxs as jsxs144 } from "react/jsx-runtime";
|
|
19197
19207
|
function isValidRedirectUri(uri) {
|
|
@@ -19221,17 +19231,17 @@ function OAuthRedirectUriInput({
|
|
|
19221
19231
|
disabled = false,
|
|
19222
19232
|
label = "Redirect URIs"
|
|
19223
19233
|
}) {
|
|
19224
|
-
const handleAdd =
|
|
19234
|
+
const handleAdd = useCallback39(() => {
|
|
19225
19235
|
onChange([...value, ""]);
|
|
19226
19236
|
}, [value, onChange]);
|
|
19227
|
-
const handleRemove =
|
|
19237
|
+
const handleRemove = useCallback39(
|
|
19228
19238
|
(index) => {
|
|
19229
19239
|
const newUris = value.filter((_, i) => i !== index);
|
|
19230
19240
|
onChange(newUris.length > 0 ? newUris : [""]);
|
|
19231
19241
|
},
|
|
19232
19242
|
[value, onChange]
|
|
19233
19243
|
);
|
|
19234
|
-
const handleChange =
|
|
19244
|
+
const handleChange = useCallback39(
|
|
19235
19245
|
(index, newValue) => {
|
|
19236
19246
|
const newUris = [...value];
|
|
19237
19247
|
newUris[index] = newValue;
|
|
@@ -19285,7 +19295,7 @@ function OAuthRedirectUriInput({
|
|
|
19285
19295
|
__name(OAuthRedirectUriInput, "OAuthRedirectUriInput");
|
|
19286
19296
|
|
|
19287
19297
|
// src/features/oauth/components/OAuthScopeSelector.tsx
|
|
19288
|
-
import { useCallback as
|
|
19298
|
+
import { useCallback as useCallback40 } from "react";
|
|
19289
19299
|
import { jsx as jsx232, jsxs as jsxs145 } from "react/jsx-runtime";
|
|
19290
19300
|
function OAuthScopeSelector({
|
|
19291
19301
|
value,
|
|
@@ -19295,7 +19305,7 @@ function OAuthScopeSelector({
|
|
|
19295
19305
|
error,
|
|
19296
19306
|
label = "Allowed Scopes"
|
|
19297
19307
|
}) {
|
|
19298
|
-
const handleToggle =
|
|
19308
|
+
const handleToggle = useCallback40(
|
|
19299
19309
|
(scope, checked) => {
|
|
19300
19310
|
if (checked) {
|
|
19301
19311
|
onChange([...value, scope]);
|
|
@@ -19363,12 +19373,12 @@ function OAuthScopeSelector({
|
|
|
19363
19373
|
__name(OAuthScopeSelector, "OAuthScopeSelector");
|
|
19364
19374
|
|
|
19365
19375
|
// src/features/oauth/components/OAuthClientSecretDisplay.tsx
|
|
19366
|
-
import { useState as useState88, useCallback as
|
|
19376
|
+
import { useState as useState88, useCallback as useCallback41 } from "react";
|
|
19367
19377
|
import { Copy as Copy3, Check, AlertTriangle } from "lucide-react";
|
|
19368
19378
|
import { jsx as jsx233, jsxs as jsxs146 } from "react/jsx-runtime";
|
|
19369
19379
|
function OAuthClientSecretDisplay({ secret, onDismiss, open, clientName }) {
|
|
19370
19380
|
const [copied, setCopied] = useState88(false);
|
|
19371
|
-
const handleCopy =
|
|
19381
|
+
const handleCopy = useCallback41(async () => {
|
|
19372
19382
|
try {
|
|
19373
19383
|
await navigator.clipboard.writeText(secret);
|
|
19374
19384
|
setCopied(true);
|
|
@@ -19377,7 +19387,7 @@ function OAuthClientSecretDisplay({ secret, onDismiss, open, clientName }) {
|
|
|
19377
19387
|
console.error("Failed to copy to clipboard:", err);
|
|
19378
19388
|
}
|
|
19379
19389
|
}, [secret]);
|
|
19380
|
-
const handleDismiss =
|
|
19390
|
+
const handleDismiss = useCallback41(() => {
|
|
19381
19391
|
setCopied(false);
|
|
19382
19392
|
onDismiss();
|
|
19383
19393
|
}, [onDismiss]);
|
|
@@ -19560,7 +19570,7 @@ function OAuthClientList({
|
|
|
19560
19570
|
__name(OAuthClientList, "OAuthClientList");
|
|
19561
19571
|
|
|
19562
19572
|
// src/features/oauth/components/OAuthClientForm.tsx
|
|
19563
|
-
import { useState as useState89, useCallback as
|
|
19573
|
+
import { useState as useState89, useCallback as useCallback42 } from "react";
|
|
19564
19574
|
import { jsx as jsx236, jsxs as jsxs149 } from "react/jsx-runtime";
|
|
19565
19575
|
function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
|
|
19566
19576
|
const isEditMode = !!client;
|
|
@@ -19572,7 +19582,7 @@ function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
|
|
|
19572
19582
|
isConfidential: client?.isConfidential ?? true
|
|
19573
19583
|
});
|
|
19574
19584
|
const [errors, setErrors] = useState89({});
|
|
19575
|
-
const validate =
|
|
19585
|
+
const validate = useCallback42(() => {
|
|
19576
19586
|
const newErrors = {};
|
|
19577
19587
|
if (!formState.name.trim()) {
|
|
19578
19588
|
newErrors.name = "Application name is required";
|
|
@@ -19587,7 +19597,7 @@ function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
|
|
|
19587
19597
|
setErrors(newErrors);
|
|
19588
19598
|
return Object.keys(newErrors).length === 0;
|
|
19589
19599
|
}, [formState]);
|
|
19590
|
-
const handleSubmit =
|
|
19600
|
+
const handleSubmit = useCallback42(
|
|
19591
19601
|
async (e) => {
|
|
19592
19602
|
e.preventDefault();
|
|
19593
19603
|
if (!validate()) return;
|
|
@@ -19694,7 +19704,7 @@ function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
|
|
|
19694
19704
|
__name(OAuthClientForm, "OAuthClientForm");
|
|
19695
19705
|
|
|
19696
19706
|
// src/features/oauth/components/OAuthClientDetail.tsx
|
|
19697
|
-
import { useState as useState90, useCallback as
|
|
19707
|
+
import { useState as useState90, useCallback as useCallback43 } from "react";
|
|
19698
19708
|
import { format as format2 } from "date-fns";
|
|
19699
19709
|
import { Copy as Copy4, Check as Check2, RefreshCw as RefreshCw3, Pencil as Pencil2, Trash2 as Trash25, ExternalLink } from "lucide-react";
|
|
19700
19710
|
import { Fragment as Fragment52, jsx as jsx237, jsxs as jsxs150 } from "react/jsx-runtime";
|
|
@@ -19710,7 +19720,7 @@ function OAuthClientDetail({
|
|
|
19710
19720
|
const [showRegenerateConfirm, setShowRegenerateConfirm] = useState90(false);
|
|
19711
19721
|
const [isDeleting, setIsDeleting] = useState90(false);
|
|
19712
19722
|
const [isRegenerating, setIsRegenerating] = useState90(false);
|
|
19713
|
-
const copyToClipboard2 =
|
|
19723
|
+
const copyToClipboard2 = useCallback43(async (text, field) => {
|
|
19714
19724
|
try {
|
|
19715
19725
|
await navigator.clipboard.writeText(text);
|
|
19716
19726
|
setCopiedField(field);
|
|
@@ -19719,7 +19729,7 @@ function OAuthClientDetail({
|
|
|
19719
19729
|
console.error("Failed to copy:", err);
|
|
19720
19730
|
}
|
|
19721
19731
|
}, []);
|
|
19722
|
-
const handleDelete =
|
|
19732
|
+
const handleDelete = useCallback43(async () => {
|
|
19723
19733
|
if (!onDelete) return;
|
|
19724
19734
|
setIsDeleting(true);
|
|
19725
19735
|
try {
|
|
@@ -19729,7 +19739,7 @@ function OAuthClientDetail({
|
|
|
19729
19739
|
setShowDeleteConfirm(false);
|
|
19730
19740
|
}
|
|
19731
19741
|
}, [onDelete]);
|
|
19732
|
-
const handleRegenerateSecret =
|
|
19742
|
+
const handleRegenerateSecret = useCallback43(async () => {
|
|
19733
19743
|
if (!onRegenerateSecret) return;
|
|
19734
19744
|
setIsRegenerating(true);
|
|
19735
19745
|
try {
|
|
@@ -20259,13 +20269,13 @@ __name(WaitlistSuccessState, "WaitlistSuccessState");
|
|
|
20259
20269
|
// src/features/waitlist/components/sections/WaitlistConfirmation.tsx
|
|
20260
20270
|
import { CheckCircle as CheckCircle4, Loader2 as Loader27, XCircle as XCircle2 } from "lucide-react";
|
|
20261
20271
|
import { useTranslations as useTranslations106 } from "next-intl";
|
|
20262
|
-
import { useEffect as
|
|
20272
|
+
import { useEffect as useEffect67, useState as useState92 } from "react";
|
|
20263
20273
|
import { jsx as jsx246, jsxs as jsxs159 } from "react/jsx-runtime";
|
|
20264
20274
|
function WaitlistConfirmation({ code }) {
|
|
20265
20275
|
const t = useTranslations106();
|
|
20266
20276
|
const [state, setState] = useState92("loading");
|
|
20267
20277
|
const [errorMessage, setErrorMessage] = useState92("");
|
|
20268
|
-
|
|
20278
|
+
useEffect67(() => {
|
|
20269
20279
|
async function confirmEmail() {
|
|
20270
20280
|
try {
|
|
20271
20281
|
await WaitlistService.confirm(code);
|
|
@@ -20305,7 +20315,7 @@ __name(WaitlistConfirmation, "WaitlistConfirmation");
|
|
|
20305
20315
|
import { flexRender as flexRender2, getCoreRowModel as getCoreRowModel2, useReactTable as useReactTable2 } from "@tanstack/react-table";
|
|
20306
20316
|
import { RefreshCw as RefreshCw4, Users as Users2 } from "lucide-react";
|
|
20307
20317
|
import { useTranslations as useTranslations108 } from "next-intl";
|
|
20308
|
-
import { useCallback as
|
|
20318
|
+
import { useCallback as useCallback44, useEffect as useEffect68, useState as useState93 } from "react";
|
|
20309
20319
|
|
|
20310
20320
|
// src/features/waitlist/hooks/useWaitlistTableStructure.tsx
|
|
20311
20321
|
import { Send } from "lucide-react";
|
|
@@ -20406,7 +20416,7 @@ function WaitlistList() {
|
|
|
20406
20416
|
const [total, setTotal] = useState93(0);
|
|
20407
20417
|
const [isLoading, setIsLoading] = useState93(true);
|
|
20408
20418
|
const [statusFilter, setStatusFilter] = useState93("all");
|
|
20409
|
-
const loadEntries =
|
|
20419
|
+
const loadEntries = useCallback44(async () => {
|
|
20410
20420
|
setIsLoading(true);
|
|
20411
20421
|
try {
|
|
20412
20422
|
const result = await WaitlistService.findMany({
|
|
@@ -20421,7 +20431,7 @@ function WaitlistList() {
|
|
|
20421
20431
|
setIsLoading(false);
|
|
20422
20432
|
}
|
|
20423
20433
|
}, [statusFilter]);
|
|
20424
|
-
|
|
20434
|
+
useEffect68(() => {
|
|
20425
20435
|
loadEntries();
|
|
20426
20436
|
}, [loadEntries]);
|
|
20427
20437
|
const handleInvite = /* @__PURE__ */ __name(async (entry) => {
|
|
@@ -20475,7 +20485,7 @@ __name(WaitlistList, "WaitlistList");
|
|
|
20475
20485
|
// src/features/rbac/components/RbacContainer.tsx
|
|
20476
20486
|
import { Loader2Icon as Loader2Icon3 } from "lucide-react";
|
|
20477
20487
|
import { useTranslations as useTranslations110 } from "next-intl";
|
|
20478
|
-
import { memo as memo2, useCallback as
|
|
20488
|
+
import { memo as memo2, useCallback as useCallback46, useEffect as useEffect70, useMemo as useMemo33, useRef as useRef34, useState as useState95 } from "react";
|
|
20479
20489
|
|
|
20480
20490
|
// src/features/rbac/components/RbacPermissionCell.tsx
|
|
20481
20491
|
import { CheckIcon as CheckIcon9, MinusIcon as MinusIcon2, XIcon as XIcon11 } from "lucide-react";
|
|
@@ -20556,7 +20566,7 @@ __name(RbacPermissionCell, "RbacPermissionCell");
|
|
|
20556
20566
|
import { Popover as PopoverPrimitive2 } from "@base-ui/react/popover";
|
|
20557
20567
|
import { CheckIcon as CheckIcon10, MinusIcon as MinusIcon3, XIcon as XIcon12 } from "lucide-react";
|
|
20558
20568
|
import { useTranslations as useTranslations109 } from "next-intl";
|
|
20559
|
-
import { useCallback as
|
|
20569
|
+
import { useCallback as useCallback45, useEffect as useEffect69, useState as useState94 } from "react";
|
|
20560
20570
|
import { Fragment as Fragment54, jsx as jsx250, jsxs as jsxs163 } from "react/jsx-runtime";
|
|
20561
20571
|
function RbacPermissionPicker({
|
|
20562
20572
|
open,
|
|
@@ -20570,11 +20580,11 @@ function RbacPermissionPicker({
|
|
|
20570
20580
|
}) {
|
|
20571
20581
|
const t = useTranslations109();
|
|
20572
20582
|
const [customSegment, setCustomSegment] = useState94("");
|
|
20573
|
-
|
|
20583
|
+
useEffect69(() => {
|
|
20574
20584
|
if (!open) setCustomSegment("");
|
|
20575
20585
|
}, [open]);
|
|
20576
20586
|
const currentSegments = typeof value === "string" ? value.split("|").filter(Boolean) : [];
|
|
20577
|
-
const toggleSegment =
|
|
20587
|
+
const toggleSegment = useCallback45(
|
|
20578
20588
|
(segment) => {
|
|
20579
20589
|
const next = currentSegments.includes(segment) ? currentSegments.filter((s) => s !== segment) : [...currentSegments, segment];
|
|
20580
20590
|
if (next.length === 0) onSetValue(false);
|
|
@@ -20582,7 +20592,7 @@ function RbacPermissionPicker({
|
|
|
20582
20592
|
},
|
|
20583
20593
|
[currentSegments, onSetValue]
|
|
20584
20594
|
);
|
|
20585
|
-
const addCustomSegment =
|
|
20595
|
+
const addCustomSegment = useCallback45(() => {
|
|
20586
20596
|
const segment = customSegment.trim();
|
|
20587
20597
|
if (!segment) return;
|
|
20588
20598
|
if (!currentSegments.includes(segment)) {
|
|
@@ -20746,7 +20756,7 @@ var CellButton = memo2(/* @__PURE__ */ __name(function CellButton2({
|
|
|
20746
20756
|
}) {
|
|
20747
20757
|
const ref = useRef34(null);
|
|
20748
20758
|
const value = cellValue(tokens, action);
|
|
20749
|
-
const handleClick =
|
|
20759
|
+
const handleClick = useCallback46(() => {
|
|
20750
20760
|
if (!ref.current) return;
|
|
20751
20761
|
onOpen({ moduleId, rowKey, action, isRoleColumn, anchor: ref.current });
|
|
20752
20762
|
}, [onOpen, moduleId, rowKey, action, isRoleColumn]);
|
|
@@ -20820,13 +20830,13 @@ function RbacContainer() {
|
|
|
20820
20830
|
const { matrix, modulePaths, loading, error, roleNames, moduleNames, updateCell, clearCell } = useRbacContext();
|
|
20821
20831
|
const [selectedModuleId, setSelectedModuleId] = useState95(null);
|
|
20822
20832
|
const [activePicker, setActivePicker] = useState95(null);
|
|
20823
|
-
const openPicker =
|
|
20833
|
+
const openPicker = useCallback46((picker) => {
|
|
20824
20834
|
setActivePicker(picker);
|
|
20825
20835
|
}, []);
|
|
20826
|
-
const closePicker =
|
|
20836
|
+
const closePicker = useCallback46(() => {
|
|
20827
20837
|
setActivePicker(null);
|
|
20828
20838
|
}, []);
|
|
20829
|
-
const handleSelectModule =
|
|
20839
|
+
const handleSelectModule = useCallback46((id) => {
|
|
20830
20840
|
setSelectedModuleId(id);
|
|
20831
20841
|
setActivePicker(null);
|
|
20832
20842
|
}, []);
|
|
@@ -20847,7 +20857,7 @@ function RbacContainer() {
|
|
|
20847
20857
|
}
|
|
20848
20858
|
return Array.from(set).sort();
|
|
20849
20859
|
}, [matrix, roleNames]);
|
|
20850
|
-
|
|
20860
|
+
useEffect70(() => {
|
|
20851
20861
|
if (!selectedModuleId && sortedModuleIds.length > 0) {
|
|
20852
20862
|
setSelectedModuleId(sortedModuleIds[0]);
|
|
20853
20863
|
}
|
|
@@ -20863,14 +20873,14 @@ function RbacContainer() {
|
|
|
20863
20873
|
if (!activePicker) return [];
|
|
20864
20874
|
return modulePaths[activePicker.moduleId] ?? [];
|
|
20865
20875
|
}, [activePicker, modulePaths]);
|
|
20866
|
-
const handleSetValue =
|
|
20876
|
+
const handleSetValue = useCallback46(
|
|
20867
20877
|
(value) => {
|
|
20868
20878
|
if (!activePicker) return;
|
|
20869
20879
|
updateCell(activePicker.moduleId, activePicker.rowKey, activePicker.action, value);
|
|
20870
20880
|
},
|
|
20871
20881
|
[activePicker, updateCell]
|
|
20872
20882
|
);
|
|
20873
|
-
const handleClear =
|
|
20883
|
+
const handleClear = useCallback46(() => {
|
|
20874
20884
|
if (!activePicker || !activePicker.isRoleColumn) return;
|
|
20875
20885
|
clearCell(activePicker.moduleId, activePicker.rowKey, activePicker.action);
|
|
20876
20886
|
}, [activePicker, clearCell]);
|
|
@@ -20930,7 +20940,7 @@ __name(RbacContainer, "RbacContainer");
|
|
|
20930
20940
|
// src/features/rbac/components/RbacByRoleContainer.tsx
|
|
20931
20941
|
import { Loader2Icon as Loader2Icon4 } from "lucide-react";
|
|
20932
20942
|
import { useTranslations as useTranslations111 } from "next-intl";
|
|
20933
|
-
import { Fragment as Fragment55, memo as memo3, useCallback as
|
|
20943
|
+
import { Fragment as Fragment55, memo as memo3, useCallback as useCallback47, useEffect as useEffect71, useMemo as useMemo34, useRef as useRef35, useState as useState96 } from "react";
|
|
20934
20944
|
import { jsx as jsx252, jsxs as jsxs165 } from "react/jsx-runtime";
|
|
20935
20945
|
function findToken2(tokens, action) {
|
|
20936
20946
|
if (!tokens) return void 0;
|
|
@@ -20953,7 +20963,7 @@ var CellButton3 = memo3(/* @__PURE__ */ __name(function CellButton4({
|
|
|
20953
20963
|
}) {
|
|
20954
20964
|
const ref = useRef35(null);
|
|
20955
20965
|
const value = cellValue2(tokens, action);
|
|
20956
|
-
const handleClick =
|
|
20966
|
+
const handleClick = useCallback47(() => {
|
|
20957
20967
|
if (!ref.current) return;
|
|
20958
20968
|
onOpen({ moduleId, rowKey, action, isRoleColumn, anchor: ref.current });
|
|
20959
20969
|
}, [onOpen, moduleId, rowKey, action, isRoleColumn]);
|
|
@@ -20970,13 +20980,13 @@ function RbacByRoleContainer() {
|
|
|
20970
20980
|
const { matrix, modulePaths, loading, error, roleNames, moduleNames, updateCell, clearCell } = useRbacContext();
|
|
20971
20981
|
const [selectedRoleId, setSelectedRoleId] = useState96(null);
|
|
20972
20982
|
const [activePicker, setActivePicker] = useState96(null);
|
|
20973
|
-
const openPicker =
|
|
20983
|
+
const openPicker = useCallback47((picker) => {
|
|
20974
20984
|
setActivePicker(picker);
|
|
20975
20985
|
}, []);
|
|
20976
|
-
const closePicker =
|
|
20986
|
+
const closePicker = useCallback47(() => {
|
|
20977
20987
|
setActivePicker(null);
|
|
20978
20988
|
}, []);
|
|
20979
|
-
const handleSelectRole =
|
|
20989
|
+
const handleSelectRole = useCallback47((id) => {
|
|
20980
20990
|
setSelectedRoleId(id);
|
|
20981
20991
|
setActivePicker(null);
|
|
20982
20992
|
}, []);
|
|
@@ -20988,7 +20998,7 @@ function RbacByRoleContainer() {
|
|
|
20988
20998
|
if (!matrix) return [];
|
|
20989
20999
|
return Object.keys(matrix).sort((a, b) => (moduleNames?.[a] ?? a).localeCompare(moduleNames?.[b] ?? b));
|
|
20990
21000
|
}, [matrix, moduleNames]);
|
|
20991
|
-
|
|
21001
|
+
useEffect71(() => {
|
|
20992
21002
|
if (!selectedRoleId && sortedRoleIds.length > 0) {
|
|
20993
21003
|
setSelectedRoleId(sortedRoleIds[0]);
|
|
20994
21004
|
}
|
|
@@ -21004,14 +21014,14 @@ function RbacByRoleContainer() {
|
|
|
21004
21014
|
if (!activePicker) return [];
|
|
21005
21015
|
return modulePaths[activePicker.moduleId] ?? [];
|
|
21006
21016
|
}, [activePicker, modulePaths]);
|
|
21007
|
-
const handleSetValue =
|
|
21017
|
+
const handleSetValue = useCallback47(
|
|
21008
21018
|
(value) => {
|
|
21009
21019
|
if (!activePicker) return;
|
|
21010
21020
|
updateCell(activePicker.moduleId, activePicker.rowKey, activePicker.action, value);
|
|
21011
21021
|
},
|
|
21012
21022
|
[activePicker, updateCell]
|
|
21013
21023
|
);
|
|
21014
|
-
const handleClear =
|
|
21024
|
+
const handleClear = useCallback47(() => {
|
|
21015
21025
|
if (!activePicker || !activePicker.isRoleColumn) return;
|
|
21016
21026
|
clearCell(activePicker.moduleId, activePicker.rowKey, activePicker.action);
|
|
21017
21027
|
}, [activePicker, clearCell]);
|
|
@@ -21611,4 +21621,4 @@ export {
|
|
|
21611
21621
|
useOAuthClients,
|
|
21612
21622
|
useOAuthClient
|
|
21613
21623
|
};
|
|
21614
|
-
//# sourceMappingURL=chunk-
|
|
21624
|
+
//# sourceMappingURL=chunk-CPXN5OGI.mjs.map
|