@zitadel/sdk-svelte 0.1.0-alpha.13 → 0.1.0-alpha.15
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/ZitadelSession.svelte.d.ts +8 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +45 -25
- package/package.json +4 -4
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import '@zitadel/components';
|
|
2
|
+
import type { ZitadelSession as ZitadelSessionElement } from '@zitadel/components';
|
|
3
|
+
import type { ZitadelSessionProps } from './types';
|
|
4
|
+
declare const ZitadelSession: import("svelte").Component<ZitadelSessionProps, {
|
|
5
|
+
getElement: () => ZitadelSessionElement | undefined;
|
|
6
|
+
}, "">;
|
|
7
|
+
type ZitadelSession = ReturnType<typeof ZitadelSession>;
|
|
8
|
+
export default ZitadelSession;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as ZitadelLogin } from "./ZitadelLogin.svelte";
|
|
2
2
|
export { default as ZitadelLogout } from "./ZitadelLogout.svelte";
|
|
3
|
+
export { default as ZitadelSession } from "./ZitadelSession.svelte";
|
|
3
4
|
export { configureZitadel, getApi, getZitadelConfig } from "@zitadel/api/config";
|
|
4
5
|
export type { ZitadelConfig, ZitadelProject } from "@zitadel/api/config";
|
|
5
6
|
export * from "./types";
|
package/dist/index.js
CHANGED
|
@@ -1,49 +1,69 @@
|
|
|
1
1
|
import "svelte/internal/disclose-version";
|
|
2
2
|
import * as e from "svelte/internal/client";
|
|
3
3
|
import "@zitadel/components";
|
|
4
|
-
import { configureZitadel as
|
|
4
|
+
import { configureZitadel as x, getApi as S, getZitadelConfig as y } from "@zitadel/api/config";
|
|
5
5
|
var f = e.from_html("<zitadel-login></zitadel-login>", 2);
|
|
6
|
-
function
|
|
6
|
+
function h(d, t) {
|
|
7
7
|
e.push(t, !0);
|
|
8
|
-
let
|
|
9
|
-
function
|
|
8
|
+
let l = e.prop(t, "purpose", 3, "login"), i = e.state(void 0);
|
|
9
|
+
function _() {
|
|
10
10
|
return e.get(i);
|
|
11
11
|
}
|
|
12
12
|
e.user_effect(() => {
|
|
13
|
-
const
|
|
14
|
-
if (!
|
|
13
|
+
const a = e.get(i);
|
|
14
|
+
if (!a)
|
|
15
15
|
return;
|
|
16
|
-
const
|
|
17
|
-
return
|
|
18
|
-
|
|
16
|
+
const s = (r) => t.onFlowStep?.(r.detail), u = (r) => t.onFlowInput?.(r.detail), m = (r) => t.onFlowComplete?.(r.detail), c = (r) => t.onFlowError?.(r.detail);
|
|
17
|
+
return a.addEventListener("zitadel-flow-step", s), a.addEventListener("zitadel-flow-input", u), a.addEventListener("zitadel-flow-complete", m), a.addEventListener("zitadel-flow-error", c), () => {
|
|
18
|
+
a.removeEventListener("zitadel-flow-step", s), a.removeEventListener("zitadel-flow-input", u), a.removeEventListener("zitadel-flow-complete", m), a.removeEventListener("zitadel-flow-error", c);
|
|
19
19
|
};
|
|
20
20
|
});
|
|
21
|
-
var
|
|
22
|
-
return e.template_effect(() => e.set_custom_element_data(
|
|
21
|
+
var n = { getElement: _ }, o = f();
|
|
22
|
+
return e.template_effect(() => e.set_custom_element_data(o, "project", t.project)), e.template_effect(() => e.set_custom_element_data(o, "purpose", l())), e.template_effect(() => e.set_custom_element_data(o, "project-id", t.projectId)), e.template_effect(() => e.set_custom_element_data(o, "proxy-path", t.proxyPath)), e.template_effect(() => e.set_custom_element_data(o, "post-sign-in-url", t.postSignInUrl)), e.bind_this(o, (a) => e.set(i, a), () => e.get(i)), e.append(d, o), e.pop(n);
|
|
23
23
|
}
|
|
24
24
|
var p = e.from_html("<zitadel-logout></zitadel-logout>", 2);
|
|
25
|
-
function E(
|
|
25
|
+
function E(d, t) {
|
|
26
26
|
e.push(t, !0);
|
|
27
|
-
let
|
|
27
|
+
let l = e.state(void 0);
|
|
28
28
|
function i() {
|
|
29
|
-
return e.get(
|
|
29
|
+
return e.get(l);
|
|
30
30
|
}
|
|
31
31
|
e.user_effect(() => {
|
|
32
|
-
const
|
|
33
|
-
if (!
|
|
32
|
+
const o = e.get(l);
|
|
33
|
+
if (!o)
|
|
34
|
+
return;
|
|
35
|
+
const a = (s) => t.onSignout?.(s.detail);
|
|
36
|
+
return o.addEventListener("zitadel-signout", a), () => {
|
|
37
|
+
o.removeEventListener("zitadel-signout", a);
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
var _ = { getElement: i }, n = p();
|
|
41
|
+
return e.template_effect(() => e.set_custom_element_data(n, "project", t.project)), e.template_effect(() => e.set_custom_element_data(n, "project-id", t.projectId)), e.template_effect(() => e.set_custom_element_data(n, "proxy-path", t.proxyPath)), e.template_effect(() => e.set_custom_element_data(n, "post-sign-out-url", t.postSignOutUrl)), e.bind_this(n, (o) => e.set(l, o), () => e.get(l)), e.append(d, n), e.pop(_);
|
|
42
|
+
}
|
|
43
|
+
var g = e.from_html("<zitadel-session></zitadel-session>", 2);
|
|
44
|
+
function L(d, t) {
|
|
45
|
+
e.push(t, !0);
|
|
46
|
+
let l = e.state(void 0);
|
|
47
|
+
function i() {
|
|
48
|
+
return e.get(l);
|
|
49
|
+
}
|
|
50
|
+
e.user_effect(() => {
|
|
51
|
+
const o = e.get(l);
|
|
52
|
+
if (!o)
|
|
34
53
|
return;
|
|
35
|
-
const
|
|
36
|
-
return
|
|
37
|
-
|
|
54
|
+
const a = (s) => t.onSignout?.(s.detail);
|
|
55
|
+
return o.addEventListener("zitadel-signout", a), () => {
|
|
56
|
+
o.removeEventListener("zitadel-signout", a);
|
|
38
57
|
};
|
|
39
58
|
});
|
|
40
|
-
var
|
|
41
|
-
return e.template_effect(() => e.set_custom_element_data(
|
|
59
|
+
var _ = { getElement: i }, n = g();
|
|
60
|
+
return e.template_effect(() => e.set_custom_element_data(n, "project", t.project)), e.template_effect(() => e.set_custom_element_data(n, "project-id", t.projectId)), e.template_effect(() => e.set_custom_element_data(n, "proxy-path", t.proxyPath)), e.template_effect(() => e.set_custom_element_data(n, "post-sign-out-url", t.postSignOutUrl)), e.template_effect(() => e.set_custom_element_data(n, "heading", t.heading)), e.template_effect(() => e.set_custom_element_data(n, "logout-label", t.logoutLabel)), e.bind_this(n, (o) => e.set(l, o), () => e.get(l)), e.append(d, n), e.pop(_);
|
|
42
61
|
}
|
|
43
62
|
export {
|
|
44
|
-
|
|
63
|
+
h as ZitadelLogin,
|
|
45
64
|
E as ZitadelLogout,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
65
|
+
L as ZitadelSession,
|
|
66
|
+
x as configureZitadel,
|
|
67
|
+
S as getApi,
|
|
68
|
+
y as getZitadelConfig
|
|
49
69
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zitadel/sdk-svelte",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.15",
|
|
4
4
|
"description": "Svelte components for the Zitadel auth UI (client-side SPA).",
|
|
5
5
|
"homepage": "https://github.com/zitadel/nextgen/tree/main/packages/sdk-svelte#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@zitadel/api": "0.1.0-alpha.
|
|
33
|
-
"@zitadel/components": "0.1.0-alpha.
|
|
34
|
-
"@zitadel/sdk-core": "0.1.0-alpha.
|
|
32
|
+
"@zitadel/api": "0.1.0-alpha.15",
|
|
33
|
+
"@zitadel/components": "0.1.0-alpha.15",
|
|
34
|
+
"@zitadel/sdk-core": "0.1.0-alpha.15"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"svelte": "^5.0.0"
|