@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.
@@ -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 h, getApi as j, getZitadelConfig as x } from "@zitadel/api/config";
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 z(s, t) {
6
+ function h(d, t) {
7
7
  e.push(t, !0);
8
- let a = e.prop(t, "purpose", 3, "login"), i = e.state(void 0);
9
- function m() {
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 o = e.get(i);
14
- if (!o)
13
+ const a = e.get(i);
14
+ if (!a)
15
15
  return;
16
- const d = (r) => t.onFlowStep?.(r.detail), u = (r) => t.onFlowInput?.(r.detail), _ = (r) => t.onFlowComplete?.(r.detail), c = (r) => t.onFlowError?.(r.detail);
17
- return o.addEventListener("zitadel-flow-step", d), o.addEventListener("zitadel-flow-input", u), o.addEventListener("zitadel-flow-complete", _), o.addEventListener("zitadel-flow-error", c), () => {
18
- o.removeEventListener("zitadel-flow-step", d), o.removeEventListener("zitadel-flow-input", u), o.removeEventListener("zitadel-flow-complete", _), o.removeEventListener("zitadel-flow-error", c);
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 l = { getElement: m }, n = f();
22
- return e.template_effect(() => e.set_custom_element_data(n, "project", t.project)), e.template_effect(() => e.set_custom_element_data(n, "purpose", a())), 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-in-url", t.postSignInUrl)), e.bind_this(n, (o) => e.set(i, o), () => e.get(i)), e.append(s, n), e.pop(l);
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(s, t) {
25
+ function E(d, t) {
26
26
  e.push(t, !0);
27
- let a = e.state(void 0);
27
+ let l = e.state(void 0);
28
28
  function i() {
29
- return e.get(a);
29
+ return e.get(l);
30
30
  }
31
31
  e.user_effect(() => {
32
- const n = e.get(a);
33
- if (!n)
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 o = (d) => t.onSignout?.(d.detail);
36
- return n.addEventListener("zitadel-signout", o), () => {
37
- n.removeEventListener("zitadel-signout", o);
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 m = { getElement: i }, l = p();
41
- return e.template_effect(() => e.set_custom_element_data(l, "project", t.project)), e.template_effect(() => e.set_custom_element_data(l, "project-id", t.projectId)), e.template_effect(() => e.set_custom_element_data(l, "proxy-path", t.proxyPath)), e.template_effect(() => e.set_custom_element_data(l, "post-sign-out-url", t.postSignOutUrl)), e.bind_this(l, (n) => e.set(a, n), () => e.get(a)), e.append(s, l), e.pop(m);
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
- z as ZitadelLogin,
63
+ h as ZitadelLogin,
45
64
  E as ZitadelLogout,
46
- h as configureZitadel,
47
- j as getApi,
48
- x as getZitadelConfig
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.13",
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.13",
33
- "@zitadel/components": "0.1.0-alpha.13",
34
- "@zitadel/sdk-core": "0.1.0-alpha.13"
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"