@hellocoop/svelte 1.0.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.
Files changed (36) hide show
  1. package/README.md +58 -0
  2. package/dist/Provider.svelte +27 -0
  3. package/dist/Provider.svelte.d.ts +26 -0
  4. package/dist/auth.d.ts +21 -0
  5. package/dist/auth.js +26 -0
  6. package/dist/buttons/BaseButton.svelte +59 -0
  7. package/dist/buttons/BaseButton.svelte.d.ts +27 -0
  8. package/dist/buttons/ContinueButton.svelte +5 -0
  9. package/dist/buttons/ContinueButton.svelte.d.ts +16 -0
  10. package/dist/buttons/LoginButton.svelte +5 -0
  11. package/dist/buttons/LoginButton.svelte.d.ts +16 -0
  12. package/dist/buttons/UpdateDiscordButton.svelte +5 -0
  13. package/dist/buttons/UpdateDiscordButton.svelte.d.ts +16 -0
  14. package/dist/buttons/UpdateEmailButton.svelte +5 -0
  15. package/dist/buttons/UpdateEmailButton.svelte.d.ts +16 -0
  16. package/dist/buttons/UpdateGitHubButton.svelte +5 -0
  17. package/dist/buttons/UpdateGitHubButton.svelte.d.ts +16 -0
  18. package/dist/buttons/UpdateGitLabButton.svelte +5 -0
  19. package/dist/buttons/UpdateGitLabButton.svelte.d.ts +16 -0
  20. package/dist/buttons/UpdatePictureButton.svelte +5 -0
  21. package/dist/buttons/UpdatePictureButton.svelte.d.ts +16 -0
  22. package/dist/buttons/UpdateTwitterButton.svelte +5 -0
  23. package/dist/buttons/UpdateTwitterButton.svelte.d.ts +16 -0
  24. package/dist/buttons/index.d.ts +8 -0
  25. package/dist/buttons/index.js +9 -0
  26. package/dist/index.d.ts +5 -0
  27. package/dist/index.js +6 -0
  28. package/dist/login-status/LoggedIn.svelte +10 -0
  29. package/dist/login-status/LoggedIn.svelte.d.ts +16 -0
  30. package/dist/login-status/LoggedOut.svelte +10 -0
  31. package/dist/login-status/LoggedOut.svelte.d.ts +16 -0
  32. package/dist/login-status/index.d.ts +2 -0
  33. package/dist/login-status/index.js +3 -0
  34. package/dist/logout.d.ts +2 -0
  35. package/dist/logout.js +6 -0
  36. package/package.json +62 -0
