@zitadel/sdk-svelte 0.1.0-alpha.18 → 1.0.0-alpha.20
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/README.md +13 -12
- package/dist/index.js +29 -29
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -23,20 +23,21 @@ TypeScript ≥ 5.0 — the published type definitions re-export with `export typ
|
|
|
23
23
|
|
|
24
24
|
`<ZitadelLogout {project} postSignOutUrl="/login" />` works the same way.
|
|
25
25
|
|
|
26
|
+
The signed-in session card is `<ZitadelSession {project} />` (exported as `ZitadelSession`).
|
|
27
|
+
|
|
26
28
|
The widget's flow events are also surfaced as optional callbacks:
|
|
27
29
|
`onFlowStep`, `onFlowInput`, `onFlowComplete`, and `onFlowError`.
|
|
28
30
|
|
|
29
31
|
## Proxying to the backend (deployment)
|
|
30
32
|
|
|
31
|
-
The widgets call `${proxyPath}/…` same-origin (default `/__nextgen`).
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
[ADR 036](https://github.com/zitadel/nextgen/blob/main/docs/adrs/036-api-credential-planes.md)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
proxy
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
backend (cross-origin), e.g. `proxyPath: "http://localhost:4000"`.
|
|
33
|
+
The widgets call `${proxyPath}/…` same-origin (default `/__nextgen`). In
|
|
34
|
+
production the same-origin path must come from your hosting platform — until
|
|
35
|
+
the CLI can scaffold those configs, **production SPA deployment is not yet
|
|
36
|
+
supported**; see
|
|
37
|
+
[ADR 036](https://github.com/zitadel/nextgen/blob/main/docs/adrs/036-api-credential-planes.md)
|
|
38
|
+
and [zitadel/nextgen#560](https://github.com/zitadel/nextgen/issues/560). The
|
|
39
|
+
CLI dev proxy covers local development.
|
|
40
|
+
|
|
41
|
+
For local development you can also skip the proxy and point `proxyPath`
|
|
42
|
+
straight at the backend (cross-origin), e.g. `proxyPath: "http://localhost:8080"`
|
|
43
|
+
(the `zitadel start` local runtime default port).
|
package/dist/index.js
CHANGED
|
@@ -3,61 +3,61 @@ import * as e from "svelte/internal/client";
|
|
|
3
3
|
import { businessLocales as j } from "@zitadel/components";
|
|
4
4
|
import { configureZitadel as S, getApi as b, getZitadelConfig as y } from "@zitadel/api/config";
|
|
5
5
|
var f = e.from_html("<zitadel-login></zitadel-login>", 2);
|
|
6
|
-
function h(
|
|
6
|
+
function h(i, t) {
|
|
7
7
|
e.push(t, !0);
|
|
8
|
-
let
|
|
8
|
+
let o = e.prop(t, "purpose", 3, "login"), _ = e.state(void 0);
|
|
9
9
|
function r() {
|
|
10
|
-
return e.get(
|
|
10
|
+
return e.get(_);
|
|
11
11
|
}
|
|
12
12
|
e.user_effect(() => {
|
|
13
|
-
const
|
|
14
|
-
if (!
|
|
13
|
+
const l = e.get(_);
|
|
14
|
+
if (!l)
|
|
15
15
|
return;
|
|
16
|
-
const m = (
|
|
17
|
-
return
|
|
18
|
-
|
|
16
|
+
const m = (s) => t.onFlowStep?.(s.detail), d = (s) => t.onFlowInput?.(s.detail), c = (s) => t.onFlowComplete?.(s.detail), u = (s) => t.onFlowError?.(s.detail);
|
|
17
|
+
return l.addEventListener("zitadel-flow-step", m), l.addEventListener("zitadel-flow-input", d), l.addEventListener("zitadel-flow-complete", c), l.addEventListener("zitadel-flow-error", u), () => {
|
|
18
|
+
l.removeEventListener("zitadel-flow-step", m), l.removeEventListener("zitadel-flow-input", d), l.removeEventListener("zitadel-flow-complete", c), l.removeEventListener("zitadel-flow-error", u);
|
|
19
19
|
};
|
|
20
20
|
});
|
|
21
21
|
var n = { getElement: r }, a = f();
|
|
22
|
-
return e.template_effect(() => e.set_custom_element_data(a, "project", t.project)), e.template_effect(() => e.set_custom_element_data(a, "purpose",
|
|
22
|
+
return e.template_effect(() => e.set_custom_element_data(a, "project", t.project)), e.template_effect(() => e.set_custom_element_data(a, "purpose", o())), e.template_effect(() => e.set_custom_element_data(a, "locales", t.locales)), e.template_effect(() => e.set_custom_element_data(a, "lang", t.lang)), e.template_effect(() => e.set_custom_element_data(a, "project-id", t.projectId)), e.template_effect(() => e.set_custom_element_data(a, "proxy-path", t.proxyPath)), e.template_effect(() => e.set_custom_element_data(a, "post-sign-in-url", t.postSignInUrl)), e.template_effect(() => e.set_custom_element_data(a, "flow-name", t.flowName)), e.template_effect(() => e.set_custom_element_data(a, "variant", t.variant)), e.template_effect(() => e.set_custom_element_data(a, "theme", t.theme)), e.template_effect(() => e.set_custom_element_data(a, "suppressHeader", t.suppressHeader)), e.bind_this(a, (l) => e.set(_, l), () => e.get(_)), e.append(i, a), e.pop(n);
|
|
23
23
|
}
|
|
24
24
|
var g = e.from_html("<zitadel-logout></zitadel-logout>", 2);
|
|
25
|
-
function z(
|
|
25
|
+
function z(i, t) {
|
|
26
26
|
e.push(t, !0);
|
|
27
|
-
let
|
|
28
|
-
function
|
|
29
|
-
return e.get(
|
|
27
|
+
let o = e.state(void 0);
|
|
28
|
+
function _() {
|
|
29
|
+
return e.get(o);
|
|
30
30
|
}
|
|
31
31
|
e.user_effect(() => {
|
|
32
|
-
const a = e.get(
|
|
32
|
+
const a = e.get(o);
|
|
33
33
|
if (!a)
|
|
34
34
|
return;
|
|
35
|
-
const
|
|
36
|
-
return a.addEventListener("zitadel-signout",
|
|
37
|
-
a.removeEventListener("zitadel-signout",
|
|
35
|
+
const l = (m) => t.onSignout?.(m.detail);
|
|
36
|
+
return a.addEventListener("zitadel-signout", l), () => {
|
|
37
|
+
a.removeEventListener("zitadel-signout", l);
|
|
38
38
|
};
|
|
39
39
|
});
|
|
40
|
-
var r = { getElement:
|
|
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.template_effect(() => e.set_custom_element_data(n, "theme", t.theme)), e.bind_this(n, (a) => e.set(
|
|
40
|
+
var r = { getElement: _ }, n = g();
|
|
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.template_effect(() => e.set_custom_element_data(n, "theme", t.theme)), e.bind_this(n, (a) => e.set(o, a), () => e.get(o)), e.append(i, n), e.pop(r);
|
|
42
42
|
}
|
|
43
43
|
var p = e.from_html("<zitadel-session></zitadel-session>", 2);
|
|
44
|
-
function E(
|
|
44
|
+
function E(i, t) {
|
|
45
45
|
e.push(t, !0);
|
|
46
|
-
let
|
|
47
|
-
function
|
|
48
|
-
return e.get(
|
|
46
|
+
let o = e.state(void 0);
|
|
47
|
+
function _() {
|
|
48
|
+
return e.get(o);
|
|
49
49
|
}
|
|
50
50
|
e.user_effect(() => {
|
|
51
|
-
const a = e.get(
|
|
51
|
+
const a = e.get(o);
|
|
52
52
|
if (!a)
|
|
53
53
|
return;
|
|
54
|
-
const
|
|
55
|
-
return a.addEventListener("zitadel-signout",
|
|
56
|
-
a.removeEventListener("zitadel-signout",
|
|
54
|
+
const l = (m) => t.onSignout?.(m.detail);
|
|
55
|
+
return a.addEventListener("zitadel-signout", l), () => {
|
|
56
|
+
a.removeEventListener("zitadel-signout", l);
|
|
57
57
|
};
|
|
58
58
|
});
|
|
59
|
-
var r = { getElement:
|
|
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.template_effect(() => e.set_custom_element_data(n, "variant", t.variant)), e.template_effect(() => e.set_custom_element_data(n, "theme", t.theme)), e.bind_this(n, (a) => e.set(
|
|
59
|
+
var r = { getElement: _ }, n = p();
|
|
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.template_effect(() => e.set_custom_element_data(n, "variant", t.variant)), e.template_effect(() => e.set_custom_element_data(n, "theme", t.theme)), e.template_effect(() => e.set_custom_element_data(n, "suppressHeader", t.suppressHeader)), e.bind_this(n, (a) => e.set(o, a), () => e.get(o)), e.append(i, n), e.pop(r);
|
|
61
61
|
}
|
|
62
62
|
export {
|
|
63
63
|
h as ZitadelLogin,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zitadel/sdk-svelte",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.0-alpha.20",
|
|
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/components": "
|
|
33
|
-
"@zitadel/
|
|
34
|
-
"@zitadel/
|
|
32
|
+
"@zitadel/components": "1.0.0-alpha.20",
|
|
33
|
+
"@zitadel/sdk-core": "1.0.0-alpha.20",
|
|
34
|
+
"@zitadel/api": "1.0.0-alpha.20"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"svelte": "^5.0.0"
|