@stackframe/stack 2.7.23 → 2.7.25
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/CHANGELOG.md +19 -0
- package/dist/components/elements/sidebar-layout.js +2 -9
- package/dist/components/elements/sidebar-layout.js.map +1 -1
- package/dist/components-page/account-settings.js +70 -83
- package/dist/components-page/account-settings.js.map +1 -1
- package/dist/esm/components/elements/sidebar-layout.js +2 -9
- package/dist/esm/components/elements/sidebar-layout.js.map +1 -1
- package/dist/esm/components-page/account-settings.js +69 -80
- package/dist/esm/components-page/account-settings.js.map +1 -1
- package/dist/esm/generated/global-css.js +1 -1
- package/dist/esm/generated/global-css.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.js +6 -10
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/common.js +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/common.js.map +1 -1
- package/dist/esm/lib/stack-app/users/index.js.map +1 -1
- package/dist/generated/global-css.js +1 -1
- package/dist/generated/global-css.js.map +1 -1
- package/dist/index.d.mts +1054 -53
- package/dist/index.d.ts +1054 -53
- package/dist/lib/stack-app/apps/implementations/client-app-impl.js +5 -9
- package/dist/lib/stack-app/apps/implementations/client-app-impl.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/common.js +1 -1
- package/dist/lib/stack-app/apps/implementations/common.js.map +1 -1
- package/dist/lib/stack-app/users/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/admin-app-impl-CTQhv9tV.d.ts +0 -395
- package/dist/admin-app-impl-DpyRKp1e.d.mts +0 -395
- package/dist/components/credential-sign-in.d.mts +0 -5
- package/dist/components/credential-sign-in.d.ts +0 -5
- package/dist/components/credential-sign-up.d.mts +0 -7
- package/dist/components/credential-sign-up.d.ts +0 -7
- package/dist/components/elements/form-warning.d.mts +0 -7
- package/dist/components/elements/form-warning.d.ts +0 -7
- package/dist/components/elements/maybe-full-page.d.mts +0 -11
- package/dist/components/elements/maybe-full-page.d.ts +0 -11
- package/dist/components/elements/separator-with-text.d.mts +0 -7
- package/dist/components/elements/separator-with-text.d.ts +0 -7
- package/dist/components/elements/sidebar-layout.d.mts +0 -19
- package/dist/components/elements/sidebar-layout.d.ts +0 -19
- package/dist/components/elements/ssr-layout-effect.d.mts +0 -8
- package/dist/components/elements/ssr-layout-effect.d.ts +0 -8
- package/dist/components/elements/user-avatar.d.mts +0 -13
- package/dist/components/elements/user-avatar.d.ts +0 -13
- package/dist/components/iframe-preventer.d.mts +0 -8
- package/dist/components/iframe-preventer.d.ts +0 -8
- package/dist/components/link.d.mts +0 -14
- package/dist/components/link.d.ts +0 -14
- package/dist/components/magic-link-sign-in.d.mts +0 -5
- package/dist/components/magic-link-sign-in.d.ts +0 -5
- package/dist/components/message-cards/known-error-message-card.d.mts +0 -9
- package/dist/components/message-cards/known-error-message-card.d.ts +0 -9
- package/dist/components/message-cards/message-card.d.mts +0 -14
- package/dist/components/message-cards/message-card.d.ts +0 -14
- package/dist/components/message-cards/predefined-message-card.d.mts +0 -8
- package/dist/components/message-cards/predefined-message-card.d.ts +0 -8
- package/dist/components/oauth-button-group.d.mts +0 -14
- package/dist/components/oauth-button-group.d.ts +0 -14
- package/dist/components/oauth-button.d.mts +0 -8
- package/dist/components/oauth-button.d.ts +0 -8
- package/dist/components/passkey-button.d.mts +0 -7
- package/dist/components/passkey-button.d.ts +0 -7
- package/dist/components/profile-image-editor.d.mts +0 -11
- package/dist/components/profile-image-editor.d.ts +0 -11
- package/dist/components/selected-team-switcher.d.mts +0 -33
- package/dist/components/selected-team-switcher.d.ts +0 -33
- package/dist/components/team-icon.d.mts +0 -30
- package/dist/components/team-icon.d.ts +0 -30
- package/dist/components/user-button.d.mts +0 -15
- package/dist/components/user-button.d.ts +0 -15
- package/dist/components-page/account-settings.d.mts +0 -24
- package/dist/components-page/account-settings.d.ts +0 -24
- package/dist/components-page/auth-page.d.mts +0 -24
- package/dist/components-page/auth-page.d.ts +0 -24
- package/dist/components-page/email-verification.d.mts +0 -8
- package/dist/components-page/email-verification.d.ts +0 -8
- package/dist/components-page/error-page.d.mts +0 -8
- package/dist/components-page/error-page.d.ts +0 -8
- package/dist/components-page/forgot-password.d.mts +0 -10
- package/dist/components-page/forgot-password.d.ts +0 -10
- package/dist/components-page/magic-link-callback.d.mts +0 -8
- package/dist/components-page/magic-link-callback.d.ts +0 -8
- package/dist/components-page/oauth-callback.d.mts +0 -7
- package/dist/components-page/oauth-callback.d.ts +0 -7
- package/dist/components-page/password-reset.d.mts +0 -12
- package/dist/components-page/password-reset.d.ts +0 -12
- package/dist/components-page/sign-in.d.mts +0 -10
- package/dist/components-page/sign-in.d.ts +0 -10
- package/dist/components-page/sign-out.d.mts +0 -7
- package/dist/components-page/sign-out.d.ts +0 -7
- package/dist/components-page/sign-up.d.mts +0 -11
- package/dist/components-page/sign-up.d.ts +0 -11
- package/dist/components-page/stack-handler.d.mts +0 -72
- package/dist/components-page/stack-handler.d.ts +0 -72
- package/dist/components-page/team-creation.d.mts +0 -7
- package/dist/components-page/team-creation.d.ts +0 -7
- package/dist/components-page/team-invitation.d.mts +0 -8
- package/dist/components-page/team-invitation.d.ts +0 -8
- package/dist/generated/global-css.d.mts +0 -3
- package/dist/generated/global-css.d.ts +0 -3
- package/dist/generated/quetzal-translations.d.mts +0 -4
- package/dist/generated/quetzal-translations.d.ts +0 -4
- package/dist/global.d.d.mts +0 -2
- package/dist/global.d.d.ts +0 -2
- package/dist/index-C7D6Vt7X.d.mts +0 -560
- package/dist/index-DQk7XJpU.d.ts +0 -560
- package/dist/lib/auth.d.mts +0 -33
- package/dist/lib/auth.d.ts +0 -33
- package/dist/lib/cookie.d.mts +0 -33
- package/dist/lib/cookie.d.ts +0 -33
- package/dist/lib/hooks.d.mts +0 -53
- package/dist/lib/hooks.d.ts +0 -53
- package/dist/lib/stack-app/api-keys/index.d.mts +0 -40
- package/dist/lib/stack-app/api-keys/index.d.ts +0 -40
- package/dist/lib/stack-app/apps/implementations/admin-app-impl.d.mts +0 -30
- package/dist/lib/stack-app/apps/implementations/admin-app-impl.d.ts +0 -30
- package/dist/lib/stack-app/apps/implementations/client-app-impl.d.mts +0 -30
- package/dist/lib/stack-app/apps/implementations/client-app-impl.d.ts +0 -30
- package/dist/lib/stack-app/apps/implementations/common.d.mts +0 -45
- package/dist/lib/stack-app/apps/implementations/common.d.ts +0 -45
- package/dist/lib/stack-app/apps/implementations/index.d.mts +0 -36
- package/dist/lib/stack-app/apps/implementations/index.d.ts +0 -36
- package/dist/lib/stack-app/apps/implementations/server-app-impl.d.mts +0 -30
- package/dist/lib/stack-app/apps/implementations/server-app-impl.d.ts +0 -30
- package/dist/lib/stack-app/apps/index.d.mts +0 -23
- package/dist/lib/stack-app/apps/index.d.ts +0 -23
- package/dist/lib/stack-app/apps/interfaces/admin-app.d.mts +0 -23
- package/dist/lib/stack-app/apps/interfaces/admin-app.d.ts +0 -23
- package/dist/lib/stack-app/apps/interfaces/client-app.d.mts +0 -23
- package/dist/lib/stack-app/apps/interfaces/client-app.d.ts +0 -23
- package/dist/lib/stack-app/apps/interfaces/server-app.d.mts +0 -23
- package/dist/lib/stack-app/apps/interfaces/server-app.d.ts +0 -23
- package/dist/lib/stack-app/common.d.mts +0 -63
- package/dist/lib/stack-app/common.d.ts +0 -63
- package/dist/lib/stack-app/connected-accounts/index.d.mts +0 -13
- package/dist/lib/stack-app/connected-accounts/index.d.ts +0 -13
- package/dist/lib/stack-app/contact-channels/index.d.mts +0 -38
- package/dist/lib/stack-app/contact-channels/index.d.ts +0 -38
- package/dist/lib/stack-app/email-templates/index.d.mts +0 -15
- package/dist/lib/stack-app/email-templates/index.d.ts +0 -15
- package/dist/lib/stack-app/index.d.mts +0 -23
- package/dist/lib/stack-app/index.d.ts +0 -23
- package/dist/lib/stack-app/permissions/index.d.mts +0 -21
- package/dist/lib/stack-app/permissions/index.d.ts +0 -21
- package/dist/lib/stack-app/project-configs/index.d.mts +0 -82
- package/dist/lib/stack-app/project-configs/index.d.ts +0 -82
- package/dist/lib/stack-app/projects/index.d.mts +0 -23
- package/dist/lib/stack-app/projects/index.d.ts +0 -23
- package/dist/lib/stack-app/teams/index.d.mts +0 -23
- package/dist/lib/stack-app/teams/index.d.ts +0 -23
- package/dist/lib/stack-app/users/index.d.mts +0 -23
- package/dist/lib/stack-app/users/index.d.ts +0 -23
- package/dist/lib/translations.d.mts +0 -5
- package/dist/lib/translations.d.ts +0 -5
- package/dist/providers/stack-provider-client.d.mts +0 -39
- package/dist/providers/stack-provider-client.d.ts +0 -39
- package/dist/providers/stack-provider.d.mts +0 -42
- package/dist/providers/stack-provider.d.ts +0 -42
- package/dist/providers/theme-provider.d.mts +0 -40
- package/dist/providers/theme-provider.d.ts +0 -40
- package/dist/providers/translation-provider-client.d.mts +0 -14
- package/dist/providers/translation-provider-client.d.ts +0 -14
- package/dist/providers/translation-provider.d.mts +0 -10
- package/dist/providers/translation-provider.d.ts +0 -10
- package/dist/utils/browser-script.d.mts +0 -7
- package/dist/utils/browser-script.d.ts +0 -7
- package/dist/utils/constants.d.mts +0 -79
- package/dist/utils/constants.d.ts +0 -79
- package/dist/utils/url.d.mts +0 -3
- package/dist/utils/url.d.ts +0 -3
|
@@ -14,7 +14,7 @@ import { Accordion, AccordionContent, AccordionItem, AccordionTrigger, ActionCel
|
|
|
14
14
|
import { Edit, Trash, icons } from "lucide-react";
|
|
15
15
|
import { TOTPController, createTOTPKeyURI } from "oslo/otp";
|
|
16
16
|
import * as QRCode from "qrcode";
|
|
17
|
-
import
|
|
17
|
+
import { Suspense, useEffect, useState } from "react";
|
|
18
18
|
import { useForm } from "react-hook-form";
|
|
19
19
|
import * as yup from "yup";
|
|
20
20
|
import { MessageCard, useStackApp, useUser } from "..";
|
|
@@ -102,22 +102,19 @@ function AccountSettings(props) {
|
|
|
102
102
|
) }) });
|
|
103
103
|
}
|
|
104
104
|
function Section(props) {
|
|
105
|
-
return /* @__PURE__ */ jsxs(
|
|
106
|
-
/* @__PURE__ */
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
105
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
106
|
+
/* @__PURE__ */ jsx(Separator, {}),
|
|
107
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col sm:flex-row gap-2", children: [
|
|
108
|
+
/* @__PURE__ */ jsxs("div", { className: "sm:flex-1 flex flex-col justify-center", children: [
|
|
109
|
+
/* @__PURE__ */ jsx(Typography, { className: "font-medium", children: props.title }),
|
|
110
|
+
props.description && /* @__PURE__ */ jsx(Typography, { variant: "secondary", type: "footnote", children: props.description })
|
|
111
|
+
] }),
|
|
112
|
+
/* @__PURE__ */ jsx("div", { className: "sm:flex-1 sm:items-end flex flex-col gap-2 ", children: props.children })
|
|
113
|
+
] })
|
|
111
114
|
] });
|
|
112
115
|
}
|
|
113
116
|
function PageLayout(props) {
|
|
114
|
-
return /* @__PURE__ */
|
|
115
|
-
/* @__PURE__ */ jsx(Separator, {}),
|
|
116
|
-
React.Children.map(props.children, (child) => child && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
117
|
-
child,
|
|
118
|
-
/* @__PURE__ */ jsx(Separator, {})
|
|
119
|
-
] }))
|
|
120
|
-
] });
|
|
117
|
+
return /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-6", children: props.children });
|
|
121
118
|
}
|
|
122
119
|
function ProfilePage() {
|
|
123
120
|
const { t } = useTranslation();
|
|
@@ -305,16 +302,12 @@ function EmailsSection() {
|
|
|
305
302
|
] });
|
|
306
303
|
}
|
|
307
304
|
function EmailsAndAuthPage() {
|
|
308
|
-
const passwordSection = usePasswordSection();
|
|
309
|
-
const mfaSection = useMfaSection();
|
|
310
|
-
const otpSection = useOtpSection();
|
|
311
|
-
const passkeySection = usePasskeySection();
|
|
312
305
|
return /* @__PURE__ */ jsxs(PageLayout, { children: [
|
|
313
306
|
/* @__PURE__ */ jsx(EmailsSection, {}),
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
307
|
+
/* @__PURE__ */ jsx(PasswordSection, {}),
|
|
308
|
+
/* @__PURE__ */ jsx(PasskeySection, {}),
|
|
309
|
+
/* @__PURE__ */ jsx(OtpSection, {}),
|
|
310
|
+
/* @__PURE__ */ jsx(MfaSection, {})
|
|
318
311
|
] });
|
|
319
312
|
}
|
|
320
313
|
function EmailsAndAuthPageSkeleton() {
|
|
@@ -325,7 +318,7 @@ function EmailsAndAuthPageSkeleton() {
|
|
|
325
318
|
/* @__PURE__ */ jsx(Skeleton, { className: "h-9 w-full mt-1" })
|
|
326
319
|
] });
|
|
327
320
|
}
|
|
328
|
-
function
|
|
321
|
+
function PasskeySection() {
|
|
329
322
|
const { t } = useTranslation();
|
|
330
323
|
const user = useUser({ or: "throw" });
|
|
331
324
|
const stackApp = useStackApp();
|
|
@@ -380,7 +373,7 @@ function usePasskeySection() {
|
|
|
380
373
|
] })
|
|
381
374
|
] }) }) });
|
|
382
375
|
}
|
|
383
|
-
function
|
|
376
|
+
function OtpSection() {
|
|
384
377
|
const { t } = useTranslation();
|
|
385
378
|
const user = useUser({ or: "throw" });
|
|
386
379
|
const project = useStackApp().useProject();
|
|
@@ -434,14 +427,12 @@ function useOtpSection() {
|
|
|
434
427
|
) : /* @__PURE__ */ jsx(Typography, { variant: "secondary", type: "label", children: t("To enable OTP sign-in, please add a verified sign-in email.") }) }) });
|
|
435
428
|
}
|
|
436
429
|
function SettingsPage() {
|
|
437
|
-
const deleteAccountSection = useDeleteAccountSection();
|
|
438
|
-
const signOutSection = useSignOutSection();
|
|
439
430
|
return /* @__PURE__ */ jsxs(PageLayout, { children: [
|
|
440
|
-
|
|
441
|
-
|
|
431
|
+
/* @__PURE__ */ jsx(DeleteAccountSection, {}),
|
|
432
|
+
/* @__PURE__ */ jsx(SignOutSection, {})
|
|
442
433
|
] });
|
|
443
434
|
}
|
|
444
|
-
function
|
|
435
|
+
function PasswordSection() {
|
|
445
436
|
const { t } = useTranslation();
|
|
446
437
|
const user = useUser({ or: "throw" });
|
|
447
438
|
const contactChannels = user.useContactChannels();
|
|
@@ -564,7 +555,7 @@ function usePasswordSection() {
|
|
|
564
555
|
}
|
|
565
556
|
);
|
|
566
557
|
}
|
|
567
|
-
function
|
|
558
|
+
function MfaSection() {
|
|
568
559
|
const { t } = useTranslation();
|
|
569
560
|
const project = useStackApp().useProject();
|
|
570
561
|
const user = useUser({ or: "throw" });
|
|
@@ -658,7 +649,7 @@ async function generateTotpQrCode(project, user, secret) {
|
|
|
658
649
|
const uri = createTOTPKeyURI(project.displayName, user.primaryEmail ?? user.id, secret);
|
|
659
650
|
return await QRCode.toDataURL(uri);
|
|
660
651
|
}
|
|
661
|
-
function
|
|
652
|
+
function SignOutSection() {
|
|
662
653
|
const { t } = useTranslation();
|
|
663
654
|
const user = useUser({ or: "throw" });
|
|
664
655
|
return /* @__PURE__ */ jsx(
|
|
@@ -678,22 +669,16 @@ function useSignOutSection() {
|
|
|
678
669
|
);
|
|
679
670
|
}
|
|
680
671
|
function TeamPage(props) {
|
|
681
|
-
const teamUserProfileSection = useTeamUserProfileSection(props);
|
|
682
|
-
const teamProfileImageSection = useTeamProfileImageSection(props);
|
|
683
|
-
const teamDisplayNameSection = useTeamDisplayNameSection(props);
|
|
684
|
-
const leaveTeamSection = useLeaveTeamSection(props);
|
|
685
|
-
const memberInvitationSection = useMemberInvitationSection(props);
|
|
686
|
-
const memberListSection = useMemberListSection(props);
|
|
687
672
|
return /* @__PURE__ */ jsxs(PageLayout, { children: [
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
673
|
+
/* @__PURE__ */ jsx(TeamUserProfileSection, { team: props.team }),
|
|
674
|
+
/* @__PURE__ */ jsx(MemberListSection, { team: props.team }),
|
|
675
|
+
/* @__PURE__ */ jsx(MemberInvitationSection, { team: props.team }),
|
|
676
|
+
/* @__PURE__ */ jsx(TeamProfileImageSection, { team: props.team }),
|
|
677
|
+
/* @__PURE__ */ jsx(TeamDisplayNameSection, { team: props.team }),
|
|
678
|
+
/* @__PURE__ */ jsx(LeaveTeamSection, { team: props.team })
|
|
694
679
|
] });
|
|
695
680
|
}
|
|
696
|
-
function
|
|
681
|
+
function LeaveTeamSection(props) {
|
|
697
682
|
const { t } = useTranslation();
|
|
698
683
|
const user = useUser({ or: "redirect" });
|
|
699
684
|
const [leaving, setLeaving] = useState(false);
|
|
@@ -736,7 +721,7 @@ function useLeaveTeamSection(props) {
|
|
|
736
721
|
}
|
|
737
722
|
);
|
|
738
723
|
}
|
|
739
|
-
function
|
|
724
|
+
function TeamProfileImageSection(props) {
|
|
740
725
|
const { t } = useTranslation();
|
|
741
726
|
const user = useUser({ or: "redirect" });
|
|
742
727
|
const updateTeamPermission = user.usePermission(props.team, "$update_team");
|
|
@@ -760,7 +745,7 @@ function useTeamProfileImageSection(props) {
|
|
|
760
745
|
}
|
|
761
746
|
);
|
|
762
747
|
}
|
|
763
|
-
function
|
|
748
|
+
function TeamDisplayNameSection(props) {
|
|
764
749
|
const { t } = useTranslation();
|
|
765
750
|
const user = useUser({ or: "redirect" });
|
|
766
751
|
const updateTeamPermission = user.usePermission(props.team, "$update_team");
|
|
@@ -782,7 +767,7 @@ function useTeamDisplayNameSection(props) {
|
|
|
782
767
|
}
|
|
783
768
|
);
|
|
784
769
|
}
|
|
785
|
-
function
|
|
770
|
+
function TeamUserProfileSection(props) {
|
|
786
771
|
const { t } = useTranslation();
|
|
787
772
|
const user = useUser({ or: "redirect" });
|
|
788
773
|
const profile = user.useTeamProfile(props.team);
|
|
@@ -803,22 +788,39 @@ function useTeamUserProfileSection(props) {
|
|
|
803
788
|
}
|
|
804
789
|
);
|
|
805
790
|
}
|
|
806
|
-
function
|
|
807
|
-
const { t } = useTranslation();
|
|
808
|
-
const invitationSchema = yupObject({
|
|
809
|
-
email: strictEmailSchema(t("Please enter a valid email address")).defined().nonEmpty(t("Please enter an email address"))
|
|
810
|
-
});
|
|
791
|
+
function MemberInvitationSection(props) {
|
|
811
792
|
const user = useUser({ or: "redirect" });
|
|
812
793
|
const inviteMemberPermission = user.usePermission(props.team, "$invite_members");
|
|
813
|
-
const readMemberPermission = user.usePermission(props.team, "$read_members");
|
|
814
|
-
const removeMemberPermission = user.usePermission(props.team, "$remove_members");
|
|
815
794
|
if (!inviteMemberPermission) {
|
|
816
795
|
return null;
|
|
817
796
|
}
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
}
|
|
797
|
+
return /* @__PURE__ */ jsx(MemberInvitationSectionInner, { team: props.team });
|
|
798
|
+
}
|
|
799
|
+
function MemberInvitationsSectionInvitationsList(props) {
|
|
800
|
+
const user = useUser({ or: "redirect" });
|
|
801
|
+
const { t } = useTranslation();
|
|
802
|
+
const invitationsToShow = props.team.useInvitations();
|
|
803
|
+
const removeMemberPermission = user.usePermission(props.team, "$remove_members");
|
|
804
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(Table, { className: "mt-6", children: [
|
|
805
|
+
/* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
806
|
+
/* @__PURE__ */ jsx(TableHead, { className: "w-[200px]", children: t("Outstanding invitations") }),
|
|
807
|
+
/* @__PURE__ */ jsx(TableHead, { className: "w-[60px]", children: t("Expires") }),
|
|
808
|
+
/* @__PURE__ */ jsx(TableHead, { className: "w-[36px] max-w-[36px]" })
|
|
809
|
+
] }) }),
|
|
810
|
+
/* @__PURE__ */ jsx(TableBody, { children: invitationsToShow.map((invitation, i) => /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
811
|
+
/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Typography, { children: invitation.recipientEmail }) }),
|
|
812
|
+
/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Typography, { variant: "secondary", children: invitation.expiresAt.toLocaleString() }) }),
|
|
813
|
+
/* @__PURE__ */ jsx(TableCell, { align: "right", className: "max-w-[36px]", children: removeMemberPermission && /* @__PURE__ */ jsx(Button, { onClick: async () => await invitation.revoke(), size: "icon", variant: "ghost", children: /* @__PURE__ */ jsx(Trash, { className: "w-4 h-4" }) }) })
|
|
814
|
+
] }, invitation.id)) })
|
|
815
|
+
] }) });
|
|
816
|
+
}
|
|
817
|
+
function MemberInvitationSectionInner(props) {
|
|
818
|
+
const user = useUser({ or: "redirect" });
|
|
819
|
+
const { t } = useTranslation();
|
|
820
|
+
const readMemberPermission = user.usePermission(props.team, "$read_members");
|
|
821
|
+
const invitationSchema = yupObject({
|
|
822
|
+
email: strictEmailSchema(t("Please enter a valid email address")).defined().nonEmpty(t("Please enter an email address"))
|
|
823
|
+
});
|
|
822
824
|
const { register, handleSubmit, formState: { errors }, watch } = useForm({
|
|
823
825
|
resolver: yupResolver(invitationSchema)
|
|
824
826
|
});
|
|
@@ -836,7 +838,7 @@ function useMemberInvitationSection(props) {
|
|
|
836
838
|
useEffect(() => {
|
|
837
839
|
setInvitedEmail(null);
|
|
838
840
|
}, [watch("email")]);
|
|
839
|
-
return /* @__PURE__ */ jsxs(
|
|
841
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
840
842
|
/* @__PURE__ */ jsx(
|
|
841
843
|
Section,
|
|
842
844
|
{
|
|
@@ -869,32 +871,21 @@ function useMemberInvitationSection(props) {
|
|
|
869
871
|
)
|
|
870
872
|
}
|
|
871
873
|
),
|
|
872
|
-
|
|
873
|
-
/* @__PURE__ */ jsx(TableHeader, { children: /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
874
|
-
/* @__PURE__ */ jsx(TableHead, { className: "w-[200px]", children: t("Outstanding invitations") }),
|
|
875
|
-
/* @__PURE__ */ jsx(TableHead, { className: "w-[60px]", children: t("Expires") }),
|
|
876
|
-
/* @__PURE__ */ jsx(TableHead, { className: "w-[36px] max-w-[36px]" })
|
|
877
|
-
] }) }),
|
|
878
|
-
/* @__PURE__ */ jsx(TableBody, { children: invitationsToShow.map((invitation, i) => /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
879
|
-
/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Typography, { children: invitation.recipientEmail }) }),
|
|
880
|
-
/* @__PURE__ */ jsx(TableCell, { children: /* @__PURE__ */ jsx(Typography, { variant: "secondary", children: invitation.expiresAt.toLocaleString() }) }),
|
|
881
|
-
/* @__PURE__ */ jsx(TableCell, { align: "right", className: "max-w-[36px]", children: removeMemberPermission && /* @__PURE__ */ jsx(Button, { onClick: async () => await invitation.revoke(), size: "icon", variant: "ghost", children: /* @__PURE__ */ jsx(Trash, { className: "w-4 h-4" }) }) })
|
|
882
|
-
] }, invitation.id)) })
|
|
883
|
-
] }) })
|
|
874
|
+
readMemberPermission && /* @__PURE__ */ jsx(MemberInvitationsSectionInvitationsList, { team: props.team })
|
|
884
875
|
] });
|
|
885
876
|
}
|
|
886
|
-
function
|
|
887
|
-
const { t } = useTranslation();
|
|
877
|
+
function MemberListSection(props) {
|
|
888
878
|
const user = useUser({ or: "redirect" });
|
|
889
879
|
const readMemberPermission = user.usePermission(props.team, "$read_members");
|
|
890
880
|
const inviteMemberPermission = user.usePermission(props.team, "$invite_members");
|
|
891
881
|
if (!readMemberPermission && !inviteMemberPermission) {
|
|
892
882
|
return null;
|
|
893
883
|
}
|
|
884
|
+
return /* @__PURE__ */ jsx(MemberListSectionInner, { team: props.team });
|
|
885
|
+
}
|
|
886
|
+
function MemberListSectionInner(props) {
|
|
887
|
+
const { t } = useTranslation();
|
|
894
888
|
const users = props.team.useUsers();
|
|
895
|
-
if (!readMemberPermission) {
|
|
896
|
-
return null;
|
|
897
|
-
}
|
|
898
889
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
899
890
|
/* @__PURE__ */ jsx(Typography, { className: "font-medium mb-2", children: t("Members") }),
|
|
900
891
|
/* @__PURE__ */ jsx("div", { className: "border rounded-md", children: /* @__PURE__ */ jsxs(Table, { children: [
|
|
@@ -958,7 +949,7 @@ function TeamCreation() {
|
|
|
958
949
|
}
|
|
959
950
|
) }) });
|
|
960
951
|
}
|
|
961
|
-
function
|
|
952
|
+
function DeleteAccountSection() {
|
|
962
953
|
const { t } = useTranslation();
|
|
963
954
|
const user = useUser({ or: "redirect" });
|
|
964
955
|
const app = useStackApp();
|
|
@@ -1051,8 +1042,6 @@ function EditableText(props) {
|
|
|
1051
1042
|
}
|
|
1052
1043
|
export {
|
|
1053
1044
|
AccountSettings,
|
|
1054
|
-
EditableText
|
|
1055
|
-
TeamCreation,
|
|
1056
|
-
useDeleteAccountSection
|
|
1045
|
+
EditableText
|
|
1057
1046
|
};
|
|
1058
1047
|
//# sourceMappingURL=account-settings.js.map
|