@hellocoop/svelte 2.1.5 → 2.1.7
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/Provider.svelte +22 -18
- package/dist/Provider.svelte.d.ts +28 -19
- package/dist/buttons/BaseButton.svelte +90 -52
- package/dist/buttons/BaseButton.svelte.d.ts +33 -31
- package/dist/buttons/ContinueButton.svelte +2 -1
- package/dist/buttons/ContinueButton.svelte.d.ts +18 -16
- package/dist/buttons/LoginButton.svelte +2 -1
- package/dist/buttons/LoginButton.svelte.d.ts +18 -16
- package/dist/buttons/UpdateProfileButton.svelte +2 -1
- package/dist/buttons/UpdateProfileButton.svelte.d.ts +18 -16
- package/dist/login-status/LoggedIn.svelte +5 -2
- package/dist/login-status/LoggedIn.svelte.d.ts +18 -16
- package/dist/login-status/LoggedOut.svelte +6 -3
- package/dist/login-status/LoggedOut.svelte.d.ts +18 -16
- package/package.json +15 -14
package/dist/Provider.svelte
CHANGED
|
@@ -1,23 +1,27 @@
|
|
|
1
|
-
<script context="module"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
1
|
+
<script context="module" lang="ts">
|
|
2
|
+
import type { Auth } from './auth.js'
|
|
3
|
+
import { setContext, getContext } from 'svelte'
|
|
4
|
+
|
|
5
|
+
export const routeConfig = {
|
|
6
|
+
login: '/api/hellocoop?login=true',
|
|
7
|
+
auth: '/api/hellocoop?auth=true',
|
|
8
|
+
logout: '/api/hellocoop?logout=true',
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const getHelloProviderContext = (): Auth | undefined => {
|
|
12
|
+
return getContext('HelloProviderContext')
|
|
13
|
+
}
|
|
10
14
|
</script>
|
|
11
15
|
|
|
12
|
-
<script
|
|
13
|
-
export let
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
if (config?.
|
|
20
|
-
|
|
16
|
+
<script lang="ts">
|
|
17
|
+
export let auth: any = {} //tbd: any
|
|
18
|
+
export let config: any = {} //tbd: any
|
|
19
|
+
|
|
20
|
+
setContext('HelloProviderContext', auth)
|
|
21
|
+
|
|
22
|
+
if (config?.login) routeConfig.login = config.login
|
|
23
|
+
if (config?.auth) routeConfig.auth = config.auth
|
|
24
|
+
if (config?.logout) routeConfig.logout = config.logout
|
|
21
25
|
</script>
|
|
22
26
|
|
|
23
27
|
<slot/>
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { Auth } from './auth.js';
|
|
3
2
|
export declare const routeConfig: {
|
|
4
3
|
login: string;
|
|
@@ -6,23 +5,33 @@ export declare const routeConfig: {
|
|
|
6
5
|
logout: string;
|
|
7
6
|
};
|
|
8
7
|
export declare const getHelloProviderContext: () => Auth | undefined;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
9
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
10
|
+
$$bindings?: Bindings;
|
|
11
|
+
} & Exports;
|
|
12
|
+
(internal: unknown, props: Props & {
|
|
13
|
+
$$events?: Events;
|
|
14
|
+
$$slots?: Slots;
|
|
15
|
+
}): Exports & {
|
|
16
|
+
$set?: any;
|
|
17
|
+
$on?: any;
|
|
13
18
|
};
|
|
14
|
-
|
|
15
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
};
|
|
17
|
-
slots: {
|
|
18
|
-
default: {};
|
|
19
|
-
};
|
|
20
|
-
exports?: {} | undefined;
|
|
21
|
-
bindings?: string | undefined;
|
|
22
|
-
};
|
|
23
|
-
export type ProviderProps = typeof __propDef.props;
|
|
24
|
-
export type ProviderEvents = typeof __propDef.events;
|
|
25
|
-
export type ProviderSlots = typeof __propDef.slots;
|
|
26
|
-
export default class Provider extends SvelteComponent<ProviderProps, ProviderEvents, ProviderSlots> {
|
|
19
|
+
z_$$bindings?: Bindings;
|
|
27
20
|
}
|
|
28
|
-
|
|
21
|
+
type $$__sveltets_2_PropsWithChildren<Props, Slots> = Props & (Slots extends {
|
|
22
|
+
default: any;
|
|
23
|
+
} ? Props extends Record<string, never> ? any : {
|
|
24
|
+
children?: any;
|
|
25
|
+
} : {});
|
|
26
|
+
declare const Provider: $$__sveltets_2_IsomorphicComponent<$$__sveltets_2_PropsWithChildren<{
|
|
27
|
+
auth?: any;
|
|
28
|
+
config?: any;
|
|
29
|
+
}, {
|
|
30
|
+
default: {};
|
|
31
|
+
}>, {
|
|
32
|
+
[evt: string]: CustomEvent<any>;
|
|
33
|
+
}, {
|
|
34
|
+
default: {};
|
|
35
|
+
}, {}, string>;
|
|
36
|
+
type Provider = InstanceType<typeof Provider>;
|
|
37
|
+
export default Provider;
|
|
@@ -1,56 +1,94 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { routeConfig } from "../Provider.svelte"
|
|
3
|
+
import type { ProviderHint, Scope } from '@hellocoop/definitions'
|
|
4
|
+
import { onMount } from "svelte"
|
|
5
|
+
import { Button } from "../types.js" // tbd use @hellocoop/definitions (currently, some esm import errors)
|
|
6
|
+
|
|
7
|
+
interface $$Props {
|
|
8
|
+
label?: string
|
|
9
|
+
style?: any
|
|
10
|
+
color?: Button.Color
|
|
11
|
+
theme?: Button.Theme
|
|
12
|
+
hover?: Button.Hover
|
|
13
|
+
scope?: Scope[]
|
|
14
|
+
update?: boolean
|
|
15
|
+
targetURI?: string
|
|
16
|
+
providerHint?: ProviderHint[],
|
|
17
|
+
showLoader?: boolean,
|
|
18
|
+
disabled?: boolean
|
|
19
|
+
promptLogin?: boolean,
|
|
20
|
+
promptConsent?: boolean,
|
|
21
|
+
loginHint?: string,
|
|
22
|
+
domainHint?: string
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// All prop exports must still be typed standalone and in the $$Props interface
|
|
26
|
+
export let label: string = "ō Continue with Hellō";
|
|
27
|
+
export let style: any = {} //TBD any
|
|
28
|
+
export let color: Button.Color = "black"
|
|
29
|
+
export let theme: Button.Theme = "ignore-light"
|
|
30
|
+
export let hover: Button.Hover = "pop"
|
|
31
|
+
export let scope: Scope[] = [];
|
|
32
|
+
// @ts-ignore tbd
|
|
33
|
+
export let update: Button.update = false;
|
|
34
|
+
export let targetURI: string = ""
|
|
35
|
+
export let providerHint: ProviderHint[] = [];
|
|
36
|
+
export let showLoader: boolean = false
|
|
37
|
+
export let disabled: boolean = false
|
|
38
|
+
export let promptLogin: boolean = false
|
|
39
|
+
export let promptConsent: boolean = false
|
|
40
|
+
export let loginHint: string = ""
|
|
41
|
+
export let domainHint: string = ""
|
|
42
|
+
|
|
43
|
+
let checkedForStylesheet: boolean = false
|
|
44
|
+
|
|
45
|
+
onMount(() => {
|
|
46
|
+
//check if dev has added Hellō stylesheet to pages with Hellō buttons
|
|
47
|
+
if(typeof window != 'undefined' && !checkedForStylesheet) {
|
|
48
|
+
const hasStylesheet = Array.from(document.head.getElementsByTagName('link')).find(
|
|
49
|
+
(element) =>
|
|
50
|
+
element.getAttribute('rel') === 'stylesheet' &&
|
|
51
|
+
element.getAttribute('href')?.startsWith(Button.STYLES_URL)
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
if(!hasStylesheet)
|
|
55
|
+
console.warn('Could not find Hellō stylesheet. Please add to pages with Hellō buttons. See http://hello.dev/docs/buttons/#stylesheet for more info.')
|
|
56
|
+
|
|
57
|
+
checkedForStylesheet = true
|
|
58
|
+
}
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
let clicked: boolean = false
|
|
62
|
+
const loginRoute = new URL(routeConfig.login, window.location.origin)
|
|
63
|
+
if(scope)
|
|
64
|
+
loginRoute.searchParams.set("scope", scope.join(" "))
|
|
65
|
+
|
|
66
|
+
loginRoute.searchParams.set("target_uri", targetURI || window.location.pathname)
|
|
67
|
+
|
|
68
|
+
if(update)
|
|
69
|
+
loginRoute.searchParams.set("prompt", "consent")
|
|
70
|
+
|
|
71
|
+
if (promptLogin && promptConsent) {
|
|
72
|
+
loginRoute.searchParams.set("prompt", "login consent")
|
|
73
|
+
} else if (promptLogin) {
|
|
74
|
+
loginRoute.searchParams.set("prompt", "login")
|
|
75
|
+
} else if (promptConsent) {
|
|
76
|
+
loginRoute.searchParams.set("prompt", "consent")
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (loginHint)
|
|
80
|
+
loginRoute.searchParams.set("login_hint", loginHint)
|
|
81
|
+
|
|
82
|
+
if (domainHint)
|
|
83
|
+
loginRoute.searchParams.set("login_hint", domainHint)
|
|
84
|
+
|
|
85
|
+
if(providerHint)
|
|
86
|
+
loginRoute.searchParams.set("provider_hint", providerHint.join(" "))
|
|
87
|
+
|
|
88
|
+
const onClickHandler = (): void => {
|
|
89
|
+
clicked = true
|
|
90
|
+
window.location.href = loginRoute.href
|
|
28
91
|
}
|
|
29
|
-
});
|
|
30
|
-
let clicked = false;
|
|
31
|
-
const loginRoute = new URL(routeConfig.login, window.location.origin);
|
|
32
|
-
if (scope)
|
|
33
|
-
loginRoute.searchParams.set("scope", scope.join(" "));
|
|
34
|
-
loginRoute.searchParams.set("target_uri", targetURI || window.location.pathname);
|
|
35
|
-
if (update)
|
|
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 (domainHint)
|
|
47
|
-
loginRoute.searchParams.set("login_hint", domainHint);
|
|
48
|
-
if (providerHint)
|
|
49
|
-
loginRoute.searchParams.set("provider_hint", providerHint.join(" "));
|
|
50
|
-
const onClickHandler = () => {
|
|
51
|
-
clicked = true;
|
|
52
|
-
window.location.href = loginRoute.href;
|
|
53
|
-
};
|
|
54
92
|
</script>
|
|
55
93
|
|
|
56
94
|
<button
|
|
@@ -1,34 +1,36 @@
|
|
|
1
|
-
import { SvelteComponent } from "svelte";
|
|
2
1
|
import type { ProviderHint, Scope } from '@hellocoop/definitions';
|
|
3
|
-
import { Button } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
providerHint?: ProviderHint[];
|
|
15
|
-
showLoader?: boolean;
|
|
16
|
-
disabled?: boolean;
|
|
17
|
-
promptLogin?: boolean;
|
|
18
|
-
promptConsent?: boolean;
|
|
19
|
-
loginHint?: string;
|
|
20
|
-
domainHint?: string;
|
|
2
|
+
import { Button } from "../types.js";
|
|
3
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
4
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
5
|
+
$$bindings?: Bindings;
|
|
6
|
+
} & Exports;
|
|
7
|
+
(internal: unknown, props: Props & {
|
|
8
|
+
$$events?: Events;
|
|
9
|
+
$$slots?: Slots;
|
|
10
|
+
}): Exports & {
|
|
11
|
+
$set?: any;
|
|
12
|
+
$on?: any;
|
|
21
13
|
};
|
|
22
|
-
|
|
23
|
-
[evt: string]: CustomEvent<any>;
|
|
24
|
-
};
|
|
25
|
-
slots: {};
|
|
26
|
-
exports?: {} | undefined;
|
|
27
|
-
bindings?: string | undefined;
|
|
28
|
-
};
|
|
29
|
-
export type BaseButtonProps = typeof __propDef.props;
|
|
30
|
-
export type BaseButtonEvents = typeof __propDef.events;
|
|
31
|
-
export type BaseButtonSlots = typeof __propDef.slots;
|
|
32
|
-
export default class BaseButton extends SvelteComponent<BaseButtonProps, BaseButtonEvents, BaseButtonSlots> {
|
|
14
|
+
z_$$bindings?: Bindings;
|
|
33
15
|
}
|
|
34
|
-
|
|
16
|
+
declare const BaseButton: $$__sveltets_2_IsomorphicComponent<{
|
|
17
|
+
label?: string;
|
|
18
|
+
style?: any;
|
|
19
|
+
color?: Button.Color;
|
|
20
|
+
theme?: Button.Theme;
|
|
21
|
+
hover?: Button.Hover;
|
|
22
|
+
scope?: Scope[];
|
|
23
|
+
update?: boolean;
|
|
24
|
+
targetURI?: string;
|
|
25
|
+
providerHint?: ProviderHint[];
|
|
26
|
+
showLoader?: boolean;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
promptLogin?: boolean;
|
|
29
|
+
promptConsent?: boolean;
|
|
30
|
+
loginHint?: string;
|
|
31
|
+
domainHint?: string;
|
|
32
|
+
}, {
|
|
33
|
+
[evt: string]: CustomEvent<any>;
|
|
34
|
+
}, {}, {}, string>;
|
|
35
|
+
type BaseButton = InstanceType<typeof BaseButton>;
|
|
36
|
+
export default BaseButton;
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
5
11
|
};
|
|
6
|
-
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
};
|
|
9
|
-
slots: {};
|
|
10
|
-
exports?: undefined;
|
|
11
|
-
bindings?: undefined;
|
|
12
|
-
};
|
|
13
|
-
export type ContinueButtonProps = typeof __propDef.props;
|
|
14
|
-
export type ContinueButtonEvents = typeof __propDef.events;
|
|
15
|
-
export type ContinueButtonSlots = typeof __propDef.slots;
|
|
16
|
-
export default class ContinueButton extends SvelteComponent<ContinueButtonProps, ContinueButtonEvents, ContinueButtonSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
17
13
|
}
|
|
18
|
-
|
|
14
|
+
declare const ContinueButton: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
[x: string]: any;
|
|
16
|
+
}, {
|
|
17
|
+
[evt: string]: CustomEvent<any>;
|
|
18
|
+
}, {}, {}, string>;
|
|
19
|
+
type ContinueButton = InstanceType<typeof ContinueButton>;
|
|
20
|
+
export default ContinueButton;
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
5
11
|
};
|
|
6
|
-
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
};
|
|
9
|
-
slots: {};
|
|
10
|
-
exports?: undefined;
|
|
11
|
-
bindings?: undefined;
|
|
12
|
-
};
|
|
13
|
-
export type LoginButtonProps = typeof __propDef.props;
|
|
14
|
-
export type LoginButtonEvents = typeof __propDef.events;
|
|
15
|
-
export type LoginButtonSlots = typeof __propDef.slots;
|
|
16
|
-
export default class LoginButton extends SvelteComponent<LoginButtonProps, LoginButtonEvents, LoginButtonSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
17
13
|
}
|
|
18
|
-
|
|
14
|
+
declare const LoginButton: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
[x: string]: any;
|
|
16
|
+
}, {
|
|
17
|
+
[evt: string]: CustomEvent<any>;
|
|
18
|
+
}, {}, {}, string>;
|
|
19
|
+
type LoginButton = InstanceType<typeof LoginButton>;
|
|
20
|
+
export default LoginButton;
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
5
11
|
};
|
|
6
|
-
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
};
|
|
9
|
-
slots: {};
|
|
10
|
-
exports?: undefined;
|
|
11
|
-
bindings?: undefined;
|
|
12
|
-
};
|
|
13
|
-
export type UpdateProfileButtonProps = typeof __propDef.props;
|
|
14
|
-
export type UpdateProfileButtonEvents = typeof __propDef.events;
|
|
15
|
-
export type UpdateProfileButtonSlots = typeof __propDef.slots;
|
|
16
|
-
export default class UpdateProfileButton extends SvelteComponent<UpdateProfileButtonProps, UpdateProfileButtonEvents, UpdateProfileButtonSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
17
13
|
}
|
|
18
|
-
|
|
14
|
+
declare const UpdateProfileButton: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
[x: string]: any;
|
|
16
|
+
}, {
|
|
17
|
+
[evt: string]: CustomEvent<any>;
|
|
18
|
+
}, {}, {}, string>;
|
|
19
|
+
type UpdateProfileButton = InstanceType<typeof UpdateProfileButton>;
|
|
20
|
+
export default UpdateProfileButton;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { useAuth } from "../auth.js"
|
|
3
|
+
import type { Readable } from "svelte/store"
|
|
4
|
+
|
|
5
|
+
const isLoggedIn = (): Readable<boolean> | boolean => useAuth()?.isLoggedIn || false
|
|
3
6
|
</script>
|
|
4
7
|
|
|
5
8
|
{#if isLoggedIn()}
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
6
11
|
};
|
|
7
|
-
|
|
8
|
-
default: {};
|
|
9
|
-
};
|
|
10
|
-
exports?: {} | undefined;
|
|
11
|
-
bindings?: string | undefined;
|
|
12
|
-
};
|
|
13
|
-
export type LoggedInProps = typeof __propDef.props;
|
|
14
|
-
export type LoggedInEvents = typeof __propDef.events;
|
|
15
|
-
export type LoggedInSlots = typeof __propDef.slots;
|
|
16
|
-
export default class LoggedIn extends SvelteComponent<LoggedInProps, LoggedInEvents, LoggedInSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
17
13
|
}
|
|
18
|
-
|
|
14
|
+
declare const LoggedIn: $$__sveltets_2_IsomorphicComponent<any, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {
|
|
17
|
+
default: {};
|
|
18
|
+
}, {}, string>;
|
|
19
|
+
type LoggedIn = InstanceType<typeof LoggedIn>;
|
|
20
|
+
export default LoggedIn;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { useAuth } from "../auth.js"
|
|
3
|
+
import type { Readable } from "svelte/store"
|
|
4
|
+
|
|
5
|
+
const isLoggedIn = (): Readable<boolean> | boolean => useAuth()?.isLoggedIn || false
|
|
6
|
+
</script>
|
|
4
7
|
|
|
5
8
|
{#if !isLoggedIn()}
|
|
6
9
|
<slot/>
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
6
11
|
};
|
|
7
|
-
|
|
8
|
-
default: {};
|
|
9
|
-
};
|
|
10
|
-
exports?: {} | undefined;
|
|
11
|
-
bindings?: string | undefined;
|
|
12
|
-
};
|
|
13
|
-
export type LoggedOutProps = typeof __propDef.props;
|
|
14
|
-
export type LoggedOutEvents = typeof __propDef.events;
|
|
15
|
-
export type LoggedOutSlots = typeof __propDef.slots;
|
|
16
|
-
export default class LoggedOut extends SvelteComponent<LoggedOutProps, LoggedOutEvents, LoggedOutSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
17
13
|
}
|
|
18
|
-
|
|
14
|
+
declare const LoggedOut: $$__sveltets_2_IsomorphicComponent<any, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {
|
|
17
|
+
default: {};
|
|
18
|
+
}, {}, string>;
|
|
19
|
+
type LoggedOut = InstanceType<typeof LoggedOut>;
|
|
20
|
+
export default LoggedOut;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hellocoop/svelte",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.7",
|
|
4
4
|
"description": "Svelte SDK for Hellō https://hello.dev",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -44,22 +44,23 @@
|
|
|
44
44
|
"svelte": "^4.0.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@sveltejs/adapter-auto": "^
|
|
48
|
-
"@sveltejs/kit": "^
|
|
49
|
-
"@sveltejs/package": "^2.
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"svelte
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
47
|
+
"@sveltejs/adapter-auto": "^3.3.1",
|
|
48
|
+
"@sveltejs/kit": "^2.9.1",
|
|
49
|
+
"@sveltejs/package": "^2.3.7",
|
|
50
|
+
"@sveltejs/vite-plugin-svelte": "^5.0.1",
|
|
51
|
+
"publint": "^0.2.12",
|
|
52
|
+
"svelte": "^5.10.0",
|
|
53
|
+
"svelte-check": "^4.1.1",
|
|
54
|
+
"tslib": "^2.8.1",
|
|
55
|
+
"typescript": "^5.7.2",
|
|
56
|
+
"vite": "^6.0.3"
|
|
56
57
|
},
|
|
57
58
|
"svelte": "./dist/index.js",
|
|
58
59
|
"types": "./dist/index.d.ts",
|
|
59
60
|
"type": "module",
|
|
61
|
+
"gitHead": "8e7b54124db48051b9e03031399e4df1b6e41a4e",
|
|
60
62
|
"dependencies": {
|
|
61
|
-
"@hellocoop/definitions": "^1.0.
|
|
62
|
-
"sswr": "^2.
|
|
63
|
-
}
|
|
64
|
-
"gitHead": "96cc2f3fa1a3724a4a96b19cc7c5d97f04cc49f8"
|
|
63
|
+
"@hellocoop/definitions": "^1.0.9",
|
|
64
|
+
"sswr": "^2.1.0"
|
|
65
|
+
}
|
|
65
66
|
}
|