@slashid/jump-page 1.0.20 → 1.0.21

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.
Files changed (32) hide show
  1. package/package/astro.config.d.mts +2 -0
  2. package/package/favicon.png +0 -0
  3. package/package/main.css +1 -0
  4. package/package/main.js +13529 -0
  5. package/package/main.js.map +1 -0
  6. package/package/package/main.d.ts +103 -0
  7. package/package/src/components/app/app.component.d.ts +7 -0
  8. package/package/src/components/app/app.context.d.ts +22 -0
  9. package/package/src/components/app/app.css.d.ts +1 -0
  10. package/package/src/components/app/index.d.ts +1 -0
  11. package/package/src/components/card/card.component.d.ts +10 -0
  12. package/package/src/components/card/card.css.d.ts +4 -0
  13. package/package/src/components/card/index.d.ts +1 -0
  14. package/package/src/components/flow/flow.component.d.ts +1 -0
  15. package/package/src/components/flow/flow.css.d.ts +3 -0
  16. package/package/src/components/flow/flow.error.d.ts +7 -0
  17. package/package/src/components/flow/flow.loading.d.ts +1 -0
  18. package/package/src/components/flow/flow.progress.d.ts +11 -0
  19. package/package/src/components/flow/flow.recover.d.ts +1 -0
  20. package/package/src/components/flow/flow.success.d.ts +4 -0
  21. package/package/src/components/flow/flow.types.d.ts +39 -0
  22. package/package/src/components/flow/flow.util.d.ts +2 -0
  23. package/package/src/components/flow/index.d.ts +3 -0
  24. package/package/src/components/text/index.d.ts +1 -0
  25. package/package/src/components/text/text.component.d.ts +6 -0
  26. package/package/src/components/text/use-i18n.d.ts +1 -0
  27. package/package/src/config.d.ts +7 -0
  28. package/package/src/domain/errors.d.ts +2 -0
  29. package/package/src/domain/i18n.d.ts +48 -0
  30. package/package/src/main.d.ts +10 -0
  31. package/package/vite.config.d.ts +2 -0
  32. package/package.json +2 -2
