@hellocoop/svelte 2.0.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/dist/auth.js +1 -0
- package/dist/buttons/BaseButton.svelte +16 -1
- package/dist/buttons/BaseButton.svelte.d.ts +8 -3
- package/dist/buttons/LoginButton.svelte +1 -1
- package/dist/buttons/UpdateProfileButton.svelte +1 -1
- package/dist/index.js +1 -0
- package/dist/logout.js +1 -0
- package/package.json +4 -3
package/dist/auth.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>import { routeConfig } from "../Provider.svelte";
|
|
2
2
|
import { onMount } from "svelte";
|
|
3
|
-
import { Button } from "
|
|
3
|
+
import { Button } from "@hellocoop/constants";
|
|
4
4
|
export let label = "\u014D Continue with Hell\u014D";
|
|
5
5
|
export let style = {};
|
|
6
6
|
export let color = "black";
|
|
@@ -12,6 +12,10 @@ export let targetURI = "";
|
|
|
12
12
|
export let providerHint = [];
|
|
13
13
|
export let showLoader = false;
|
|
14
14
|
export let disabled = false;
|
|
15
|
+
export let promptLogin = false;
|
|
16
|
+
export let promptConsent = false;
|
|
17
|
+
export let loginHint = "";
|
|
18
|
+
export let account = void 0;
|
|
15
19
|
let checkedForStylesheet = false;
|
|
16
20
|
onMount(() => {
|
|
17
21
|
if (typeof window != "undefined" && !checkedForStylesheet) {
|
|
@@ -30,6 +34,17 @@ if (scope)
|
|
|
30
34
|
loginRoute.searchParams.set("target_uri", targetURI || window.location.pathname);
|
|
31
35
|
if (update)
|
|
32
36
|
loginRoute.searchParams.set("prompt", "consent");
|
|
37
|
+
if (promptLogin && promptConsent) {
|
|
38
|
+
loginRoute.searchParams.set("prompt", "login consent");
|
|
39
|
+
} else if (promptLogin) {
|
|
40
|
+
loginRoute.searchParams.set("prompt", "login");
|
|
41
|
+
} else if (promptConsent) {
|
|
42
|
+
loginRoute.searchParams.set("prompt", "consent");
|
|
43
|
+
}
|
|
44
|
+
if (loginHint)
|
|
45
|
+
loginRoute.searchParams.set("login_hint", loginHint);
|
|
46
|
+
if (account)
|
|
47
|
+
loginRoute.searchParams.set("account", account);
|
|
33
48
|
if (providerHint)
|
|
34
49
|
loginRoute.searchParams.set("provider_hint", providerHint.join(" "));
|
|
35
50
|
const onClickHandler = () => {
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
+
import { Button } from '@hellocoop/constants';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
label?: string | undefined;
|
|
5
6
|
style?: any;
|
|
6
|
-
color?:
|
|
7
|
-
theme?:
|
|
8
|
-
hover?:
|
|
7
|
+
color?: Button.Color | undefined;
|
|
8
|
+
theme?: Button.Theme | undefined;
|
|
9
|
+
hover?: Button.Hover | undefined;
|
|
9
10
|
scope?: ("name" | "nickname" | "preferred_username" | "given_name" | "family_name" | "email" | "phone" | "picture" | "ethereum" | "discord" | "twitter" | "github" | "gitlab" | "profile" | "openid" | "profile_update")[] | undefined;
|
|
10
11
|
update?: boolean | undefined;
|
|
11
12
|
targetURI?: string | undefined;
|
|
12
13
|
providerHint?: ("phone" | "ethereum" | "discord" | "twitter" | "github" | "gitlab" | "apple" | "facebook" | "google" | "twitch" | "tumblr" | "mastodon" | "microsoft" | "line" | "wordpress" | "yahoo" | "qrcode" | "apple--" | "microsoft--" | "google--" | "email--" | "passkey--")[] | undefined;
|
|
13
14
|
showLoader?: boolean | undefined;
|
|
14
15
|
disabled?: boolean | undefined;
|
|
16
|
+
promptLogin?: boolean | undefined;
|
|
17
|
+
promptConsent?: boolean | undefined;
|
|
18
|
+
loginHint?: string | undefined;
|
|
19
|
+
account?: 'personal' | 'managed' | undefined;
|
|
15
20
|
};
|
|
16
21
|
events: {
|
|
17
22
|
[evt: string]: CustomEvent<any>;
|
package/dist/index.js
CHANGED
package/dist/logout.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hellocoop/svelte",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Svelte SDK for Hellō https://hello.dev",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"svelte": "^4.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@sveltejs/adapter-auto": "^2.
|
|
46
|
+
"@sveltejs/adapter-auto": "^2.1.1",
|
|
47
47
|
"@sveltejs/kit": "^1.20.4",
|
|
48
48
|
"@sveltejs/package": "^2.0.0",
|
|
49
49
|
"publint": "^0.1.9",
|
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
"types": "./dist/index.d.ts",
|
|
58
58
|
"type": "module",
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"sswr": "^2.0.0"
|
|
60
|
+
"sswr": "^2.0.0",
|
|
61
|
+
"@hellocoop/constants": "^1.1.6"
|
|
61
62
|
}
|
|
62
63
|
}
|