@hexclave/next 1.0.18 → 1.0.20
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/components/api-key-dialogs.d.ts +1 -1
- package/dist/components/credential-sign-in.js +5 -1
- package/dist/components/credential-sign-in.js.map +1 -1
- package/dist/components/elements/sidebar-layout.js +1 -1
- package/dist/components/team-switcher.js +3 -5
- package/dist/components/team-switcher.js.map +1 -1
- package/dist/components-page/auth-page.js +2 -2
- package/dist/components-page/auth-page.js.map +1 -1
- package/dist/components-page/forgot-password.js +5 -1
- package/dist/components-page/forgot-password.js.map +1 -1
- package/dist/components-page/oauth-callback.js +6 -1
- package/dist/components-page/oauth-callback.js.map +1 -1
- package/dist/components-page/team-creation.js +2 -3
- package/dist/components-page/team-creation.js.map +1 -1
- package/dist/esm/components/api-key-dialogs.d.ts +1 -1
- package/dist/esm/components/credential-sign-in.js +5 -1
- package/dist/esm/components/credential-sign-in.js.map +1 -1
- package/dist/esm/components/elements/sidebar-layout.js +1 -1
- package/dist/esm/components/team-switcher.js +3 -5
- package/dist/esm/components/team-switcher.js.map +1 -1
- package/dist/esm/components-page/auth-page.js +2 -2
- package/dist/esm/components-page/auth-page.js.map +1 -1
- package/dist/esm/components-page/forgot-password.js +5 -1
- package/dist/esm/components-page/forgot-password.js.map +1 -1
- package/dist/esm/components-page/oauth-callback.js +6 -1
- package/dist/esm/components-page/oauth-callback.js.map +1 -1
- package/dist/esm/components-page/team-creation.js +2 -3
- package/dist/esm/components-page/team-creation.js.map +1 -1
- package/dist/esm/generated/quetzal-translations.d.ts +2 -2
- package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.cross-domain.test.js +34 -5
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.cross-domain.test.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.d.ts +1 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.js +24 -4
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/common.js +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/server-app-impl.d.ts +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/server-app-impl.js +2 -2
- package/dist/esm/lib/hexclave-app/apps/implementations/server-app-impl.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/interfaces/client-app.d.ts +3 -2
- package/dist/esm/lib/hexclave-app/apps/interfaces/client-app.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/interfaces/client-app.js.map +1 -1
- package/dist/esm/lib/hexclave-app/project-configs/index.d.ts +7 -0
- package/dist/esm/lib/hexclave-app/project-configs/index.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/projects/index.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/projects/index.js +1 -1
- package/dist/esm/lib/hexclave-app/projects/index.js.map +1 -1
- package/dist/generated/quetzal-translations.d.ts +2 -2
- package/dist/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.cross-domain.test.js +34 -5
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.cross-domain.test.js.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.d.ts +1 -0
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.d.ts.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.js +24 -4
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.js.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/common.js +1 -1
- package/dist/lib/hexclave-app/apps/implementations/server-app-impl.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/implementations/server-app-impl.js +2 -2
- package/dist/lib/hexclave-app/apps/implementations/server-app-impl.js.map +1 -1
- package/dist/lib/hexclave-app/apps/interfaces/client-app.d.ts +3 -2
- package/dist/lib/hexclave-app/apps/interfaces/client-app.d.ts.map +1 -1
- package/dist/lib/hexclave-app/apps/interfaces/client-app.js.map +1 -1
- package/dist/lib/hexclave-app/project-configs/index.d.ts +7 -0
- package/dist/lib/hexclave-app/project-configs/index.d.ts.map +1 -1
- package/dist/lib/hexclave-app/projects/index.d.ts.map +1 -1
- package/dist/lib/hexclave-app/projects/index.js +1 -1
- package/dist/lib/hexclave-app/projects/index.js.map +1 -1
- package/package.json +4 -4
- package/src/components/credential-sign-in.tsx +8 -1
- package/src/components/team-switcher.tsx +3 -5
- package/src/components-page/auth-page.tsx +2 -2
- package/src/components-page/forgot-password.tsx +7 -1
- package/src/components-page/oauth-callback.tsx +9 -1
- package/src/components-page/team-creation.tsx +2 -3
- package/src/lib/hexclave-app/apps/implementations/client-app-impl.cross-domain.test.ts +36 -0
- package/src/lib/hexclave-app/apps/implementations/client-app-impl.ts +43 -4
- package/src/lib/hexclave-app/apps/implementations/server-app-impl.ts +2 -2
- package/src/lib/hexclave-app/apps/interfaces/client-app.ts +3 -2
- package/src/lib/hexclave-app/project-configs/index.ts +8 -0
- package/src/lib/hexclave-app/projects/index.ts +13 -11
|
@@ -4,7 +4,7 @@ import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
4
4
|
//#region src/components/api-key-dialogs.d.ts
|
|
5
5
|
declare const neverInMs: number;
|
|
6
6
|
declare const expiresInOptions: {
|
|
7
|
-
readonly [x: number]: "
|
|
7
|
+
readonly [x: number]: "1 day" | "7 days" | "30 days" | "90 days" | "1 year" | "Never";
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
10
10
|
* Dialog for creating a new API key
|
|
@@ -68,8 +68,12 @@ function CredentialSignIn() {
|
|
|
68
68
|
}),
|
|
69
69
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__elements_form_warning_js.FormWarningText, { text: errors.password?.message?.toString() }),
|
|
70
70
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__link_js.StyledLink, {
|
|
71
|
-
href:
|
|
71
|
+
href: "#",
|
|
72
72
|
className: "mt-1 text-sm",
|
|
73
|
+
onClick: (e) => {
|
|
74
|
+
e.preventDefault();
|
|
75
|
+
(0, _hexclave_shared_dist_utils_promises.runAsynchronouslyWithAlert)(app.redirectToForgotPassword());
|
|
76
|
+
},
|
|
73
77
|
children: t("Forgot password?")
|
|
74
78
|
}),
|
|
75
79
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hexclave_ui.Button, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-sign-in.js","names":["passwordSchema","Label","Input","FormWarningText","PasswordInput","StyledLink","Button"],"sources":["../../src/components/credential-sign-in.tsx"],"sourcesContent":["'use client';\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n\nimport { yupResolver } from \"@hookform/resolvers/yup\";\nimport { passwordSchema, strictEmailSchema, yupObject } from \"@hexclave/shared/dist/schema-fields\";\nimport { runAsynchronouslyWithAlert } from \"@hexclave/shared/dist/utils/promises\";\nimport { Button, Input, Label, PasswordInput } from \"@hexclave/ui\";\nimport { useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport * as yup from \"yup\";\nimport { useStackApp } from \"..\";\nimport { useTranslation } from \"../lib/translations\";\nimport { FormWarningText } from \"./elements/form-warning\";\nimport { StyledLink } from \"./link\";\n\nexport function CredentialSignIn() {\n const { t } = useTranslation();\n\n const schema = yupObject({\n email: strictEmailSchema(t('Please enter a valid email')).defined().nonEmpty(t('Please enter your email')),\n password: passwordSchema.defined().nonEmpty(t('Please enter your password'))\n });\n\n const { register, handleSubmit, setError, formState: { errors } } = useForm({\n resolver: yupResolver(schema)\n });\n const app = useStackApp();\n const [loading, setLoading] = useState(false);\n\n const onSubmit = async (data: yup.InferType<typeof schema>) => {\n setLoading(true);\n\n try {\n const { email, password } = data;\n const result = await app.signInWithCredential({\n email,\n password,\n });\n if (result.status === 'error') {\n setError('email', { type: 'manual', message: result.error.message });\n }\n } finally {\n setLoading(false);\n }\n };\n\n return (\n <form\n className=\"flex flex-col items-stretch stack-scope\"\n onSubmit={e => runAsynchronouslyWithAlert(handleSubmit(onSubmit)(e))}\n noValidate\n >\n <Label htmlFor=\"email\" className=\"mb-1\">{t('Email')}</Label>\n <Input\n id=\"email\"\n type=\"email\"\n autoComplete=\"email\"\n {...register('email')}\n />\n <FormWarningText text={errors.email?.message?.toString()} />\n\n <Label htmlFor=\"password\" className=\"mt-4 mb-1\">{t('Password')}</Label>\n <PasswordInput\n id=\"password\"\n autoComplete=\"current-password\"\n {...register('password')}\n />\n <FormWarningText text={errors.password?.message?.toString()} />\n\n <StyledLink
|
|
1
|
+
{"version":3,"file":"credential-sign-in.js","names":["passwordSchema","Label","Input","FormWarningText","PasswordInput","StyledLink","Button"],"sources":["../../src/components/credential-sign-in.tsx"],"sourcesContent":["'use client';\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n\nimport { yupResolver } from \"@hookform/resolvers/yup\";\nimport { passwordSchema, strictEmailSchema, yupObject } from \"@hexclave/shared/dist/schema-fields\";\nimport { runAsynchronouslyWithAlert } from \"@hexclave/shared/dist/utils/promises\";\nimport { Button, Input, Label, PasswordInput } from \"@hexclave/ui\";\nimport { useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport * as yup from \"yup\";\nimport { useStackApp } from \"..\";\nimport { useTranslation } from \"../lib/translations\";\nimport { FormWarningText } from \"./elements/form-warning\";\nimport { StyledLink } from \"./link\";\n\nexport function CredentialSignIn() {\n const { t } = useTranslation();\n\n const schema = yupObject({\n email: strictEmailSchema(t('Please enter a valid email')).defined().nonEmpty(t('Please enter your email')),\n password: passwordSchema.defined().nonEmpty(t('Please enter your password'))\n });\n\n const { register, handleSubmit, setError, formState: { errors } } = useForm({\n resolver: yupResolver(schema)\n });\n const app = useStackApp();\n const [loading, setLoading] = useState(false);\n\n const onSubmit = async (data: yup.InferType<typeof schema>) => {\n setLoading(true);\n\n try {\n const { email, password } = data;\n const result = await app.signInWithCredential({\n email,\n password,\n });\n if (result.status === 'error') {\n setError('email', { type: 'manual', message: result.error.message });\n }\n } finally {\n setLoading(false);\n }\n };\n\n return (\n <form\n className=\"flex flex-col items-stretch stack-scope\"\n onSubmit={e => runAsynchronouslyWithAlert(handleSubmit(onSubmit)(e))}\n noValidate\n >\n <Label htmlFor=\"email\" className=\"mb-1\">{t('Email')}</Label>\n <Input\n id=\"email\"\n type=\"email\"\n autoComplete=\"email\"\n {...register('email')}\n />\n <FormWarningText text={errors.email?.message?.toString()} />\n\n <Label htmlFor=\"password\" className=\"mt-4 mb-1\">{t('Password')}</Label>\n <PasswordInput\n id=\"password\"\n autoComplete=\"current-password\"\n {...register('password')}\n />\n <FormWarningText text={errors.password?.message?.toString()} />\n\n <StyledLink\n href=\"#\"\n className=\"mt-1 text-sm\"\n onClick={(e) => {\n e.preventDefault();\n runAsynchronouslyWithAlert(app.redirectToForgotPassword());\n }}\n >\n {t('Forgot password?')}\n </StyledLink>\n\n <Button type=\"submit\" className=\"mt-6\" loading={loading}>\n {t('Sign In')}\n </Button>\n </form>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAmBA,SAAgB,mBAAmB;CACjC,MAAM,EAAE,kDAAsB;CAO9B,MAAM,EAAE,UAAU,cAAc,UAAU,WAAW,EAAE,0CAAqB,EAC1E,sGANuB;EACvB,kEAAyB,EAAE,6BAA6B,CAAC,CAAC,SAAS,CAAC,SAAS,EAAE,0BAA0B,CAAC;EAC1G,UAAUA,mDAAe,SAAS,CAAC,SAAS,EAAE,6BAA6B,CAAC;EAC7E,CAAC,CAG6B,EAC9B,CAAC;CACF,MAAM,oCAAmB;CACzB,MAAM,CAAC,SAAS,kCAAuB,MAAM;CAE7C,MAAM,WAAW,OAAO,SAAuC;AAC7D,aAAW,KAAK;AAEhB,MAAI;GACF,MAAM,EAAE,OAAO,aAAa;GAC5B,MAAM,SAAS,MAAM,IAAI,qBAAqB;IAC5C;IACA;IACD,CAAC;AACF,OAAI,OAAO,WAAW,QACpB,UAAS,SAAS;IAAE,MAAM;IAAU,SAAS,OAAO,MAAM;IAAS,CAAC;YAE9D;AACR,cAAW,MAAM;;;AAIrB,QACE,4CAAC;EACC,WAAU;EACV,WAAU,2EAAgC,aAAa,SAAS,CAAC,EAAE,CAAC;EACpE;;GAEA,2CAACC;IAAM,SAAQ;IAAQ,WAAU;cAAQ,EAAE,QAAQ;KAAS;GAC5D,2CAACC;IACC,IAAG;IACH,MAAK;IACL,cAAa;IACb,GAAI,SAAS,QAAQ;KACrB;GACF,2CAACC,8CAAgB,MAAM,OAAO,OAAO,SAAS,UAAU,GAAI;GAE5D,2CAACF;IAAM,SAAQ;IAAW,WAAU;cAAa,EAAE,WAAW;KAAS;GACvE,2CAACG;IACC,IAAG;IACH,cAAa;IACb,GAAI,SAAS,WAAW;KACxB;GACF,2CAACD,8CAAgB,MAAM,OAAO,UAAU,SAAS,UAAU,GAAI;GAE/D,2CAACE;IACC,MAAK;IACL,WAAU;IACV,UAAU,MAAM;AACd,OAAE,gBAAgB;AAClB,0EAA2B,IAAI,0BAA0B,CAAC;;cAG3D,EAAE,mBAAmB;KACX;GAEb,2CAACC;IAAO,MAAK;IAAS,WAAU;IAAgB;cAC7C,EAAE,UAAU;KACN;;GACJ"}
|
|
@@ -7,8 +7,8 @@ let react = require("react");
|
|
|
7
7
|
react = require_chunk.__toESM(react);
|
|
8
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
9
|
let lucide_react = require("lucide-react");
|
|
10
|
-
let _hexclave_shared_dist_hooks_use_hash = require("@hexclave/shared/dist/hooks/use-hash");
|
|
11
10
|
let ______index_js = require("../../index.js");
|
|
11
|
+
let _hexclave_shared_dist_hooks_use_hash = require("@hexclave/shared/dist/hooks/use-hash");
|
|
12
12
|
|
|
13
13
|
//#region src/components/elements/sidebar-layout.tsx
|
|
14
14
|
function SidebarLayout(props) {
|
|
@@ -28,15 +28,13 @@ function Inner(props) {
|
|
|
28
28
|
const userFromHook = (0, ___index_js.useUser)();
|
|
29
29
|
const app = props.mockUser ? {
|
|
30
30
|
useProject: () => props.mockProject || { config: { clientTeamCreationEnabled: false } },
|
|
31
|
-
|
|
32
|
-
urls: { accountSettings: "/account-settings" }
|
|
31
|
+
redirectToAccountSettings: async () => {}
|
|
33
32
|
} : appFromHook;
|
|
34
33
|
const user = props.mockUser ? {
|
|
35
34
|
selectedTeam: props.mockUser.team,
|
|
36
35
|
useTeams: () => props.mockTeams || [],
|
|
37
36
|
setSelectedTeam: async () => {}
|
|
38
37
|
} : userFromHook;
|
|
39
|
-
const navigate = app.useNavigate();
|
|
40
38
|
const project = app.useProject();
|
|
41
39
|
const rawTeams = props.teams ?? user?.useTeams();
|
|
42
40
|
const selectedTeam = props.team || rawTeams?.find((team) => team.id === props.teamId);
|
|
@@ -66,7 +64,7 @@ function Inner(props) {
|
|
|
66
64
|
size: "icon",
|
|
67
65
|
className: "h-6 w-6",
|
|
68
66
|
onClick: () => {
|
|
69
|
-
if (!props.mockUser)
|
|
67
|
+
if (!props.mockUser) (0, _hexclave_shared_dist_utils_promises.runAsynchronouslyWithAlert)(app.redirectToAccountSettings());
|
|
70
68
|
},
|
|
71
69
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(lucide_react.Settings, { className: "h-4 w-4" })
|
|
72
70
|
})]
|
|
@@ -103,7 +101,7 @@ function Inner(props) {
|
|
|
103
101
|
!teams?.length && !props.allowNull ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hexclave_ui.SelectGroup, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hexclave_ui.SelectLabel, { children: t("No teams yet") }) }) : null,
|
|
104
102
|
project.config.clientTeamCreationEnabled && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hexclave_ui.SelectSeparator, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_hexclave_ui.Button, {
|
|
105
103
|
onClick: () => {
|
|
106
|
-
if (!props.mockUser)
|
|
104
|
+
if (!props.mockUser) (0, _hexclave_shared_dist_utils_promises.runAsynchronouslyWithAlert)(app.redirectToAccountSettings());
|
|
107
105
|
},
|
|
108
106
|
className: "w-full",
|
|
109
107
|
variant: "ghost",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team-switcher.js","names":["Suspense","Skeleton","Select","HexclaveAssertionError","SelectTrigger","SelectValue","SelectContent","SelectGroup","SelectLabel","Button","Settings","SelectItem","TeamIcon","Typography","SelectSeparator","PlusCircle"],"sources":["../../src/components/team-switcher.tsx"],"sourcesContent":["'use client';\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { HexclaveAssertionError } from \"@hexclave/shared/dist/utils/errors\";\nimport { runAsynchronouslyWithAlert } from \"@hexclave/shared/dist/utils/promises\";\nimport {\n Button,\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n Skeleton,\n Typography,\n cn,\n} from \"@hexclave/ui\";\nimport { PlusCircle, Settings } from \"lucide-react\";\nimport { Suspense, useMemo } from \"react\";\nimport { Team, useStackApp, useUser } from \"..\";\nimport { useTranslation } from \"../lib/translations\";\nimport { TeamIcon } from \"./team-icon\";\n\ntype MockTeam = {\n id: string,\n displayName: string,\n profileImageUrl?: string | null,\n};\n\ntype TeamSwitcherProps<AllowNull extends boolean = false> = {\n team?: Team,\n teamId?: string,\n teams?: Team[],\n allowNull?: AllowNull,\n nullLabel?: string,\n triggerClassName?: string,\n onChange?: (team: AllowNull extends true ? Team | null : Team) => Promise<void>,\n // Mock data props\n mockUser?: {\n team?: MockTeam,\n },\n mockTeams?: MockTeam[],\n mockProject?: {\n config: {\n clientTeamCreationEnabled: boolean,\n },\n },\n};\n\nexport function TeamSwitcher<AllowNull extends boolean = false>(props: TeamSwitcherProps<AllowNull>) {\n return <Suspense fallback={<Fallback />}>\n <Inner {...props} />\n </Suspense>;\n}\n\nfunction Fallback() {\n return <Skeleton className=\"h-9 w-full max-w-64 stack-scope\" />;\n}\n\nfunction Inner<AllowNull extends boolean>(props: TeamSwitcherProps<AllowNull>) {\n const { t } = useTranslation();\n const appFromHook = useStackApp();\n const userFromHook = useUser();\n\n // Use mock data if provided, otherwise use real data\n const app = props.mockUser ? {\n useProject: () => props.mockProject || { config: { clientTeamCreationEnabled: false } },\n
|
|
1
|
+
{"version":3,"file":"team-switcher.js","names":["Suspense","Skeleton","Select","HexclaveAssertionError","SelectTrigger","SelectValue","SelectContent","SelectGroup","SelectLabel","Button","Settings","SelectItem","TeamIcon","Typography","SelectSeparator","PlusCircle"],"sources":["../../src/components/team-switcher.tsx"],"sourcesContent":["'use client';\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { HexclaveAssertionError } from \"@hexclave/shared/dist/utils/errors\";\nimport { runAsynchronouslyWithAlert } from \"@hexclave/shared/dist/utils/promises\";\nimport {\n Button,\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n Skeleton,\n Typography,\n cn,\n} from \"@hexclave/ui\";\nimport { PlusCircle, Settings } from \"lucide-react\";\nimport { Suspense, useMemo } from \"react\";\nimport { Team, useStackApp, useUser } from \"..\";\nimport { useTranslation } from \"../lib/translations\";\nimport { TeamIcon } from \"./team-icon\";\n\ntype MockTeam = {\n id: string,\n displayName: string,\n profileImageUrl?: string | null,\n};\n\ntype TeamSwitcherProps<AllowNull extends boolean = false> = {\n team?: Team,\n teamId?: string,\n teams?: Team[],\n allowNull?: AllowNull,\n nullLabel?: string,\n triggerClassName?: string,\n onChange?: (team: AllowNull extends true ? Team | null : Team) => Promise<void>,\n // Mock data props\n mockUser?: {\n team?: MockTeam,\n },\n mockTeams?: MockTeam[],\n mockProject?: {\n config: {\n clientTeamCreationEnabled: boolean,\n },\n },\n};\n\nexport function TeamSwitcher<AllowNull extends boolean = false>(props: TeamSwitcherProps<AllowNull>) {\n return <Suspense fallback={<Fallback />}>\n <Inner {...props} />\n </Suspense>;\n}\n\nfunction Fallback() {\n return <Skeleton className=\"h-9 w-full max-w-64 stack-scope\" />;\n}\n\nfunction Inner<AllowNull extends boolean>(props: TeamSwitcherProps<AllowNull>) {\n const { t } = useTranslation();\n const appFromHook = useStackApp();\n const userFromHook = useUser();\n\n // Use mock data if provided, otherwise use real data\n const app = props.mockUser ? {\n useProject: () => props.mockProject || { config: { clientTeamCreationEnabled: false } },\n redirectToAccountSettings: async () => {},\n } : appFromHook;\n\n const user = props.mockUser ? {\n selectedTeam: props.mockUser.team,\n useTeams: () => props.mockTeams || [],\n setSelectedTeam: async () => {}, // Mock function\n } : userFromHook;\n\n const project = app.useProject();\n const rawTeams = props.teams ?? user?.useTeams();\n const selectedTeam = props.team || rawTeams?.find(team => team.id === props.teamId);\n const teams = useMemo(() => rawTeams?.sort((a, b) => b.id === selectedTeam?.id ? 1 : -1), [rawTeams, selectedTeam]);\n\n\n return (\n <Select\n value={selectedTeam?.id || (props.allowNull ? 'null-sentinel' : undefined)}\n onValueChange={(value) => {\n runAsynchronouslyWithAlert(async () => {\n let team: MockTeam | null = null;\n if (value !== 'null-sentinel') {\n team = teams?.find(team => team.id === value) || null;\n if (!team) {\n throw new HexclaveAssertionError('Team not found, this should not happen');\n }\n } else {\n team = null;\n }\n\n // Call onChange callback if provided\n if (props.onChange) {\n await props.onChange(team as Team);\n }\n });\n }}\n >\n <SelectTrigger className={cn(\"stack-scope max-w-64\", props.triggerClassName)}>\n <SelectValue placeholder=\"Select team\"/>\n </SelectTrigger>\n <SelectContent className=\"stack-scope\">\n {selectedTeam ? <SelectGroup>\n <SelectLabel>\n <div className=\"flex items-center justify-between\">\n <span>\n {t('Current team')}\n </span>\n <Button\n variant='ghost'\n size='icon'\n className=\"h-6 w-6\"\n onClick={() => {\n if (!props.mockUser) {\n runAsynchronouslyWithAlert(app.redirectToAccountSettings());\n }\n }}\n >\n <Settings className=\"h-4 w-4\"/>\n </Button>\n </div>\n </SelectLabel>\n <SelectItem value={selectedTeam.id}>\n <div className=\"flex items-center gap-2\">\n <TeamIcon team={selectedTeam as Team} />\n <Typography className=\"max-w-40 truncate\">{selectedTeam.displayName}</Typography>\n </div>\n </SelectItem>\n </SelectGroup> : undefined}\n\n {props.allowNull && <SelectGroup>\n <SelectItem value=\"null-sentinel\">\n <div className=\"flex items-center gap-2\">\n <TeamIcon team='personal' />\n <Typography className=\"max-w-40 truncate\">{props.nullLabel || t('No team')}</Typography>\n </div>\n </SelectItem>\n </SelectGroup>}\n\n {teams?.length ?\n <SelectGroup>\n <SelectLabel>{t('Other teams')}</SelectLabel>\n {teams.filter(team => team.id !== selectedTeam?.id)\n .map(team => (\n <SelectItem value={team.id} key={team.id}>\n <div className=\"flex items-center gap-2\">\n <TeamIcon team={team as Team} />\n <Typography className=\"max-w-64 truncate\">{team.displayName}</Typography>\n </div>\n </SelectItem>\n ))}\n </SelectGroup> : null}\n\n {!teams?.length && !props.allowNull ?\n <SelectGroup>\n <SelectLabel>{t('No teams yet')}</SelectLabel>\n </SelectGroup> : null}\n\n {project.config.clientTeamCreationEnabled && <>\n <SelectSeparator/>\n <div>\n <Button\n onClick={() => {\n if (!props.mockUser) {\n runAsynchronouslyWithAlert(app.redirectToAccountSettings());\n }\n }}\n className=\"w-full\"\n variant='ghost'\n >\n <PlusCircle className=\"mr-2 h-4 w-4\"/> {t('Create a team')}\n </Button>\n </div>\n </>}\n </SelectContent>\n </Select>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAsDA,SAAgB,aAAgD,OAAqC;AACnG,QAAO,2CAACA;EAAS,UAAU,2CAAC,aAAW;YACrC,2CAAC,SAAM,GAAI,QAAS;GACX;;AAGb,SAAS,WAAW;AAClB,QAAO,2CAACC,yBAAS,WAAU,oCAAoC;;AAGjE,SAAS,MAAiC,OAAqC;CAC7E,MAAM,EAAE,kDAAsB;CAC9B,MAAM,4CAA2B;CACjC,MAAM,yCAAwB;CAG9B,MAAM,MAAM,MAAM,WAAW;EAC3B,kBAAkB,MAAM,eAAe,EAAE,QAAQ,EAAE,2BAA2B,OAAO,EAAE;EACvF,2BAA2B,YAAY;EACxC,GAAG;CAEJ,MAAM,OAAO,MAAM,WAAW;EAC5B,cAAc,MAAM,SAAS;EAC7B,gBAAgB,MAAM,aAAa,EAAE;EACrC,iBAAiB,YAAY;EAC9B,GAAG;CAEJ,MAAM,UAAU,IAAI,YAAY;CAChC,MAAM,WAAW,MAAM,SAAS,MAAM,UAAU;CAChD,MAAM,eAAe,MAAM,QAAQ,UAAU,MAAK,SAAQ,KAAK,OAAO,MAAM,OAAO;CACnF,MAAM,iCAAsB,UAAU,MAAM,GAAG,MAAM,EAAE,OAAO,cAAc,KAAK,IAAI,GAAG,EAAE,CAAC,UAAU,aAAa,CAAC;AAGnH,QACE,4CAACC;EACC,OAAO,cAAc,OAAO,MAAM,YAAY,kBAAkB;EAChE,gBAAgB,UAAU;AACxB,wEAA2B,YAAY;IACrC,IAAI,OAAwB;AAC5B,QAAI,UAAU,iBAAiB;AAC7B,YAAO,OAAO,MAAK,SAAQ,KAAK,OAAO,MAAM,IAAI;AACjD,SAAI,CAAC,KACH,OAAM,IAAIC,0DAAuB,yCAAyC;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2CAACM,iCAAiB,EAClB,2CAAC,mBACC,4CAACL;KACC,eAAe;AACb,UAAI,CAAC,MAAM,SACT,sEAA2B,IAAI,2BAA2B,CAAC;;KAG/D,WAAU;KACV,SAAQ;;MAER,2CAACM,2BAAW,WAAU,iBAAgB;;MAAE,EAAE,gBAAgB;;MACnD,GACL,IACL;;IACW;GACT"}
|
|
@@ -134,7 +134,7 @@ function Inner(props) {
|
|
|
134
134
|
t("Don't have an account?"),
|
|
135
135
|
" ",
|
|
136
136
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(___components_link_js.StyledLink, {
|
|
137
|
-
href:
|
|
137
|
+
href: "#",
|
|
138
138
|
onClick: (e) => {
|
|
139
139
|
(0, _hexclave_shared_dist_utils_promises.runAsynchronously)(hexclaveApp.redirectToSignUp());
|
|
140
140
|
e.preventDefault();
|
|
@@ -145,7 +145,7 @@ function Inner(props) {
|
|
|
145
145
|
t("Already have an account?"),
|
|
146
146
|
" ",
|
|
147
147
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(___components_link_js.StyledLink, {
|
|
148
|
-
href:
|
|
148
|
+
href: "#",
|
|
149
149
|
onClick: (e) => {
|
|
150
150
|
(0, _hexclave_shared_dist_utils_promises.runAsynchronously)(hexclaveApp.redirectToSignIn());
|
|
151
151
|
e.preventDefault();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth-page.js","names":["Suspense","MaybeFullPage","Skeleton","KnownError","KnownErrorMessageCard","PredefinedMessageCard","MessageCard","Typography","StyledLink","OAuthButtonGroup","PasskeyButton","SeparatorWithText","Tabs","TabsList","TabsTrigger","TabsContent","MagicLinkSignIn","CredentialSignUp","CredentialSignIn"],"sources":["../../src/components-page/auth-page.tsx"],"sourcesContent":["'use client';\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n\nimport { KnownError } from '@hexclave/shared';\nimport { captureError } from '@hexclave/shared/dist/utils/errors';\nimport { runAsynchronously } from '@hexclave/shared/dist/utils/promises';\nimport { use } from '@hexclave/shared/dist/utils/react';\nimport { Skeleton, Tabs, TabsContent, TabsList, TabsTrigger, Typography, cn } from '@hexclave/ui';\nimport { Suspense, useMemo } from 'react';\nimport { useStackApp, useUser } from '..';\nimport { CredentialSignIn } from '../components/credential-sign-in';\nimport { CredentialSignUp } from '../components/credential-sign-up';\nimport { MaybeFullPage } from '../components/elements/maybe-full-page';\nimport { SeparatorWithText } from '../components/elements/separator-with-text';\nimport { StyledLink } from '../components/link';\nimport { KnownErrorMessageCard } from '../components/message-cards/known-error-message-card';\nimport { MessageCard } from '../components/message-cards/message-card';\nimport { MagicLinkSignIn } from '../components/magic-link-sign-in';\nimport { PredefinedMessageCard } from '../components/message-cards/predefined-message-card';\nimport { OAuthButtonGroup } from '../components/oauth-button-group';\nimport { PasskeyButton } from '../components/passkey-button';\nimport { useTranslation } from '../lib/translations';\n\ntype Props = {\n noPasswordRepeat?: boolean,\n firstTab?: 'magic-link' | 'password',\n fullPage?: boolean,\n type: 'sign-in' | 'sign-up',\n automaticRedirect?: boolean,\n extraInfo?: React.ReactNode,\n mockProject?: {\n config: {\n signUpEnabled: boolean,\n credentialEnabled: boolean,\n passkeyEnabled: boolean,\n magicLinkEnabled: boolean,\n oauthProviders: {\n id: string,\n }[],\n },\n },\n}\n\ntype AutomaticRedirectResult =\n | { status: \"success\" }\n | { status: \"known-error\", error: KnownError }\n | { status: \"unknown-error\" };\n\nexport function AuthPage(props: Props) {\n return <Suspense fallback={<Fallback {...props} />}>\n <Inner {...props} />\n </Suspense>;\n}\n\nfunction Fallback(props: Props) {\n return (\n <MaybeFullPage fullPage={!!props.fullPage}>\n <div className='stack-scope flex flex-col items-stretch' style={{ maxWidth: '380px', flexBasis: '380px', padding: props.fullPage ? '1rem' : 0 }}>\n <div className=\"text-center mb-6 flex flex-col\">\n <Skeleton className='h-9 w-2/3 self-center' />\n\n <Skeleton className='h-3 w-16 mt-8' />\n <Skeleton className='h-9 w-full mt-1' />\n\n <Skeleton className='h-3 w-24 mt-2' />\n <Skeleton className='h-9 w-full mt-1' />\n\n <Skeleton className='h-9 w-full mt-6' />\n </div>\n </div>\n </MaybeFullPage>\n );\n}\n\nfunction AutomaticRedirect(props: {\n fullPage?: boolean,\n isRestricted: boolean,\n type: 'sign-in' | 'sign-up',\n}) {\n const hexclaveApp = useStackApp();\n const { t } = useTranslation();\n const redirectResultPromise = useMemo(async (): Promise<AutomaticRedirectResult> => {\n try {\n await (\n props.isRestricted\n ? hexclaveApp.redirectToOnboarding({ replace: true })\n : props.type === 'sign-in'\n ? hexclaveApp.redirectToAfterSignIn({ replace: true })\n : hexclaveApp.redirectToAfterSignUp({ replace: true })\n );\n return { status: \"success\" };\n } catch (e) {\n if (KnownError.isKnownError(e)) {\n return { status: \"known-error\", error: e };\n }\n captureError(\"<AuthPage automaticRedirect />\", e);\n return { status: \"unknown-error\" };\n }\n }, [hexclaveApp, props.isRestricted, props.type]);\n\n const redirectResult = use(redirectResultPromise);\n if (redirectResult.status === \"known-error\") {\n return <KnownErrorMessageCard error={redirectResult.error} fullPage={props.fullPage} />;\n }\n if (redirectResult.status === \"unknown-error\") {\n return <PredefinedMessageCard type='unknownError' fullPage={props.fullPage} />;\n }\n return <MessageCard title={t(\"Redirecting...\")} fullPage={props.fullPage} />;\n}\n\nfunction Inner(props: Props) {\n const hexclaveApp = useStackApp();\n const user = useUser({ includeRestricted: true });\n const projectFromHook = hexclaveApp.useProject();\n const project = props.mockProject || projectFromHook;\n const { t } = useTranslation();\n\n if (props.automaticRedirect && user && !props.mockProject) {\n return <Suspense fallback={<MessageCard title={t(\"Redirecting...\")} fullPage={props.fullPage} />}>\n <AutomaticRedirect fullPage={props.fullPage} isRestricted={user.isRestricted} type={props.type} />\n </Suspense>;\n }\n\n if (user && !props.mockProject && !props.automaticRedirect) {\n return <PredefinedMessageCard type='signedIn' fullPage={props.fullPage} />;\n }\n\n if (props.type === 'sign-up' && !project.config.signUpEnabled) {\n return <PredefinedMessageCard type='signUpDisabled' fullPage={props.fullPage} />;\n }\n\n const hasOAuthProviders = project.config.oauthProviders.length > 0;\n const hasPasskey = (project.config.passkeyEnabled === true && props.type === \"sign-in\");\n const enableSeparator = (project.config.credentialEnabled || project.config.magicLinkEnabled) && (hasOAuthProviders || hasPasskey);\n\n return (\n <MaybeFullPage fullPage={!!props.fullPage}>\n <div className='stack-scope flex flex-col items-stretch' style={{ maxWidth: '380px', flexBasis: '380px', padding: props.fullPage ? '1rem' : 0 }}>\n <div className=\"text-center mb-6\">\n <Typography type='h2'>\n {props.type === 'sign-in' ? t(\"Sign in to your account\") : t(\"Create a new account\")}\n </Typography>\n {props.type === 'sign-in' ? (\n project.config.signUpEnabled && (\n <Typography>\n {t(\"Don't have an account?\")}{\" \"}\n <StyledLink href={hexclaveApp.urls.signUp} onClick={(e) => {\n runAsynchronously(hexclaveApp.redirectToSignUp());\n e.preventDefault();\n }}>{t(\"Sign up\")}</StyledLink>\n </Typography>\n )\n ) : (\n <Typography>\n {t(\"Already have an account?\")}{\" \"}\n <StyledLink href={hexclaveApp.urls.signIn} onClick={(e) => {\n runAsynchronously(hexclaveApp.redirectToSignIn());\n e.preventDefault();\n }}>{t(\"Sign in\")}</StyledLink>\n </Typography>\n )}\n </div>\n {(hasOAuthProviders || hasPasskey) && (\n <div className='gap-4 flex flex-col items-stretch stack-scope'>\n {hasOAuthProviders && <OAuthButtonGroup type={props.type} mockProject={props.mockProject} />}\n {hasPasskey && <PasskeyButton type={props.type} />}\n </div>\n )}\n\n {enableSeparator && <SeparatorWithText text={t('Or continue with')} />}\n {project.config.credentialEnabled && project.config.magicLinkEnabled ? (\n <Tabs defaultValue={props.firstTab || 'magic-link'}>\n <TabsList className={cn('w-full mb-2', {\n 'flex-row-reverse': props.firstTab === 'password'\n })}>\n <TabsTrigger value='magic-link' className='flex-1'>{t(\"Email\")}</TabsTrigger>\n <TabsTrigger value='password' className='flex-1'>{t(\"Email & Password\")}</TabsTrigger>\n </TabsList>\n <TabsContent value='magic-link'>\n <MagicLinkSignIn />\n </TabsContent>\n <TabsContent value='password'>\n {props.type === 'sign-up' ? <CredentialSignUp noPasswordRepeat={props.noPasswordRepeat} /> : <CredentialSignIn />}\n </TabsContent>\n </Tabs>\n ) : project.config.credentialEnabled ? (\n props.type === 'sign-up' ? <CredentialSignUp noPasswordRepeat={props.noPasswordRepeat} /> : <CredentialSignIn />\n ) : project.config.magicLinkEnabled ? (\n <MagicLinkSignIn />\n ) : !(hasOAuthProviders || hasPasskey) ? <Typography variant={\"destructive\"} className=\"text-center\">{t(\"No authentication method enabled.\")}</Typography> : null}\n {props.extraInfo && (\n <div className={cn('flex flex-col items-center text-center text-sm text-gray-500', {\n 'mt-2': project.config.credentialEnabled || project.config.magicLinkEnabled,\n 'mt-6': !(project.config.credentialEnabled || project.config.magicLinkEnabled),\n })}>\n <div>{props.extraInfo}</div>\n </div>\n )}\n </div>\n </MaybeFullPage>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,SAAgB,SAAS,OAAc;AACrC,QAAO,2CAACA;EAAS,UAAU,2CAAC,YAAS,GAAI,QAAS;YAChD,2CAAC,SAAM,GAAI,QAAS;GACX;;AAGb,SAAS,SAAS,OAAc;AAC9B,QACE,2CAACC;EAAc,UAAU,CAAC,CAAC,MAAM;YAC/B,2CAAC;GAAI,WAAU;GAA0C,OAAO;IAAE,UAAU;IAAS,WAAW;IAAS,SAAS,MAAM,WAAW,SAAS;IAAG;aAC7I,4CAAC;IAAI,WAAU;;KACb,2CAACC,yBAAS,WAAU,0BAA0B;KAE9C,2CAACA,yBAAS,WAAU,kBAAkB;KACtC,2CAACA,yBAAS,WAAU,oBAAoB;KAExC,2CAACA,yBAAS,WAAU,kBAAkB;KACtC,2CAACA,yBAAS,WAAU,oBAAoB;KAExC,2CAACA,yBAAS,WAAU,oBAAoB;;KACpC;IACF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I;IACrE,QAAQ,OAAO,qBAAqB,QAAQ,OAAO,mBAClD,4CAACC;KAAK,cAAc,MAAM,YAAY;;MACpC,4CAACC;OAAS,gCAAc,eAAe,EACrC,oBAAoB,MAAM,aAAa,YACxC,CAAC;kBACA,2CAACC;QAAY,OAAM;QAAa,WAAU;kBAAU,EAAE,QAAQ;SAAe,EAC7E,2CAACA;QAAY,OAAM;QAAW,WAAU;kBAAU,EAAE,mBAAmB;SAAe;QAC7E;MACX,2CAACC;OAAY,OAAM;iBACjB,2CAACC,wDAAkB;QACP;MACd,2CAACD;OAAY,OAAM;iBAChB,MAAM,SAAS,YAAY,2CAACE,wDAAiB,kBAAkB,MAAM,mBAAoB,GAAG,2CAACC,yDAAmB;QACrG;;MACT,GACL,QAAQ,OAAO,oBACjB,MAAM,SAAS,YAAY,2CAACD,wDAAiB,kBAAkB,MAAM,mBAAoB,GAAG,2CAACC,yDAAmB,GAC9G,QAAQ,OAAO,mBACjB,2CAACF,wDAAkB,GACjB,EAAE,qBAAqB,cAAc,2CAACT;KAAW,SAAS;KAAe,WAAU;eAAe,EAAE,oCAAoC;MAAc,GAAG;IAC5J,MAAM,aACL,2CAAC;KAAI,gCAAc,gEAAgE;MACjF,QAAQ,QAAQ,OAAO,qBAAqB,QAAQ,OAAO;MAC3D,QAAQ,EAAE,QAAQ,OAAO,qBAAqB,QAAQ,OAAO;MAC9D,CAAC;eACA,2CAAC,mBAAK,MAAM,YAAgB;MACxB;;IAEJ;GACQ"}
|
|
1
|
+
{"version":3,"file":"auth-page.js","names":["Suspense","MaybeFullPage","Skeleton","KnownError","KnownErrorMessageCard","PredefinedMessageCard","MessageCard","Typography","StyledLink","OAuthButtonGroup","PasskeyButton","SeparatorWithText","Tabs","TabsList","TabsTrigger","TabsContent","MagicLinkSignIn","CredentialSignUp","CredentialSignIn"],"sources":["../../src/components-page/auth-page.tsx"],"sourcesContent":["'use client';\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n\nimport { KnownError } from '@hexclave/shared';\nimport { captureError } from '@hexclave/shared/dist/utils/errors';\nimport { runAsynchronously } from '@hexclave/shared/dist/utils/promises';\nimport { use } from '@hexclave/shared/dist/utils/react';\nimport { Skeleton, Tabs, TabsContent, TabsList, TabsTrigger, Typography, cn } from '@hexclave/ui';\nimport { Suspense, useMemo } from 'react';\nimport { useStackApp, useUser } from '..';\nimport { CredentialSignIn } from '../components/credential-sign-in';\nimport { CredentialSignUp } from '../components/credential-sign-up';\nimport { MaybeFullPage } from '../components/elements/maybe-full-page';\nimport { SeparatorWithText } from '../components/elements/separator-with-text';\nimport { StyledLink } from '../components/link';\nimport { KnownErrorMessageCard } from '../components/message-cards/known-error-message-card';\nimport { MessageCard } from '../components/message-cards/message-card';\nimport { MagicLinkSignIn } from '../components/magic-link-sign-in';\nimport { PredefinedMessageCard } from '../components/message-cards/predefined-message-card';\nimport { OAuthButtonGroup } from '../components/oauth-button-group';\nimport { PasskeyButton } from '../components/passkey-button';\nimport { useTranslation } from '../lib/translations';\n\ntype Props = {\n noPasswordRepeat?: boolean,\n firstTab?: 'magic-link' | 'password',\n fullPage?: boolean,\n type: 'sign-in' | 'sign-up',\n automaticRedirect?: boolean,\n extraInfo?: React.ReactNode,\n mockProject?: {\n config: {\n signUpEnabled: boolean,\n credentialEnabled: boolean,\n passkeyEnabled: boolean,\n magicLinkEnabled: boolean,\n oauthProviders: {\n id: string,\n }[],\n },\n },\n}\n\ntype AutomaticRedirectResult =\n | { status: \"success\" }\n | { status: \"known-error\", error: KnownError }\n | { status: \"unknown-error\" };\n\nexport function AuthPage(props: Props) {\n return <Suspense fallback={<Fallback {...props} />}>\n <Inner {...props} />\n </Suspense>;\n}\n\nfunction Fallback(props: Props) {\n return (\n <MaybeFullPage fullPage={!!props.fullPage}>\n <div className='stack-scope flex flex-col items-stretch' style={{ maxWidth: '380px', flexBasis: '380px', padding: props.fullPage ? '1rem' : 0 }}>\n <div className=\"text-center mb-6 flex flex-col\">\n <Skeleton className='h-9 w-2/3 self-center' />\n\n <Skeleton className='h-3 w-16 mt-8' />\n <Skeleton className='h-9 w-full mt-1' />\n\n <Skeleton className='h-3 w-24 mt-2' />\n <Skeleton className='h-9 w-full mt-1' />\n\n <Skeleton className='h-9 w-full mt-6' />\n </div>\n </div>\n </MaybeFullPage>\n );\n}\n\nfunction AutomaticRedirect(props: {\n fullPage?: boolean,\n isRestricted: boolean,\n type: 'sign-in' | 'sign-up',\n}) {\n const hexclaveApp = useStackApp();\n const { t } = useTranslation();\n const redirectResultPromise = useMemo(async (): Promise<AutomaticRedirectResult> => {\n try {\n await (\n props.isRestricted\n ? hexclaveApp.redirectToOnboarding({ replace: true })\n : props.type === 'sign-in'\n ? hexclaveApp.redirectToAfterSignIn({ replace: true })\n : hexclaveApp.redirectToAfterSignUp({ replace: true })\n );\n return { status: \"success\" };\n } catch (e) {\n if (KnownError.isKnownError(e)) {\n return { status: \"known-error\", error: e };\n }\n captureError(\"<AuthPage automaticRedirect />\", e);\n return { status: \"unknown-error\" };\n }\n }, [hexclaveApp, props.isRestricted, props.type]);\n\n const redirectResult = use(redirectResultPromise);\n if (redirectResult.status === \"known-error\") {\n return <KnownErrorMessageCard error={redirectResult.error} fullPage={props.fullPage} />;\n }\n if (redirectResult.status === \"unknown-error\") {\n return <PredefinedMessageCard type='unknownError' fullPage={props.fullPage} />;\n }\n return <MessageCard title={t(\"Redirecting...\")} fullPage={props.fullPage} />;\n}\n\nfunction Inner(props: Props) {\n const hexclaveApp = useStackApp();\n const user = useUser({ includeRestricted: true });\n const projectFromHook = hexclaveApp.useProject();\n const project = props.mockProject || projectFromHook;\n const { t } = useTranslation();\n\n if (props.automaticRedirect && user && !props.mockProject) {\n return <Suspense fallback={<MessageCard title={t(\"Redirecting...\")} fullPage={props.fullPage} />}>\n <AutomaticRedirect fullPage={props.fullPage} isRestricted={user.isRestricted} type={props.type} />\n </Suspense>;\n }\n\n if (user && !props.mockProject && !props.automaticRedirect) {\n return <PredefinedMessageCard type='signedIn' fullPage={props.fullPage} />;\n }\n\n if (props.type === 'sign-up' && !project.config.signUpEnabled) {\n return <PredefinedMessageCard type='signUpDisabled' fullPage={props.fullPage} />;\n }\n\n const hasOAuthProviders = project.config.oauthProviders.length > 0;\n const hasPasskey = (project.config.passkeyEnabled === true && props.type === \"sign-in\");\n const enableSeparator = (project.config.credentialEnabled || project.config.magicLinkEnabled) && (hasOAuthProviders || hasPasskey);\n\n return (\n <MaybeFullPage fullPage={!!props.fullPage}>\n <div className='stack-scope flex flex-col items-stretch' style={{ maxWidth: '380px', flexBasis: '380px', padding: props.fullPage ? '1rem' : 0 }}>\n <div className=\"text-center mb-6\">\n <Typography type='h2'>\n {props.type === 'sign-in' ? t(\"Sign in to your account\") : t(\"Create a new account\")}\n </Typography>\n {props.type === 'sign-in' ? (\n project.config.signUpEnabled && (\n <Typography>\n {t(\"Don't have an account?\")}{\" \"}\n <StyledLink href=\"#\" onClick={(e) => {\n runAsynchronously(hexclaveApp.redirectToSignUp());\n e.preventDefault();\n }}>{t(\"Sign up\")}</StyledLink>\n </Typography>\n )\n ) : (\n <Typography>\n {t(\"Already have an account?\")}{\" \"}\n <StyledLink href=\"#\" onClick={(e) => {\n runAsynchronously(hexclaveApp.redirectToSignIn());\n e.preventDefault();\n }}>{t(\"Sign in\")}</StyledLink>\n </Typography>\n )}\n </div>\n {(hasOAuthProviders || hasPasskey) && (\n <div className='gap-4 flex flex-col items-stretch stack-scope'>\n {hasOAuthProviders && <OAuthButtonGroup type={props.type} mockProject={props.mockProject} />}\n {hasPasskey && <PasskeyButton type={props.type} />}\n </div>\n )}\n\n {enableSeparator && <SeparatorWithText text={t('Or continue with')} />}\n {project.config.credentialEnabled && project.config.magicLinkEnabled ? (\n <Tabs defaultValue={props.firstTab || 'magic-link'}>\n <TabsList className={cn('w-full mb-2', {\n 'flex-row-reverse': props.firstTab === 'password'\n })}>\n <TabsTrigger value='magic-link' className='flex-1'>{t(\"Email\")}</TabsTrigger>\n <TabsTrigger value='password' className='flex-1'>{t(\"Email & Password\")}</TabsTrigger>\n </TabsList>\n <TabsContent value='magic-link'>\n <MagicLinkSignIn />\n </TabsContent>\n <TabsContent value='password'>\n {props.type === 'sign-up' ? <CredentialSignUp noPasswordRepeat={props.noPasswordRepeat} /> : <CredentialSignIn />}\n </TabsContent>\n </Tabs>\n ) : project.config.credentialEnabled ? (\n props.type === 'sign-up' ? <CredentialSignUp noPasswordRepeat={props.noPasswordRepeat} /> : <CredentialSignIn />\n ) : project.config.magicLinkEnabled ? (\n <MagicLinkSignIn />\n ) : !(hasOAuthProviders || hasPasskey) ? <Typography variant={\"destructive\"} className=\"text-center\">{t(\"No authentication method enabled.\")}</Typography> : null}\n {props.extraInfo && (\n <div className={cn('flex flex-col items-center text-center text-sm text-gray-500', {\n 'mt-2': project.config.credentialEnabled || project.config.magicLinkEnabled,\n 'mt-6': !(project.config.credentialEnabled || project.config.magicLinkEnabled),\n })}>\n <div>{props.extraInfo}</div>\n </div>\n )}\n </div>\n </MaybeFullPage>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,SAAgB,SAAS,OAAc;AACrC,QAAO,2CAACA;EAAS,UAAU,2CAAC,YAAS,GAAI,QAAS;YAChD,2CAAC,SAAM,GAAI,QAAS;GACX;;AAGb,SAAS,SAAS,OAAc;AAC9B,QACE,2CAACC;EAAc,UAAU,CAAC,CAAC,MAAM;YAC/B,2CAAC;GAAI,WAAU;GAA0C,OAAO;IAAE,UAAU;IAAS,WAAW;IAAS,SAAS,MAAM,WAAW,SAAS;IAAG;aAC7I,4CAAC;IAAI,WAAU;;KACb,2CAACC,yBAAS,WAAU,0BAA0B;KAE9C,2CAACA,yBAAS,WAAU,kBAAkB;KACtC,2CAACA,yBAAS,WAAU,oBAAoB;KAExC,2CAACA,yBAAS,WAAU,kBAAkB;KACtC,2CAACA,yBAAS,W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mEAAkB,MAAM,EAAE,mBAAmB,GAAI;IACrE,QAAQ,OAAO,qBAAqB,QAAQ,OAAO,mBAClD,4CAACC;KAAK,cAAc,MAAM,YAAY;;MACpC,4CAACC;OAAS,gCAAc,eAAe,EACrC,oBAAoB,MAAM,aAAa,YACxC,CAAC;kBACA,2CAACC;QAAY,OAAM;QAAa,WAAU;kBAAU,EAAE,QAAQ;SAAe,EAC7E,2CAACA;QAAY,OAAM;QAAW,WAAU;kBAAU,EAAE,mBAAmB;SAAe;QAC7E;MACX,2CAACC;OAAY,OAAM;iBACjB,2CAACC,wDAAkB;QACP;MACd,2CAACD;OAAY,OAAM;iBAChB,MAAM,SAAS,YAAY,2CAACE,wDAAiB,kBAAkB,MAAM,mBAAoB,GAAG,2CAACC,yDAAmB;QACrG;;MACT,GACL,QAAQ,OAAO,oBACjB,MAAM,SAAS,YAAY,2CAACD,wDAAiB,kBAAkB,MAAM,mBAAoB,GAAG,2CAACC,yDAAmB,GAC9G,QAAQ,OAAO,mBACjB,2CAACF,wDAAkB,GACjB,EAAE,qBAAqB,cAAc,2CAACT;KAAW,SAAS;KAAe,WAAU;eAAe,EAAE,oCAAoC;MAAc,GAAG;IAC5J,MAAM,aACL,2CAAC;KAAI,gCAAc,gEAAgE;MACjF,QAAQ,QAAQ,OAAO,qBAAqB,QAAQ,OAAO;MAC3D,QAAQ,EAAE,QAAQ,OAAO,qBAAqB,QAAQ,OAAO;MAC9D,CAAC;eACA,2CAAC,mBAAK,MAAM,YAAgB;MACxB;;IAEJ;GACQ"}
|
|
@@ -84,7 +84,11 @@ function ForgotPassword(props) {
|
|
|
84
84
|
t("Don't need to reset?"),
|
|
85
85
|
" ",
|
|
86
86
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(___components_link_js.StyledLink, {
|
|
87
|
-
href:
|
|
87
|
+
href: "#",
|
|
88
|
+
onClick: (e) => {
|
|
89
|
+
e.preventDefault();
|
|
90
|
+
(0, _hexclave_shared_dist_utils_promises.runAsynchronouslyWithAlert)(hexclaveApp.redirectToSignIn());
|
|
91
|
+
},
|
|
88
92
|
children: t("Sign in")
|
|
89
93
|
})
|
|
90
94
|
] })]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forgot-password.js","names":["Label","Input","FormWarningText","Button","PredefinedMessageCard","MaybeFullPage","Typography","StyledLink"],"sources":["../../src/components-page/forgot-password.tsx"],"sourcesContent":["'use client';\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n\nimport { yupResolver } from \"@hookform/resolvers/yup\";\nimport { strictEmailSchema, yupObject } from \"@hexclave/shared/dist/schema-fields\";\nimport { runAsynchronouslyWithAlert } from \"@hexclave/shared/dist/utils/promises\";\nimport { Button, Input, Label, Typography, cn } from \"@hexclave/ui\";\nimport { useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport * as yup from \"yup\";\nimport { useStackApp, useUser } from \"..\";\nimport { FormWarningText } from \"../components/elements/form-warning\";\nimport { MaybeFullPage } from \"../components/elements/maybe-full-page\";\nimport { StyledLink } from \"../components/link\";\nimport { PredefinedMessageCard } from \"../components/message-cards/predefined-message-card\";\nimport { useTranslation } from \"../lib/translations\";\n\nexport function ForgotPasswordForm({ onSent }: { onSent?: () => void }) {\n const { t } = useTranslation();\n\n const schema = yupObject({\n email: strictEmailSchema(t(\"Please enter a valid email\")).defined().nonEmpty(t(\"Please enter your email\"))\n });\n\n const { register, handleSubmit, formState: { errors }, clearErrors } = useForm({\n resolver: yupResolver(schema)\n });\n const hexclaveApp = useStackApp();\n const [loading, setLoading] = useState(false);\n\n const onSubmit = async (data: yup.InferType<typeof schema>) => {\n setLoading(true);\n try {\n const { email } = data;\n await hexclaveApp.sendForgotPasswordEmail(email);\n onSent?.();\n } finally {\n setLoading(false);\n }\n };\n\n return (\n <form\n className=\"flex flex-col items-stretch stack-scope\"\n onSubmit={e => runAsynchronouslyWithAlert(handleSubmit(onSubmit)(e))}\n noValidate\n >\n <Label htmlFor=\"email\" className=\"mb-1\">{t(\"Your Email\")}</Label>\n <Input\n id=\"email\"\n type=\"email\"\n autoComplete=\"email\"\n {...register('email', { onChange: () => clearErrors('email') })}\n />\n <FormWarningText text={errors.email?.message?.toString()} />\n\n <Button type=\"submit\" className=\"mt-6\" loading={loading}>\n {t(\"Send Email\")}\n </Button>\n </form>\n );\n}\n\n\nexport function ForgotPassword(props: { fullPage?: boolean }) {\n const { t } = useTranslation();\n const hexclaveApp = useStackApp();\n const user = useUser();\n const [sent, setSent] = useState(false);\n\n if (user) {\n return <PredefinedMessageCard type='signedIn' fullPage={!!props.fullPage} />;\n }\n\n if (sent) {\n return <PredefinedMessageCard type='emailSent' fullPage={!!props.fullPage} />;\n }\n\n return (\n <MaybeFullPage fullPage={!!props.fullPage}>\n <div className={cn(\n \"stack-scope max-w-[380px] flex-basis-[380px]\",\n props.fullPage ? \"p-4\" : \"p-0\"\n )}>\n <div className=\"text-center\">\n <Typography type='h2'>{t(\"Reset Your Password\")}</Typography>\n <Typography>\n {t(\"Don't need to reset?\")}{\" \"}\n <StyledLink
|
|
1
|
+
{"version":3,"file":"forgot-password.js","names":["Label","Input","FormWarningText","Button","PredefinedMessageCard","MaybeFullPage","Typography","StyledLink"],"sources":["../../src/components-page/forgot-password.tsx"],"sourcesContent":["'use client';\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n\nimport { yupResolver } from \"@hookform/resolvers/yup\";\nimport { strictEmailSchema, yupObject } from \"@hexclave/shared/dist/schema-fields\";\nimport { runAsynchronouslyWithAlert } from \"@hexclave/shared/dist/utils/promises\";\nimport { Button, Input, Label, Typography, cn } from \"@hexclave/ui\";\nimport { useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport * as yup from \"yup\";\nimport { useStackApp, useUser } from \"..\";\nimport { FormWarningText } from \"../components/elements/form-warning\";\nimport { MaybeFullPage } from \"../components/elements/maybe-full-page\";\nimport { StyledLink } from \"../components/link\";\nimport { PredefinedMessageCard } from \"../components/message-cards/predefined-message-card\";\nimport { useTranslation } from \"../lib/translations\";\n\nexport function ForgotPasswordForm({ onSent }: { onSent?: () => void }) {\n const { t } = useTranslation();\n\n const schema = yupObject({\n email: strictEmailSchema(t(\"Please enter a valid email\")).defined().nonEmpty(t(\"Please enter your email\"))\n });\n\n const { register, handleSubmit, formState: { errors }, clearErrors } = useForm({\n resolver: yupResolver(schema)\n });\n const hexclaveApp = useStackApp();\n const [loading, setLoading] = useState(false);\n\n const onSubmit = async (data: yup.InferType<typeof schema>) => {\n setLoading(true);\n try {\n const { email } = data;\n await hexclaveApp.sendForgotPasswordEmail(email);\n onSent?.();\n } finally {\n setLoading(false);\n }\n };\n\n return (\n <form\n className=\"flex flex-col items-stretch stack-scope\"\n onSubmit={e => runAsynchronouslyWithAlert(handleSubmit(onSubmit)(e))}\n noValidate\n >\n <Label htmlFor=\"email\" className=\"mb-1\">{t(\"Your Email\")}</Label>\n <Input\n id=\"email\"\n type=\"email\"\n autoComplete=\"email\"\n {...register('email', { onChange: () => clearErrors('email') })}\n />\n <FormWarningText text={errors.email?.message?.toString()} />\n\n <Button type=\"submit\" className=\"mt-6\" loading={loading}>\n {t(\"Send Email\")}\n </Button>\n </form>\n );\n}\n\n\nexport function ForgotPassword(props: { fullPage?: boolean }) {\n const { t } = useTranslation();\n const hexclaveApp = useStackApp();\n const user = useUser();\n const [sent, setSent] = useState(false);\n\n if (user) {\n return <PredefinedMessageCard type='signedIn' fullPage={!!props.fullPage} />;\n }\n\n if (sent) {\n return <PredefinedMessageCard type='emailSent' fullPage={!!props.fullPage} />;\n }\n\n return (\n <MaybeFullPage fullPage={!!props.fullPage}>\n <div className={cn(\n \"stack-scope max-w-[380px] flex-basis-[380px]\",\n props.fullPage ? \"p-4\" : \"p-0\"\n )}>\n <div className=\"text-center\">\n <Typography type='h2'>{t(\"Reset Your Password\")}</Typography>\n <Typography>\n {t(\"Don't need to reset?\")}{\" \"}\n <StyledLink\n href=\"#\"\n onClick={(e) => {\n e.preventDefault();\n runAsynchronouslyWithAlert(hexclaveApp.redirectToSignIn());\n }}\n >\n {t(\"Sign in\")}\n </StyledLink>\n </Typography>\n </div>\n <div className=\"mt-6\">\n <ForgotPasswordForm onSent={() => setSent(true)} />\n </div>\n </div>\n </MaybeFullPage>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAqBA,SAAgB,mBAAmB,EAAE,UAAmC;CACtE,MAAM,EAAE,kDAAsB;CAM9B,MAAM,EAAE,UAAU,cAAc,WAAW,EAAE,UAAU,6CAAwB,EAC7E,sGALuB,EACvB,kEAAyB,EAAE,6BAA6B,CAAC,CAAC,SAAS,CAAC,SAAS,EAAE,0BAA0B,CAAC,EAC3G,CAAC,CAG6B,EAC9B,CAAC;CACF,MAAM,4CAA2B;CACjC,MAAM,CAAC,SAAS,kCAAuB,MAAM;CAE7C,MAAM,WAAW,OAAO,SAAuC;AAC7D,aAAW,KAAK;AAChB,MAAI;GACF,MAAM,EAAE,UAAU;AAClB,SAAM,YAAY,wBAAwB,MAAM;AAClD,aAAU;YACA;AACR,cAAW,MAAM;;;AAIrB,QACE,4CAAC;EACC,WAAU;EACV,WAAU,2EAAgC,aAAa,SAAS,CAAC,EAAE,CAAC;EACpE;;GAEA,2CAACA;IAAM,SAAQ;IAAQ,WAAU;cAAQ,EAAE,aAAa;KAAS;GACjE,2CAACC;IACC,IAAG;IACH,MAAK;IACL,cAAa;IACb,GAAI,SAAS,SAAS,EAAE,gBAAgB,YAAY,QAAQ,EAAE,CAAC;KAC/D;GACF,2CAACC,0DAAgB,MAAM,OAAO,OAAO,SAAS,UAAU,GAAI;GAE5D,2CAACC;IAAO,MAAK;IAAS,WAAU;IAAgB;cAC7C,EAAE,aAAa;KACT;;GACJ;;AAKX,SAAgB,eAAe,OAA+B;CAC5D,MAAM,EAAE,kDAAsB;CAC9B,MAAM,4CAA2B;CACjC,MAAM,iCAAgB;CACtB,MAAM,CAAC,MAAM,+BAAoB,MAAM;AAEvC,KAAI,KACF,QAAO,2CAACC;EAAsB,MAAK;EAAW,UAAU,CAAC,CAAC,MAAM;GAAY;AAG9E,KAAI,KACF,QAAO,2CAACA;EAAsB,MAAK;EAAY,UAAU,CAAC,CAAC,MAAM;GAAY;AAG/E,QACE,2CAACC;EAAc,UAAU,CAAC,CAAC,MAAM;YAC/B,4CAAC;GAAI,gCACH,gDACA,MAAM,WAAW,QAAQ,MAC1B;cACC,4CAAC;IAAI,WAAU;eACb,2CAACC;KAAW,MAAK;eAAM,EAAE,sBAAsB;MAAc,EAC7D,4CAACA;KACE,EAAE,uBAAuB;KAAE;KAC5B,2CAACC;MACC,MAAK;MACL,UAAU,MAAM;AACd,SAAE,gBAAgB;AAClB,4EAA2B,YAAY,kBAAkB,CAAC;;gBAG3D,EAAE,UAAU;OACF;QACF;KACT,EACN,2CAAC;IAAI,WAAU;cACb,2CAAC,sBAAmB,cAAc,QAAQ,KAAK,GAAI;KAC/C;IACF;GACQ"}
|
|
@@ -60,7 +60,12 @@ function OAuthCallback({ fullPage }) {
|
|
|
60
60
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_hexclave_ui.Spinner, { size: 20 })
|
|
61
61
|
}), showRedirectLink || redirectUrl != null ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", { children: [t("If you are not redirected automatically, "), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(___components_link_js.StyledLink, {
|
|
62
62
|
className: "whitespace-nowrap",
|
|
63
|
-
href: redirectUrl ??
|
|
63
|
+
href: redirectUrl ?? "#",
|
|
64
|
+
onClick: (e) => {
|
|
65
|
+
if (redirectUrl != null) return;
|
|
66
|
+
e.preventDefault();
|
|
67
|
+
(0, _hexclave_shared_dist_utils_promises.runAsynchronously)(app.redirectToHome());
|
|
68
|
+
},
|
|
64
69
|
children: t("click here")
|
|
65
70
|
})] }) : null]
|
|
66
71
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-callback.js","names":["hexclaveAppInternalsSymbol","KnownError","MaybeFullPage","Spinner","StyledLink"],"sources":["../../src/components-page/oauth-callback.tsx"],"sourcesContent":["'use client';\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n\nimport { KnownError } from \"@hexclave/shared\";\nimport { captureError } from \"@hexclave/shared/dist/utils/errors\";\nimport { runAsynchronously } from \"@hexclave/shared/dist/utils/promises\";\nimport { Spinner, cn } from \"@hexclave/ui\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { useStackApp } from \"..\";\nimport { MaybeFullPage } from \"../components/elements/maybe-full-page\";\nimport { StyledLink } from \"../components/link\";\nimport { hexclaveAppInternalsSymbol } from \"../lib/hexclave-app\";\nimport { useTranslation } from \"../lib/translations\";\n\nexport function OAuthCallback({ fullPage }: { fullPage?: boolean }) {\n const { t } = useTranslation();\n const app = useStackApp();\n const called = useRef(false);\n const [showRedirectLink, setShowRedirectLink] = useState(false);\n const [redirectUrl, setRedirectUrl] = useState<string | null>(null);\n\n useEffect(() => runAsynchronously(async () => {\n if (called.current) return;\n called.current = true;\n const redirectToError = async (url: URL) => {\n const urlString = url.toString();\n if (app[hexclaveAppInternalsSymbol].getRedirectMethod() === \"none\") {\n setRedirectUrl(urlString);\n return;\n }\n await app[hexclaveAppInternalsSymbol].redirectToUrl(urlString, { replace: true });\n };\n try {\n const hasRedirected = await app.callOAuthCallback();\n if (!hasRedirected) {\n await app.redirectToSignIn({ noRedirectBack: true });\n }\n } catch (e) {\n if (KnownError.isKnownError(e)) {\n const errorUrl = new URL(app.urls.error, window.location.href);\n errorUrl.searchParams.set(\"errorCode\", e.errorCode);\n errorUrl.searchParams.set(\"message\", e.message);\n errorUrl.searchParams.set(\"details\", JSON.stringify(e.details ?? {}));\n await redirectToError(errorUrl);\n return;\n }\n captureError(\"<OAuthCallback />\", e);\n await redirectToError(new URL(app.urls.error, window.location.href));\n }\n }), [app]);\n\n useEffect(() => {\n setTimeout(() => setShowRedirectLink(true), 3000);\n }, []);\n\n return (\n <MaybeFullPage\n fullPage={fullPage ?? false}\n containerClassName=\"flex items-center justify-center\"\n >\n <div\n className={cn(\n \"text-center justify-center items-center stack-scope flex flex-col gap-4 max-w-[380px]\",\n fullPage ? \"p-4\" : \"p-0\"\n )}\n >\n <div className=\"flex flex-col justify-center items-center gap-4\">\n <Spinner size={20} />\n </div>\n {showRedirectLink || redirectUrl != null ? <p>{t('If you are not redirected automatically, ')}<StyledLink
|
|
1
|
+
{"version":3,"file":"oauth-callback.js","names":["hexclaveAppInternalsSymbol","KnownError","MaybeFullPage","Spinner","StyledLink"],"sources":["../../src/components-page/oauth-callback.tsx"],"sourcesContent":["'use client';\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n\nimport { KnownError } from \"@hexclave/shared\";\nimport { captureError } from \"@hexclave/shared/dist/utils/errors\";\nimport { runAsynchronously } from \"@hexclave/shared/dist/utils/promises\";\nimport { Spinner, cn } from \"@hexclave/ui\";\nimport { useEffect, useRef, useState } from \"react\";\nimport { useStackApp } from \"..\";\nimport { MaybeFullPage } from \"../components/elements/maybe-full-page\";\nimport { StyledLink } from \"../components/link\";\nimport { hexclaveAppInternalsSymbol } from \"../lib/hexclave-app\";\nimport { useTranslation } from \"../lib/translations\";\n\nexport function OAuthCallback({ fullPage }: { fullPage?: boolean }) {\n const { t } = useTranslation();\n const app = useStackApp();\n const called = useRef(false);\n const [showRedirectLink, setShowRedirectLink] = useState(false);\n const [redirectUrl, setRedirectUrl] = useState<string | null>(null);\n\n useEffect(() => runAsynchronously(async () => {\n if (called.current) return;\n called.current = true;\n const redirectToError = async (url: URL) => {\n const urlString = url.toString();\n if (app[hexclaveAppInternalsSymbol].getRedirectMethod() === \"none\") {\n setRedirectUrl(urlString);\n return;\n }\n await app[hexclaveAppInternalsSymbol].redirectToUrl(urlString, { replace: true });\n };\n try {\n const hasRedirected = await app.callOAuthCallback();\n if (!hasRedirected) {\n await app.redirectToSignIn({ noRedirectBack: true });\n }\n } catch (e) {\n if (KnownError.isKnownError(e)) {\n const errorUrl = new URL(app.urls.error, window.location.href);\n errorUrl.searchParams.set(\"errorCode\", e.errorCode);\n errorUrl.searchParams.set(\"message\", e.message);\n errorUrl.searchParams.set(\"details\", JSON.stringify(e.details ?? {}));\n await redirectToError(errorUrl);\n return;\n }\n captureError(\"<OAuthCallback />\", e);\n await redirectToError(new URL(app.urls.error, window.location.href));\n }\n }), [app]);\n\n useEffect(() => {\n setTimeout(() => setShowRedirectLink(true), 3000);\n }, []);\n\n return (\n <MaybeFullPage\n fullPage={fullPage ?? false}\n containerClassName=\"flex items-center justify-center\"\n >\n <div\n className={cn(\n \"text-center justify-center items-center stack-scope flex flex-col gap-4 max-w-[380px]\",\n fullPage ? \"p-4\" : \"p-0\"\n )}\n >\n <div className=\"flex flex-col justify-center items-center gap-4\">\n <Spinner size={20} />\n </div>\n {showRedirectLink || redirectUrl != null ? <p>{t('If you are not redirected automatically, ')}<StyledLink\n className=\"whitespace-nowrap\"\n href={redirectUrl ?? \"#\"}\n onClick={(e) => {\n if (redirectUrl != null) return;\n e.preventDefault();\n runAsynchronously(app.redirectToHome());\n }}\n >{t(\"click here\")}</StyledLink></p> : null}\n </div>\n </MaybeFullPage>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAkBA,SAAgB,cAAc,EAAE,YAAoC;CAClE,MAAM,EAAE,kDAAsB;CAC9B,MAAM,oCAAmB;CACzB,MAAM,2BAAgB,MAAM;CAC5B,MAAM,CAAC,kBAAkB,2CAAgC,MAAM;CAC/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ACzB,OAAE,gBAAgB;AAClB,iEAAkB,IAAI,gBAAgB,CAAC;;cAEzC,EAAE,aAAa;KAAc,IAAI,GAAG;IAClC;GACQ"}
|
|
@@ -22,13 +22,12 @@ function TeamCreation(props) {
|
|
|
22
22
|
const project = app.useProject();
|
|
23
23
|
const user = (0, ___index_js.useUser)({ or: "redirect" });
|
|
24
24
|
const [loading, setLoading] = (0, react.useState)(false);
|
|
25
|
-
const navigate = app.useNavigate();
|
|
26
25
|
if (!project.config.clientTeamCreationEnabled) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(___index_js.MessageCard, { title: t("Team creation is not enabled") });
|
|
27
26
|
const onSubmit = async (data) => {
|
|
28
27
|
setLoading(true);
|
|
29
28
|
try {
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
await user.createTeam({ displayName: data.displayName });
|
|
30
|
+
await app.redirectToAccountSettings();
|
|
32
31
|
} finally {
|
|
33
32
|
setLoading(false);
|
|
34
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team-creation.js","names":["MessageCard","MaybeFullPage","Typography","Label","Input","FormWarningText","Button"],"sources":["../../src/components-page/team-creation.tsx"],"sourcesContent":["'use client';\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n\nimport { yupResolver } from \"@hookform/resolvers/yup\";\nimport { yupObject, yupString } from \"@hexclave/shared/dist/schema-fields\";\nimport { runAsynchronously } from \"@hexclave/shared/dist/utils/promises\";\nimport { Button, Input, Label, Typography } from \"@hexclave/ui\";\nimport { useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport * as yup from \"yup\";\nimport { MessageCard, useStackApp, useUser } from \"..\";\nimport { FormWarningText } from \"../components/elements/form-warning\";\nimport { MaybeFullPage } from \"../components/elements/maybe-full-page\";\nimport { useTranslation } from \"../lib/translations\";\n\nexport function TeamCreation(props: { fullPage?: boolean }) {\n const { t } = useTranslation();\n\n const schema = yupObject({\n displayName: yupString().defined().nonEmpty(t('Please enter a team name')),\n });\n\n const { register, handleSubmit, formState: { errors } } = useForm({\n resolver: yupResolver(schema)\n });\n const app = useStackApp();\n const project = app.useProject();\n const user = useUser({ or: 'redirect' });\n const [loading, setLoading] = useState(false);\n
|
|
1
|
+
{"version":3,"file":"team-creation.js","names":["MessageCard","MaybeFullPage","Typography","Label","Input","FormWarningText","Button"],"sources":["../../src/components-page/team-creation.tsx"],"sourcesContent":["'use client';\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n\nimport { yupResolver } from \"@hookform/resolvers/yup\";\nimport { yupObject, yupString } from \"@hexclave/shared/dist/schema-fields\";\nimport { runAsynchronously } from \"@hexclave/shared/dist/utils/promises\";\nimport { Button, Input, Label, Typography } from \"@hexclave/ui\";\nimport { useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport * as yup from \"yup\";\nimport { MessageCard, useStackApp, useUser } from \"..\";\nimport { FormWarningText } from \"../components/elements/form-warning\";\nimport { MaybeFullPage } from \"../components/elements/maybe-full-page\";\nimport { useTranslation } from \"../lib/translations\";\n\nexport function TeamCreation(props: { fullPage?: boolean }) {\n const { t } = useTranslation();\n\n const schema = yupObject({\n displayName: yupString().defined().nonEmpty(t('Please enter a team name')),\n });\n\n const { register, handleSubmit, formState: { errors } } = useForm({\n resolver: yupResolver(schema)\n });\n const app = useStackApp();\n const project = app.useProject();\n const user = useUser({ or: 'redirect' });\n const [loading, setLoading] = useState(false);\n\n if (!project.config.clientTeamCreationEnabled) {\n return <MessageCard title={t('Team creation is not enabled')} />;\n }\n\n const onSubmit = async (data: yup.InferType<typeof schema>) => {\n setLoading(true);\n\n try {\n await user.createTeam({ displayName: data.displayName });\n await app.redirectToAccountSettings();\n } finally {\n setLoading(false);\n }\n };\n\n return (\n <MaybeFullPage fullPage={!!props.fullPage}>\n <div className='stack-scope flex flex-col items-stretch' style={{ maxWidth: '380px', flexBasis: '380px', padding: props.fullPage ? '1rem' : 0 }}>\n <div className=\"text-center mb-6\">\n <Typography type='h2'>\n {t('Create a Team')}\n </Typography>\n </div>\n <form\n className=\"flex flex-col items-stretch stack-scope\"\n onSubmit={e => runAsynchronously(handleSubmit(onSubmit)(e))}\n noValidate\n >\n <Label htmlFor=\"display-name\" className=\"mb-1\">{t('Display name')}</Label>\n <Input\n id=\"display-name\"\n {...register('displayName')}\n />\n <FormWarningText text={errors.displayName?.message?.toString()} />\n\n <Button type=\"submit\" className=\"mt-6\" loading={loading}>\n {t('Create')}\n </Button>\n </form>\n </div>\n </MaybeFullPage>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAmBA,SAAgB,aAAa,OAA+B;CAC1D,MAAM,EAAE,kDAAsB;CAM9B,MAAM,EAAE,UAAU,cAAc,WAAW,EAAE,0CAAqB,EAChE,sGALuB,EACvB,iEAAwB,CAAC,SAAS,CAAC,SAAS,EAAE,2BAA2B,CAAC,EAC3E,CAAC,CAG6B,EAC9B,CAAC;CACF,MAAM,oCAAmB;CACzB,MAAM,UAAU,IAAI,YAAY;CAChC,MAAM,gCAAe,EAAE,IAAI,YAAY,CAAC;CACxC,MAAM,CAAC,SAAS,kCAAuB,MAAM;AAE7C,KAAI,CAAC,QAAQ,OAAO,0BAClB,QAAO,2CAACA,2BAAY,OAAO,EAAE,+BAA+B,GAAI;CAGlE,MAAM,WAAW,OAAO,SAAuC;AAC7D,aAAW,KAAK;AAEhB,MAAI;AACF,SAAM,KAAK,WAAW,EAAE,aAAa,KAAK,aAAa,CAAC;AACxD,SAAM,IAAI,2BAA2B;YAC7B;AACR,cAAW,MAAM;;;AAIrB,QACE,2CAACC;EAAc,UAAU,CAAC,CAAC,MAAM;YAC/B,4CAAC;GAAI,WAAU;GAA0C,OAAO;IAAE,UAAU;IAAS,WAAW;IAAS,SAAS,MAAM,WAAW,SAAS;IAAG;cAC7I,2CAAC;IAAI,WAAU;cACb,2CAACC;KAAW,MAAK;eACd,EAAE,gBAAgB;MACR;KACT,EACN,4CAAC;IACC,WAAU;IACV,WAAU,kEAAuB,aAAa,SAAS,CAAC,EAAE,CAAC;IAC3D;;KAEA,2CAACC;MAAM,SAAQ;MAAe,WAAU;gBAAQ,EAAE,eAAe;OAAS;KAC1E,2CAACC;MACC,IAAG;MACH,GAAI,SAAS,cAAc;OAC3B;KACF,2CAACC,0DAAgB,MAAM,OAAO,aAAa,SAAS,UAAU,GAAI;KAElE,2CAACC;MAAO,MAAK;MAAS,WAAU;MAAgB;gBAC7C,EAAE,SAAS;OACL;;KACJ;IACH;GACQ"}
|
|
@@ -4,7 +4,7 @@ import { ApiKey, ApiKeyCreationOptions, ApiKeyType } from "../lib/hexclave-app/a
|
|
|
4
4
|
//#region src/components/api-key-dialogs.d.ts
|
|
5
5
|
declare const neverInMs: number;
|
|
6
6
|
declare const expiresInOptions: {
|
|
7
|
-
readonly [x: number]: "
|
|
7
|
+
readonly [x: number]: "1 day" | "7 days" | "30 days" | "90 days" | "1 year" | "Never";
|
|
8
8
|
};
|
|
9
9
|
/**
|
|
10
10
|
* Dialog for creating a new API key
|
|
@@ -66,8 +66,12 @@ function CredentialSignIn() {
|
|
|
66
66
|
}),
|
|
67
67
|
/* @__PURE__ */ jsx(FormWarningText, { text: errors.password?.message?.toString() }),
|
|
68
68
|
/* @__PURE__ */ jsx(StyledLink, {
|
|
69
|
-
href:
|
|
69
|
+
href: "#",
|
|
70
70
|
className: "mt-1 text-sm",
|
|
71
|
+
onClick: (e) => {
|
|
72
|
+
e.preventDefault();
|
|
73
|
+
runAsynchronouslyWithAlert(app.redirectToForgotPassword());
|
|
74
|
+
},
|
|
71
75
|
children: t("Forgot password?")
|
|
72
76
|
}),
|
|
73
77
|
/* @__PURE__ */ jsx(Button, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-sign-in.js","names":[],"sources":["../../../src/components/credential-sign-in.tsx"],"sourcesContent":["'use client';\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n\nimport { yupResolver } from \"@hookform/resolvers/yup\";\nimport { passwordSchema, strictEmailSchema, yupObject } from \"@hexclave/shared/dist/schema-fields\";\nimport { runAsynchronouslyWithAlert } from \"@hexclave/shared/dist/utils/promises\";\nimport { Button, Input, Label, PasswordInput } from \"@hexclave/ui\";\nimport { useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport * as yup from \"yup\";\nimport { useStackApp } from \"..\";\nimport { useTranslation } from \"../lib/translations\";\nimport { FormWarningText } from \"./elements/form-warning\";\nimport { StyledLink } from \"./link\";\n\nexport function CredentialSignIn() {\n const { t } = useTranslation();\n\n const schema = yupObject({\n email: strictEmailSchema(t('Please enter a valid email')).defined().nonEmpty(t('Please enter your email')),\n password: passwordSchema.defined().nonEmpty(t('Please enter your password'))\n });\n\n const { register, handleSubmit, setError, formState: { errors } } = useForm({\n resolver: yupResolver(schema)\n });\n const app = useStackApp();\n const [loading, setLoading] = useState(false);\n\n const onSubmit = async (data: yup.InferType<typeof schema>) => {\n setLoading(true);\n\n try {\n const { email, password } = data;\n const result = await app.signInWithCredential({\n email,\n password,\n });\n if (result.status === 'error') {\n setError('email', { type: 'manual', message: result.error.message });\n }\n } finally {\n setLoading(false);\n }\n };\n\n return (\n <form\n className=\"flex flex-col items-stretch stack-scope\"\n onSubmit={e => runAsynchronouslyWithAlert(handleSubmit(onSubmit)(e))}\n noValidate\n >\n <Label htmlFor=\"email\" className=\"mb-1\">{t('Email')}</Label>\n <Input\n id=\"email\"\n type=\"email\"\n autoComplete=\"email\"\n {...register('email')}\n />\n <FormWarningText text={errors.email?.message?.toString()} />\n\n <Label htmlFor=\"password\" className=\"mt-4 mb-1\">{t('Password')}</Label>\n <PasswordInput\n id=\"password\"\n autoComplete=\"current-password\"\n {...register('password')}\n />\n <FormWarningText text={errors.password?.message?.toString()} />\n\n <StyledLink
|
|
1
|
+
{"version":3,"file":"credential-sign-in.js","names":[],"sources":["../../../src/components/credential-sign-in.tsx"],"sourcesContent":["'use client';\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n\nimport { yupResolver } from \"@hookform/resolvers/yup\";\nimport { passwordSchema, strictEmailSchema, yupObject } from \"@hexclave/shared/dist/schema-fields\";\nimport { runAsynchronouslyWithAlert } from \"@hexclave/shared/dist/utils/promises\";\nimport { Button, Input, Label, PasswordInput } from \"@hexclave/ui\";\nimport { useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport * as yup from \"yup\";\nimport { useStackApp } from \"..\";\nimport { useTranslation } from \"../lib/translations\";\nimport { FormWarningText } from \"./elements/form-warning\";\nimport { StyledLink } from \"./link\";\n\nexport function CredentialSignIn() {\n const { t } = useTranslation();\n\n const schema = yupObject({\n email: strictEmailSchema(t('Please enter a valid email')).defined().nonEmpty(t('Please enter your email')),\n password: passwordSchema.defined().nonEmpty(t('Please enter your password'))\n });\n\n const { register, handleSubmit, setError, formState: { errors } } = useForm({\n resolver: yupResolver(schema)\n });\n const app = useStackApp();\n const [loading, setLoading] = useState(false);\n\n const onSubmit = async (data: yup.InferType<typeof schema>) => {\n setLoading(true);\n\n try {\n const { email, password } = data;\n const result = await app.signInWithCredential({\n email,\n password,\n });\n if (result.status === 'error') {\n setError('email', { type: 'manual', message: result.error.message });\n }\n } finally {\n setLoading(false);\n }\n };\n\n return (\n <form\n className=\"flex flex-col items-stretch stack-scope\"\n onSubmit={e => runAsynchronouslyWithAlert(handleSubmit(onSubmit)(e))}\n noValidate\n >\n <Label htmlFor=\"email\" className=\"mb-1\">{t('Email')}</Label>\n <Input\n id=\"email\"\n type=\"email\"\n autoComplete=\"email\"\n {...register('email')}\n />\n <FormWarningText text={errors.email?.message?.toString()} />\n\n <Label htmlFor=\"password\" className=\"mt-4 mb-1\">{t('Password')}</Label>\n <PasswordInput\n id=\"password\"\n autoComplete=\"current-password\"\n {...register('password')}\n />\n <FormWarningText text={errors.password?.message?.toString()} />\n\n <StyledLink\n href=\"#\"\n className=\"mt-1 text-sm\"\n onClick={(e) => {\n e.preventDefault();\n runAsynchronouslyWithAlert(app.redirectToForgotPassword());\n }}\n >\n {t('Forgot password?')}\n </StyledLink>\n\n <Button type=\"submit\" className=\"mt-6\" loading={loading}>\n {t('Sign In')}\n </Button>\n </form>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAmBA,SAAgB,mBAAmB;CACjC,MAAM,EAAE,MAAM,gBAAgB;CAO9B,MAAM,EAAE,UAAU,cAAc,UAAU,WAAW,EAAE,aAAa,QAAQ,EAC1E,UAAU,YANG,UAAU;EACvB,OAAO,kBAAkB,EAAE,6BAA6B,CAAC,CAAC,SAAS,CAAC,SAAS,EAAE,0BAA0B,CAAC;EAC1G,UAAU,eAAe,SAAS,CAAC,SAAS,EAAE,6BAA6B,CAAC;EAC7E,CAAC,CAG6B,EAC9B,CAAC;CACF,MAAM,MAAM,aAAa;CACzB,MAAM,CAAC,SAAS,cAAc,SAAS,MAAM;CAE7C,MAAM,WAAW,OAAO,SAAuC;AAC7D,aAAW,KAAK;AAEhB,MAAI;GACF,MAAM,EAAE,OAAO,aAAa;GAC5B,MAAM,SAAS,MAAM,IAAI,qBAAqB;IAC5C;IACA;IACD,CAAC;AACF,OAAI,OAAO,WAAW,QACpB,UAAS,SAAS;IAAE,MAAM;IAAU,SAAS,OAAO,MAAM;IAAS,CAAC;YAE9D;AACR,cAAW,MAAM;;;AAIrB,QACE,qBAAC;EACC,WAAU;EACV,WAAU,MAAK,2BAA2B,aAAa,SAAS,CAAC,EAAE,CAAC;EACpE;;GAEA,oBAAC;IAAM,SAAQ;IAAQ,WAAU;cAAQ,EAAE,QAAQ;KAAS;GAC5D,oBAAC;IACC,IAAG;IACH,MAAK;IACL,cAAa;IACb,GAAI,SAAS,QAAQ;KACrB;GACF,oBAAC,mBAAgB,MAAM,OAAO,OAAO,SAAS,UAAU,GAAI;GAE5D,oBAAC;IAAM,SAAQ;IAAW,WAAU;cAAa,EAAE,WAAW;KAAS;GACvE,oBAAC;IACC,IAAG;IACH,cAAa;IACb,GAAI,SAAS,WAAW;KACxB;GACF,oBAAC,mBAAgB,MAAM,OAAO,UAAU,SAAS,UAAU,GAAI;GAE/D,oBAAC;IACC,MAAK;IACL,WAAU;IACV,UAAU,MAAM;AACd,OAAE,gBAAgB;AAClB,gCAA2B,IAAI,0BAA0B,CAAC;;cAG3D,EAAE,mBAAmB;KACX;GAEb,oBAAC;IAAO,MAAK;IAAS,WAAU;IAAgB;cAC7C,EAAE,UAAU;KACN;;GACJ"}
|
|
@@ -4,8 +4,8 @@ import { Button, Typography, cn } from "@hexclave/ui";
|
|
|
4
4
|
import React from "react";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { XIcon } from "lucide-react";
|
|
7
|
-
import { useHash } from "@hexclave/shared/dist/hooks/use-hash";
|
|
8
7
|
import { useStackApp } from "../../index.js";
|
|
8
|
+
import { useHash } from "@hexclave/shared/dist/hooks/use-hash";
|
|
9
9
|
|
|
10
10
|
//#region src/components/elements/sidebar-layout.tsx
|
|
11
11
|
function SidebarLayout(props) {
|
|
@@ -26,15 +26,13 @@ function Inner(props) {
|
|
|
26
26
|
const userFromHook = useUser();
|
|
27
27
|
const app = props.mockUser ? {
|
|
28
28
|
useProject: () => props.mockProject || { config: { clientTeamCreationEnabled: false } },
|
|
29
|
-
|
|
30
|
-
urls: { accountSettings: "/account-settings" }
|
|
29
|
+
redirectToAccountSettings: async () => {}
|
|
31
30
|
} : appFromHook;
|
|
32
31
|
const user = props.mockUser ? {
|
|
33
32
|
selectedTeam: props.mockUser.team,
|
|
34
33
|
useTeams: () => props.mockTeams || [],
|
|
35
34
|
setSelectedTeam: async () => {}
|
|
36
35
|
} : userFromHook;
|
|
37
|
-
const navigate = app.useNavigate();
|
|
38
36
|
const project = app.useProject();
|
|
39
37
|
const rawTeams = props.teams ?? user?.useTeams();
|
|
40
38
|
const selectedTeam = props.team || rawTeams?.find((team) => team.id === props.teamId);
|
|
@@ -64,7 +62,7 @@ function Inner(props) {
|
|
|
64
62
|
size: "icon",
|
|
65
63
|
className: "h-6 w-6",
|
|
66
64
|
onClick: () => {
|
|
67
|
-
if (!props.mockUser)
|
|
65
|
+
if (!props.mockUser) runAsynchronouslyWithAlert(app.redirectToAccountSettings());
|
|
68
66
|
},
|
|
69
67
|
children: /* @__PURE__ */ jsx(Settings, { className: "h-4 w-4" })
|
|
70
68
|
})]
|
|
@@ -101,7 +99,7 @@ function Inner(props) {
|
|
|
101
99
|
!teams?.length && !props.allowNull ? /* @__PURE__ */ jsx(SelectGroup, { children: /* @__PURE__ */ jsx(SelectLabel, { children: t("No teams yet") }) }) : null,
|
|
102
100
|
project.config.clientTeamCreationEnabled && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(SelectSeparator, {}), /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(Button, {
|
|
103
101
|
onClick: () => {
|
|
104
|
-
if (!props.mockUser)
|
|
102
|
+
if (!props.mockUser) runAsynchronouslyWithAlert(app.redirectToAccountSettings());
|
|
105
103
|
},
|
|
106
104
|
className: "w-full",
|
|
107
105
|
variant: "ghost",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"team-switcher.js","names":[],"sources":["../../../src/components/team-switcher.tsx"],"sourcesContent":["'use client';\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { HexclaveAssertionError } from \"@hexclave/shared/dist/utils/errors\";\nimport { runAsynchronouslyWithAlert } from \"@hexclave/shared/dist/utils/promises\";\nimport {\n Button,\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n Skeleton,\n Typography,\n cn,\n} from \"@hexclave/ui\";\nimport { PlusCircle, Settings } from \"lucide-react\";\nimport { Suspense, useMemo } from \"react\";\nimport { Team, useStackApp, useUser } from \"..\";\nimport { useTranslation } from \"../lib/translations\";\nimport { TeamIcon } from \"./team-icon\";\n\ntype MockTeam = {\n id: string,\n displayName: string,\n profileImageUrl?: string | null,\n};\n\ntype TeamSwitcherProps<AllowNull extends boolean = false> = {\n team?: Team,\n teamId?: string,\n teams?: Team[],\n allowNull?: AllowNull,\n nullLabel?: string,\n triggerClassName?: string,\n onChange?: (team: AllowNull extends true ? Team | null : Team) => Promise<void>,\n // Mock data props\n mockUser?: {\n team?: MockTeam,\n },\n mockTeams?: MockTeam[],\n mockProject?: {\n config: {\n clientTeamCreationEnabled: boolean,\n },\n },\n};\n\nexport function TeamSwitcher<AllowNull extends boolean = false>(props: TeamSwitcherProps<AllowNull>) {\n return <Suspense fallback={<Fallback />}>\n <Inner {...props} />\n </Suspense>;\n}\n\nfunction Fallback() {\n return <Skeleton className=\"h-9 w-full max-w-64 stack-scope\" />;\n}\n\nfunction Inner<AllowNull extends boolean>(props: TeamSwitcherProps<AllowNull>) {\n const { t } = useTranslation();\n const appFromHook = useStackApp();\n const userFromHook = useUser();\n\n // Use mock data if provided, otherwise use real data\n const app = props.mockUser ? {\n useProject: () => props.mockProject || { config: { clientTeamCreationEnabled: false } },\n
|
|
1
|
+
{"version":3,"file":"team-switcher.js","names":[],"sources":["../../../src/components/team-switcher.tsx"],"sourcesContent":["'use client';\n\n\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { HexclaveAssertionError } from \"@hexclave/shared/dist/utils/errors\";\nimport { runAsynchronouslyWithAlert } from \"@hexclave/shared/dist/utils/promises\";\nimport {\n Button,\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n Skeleton,\n Typography,\n cn,\n} from \"@hexclave/ui\";\nimport { PlusCircle, Settings } from \"lucide-react\";\nimport { Suspense, useMemo } from \"react\";\nimport { Team, useStackApp, useUser } from \"..\";\nimport { useTranslation } from \"../lib/translations\";\nimport { TeamIcon } from \"./team-icon\";\n\ntype MockTeam = {\n id: string,\n displayName: string,\n profileImageUrl?: string | null,\n};\n\ntype TeamSwitcherProps<AllowNull extends boolean = false> = {\n team?: Team,\n teamId?: string,\n teams?: Team[],\n allowNull?: AllowNull,\n nullLabel?: string,\n triggerClassName?: string,\n onChange?: (team: AllowNull extends true ? Team | null : Team) => Promise<void>,\n // Mock data props\n mockUser?: {\n team?: MockTeam,\n },\n mockTeams?: MockTeam[],\n mockProject?: {\n config: {\n clientTeamCreationEnabled: boolean,\n },\n },\n};\n\nexport function TeamSwitcher<AllowNull extends boolean = false>(props: TeamSwitcherProps<AllowNull>) {\n return <Suspense fallback={<Fallback />}>\n <Inner {...props} />\n </Suspense>;\n}\n\nfunction Fallback() {\n return <Skeleton className=\"h-9 w-full max-w-64 stack-scope\" />;\n}\n\nfunction Inner<AllowNull extends boolean>(props: TeamSwitcherProps<AllowNull>) {\n const { t } = useTranslation();\n const appFromHook = useStackApp();\n const userFromHook = useUser();\n\n // Use mock data if provided, otherwise use real data\n const app = props.mockUser ? {\n useProject: () => props.mockProject || { config: { clientTeamCreationEnabled: false } },\n redirectToAccountSettings: async () => {},\n } : appFromHook;\n\n const user = props.mockUser ? {\n selectedTeam: props.mockUser.team,\n useTeams: () => props.mockTeams || [],\n setSelectedTeam: async () => {}, // Mock function\n } : userFromHook;\n\n const project = app.useProject();\n const rawTeams = props.teams ?? user?.useTeams();\n const selectedTeam = props.team || rawTeams?.find(team => team.id === props.teamId);\n const teams = useMemo(() => rawTeams?.sort((a, b) => b.id === selectedTeam?.id ? 1 : -1), [rawTeams, selectedTeam]);\n\n\n return (\n <Select\n value={selectedTeam?.id || (props.allowNull ? 'null-sentinel' : undefined)}\n onValueChange={(value) => {\n runAsynchronouslyWithAlert(async () => {\n let team: MockTeam | null = null;\n if (value !== 'null-sentinel') {\n team = teams?.find(team => team.id === value) || null;\n if (!team) {\n throw new HexclaveAssertionError('Team not found, this should not happen');\n }\n } else {\n team = null;\n }\n\n // Call onChange callback if provided\n if (props.onChange) {\n await props.onChange(team as Team);\n }\n });\n }}\n >\n <SelectTrigger className={cn(\"stack-scope max-w-64\", props.triggerClassName)}>\n <SelectValue placeholder=\"Select team\"/>\n </SelectTrigger>\n <SelectContent className=\"stack-scope\">\n {selectedTeam ? <SelectGroup>\n <SelectLabel>\n <div className=\"flex items-center justify-between\">\n <span>\n {t('Current team')}\n </span>\n <Button\n variant='ghost'\n size='icon'\n className=\"h-6 w-6\"\n onClick={() => {\n if (!props.mockUser) {\n runAsynchronouslyWithAlert(app.redirectToAccountSettings());\n }\n }}\n >\n <Settings className=\"h-4 w-4\"/>\n </Button>\n </div>\n </SelectLabel>\n <SelectItem value={selectedTeam.id}>\n <div className=\"flex items-center gap-2\">\n <TeamIcon team={selectedTeam as Team} />\n <Typography className=\"max-w-40 truncate\">{selectedTeam.displayName}</Typography>\n </div>\n </SelectItem>\n </SelectGroup> : undefined}\n\n {props.allowNull && <SelectGroup>\n <SelectItem value=\"null-sentinel\">\n <div className=\"flex items-center gap-2\">\n <TeamIcon team='personal' />\n <Typography className=\"max-w-40 truncate\">{props.nullLabel || t('No team')}</Typography>\n </div>\n </SelectItem>\n </SelectGroup>}\n\n {teams?.length ?\n <SelectGroup>\n <SelectLabel>{t('Other teams')}</SelectLabel>\n {teams.filter(team => team.id !== selectedTeam?.id)\n .map(team => (\n <SelectItem value={team.id} key={team.id}>\n <div className=\"flex items-center gap-2\">\n <TeamIcon team={team as Team} />\n <Typography className=\"max-w-64 truncate\">{team.displayName}</Typography>\n </div>\n </SelectItem>\n ))}\n </SelectGroup> : null}\n\n {!teams?.length && !props.allowNull ?\n <SelectGroup>\n <SelectLabel>{t('No teams yet')}</SelectLabel>\n </SelectGroup> : null}\n\n {project.config.clientTeamCreationEnabled && <>\n <SelectSeparator/>\n <div>\n <Button\n onClick={() => {\n if (!props.mockUser) {\n runAsynchronouslyWithAlert(app.redirectToAccountSettings());\n }\n }}\n className=\"w-full\"\n variant='ghost'\n >\n <PlusCircle className=\"mr-2 h-4 w-4\"/> {t('Create a team')}\n </Button>\n </div>\n </>}\n </SelectContent>\n </Select>\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAsDA,SAAgB,aAAgD,OAAqC;AACnG,QAAO,oBAAC;EAAS,UAAU,oBAAC,aAAW;YACrC,oBAAC,SAAM,GAAI,QAAS;GACX;;AAGb,SAAS,WAAW;AAClB,QAAO,oBAAC,YAAS,WAAU,oCAAoC;;AAGjE,SAAS,MAAiC,OAAqC;CAC7E,MAAM,EAAE,MAAM,gBAAgB;CAC9B,MAAM,cAAc,aAAa;CACjC,MAAM,eAAe,SAAS;CAG9B,MAAM,MAAM,MAAM,WAAW;EAC3B,kBAAkB,MAAM,eAAe,EAAE,QAAQ,EAAE,2BAA2B,OAAO,EAAE;EACvF,2BAA2B,YAAY;EACxC,GAAG;CAEJ,MAAM,OAAO,MAAM,WAAW;EAC5B,cAAc,MAAM,SAAS;EAC7B,gBAAgB,MAAM,aAAa,EAAE;EACrC,iBAAiB,YAAY;EAC9B,GAAG;CAEJ,MAAM,UAAU,IAAI,YAAY;CAChC,MAAM,WAAW,MAAM,SAAS,MAAM,UAAU;CAChD,MAAM,eAAe,MAAM,QAAQ,UAAU,MAAK,SAAQ,KAAK,OAAO,MAAM,OAAO;CACnF,MAAM,QAAQ,cAAc,UAAU,MAAM,GAAG,MAAM,EAAE,OAAO,cAAc,KAAK,IAAI,GAAG,EAAE,CAAC,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tB,qBAAC;MAAI,WAAU;iBACb,oBAAC,YAAe,OAAgB,EAChC,oBAAC;OAAW,WAAU;iBAAqB,KAAK;QAAyB;OACrE;OAJyB,KAAK,GAKzB,CACb,IACQ,GAAG;IAElB,CAAC,OAAO,UAAU,CAAC,MAAM,YACxB,oBAAC,yBACC,oBAAC,yBAAa,EAAE,eAAe,GAAe,GAClC,GAAG;IAElB,QAAQ,OAAO,6BAA6B,4CAC3C,oBAAC,oBAAiB,EAClB,oBAAC,mBACC,qBAAC;KACC,eAAe;AACb,UAAI,CAAC,MAAM,SACT,4BAA2B,IAAI,2BAA2B,CAAC;;KAG/D,WAAU;KACV,SAAQ;;MAER,oBAAC,cAAW,WAAU,iBAAgB;;MAAE,EAAE,gBAAgB;;MACnD,GACL,IACL;;IACW;GACT"}
|
|
@@ -132,7 +132,7 @@ function Inner(props) {
|
|
|
132
132
|
t("Don't have an account?"),
|
|
133
133
|
" ",
|
|
134
134
|
/* @__PURE__ */ jsx(StyledLink, {
|
|
135
|
-
href:
|
|
135
|
+
href: "#",
|
|
136
136
|
onClick: (e) => {
|
|
137
137
|
runAsynchronously(hexclaveApp.redirectToSignUp());
|
|
138
138
|
e.preventDefault();
|
|
@@ -143,7 +143,7 @@ function Inner(props) {
|
|
|
143
143
|
t("Already have an account?"),
|
|
144
144
|
" ",
|
|
145
145
|
/* @__PURE__ */ jsx(StyledLink, {
|
|
146
|
-
href:
|
|
146
|
+
href: "#",
|
|
147
147
|
onClick: (e) => {
|
|
148
148
|
runAsynchronously(hexclaveApp.redirectToSignIn());
|
|
149
149
|
e.preventDefault();
|