@@ -0,0 +1,103 @@
1
+ declare function Is({ children: e, className: t, header: n, footer: r, style: o }: {
2
+ children: any;
3
+ className: any;
4
+ header?: any;
5
+ footer?: any;
6
+ style: any;
7
+ }): any;
8
+ declare function co({ errorCode: e, type: t, redirectUri: n }: {
9
+ errorCode: any;
10
+ type: any;
11
+ redirectUri: any;
12
+ }): any;
13
+ declare namespace Ps {
14
+ export { fe as en };
15
+ export let ja: {
16
+ "footer.text": string;
17
+ "initial.title": string;
18
+ "initial.details": string;
19
+ "success.title": string;
20
+ "success.details.default": string;
21
+ "success.details.autoclose": string;
22
+ "recover.password.title": string;
23
+ "recover.password.details": string;
24
+ "recover.password.input.password.label": string;
25
+ "recover.password.input.confirmPassword.label": string;
26
+ "recover.password.input.placeholder": string;
27
+ "recover.password.submit": string;
28
+ "recover.password.validation.passwordsDoNotMatch": string;
29
+ "recover.password.validation.length": string;
30
+ "recover.password.validation.password_variants": string;
31
+ "recover.password.validation.admin_variants": string;
32
+ "recover.password.validation.user_variants": string;
33
+ "recover.password.validation.alphanumeric_sequences_1": string;
34
+ "recover.password.validation.alphanumeric_sequences_2": string;
35
+ "recover.password.validation.numeric_sequences_ascending": string;
36
+ "recover.password.validation.numeric_subsequences_ascending": string;
37
+ "recover.password.validation.numeric_sequences_descending": string;
38
+ "recover.password.validation.numeric_subsequences_descending": string;
39
+ "recover.password.validation.common_password_xkcd": string;
40
+ "error.title": string;
41
+ "error.title.authentication_expired": string;
42
+ "error.title.registration_already_completed": string;
43
+ "error.detail": string;
44
+ "error.detail.authentication_expired": string;
45
+ "error.detail.registration_already_completed": string;
46
+ };
47
+ }
48
+ declare function fm({ onSuccess: e, onError: t, flowType: n, onRedirectDiscovered: r }: {
49
+ onSuccess: any;
50
+ onError: any;
51
+ flowType: any;
52
+ onRedirectDiscovered: any;
53
+ }): any;
54
+ declare function Ef(): any;
55
+ declare function vf({ redirectUri: e, autoClose: t }?: {
56
+ redirectUri: any;
57
+ autoClose?: boolean | undefined;
58
+ }): any;
59
+ declare function tf({ text: e, children: t }: {
60
+ text: any;
61
+ children: any;
62
+ }): any;
63
+ declare function Cd({ children: e, theme: t, className: n }: {
64
+ children: any;
65
+ theme?: string | undefined;
66
+ className: any;
67
+ }): any;
68
+ declare function E5({ environment: e }: {
69
+ environment?: string | undefined;
70
+ }): any;
71
+ declare const fe: {
72
+ "footer.text": string;
73
+ "initial.title": string;
74
+ "initial.details": string;
75
+ "recover.password.title": string;
76
+ "recover.password.details": string;
77
+ "recover.password.input.password.label": string;
78
+ "recover.password.input.confirmPassword.label": string;
79
+ "recover.password.input.placeholder": string;
80
+ "recover.password.submit": string;
81
+ "recover.password.validation.passwordsDoNotMatch": string;
82
+ "recover.password.validation.length": string;
83
+ "recover.password.validation.password_variants": string;
84
+ "recover.password.validation.admin_variants": string;
85
+ "recover.password.validation.user_variants": string;
86
+ "recover.password.validation.alphanumeric_sequences_1": string;
87
+ "recover.password.validation.alphanumeric_sequences_2": string;
88
+ "recover.password.validation.numeric_sequences_ascending": string;
89
+ "recover.password.validation.numeric_subsequences_ascending": string;
90
+ "recover.password.validation.numeric_sequences_descending": string;
91
+ "recover.password.validation.numeric_subsequences_descending": string;
92
+ "recover.password.validation.common_password_xkcd": string;
93
+ "success.title": string;
94
+ "success.details.default": string;
95
+ "success.details.autoclose": string;
96
+ "error.title": string;
97
+ "error.title.authentication_expired": string;
98
+ "error.title.registration_already_completed": string;
99
+ "error.detail": string;
100
+ "error.detail.authentication_expired": string;
101
+ "error.detail.registration_already_completed": string;
102
+ };
103
+ export { Is as Card, co as Error, Ps as I18N, fm as Progress, Ef as Recover, vf as Success, tf as TextProvider, Cd as ThemeRoot, E5 as Verification };
@@ -0,0 +1,7 @@
1
+ import { type SlashIDOptions } from "@slashid/slashid";
2
+ export type Environment = SlashIDOptions["environment"];
3
+ export type VerificationProps = {
4
+ environment?: Environment;
5
+ };
6
+ export declare function Verification({ environment }: VerificationProps): import("react/jsx-runtime").JSX.Element;
7
+ export declare function App(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ /// <reference types="react" />
2
+ import type { SlashID } from "@slashid/slashid";
3
+ import { type Language } from "../../domain/i18n";
4
+ export type AppState = "initial" | "ready";
5
+ type AppConfig = {
6
+ logo: string | React.ReactNode;
7
+ language: Language;
8
+ setLogo: (logo: string) => void;
9
+ };
10
+ export type AppInitialState = AppConfig & {
11
+ state: "initial";
12
+ sdk: undefined;
13
+ };
14
+ export type AppReadyState = AppConfig & {
15
+ state: "ready";
16
+ sdk: SlashID;
17
+ };
18
+ export type AppContextState = AppInitialState | AppReadyState;
19
+ export declare const initialAppContextState: AppContextState;
20
+ export declare const AppContext: import("react").Context<AppContextState>;
21
+ export declare const useAppContext: () => AppContextState;
22
+ export {};
@@ -0,0 +1 @@
1
+ export declare const app: string;
@@ -0,0 +1 @@
1
+ export * from "./app.component";
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ import type { ThemeVars } from "../flow";
3
+ export type Props = {
4
+ children: React.ReactNode;
5
+ footer?: React.ReactNode;
6
+ header?: React.ReactNode;
7
+ className?: string;
8
+ style?: ThemeVars;
9
+ };
10
+ export declare function Card({ children, className, header, footer, style }: Props): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export declare const card: string;
2
+ export declare const header: string;
3
+ export declare const footer: string;
4
+ export declare const logo: string;
@@ -0,0 +1 @@
1
+ export * from "./card.component";
@@ -0,0 +1 @@
1
+ export declare function Flow(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ export declare const formInputs: string;
2
+ export declare const passwordRecoveryPrompt: string;
3
+ export declare const errorMessage: string;
@@ -0,0 +1,7 @@
1
+ import type { ErrorCode } from "./flow.types";
2
+ export type ErrorType = "warning" | "error" | "neutral";
3
+ export declare function Error({ errorCode, type, redirectUri }: {
4
+ errorCode?: ErrorCode;
5
+ type: ErrorType;
6
+ redirectUri?: string;
7
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function Loading(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,11 @@
1
+ import { type RedirectUriDiscoveredEvent } from "@slashid/slashid";
2
+ import type { FlowType } from "./flow.types";
3
+ export type Props = {
4
+ flowType: FlowType;
5
+ onSuccess: () => void;
6
+ onError: ({ error }: {
7
+ error: Error;
8
+ }) => void;
9
+ onRedirectDiscovered?: (event: RedirectUriDiscoveredEvent) => void;
10
+ };
11
+ export declare function Progress({ onSuccess, onError, flowType, onRedirectDiscovered }: Props): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function Recover(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export declare function Success({ redirectUri, autoClose }?: {
2
+ redirectUri?: string;
3
+ autoClose?: boolean;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,39 @@
1
+ import type { SlashID } from "@slashid/slashid";
2
+ export type InitialState = {
3
+ state: "initial";
4
+ };
5
+ export type ParsingURLState = {
6
+ state: "parsing-url";
7
+ };
8
+ export type NoChallengesState = {
9
+ state: "no-challenges";
10
+ challenges: null;
11
+ };
12
+ export type ProgressState = {
13
+ state: "progress";
14
+ challenges: Challenges;
15
+ flowType: FlowType;
16
+ };
17
+ export type SuccessState = {
18
+ state: "success";
19
+ challenges: Challenges;
20
+ flowType: FlowType;
21
+ };
22
+ export type ErrorState = {
23
+ state: "error";
24
+ error: Error;
25
+ challenges: Challenges;
26
+ flowType: FlowType;
27
+ };
28
+ export type State = InitialState | ParsingURLState | NoChallengesState | ProgressState | SuccessState | ErrorState;
29
+ export type FlowType = "catch-all" | "password-recovery";
30
+ export type ChallengesInURL = Awaited<ReturnType<SlashID["getChallengesFromURL"]>>;
31
+ export type Challenges = NonNullable<ChallengesInURL>;
32
+ export type ThemeVars = Record<`--sid-${string}`, string | number>;
33
+ export type SlashIDUIConfig = {
34
+ logoUrl: string;
35
+ showBadge: boolean;
36
+ autoClose?: boolean;
37
+ themeVars: ThemeVars;
38
+ };
39
+ export type ErrorCode = "authentication_expired" | "registration_already_completed";
@@ -0,0 +1,2 @@
1
+ import type { ErrorCode, ErrorState } from ".";
2
+ export declare const errorToErrorCode: (state: ErrorState) => Promise<ErrorCode | undefined>;
@@ -0,0 +1,3 @@
1
+ export * from "./flow.component";
2
+ export * from "./flow.types";
3
+ export * from "./flow.error";
@@ -0,0 +1 @@
1
+ export * from "./text.component";
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { type TextProps } from "@slashid/react-primitives";
3
+ import type { TranslationKeys } from "../../domain/i18n";
4
+ type Props = TextProps<Record<TranslationKeys, string>>;
5
+ export declare const Text: React.FC<Props>;
6
+ export {};
@@ -0,0 +1 @@
1
+ export declare function useI18n(): (key: "footer.text" | "success.details.autoclose" | "recover.password.title" | "recover.password.details" | "recover.password.input.password.label" | "recover.password.input.confirmPassword.label" | "recover.password.input.placeholder" | "recover.password.submit" | "recover.password.validation.passwordsDoNotMatch" | "recover.password.validation.length" | "recover.password.validation.password_variants" | "recover.password.validation.admin_variants" | "recover.password.validation.user_variants" | "recover.password.validation.alphanumeric_sequences_1" | "recover.password.validation.alphanumeric_sequences_2" | "recover.password.validation.numeric_sequences_ascending" | "recover.password.validation.numeric_subsequences_ascending" | "recover.password.validation.numeric_sequences_descending" | "recover.password.validation.numeric_subsequences_descending" | "recover.password.validation.common_password_xkcd" | "error.title" | "error.title.authentication_expired" | "error.title.registration_already_completed" | "error.detail.authentication_expired" | "error.detail.registration_already_completed" | "error.detail" | "success.title" | "success.details.default" | "initial.title" | "initial.details") => string;
@@ -0,0 +1,7 @@
1
+ export declare const config: {
2
+ sdkURL: any;
3
+ baseURL: any;
4
+ environment: any;
5
+ sentryDSN: any;
6
+ sentryEnabled: boolean;
7
+ };
@@ -0,0 +1,2 @@
1
+ export declare function logError(err: unknown, context?: Record<string, string>): Promise<void>;
2
+ export declare function ensureError(value: unknown): Error;
@@ -0,0 +1,48 @@
1
+ export type Language = "en" | "ja";
2
+ /**
3
+ * Check the language based on the browser settings.
4
+ * Default to "en"
5
+ */
6
+ export declare function detectLanguage(): Language;
7
+ export declare const defaultStrings: {
8
+ "footer.text": string;
9
+ "initial.title": string;
10
+ "initial.details": string;
11
+ "recover.password.title": string;
12
+ "recover.password.details": string;
13
+ "recover.password.input.password.label": string;
14
+ "recover.password.input.confirmPassword.label": string;
15
+ "recover.password.input.placeholder": string;
16
+ "recover.password.submit": string;
17
+ "recover.password.validation.passwordsDoNotMatch": string;
18
+ "recover.password.validation.length": string;
19
+ "recover.password.validation.password_variants": string;
20
+ "recover.password.validation.admin_variants": string;
21
+ "recover.password.validation.user_variants": string;
22
+ "recover.password.validation.alphanumeric_sequences_1": string;
23
+ "recover.password.validation.alphanumeric_sequences_2": string;
24
+ "recover.password.validation.numeric_sequences_ascending": string;
25
+ "recover.password.validation.numeric_subsequences_ascending": string;
26
+ "recover.password.validation.numeric_sequences_descending": string;
27
+ "recover.password.validation.numeric_subsequences_descending": string;
28
+ "recover.password.validation.common_password_xkcd": string;
29
+ "success.title": string;
30
+ "success.details.default": string;
31
+ "success.details.autoclose": string;
32
+ "error.title": string;
33
+ "error.title.authentication_expired": string;
34
+ "error.title.registration_already_completed": string;
35
+ "error.detail": string;
36
+ "error.detail.authentication_expired": string;
37
+ "error.detail.registration_already_completed": string;
38
+ };
39
+ export type TranslationKeys = keyof typeof defaultStrings;
40
+ export type Translations = {
41
+ [key in Language]: {
42
+ [key in TranslationKeys]: string;
43
+ };
44
+ };
45
+ export declare const I18N: Translations;
46
+ export type TranslationKey = keyof Translations[Language];
47
+ export type Translate = (key: TranslationKey) => (typeof I18N)[Language][TranslationKey];
48
+ export declare const createI18n: (language: Language) => (key: TranslationKey) => string;
@@ -0,0 +1,10 @@
1
+ export { TextProvider, ThemeRoot } from "@slashid/react-primitives";
2
+ export { I18N } from "./domain/i18n";
3
+ export { Card } from "./components/card";
4
+ export { Error } from "./components/flow/flow.error";
5
+ export { Success } from "./components/flow/flow.success";
6
+ export { Recover } from "./components/flow/flow.recover";
7
+ export { Progress } from "./components/flow/flow.progress";
8
+ export { Verification } from "./components/app/app.component";
9
+ export type { VerificationProps, Environment } from "./components/app/app.component";
10
+ export type { ErrorType } from "./components/flow/flow.error";
@@ -0,0 +1,2 @@
1
+ declare const _default: import("vite").UserConfig;
2
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slashid/jump-page",
3
- "version": "1.0.20",
3
+ "version": "1.0.21",
4
4
  "homepage": "https://slashid.dev",
5
5
  "author": "SlashID",
6
6
  "license": "MIT",
@@ -47,7 +47,7 @@
47
47
  "@types/react": "^18.0.21",
48
48
  "@types/react-dom": "^18.0.6",
49
49
  "@vitejs/plugin-react": "^4.2.1",
50
- "astro": "^5.12.8",
50
+ "astro": "5.14.1",
51
51
  "clsx": "^2.1.0",
52
52
  "commander": "^11.1.0",
53
53
  "typescript": "^5.3.3"