@carlonicora/nextjs-jsonapi 5.1.2 → 5.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-AZ627NB7.mjs → BlockNoteEditor-2QJVK2HH.mjs} +4 -4
- package/dist/{BlockNoteEditor-OP7LWYOG.js → BlockNoteEditor-EGY4ZAAM.js} +19 -19
- package/dist/{BlockNoteEditor-OP7LWYOG.js.map → BlockNoteEditor-EGY4ZAAM.js.map} +1 -1
- package/dist/{BlockNoteViewer-SUK7OMWH.mjs → BlockNoteViewer-6BQXJ4TB.mjs} +2 -2
- package/dist/{BlockNoteViewer-LK22AE7Z.js → BlockNoteViewer-I2MMFH3S.js} +3 -3
- package/dist/{BlockNoteViewer-LK22AE7Z.js.map → BlockNoteViewer-I2MMFH3S.js.map} +1 -1
- package/dist/auth.interface-CSzJ1oP1.d.ts +64 -0
- package/dist/auth.interface-DD4uQv2K.d.mts +64 -0
- package/dist/billing/index.js +441 -441
- package/dist/billing/index.mjs +3 -3
- package/dist/{chunk-DYITOVR5.mjs → chunk-2Z3ZCYXX.mjs} +173 -96
- package/dist/chunk-2Z3ZCYXX.mjs.map +1 -0
- package/dist/{chunk-YZN2774P.js → chunk-3VEQ5JZJ.js} +1336 -1259
- package/dist/chunk-3VEQ5JZJ.js.map +1 -0
- package/dist/{chunk-TO6IYGML.js → chunk-75MLT74B.js} +126 -8
- package/dist/chunk-75MLT74B.js.map +1 -0
- package/dist/{chunk-67NJY7SM.js → chunk-EXICQC4A.js} +3 -3
- package/dist/{chunk-67NJY7SM.js.map → chunk-EXICQC4A.js.map} +1 -1
- package/dist/{chunk-OCJEXAGE.mjs → chunk-HNOWSFM5.mjs} +55 -4
- package/dist/chunk-HNOWSFM5.mjs.map +1 -0
- package/dist/{chunk-OKUGTXDN.mjs → chunk-JEZQTZQ4.mjs} +121 -3
- package/dist/chunk-JEZQTZQ4.mjs.map +1 -0
- package/dist/{chunk-KL7CAQP3.mjs → chunk-NPKFMRH5.mjs} +2 -2
- package/dist/{chunk-VVJDWQEI.js → chunk-S5MQDWWC.js} +55 -4
- package/dist/chunk-S5MQDWWC.js.map +1 -0
- package/dist/{chunk-XCHXOCEJ.js → chunk-THKYH65N.js} +4 -4
- package/dist/{chunk-XCHXOCEJ.js.map → chunk-THKYH65N.js.map} +1 -1
- package/dist/{chunk-XLVRAHUK.mjs → chunk-YMUPTXOT.mjs} +2 -2
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/components/index.d.mts +17 -3
- package/dist/components/index.d.ts +17 -3
- package/dist/components/index.js +6 -4
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +5 -3
- package/dist/contexts/index.js +4 -4
- package/dist/contexts/index.mjs +3 -3
- package/dist/core/index.d.mts +27 -7
- package/dist/core/index.d.ts +27 -7
- package/dist/core/index.js +2 -2
- package/dist/core/index.mjs +1 -1
- package/dist/features/analytics/index.js +122 -122
- package/dist/features/analytics/index.mjs +4 -4
- package/dist/features/analytics/server.js +4 -4
- package/dist/features/analytics/server.mjs +2 -2
- package/dist/features/help/index.js +37 -37
- package/dist/features/help/index.mjs +3 -3
- package/dist/features/tokenusage/index.js +125 -125
- package/dist/features/tokenusage/index.mjs +4 -4
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +13 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -3
- package/dist/{s3.service-C-4YpEMu.d.ts → s3.service-CY-jgOAM.d.ts} +1 -1
- package/dist/{s3.service-dVj-nxMl.d.mts → s3.service-Sri0QP7Z.d.mts} +1 -1
- package/dist/server/index.d.mts +2 -2
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +2 -2
- package/dist/{waitlist.config-kPfjImle.d.mts → waitlist.config-Cagmgm7-.d.mts} +7 -0
- package/dist/{waitlist.config-kPfjImle.d.ts → waitlist.config-Cagmgm7-.d.ts} +7 -0
- package/messages/en.json +15 -1
- package/messages/it.json +15 -1
- package/package.json +1 -1
- package/scripts/validate-messages.mjs +1 -0
- package/src/components/index.ts +1 -0
- package/src/features/auth/components/buttons/GoogleSignInButton.tsx +8 -4
- package/src/features/auth/components/forms/Register.tsx +20 -8
- package/src/features/auth/data/auth.interface.ts +2 -0
- package/src/features/auth/data/auth.ts +10 -0
- package/src/features/signup-source/SignupSourceCapture.tsx +27 -0
- package/src/features/signup-source/__tests__/signup-source.spec.ts +161 -0
- package/src/features/signup-source/index.ts +9 -0
- package/src/features/signup-source/signup-source.ts +135 -0
- package/src/features/waitlist/components/forms/WaitlistForm.tsx +2 -0
- package/src/features/waitlist/components/forms/WaitlistQuestionnaireRenderer.tsx +15 -13
- package/src/features/waitlist/components/lists/WaitlistList.tsx +60 -22
- package/src/features/waitlist/components/sections/WaitlistHeroSection.tsx +6 -5
- package/src/features/waitlist/config/waitlist.config.ts +23 -0
- package/src/features/waitlist/data/Waitlist.ts +51 -3
- package/src/features/waitlist/data/WaitlistInterface.ts +9 -1
- package/src/features/waitlist/data/WaitlistService.ts +3 -2
- package/src/features/waitlist/data/__tests__/Waitlist.spec.ts +82 -0
- package/src/features/waitlist/data/__tests__/WaitlistService.spec.ts +48 -0
- package/src/features/waitlist/data/waitlist.fields.ts +1 -0
- package/src/features/waitlist/hooks/__tests__/formatSignupSource.spec.ts +24 -0
- package/src/features/waitlist/hooks/formatSignupSource.ts +14 -0
- package/src/features/waitlist/hooks/useWaitlistTableStructure.tsx +26 -14
- package/src/hooks/__tests__/useDataListRetriever.spec.ts +69 -0
- package/src/hooks/__tests__/usePageTracker.spec.tsx +16 -10
- package/src/hooks/useDataListRetriever.ts +6 -2
- package/src/index.ts +3 -0
- package/dist/auth.interface-CeFCz9NU.d.mts +0 -34
- package/dist/auth.interface-D1R7VVky.d.ts +0 -34
- package/dist/chunk-DYITOVR5.mjs.map +0 -1
- package/dist/chunk-OCJEXAGE.mjs.map +0 -1
- package/dist/chunk-OKUGTXDN.mjs.map +0 -1
- package/dist/chunk-TO6IYGML.js.map +0 -1
- package/dist/chunk-VVJDWQEI.js.map +0 -1
- package/dist/chunk-YZN2774P.js.map +0 -1
- /package/dist/{BlockNoteEditor-AZ627NB7.mjs.map → BlockNoteEditor-2QJVK2HH.mjs.map} +0 -0
- /package/dist/{BlockNoteViewer-SUK7OMWH.mjs.map → BlockNoteViewer-6BQXJ4TB.mjs.map} +0 -0
- /package/dist/{chunk-KL7CAQP3.mjs.map → chunk-NPKFMRH5.mjs.map} +0 -0
- /package/dist/{chunk-XLVRAHUK.mjs.map → chunk-YMUPTXOT.mjs.map} +0 -0
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ACTION_TYPES,
|
|
3
3
|
RbacService,
|
|
4
|
+
SIGNUP_SOURCE_FIELDS,
|
|
5
|
+
captureSignupSource,
|
|
4
6
|
getPublicApiUrl,
|
|
5
7
|
getReferralConfig,
|
|
6
8
|
getRegistrationMode,
|
|
9
|
+
getSignupSource,
|
|
7
10
|
getStripePublishableKey,
|
|
8
11
|
getTrackablePages,
|
|
9
12
|
getWaitlistConfig,
|
|
@@ -11,8 +14,9 @@ import {
|
|
|
11
14
|
isGoogleAuthEnabled,
|
|
12
15
|
isInternalAuthEnabled,
|
|
13
16
|
isReferralEnabled,
|
|
14
|
-
isRegistrationAllowed
|
|
15
|
-
|
|
17
|
+
isRegistrationAllowed,
|
|
18
|
+
useWaitlistText
|
|
19
|
+
} from "./chunk-JEZQTZQ4.mjs";
|
|
16
20
|
import {
|
|
17
21
|
getRoleId,
|
|
18
22
|
isRolesConfigured
|
|
@@ -84,7 +88,7 @@ import {
|
|
|
84
88
|
useIsMobile,
|
|
85
89
|
validateItalianTaxCode,
|
|
86
90
|
validatePartitaIva
|
|
87
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-HNOWSFM5.mjs";
|
|
88
92
|
import {
|
|
89
93
|
ENV
|
|
90
94
|
} from "./chunk-V5MI7RNB.mjs";
|
|
@@ -6919,7 +6923,8 @@ function useDataListRetriever(params) {
|
|
|
6919
6923
|
if ((fetchParams?.callNext || fetchParams?.callPrevious) && isPaginatingRef.current) {
|
|
6920
6924
|
return;
|
|
6921
6925
|
}
|
|
6922
|
-
if (isFetchingRef.current && !fetchParams?.callNext && !fetchParams?.callPrevious)
|
|
6926
|
+
if (isFetchingRef.current && !fetchParams?.isRefine && !fetchParams?.callNext && !fetchParams?.callPrevious)
|
|
6927
|
+
return;
|
|
6923
6928
|
if (stableParams.requiresSearch === true && fetchParams?.isRefine !== true && fetchParams?.isRefresh !== true) {
|
|
6924
6929
|
return;
|
|
6925
6930
|
}
|
|
@@ -10683,7 +10688,7 @@ import { useRef as useRef18 } from "react";
|
|
|
10683
10688
|
import dynamic from "next/dynamic";
|
|
10684
10689
|
import React18 from "react";
|
|
10685
10690
|
import { jsx as jsx90 } from "react/jsx-runtime";
|
|
10686
|
-
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-
|
|
10691
|
+
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-2QJVK2HH.mjs"), {
|
|
10687
10692
|
ssr: false
|
|
10688
10693
|
});
|
|
10689
10694
|
var BlockNoteEditorContainer = React18.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
|
|
@@ -16881,7 +16886,7 @@ __name(BlockNoteEditorMentionSuggestionMenu, "BlockNoteEditorMentionSuggestionMe
|
|
|
16881
16886
|
import dynamic2 from "next/dynamic";
|
|
16882
16887
|
import React29 from "react";
|
|
16883
16888
|
import { jsx as jsx177 } from "react/jsx-runtime";
|
|
16884
|
-
var BlockNoteViewer = dynamic2(() => import("./BlockNoteViewer-
|
|
16889
|
+
var BlockNoteViewer = dynamic2(() => import("./BlockNoteViewer-6BQXJ4TB.mjs").then((m) => m.BlockNoteViewer), { ssr: false });
|
|
16885
16890
|
var BlockNoteViewerContainer = React29.memo(/* @__PURE__ */ __name(function ViewerContainer(props) {
|
|
16886
16891
|
return /* @__PURE__ */ jsx177(BlockNoteViewer, { ...props });
|
|
16887
16892
|
}, "ViewerContainer"));
|
|
@@ -17817,16 +17822,19 @@ registerTableGenerator("stripe-products", useStripeProductTableStructure);
|
|
|
17817
17822
|
import { Send } from "lucide-react";
|
|
17818
17823
|
import { useTranslations as useTranslations70 } from "next-intl";
|
|
17819
17824
|
import { useMemo as useMemo33 } from "react";
|
|
17820
|
-
|
|
17821
|
-
|
|
17822
|
-
|
|
17823
|
-
|
|
17824
|
-
|
|
17825
|
-
|
|
17826
|
-
|
|
17827
|
-
|
|
17825
|
+
|
|
17826
|
+
// src/features/waitlist/hooks/formatSignupSource.ts
|
|
17827
|
+
function formatSignupSource(entry) {
|
|
17828
|
+
if (entry.sourceRef) return entry.sourceRef;
|
|
17829
|
+
if (entry.sourceUtmSource)
|
|
17830
|
+
return entry.sourceUtmCampaign ? `${entry.sourceUtmSource} / ${entry.sourceUtmCampaign}` : entry.sourceUtmSource;
|
|
17831
|
+
if (entry.sourceReferrer) return entry.sourceReferrer;
|
|
17832
|
+
return void 0;
|
|
17828
17833
|
}
|
|
17829
|
-
__name(
|
|
17834
|
+
__name(formatSignupSource, "formatSignupSource");
|
|
17835
|
+
|
|
17836
|
+
// src/features/waitlist/hooks/useWaitlistTableStructure.tsx
|
|
17837
|
+
import { jsx as jsx190, jsxs as jsxs102 } from "react/jsx-runtime";
|
|
17830
17838
|
var useWaitlistTableStructure = /* @__PURE__ */ __name((params) => {
|
|
17831
17839
|
const t = useTranslations70();
|
|
17832
17840
|
const locale = useI18nLocale();
|
|
@@ -17880,12 +17888,27 @@ var useWaitlistTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
17880
17888
|
enableSorting: false,
|
|
17881
17889
|
enableHiding: false
|
|
17882
17890
|
}),
|
|
17891
|
+
["source" /* source */]: () => ({
|
|
17892
|
+
id: "source",
|
|
17893
|
+
header: t("waitlist.admin.columns.source"),
|
|
17894
|
+
cell: /* @__PURE__ */ __name(({ row }) => {
|
|
17895
|
+
const entry = row.original.jsonApiData;
|
|
17896
|
+
const details = SIGNUP_SOURCE_FIELDS.filter((field) => !!entry[field]).map((field) => `${t(`waitlist.admin.source.fields.${field}`)}: ${entry[field]}`).join("\n");
|
|
17897
|
+
const source = formatSignupSource(entry);
|
|
17898
|
+
if (!source) {
|
|
17899
|
+
return /* @__PURE__ */ jsx190("span", { className: "text-muted-foreground", title: details || void 0, children: t("waitlist.admin.source.direct") });
|
|
17900
|
+
}
|
|
17901
|
+
return /* @__PURE__ */ jsx190("span", { title: details, children: source });
|
|
17902
|
+
}, "cell"),
|
|
17903
|
+
enableSorting: false,
|
|
17904
|
+
enableHiding: false
|
|
17905
|
+
}),
|
|
17883
17906
|
["questionnaire" /* questionnaire */]: () => ({
|
|
17884
17907
|
id: "questionnaire",
|
|
17885
17908
|
accessorKey: "questionnaire",
|
|
17886
17909
|
header: t("waitlist.admin.columns.questionnaire"),
|
|
17887
17910
|
cell: /* @__PURE__ */ __name(({ row }) => {
|
|
17888
|
-
const questionnaire =
|
|
17911
|
+
const questionnaire = row.original.jsonApiData.questionnaire;
|
|
17889
17912
|
if (!questionnaire || Object.keys(questionnaire).length === 0) {
|
|
17890
17913
|
return /* @__PURE__ */ jsx190("span", { className: "text-muted-foreground", children: "-" });
|
|
17891
17914
|
}
|
|
@@ -19039,11 +19062,12 @@ function clearReferralCode() {
|
|
|
19039
19062
|
document.cookie = `${REFERRAL_COOKIE_NAME}=; path=/; max-age=0; SameSite=Lax`;
|
|
19040
19063
|
}
|
|
19041
19064
|
__name(clearReferralCode, "clearReferralCode");
|
|
19042
|
-
function buildOAuthQueryParams(inviteCode, referralCode) {
|
|
19043
|
-
const params =
|
|
19044
|
-
if (inviteCode) params.
|
|
19045
|
-
if (referralCode) params.
|
|
19046
|
-
|
|
19065
|
+
function buildOAuthQueryParams(inviteCode, referralCode, source) {
|
|
19066
|
+
const params = [];
|
|
19067
|
+
if (inviteCode) params.push(`invite=${encodeURIComponent(inviteCode)}`);
|
|
19068
|
+
if (referralCode) params.push(`referral=${encodeURIComponent(referralCode)}`);
|
|
19069
|
+
if (source) params.push(`source=${encodeURIComponent(JSON.stringify(source))}`);
|
|
19070
|
+
return params.length ? `?${params.join("&")}` : "";
|
|
19047
19071
|
}
|
|
19048
19072
|
__name(buildOAuthQueryParams, "buildOAuthQueryParams");
|
|
19049
19073
|
function Register() {
|
|
@@ -19059,9 +19083,11 @@ function Register() {
|
|
|
19059
19083
|
registrationMode === "waitlist" && !!inviteCode
|
|
19060
19084
|
);
|
|
19061
19085
|
const [referralCode, setReferralCode2] = useState65(null);
|
|
19086
|
+
const [signupSource, setSignupSource] = useState65(void 0);
|
|
19062
19087
|
useEffect55(() => {
|
|
19063
19088
|
const code = getReferralCode();
|
|
19064
19089
|
setReferralCode2(code);
|
|
19090
|
+
setSignupSource(getSignupSource());
|
|
19065
19091
|
}, []);
|
|
19066
19092
|
const formSchema = z5.object({
|
|
19067
19093
|
company: z5.string().min(1, {
|
|
@@ -19128,7 +19154,8 @@ function Register() {
|
|
|
19128
19154
|
marketingConsent: values.marketingConsent ?? false,
|
|
19129
19155
|
marketingConsentAt: values.marketingConsent ? (/* @__PURE__ */ new Date()).toISOString() : null,
|
|
19130
19156
|
inviteCode: inviteCode ?? void 0,
|
|
19131
|
-
referralCode: referralCode ?? void 0
|
|
19157
|
+
referralCode: referralCode ?? void 0,
|
|
19158
|
+
source: getSignupSource()
|
|
19132
19159
|
};
|
|
19133
19160
|
await AuthService.register(payload);
|
|
19134
19161
|
clearReferralCode();
|
|
@@ -19213,7 +19240,9 @@ function Register() {
|
|
|
19213
19240
|
form,
|
|
19214
19241
|
id: "email",
|
|
19215
19242
|
name: t(`common.fields.email.label`),
|
|
19216
|
-
placeholder: t(`common.fields.email.placeholder`)
|
|
19243
|
+
placeholder: t(`common.fields.email.placeholder`),
|
|
19244
|
+
disabled: inviteValidated,
|
|
19245
|
+
description: inviteValidated ? t("waitlist.invite.email_locked_hint") : void 0
|
|
19217
19246
|
}
|
|
19218
19247
|
),
|
|
19219
19248
|
/* @__PURE__ */ jsx202(
|
|
@@ -19237,7 +19266,7 @@ function Register() {
|
|
|
19237
19266
|
isGoogleAuthEnabled() && /* @__PURE__ */ jsx202(
|
|
19238
19267
|
Link,
|
|
19239
19268
|
{
|
|
19240
|
-
href: `${getPublicApiUrl()}auth/google${buildOAuthQueryParams(inviteCode, referralCode)}`,
|
|
19269
|
+
href: `${getPublicApiUrl()}auth/google${buildOAuthQueryParams(inviteCode, referralCode, signupSource)}`,
|
|
19241
19270
|
className: "flex w-full",
|
|
19242
19271
|
children: /* @__PURE__ */ jsxs112(
|
|
19243
19272
|
Button,
|
|
@@ -19285,7 +19314,7 @@ function Register() {
|
|
|
19285
19314
|
isDiscordAuthEnabled() && /* @__PURE__ */ jsx202(
|
|
19286
19315
|
Link,
|
|
19287
19316
|
{
|
|
19288
|
-
href: `${getPublicApiUrl()}auth/discord${buildOAuthQueryParams(inviteCode, referralCode)}`,
|
|
19317
|
+
href: `${getPublicApiUrl()}auth/discord${buildOAuthQueryParams(inviteCode, referralCode, signupSource)}`,
|
|
19289
19318
|
className: "flex w-full",
|
|
19290
19319
|
children: /* @__PURE__ */ jsxs112(Button, { className: "w-full", variant: "outline", type: "button", children: [
|
|
19291
19320
|
/* @__PURE__ */ jsx202("svg", { className: "me-2 h-5 w-5", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ jsx202("path", { d: "M20.317 4.37a19.791 19.791 0 0 0-4.885-1.515.074.074 0 0 0-.079.037c-.21.375-.444.864-.608 1.25a18.27 18.27 0 0 0-5.487 0 12.64 12.64 0 0 0-.617-1.25.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.37a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.106 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128 10.2 10.2 0 0 0 .372-.292.074.074 0 0 1 .077-.01c3.928 1.793 8.18 1.793 12.062 0a.074.074 0 0 1 .078.01c.12.098.246.198.373.292a.077.077 0 0 1-.006.127 12.299 12.299 0 0 1-1.873.892.077.077 0 0 0-.041.107c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.839 19.839 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.549-13.66a.061.061 0 0 0-.031-.03zM8.02 15.33c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.956 2.418-2.157 2.418zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.419 2.157-2.419 1.21 0 2.176 1.096 2.157 2.42 0 1.333-.946 2.418-2.157 2.418z" }) }),
|
|
@@ -20116,15 +20145,17 @@ import Image9 from "next/image";
|
|
|
20116
20145
|
// src/features/auth/components/buttons/GoogleSignInButton.tsx
|
|
20117
20146
|
import { useTranslations as useTranslations88 } from "next-intl";
|
|
20118
20147
|
import { jsx as jsx214, jsxs as jsxs121 } from "react/jsx-runtime";
|
|
20119
|
-
function GoogleSignInButton({ referralCode }) {
|
|
20148
|
+
function GoogleSignInButton({ referralCode, source }) {
|
|
20120
20149
|
const t = useTranslations88();
|
|
20121
20150
|
if (!isGoogleAuthEnabled()) {
|
|
20122
20151
|
return null;
|
|
20123
20152
|
}
|
|
20124
20153
|
const buildGoogleOAuthUrl = /* @__PURE__ */ __name(() => {
|
|
20125
20154
|
const baseUrl = `${getPublicApiUrl()}auth/google`;
|
|
20126
|
-
|
|
20127
|
-
|
|
20155
|
+
const params = [];
|
|
20156
|
+
if (referralCode) params.push(`referral=${encodeURIComponent(referralCode)}`);
|
|
20157
|
+
if (source) params.push(`source=${encodeURIComponent(JSON.stringify(source))}`);
|
|
20158
|
+
return params.length ? `${baseUrl}?${params.join("&")}` : baseUrl;
|
|
20128
20159
|
}, "buildGoogleOAuthUrl");
|
|
20129
20160
|
return /* @__PURE__ */ jsx214(Link, { href: buildGoogleOAuthUrl(), className: "flex w-full justify-end", children: /* @__PURE__ */ jsxs121(
|
|
20130
20161
|
Button,
|
|
@@ -25537,6 +25568,19 @@ function ReferralDialog({
|
|
|
25537
25568
|
}
|
|
25538
25569
|
__name(ReferralDialog, "ReferralDialog");
|
|
25539
25570
|
|
|
25571
|
+
// src/features/signup-source/SignupSourceCapture.tsx
|
|
25572
|
+
import { usePathname as usePathname4, useSearchParams as useSearchParams7 } from "next/navigation";
|
|
25573
|
+
import { useEffect as useEffect82 } from "react";
|
|
25574
|
+
function SignupSourceCapture({ persist }) {
|
|
25575
|
+
const searchParams = useSearchParams7();
|
|
25576
|
+
const pathname = usePathname4();
|
|
25577
|
+
useEffect82(() => {
|
|
25578
|
+
captureSignupSource({ persist });
|
|
25579
|
+
}, [pathname, searchParams, persist]);
|
|
25580
|
+
return null;
|
|
25581
|
+
}
|
|
25582
|
+
__name(SignupSourceCapture, "SignupSourceCapture");
|
|
25583
|
+
|
|
25540
25584
|
// src/features/role/components/details/RoleDetails.tsx
|
|
25541
25585
|
import { useTranslations as useTranslations147 } from "next-intl";
|
|
25542
25586
|
import { jsx as jsx287 } from "react/jsx-runtime";
|
|
@@ -25597,13 +25641,13 @@ __name(FormRoles, "FormRoles");
|
|
|
25597
25641
|
|
|
25598
25642
|
// src/features/role/components/forms/RemoveUserFromRole.tsx
|
|
25599
25643
|
import { useTranslations as useTranslations149 } from "next-intl";
|
|
25600
|
-
import { useEffect as
|
|
25644
|
+
import { useEffect as useEffect83, useState as useState108 } from "react";
|
|
25601
25645
|
import { Fragment as Fragment61, jsx as jsx290, jsxs as jsxs173 } from "react/jsx-runtime";
|
|
25602
25646
|
function RemoveUserFromRole({ role, user, refresh }) {
|
|
25603
25647
|
const [open, setOpen] = useState108(false);
|
|
25604
25648
|
const [canRemove, setCanRemove] = useState108(false);
|
|
25605
25649
|
const t = useTranslations149();
|
|
25606
|
-
|
|
25650
|
+
useEffect83(() => {
|
|
25607
25651
|
async function checkCompanyAdminDeletability() {
|
|
25608
25652
|
const roleUsers = await UserService.findAllUsersByRole({
|
|
25609
25653
|
roleId: role.id
|
|
@@ -25673,7 +25717,7 @@ __name(RemoveUserFromRole, "RemoveUserFromRole");
|
|
|
25673
25717
|
// src/features/role/components/forms/UserRoleAdd.tsx
|
|
25674
25718
|
import { PlusCircle as PlusCircle2 } from "lucide-react";
|
|
25675
25719
|
import { useTranslations as useTranslations150 } from "next-intl";
|
|
25676
|
-
import { useCallback as useCallback52, useEffect as
|
|
25720
|
+
import { useCallback as useCallback52, useEffect as useEffect84, useRef as useRef47, useState as useState109 } from "react";
|
|
25677
25721
|
import { Fragment as Fragment62, jsx as jsx291, jsxs as jsxs174 } from "react/jsx-runtime";
|
|
25678
25722
|
function UserRoleAdd({ user, refresh }) {
|
|
25679
25723
|
const [open, setOpen] = useState109(false);
|
|
@@ -25715,10 +25759,10 @@ function UserRoleAdd({ user, refresh }) {
|
|
|
25715
25759
|
[searchTerm, user]
|
|
25716
25760
|
);
|
|
25717
25761
|
const updateSearchTerm = useDebounce2(searchRoles, 500);
|
|
25718
|
-
|
|
25762
|
+
useEffect84(() => {
|
|
25719
25763
|
if (open) updateSearchTerm(searchTerm);
|
|
25720
25764
|
}, [open, searchTerm]);
|
|
25721
|
-
|
|
25765
|
+
useEffect84(() => {
|
|
25722
25766
|
if (open) searchRoles("");
|
|
25723
25767
|
}, [open]);
|
|
25724
25768
|
return /* @__PURE__ */ jsxs174(Fragment62, { children: [
|
|
@@ -26678,6 +26722,7 @@ function WaitlistQuestionnaireRenderer({
|
|
|
26678
26722
|
fields,
|
|
26679
26723
|
fieldPrefix = "questionnaire"
|
|
26680
26724
|
}) {
|
|
26725
|
+
const text = useWaitlistText();
|
|
26681
26726
|
if (!fields || fields.length === 0) {
|
|
26682
26727
|
return null;
|
|
26683
26728
|
}
|
|
@@ -26690,8 +26735,8 @@ function WaitlistQuestionnaireRenderer({
|
|
|
26690
26735
|
{
|
|
26691
26736
|
form,
|
|
26692
26737
|
id: fieldId,
|
|
26693
|
-
name: field.label,
|
|
26694
|
-
placeholder: field.placeholder,
|
|
26738
|
+
name: text(field.label) ?? field.label,
|
|
26739
|
+
placeholder: text(field.placeholder),
|
|
26695
26740
|
isRequired: field.required
|
|
26696
26741
|
},
|
|
26697
26742
|
field.id
|
|
@@ -26702,8 +26747,8 @@ function WaitlistQuestionnaireRenderer({
|
|
|
26702
26747
|
{
|
|
26703
26748
|
form,
|
|
26704
26749
|
id: fieldId,
|
|
26705
|
-
name: field.label,
|
|
26706
|
-
placeholder: field.placeholder,
|
|
26750
|
+
name: text(field.label) ?? field.label,
|
|
26751
|
+
placeholder: text(field.placeholder),
|
|
26707
26752
|
className: "min-h-24"
|
|
26708
26753
|
},
|
|
26709
26754
|
field.id
|
|
@@ -26717,10 +26762,10 @@ function WaitlistQuestionnaireRenderer({
|
|
|
26717
26762
|
{
|
|
26718
26763
|
form,
|
|
26719
26764
|
id: fieldId,
|
|
26720
|
-
name: field.label,
|
|
26765
|
+
name: text(field.label) ?? field.label,
|
|
26721
26766
|
values: field.options.map((opt) => ({
|
|
26722
26767
|
id: opt.value,
|
|
26723
|
-
text: opt.label
|
|
26768
|
+
text: text(opt.label) ?? opt.label
|
|
26724
26769
|
}))
|
|
26725
26770
|
},
|
|
26726
26771
|
field.id
|
|
@@ -26732,8 +26777,8 @@ function WaitlistQuestionnaireRenderer({
|
|
|
26732
26777
|
{
|
|
26733
26778
|
form,
|
|
26734
26779
|
id: fieldId,
|
|
26735
|
-
name: field.label,
|
|
26736
|
-
description: field.description,
|
|
26780
|
+
name: text(field.label) ?? field.label,
|
|
26781
|
+
description: text(field.description),
|
|
26737
26782
|
isRequired: field.required
|
|
26738
26783
|
},
|
|
26739
26784
|
field.id
|
|
@@ -26741,17 +26786,17 @@ function WaitlistQuestionnaireRenderer({
|
|
|
26741
26786
|
}
|
|
26742
26787
|
return /* @__PURE__ */ jsxs187("div", { className: "space-y-2", children: [
|
|
26743
26788
|
/* @__PURE__ */ jsxs187("span", { className: "text-sm font-medium", children: [
|
|
26744
|
-
field.label,
|
|
26789
|
+
text(field.label) ?? field.label,
|
|
26745
26790
|
field.required && /* @__PURE__ */ jsx306("span", { className: "ms-1 text-destructive", children: "*" })
|
|
26746
26791
|
] }),
|
|
26747
|
-
field.description && /* @__PURE__ */ jsx306("p", { className: "text-muted-foreground text-xs", children: field.description }),
|
|
26792
|
+
field.description && /* @__PURE__ */ jsx306("p", { className: "text-muted-foreground text-xs", children: text(field.description) }),
|
|
26748
26793
|
/* @__PURE__ */ jsx306("div", { className: "space-y-2", children: field.options.map((option) => /* @__PURE__ */ jsx306(
|
|
26749
26794
|
FormCheckbox,
|
|
26750
26795
|
{
|
|
26751
26796
|
form,
|
|
26752
26797
|
id: `${fieldId}.${option.value}`,
|
|
26753
|
-
name: option.label,
|
|
26754
|
-
description: option.description
|
|
26798
|
+
name: text(option.label) ?? option.label,
|
|
26799
|
+
description: text(option.description)
|
|
26755
26800
|
},
|
|
26756
26801
|
option.value
|
|
26757
26802
|
)) })
|
|
@@ -26842,7 +26887,8 @@ function WaitlistForm({ onSuccess }) {
|
|
|
26842
26887
|
gdprConsentAt: now,
|
|
26843
26888
|
marketingConsent: values.marketingConsent ?? false,
|
|
26844
26889
|
marketingConsentAt: values.marketingConsent ? now : void 0,
|
|
26845
|
-
questionnaire: values.questionnaire
|
|
26890
|
+
questionnaire: values.questionnaire,
|
|
26891
|
+
source: getSignupSource()
|
|
26846
26892
|
});
|
|
26847
26893
|
setIsSuccess(true);
|
|
26848
26894
|
onSuccess?.();
|
|
@@ -26912,16 +26958,17 @@ import { CheckCircle as CheckCircle2 } from "lucide-react";
|
|
|
26912
26958
|
import { jsx as jsx308, jsxs as jsxs189 } from "react/jsx-runtime";
|
|
26913
26959
|
function WaitlistHeroSection() {
|
|
26914
26960
|
const config = getWaitlistConfig();
|
|
26961
|
+
const text = useWaitlistText();
|
|
26915
26962
|
return /* @__PURE__ */ jsx308("section", { className: "relative overflow-hidden py-16 md:py-24", children: /* @__PURE__ */ jsx308("div", { className: "container mx-auto px-4", children: /* @__PURE__ */ jsxs189("div", { className: "grid gap-12 lg:grid-cols-2 lg:items-center", children: [
|
|
26916
26963
|
/* @__PURE__ */ jsxs189("div", { className: "space-y-8", children: [
|
|
26917
26964
|
/* @__PURE__ */ jsxs189("div", { className: "space-y-4", children: [
|
|
26918
|
-
config.heroTitle && /* @__PURE__ */ jsx308("h1", { className: "text-4xl font-bold tracking-tight md:text-5xl lg:text-6xl", children: config.heroTitle }),
|
|
26919
|
-
config.heroSubtitle && /* @__PURE__ */ jsx308("p", { className: "text-muted-foreground text-xl md:text-2xl", children: config.heroSubtitle }),
|
|
26920
|
-
config.heroDescription && /* @__PURE__ */ jsx308("p", { className: "text-muted-foreground", children: config.heroDescription })
|
|
26965
|
+
config.heroTitle && /* @__PURE__ */ jsx308("h1", { className: "text-4xl font-bold tracking-tight md:text-5xl lg:text-6xl", children: text(config.heroTitle) }),
|
|
26966
|
+
config.heroSubtitle && /* @__PURE__ */ jsx308("p", { className: "text-muted-foreground text-xl md:text-2xl", children: text(config.heroSubtitle) }),
|
|
26967
|
+
config.heroDescription && /* @__PURE__ */ jsx308("p", { className: "text-muted-foreground", children: text(config.heroDescription) })
|
|
26921
26968
|
] }),
|
|
26922
26969
|
config.benefits && config.benefits.length > 0 && /* @__PURE__ */ jsx308("ul", { className: "space-y-3", children: config.benefits.map((benefit, index) => /* @__PURE__ */ jsxs189("li", { className: "flex items-start gap-3", children: [
|
|
26923
26970
|
/* @__PURE__ */ jsx308(CheckCircle2, { className: "text-primary mt-0.5 h-5 w-5 shrink-0" }),
|
|
26924
|
-
/* @__PURE__ */ jsx308("span", { children: benefit })
|
|
26971
|
+
/* @__PURE__ */ jsx308("span", { children: text(benefit) })
|
|
26925
26972
|
] }, index)) })
|
|
26926
26973
|
] }),
|
|
26927
26974
|
/* @__PURE__ */ jsx308("div", { className: "lg:pl-8", children: /* @__PURE__ */ jsx308("div", { className: "bg-card rounded-lg border p-6 shadow-lg md:p-8", children: /* @__PURE__ */ jsx308(WaitlistForm, {}) }) })
|
|
@@ -26947,13 +26994,13 @@ __name(WaitlistSuccessState, "WaitlistSuccessState");
|
|
|
26947
26994
|
// src/features/waitlist/components/sections/WaitlistConfirmation.tsx
|
|
26948
26995
|
import { CheckCircle as CheckCircle4, Loader2 as Loader28, XCircle as XCircle2 } from "lucide-react";
|
|
26949
26996
|
import { useTranslations as useTranslations167 } from "next-intl";
|
|
26950
|
-
import { useEffect as
|
|
26997
|
+
import { useEffect as useEffect85, useState as useState114 } from "react";
|
|
26951
26998
|
import { jsx as jsx310, jsxs as jsxs191 } from "react/jsx-runtime";
|
|
26952
26999
|
function WaitlistConfirmation({ code }) {
|
|
26953
27000
|
const t = useTranslations167();
|
|
26954
27001
|
const [state, setState] = useState114("loading");
|
|
26955
27002
|
const [errorMessage, setErrorMessage] = useState114("");
|
|
26956
|
-
|
|
27003
|
+
useEffect85(() => {
|
|
26957
27004
|
async function confirmEmail() {
|
|
26958
27005
|
try {
|
|
26959
27006
|
await WaitlistService.confirm(code);
|
|
@@ -26992,21 +27039,36 @@ __name(WaitlistConfirmation, "WaitlistConfirmation");
|
|
|
26992
27039
|
// src/features/waitlist/components/lists/WaitlistList.tsx
|
|
26993
27040
|
import { RefreshCw as RefreshCw4 } from "lucide-react";
|
|
26994
27041
|
import { useTranslations as useTranslations168 } from "next-intl";
|
|
26995
|
-
import { useMemo as useMemo59, useState as useState115 } from "react";
|
|
27042
|
+
import { useCallback as useCallback58, useEffect as useEffect86, useMemo as useMemo59, useState as useState115 } from "react";
|
|
26996
27043
|
import { jsx as jsx311, jsxs as jsxs192 } from "react/jsx-runtime";
|
|
26997
27044
|
function WaitlistList({ fullWidth } = {}) {
|
|
26998
27045
|
const t = useTranslations168();
|
|
26999
27046
|
const [statusFilter, setStatusFilter] = useState115("all");
|
|
27047
|
+
const [stats, setStats] = useState115(void 0);
|
|
27000
27048
|
const data = useDataListRetriever({
|
|
27001
27049
|
retriever: /* @__PURE__ */ __name((params) => WaitlistService.findMany(params), "retriever"),
|
|
27002
27050
|
retrieverParams: {},
|
|
27003
27051
|
module: Modules.Waitlist
|
|
27004
27052
|
});
|
|
27053
|
+
const loadStats = useCallback58(async () => {
|
|
27054
|
+
try {
|
|
27055
|
+
setStats(await WaitlistService.getStats());
|
|
27056
|
+
} catch (error) {
|
|
27057
|
+
errorToast({ title: t("common.errors.error"), error });
|
|
27058
|
+
}
|
|
27059
|
+
}, [t]);
|
|
27060
|
+
useEffect86(() => {
|
|
27061
|
+
void loadStats();
|
|
27062
|
+
}, [loadStats]);
|
|
27063
|
+
const refresh = /* @__PURE__ */ __name(() => {
|
|
27064
|
+
void data.refresh();
|
|
27065
|
+
void loadStats();
|
|
27066
|
+
}, "refresh");
|
|
27005
27067
|
const handleInvite = /* @__PURE__ */ __name(async (entry) => {
|
|
27006
27068
|
try {
|
|
27007
27069
|
await WaitlistService.invite(entry.id);
|
|
27008
27070
|
showToast(t("waitlist.admin.invite_sent", { email: entry.email }));
|
|
27009
|
-
|
|
27071
|
+
refresh();
|
|
27010
27072
|
} catch (error) {
|
|
27011
27073
|
errorToast({ title: t("common.errors.error"), error });
|
|
27012
27074
|
}
|
|
@@ -27037,35 +27099,49 @@ function WaitlistList({ fullWidth } = {}) {
|
|
|
27037
27099
|
/* @__PURE__ */ jsx311(SelectItem, { value: "registered", children: t("waitlist.admin.status.registered") })
|
|
27038
27100
|
] })
|
|
27039
27101
|
] }),
|
|
27040
|
-
/* @__PURE__ */ jsx311(Button, { variant: "outline", size: "icon", onClick:
|
|
27102
|
+
/* @__PURE__ */ jsx311(Button, { variant: "outline", size: "icon", onClick: refresh, disabled: !data.isLoaded, children: /* @__PURE__ */ jsx311(RefreshCw4, { className: `h-4 w-4 ${!data.isLoaded ? "animate-spin" : ""}` }) })
|
|
27103
|
+
] });
|
|
27104
|
+
const totals = [
|
|
27105
|
+
{ key: "total", label: t("waitlist.admin.total"), value: stats?.total },
|
|
27106
|
+
{ key: "pending", label: t("waitlist.admin.status.pending"), value: stats?.pending },
|
|
27107
|
+
{ key: "confirmed", label: t("waitlist.admin.status.confirmed"), value: stats?.confirmed },
|
|
27108
|
+
{ key: "invited", label: t("waitlist.admin.status.invited"), value: stats?.invited },
|
|
27109
|
+
{ key: "registered", label: t("waitlist.admin.status.registered"), value: stats?.registered }
|
|
27110
|
+
];
|
|
27111
|
+
return /* @__PURE__ */ jsxs192("div", { className: "flex flex-col gap-4", children: [
|
|
27112
|
+
/* @__PURE__ */ jsx311("dl", { className: "grid grid-cols-5 divide-x divide-border rounded-md border", "data-testid": "waitlist-totals", children: totals.map((total) => /* @__PURE__ */ jsxs192("div", { className: "flex flex-col-reverse items-center gap-1 p-3", children: [
|
|
27113
|
+
/* @__PURE__ */ jsx311("dt", { className: "text-muted-foreground text-xs", children: total.label }),
|
|
27114
|
+
/* @__PURE__ */ jsx311("dd", { className: "text-primary text-xl font-semibold tabular-nums", children: total.value ?? "-" })
|
|
27115
|
+
] }, total.key)) }),
|
|
27116
|
+
/* @__PURE__ */ jsx311(
|
|
27117
|
+
ContentListTable,
|
|
27118
|
+
{
|
|
27119
|
+
data,
|
|
27120
|
+
fields: [
|
|
27121
|
+
"email" /* email */,
|
|
27122
|
+
"status" /* status */,
|
|
27123
|
+
"createdAt" /* createdAt */,
|
|
27124
|
+
"source" /* source */,
|
|
27125
|
+
"questionnaire" /* questionnaire */,
|
|
27126
|
+
"actions" /* actions */
|
|
27127
|
+
],
|
|
27128
|
+
tableGeneratorType: Modules.Waitlist,
|
|
27129
|
+
title: t("waitlist.admin.title"),
|
|
27130
|
+
filters,
|
|
27131
|
+
allowSearch: false,
|
|
27132
|
+
context: { onInvite: handleInvite },
|
|
27133
|
+
fullWidth,
|
|
27134
|
+
emptyState: t("waitlist.admin.empty")
|
|
27135
|
+
}
|
|
27136
|
+
)
|
|
27041
27137
|
] });
|
|
27042
|
-
return /* @__PURE__ */ jsx311(
|
|
27043
|
-
ContentListTable,
|
|
27044
|
-
{
|
|
27045
|
-
data,
|
|
27046
|
-
fields: [
|
|
27047
|
-
"email" /* email */,
|
|
27048
|
-
"status" /* status */,
|
|
27049
|
-
"createdAt" /* createdAt */,
|
|
27050
|
-
"questionnaire" /* questionnaire */,
|
|
27051
|
-
"actions" /* actions */
|
|
27052
|
-
],
|
|
27053
|
-
tableGeneratorType: Modules.Waitlist,
|
|
27054
|
-
title: t("waitlist.admin.title"),
|
|
27055
|
-
filters,
|
|
27056
|
-
allowSearch: false,
|
|
27057
|
-
context: { onInvite: handleInvite },
|
|
27058
|
-
fullWidth,
|
|
27059
|
-
emptyState: t("waitlist.admin.empty")
|
|
27060
|
-
}
|
|
27061
|
-
);
|
|
27062
27138
|
}
|
|
27063
27139
|
__name(WaitlistList, "WaitlistList");
|
|
27064
27140
|
|
|
27065
27141
|
// src/features/rbac/components/RbacContainer.tsx
|
|
27066
27142
|
import { Loader2Icon as Loader2Icon4 } from "lucide-react";
|
|
27067
27143
|
import { useTranslations as useTranslations170 } from "next-intl";
|
|
27068
|
-
import { memo as memo2, useCallback as
|
|
27144
|
+
import { memo as memo2, useCallback as useCallback60, useEffect as useEffect88, useMemo as useMemo60, useRef as useRef48, useState as useState117 } from "react";
|
|
27069
27145
|
|
|
27070
27146
|
// src/features/rbac/components/RbacPermissionCell.tsx
|
|
27071
27147
|
import { CheckIcon as CheckIcon9, MinusIcon as MinusIcon2, XIcon as XIcon12 } from "lucide-react";
|
|
@@ -27146,7 +27222,7 @@ __name(RbacPermissionCell, "RbacPermissionCell");
|
|
|
27146
27222
|
import { Popover as PopoverPrimitive2 } from "@base-ui/react/popover";
|
|
27147
27223
|
import { CheckIcon as CheckIcon10, MinusIcon as MinusIcon3, XIcon as XIcon13 } from "lucide-react";
|
|
27148
27224
|
import { useTranslations as useTranslations169 } from "next-intl";
|
|
27149
|
-
import { useCallback as
|
|
27225
|
+
import { useCallback as useCallback59, useEffect as useEffect87, useState as useState116 } from "react";
|
|
27150
27226
|
import { Fragment as Fragment66, jsx as jsx313, jsxs as jsxs194 } from "react/jsx-runtime";
|
|
27151
27227
|
function RbacPermissionPicker({
|
|
27152
27228
|
open,
|
|
@@ -27160,11 +27236,11 @@ function RbacPermissionPicker({
|
|
|
27160
27236
|
}) {
|
|
27161
27237
|
const t = useTranslations169();
|
|
27162
27238
|
const [customSegment, setCustomSegment] = useState116("");
|
|
27163
|
-
|
|
27239
|
+
useEffect87(() => {
|
|
27164
27240
|
if (!open) setCustomSegment("");
|
|
27165
27241
|
}, [open]);
|
|
27166
27242
|
const currentSegments = typeof value === "string" ? value.split("|").filter(Boolean) : [];
|
|
27167
|
-
const toggleSegment =
|
|
27243
|
+
const toggleSegment = useCallback59(
|
|
27168
27244
|
(segment) => {
|
|
27169
27245
|
const next = currentSegments.includes(segment) ? currentSegments.filter((s) => s !== segment) : [...currentSegments, segment];
|
|
27170
27246
|
if (next.length === 0) onSetValue(false);
|
|
@@ -27172,7 +27248,7 @@ function RbacPermissionPicker({
|
|
|
27172
27248
|
},
|
|
27173
27249
|
[currentSegments, onSetValue]
|
|
27174
27250
|
);
|
|
27175
|
-
const addCustomSegment =
|
|
27251
|
+
const addCustomSegment = useCallback59(() => {
|
|
27176
27252
|
const segment = customSegment.trim();
|
|
27177
27253
|
if (!segment) return;
|
|
27178
27254
|
if (!currentSegments.includes(segment)) {
|
|
@@ -27336,7 +27412,7 @@ var CellButton = memo2(/* @__PURE__ */ __name(function CellButton2({
|
|
|
27336
27412
|
}) {
|
|
27337
27413
|
const ref = useRef48(null);
|
|
27338
27414
|
const value = cellValue(tokens, action);
|
|
27339
|
-
const handleClick =
|
|
27415
|
+
const handleClick = useCallback60(() => {
|
|
27340
27416
|
if (!ref.current) return;
|
|
27341
27417
|
onOpen({ moduleId, rowKey, action, isRoleColumn, anchor: ref.current });
|
|
27342
27418
|
}, [onOpen, moduleId, rowKey, action, isRoleColumn]);
|
|
@@ -27410,13 +27486,13 @@ function RbacContainer() {
|
|
|
27410
27486
|
const { matrix, modulePaths, loading, error, roleNames, moduleNames, updateCell, clearCell } = useRbacContext();
|
|
27411
27487
|
const [selectedModuleId, setSelectedModuleId] = useState117(null);
|
|
27412
27488
|
const [activePicker, setActivePicker] = useState117(null);
|
|
27413
|
-
const openPicker =
|
|
27489
|
+
const openPicker = useCallback60((picker) => {
|
|
27414
27490
|
setActivePicker(picker);
|
|
27415
27491
|
}, []);
|
|
27416
|
-
const closePicker =
|
|
27492
|
+
const closePicker = useCallback60(() => {
|
|
27417
27493
|
setActivePicker(null);
|
|
27418
27494
|
}, []);
|
|
27419
|
-
const handleSelectModule =
|
|
27495
|
+
const handleSelectModule = useCallback60((id) => {
|
|
27420
27496
|
setSelectedModuleId(id);
|
|
27421
27497
|
setActivePicker(null);
|
|
27422
27498
|
}, []);
|
|
@@ -27437,7 +27513,7 @@ function RbacContainer() {
|
|
|
27437
27513
|
}
|
|
27438
27514
|
return Array.from(set).sort();
|
|
27439
27515
|
}, [matrix, roleNames]);
|
|
27440
|
-
|
|
27516
|
+
useEffect88(() => {
|
|
27441
27517
|
if (!selectedModuleId && sortedModuleIds.length > 0) {
|
|
27442
27518
|
setSelectedModuleId(sortedModuleIds[0]);
|
|
27443
27519
|
}
|
|
@@ -27453,14 +27529,14 @@ function RbacContainer() {
|
|
|
27453
27529
|
if (!activePicker) return [];
|
|
27454
27530
|
return modulePaths[activePicker.moduleId] ?? [];
|
|
27455
27531
|
}, [activePicker, modulePaths]);
|
|
27456
|
-
const handleSetValue =
|
|
27532
|
+
const handleSetValue = useCallback60(
|
|
27457
27533
|
(value) => {
|
|
27458
27534
|
if (!activePicker) return;
|
|
27459
27535
|
updateCell(activePicker.moduleId, activePicker.rowKey, activePicker.action, value);
|
|
27460
27536
|
},
|
|
27461
27537
|
[activePicker, updateCell]
|
|
27462
27538
|
);
|
|
27463
|
-
const handleClear =
|
|
27539
|
+
const handleClear = useCallback60(() => {
|
|
27464
27540
|
if (!activePicker || !activePicker.isRoleColumn) return;
|
|
27465
27541
|
clearCell(activePicker.moduleId, activePicker.rowKey, activePicker.action);
|
|
27466
27542
|
}, [activePicker, clearCell]);
|
|
@@ -27520,7 +27596,7 @@ __name(RbacContainer, "RbacContainer");
|
|
|
27520
27596
|
// src/features/rbac/components/RbacByRoleContainer.tsx
|
|
27521
27597
|
import { Loader2Icon as Loader2Icon5 } from "lucide-react";
|
|
27522
27598
|
import { useTranslations as useTranslations171 } from "next-intl";
|
|
27523
|
-
import { Fragment as Fragment67, memo as memo3, useCallback as
|
|
27599
|
+
import { Fragment as Fragment67, memo as memo3, useCallback as useCallback61, useEffect as useEffect89, useMemo as useMemo61, useRef as useRef49, useState as useState118 } from "react";
|
|
27524
27600
|
import { jsx as jsx315, jsxs as jsxs196 } from "react/jsx-runtime";
|
|
27525
27601
|
function findToken2(tokens, action) {
|
|
27526
27602
|
if (!tokens) return void 0;
|
|
@@ -27543,7 +27619,7 @@ var CellButton3 = memo3(/* @__PURE__ */ __name(function CellButton4({
|
|
|
27543
27619
|
}) {
|
|
27544
27620
|
const ref = useRef49(null);
|
|
27545
27621
|
const value = cellValue2(tokens, action);
|
|
27546
|
-
const handleClick =
|
|
27622
|
+
const handleClick = useCallback61(() => {
|
|
27547
27623
|
if (!ref.current) return;
|
|
27548
27624
|
onOpen({ moduleId, rowKey, action, isRoleColumn, anchor: ref.current });
|
|
27549
27625
|
}, [onOpen, moduleId, rowKey, action, isRoleColumn]);
|
|
@@ -27560,13 +27636,13 @@ function RbacByRoleContainer() {
|
|
|
27560
27636
|
const { matrix, modulePaths, loading, error, roleNames, moduleNames, updateCell, clearCell } = useRbacContext();
|
|
27561
27637
|
const [selectedRoleId, setSelectedRoleId] = useState118(null);
|
|
27562
27638
|
const [activePicker, setActivePicker] = useState118(null);
|
|
27563
|
-
const openPicker =
|
|
27639
|
+
const openPicker = useCallback61((picker) => {
|
|
27564
27640
|
setActivePicker(picker);
|
|
27565
27641
|
}, []);
|
|
27566
|
-
const closePicker =
|
|
27642
|
+
const closePicker = useCallback61(() => {
|
|
27567
27643
|
setActivePicker(null);
|
|
27568
27644
|
}, []);
|
|
27569
|
-
const handleSelectRole =
|
|
27645
|
+
const handleSelectRole = useCallback61((id) => {
|
|
27570
27646
|
setSelectedRoleId(id);
|
|
27571
27647
|
setActivePicker(null);
|
|
27572
27648
|
}, []);
|
|
@@ -27578,7 +27654,7 @@ function RbacByRoleContainer() {
|
|
|
27578
27654
|
if (!matrix) return [];
|
|
27579
27655
|
return Object.keys(matrix).sort((a, b) => (moduleNames?.[a] ?? a).localeCompare(moduleNames?.[b] ?? b));
|
|
27580
27656
|
}, [matrix, moduleNames]);
|
|
27581
|
-
|
|
27657
|
+
useEffect89(() => {
|
|
27582
27658
|
if (!selectedRoleId && sortedRoleIds.length > 0) {
|
|
27583
27659
|
setSelectedRoleId(sortedRoleIds[0]);
|
|
27584
27660
|
}
|
|
@@ -27594,14 +27670,14 @@ function RbacByRoleContainer() {
|
|
|
27594
27670
|
if (!activePicker) return [];
|
|
27595
27671
|
return modulePaths[activePicker.moduleId] ?? [];
|
|
27596
27672
|
}, [activePicker, modulePaths]);
|
|
27597
|
-
const handleSetValue =
|
|
27673
|
+
const handleSetValue = useCallback61(
|
|
27598
27674
|
(value) => {
|
|
27599
27675
|
if (!activePicker) return;
|
|
27600
27676
|
updateCell(activePicker.moduleId, activePicker.rowKey, activePicker.action, value);
|
|
27601
27677
|
},
|
|
27602
27678
|
[activePicker, updateCell]
|
|
27603
27679
|
);
|
|
27604
|
-
const handleClear =
|
|
27680
|
+
const handleClear = useCallback61(() => {
|
|
27605
27681
|
if (!activePicker || !activePicker.isRoleColumn) return;
|
|
27606
27682
|
clearCell(activePicker.moduleId, activePicker.rowKey, activePicker.action);
|
|
27607
27683
|
}, [activePicker, clearCell]);
|
|
@@ -28235,6 +28311,7 @@ export {
|
|
|
28235
28311
|
ReferralCodeCapture,
|
|
28236
28312
|
ReferralWidget,
|
|
28237
28313
|
ReferralDialog,
|
|
28314
|
+
SignupSourceCapture,
|
|
28238
28315
|
RoleProvider,
|
|
28239
28316
|
useRoleContext,
|
|
28240
28317
|
RoleDetails,
|
|
@@ -28305,4 +28382,4 @@ export {
|
|
|
28305
28382
|
useOAuthClients,
|
|
28306
28383
|
useOAuthClient
|
|
28307
28384
|
};
|
|
28308
|
-
//# sourceMappingURL=chunk-
|
|
28385
|
+
//# sourceMappingURL=chunk-2Z3ZCYXX.mjs.map
|