package/README.md ADDED
@@ -0,0 +1,58 @@
1
+ # create-svelte
2
+
3
+ Everything you need to build a Svelte library, powered by [`create-svelte`](https://github.com/sveltejs/kit/tree/master/packages/create-svelte).
4
+
5
+ Read more about creating a library [in the docs](https://kit.svelte.dev/docs/packaging).
6
+
7
+ ## Creating a project
8
+
9
+ If you're seeing this, you've probably already done this step. Congrats!
10
+
11
+ ```bash
12
+ # create a new project in the current directory
13
+ npm create svelte@latest
14
+
15
+ # create a new project in my-app
16
+ npm create svelte@latest my-app
17
+ ```
18
+
19
+ ## Developing
20
+
21
+ Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
22
+
23
+ ```bash
24
+ npm run dev
25
+
26
+ # or start the server and open the app in a new browser tab
27
+ npm run dev -- --open
28
+ ```
29
+
30
+ Everything inside `src/lib` is part of your library, everything inside `src/routes` can be used as a showcase or preview app.
31
+
32
+ ## Building
33
+
34
+ To build your library:
35
+
36
+ ```bash
37
+ npm run package
38
+ ```
39
+
40
+ To create a production version of your showcase app:
41
+
42
+ ```bash
43
+ npm run build
44
+ ```
45
+
46
+ You can preview the production build with `npm run preview`.
47
+
48
+ > To deploy your app, you may need to install an [adapter](https://kit.svelte.dev/docs/adapters) for your target environment.
49
+
50
+ ## Publishing
51
+
52
+ Go into the `package.json` and give your package the desired name through the `"name"` option. Also consider adding a `"license"` field and point it to a `LICENSE` file which you can create from a template (one popular option is the [MIT license](https://opensource.org/license/mit/)).
53
+
54
+ To publish your library to [npm](https://www.npmjs.com):
55
+
56
+ ```bash
57
+ npm publish
58
+ ```
@@ -0,0 +1,27 @@
1
+ <script context="module" lang="ts">
2
+ import { type Auth } from './auth'
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
+ }
14
+ </script>
15
+
16
+ <script>
17
+ export let auth = {}
18
+ export let config = {}
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
25
+ </script>
26
+
27
+ <slot/>
@@ -0,0 +1,26 @@
1
+ import { SvelteComponent } from "svelte";
2
+ import { type Auth } from './auth';
3
+ export declare const routeConfig: {
4
+ login: string;
5
+ auth: string;
6
+ logout: string;
7
+ };
8
+ export declare const getHelloProviderContext: () => Auth | undefined;
9
+ declare const __propDef: {
10
+ props: {
11
+ auth?: {} | undefined;
12
+ config?: {} | undefined;
13
+ };
14
+ events: {
15
+ [evt: string]: CustomEvent<any>;
16
+ };
17
+ slots: {
18
+ default: {};
19
+ };
20
+ };
21
+ export type ProviderProps = typeof __propDef.props;
22
+ export type ProviderEvents = typeof __propDef.events;
23
+ export type ProviderSlots = typeof __propDef.slots;
24
+ export default class Provider extends SvelteComponent<ProviderProps, ProviderEvents, ProviderSlots> {
25
+ }
26
+ export {};
package/dist/auth.d.ts ADDED
@@ -0,0 +1,21 @@
1
+ /// <reference types="svelte" />
2
+ import type { Readable } from 'svelte/store';
3
+ import type { Claims } from '@hellocoop/types';
4
+ type AuthCookie = {
5
+ sub: string;
6
+ iat: number;
7
+ } & Claims & {
8
+ [key: string]: any;
9
+ };
10
+ export type Auth = {
11
+ isLoggedIn: false;
12
+ } | ({
13
+ isLoggedIn: true;
14
+ } & AuthCookie);
15
+ export type AuthState = {
16
+ auth: Auth | {};
17
+ isLoading: Readable<boolean>;
18
+ isLoggedIn: Readable<boolean> | undefined;
19
+ };
20
+ export declare const useAuth: () => AuthState;
21
+ export {};
package/dist/auth.js ADDED
@@ -0,0 +1,26 @@
1
+ /// <reference types="svelte" />
2
+ import { useSWR } from "sswr";
3
+ import { getHelloProviderContext, routeConfig } from "./Provider.svelte";
4
+ const fetcher = async (url) => {
5
+ try {
6
+ const response = await fetch(url);
7
+ const auth = await response.json();
8
+ return auth;
9
+ }
10
+ catch (err) {
11
+ console.error(err);
12
+ return undefined;
13
+ }
14
+ };
15
+ export const useAuth = () => {
16
+ const defaultAuth = getHelloProviderContext();
17
+ const { data: auth, isLoading } = useSWR(routeConfig.auth, {
18
+ fetcher,
19
+ initialData: defaultAuth
20
+ });
21
+ return {
22
+ auth: auth || {},
23
+ isLoading,
24
+ isLoggedIn: auth?.isLoggedIn
25
+ };
26
+ };
@@ -0,0 +1,59 @@
1
+ <script lang="ts">
2
+ import { routeConfig } from "../Provder.svelte"
3
+ import { Button, type ProviderHint, type Scope } from '@hellocoop/types'
4
+
5
+ interface $$Props {
6
+ label?: string
7
+ style?: any
8
+ color?: Button.Color
9
+ theme?: Button.Theme
10
+ hover?: Button.Hover
11
+ scope?: Scope[]
12
+ updateScope?: Button.UpdateScope
13
+ targetURI?: string
14
+ providerHint?: ProviderHint[],
15
+ showLoader?: boolean,
16
+ disabled?: boolean
17
+ }
18
+
19
+ // All prop exports must still be typed standalone and in the $$Props interface
20
+ export let label: string = "ō&nbsp;&nbsp;&nbsp;Continue with Hellō";
21
+ export let style: any = {} //TBD any
22
+ export let color: Button.Color = "black"
23
+ export let theme: Button.Theme = "ignore-light"
24
+ export let hover: Button.Hover = "pop"
25
+ export let scope: Scope[];
26
+ export let updateScope: Button.UpdateScope;
27
+ export let targetURI: string = ""
28
+ export let providerHint: ProviderHint[];
29
+ export let showLoader: boolean = false
30
+ export let disabled: boolean = false
31
+
32
+ let clicked: boolean = false
33
+ const loginRoute = new URL(routeConfig.login, window.location.origin)
34
+ if(scope)
35
+ loginRoute.searchParams.set("scope", scope.join(" "))
36
+
37
+ loginRoute.searchParams.set("target_uri", targetURI || window.location.pathname)
38
+
39
+ if(updateScope)
40
+ loginRoute.searchParams.set("scope", "profile_update " + updateScope)
41
+
42
+ if(providerHint)
43
+ loginRoute.searchParams.set("provider_hint", providerHint.join(" "))
44
+
45
+ const onClickHandler = (): void => {
46
+ clicked = true
47
+ window.location.href = loginRoute.href
48
+ }
49
+ </script>
50
+
51
+ <button
52
+ on:click={onClickHandler}
53
+ class="hello-btn {Button.CLASS_MAPPING[color]?.[theme]} {Button.HOVER_MAPPING[hover]}"
54
+ class:hello-btn-loader={showLoader || clicked}
55
+ disabled={disabled || clicked}
56
+ {style}
57
+ >
58
+ {@html label}
59
+ </button>
@@ -0,0 +1,27 @@
1
+ import { SvelteComponent } from "svelte";
2
+ import { Button } from '@hellocoop/types';
3
+ declare const __propDef: {
4
+ props: {
5
+ label?: string | undefined;
6
+ style?: any;
7
+ color?: Button.Color | undefined;
8
+ theme?: Button.Theme | undefined;
9
+ hover?: Button.Hover | undefined;
10
+ scope?: ("name" | "nickname" | "preferred_username" | "given_name" | "family_name" | "email" | "phone" | "picture" | "ethereum" | "discord" | "twitter" | "github" | "gitlab" | "openid" | "profile_update")[] | undefined;
11
+ updateScope?: Button.UpdateScope | undefined;
12
+ targetURI?: string | undefined;
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;
14
+ showLoader?: boolean | undefined;
15
+ disabled?: boolean | undefined;
16
+ };
17
+ events: {
18
+ [evt: string]: CustomEvent<any>;
19
+ };
20
+ slots: {};
21
+ };
22
+ export type BaseButtonProps = typeof __propDef.props;
23
+ export type BaseButtonEvents = typeof __propDef.events;
24
+ export type BaseButtonSlots = typeof __propDef.slots;
25
+ export default class BaseButton extends SvelteComponent<BaseButtonProps, BaseButtonEvents, BaseButtonSlots> {
26
+ }
27
+ export {};
@@ -0,0 +1,5 @@
1
+ <script lang="ts">
2
+ import BaseButton from "./BaseButton.svelte";
3
+ </script>
4
+
5
+ <BaseButton {...$$props}/>
@@ -0,0 +1,16 @@
1
+ import { SvelteComponent } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ };
6
+ events: {
7
+ [evt: string]: CustomEvent<any>;
8
+ };
9
+ slots: {};
10
+ };
11
+ export type ContinueButtonProps = typeof __propDef.props;
12
+ export type ContinueButtonEvents = typeof __propDef.events;
13
+ export type ContinueButtonSlots = typeof __propDef.slots;
14
+ export default class ContinueButton extends SvelteComponent<ContinueButtonProps, ContinueButtonEvents, ContinueButtonSlots> {
15
+ }
16
+ export {};
@@ -0,0 +1,5 @@
1
+ <script lang="ts">
2
+ import BaseButton from "./BaseButton.svelte";
3
+ </script>
4
+
5
+ <BaseButton label="ō&nbsp;&nbsp;&nbsp;Login with Hellō" {...$$props} />
@@ -0,0 +1,16 @@
1
+ import { SvelteComponent } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ };
6
+ events: {
7
+ [evt: string]: CustomEvent<any>;
8
+ };
9
+ slots: {};
10
+ };
11
+ export type LoginButtonProps = typeof __propDef.props;
12
+ export type LoginButtonEvents = typeof __propDef.events;
13
+ export type LoginButtonSlots = typeof __propDef.slots;
14
+ export default class LoginButton extends SvelteComponent<LoginButtonProps, LoginButtonEvents, LoginButtonSlots> {
15
+ }
16
+ export {};
@@ -0,0 +1,5 @@
1
+ <script lang="ts">
2
+ import BaseButton from "./BaseButton.svelte";
3
+ </script>
4
+
5
+ <BaseButton label="ō&nbsp;&nbsp;&nbsp;Update Discord with Hellō" {...$$props} updateScope="discord" />
@@ -0,0 +1,16 @@
1
+ import { SvelteComponent } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ };
6
+ events: {
7
+ [evt: string]: CustomEvent<any>;
8
+ };
9
+ slots: {};
10
+ };
11
+ export type UpdateDiscordButtonProps = typeof __propDef.props;
12
+ export type UpdateDiscordButtonEvents = typeof __propDef.events;
13
+ export type UpdateDiscordButtonSlots = typeof __propDef.slots;
14
+ export default class UpdateDiscordButton extends SvelteComponent<UpdateDiscordButtonProps, UpdateDiscordButtonEvents, UpdateDiscordButtonSlots> {
15
+ }
16
+ export {};
@@ -0,0 +1,5 @@
1
+ <script lang="ts">
2
+ import BaseButton from "./BaseButton.svelte";
3
+ </script>
4
+
5
+ <BaseButton label="ō&nbsp;&nbsp;&nbsp;Update Email with Hellō" {...$$props} updateScope="email" />
@@ -0,0 +1,16 @@
1
+ import { SvelteComponent } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ };
6
+ events: {
7
+ [evt: string]: CustomEvent<any>;
8
+ };
9
+ slots: {};
10
+ };
11
+ export type UpdateEmailButtonProps = typeof __propDef.props;
12
+ export type UpdateEmailButtonEvents = typeof __propDef.events;
13
+ export type UpdateEmailButtonSlots = typeof __propDef.slots;
14
+ export default class UpdateEmailButton extends SvelteComponent<UpdateEmailButtonProps, UpdateEmailButtonEvents, UpdateEmailButtonSlots> {
15
+ }
16
+ export {};
@@ -0,0 +1,5 @@
1
+ <script lang="ts">
2
+ import BaseButton from "./BaseButton.svelte";
3
+ </script>
4
+
5
+ <BaseButton label="ō&nbsp;&nbsp;&nbsp;Update GitHub with Hellō" {...$$props} updateScope="github" />
@@ -0,0 +1,16 @@
1
+ import { SvelteComponent } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ };
6
+ events: {
7
+ [evt: string]: CustomEvent<any>;
8
+ };
9
+ slots: {};
10
+ };
11
+ export type UpdateGitHubButtonProps = typeof __propDef.props;
12
+ export type UpdateGitHubButtonEvents = typeof __propDef.events;
13
+ export type UpdateGitHubButtonSlots = typeof __propDef.slots;
14
+ export default class UpdateGitHubButton extends SvelteComponent<UpdateGitHubButtonProps, UpdateGitHubButtonEvents, UpdateGitHubButtonSlots> {
15
+ }
16
+ export {};
@@ -0,0 +1,5 @@
1
+ <script lang="ts">
2
+ import BaseButton from "./BaseButton.svelte";
3
+ </script>
4
+
5
+ <BaseButton label="ō&nbsp;&nbsp;&nbsp;Update GitLab with Hellō" {...$$props} updateScope="gitlab" />
@@ -0,0 +1,16 @@
1
+ import { SvelteComponent } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ };
6
+ events: {
7
+ [evt: string]: CustomEvent<any>;
8
+ };
9
+ slots: {};
10
+ };
11
+ export type UpdateGitLabButtonProps = typeof __propDef.props;
12
+ export type UpdateGitLabButtonEvents = typeof __propDef.events;
13
+ export type UpdateGitLabButtonSlots = typeof __propDef.slots;
14
+ export default class UpdateGitLabButton extends SvelteComponent<UpdateGitLabButtonProps, UpdateGitLabButtonEvents, UpdateGitLabButtonSlots> {
15
+ }
16
+ export {};
@@ -0,0 +1,5 @@
1
+ <script lang="ts">
2
+ import BaseButton from "./BaseButton.svelte";
3
+ </script>
4
+
5
+ <BaseButton label="ō&nbsp;&nbsp;&nbsp;Update Picture with Hellō" {...$$props} updateScope="picture" />
@@ -0,0 +1,16 @@
1
+ import { SvelteComponent } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ };
6
+ events: {
7
+ [evt: string]: CustomEvent<any>;
8
+ };
9
+ slots: {};
10
+ };
11
+ export type UpdatePictureButtonProps = typeof __propDef.props;
12
+ export type UpdatePictureButtonEvents = typeof __propDef.events;
13
+ export type UpdatePictureButtonSlots = typeof __propDef.slots;
14
+ export default class UpdatePictureButton extends SvelteComponent<UpdatePictureButtonProps, UpdatePictureButtonEvents, UpdatePictureButtonSlots> {
15
+ }
16
+ export {};
@@ -0,0 +1,5 @@
1
+ <script lang="ts">
2
+ import BaseButton from "./BaseButton.svelte";
3
+ </script>
4
+
5
+ <BaseButton label="ō&nbsp;&nbsp;&nbsp;Update Twitter with Hellō" {...$$props} updateScope="twitter" />
@@ -0,0 +1,16 @@
1
+ import { SvelteComponent } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ };
6
+ events: {
7
+ [evt: string]: CustomEvent<any>;
8
+ };
9
+ slots: {};
10
+ };
11
+ export type UpdateTwitterButtonProps = typeof __propDef.props;
12
+ export type UpdateTwitterButtonEvents = typeof __propDef.events;
13
+ export type UpdateTwitterButtonSlots = typeof __propDef.slots;
14
+ export default class UpdateTwitterButton extends SvelteComponent<UpdateTwitterButtonProps, UpdateTwitterButtonEvents, UpdateTwitterButtonSlots> {
15
+ }
16
+ export {};
@@ -0,0 +1,8 @@
1
+ export { default as ContinueButton } from './ContinueButton.svelte';
2
+ export { default as LoginButton } from './LoginButton.svelte';
3
+ export { default as UpdateEmailButton } from './UpdateEmailButton.svelte';
4
+ export { default as UpdatePictureButton } from './UpdatePictureButton.svelte';
5
+ export { default as UpdateTwitterButton } from './UpdateTwitterButton.svelte';
6
+ export { default as UpdateDiscordButton } from './UpdateDiscordButton.svelte';
7
+ export { default as UpdateGitHubButton } from './UpdateGitHubButton.svelte';
8
+ export { default as UpdateGitLabButton } from './UpdateGitLabButton.svelte';
@@ -0,0 +1,9 @@
1
+ /// <reference types="svelte" />
2
+ export { default as ContinueButton } from './ContinueButton.svelte';
3
+ export { default as LoginButton } from './LoginButton.svelte';
4
+ export { default as UpdateEmailButton } from './UpdateEmailButton.svelte';
5
+ export { default as UpdatePictureButton } from './UpdatePictureButton.svelte';
6
+ export { default as UpdateTwitterButton } from './UpdateTwitterButton.svelte';
7
+ export { default as UpdateDiscordButton } from './UpdateDiscordButton.svelte';
8
+ export { default as UpdateGitHubButton } from './UpdateGitHubButton.svelte';
9
+ export { default as UpdateGitLabButton } from './UpdateGitLabButton.svelte';
@@ -0,0 +1,5 @@
1
+ export * from '/buttons/';
2
+ export * from '/login-status/';
3
+ export * from '/auth.ts';
4
+ export * from '/logout.ts';
5
+ export * from '/Provider.svelte';
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ /// <reference types="svelte" />
2
+ export * from '/buttons/';
3
+ export * from '/login-status/';
4
+ export * from '/auth.ts';
5
+ export * from '/logout.ts';
6
+ export * from '/Provider.svelte';
@@ -0,0 +1,10 @@
1
+ <script lang="ts">
2
+ import { useAuth } from "../auth"
3
+ import type { Readable } from "svelte/store"
4
+
5
+ const isLoggedIn = (): Readable<boolean> | boolean => useAuth()?.isLoggedIn || false
6
+ </script>
7
+
8
+ {#if isLoggedIn}
9
+ <slot/>
10
+ {/if}
@@ -0,0 +1,16 @@
1
+ import { SvelteComponent } from "svelte";
2
+ declare const __propDef: {
3
+ props: Record<string, never>;
4
+ events: {
5
+ [evt: string]: CustomEvent<any>;
6
+ };
7
+ slots: {
8
+ default: {};
9
+ };
10
+ };
11
+ export type LoggedInProps = typeof __propDef.props;
12
+ export type LoggedInEvents = typeof __propDef.events;
13
+ export type LoggedInSlots = typeof __propDef.slots;
14
+ export default class LoggedIn extends SvelteComponent<LoggedInProps, LoggedInEvents, LoggedInSlots> {
15
+ }
16
+ export {};
@@ -0,0 +1,10 @@
1
+ <script lang="ts">
2
+ import { useAuth } from "../auth"
3
+ import type { Readable } from "svelte/store"
4
+
5
+ const isLoggedIn = (): Readable<boolean> | boolean => useAuth()?.isLoggedIn || false
6
+ </script>
7
+
8
+ {#if !isLoggedIn}
9
+ <slot/>
10
+ {/if}
@@ -0,0 +1,16 @@
1
+ import { SvelteComponent } from "svelte";
2
+ declare const __propDef: {
3
+ props: Record<string, never>;
4
+ events: {
5
+ [evt: string]: CustomEvent<any>;
6
+ };
7
+ slots: {
8
+ default: {};
9
+ };
10
+ };
11
+ export type LoggedOutProps = typeof __propDef.props;
12
+ export type LoggedOutEvents = typeof __propDef.events;
13
+ export type LoggedOutSlots = typeof __propDef.slots;
14
+ export default class LoggedOut extends SvelteComponent<LoggedOutProps, LoggedOutEvents, LoggedOutSlots> {
15
+ }
16
+ export {};
@@ -0,0 +1,2 @@
1
+ export { default as LoggedIn } from '/LoggedIn.svelte';
2
+ export { default as LoggedOut } from '/LoggedOut.svelte';
@@ -0,0 +1,3 @@
1
+ /// <reference types="svelte" />
2
+ export { default as LoggedIn } from '/LoggedIn.svelte';
3
+ export { default as LoggedOut } from '/LoggedOut.svelte';
@@ -0,0 +1,2 @@
1
+ export declare const getLogOutRoute: () => string;
2
+ export declare function logOut(): void;
package/dist/logout.js ADDED
@@ -0,0 +1,6 @@
1
+ /// <reference types="svelte" />
2
+ import { routeConfig } from './Provider.svelte';
3
+ export const getLogOutRoute = () => routeConfig.logout;
4
+ export function logOut() {
5
+ window.location.href = routeConfig.logout;
6
+ }
package/package.json ADDED
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "@hellocoop/svelte",
3
+ "version": "1.0.0",
4
+ "description": "Svelte SDK for Hellō https://hello.dev",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/hellocoop/packages.git"
8
+ },
9
+ "homepage": "https://www.hello.dev/docs/sdks/svelte",
10
+ "scripts": {
11
+ "build": "svelte-kit sync && svelte-package && publint"
12
+ },
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "svelte": "./dist/index.js"
17
+ }
18
+ },
19
+ "keywords": [
20
+ "reactjs",
21
+ "react",
22
+ "react.js",
23
+ "hello",
24
+ "openid",
25
+ "oidc",
26
+ "sso"
27
+ ],
28
+ "author": {
29
+ "name": "Hello Identity Co-op",
30
+ "email": "contact@hello.coop",
31
+ "url": "https://hello.coop"
32
+ },
33
+ "license": "MIT",
34
+ "bugs": {
35
+ "url": "https://github.com/hellocoop/packages/issues"
36
+ },
37
+ "files": [
38
+ "dist",
39
+ "!dist/**/*.test.*",
40
+ "!dist/**/*.spec.*"
41
+ ],
42
+ "peerDependencies": {
43
+ "svelte": "^4.0.0"
44
+ },
45
+ "devDependencies": {
46
+ "@sveltejs/adapter-auto": "^2.0.0",
47
+ "@sveltejs/kit": "^1.20.4",
48
+ "@sveltejs/package": "^2.0.0",
49
+ "publint": "^0.1.9",
50
+ "svelte": "^4.0.5",
51
+ "svelte-check": "^3.4.3",
52
+ "tslib": "^2.4.1",
53
+ "typescript": "^5.0.0",
54
+ "vite": "^4.4.2"
55
+ },
56
+ "svelte": "./dist/index.js",
57
+ "types": "./dist/index.d.ts",
58
+ "type": "module",
59
+ "dependencies": {
60
+ "sswr": "^2.0.0"
61
+ }
62
+ }