@hexclave/tanstack-start 1.0.14 → 1.0.16
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/clickmap/clickmap-core.d.ts +15 -0
- package/dist/clickmap/clickmap-core.d.ts.map +1 -0
- package/dist/clickmap/clickmap-core.js +1527 -0
- package/dist/clickmap/clickmap-core.js.map +1 -0
- package/dist/clickmap/clickmap-styles.d.ts +5 -0
- package/dist/clickmap/clickmap-styles.d.ts.map +1 -0
- package/dist/clickmap/clickmap-styles.js +1095 -0
- package/dist/clickmap/clickmap-styles.js.map +1 -0
- package/dist/clickmap/index.d.ts +16 -0
- package/dist/clickmap/index.d.ts.map +1 -0
- package/dist/clickmap/index.js +74 -0
- package/dist/clickmap/index.js.map +1 -0
- package/dist/components/api-key-dialogs.d.ts +1 -1
- package/dist/components/api-key-dialogs.js +2 -2
- package/dist/components/credential-sign-in.js +1 -1
- package/dist/components/credential-sign-up.js +1 -1
- package/dist/components/magic-link-sign-in.js +1 -1
- package/dist/components/message-cards/known-error-message-card.d.ts +1 -1
- package/dist/components/team-switcher.js +1 -1
- package/dist/components-page/account-settings/active-sessions/active-sessions-page.js +1 -1
- package/dist/components-page/account-settings/email-and-auth/emails-section.js +2 -2
- package/dist/components-page/account-settings/email-and-auth/mfa-section.js +2 -2
- package/dist/components-page/account-settings/email-and-auth/passkey-section.js +1 -1
- package/dist/components-page/account-settings/email-and-auth/password-section.js +3 -3
- package/dist/components-page/account-settings/payments/payments-panel.js +1 -1
- package/dist/components-page/account-settings/teams/team-creation-page.js +2 -2
- package/dist/components-page/account-settings/teams/team-member-invitation-section.js +2 -2
- package/dist/components-page/auth-page.js +1 -1
- package/dist/components-page/cli-auth-confirm.js +1 -1
- package/dist/components-page/cli-auth-confirm.test.js +1 -1
- package/dist/components-page/forgot-password.d.ts.map +1 -1
- package/dist/components-page/forgot-password.js +2 -3
- package/dist/components-page/forgot-password.js.map +1 -1
- package/dist/components-page/hexclave-handler-client.d.ts +1 -1
- package/dist/components-page/mfa.js +4 -19
- package/dist/components-page/mfa.js.map +1 -1
- package/dist/components-page/oauth-callback.js +1 -1
- package/dist/components-page/onboarding.js +1 -1
- package/dist/components-page/password-reset.d.ts.map +1 -1
- package/dist/components-page/password-reset.js +5 -7
- package/dist/components-page/password-reset.js.map +1 -1
- package/dist/components-page/team-creation.js +1 -1
- package/dist/dev-tool/dev-tool-core.d.ts.map +1 -1
- package/dist/dev-tool/dev-tool-core.js +258 -262
- package/dist/dev-tool/dev-tool-core.js.map +1 -1
- package/dist/dev-tool/dev-tool-styles.d.ts +1 -1
- package/dist/dev-tool/dev-tool-styles.d.ts.map +1 -1
- package/dist/dev-tool/dev-tool-styles.js +13 -143
- package/dist/dev-tool/dev-tool-styles.js.map +1 -1
- package/dist/dev-tool/index.d.ts.map +1 -1
- package/dist/dev-tool/index.js +5 -12
- package/dist/dev-tool/index.js.map +1 -1
- package/dist/esm/clickmap/clickmap-core.d.ts +15 -0
- package/dist/esm/clickmap/clickmap-core.d.ts.map +1 -0
- package/dist/esm/clickmap/clickmap-core.js +1525 -0
- package/dist/esm/clickmap/clickmap-core.js.map +1 -0
- package/dist/esm/clickmap/clickmap-styles.d.ts +5 -0
- package/dist/esm/clickmap/clickmap-styles.d.ts.map +1 -0
- package/dist/esm/clickmap/clickmap-styles.js +1093 -0
- package/dist/esm/clickmap/clickmap-styles.js.map +1 -0
- package/dist/esm/clickmap/index.d.ts +16 -0
- package/dist/esm/clickmap/index.d.ts.map +1 -0
- package/dist/esm/clickmap/index.js +72 -0
- package/dist/esm/clickmap/index.js.map +1 -0
- package/dist/esm/components/api-key-dialogs.d.ts +1 -1
- package/dist/esm/components/api-key-dialogs.js +2 -2
- package/dist/esm/components/credential-sign-in.js +1 -1
- package/dist/esm/components/credential-sign-up.js +1 -1
- package/dist/esm/components/magic-link-sign-in.js +1 -1
- package/dist/esm/components/team-switcher.js +1 -1
- package/dist/esm/components-page/account-settings/active-sessions/active-sessions-page.js +1 -1
- package/dist/esm/components-page/account-settings/email-and-auth/emails-section.js +2 -2
- package/dist/esm/components-page/account-settings/email-and-auth/mfa-section.js +2 -2
- package/dist/esm/components-page/account-settings/email-and-auth/passkey-section.js +1 -1
- package/dist/esm/components-page/account-settings/email-and-auth/password-section.js +3 -3
- package/dist/esm/components-page/account-settings/payments/payments-panel.js +1 -1
- package/dist/esm/components-page/account-settings/teams/team-creation-page.js +2 -2
- package/dist/esm/components-page/account-settings/teams/team-member-invitation-section.js +2 -2
- package/dist/esm/components-page/auth-page.js +1 -1
- package/dist/esm/components-page/cli-auth-confirm.js +1 -1
- package/dist/esm/components-page/cli-auth-confirm.test.js +1 -1
- package/dist/esm/components-page/forgot-password.d.ts.map +1 -1
- package/dist/esm/components-page/forgot-password.js +2 -3
- package/dist/esm/components-page/forgot-password.js.map +1 -1
- package/dist/esm/components-page/hexclave-handler-client.d.ts +1 -1
- package/dist/esm/components-page/mfa.js +4 -19
- package/dist/esm/components-page/mfa.js.map +1 -1
- package/dist/esm/components-page/oauth-callback.js +1 -1
- package/dist/esm/components-page/onboarding.js +1 -1
- package/dist/esm/components-page/password-reset.d.ts.map +1 -1
- package/dist/esm/components-page/password-reset.js +5 -7
- package/dist/esm/components-page/password-reset.js.map +1 -1
- package/dist/esm/components-page/team-creation.js +1 -1
- package/dist/esm/dev-tool/dev-tool-core.d.ts.map +1 -1
- package/dist/esm/dev-tool/dev-tool-core.js +35 -39
- package/dist/esm/dev-tool/dev-tool-core.js.map +1 -1
- package/dist/esm/dev-tool/dev-tool-styles.d.ts +1 -1
- package/dist/esm/dev-tool/dev-tool-styles.d.ts.map +1 -1
- package/dist/esm/dev-tool/dev-tool-styles.js +13 -143
- package/dist/esm/dev-tool/dev-tool-styles.js.map +1 -1
- package/dist/esm/dev-tool/index.d.ts.map +1 -1
- package/dist/esm/dev-tool/index.js +2 -9
- package/dist/esm/dev-tool/index.js.map +1 -1
- package/dist/esm/generated/global-css.d.ts +1 -1
- package/dist/esm/generated/global-css.js +1 -1
- package/dist/esm/generated/global-css.js.map +1 -1
- package/dist/esm/generated/quetzal-translations.d.ts +2 -2
- package/dist/esm/in-page-ui/base-styles.d.ts +5 -0
- package/dist/esm/in-page-ui/base-styles.d.ts.map +1 -0
- package/dist/esm/in-page-ui/base-styles.js +166 -0
- package/dist/esm/in-page-ui/base-styles.js.map +1 -0
- package/dist/esm/in-page-ui/dom.d.ts +15 -0
- package/dist/esm/in-page-ui/dom.d.ts.map +1 -0
- package/dist/esm/in-page-ui/dom.js +44 -0
- package/dist/esm/in-page-ui/dom.js.map +1 -0
- package/dist/esm/lib/auth.js +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts +5 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.js +20 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.js.map +1 -1
- 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 +4 -2
- 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 +2 -2
- package/dist/esm/lib/hexclave-app/apps/implementations/event-tracker.d.ts +13 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/event-tracker.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/event-tracker.js +146 -14
- package/dist/esm/lib/hexclave-app/apps/implementations/event-tracker.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/event-tracker.test.js +221 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/event-tracker.test.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/server-app-impl.js +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/session-replay.js +1 -1
- package/dist/esm/lib/hexclave-app/apps/interfaces/admin-app.d.ts +5 -0
- package/dist/esm/lib/hexclave-app/apps/interfaces/admin-app.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/interfaces/admin-app.js.map +1 -1
- package/dist/esm/providers/theme-provider.js +1 -1
- package/dist/generated/global-css.d.ts +1 -1
- package/dist/generated/global-css.js +1 -1
- package/dist/generated/global-css.js.map +1 -1
- package/dist/generated/quetzal-translations.d.ts +2 -2
- package/dist/in-page-ui/base-styles.d.ts +5 -0
- package/dist/in-page-ui/base-styles.d.ts.map +1 -0
- package/dist/in-page-ui/base-styles.js +168 -0
- package/dist/in-page-ui/base-styles.js.map +1 -0
- package/dist/in-page-ui/dom.d.ts +15 -0
- package/dist/in-page-ui/dom.d.ts.map +1 -0
- package/dist/in-page-ui/dom.js +51 -0
- package/dist/in-page-ui/dom.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/integrations/convex/component/convex.config.d.ts +1 -1
- package/dist/lib/auth.js +1 -1
- package/dist/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts +5 -1
- package/dist/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/admin-app-impl.js +20 -0
- package/dist/lib/hexclave-app/apps/implementations/admin-app-impl.js.map +1 -1
- 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 +4 -2
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.js.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/common.js +2 -2
- package/dist/lib/hexclave-app/apps/implementations/event-tracker.d.ts +13 -0
- package/dist/lib/hexclave-app/apps/implementations/event-tracker.d.ts.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/event-tracker.js +146 -14
- package/dist/lib/hexclave-app/apps/implementations/event-tracker.js.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/event-tracker.test.js +221 -0
- package/dist/lib/hexclave-app/apps/implementations/event-tracker.test.js.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/server-app-impl.js +1 -1
- package/dist/lib/hexclave-app/apps/implementations/session-replay.js +1 -1
- package/dist/lib/hexclave-app/apps/interfaces/admin-app.d.ts +5 -0
- package/dist/lib/hexclave-app/apps/interfaces/admin-app.d.ts.map +1 -1
- package/dist/lib/hexclave-app/apps/interfaces/admin-app.js.map +1 -1
- package/dist/lib/hexclave-app/apps/interfaces/server-app.d.ts +1 -1
- package/dist/lib/hexclave-app/common.d.ts +1 -1
- package/dist/providers/hexclave-provider-client.d.ts +1 -1
- package/dist/providers/theme-provider.js +1 -1
- package/dist/{storage-CKzvsBxG.d.ts → storage-ksajV_p6.d.ts} +1 -1
- package/dist/{storage-CKzvsBxG.d.ts.map → storage-ksajV_p6.d.ts.map} +1 -1
- package/package.json +3 -3
- package/src/clickmap/clickmap-core.ts +1997 -0
- package/src/clickmap/clickmap-styles.ts +1102 -0
- package/src/clickmap/index.ts +95 -0
- package/src/components-page/forgot-password.tsx +1 -2
- package/src/components-page/mfa.tsx +12 -21
- package/src/components-page/password-reset.tsx +4 -6
- package/src/dev-tool/dev-tool-core.ts +38 -65
- package/src/dev-tool/dev-tool-styles.ts +13 -142
- package/src/dev-tool/index.ts +1 -14
- package/src/in-page-ui/base-styles.ts +171 -0
- package/src/in-page-ui/dom.ts +80 -0
- package/src/lib/hexclave-app/apps/implementations/admin-app-impl.ts +23 -1
- package/src/lib/hexclave-app/apps/implementations/client-app-impl.ts +7 -0
- package/src/lib/hexclave-app/apps/implementations/event-tracker.test.ts +287 -0
- package/src/lib/hexclave-app/apps/implementations/event-tracker.ts +226 -16
- package/src/lib/hexclave-app/apps/interfaces/admin-app.ts +3 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { runAsynchronouslyWithAlert } from "@hexclave/shared/dist/utils/promises";
|
|
3
4
|
import { yupResolver } from "@hookform/resolvers/yup";
|
|
4
5
|
import { passwordSchema, yupObject, yupString } from "@hexclave/shared/dist/schema-fields";
|
|
5
|
-
import { runAsynchronouslyWithAlert } from "@hexclave/shared/dist/utils/promises";
|
|
6
6
|
import { Button, Label, PasswordInput, Typography, cn } from "@hexclave/ui";
|
|
7
7
|
import { useState } from "react";
|
|
8
8
|
import { useForm } from "react-hook-form";
|
|
@@ -85,11 +85,10 @@ function PasswordResetForm(props) {
|
|
|
85
85
|
/* @__PURE__ */ jsx(PasswordInput, {
|
|
86
86
|
id: "password",
|
|
87
87
|
autoComplete: "new-password",
|
|
88
|
-
...register("password")
|
|
89
|
-
onChange: () => {
|
|
88
|
+
...register("password", { onChange: () => {
|
|
90
89
|
clearErrors("password");
|
|
91
90
|
clearErrors("passwordRepeat");
|
|
92
|
-
}
|
|
91
|
+
} })
|
|
93
92
|
}),
|
|
94
93
|
/* @__PURE__ */ jsx(FormWarningText, { text: errors.password?.message?.toString() }),
|
|
95
94
|
/* @__PURE__ */ jsx(Label, {
|
|
@@ -100,11 +99,10 @@ function PasswordResetForm(props) {
|
|
|
100
99
|
/* @__PURE__ */ jsx(PasswordInput, {
|
|
101
100
|
id: "repeat-password",
|
|
102
101
|
autoComplete: "new-password",
|
|
103
|
-
...register("passwordRepeat")
|
|
104
|
-
onChange: () => {
|
|
102
|
+
...register("passwordRepeat", { onChange: () => {
|
|
105
103
|
clearErrors("password");
|
|
106
104
|
clearErrors("passwordRepeat");
|
|
107
|
-
}
|
|
105
|
+
} })
|
|
108
106
|
}),
|
|
109
107
|
/* @__PURE__ */ jsx(FormWarningText, { text: errors.passwordRepeat?.message?.toString() }),
|
|
110
108
|
/* @__PURE__ */ jsx(Button, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"password-reset.js","names":["MessageCard"],"sources":["../../../src/components-page/password-reset.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 { KnownErrors } from \"@hexclave/shared\";\nimport { getPasswordError } from \"@hexclave/shared/dist/helpers/password\";\nimport { passwordSchema, yupObject, yupString } from \"@hexclave/shared/dist/schema-fields\";\nimport { cacheFunction } from \"@hexclave/shared/dist/utils/caches\";\nimport { runAsynchronouslyWithAlert } from \"@hexclave/shared/dist/utils/promises\";\nimport { use } from \"@hexclave/shared/dist/utils/react\";\nimport { Button, Label, PasswordInput, Typography, cn } from \"@hexclave/ui\";\nimport { useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport * as yup from \"yup\";\nimport { StackClientApp, useStackApp } from \"..\";\nimport { FormWarningText } from \"../components/elements/form-warning\";\nimport { MaybeFullPage } from \"../components/elements/maybe-full-page\";\nimport { MessageCard } from \"../components/message-cards/message-card\";\nimport { PredefinedMessageCard } from \"../components/message-cards/predefined-message-card\";\nimport { useTranslation } from \"../lib/translations\";\n\nexport default function PasswordResetForm(props: {\n code: string,\n fullPage?: boolean,\n}) {\n const { t } = useTranslation();\n\n const schema = yupObject({\n password: passwordSchema.defined(t(\"Please enter your password\")).nonEmpty(t(\"Please enter your password\")).test({\n name: 'is-valid-password',\n test: (value, ctx) => {\n const error = getPasswordError(value);\n if (error) {\n return ctx.createError({ message: error.message });\n } else {\n return true;\n }\n }\n }),\n passwordRepeat: yupString().nullable().oneOf([yup.ref('password'), null], t(\"Passwords do not match\")).defined().nonEmpty(t(\"Please repeat your password\"))\n });\n\n const { register, handleSubmit, formState: { errors }, clearErrors } = useForm({\n resolver: yupResolver(schema)\n });\n const hexclaveApp = useStackApp();\n const [finished, setFinished] = useState(false);\n const [resetError, setResetError] = useState(false);\n const [loading, setLoading] = useState(false);\n\n const onSubmit = async (data: yup.InferType<typeof schema>) => {\n setLoading(true);\n try {\n const { password } = data;\n const result = await hexclaveApp.resetPassword({ password, code: props.code });\n if (result.status === 'error') {\n setResetError(true);\n return;\n }\n\n setFinished(true);\n } finally {\n setLoading(false);\n }\n };\n\n if (finished) {\n return <PredefinedMessageCard type='passwordReset' fullPage={!!props.fullPage} />;\n }\n\n if (resetError) {\n return (\n <MessageCard title={t(\"Failed to reset password\")} fullPage={!!props.fullPage}>\n {t(\"Failed to reset password. Please request a new password reset link\")}\n </MessageCard>\n );\n }\n\n\n return (\n <MaybeFullPage fullPage={!!props.fullPage}>\n <div className={cn(\n \"flex flex-col items-stretch max-w-[380px] flex-basis-[380px]\",\n props.fullPage ? \"p-4\" : \"p-0\"\n )}>\n <div className=\"text-center mb-6\">\n <Typography type='h2'>{t(\"Reset Your Password\")}</Typography>\n </div>\n\n <form\n className=\"flex flex-col items-stretch\"\n onSubmit={e => runAsynchronouslyWithAlert(handleSubmit(onSubmit)(e))}\n noValidate\n >\n <Label htmlFor=\"password\" className=\"mb-1\">{t(\"New Password\")}</Label>\n <PasswordInput\n id=\"password\"\n autoComplete=\"new-password\"\n {...register('password'
|
|
1
|
+
{"version":3,"file":"password-reset.js","names":["MessageCard"],"sources":["../../../src/components-page/password-reset.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 { KnownErrors } from \"@hexclave/shared\";\nimport { getPasswordError } from \"@hexclave/shared/dist/helpers/password\";\nimport { passwordSchema, yupObject, yupString } from \"@hexclave/shared/dist/schema-fields\";\nimport { cacheFunction } from \"@hexclave/shared/dist/utils/caches\";\nimport { runAsynchronouslyWithAlert } from \"@hexclave/shared/dist/utils/promises\";\nimport { use } from \"@hexclave/shared/dist/utils/react\";\nimport { Button, Label, PasswordInput, Typography, cn } from \"@hexclave/ui\";\nimport { useState } from \"react\";\nimport { useForm } from \"react-hook-form\";\nimport * as yup from \"yup\";\nimport { StackClientApp, useStackApp } from \"..\";\nimport { FormWarningText } from \"../components/elements/form-warning\";\nimport { MaybeFullPage } from \"../components/elements/maybe-full-page\";\nimport { MessageCard } from \"../components/message-cards/message-card\";\nimport { PredefinedMessageCard } from \"../components/message-cards/predefined-message-card\";\nimport { useTranslation } from \"../lib/translations\";\n\nexport default function PasswordResetForm(props: {\n code: string,\n fullPage?: boolean,\n}) {\n const { t } = useTranslation();\n\n const schema = yupObject({\n password: passwordSchema.defined(t(\"Please enter your password\")).nonEmpty(t(\"Please enter your password\")).test({\n name: 'is-valid-password',\n test: (value, ctx) => {\n const error = getPasswordError(value);\n if (error) {\n return ctx.createError({ message: error.message });\n } else {\n return true;\n }\n }\n }),\n passwordRepeat: yupString().nullable().oneOf([yup.ref('password'), null], t(\"Passwords do not match\")).defined().nonEmpty(t(\"Please repeat your password\"))\n });\n\n const { register, handleSubmit, formState: { errors }, clearErrors } = useForm({\n resolver: yupResolver(schema)\n });\n const hexclaveApp = useStackApp();\n const [finished, setFinished] = useState(false);\n const [resetError, setResetError] = useState(false);\n const [loading, setLoading] = useState(false);\n\n const onSubmit = async (data: yup.InferType<typeof schema>) => {\n setLoading(true);\n try {\n const { password } = data;\n const result = await hexclaveApp.resetPassword({ password, code: props.code });\n if (result.status === 'error') {\n setResetError(true);\n return;\n }\n\n setFinished(true);\n } finally {\n setLoading(false);\n }\n };\n\n if (finished) {\n return <PredefinedMessageCard type='passwordReset' fullPage={!!props.fullPage} />;\n }\n\n if (resetError) {\n return (\n <MessageCard title={t(\"Failed to reset password\")} fullPage={!!props.fullPage}>\n {t(\"Failed to reset password. Please request a new password reset link\")}\n </MessageCard>\n );\n }\n\n\n return (\n <MaybeFullPage fullPage={!!props.fullPage}>\n <div className={cn(\n \"flex flex-col items-stretch max-w-[380px] flex-basis-[380px]\",\n props.fullPage ? \"p-4\" : \"p-0\"\n )}>\n <div className=\"text-center mb-6\">\n <Typography type='h2'>{t(\"Reset Your Password\")}</Typography>\n </div>\n\n <form\n className=\"flex flex-col items-stretch\"\n onSubmit={e => runAsynchronouslyWithAlert(handleSubmit(onSubmit)(e))}\n noValidate\n >\n <Label htmlFor=\"password\" className=\"mb-1\">{t(\"New Password\")}</Label>\n <PasswordInput\n id=\"password\"\n autoComplete=\"new-password\"\n {...register('password', { onChange: () => {\n clearErrors('password');\n clearErrors('passwordRepeat');\n } })}\n />\n <FormWarningText text={errors.password?.message?.toString()} />\n\n <Label htmlFor=\"repeat-password\" className=\"mt-4 mb-1\">{t(\"Repeat New Password\")}</Label>\n <PasswordInput\n id=\"repeat-password\"\n autoComplete=\"new-password\"\n {...register('passwordRepeat', { onChange: () => {\n clearErrors('password');\n clearErrors('passwordRepeat');\n } })}\n />\n <FormWarningText text={errors.passwordRepeat?.message?.toString()} />\n\n <Button type=\"submit\" className=\"mt-6\" loading={loading}>\n {t(\"Reset Password\")}\n </Button>\n </form>\n </div>\n </MaybeFullPage>\n );\n}\n\n\nconst cachedVerifyPasswordResetCode = cacheFunction(async (hexclaveApp: StackClientApp<true>, code: string) => {\n return await hexclaveApp.verifyPasswordResetCode(code);\n});\n\nexport function PasswordReset({\n searchParams,\n fullPage = false,\n}: {\n searchParams: Record<string, string>,\n fullPage?: boolean,\n}) {\n const { t } = useTranslation();\n const hexclaveApp = useStackApp();\n\n const invalidJsx = (\n <MessageCard title={t(\"Invalid Password Reset Link\")} fullPage={fullPage}>\n <Typography>{t(\"Please double check if you have the correct password reset link.\")}</Typography>\n </MessageCard>\n );\n\n const expiredJsx = (\n <MessageCard title={t(\"Expired Password Reset Link\")} fullPage={fullPage}>\n <Typography>{t(\"Your password reset link has expired. Please request a new password reset link from the login page.\")}</Typography>\n </MessageCard>\n );\n\n const usedJsx = (\n <MessageCard title={t(\"Used Password Reset Link\")} fullPage={fullPage}>\n <Typography>{t(\"This password reset link has already been used. If you need to reset your password again, please request a new password reset link from the login page.\")}</Typography>\n </MessageCard>\n );\n\n const code = searchParams.code;\n if (!code) {\n return invalidJsx;\n }\n\n const result = use(cachedVerifyPasswordResetCode(hexclaveApp, code));\n\n if (result.status === 'error') {\n if (KnownErrors.VerificationCodeNotFound.isInstance(result.error)) {\n return invalidJsx;\n } else if (KnownErrors.VerificationCodeExpired.isInstance(result.error)) {\n return expiredJsx;\n } else if (KnownErrors.VerificationCodeAlreadyUsed.isInstance(result.error)) {\n return usedJsx;\n } else {\n throw result.error;\n }\n }\n\n return <PasswordResetForm code={code} fullPage={fullPage} />;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAyBA,SAAwB,kBAAkB,OAGvC;CACD,MAAM,EAAE,MAAM,gBAAgB;CAiB9B,MAAM,EAAE,UAAU,cAAc,WAAW,EAAE,UAAU,gBAAgB,QAAQ,EAC7E,UAAU,YAhBG,UAAU;EACvB,UAAU,eAAe,QAAQ,EAAE,6BAA6B,CAAC,CAAC,SAAS,EAAE,6BAA6B,CAAC,CAAC,KAAK;GAC/G,MAAM;GACN,OAAO,OAAO,QAAQ;IACpB,MAAM,QAAQ,iBAAiB,MAAM;AACrC,QAAI,MACF,QAAO,IAAI,YAAY,EAAE,SAAS,MAAM,SAAS,CAAC;QAElD,QAAO;;GAGZ,CAAC;EACF,gBAAgB,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,IAAI,WAAW,EAAE,KAAK,EAAE,EAAE,yBAAyB,CAAC,CAAC,SAAS,CAAC,SAAS,EAAE,8BAA8B,CAAC;EAC5J,CAAC,CAG6B,EAC9B,CAAC;CACF,MAAM,cAAc,aAAa;CACjC,MAAM,CAAC,UAAU,eAAe,SAAS,MAAM;CAC/C,MAAM,CAAC,YAAY,iBAAiB,SAAS,MAAM;CACnD,MAAM,CAAC,SAAS,cAAc,SAAS,MAAM;CAE7C,MAAM,WAAW,OAAO,SAAuC;AAC7D,aAAW,KAAK;AAChB,MAAI;GACF,MAAM,EAAE,aAAa;AAErB,QADe,MAAM,YAAY,cAAc;IAAE;IAAU,MAAM,MAAM;IAAM,CAAC,EACnE,WAAW,SAAS;AAC7B,kBAAc,KAAK;AACnB;;AAGF,eAAY,KAAK;YACT;AACR,cAAW,MAAM;;;AAIrB,KAAI,SACF,QAAO,oBAAC;EAAsB,MAAK;EAAgB,UAAU,CAAC,CAAC,MAAM;GAAY;AAGnF,KAAI,WACF,QACE,oBAACA;EAAY,OAAO,EAAE,2BAA2B;EAAE,UAAU,CAAC,CAAC,MAAM;YAClE,EAAE,qEAAqE;GAC5D;AAKlB,QACE,oBAAC;EAAc,UAAU,CAAC,CAAC,MAAM;YAC/B,qBAAC;GAAI,WAAW,GACd,gEACA,MAAM,WAAW,QAAQ,MAC1B;cACC,oBAAC;IAAI,WAAU;cACb,oBAAC;KAAW,MAAK;eAAM,EAAE,sBAAsB;MAAc;KACzD,EAEN,qBAAC;IACC,WAAU;IACV,WAAU,MAAK,2BAA2B,aAAa,SAAS,CAAC,EAAE,CAAC;IACpE;;KAEA,oBAAC;MAAM,SAAQ;MAAW,WAAU;gBAAQ,EAAE,eAAe;OAAS;KACtE,oBAAC;MACC,IAAG;MACH,cAAa;MACb,GAAI,SAAS,YAAY,EAAE,gBAAgB;AACzC,mBAAY,WAAW;AACvB,mBAAY,iBAAiB;SAC5B,CAAC;OACJ;KACF,oBAAC,mBAAgB,MAAM,OAAO,UAAU,SAAS,UAAU,GAAI;KAE/D,oBAAC;MAAM,SAAQ;MAAkB,WAAU;gBAAa,EAAE,sBAAsB;OAAS;KACzF,oBAAC;MACC,IAAG;MACH,cAAa;MACb,GAAI,SAAS,kBAAkB,EAAE,gBAAgB;AAC/C,mBAAY,WAAW;AACvB,mBAAY,iBAAiB;SAC5B,CAAC;OACJ;KACF,oBAAC,mBAAgB,MAAM,OAAO,gBAAgB,SAAS,UAAU,GAAI;KAErE,oBAAC;MAAO,MAAK;MAAS,WAAU;MAAgB;gBAC7C,EAAE,iBAAiB;OACb;;KACJ;IACH;GACQ;;AAKpB,MAAM,gCAAgC,cAAc,OAAO,aAAmC,SAAiB;AAC7G,QAAO,MAAM,YAAY,wBAAwB,KAAK;EACtD;AAEF,SAAgB,cAAc,EAC5B,cACA,WAAW,SAIV;CACD,MAAM,EAAE,MAAM,gBAAgB;CAC9B,MAAM,cAAc,aAAa;CAEjC,MAAM,aACJ,oBAACA;EAAY,OAAO,EAAE,8BAA8B;EAAY;YAC9D,oBAAC,wBAAY,EAAE,mEAAmE,GAAc;GACpF;CAGhB,MAAM,aACJ,oBAACA;EAAY,OAAO,EAAE,8BAA8B;EAAY;YAC9D,oBAAC,wBAAY,EAAE,sGAAsG,GAAc;GACvH;CAGhB,MAAM,UACJ,oBAACA;EAAY,OAAO,EAAE,2BAA2B;EAAY;YAC3D,oBAAC,wBAAY,EAAE,0JAA0J,GAAc;GAC3K;CAGhB,MAAM,OAAO,aAAa;AAC1B,KAAI,CAAC,KACH,QAAO;CAGT,MAAM,SAAS,IAAI,8BAA8B,aAAa,KAAK,CAAC;AAEpE,KAAI,OAAO,WAAW,QACpB,KAAI,YAAY,yBAAyB,WAAW,OAAO,MAAM,CAC/D,QAAO;UACE,YAAY,wBAAwB,WAAW,OAAO,MAAM,CACrE,QAAO;UACE,YAAY,4BAA4B,WAAW,OAAO,MAAM,CACzE,QAAO;KAEP,OAAM,OAAO;AAIjB,QAAO,oBAAC;EAAwB;EAAgB;GAAY"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
+
import { runAsynchronously } from "@hexclave/shared/dist/utils/promises";
|
|
3
4
|
import { yupResolver } from "@hookform/resolvers/yup";
|
|
4
5
|
import { yupObject, yupString } from "@hexclave/shared/dist/schema-fields";
|
|
5
|
-
import { runAsynchronously } from "@hexclave/shared/dist/utils/promises";
|
|
6
6
|
import { Button, Input, Label, Typography } from "@hexclave/ui";
|
|
7
7
|
import { useState } from "react";
|
|
8
8
|
import { useForm } from "react-hook-form";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev-tool-core.d.ts","names":[],"sources":["../../../src/dev-tool/dev-tool-core.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"dev-tool-core.d.ts","names":[],"sources":["../../../src/dev-tool/dev-tool-core.ts"],"mappings":";;;iBAkxEgB,aAAA,CAAc,GAAA,EAAK,cAAA"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { DEV_TOOL_ROOT_ID } from "@hexclave/shared/dist/utils/dev-tool";
|
|
1
2
|
import { runAsynchronously } from "@hexclave/shared/dist/utils/promises";
|
|
3
|
+
import { getGlobalUiInstance, h, hasAppendChild, setGlobalUiInstance, setHtml } from "../in-page-ui/dom.js";
|
|
2
4
|
import { hexclaveAppInternalsSymbol } from "../lib/hexclave-app/common.js";
|
|
3
5
|
import { isLocalhost } from "@hexclave/shared/dist/utils/urls";
|
|
4
6
|
import { getPagePrompt } from "../lib/hexclave-app/url-targets.js";
|
|
@@ -10,7 +12,7 @@ import { clampTriggerPosition, getSnappedTriggerPlacement, resolveTriggerPositio
|
|
|
10
12
|
//#region src/dev-tool/dev-tool-core.ts
|
|
11
13
|
const STORAGE_KEY = "__hexclave-dev-tool-state";
|
|
12
14
|
const TRIGGER_POS_KEY = "hexclave-devtool-trigger-position";
|
|
13
|
-
const ROOT_ID =
|
|
15
|
+
const ROOT_ID = DEV_TOOL_ROOT_ID;
|
|
14
16
|
const GLOBAL_INSTANCE_KEY = "__hexclave-dev-tool-instance";
|
|
15
17
|
const MAX_LOG_ENTRIES = 500;
|
|
16
18
|
const CONSOLE_LOG_BATCH_SIZE = 100;
|
|
@@ -100,19 +102,6 @@ function createStateStore() {
|
|
|
100
102
|
}
|
|
101
103
|
};
|
|
102
104
|
}
|
|
103
|
-
function isDevToolGlobalInstance(value) {
|
|
104
|
-
return typeof value === "object" && value !== null && typeof Reflect.get(value, "cleanup") === "function";
|
|
105
|
-
}
|
|
106
|
-
function getGlobalDevToolInstance() {
|
|
107
|
-
if (typeof window === "undefined") return null;
|
|
108
|
-
const value = Reflect.get(window, GLOBAL_INSTANCE_KEY);
|
|
109
|
-
return isDevToolGlobalInstance(value) ? value : null;
|
|
110
|
-
}
|
|
111
|
-
function setGlobalDevToolInstance(instance) {
|
|
112
|
-
if (typeof window === "undefined") return;
|
|
113
|
-
if (instance === null) Reflect.deleteProperty(window, GLOBAL_INSTANCE_KEY);
|
|
114
|
-
else Reflect.set(window, GLOBAL_INSTANCE_KEY, instance);
|
|
115
|
-
}
|
|
116
105
|
function getGlobalLogStore() {
|
|
117
106
|
const g = globalThis;
|
|
118
107
|
if (!g.__STACK_DEV_TOOL_LOG_STORE__) g.__STACK_DEV_TOOL_LOG_STORE__ = {
|
|
@@ -192,27 +181,6 @@ function generateRandomEmail() {
|
|
|
192
181
|
for (let i = 0; i < 8; i++) id += chars[Math.floor(Math.random() * 36)];
|
|
193
182
|
return `dev-${id}@test.hexclave.com`;
|
|
194
183
|
}
|
|
195
|
-
function h(tag, attrs, ...children) {
|
|
196
|
-
const el = document.createElement(tag);
|
|
197
|
-
if (attrs) for (const [k, v] of Object.entries(attrs)) {
|
|
198
|
-
if (v == null) continue;
|
|
199
|
-
if (k === "className") el.className = v;
|
|
200
|
-
else if (k === "style" && typeof v === "object") Object.assign(el.style, v);
|
|
201
|
-
else if (k.startsWith("on") && typeof v === "function") el.addEventListener(k.slice(2).toLowerCase(), v);
|
|
202
|
-
else el.setAttribute(k, String(v));
|
|
203
|
-
}
|
|
204
|
-
for (const child of children) {
|
|
205
|
-
if (child == null) continue;
|
|
206
|
-
el.appendChild(typeof child === "string" ? document.createTextNode(child) : child);
|
|
207
|
-
}
|
|
208
|
-
return el;
|
|
209
|
-
}
|
|
210
|
-
function setHtml(el, html) {
|
|
211
|
-
el.innerHTML = html;
|
|
212
|
-
}
|
|
213
|
-
function hasAppendChild(value) {
|
|
214
|
-
return typeof value === "object" && value !== null && typeof Reflect.get(value, "appendChild") === "function";
|
|
215
|
-
}
|
|
216
184
|
function appendInlineMarkdown(container, text) {
|
|
217
185
|
const tokenPattern = /(\[[^\]]+\]\([^)]+\)|`[^`\n]+`|\*\*[^*\n]+\*\*|__[^_\n]+__|\*[^*\n]+\*|_[^_\n]+_)/g;
|
|
218
186
|
let lastIndex = 0;
|
|
@@ -509,8 +477,12 @@ function createIframeTab(src, title, loadingMsg = "Loading…", errorMsg = "Unab
|
|
|
509
477
|
container.appendChild(iframe);
|
|
510
478
|
return container;
|
|
511
479
|
}
|
|
480
|
+
function hasPersistentTokenStoreForDevTool(app) {
|
|
481
|
+
return app[hexclaveAppInternalsSymbol].getConstructorOptions().tokenStore !== null;
|
|
482
|
+
}
|
|
512
483
|
function createOverviewTab(app) {
|
|
513
484
|
const container = h("div", { className: "sdt-ov" });
|
|
485
|
+
const hasPersistentTokenStore = hasPersistentTokenStoreForDevTool(app);
|
|
514
486
|
const heroCard = h("div", { className: "sdt-ov-card sdt-ov-card-hero" });
|
|
515
487
|
heroCard.appendChild(h("div", { className: "sdt-ov-label" }, "Identity"));
|
|
516
488
|
const userRow = h("div", { className: "sdt-ov-user-row" });
|
|
@@ -556,6 +528,15 @@ function createOverviewTab(app) {
|
|
|
556
528
|
let loading = false;
|
|
557
529
|
function rebuildActions() {
|
|
558
530
|
actions.innerHTML = "";
|
|
531
|
+
if (!hasPersistentTokenStore) {
|
|
532
|
+
userName.textContent = "Current user unavailable";
|
|
533
|
+
userEmail.textContent = "This app was initialized without a token store";
|
|
534
|
+
actions.appendChild(h("button", {
|
|
535
|
+
className: "sdt-ov-btn sdt-ov-btn-wide",
|
|
536
|
+
disabled: "true"
|
|
537
|
+
}, "Session actions unavailable"));
|
|
538
|
+
return;
|
|
539
|
+
}
|
|
559
540
|
if (currentUser) {
|
|
560
541
|
const signOutBtn = h("button", { className: "sdt-ov-btn sdt-ov-btn-danger" }, "Sign Out");
|
|
561
542
|
signOutBtn.disabled = loading;
|
|
@@ -744,10 +725,14 @@ function createOverviewTab(app) {
|
|
|
744
725
|
label: "Auth method active",
|
|
745
726
|
hint: hasActiveAuthMethod === null ? "Still checking project config" : null
|
|
746
727
|
},
|
|
747
|
-
{
|
|
728
|
+
hasPersistentTokenStore ? {
|
|
748
729
|
ok: !!currentUser,
|
|
749
730
|
label: "Sign in a test user",
|
|
750
731
|
hint: "Use “Quick Sign In” above →"
|
|
732
|
+
} : {
|
|
733
|
+
ok: true,
|
|
734
|
+
label: "Current-user tools unavailable",
|
|
735
|
+
hint: null
|
|
751
736
|
}
|
|
752
737
|
];
|
|
753
738
|
const passCount = checks.filter((c) => c.ok).length;
|
|
@@ -787,6 +772,17 @@ function createOverviewTab(app) {
|
|
|
787
772
|
}
|
|
788
773
|
}
|
|
789
774
|
async function refreshUser() {
|
|
775
|
+
if (!hasPersistentTokenStore) {
|
|
776
|
+
avatar.className = "sdt-ov-avatar";
|
|
777
|
+
avatar.textContent = "?";
|
|
778
|
+
userName.textContent = "Current user unavailable";
|
|
779
|
+
userEmail.textContent = "This app was initialized without a token store";
|
|
780
|
+
authIndicator.style.display = "none";
|
|
781
|
+
currentUser = null;
|
|
782
|
+
rebuildActions();
|
|
783
|
+
buildChecklist();
|
|
784
|
+
return;
|
|
785
|
+
}
|
|
790
786
|
try {
|
|
791
787
|
currentUser = await app.getUser();
|
|
792
788
|
if (currentUser) {
|
|
@@ -2023,7 +2019,7 @@ function createDevTool(app) {
|
|
|
2023
2019
|
if (typeof document === "undefined" || typeof document.createElement !== "function") return () => {};
|
|
2024
2020
|
const body = Reflect.get(document, "body");
|
|
2025
2021
|
if (!hasAppendChild(body)) return () => {};
|
|
2026
|
-
|
|
2022
|
+
getGlobalUiInstance(GLOBAL_INSTANCE_KEY)?.cleanup();
|
|
2027
2023
|
let existingRoot = document.getElementById(ROOT_ID);
|
|
2028
2024
|
while (existingRoot !== null) {
|
|
2029
2025
|
existingRoot.remove();
|
|
@@ -2097,13 +2093,13 @@ function createDevTool(app) {
|
|
|
2097
2093
|
const instance = { cleanup: () => {
|
|
2098
2094
|
if (didCleanup) return;
|
|
2099
2095
|
didCleanup = true;
|
|
2100
|
-
if (
|
|
2096
|
+
if (getGlobalUiInstance(GLOBAL_INSTANCE_KEY) === instance) setGlobalUiInstance(GLOBAL_INSTANCE_KEY, null);
|
|
2101
2097
|
trigger.cleanup();
|
|
2102
2098
|
removeRequestListener();
|
|
2103
2099
|
panel?.cleanup();
|
|
2104
2100
|
if (root.parentNode) root.parentNode.removeChild(root);
|
|
2105
2101
|
} };
|
|
2106
|
-
|
|
2102
|
+
setGlobalUiInstance(GLOBAL_INSTANCE_KEY, instance);
|
|
2107
2103
|
return () => {
|
|
2108
2104
|
instance.cleanup();
|
|
2109
2105
|
};
|