zudoku 0.3.0-dev.86 → 0.3.0-dev.88
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/config/validators/InputSidebarSchema.d.ts +176 -0
- package/dist/config/validators/InputSidebarSchema.js +71 -0
- package/dist/config/validators/InputSidebarSchema.js.map +1 -0
- package/dist/config/validators/SidebarSchema.d.ts +13 -173
- package/dist/config/validators/SidebarSchema.js +75 -70
- package/dist/config/validators/SidebarSchema.js.map +1 -1
- package/dist/config/validators/validate.d.ts +5 -5
- package/dist/config/validators/validate.js +4 -3
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/lib/authentication/components/SignIn.js +2 -2
- package/dist/lib/authentication/components/SignIn.js.map +1 -1
- package/dist/lib/authentication/components/SignOut.js +2 -2
- package/dist/lib/authentication/components/SignOut.js.map +1 -1
- package/dist/lib/authentication/components/SignUp.js +2 -2
- package/dist/lib/authentication/components/SignUp.js.map +1 -1
- package/dist/lib/authentication/hook.js +2 -2
- package/dist/lib/authentication/hook.js.map +1 -1
- package/dist/lib/components/DevPortal.d.ts +0 -4
- package/dist/lib/components/DevPortal.js +4 -23
- package/dist/lib/components/DevPortal.js.map +1 -1
- package/dist/lib/components/Header.js +2 -2
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/Layout.js +2 -2
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/TopNavigation.js +2 -2
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/context/{DevPortalProvider.d.ts → ZudokuContext.d.ts} +3 -3
- package/dist/lib/components/context/{DevPortalProvider.js → ZudokuContext.js} +8 -9
- package/dist/lib/components/context/ZudokuContext.js.map +1 -0
- package/dist/lib/components/context/ZudokuProvider.d.ts +5 -0
- package/dist/lib/components/context/ZudokuProvider.js +16 -0
- package/dist/lib/components/context/ZudokuProvider.js.map +1 -0
- package/dist/lib/components/navigation/Sidebar.js +1 -1
- package/dist/lib/components/navigation/Sidebar.js.map +1 -1
- package/dist/lib/components/navigation/SidebarCategory.d.ts +2 -2
- package/dist/lib/components/navigation/SidebarCategory.js +1 -1
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.d.ts +2 -2
- package/dist/lib/components/navigation/SidebarItem.js +2 -2
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
- package/dist/lib/components/navigation/utils.d.ts +6 -6
- package/dist/lib/components/navigation/utils.js +3 -3
- package/dist/lib/components/navigation/utils.js.map +1 -1
- package/dist/lib/core/DevPortalContext.d.ts +3 -3
- package/dist/lib/core/DevPortalContext.js +2 -2
- package/dist/lib/core/DevPortalContext.js.map +1 -1
- package/dist/lib/core/plugins.d.ts +2 -2
- package/dist/lib/plugins/api-keys/CreateApiKey.js +2 -2
- package/dist/lib/plugins/api-keys/CreateApiKey.js.map +1 -1
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js +2 -2
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
- package/dist/lib/plugins/openapi/index.js +1 -1
- package/dist/lib/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.js +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/vite/plugin-sidebar.js +1 -1
- package/dist/vite/plugin-sidebar.js.map +1 -1
- package/lib/{AuthenticationPlugin-DgwV0hVu.js → AuthenticationPlugin-C3dzfGaA.js} +2 -2
- package/lib/AuthenticationPlugin-C3dzfGaA.js.map +1 -0
- package/lib/{Combination-DkycFHkm.js → Combination-Djh-LWhb.js} +93 -93
- package/lib/Combination-Djh-LWhb.js.map +1 -0
- package/lib/{Input-BclXSY0g.js → Input-SCGD-EvD.js} +3 -3
- package/lib/{Input-BclXSY0g.js.map → Input-SCGD-EvD.js.map} +1 -1
- package/lib/{MdxPage-Crlr0GmN.js → MdxPage-d02krMBw.js} +2 -2
- package/lib/{MdxPage-Crlr0GmN.js.map → MdxPage-d02krMBw.js.map} +1 -1
- package/lib/{OperationList-CMH3DPpj.js → OperationList-BQweX28o.js} +4 -4
- package/lib/{OperationList-CMH3DPpj.js.map → OperationList-BQweX28o.js.map} +1 -1
- package/lib/{Route-CwXfyIUw.js → Route-BPGW1TS_.js} +2 -2
- package/lib/{Route-CwXfyIUw.js.map → Route-BPGW1TS_.js.map} +1 -1
- package/lib/{Spinner-fF-Xv-gw.js → Spinner-DEgs-1Gu.js} +2 -2
- package/lib/{Spinner-fF-Xv-gw.js.map → Spinner-DEgs-1Gu.js.map} +1 -1
- package/lib/{DevPortalProvider-CTxoCHIT.js → ZudokuContext-C3JtXViU.js} +99 -99
- package/lib/ZudokuContext-C3JtXViU.js.map +1 -0
- package/lib/{index-DkuZvRNP.js → index-B8BCBPkc.js} +3 -3
- package/lib/{index-DkuZvRNP.js.map → index-B8BCBPkc.js.map} +1 -1
- package/lib/{index-DUrF63A6.js → index-DoIWqOG1.js} +8 -8
- package/lib/index-DoIWqOG1.js.map +1 -0
- package/lib/{utils-CzT_9Tsn.js → utils-D3fcGEot.js} +9 -9
- package/lib/{utils-CzT_9Tsn.js.map → utils-D3fcGEot.js.map} +1 -1
- package/lib/zudoku.auth-clerk.js +1 -1
- package/lib/zudoku.auth-openid.js +1 -1
- package/lib/zudoku.components.js +569 -566
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +16 -16
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +3 -3
- package/package.json +1 -1
- package/src/lib/authentication/components/SignIn.tsx +2 -2
- package/src/lib/authentication/components/SignOut.tsx +2 -2
- package/src/lib/authentication/components/SignUp.tsx +2 -2
- package/src/lib/authentication/hook.ts +2 -2
- package/src/lib/components/DevPortal.tsx +4 -30
- package/src/lib/components/Header.tsx +2 -2
- package/src/lib/components/Layout.tsx +2 -2
- package/src/lib/components/TopNavigation.tsx +2 -2
- package/src/lib/components/context/{DevPortalProvider.ts → ZudokuContext.ts} +7 -9
- package/src/lib/components/context/ZudokuProvider.tsx +26 -0
- package/src/lib/components/navigation/Sidebar.tsx +1 -1
- package/src/lib/components/navigation/SidebarCategory.tsx +3 -3
- package/src/lib/components/navigation/SidebarItem.tsx +8 -4
- package/src/lib/components/navigation/utils.ts +12 -15
- package/src/lib/core/DevPortalContext.ts +4 -4
- package/src/lib/core/plugins.ts +2 -2
- package/src/lib/plugins/api-keys/CreateApiKey.tsx +2 -2
- package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +2 -2
- package/src/lib/plugins/openapi/index.tsx +3 -3
- package/src/lib/plugins/openapi/playground/Playground.tsx +1 -1
- package/dist/config/validators/ResolvedSidebarSchema.d.ts +0 -18
- package/dist/config/validators/ResolvedSidebarSchema.js +0 -76
- package/dist/config/validators/ResolvedSidebarSchema.js.map +0 -1
- package/dist/lib/components/context/DevPortalProvider.js.map +0 -1
- package/lib/AuthenticationPlugin-DgwV0hVu.js.map +0 -1
- package/lib/Combination-DkycFHkm.js.map +0 -1
- package/lib/DevPortalProvider-CTxoCHIT.js.map +0 -1
- package/lib/index-DUrF63A6.js.map +0 -1
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
import { useLocation } from "react-router-dom";
|
|
2
2
|
import type {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} from "../../../config/validators/
|
|
3
|
+
SidebarItem,
|
|
4
|
+
SidebarItemCategory,
|
|
5
|
+
} from "../../../config/validators/SidebarSchema.js";
|
|
6
6
|
import { joinPath } from "../../util/joinPath.js";
|
|
7
|
-
import {
|
|
8
|
-
useDevPortal,
|
|
9
|
-
useTopNavigationItem,
|
|
10
|
-
} from "../context/DevPortalProvider.js";
|
|
7
|
+
import { useTopNavigationItem, useZudoku } from "../context/ZudokuContext.js";
|
|
11
8
|
|
|
12
9
|
export type TraverseCallback<T> = (
|
|
13
|
-
item:
|
|
14
|
-
parentCategories:
|
|
10
|
+
item: SidebarItem,
|
|
11
|
+
parentCategories: SidebarItem[],
|
|
15
12
|
) => T | void;
|
|
16
13
|
|
|
17
14
|
export const traverseSidebar = <T>(
|
|
18
|
-
sidebar:
|
|
15
|
+
sidebar: SidebarItem[],
|
|
19
16
|
callback: TraverseCallback<T>,
|
|
20
17
|
): T | undefined => {
|
|
21
18
|
for (const item of sidebar) {
|
|
@@ -25,9 +22,9 @@ export const traverseSidebar = <T>(
|
|
|
25
22
|
};
|
|
26
23
|
|
|
27
24
|
export const traverseSidebarItem = <T>(
|
|
28
|
-
item:
|
|
25
|
+
item: SidebarItem,
|
|
29
26
|
callback: TraverseCallback<T>,
|
|
30
|
-
parentCategories:
|
|
27
|
+
parentCategories: SidebarItem[] = [],
|
|
31
28
|
): T | undefined => {
|
|
32
29
|
const result = callback(item, parentCategories);
|
|
33
30
|
if (result !== undefined) return result;
|
|
@@ -46,7 +43,7 @@ export const traverseSidebarItem = <T>(
|
|
|
46
43
|
export const useCurrentItem = () => {
|
|
47
44
|
const location = useLocation();
|
|
48
45
|
const topNavItem = useTopNavigationItem();
|
|
49
|
-
const { sidebars } =
|
|
46
|
+
const { sidebars } = useZudoku();
|
|
50
47
|
const currentSidebar = topNavItem?.id ? sidebars[topNavItem.id] : [];
|
|
51
48
|
|
|
52
49
|
return traverseSidebar(currentSidebar, (item) => {
|
|
@@ -59,7 +56,7 @@ export const useCurrentItem = () => {
|
|
|
59
56
|
});
|
|
60
57
|
};
|
|
61
58
|
|
|
62
|
-
export const useIsCategoryOpen = (category:
|
|
59
|
+
export const useIsCategoryOpen = (category: SidebarItemCategory) => {
|
|
63
60
|
const location = useLocation();
|
|
64
61
|
const topNavItem = useTopNavigationItem();
|
|
65
62
|
|
|
@@ -85,7 +82,7 @@ export const usePrevNext = (): {
|
|
|
85
82
|
next?: { label: string; id: string };
|
|
86
83
|
} => {
|
|
87
84
|
const currentId = useLocation().pathname;
|
|
88
|
-
const { sidebars } =
|
|
85
|
+
const { sidebars } = useZudoku();
|
|
89
86
|
const topNavItem = useTopNavigationItem();
|
|
90
87
|
const currentSidebar = topNavItem?.id ? sidebars[topNavItem.id] : [];
|
|
91
88
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { QueryClient } from "@tanstack/react-query";
|
|
2
2
|
import { NavigateFunction } from "react-router-dom";
|
|
3
|
-
import type {
|
|
3
|
+
import type { SidebarConfig } from "../../config/validators/SidebarSchema.js";
|
|
4
4
|
import { type AuthenticationProvider } from "../authentication/authentication.js";
|
|
5
5
|
import type { ComponentsContextType } from "../components/context/ComponentsContext.js";
|
|
6
6
|
import { Slotlets } from "../components/SlotletProvider.js";
|
|
@@ -56,7 +56,7 @@ export type ZudokuContextOptions = {
|
|
|
56
56
|
page?: Page;
|
|
57
57
|
authentication?: AuthenticationProvider;
|
|
58
58
|
topNavigation?: Array<{ id: string; label: string }>;
|
|
59
|
-
sidebars?:
|
|
59
|
+
sidebars?: SidebarConfig;
|
|
60
60
|
plugins?: DevPortalPlugin[];
|
|
61
61
|
slotlets?: Slotlets;
|
|
62
62
|
mdx?: {
|
|
@@ -110,10 +110,10 @@ export class DevPortalContext {
|
|
|
110
110
|
return keys.flat();
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
-
|
|
113
|
+
getPluginSidebar = async (path: string) => {
|
|
114
114
|
const navigations = await Promise.all(
|
|
115
115
|
this.navigationPlugins.map((plugin) =>
|
|
116
|
-
plugin.
|
|
116
|
+
plugin.getSidebar?.(joinPath(path)),
|
|
117
117
|
),
|
|
118
118
|
);
|
|
119
119
|
|
package/src/lib/core/plugins.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactElement } from "react";
|
|
2
2
|
import { NavigateFunction, type RouteObject } from "react-router-dom";
|
|
3
|
-
import type {
|
|
3
|
+
import type { Sidebar } from "../../config/validators/SidebarSchema.js";
|
|
4
4
|
import { MdxComponentsType } from "../util/MdxComponents.js";
|
|
5
5
|
import { DevPortalContext, type ApiIdentity } from "./DevPortalContext.js";
|
|
6
6
|
|
|
@@ -12,7 +12,7 @@ export type DevPortalPlugin =
|
|
|
12
12
|
|
|
13
13
|
export interface NavigationPlugin {
|
|
14
14
|
getRoutes: () => RouteObject[];
|
|
15
|
-
|
|
15
|
+
getSidebar?: (path: string) => Promise<Sidebar>;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
export interface ApiIdentityPlugin {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useMutation } from "@tanstack/react-query";
|
|
2
2
|
import { useForm } from "react-hook-form";
|
|
3
3
|
import { Link, useNavigate } from "react-router-dom";
|
|
4
|
-
import {
|
|
4
|
+
import { useZudoku } from "../../components/context/ZudokuContext.js";
|
|
5
5
|
import {
|
|
6
6
|
Select,
|
|
7
7
|
SelectContent,
|
|
@@ -17,7 +17,7 @@ import { ApiKeyService } from "./index.js";
|
|
|
17
17
|
type CreateApiKey = { description: string; expiresOn?: string };
|
|
18
18
|
|
|
19
19
|
export const CreateApiKey = ({ service }: { service: ApiKeyService }) => {
|
|
20
|
-
const context =
|
|
20
|
+
const context = useZudoku();
|
|
21
21
|
const navigate = useNavigate();
|
|
22
22
|
const form = useForm<CreateApiKey>({
|
|
23
23
|
defaultValues: {
|
|
@@ -6,14 +6,14 @@ import {
|
|
|
6
6
|
import { EyeIcon, EyeOffIcon, RotateCwIcon, TrashIcon } from "lucide-react";
|
|
7
7
|
import { useState } from "react";
|
|
8
8
|
import { Link } from "react-router-dom";
|
|
9
|
-
import {
|
|
9
|
+
import { useZudoku } from "../../components/context/ZudokuContext.js";
|
|
10
10
|
import { Slotlet } from "../../components/SlotletProvider.js";
|
|
11
11
|
import { Button } from "../../ui/Button.js";
|
|
12
12
|
import { cn } from "../../util/cn.js";
|
|
13
13
|
import { ApiKeyService } from "./index.js";
|
|
14
14
|
|
|
15
15
|
export const SettingsApiKeys = ({ service }: { service: ApiKeyService }) => {
|
|
16
|
-
const context =
|
|
16
|
+
const context = useZudoku();
|
|
17
17
|
const queryClient = useQueryClient();
|
|
18
18
|
const { data } = useSuspenseQuery({
|
|
19
19
|
queryFn: () => service.getKeys(context),
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import { useQuery } from "@tanstack/react-query";
|
|
11
11
|
import { CirclePlayIcon, LogInIcon } from "lucide-react";
|
|
12
12
|
import { createClient } from "zudoku/openapi-worker";
|
|
13
|
-
import type {
|
|
13
|
+
import type { SidebarItem } from "../../../config/validators/SidebarSchema.js";
|
|
14
14
|
import { useAuth } from "../../authentication/hook.js";
|
|
15
15
|
import { ErrorPage } from "../../components/ErrorPage.js";
|
|
16
16
|
import { SyntaxHighlight } from "../../components/SyntaxHighlight.js";
|
|
@@ -136,7 +136,7 @@ export const openApiPlugin = (
|
|
|
136
136
|
);
|
|
137
137
|
},
|
|
138
138
|
}),
|
|
139
|
-
|
|
139
|
+
getSidebar: async (path: string) => {
|
|
140
140
|
if (!matchPath({ path: basePath, end: false }, path)) {
|
|
141
141
|
return [];
|
|
142
142
|
}
|
|
@@ -150,7 +150,7 @@ export const openApiPlugin = (
|
|
|
150
150
|
|
|
151
151
|
const categories = data.schema.tags
|
|
152
152
|
.filter((tag) => tag.operations.length > 0)
|
|
153
|
-
.map<
|
|
153
|
+
.map<SidebarItem>((tag) => ({
|
|
154
154
|
type: "category",
|
|
155
155
|
label: tag.name ?? "",
|
|
156
156
|
collapsible: false,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useMutation } from "@tanstack/react-query";
|
|
2
2
|
import { Fragment, useEffect, useRef } from "react";
|
|
3
3
|
import { FormProvider, useForm } from "react-hook-form";
|
|
4
|
-
import { useApiIdentities } from "../../../components/context/
|
|
4
|
+
import { useApiIdentities } from "../../../components/context/ZudokuContext.js";
|
|
5
5
|
import {
|
|
6
6
|
Select,
|
|
7
7
|
SelectContent,
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { BaseSidebarItemCategoryLinkDoc, BaseSidebarItemDoc, SidebarItem, SidebarItemCategory, SidebarItemLink } from "./SidebarSchema.js";
|
|
2
|
-
export type ResolvedSidebarItemDoc = BaseSidebarItemDoc & {
|
|
3
|
-
label: string;
|
|
4
|
-
categoryLabel?: string;
|
|
5
|
-
};
|
|
6
|
-
type ResolvedSidebarItemLink = SidebarItemLink;
|
|
7
|
-
type ResolvedSidebarItemCategoryLinkDoc = BaseSidebarItemCategoryLinkDoc & {
|
|
8
|
-
label: string;
|
|
9
|
-
};
|
|
10
|
-
export type ResolvedSidebarItemCategory = Omit<SidebarItemCategory, "items" | "link"> & {
|
|
11
|
-
items: ResolvedSidebarItem[];
|
|
12
|
-
link?: ResolvedSidebarItemCategoryLinkDoc;
|
|
13
|
-
};
|
|
14
|
-
export type ResolvedSidebarItem = ResolvedSidebarItemDoc | ResolvedSidebarItemLink | ResolvedSidebarItemCategory;
|
|
15
|
-
export declare const resolveSidebar: (rootDir: string, parentId: string, sidebar: SidebarItem[]) => Promise<ResolvedSidebarItem[]>;
|
|
16
|
-
export type ResolvedSidebar = ResolvedSidebarItem[];
|
|
17
|
-
export type ResolvedSidebarConfig = Record<string, ResolvedSidebar>;
|
|
18
|
-
export {};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { glob } from "glob";
|
|
2
|
-
import matter from "gray-matter";
|
|
3
|
-
import fs from "node:fs/promises";
|
|
4
|
-
const extractTitleFromContent = (content) => content.match(/^\s*#\s(.*)$/m)?.at(1);
|
|
5
|
-
export const resolveSidebar = async (rootDir, parentId, sidebar) => {
|
|
6
|
-
const resolveDoc = async (id, categoryLabel) => {
|
|
7
|
-
const foundMatches = await glob(`/**/${parentId}/${id}.{md,mdx}`, {
|
|
8
|
-
root: rootDir,
|
|
9
|
-
});
|
|
10
|
-
if (foundMatches.length === 0) {
|
|
11
|
-
throw new Error(`No file found for doc ${parentId}/${id}`);
|
|
12
|
-
}
|
|
13
|
-
if (foundMatches.length > 1) {
|
|
14
|
-
throw new Error(`Multiple files found for doc ${parentId}/${id}`);
|
|
15
|
-
}
|
|
16
|
-
const file = await fs.readFile(foundMatches.at(0));
|
|
17
|
-
const { data, content } = matter(file);
|
|
18
|
-
const label = data.sidebar_label ?? data.title ?? extractTitleFromContent(content);
|
|
19
|
-
if (typeof label !== "string") {
|
|
20
|
-
throw new Error(`No title found for doc ${id}`);
|
|
21
|
-
}
|
|
22
|
-
return {
|
|
23
|
-
type: "doc",
|
|
24
|
-
id,
|
|
25
|
-
label,
|
|
26
|
-
categoryLabel,
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
const resolveLink = async (id) => {
|
|
30
|
-
const doc = await resolveDoc(id);
|
|
31
|
-
return {
|
|
32
|
-
type: "doc",
|
|
33
|
-
id: id,
|
|
34
|
-
label: doc.label,
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
const resolveSidebarItemCategoryLinkDoc = async (item) => {
|
|
38
|
-
if (typeof item === "string") {
|
|
39
|
-
return resolveLink(item);
|
|
40
|
-
}
|
|
41
|
-
const label = item.label ?? (await resolveDoc(item.id)).label;
|
|
42
|
-
return { label, ...item };
|
|
43
|
-
};
|
|
44
|
-
const resolveSidebarItemDoc = async (item, categoryLabel) => {
|
|
45
|
-
if (typeof item === "string") {
|
|
46
|
-
return resolveDoc(item, categoryLabel);
|
|
47
|
-
}
|
|
48
|
-
const label = item.label ?? (await resolveDoc(item.id, categoryLabel)).label;
|
|
49
|
-
return { ...item, label, categoryLabel };
|
|
50
|
-
};
|
|
51
|
-
const resolveSidebarItem = async (item, categoryLabel) => {
|
|
52
|
-
if (typeof item === "string") {
|
|
53
|
-
return resolveDoc(item, categoryLabel);
|
|
54
|
-
}
|
|
55
|
-
switch (item.type) {
|
|
56
|
-
case "doc":
|
|
57
|
-
return resolveSidebarItemDoc(item, categoryLabel);
|
|
58
|
-
case "link":
|
|
59
|
-
return item;
|
|
60
|
-
case "category": {
|
|
61
|
-
const categoryItem = item;
|
|
62
|
-
const items = await Promise.all(categoryItem.items.map((subItem) => resolveSidebarItem(subItem, categoryItem.label)));
|
|
63
|
-
const resolvedLink = categoryItem.link
|
|
64
|
-
? await resolveSidebarItemCategoryLinkDoc(categoryItem.link)
|
|
65
|
-
: undefined;
|
|
66
|
-
return {
|
|
67
|
-
...categoryItem,
|
|
68
|
-
items,
|
|
69
|
-
link: resolvedLink,
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
return Promise.all(sidebar.map((item) => resolveSidebarItem(item)));
|
|
75
|
-
};
|
|
76
|
-
//# sourceMappingURL=ResolvedSidebarSchema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ResolvedSidebarSchema.js","sourceRoot":"","sources":["../../../src/config/validators/ResolvedSidebarSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAiClC,MAAM,uBAAuB,GAAG,CAAC,OAAe,EAAE,EAAE,CAClD,OAAO,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;AAExC,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,EACjC,OAAe,EACf,QAAgB,EAChB,OAAsB,EACU,EAAE;IAClC,MAAM,UAAU,GAAG,KAAK,EAAE,EAAU,EAAE,aAAsB,EAAE,EAAE;QAC9D,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,OAAO,QAAQ,IAAI,EAAE,WAAW,EAAE;YAChE,IAAI,EAAE,OAAO;SACd,CAAC,CAAC;QAEH,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,yBAAyB,QAAQ,IAAI,EAAE,EAAE,CAAC,CAAC;QAC7D,CAAC;QAED,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC5B,MAAM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AC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IACrD,IAAI,CAAC,SAAS;QAAE,OAAO;IAEvB,OAAO,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC;AAC7D,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,GAAG,EAAE;IAChC,MAAM,EAAE,mBAAmB,EAAE,QAAQ,EAAE,GAAG,YAAY,EAAE,CAAC;IACzD,MAAM,OAAO,GAAG,oBAAoB,EAAE,CAAC;IACvC,MAAM,IAAI,GAAG,OAAO,EAAE,EAAE,CAAC;IACzB,MAAM,cAAc,GAAG,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAExD,OAAO,gBAAgB,CAAC;QACtB,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,aAAa,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAElE,OAAO;gBACL,KAAK,EAAE,CAAC,GAAG,cAAc,EAAE,GAAG,aAAa,CAAC;gBAC5C,iBAAiB,EAAE,OAAO;aAC3B,CAAC;QACJ,CAAC;QACD,QAAQ,EAAE,CAAC,YAAY,EAAE,IAAI,CAAC;KAC/B,CAAC,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AuthenticationPlugin-DgwV0hVu.js","sources":["../src/lib/authentication/components/SignIn.tsx","../src/lib/authentication/components/SignOut.tsx","../src/lib/authentication/components/SignUp.tsx","../src/lib/authentication/AuthenticationPlugin.tsx"],"sourcesContent":["import { useEffect } from \"react\";\nimport { useSearchParams } from \"react-router-dom\";\nimport { useDevPortal } from \"../../components/context/DevPortalProvider.js\";\n\nexport const SignIn = () => {\n const context = useDevPortal();\n const [search] = useSearchParams();\n useEffect(() => {\n void context.authentication?.signIn({\n redirectTo: search.get(\"redirect\") ?? undefined,\n });\n }, [context.authentication, search]);\n\n return null;\n};\n","import { useEffect } from \"react\";\nimport { useNavigate } from \"react-router-dom\";\nimport { useDevPortal } from \"../../components/context/DevPortalProvider.js\";\n\nexport const SignOut = () => {\n const context = useDevPortal();\n const navigate = useNavigate();\n useEffect(() => {\n void context.authentication?.signOut().then(() => navigate(\"/\"));\n }, [navigate, context.authentication]);\n\n return null;\n};\n","import { useEffect } from \"react\";\nimport { useDevPortal } from \"../../components/context/DevPortalProvider.js\";\n\nexport const SignUp = () => {\n const context = useDevPortal();\n useEffect(() => {\n void (context.authentication?.signUp() ?? context.authentication?.signIn());\n }, [context.authentication]);\n\n return null;\n};\n","import {\n CommonPlugin,\n NavigationPlugin,\n ProfileMenuPlugin,\n} from \"../core/plugins.js\";\nimport { SignIn } from \"./components/SignIn.js\";\nimport { SignOut } from \"./components/SignOut.js\";\nimport { SignUp } from \"./components/SignUp.js\";\n\ntype PluginInterface = NavigationPlugin & CommonPlugin & ProfileMenuPlugin;\n\nexport class AuthenticationPlugin implements PluginInterface {\n getRoutes() {\n return [\n {\n path: \"/signout\",\n element: <SignOut />,\n },\n {\n path: \"/signin\",\n element: <SignIn />,\n },\n {\n path: \"/signup\",\n element: <SignUp />,\n },\n ];\n }\n\n getProfileMenuItems() {\n return [\n {\n label: \"Logout\",\n path: \"/signout\",\n },\n ];\n }\n}\n"],"names":["SignIn","context","useDevPortal","search","useSearchParams","useEffect","_a","SignOut","navigate","useNavigate","SignUp","_b","AuthenticationPlugin"],"mappings":";;;;AAIO,MAAMA,IAAS,MAAM;AAC1B,QAAMC,IAAUC,KACV,CAACC,CAAM,IAAIC;AACjB,SAAAC,EAAU,MAAM;;AACT,KAAAC,IAAAL,EAAQ,mBAAR,QAAAK,EAAwB,OAAO;AAAA,MAClC,YAAYH,EAAO,IAAI,UAAU,KAAK;AAAA,IAAA;AAAA,EAEvC,GAAA,CAACF,EAAQ,gBAAgBE,CAAM,CAAC,GAE5B;AACT,GCVaI,IAAU,MAAM;AAC3B,QAAMN,IAAUC,KACVM,IAAWC;AACjB,SAAAJ,EAAU,MAAM;;AACT,KAAAC,IAAAL,EAAQ,mBAAR,QAAAK,EAAwB,UAAU,KAAK,MAAME,EAAS,GAAG;AAAA,EAC7D,GAAA,CAACA,GAAUP,EAAQ,cAAc,CAAC,GAE9B;AACT,GCTaS,IAAS,MAAM;AAC1B,QAAMT,IAAUC;AAChB,SAAAG,EAAU,MAAM;;AACd,MAAMC,IAAAL,EAAQ,mBAAR,gBAAAK,EAAwB,eAAYK,IAAAV,EAAQ,mBAAR,QAAAU,EAAwB;AAAA,EAAO,GACxE,CAACV,EAAQ,cAAc,CAAC,GAEpB;AACT;ACCO,MAAMW,EAAgD;AAAA,EAC3D,YAAY;AACH,WAAA;AAAA,MACL;AAAA,QACE,MAAM;AAAA,QACN,+BAAUL,GAAQ,EAAA;AAAA,MACpB;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,+BAAUP,GAAO,EAAA;AAAA,MACnB;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,+BAAUU,GAAO,EAAA;AAAA,MACnB;AAAA,IAAA;AAAA,EAEJ;AAAA,EAEA,sBAAsB;AACb,WAAA;AAAA,MACL;AAAA,QACE,OAAO;AAAA,QACP,MAAM;AAAA,MACR;AAAA,IAAA;AAAA,EAEJ;AACF;"}
|