zudoku 0.3.0-dev.50 → 0.3.0-dev.52
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/app/main.js +2 -2
- package/dist/app/main.js.map +1 -1
- package/dist/lib/authentication/providers/clerk.js +1 -1
- package/dist/lib/authentication/providers/clerk.js.map +1 -1
- package/dist/lib/components/DevPortal.js +1 -1
- package/dist/lib/components/DevPortal.js.map +1 -1
- package/dist/lib/core/DevPortalContext.d.ts +4 -7
- package/dist/lib/core/DevPortalContext.js +2 -6
- package/dist/lib/core/DevPortalContext.js.map +1 -1
- package/dist/vite/prerender.js +4 -0
- package/dist/vite/prerender.js.map +1 -1
- package/lib/{hook-DCYGmylw.js → hook-CGFJQf_n.js} +2 -2
- package/lib/{hook-DCYGmylw.js.map → hook-CGFJQf_n.js.map} +1 -1
- package/lib/{state-D36MLDHk.js → state-DKdaQzvh.js} +1 -2
- package/lib/{state-D36MLDHk.js.map → state-DKdaQzvh.js.map} +1 -1
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-clerk.js +6 -5
- package/lib/zudoku.auth-clerk.js.map +1 -1
- package/lib/zudoku.auth-openid.js +1 -1
- package/lib/zudoku.components.js +151 -150
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +1 -1
- package/package.json +1 -1
- package/src/app/main.tsx +2 -2
- package/src/lib/authentication/providers/clerk.tsx +1 -1
- package/src/lib/components/DevPortal.tsx +2 -2
- package/src/lib/core/DevPortalContext.ts +5 -13
|
@@ -9,7 +9,7 @@ const clerkAuth: AuthenticationProviderInitializer<
|
|
|
9
9
|
let clerkApi: Clerk;
|
|
10
10
|
|
|
11
11
|
const ensureLoaded = (async () => {
|
|
12
|
-
if (
|
|
12
|
+
if (typeof window === "undefined") return;
|
|
13
13
|
const { Clerk } = await import("@clerk/clerk-js");
|
|
14
14
|
clerkApi = new Clerk(clerkPubKey);
|
|
15
15
|
|
|
@@ -43,8 +43,8 @@ const DevPortalInner = ({
|
|
|
43
43
|
);
|
|
44
44
|
|
|
45
45
|
const mdxComponents = useMemo(
|
|
46
|
-
() => ({ ...MdxComponents, ...props.
|
|
47
|
-
[props.
|
|
46
|
+
() => ({ ...MdxComponents, ...props.mdx?.components }),
|
|
47
|
+
[props.mdx?.components],
|
|
48
48
|
);
|
|
49
49
|
|
|
50
50
|
const devPortalContext = useMemo(() => new DevPortalContext(props), [props]);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { QueryClient } from "@tanstack/react-query";
|
|
2
2
|
import { type ReactNode } from "react";
|
|
3
|
-
import { create } from "zustand";
|
|
4
3
|
import { type AuthenticationProvider } from "../authentication/authentication.js";
|
|
5
4
|
import type { ComponentsContextType } from "../components/context/ComponentsContext.js";
|
|
6
5
|
import { type DevPortalPath } from "../components/DevPortal.js";
|
|
@@ -54,14 +53,8 @@ export type NavigationItem = {
|
|
|
54
53
|
categories?: NavigationCategory[];
|
|
55
54
|
};
|
|
56
55
|
|
|
57
|
-
export type RoutingState = {
|
|
58
|
-
path?: string;
|
|
59
|
-
};
|
|
60
|
-
|
|
61
56
|
export const queryClient = new QueryClient();
|
|
62
57
|
|
|
63
|
-
export const useRoutingState = create<RoutingState>(() => ({}));
|
|
64
|
-
|
|
65
58
|
export type ApiKeyCache = "api-keys";
|
|
66
59
|
export type DevPortalCacheKey = ApiKeyCache | string;
|
|
67
60
|
|
|
@@ -88,7 +81,9 @@ export type ZudokuContextOptions = {
|
|
|
88
81
|
authentication?: AuthenticationProvider;
|
|
89
82
|
navigation: NavigationItem[];
|
|
90
83
|
plugins?: DevPortalPlugin[];
|
|
91
|
-
|
|
84
|
+
mdx?: {
|
|
85
|
+
components?: MdxComponentsType;
|
|
86
|
+
};
|
|
92
87
|
overrides?: ComponentsContextType;
|
|
93
88
|
};
|
|
94
89
|
|
|
@@ -98,8 +93,6 @@ export class DevPortalContext {
|
|
|
98
93
|
public meta: ZudokuContextOptions["metadata"];
|
|
99
94
|
public page: ZudokuContextOptions["page"];
|
|
100
95
|
public authentication?: ZudokuContextOptions["authentication"];
|
|
101
|
-
|
|
102
|
-
public state: typeof useRoutingState;
|
|
103
96
|
private navigationPlugins: NavigationPlugin[];
|
|
104
97
|
|
|
105
98
|
constructor(config: ZudokuContextOptions) {
|
|
@@ -109,7 +102,6 @@ export class DevPortalContext {
|
|
|
109
102
|
this.authentication = config.authentication;
|
|
110
103
|
this.meta = config.metadata;
|
|
111
104
|
this.page = config.page;
|
|
112
|
-
this.state = useRoutingState;
|
|
113
105
|
}
|
|
114
106
|
|
|
115
107
|
initialize = async () => {
|
|
@@ -144,7 +136,7 @@ export class DevPortalContext {
|
|
|
144
136
|
return navigations.flatMap((nav) => nav ?? []);
|
|
145
137
|
};
|
|
146
138
|
|
|
147
|
-
async
|
|
139
|
+
signRequest = async (request: Request) => {
|
|
148
140
|
if (!this.authentication) {
|
|
149
141
|
throw new Error("No authentication provider configured");
|
|
150
142
|
}
|
|
@@ -154,5 +146,5 @@ export class DevPortalContext {
|
|
|
154
146
|
request.headers.set("Authorization", `Bearer ${accessToken}`);
|
|
155
147
|
|
|
156
148
|
return request;
|
|
157
|
-
}
|
|
149
|
+
};
|
|
158
150
|
}
|