@forgerock/login-widget 1.3.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +361 -531
- package/dist/browser-DluKPU6C.js +1500 -0
- package/dist/browser-DluKPU6C.js.map +1 -0
- package/dist/core/captcha.config.d.ts +15 -0
- package/dist/core/component.store.d.ts +40 -0
- package/dist/core/interfaces.d.ts +12 -0
- package/dist/core/journey/config.store.d.ts +50 -0
- package/dist/core/journey/journey.interfaces.d.ts +91 -0
- package/dist/core/links.store.d.ts +26 -0
- package/dist/core/locale.store.d.ts +417 -0
- package/dist/core/oauth/oauth.store.d.ts +38 -0
- package/dist/core/oidc/oidc.store.d.ts +58 -0
- package/dist/core/protect/protect.store.d.ts +77 -0
- package/dist/core/style.store.d.ts +182 -0
- package/dist/core/user/user.store.d.ts +32 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.js +25312 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces.d.ts +76 -0
- package/dist/signals-sdk-DbtqPU1J.js +12331 -0
- package/dist/signals-sdk-DbtqPU1J.js.map +1 -0
- package/dist/stats.html +4950 -0
- package/dist/types.d.ts +79 -0
- package/dist/widget.config.d.ts +36 -0
- package/dist/widget.css +1 -0
- package/dist/widget.iife.js +94 -0
- package/dist/widget.iife.js.map +1 -0
- package/package.json +66 -8
- package/CHANGELOG.md +0 -586
- package/index.cjs +0 -47270
- package/index.cjs.map +0 -1
- package/index.d.ts +0 -2565
- package/index.js +0 -47260
- package/index.js.map +0 -1
- package/types.d.ts +0 -2568
- package/widget.css +0 -1881
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2025-2026 Ping Identity Corporation. All right reserved.
|
|
4
|
+
*
|
|
5
|
+
* This software may be modified and distributed under the terms
|
|
6
|
+
* of the MIT license. See the LICENSE file for details.
|
|
7
|
+
*
|
|
8
|
+
**/
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
import type { Writable } from 'svelte/store';
|
|
11
|
+
export declare const urlRegex: RegExp;
|
|
12
|
+
export declare const themeSchema: z.ZodObject<{
|
|
13
|
+
primaryColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
14
|
+
primaryOffColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
15
|
+
secondaryColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
16
|
+
backgroundColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
17
|
+
linkColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
18
|
+
linkActiveColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
19
|
+
logo: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
20
|
+
favicon: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
21
|
+
logoHeight: z.ZodOptional<z.ZodNumber>;
|
|
22
|
+
fontFamily: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
23
|
+
buttonBorderRadius: z.ZodOptional<z.ZodNumber>;
|
|
24
|
+
cardBorderRadius: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
cardBgColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
26
|
+
inputBgColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
27
|
+
inputBorderColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
28
|
+
inputLabelColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
29
|
+
inputFocusRingColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
30
|
+
selectAccentColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
31
|
+
selectHoverBgColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
32
|
+
buttonFocusRingColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
33
|
+
inputTextColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
34
|
+
cardTextColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
35
|
+
bodyTextColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
36
|
+
buttonTextColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
37
|
+
}, z.core.$strict>;
|
|
38
|
+
export type ThemeObject = z.infer<typeof themeSchema>;
|
|
39
|
+
export declare const logoSchema: z.ZodObject<{
|
|
40
|
+
dark: z.ZodOptional<z.ZodString>;
|
|
41
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
42
|
+
light: z.ZodOptional<z.ZodString>;
|
|
43
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
}, z.core.$strict>;
|
|
45
|
+
export declare const styleSchema: z.ZodObject<{
|
|
46
|
+
checksAndRadios: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"animated">, z.ZodLiteral<"standard">]>>;
|
|
47
|
+
labels: z.ZodOptional<z.ZodUnion<readonly [z.ZodOptional<z.ZodLiteral<"floating">>, z.ZodLiteral<"stacked">]>>;
|
|
48
|
+
showPassword: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"button">, z.ZodLiteral<"checkbox">]>>;
|
|
49
|
+
logo: z.ZodOptional<z.ZodObject<{
|
|
50
|
+
dark: z.ZodOptional<z.ZodString>;
|
|
51
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
52
|
+
light: z.ZodOptional<z.ZodString>;
|
|
53
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
54
|
+
}, z.core.$strict>>;
|
|
55
|
+
sections: z.ZodOptional<z.ZodObject<{
|
|
56
|
+
header: z.ZodOptional<z.ZodBoolean>;
|
|
57
|
+
}, z.core.$strict>>;
|
|
58
|
+
stage: z.ZodOptional<z.ZodObject<{
|
|
59
|
+
icon: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
+
}, z.core.$strict>>;
|
|
61
|
+
theme: z.ZodOptional<z.ZodObject<{
|
|
62
|
+
primaryColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
63
|
+
primaryOffColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
64
|
+
secondaryColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
65
|
+
backgroundColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
66
|
+
linkColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
67
|
+
linkActiveColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
68
|
+
logo: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
69
|
+
favicon: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
70
|
+
logoHeight: z.ZodOptional<z.ZodNumber>;
|
|
71
|
+
fontFamily: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
72
|
+
buttonBorderRadius: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
cardBorderRadius: z.ZodOptional<z.ZodNumber>;
|
|
74
|
+
cardBgColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
75
|
+
inputBgColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
76
|
+
inputBorderColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
77
|
+
inputLabelColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
78
|
+
inputFocusRingColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
79
|
+
selectAccentColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
80
|
+
selectHoverBgColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
81
|
+
buttonFocusRingColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
82
|
+
inputTextColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
83
|
+
cardTextColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
84
|
+
bodyTextColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
85
|
+
buttonTextColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
86
|
+
}, z.core.$strict>>;
|
|
87
|
+
}, z.core.$strict>;
|
|
88
|
+
export declare const partialStyleSchema: z.ZodObject<{
|
|
89
|
+
checksAndRadios: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"animated">, z.ZodLiteral<"standard">]>>>;
|
|
90
|
+
labels: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodOptional<z.ZodLiteral<"floating">>, z.ZodLiteral<"stacked">]>>>;
|
|
91
|
+
showPassword: z.ZodOptional<z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"none">, z.ZodLiteral<"button">, z.ZodLiteral<"checkbox">]>>>;
|
|
92
|
+
logo: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
93
|
+
dark: z.ZodOptional<z.ZodString>;
|
|
94
|
+
height: z.ZodOptional<z.ZodNumber>;
|
|
95
|
+
light: z.ZodOptional<z.ZodString>;
|
|
96
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
97
|
+
}, z.core.$strict>>>;
|
|
98
|
+
sections: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
99
|
+
header: z.ZodOptional<z.ZodBoolean>;
|
|
100
|
+
}, z.core.$strict>>>;
|
|
101
|
+
stage: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
102
|
+
icon: z.ZodOptional<z.ZodBoolean>;
|
|
103
|
+
}, z.core.$strict>>>;
|
|
104
|
+
theme: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
105
|
+
primaryColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
106
|
+
primaryOffColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
107
|
+
secondaryColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
108
|
+
backgroundColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
109
|
+
linkColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
110
|
+
linkActiveColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
111
|
+
logo: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
112
|
+
favicon: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
113
|
+
logoHeight: z.ZodOptional<z.ZodNumber>;
|
|
114
|
+
fontFamily: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
115
|
+
buttonBorderRadius: z.ZodOptional<z.ZodNumber>;
|
|
116
|
+
cardBorderRadius: z.ZodOptional<z.ZodNumber>;
|
|
117
|
+
cardBgColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
118
|
+
inputBgColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
119
|
+
inputBorderColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
120
|
+
inputLabelColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
121
|
+
inputFocusRingColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
122
|
+
selectAccentColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
123
|
+
selectHoverBgColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
124
|
+
buttonFocusRingColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
125
|
+
inputTextColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
126
|
+
cardTextColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
127
|
+
bodyTextColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
128
|
+
buttonTextColor: z.ZodCatch<z.ZodOptional<z.ZodString>>;
|
|
129
|
+
}, z.core.$strict>>>;
|
|
130
|
+
}, z.core.$strict>;
|
|
131
|
+
/** Convenience type alias for the resolved widget style object. */
|
|
132
|
+
export type StyleObject = z.infer<typeof partialStyleSchema>;
|
|
133
|
+
export declare const styleStore: Writable<z.infer<typeof partialStyleSchema>>;
|
|
134
|
+
/**
|
|
135
|
+
* @function initialize - Initialize the style store
|
|
136
|
+
* @param {object} customStyle - An object of custom styles to merge with the default
|
|
137
|
+
* @returns {object} - The style store
|
|
138
|
+
* @example initialize({ checksAndRadios: 'standard' });
|
|
139
|
+
*/
|
|
140
|
+
export declare function initialize(customStyle?: z.infer<typeof partialStyleSchema>): Writable<{
|
|
141
|
+
checksAndRadios?: "animated" | "standard" | undefined;
|
|
142
|
+
labels?: "floating" | "stacked" | undefined;
|
|
143
|
+
showPassword?: "none" | "button" | "checkbox" | undefined;
|
|
144
|
+
logo?: {
|
|
145
|
+
dark?: string | undefined;
|
|
146
|
+
height?: number | undefined;
|
|
147
|
+
light?: string | undefined;
|
|
148
|
+
width?: number | undefined;
|
|
149
|
+
} | undefined;
|
|
150
|
+
sections?: {
|
|
151
|
+
header?: boolean | undefined;
|
|
152
|
+
} | undefined;
|
|
153
|
+
stage?: {
|
|
154
|
+
icon?: boolean | undefined;
|
|
155
|
+
} | undefined;
|
|
156
|
+
theme?: {
|
|
157
|
+
primaryColor?: string | undefined;
|
|
158
|
+
primaryOffColor?: string | undefined;
|
|
159
|
+
secondaryColor?: string | undefined;
|
|
160
|
+
backgroundColor?: string | undefined;
|
|
161
|
+
linkColor?: string | undefined;
|
|
162
|
+
linkActiveColor?: string | undefined;
|
|
163
|
+
logo?: string | undefined;
|
|
164
|
+
favicon?: string | undefined;
|
|
165
|
+
logoHeight?: number | undefined;
|
|
166
|
+
fontFamily?: string | undefined;
|
|
167
|
+
buttonBorderRadius?: number | undefined;
|
|
168
|
+
cardBorderRadius?: number | undefined;
|
|
169
|
+
cardBgColor?: string | undefined;
|
|
170
|
+
inputBgColor?: string | undefined;
|
|
171
|
+
inputBorderColor?: string | undefined;
|
|
172
|
+
inputLabelColor?: string | undefined;
|
|
173
|
+
inputFocusRingColor?: string | undefined;
|
|
174
|
+
selectAccentColor?: string | undefined;
|
|
175
|
+
selectHoverBgColor?: string | undefined;
|
|
176
|
+
buttonFocusRingColor?: string | undefined;
|
|
177
|
+
inputTextColor?: string | undefined;
|
|
178
|
+
cardTextColor?: string | undefined;
|
|
179
|
+
bodyTextColor?: string | undefined;
|
|
180
|
+
buttonTextColor?: string | undefined;
|
|
181
|
+
} | undefined;
|
|
182
|
+
}>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*
|
|
3
|
+
* Copyright © 2025 - 2026 Ping Identity Corporation. All right reserved.
|
|
4
|
+
*
|
|
5
|
+
* This software may be modified and distributed under the terms
|
|
6
|
+
* of the MIT license. See the LICENSE file for details.
|
|
7
|
+
*
|
|
8
|
+
**/
|
|
9
|
+
import type { OidcClient, UserInfoResponse } from '@forgerock/oidc-client/types';
|
|
10
|
+
import type { Readable, Writable } from 'svelte/store';
|
|
11
|
+
import type { Maybe } from '../interfaces';
|
|
12
|
+
export interface UserStore extends Pick<Writable<UserStoreValue>, 'subscribe'> {
|
|
13
|
+
get: () => Promise<UserStoreValue>;
|
|
14
|
+
reset: () => void;
|
|
15
|
+
}
|
|
16
|
+
export interface UserStoreValue {
|
|
17
|
+
completed: boolean;
|
|
18
|
+
error: Maybe<{
|
|
19
|
+
code?: Maybe<number>;
|
|
20
|
+
message: Maybe<string>;
|
|
21
|
+
troubleshoot: Maybe<string>;
|
|
22
|
+
}>;
|
|
23
|
+
loading: boolean;
|
|
24
|
+
successful: boolean;
|
|
25
|
+
response: Maybe<UserInfoResponse>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @function initialize - Initializes the user store with a get function and a reset function
|
|
29
|
+
* @param {Readable<OidcClient | null>} oidcClientStore - The OIDC client store to read the client from
|
|
30
|
+
* @returns {UserStore} - The user store
|
|
31
|
+
*/
|
|
32
|
+
export declare function initialize(oidcClientStore: Readable<OidcClient | null> | undefined): UserStore;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import './main.css';
|
|
3
|
+
export declare const configure: (options: import("./interfaces").WidgetConfigOptions) => Promise<void>;
|
|
4
|
+
export declare const journey: (options?: import("./interfaces").JourneyOptions) => {
|
|
5
|
+
change: (changeOptions: import("./interfaces").JourneyOptionsChange) => Promise<unknown>;
|
|
6
|
+
start: (startOptions?: import("./interfaces").JourneyOptionsStart) => Promise<unknown>;
|
|
7
|
+
subscribe: (this: void, run: import("svelte/store").Subscriber<{
|
|
8
|
+
journey: import("./core/journey/journey.interfaces").JourneyStoreValue;
|
|
9
|
+
oauth: import("./core/oauth/oauth.store").OAuthTokenStoreValue;
|
|
10
|
+
user: import("./core/user/user.store").UserStoreValue;
|
|
11
|
+
}>, invalidate?: () => void) => import("svelte/store").Unsubscriber;
|
|
12
|
+
};
|
|
13
|
+
export declare const component: () => {
|
|
14
|
+
close: (args?: {
|
|
15
|
+
reason: "auto" | "external" | "user";
|
|
16
|
+
}) => void;
|
|
17
|
+
open: () => void;
|
|
18
|
+
subscribe: (this: void, run: import("svelte/store").Subscriber<Pick<import("./core/component.store").ComponentStoreValue, "open" | "lastAction" | "error" | "mounted" | "reason">>, invalidate?: () => void) => import("svelte/store").Unsubscriber;
|
|
19
|
+
};
|
|
20
|
+
export declare const user: {
|
|
21
|
+
info(): {
|
|
22
|
+
get: () => Promise<import("./core/user/user.store").UserStoreValue>;
|
|
23
|
+
subscribe: (this: void, run: import("svelte/store").Subscriber<import("./core/user/user.store").UserStoreValue>, invalidate?: () => void) => import("svelte/store").Unsubscriber;
|
|
24
|
+
};
|
|
25
|
+
logout(): Promise<void>;
|
|
26
|
+
tokens(): {
|
|
27
|
+
get: (options?: import("@forgerock/oidc-client").GetTokensOptions) => Promise<import("./core/oauth/oauth.store").OAuthTokenStoreValue>;
|
|
28
|
+
subscribe: (this: void, run: import("svelte/store").Subscriber<import("./core/oauth/oauth.store").OAuthTokenStoreValue>, invalidate?: () => void) => import("svelte/store").Unsubscriber;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export declare const protect: {
|
|
32
|
+
start: (config: import("./core/protect/protect.store").ProtectConfig | import("@forgerock/protect/types").SignalsInitializationOptions) => Promise<void | {
|
|
33
|
+
error: string;
|
|
34
|
+
}>;
|
|
35
|
+
getData: () => Promise<string | {
|
|
36
|
+
error: string;
|
|
37
|
+
}>;
|
|
38
|
+
pauseBehavioralData: () => void | {
|
|
39
|
+
error: string;
|
|
40
|
+
};
|
|
41
|
+
resumeBehavioralData: () => void | {
|
|
42
|
+
error: string;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
declare const __propDef: {
|
|
46
|
+
props: {
|
|
47
|
+
type?: "modal" | "inline";
|
|
48
|
+
};
|
|
49
|
+
events: {
|
|
50
|
+
[evt: string]: CustomEvent<any>;
|
|
51
|
+
};
|
|
52
|
+
slots: {};
|
|
53
|
+
};
|
|
54
|
+
export type IndexProps = typeof __propDef.props;
|
|
55
|
+
export type IndexEvents = typeof __propDef.events;
|
|
56
|
+
export type IndexSlots = typeof __propDef.slots;
|
|
57
|
+
export default class Index extends SvelteComponentTyped<IndexProps, IndexEvents, IndexSlots> {
|
|
58
|
+
}
|
|
59
|
+
export {};
|