@zitadel/sdk-qwik 0.1.0-alpha.13 → 0.1.0-alpha.14

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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { ZitadelLogin as ZitadelLoginElement, ZitadelLogout as ZitadelLogoutElement } from '@zitadel/components';
2
- import { ZitadelLoginConfig, ZitadelLoginHandlers, ZitadelLogoutConfig, ZitadelLogoutHandlers } from '@zitadel/sdk-core/types';
1
+ import { ZitadelLogin as ZitadelLoginElement, ZitadelLogout as ZitadelLogoutElement, ZitadelSession as ZitadelSessionElement } from '@zitadel/components';
2
+ import { ZitadelLoginConfig, ZitadelLoginHandlers, ZitadelLogoutConfig, ZitadelLogoutHandlers, ZitadelSessionConfig, ZitadelSessionHandlers } from '@zitadel/sdk-core/types';
3
3
  import { QRL, Signal } from '@builder.io/qwik';
4
4
  import { configureZitadel, getApi, getZitadelConfig, ZitadelConfig, ZitadelProject } from '@zitadel/api/config';
5
5
  export { configureZitadel, getApi, getZitadelConfig };
@@ -60,4 +60,25 @@ export type ZitadelLogoutProps = ZitadelLogoutConfig & Qrlify<ZitadelLogoutHandl
60
60
  * callback.
61
61
  */
62
62
  export declare const ZitadelLogout: import('@builder.io/qwik').Component<ZitadelLogoutProps>;
63
+ /**
64
+ * Props for {@link ZitadelSession}. Supply the SDK handle via {@link project},
65
+ * or the discrete `projectId` / `proxyPath` the widget reads as properties. The
66
+ * `on…$` QRL callbacks are derived from the shared {@link ZitadelSessionHandlers}
67
+ * contract. Pass an optional {@link ref} signal to obtain the underlying
68
+ * `<zitadel-session>` element imperatively.
69
+ */
70
+ export type ZitadelSessionProps = ZitadelSessionConfig & Qrlify<ZitadelSessionHandlers> & {
71
+ /**
72
+ * Optional signal populated with the underlying `<zitadel-session>` element
73
+ * once it mounts, mirroring React's `forwardRef`.
74
+ */
75
+ readonly ref?: Signal<ZitadelSessionElement | undefined>;
76
+ };
77
+ /**
78
+ * Qwik component wrapping the `<zitadel-session>` web component — the
79
+ * post-sign-in "signed in as" card. Binds the {@link ZitadelProject} handle as
80
+ * a DOM property (or the discrete project id / proxy path) and forwards the
81
+ * widget's `zitadel-signout` event as an optional callback.
82
+ */
83
+ export declare const ZitadelSession: import('@builder.io/qwik').Component<ZitadelSessionProps>;
63
84
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,IAAI,mBAAmB,EACnC,aAAa,IAAI,oBAAoB,EACtC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAA0C,KAAK,GAAG,EAAE,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACjG,OAAO,EACL,gBAAgB,EAChB,MAAM,EACN,gBAAgB,EAChB,KAAK,aAAa,EAClB,KAAK,cAAc,EACpB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC;AACtD,YAAY,EAAE,aAAa,EAAE,cAAc,EAAE,CAAC;AAC9C,cAAc,SAAS,CAAC;AAoBxB;;;;;GAKG;AACH,KAAK,MAAM,CAAC,CAAC,IAAI;IACf,QAAQ,EAAE,CAAC,IAAI,MAAM,CAAC,IAAI,GAAG,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC,GAAG,SAAS,GAC9F,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,IAAI,CAAC,GACxB,KAAK;CACV,CAAC;AAEF;;;;;;GAMG;A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AC,IAAI;IACf,QAAQ,EAAE,CAAC,IAAI,MAAM,CAAC,IAAI,GAAG,CAAC,GAAG,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,IAAI,CAAC,GAAG,SAAS,GAC9F,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,IAAI,CAAC,GACxB,KAAK;CACV,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,GAChD,MAAM,CAAC,oBAAoB,CAAC,GAAG;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,mBAAmB,GAAG,SAAS,CAAC,CAAC;CACxD,CAAC;AAEJ;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,yDAuCvB,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG,mBAAmB,GAClD,MAAM,CAAC,qBAAqB,CAAC,GAAG;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,oBAAoB,GAAG,SAAS,CAAC,CAAC;CACzD,CAAC;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,aAAa,0DA6BxB,CAAC;AAEH;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GAAG,oBAAoB,GACpD,MAAM,CAAC,sBAAsB,CAAC,GAAG;IAC/B;;;OAGG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAAC;CAC1D,CAAC;AAEJ;;;;;GAKG;AACH,eAAO,MAAM,cAAc,2DA+BzB,CAAC"}
@@ -74,9 +74,38 @@ const ZitadelLogout = component$((props) => {
74
74
  "post-sign-out-url": props.postSignOutUrl
75
75
  });
76
76
  });
77
+ const ZitadelSession = component$((props) => {
78
+ const host = useSignal();
79
+ useVisibleTask$(({ track, cleanup }) => {
80
+ const el = track(() => host.value);
81
+ if (!el) {
82
+ return;
83
+ }
84
+ const onSignout = (event) => void props.onSignout$?.(eventDetail(event));
85
+ el.addEventListener("zitadel-signout", onSignout);
86
+ cleanup(() => {
87
+ el.removeEventListener("zitadel-signout", onSignout);
88
+ });
89
+ }, {
90
+ strategy: "document-ready"
91
+ });
92
+ return /* @__PURE__ */ jsx("zitadel-session", {
93
+ ref: (el) => {
94
+ host.value = el;
95
+ if (props.ref) {
96
+ props.ref.value = el;
97
+ }
98
+ },
99
+ ...projectProp(props.project, props.projectId, props.proxyPath),
100
+ "post-sign-out-url": props.postSignOutUrl,
101
+ heading: props.heading,
102
+ "logout-label": props.logoutLabel
103
+ });
104
+ });
77
105
  export {
78
106
  ZitadelLogin,
79
107
  ZitadelLogout,
108
+ ZitadelSession,
80
109
  configureZitadel,
81
110
  getApi,
82
111
  getZitadelConfig
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zitadel/sdk-qwik",
3
- "version": "0.1.0-alpha.13",
3
+ "version": "0.1.0-alpha.14",
4
4
  "description": "Qwik components for the Zitadel auth UI (client-side SPA).",
5
5
  "homepage": "https://github.com/zitadel/nextgen/tree/main/packages/sdk-qwik#readme",
6
6
  "bugs": {
@@ -29,9 +29,9 @@
29
29
  "access": "public"
30
30
  },
31
31
  "dependencies": {
32
- "@zitadel/sdk-core": "0.1.0-alpha.13",
33
- "@zitadel/api": "0.1.0-alpha.13",
34
- "@zitadel/components": "0.1.0-alpha.13"
32
+ "@zitadel/sdk-core": "0.1.0-alpha.14",
33
+ "@zitadel/api": "0.1.0-alpha.14",
34
+ "@zitadel/components": "0.1.0-alpha.14"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "@builder.io/qwik": "^1.5.0"