zudoku 0.13.3 → 0.13.5
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 -4
- package/dist/app/main.js.map +1 -1
- package/dist/config/validators/validate.d.ts +70 -0
- package/dist/config/validators/validate.js +14 -0
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/lib/authentication/hook.d.ts +1 -1
- package/dist/lib/authentication/hook.js +1 -1
- package/dist/lib/authentication/hook.js.map +1 -1
- package/dist/lib/components/MobileTopNavigation.js +4 -1
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/TopNavigation.d.ts +3 -0
- package/dist/lib/components/TopNavigation.js +9 -1
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.d.ts +2 -0
- package/dist/lib/components/index.d.ts +17 -8
- package/dist/lib/components/index.js +10 -3
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/core/DevPortalContext.d.ts +1 -0
- package/dist/lib/core/DevPortalContext.js.map +1 -1
- package/dist/vite/dev-server.js +1 -1
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/plugin-search.d.ts +3 -0
- package/dist/vite/plugin-search.js +26 -0
- package/dist/vite/plugin-search.js.map +1 -0
- package/dist/vite/plugin.js +2 -0
- package/dist/vite/plugin.js.map +1 -1
- package/lib/ClientOnly-CVN6leDu.js +11 -0
- package/lib/ClientOnly-CVN6leDu.js.map +1 -0
- package/lib/{Input-a9rLgbP_.js → Input-DrR6P3mq.js} +2 -2
- package/lib/{Input-a9rLgbP_.js.map → Input-DrR6P3mq.js.map} +1 -1
- package/lib/{OperationList-BhLMwPSh.js → OperationList-C2jKCTwZ.js} +4 -4
- package/lib/{OperationList-BhLMwPSh.js.map → OperationList-C2jKCTwZ.js.map} +1 -1
- package/lib/{Route-fK1i4Ryz.js → Route-DWXcQzRK.js} +2 -2
- package/lib/{Route-fK1i4Ryz.js.map → Route-DWXcQzRK.js.map} +1 -1
- package/lib/{SidebarBadge-BdzN0ZBK.js → SidebarBadge-C0iWtji9.js} +2 -2
- package/lib/{SidebarBadge-BdzN0ZBK.js.map → SidebarBadge-C0iWtji9.js.map} +1 -1
- package/lib/{index-_GxJ8hpM.js → index-Ch8VO_uX.js} +2 -2
- package/lib/index-Ch8VO_uX.js.map +1 -0
- package/lib/{index-dHVZhVNO.js → index-Dso_b0di.js} +6 -6
- package/lib/{index-dHVZhVNO.js.map → index-Dso_b0di.js.map} +1 -1
- package/lib/{index-BijFM__9.js → index-bYAqbdYl.js} +3 -3
- package/lib/{index-BijFM__9.js.map → index-bYAqbdYl.js.map} +1 -1
- package/lib/urql-core-KJnLL26g.js.map +1 -1
- package/lib/zudoku.components.js +740 -734
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +2 -2
- package/lib/zudoku.plugin-openapi.js +2 -2
- package/lib/zudoku.plugin-search-inkeep.js +9 -13
- package/lib/zudoku.plugin-search-inkeep.js.map +1 -1
- package/package.json +1 -1
- package/src/app/main.tsx +2 -4
- package/src/lib/authentication/hook.ts +1 -1
- package/src/lib/components/MobileTopNavigation.tsx +5 -1
- package/src/lib/components/TopNavigation.tsx +14 -1
- package/src/lib/components/index.ts +13 -4
- package/src/lib/core/DevPortalContext.ts +6 -1
- package/lib/index-_GxJ8hpM.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-B6kdoens.js";
|
|
2
2
|
import { S as x, R as f } from "./SlotletProvider-DmqWiVFt.js";
|
|
3
|
-
import { u as g, a as d, I as j, S as v, b as w, c as b, d as k, e as K, f as m } from "./Input-
|
|
3
|
+
import { u as g, a as d, I as j, S as v, b as w, c as b, d as k, e as K, f as m } from "./Input-DrR6P3mq.js";
|
|
4
4
|
import { a as N, L as u, O as I } from "./index-DFN92YJN.js";
|
|
5
5
|
import { u as h, a as E, b as S } from "./ZudokuContext-MRoel6bS.js";
|
|
6
|
-
import { B as l, n as A } from "./index-
|
|
6
|
+
import { B as l, n as A } from "./index-Ch8VO_uX.js";
|
|
7
7
|
import { D as C } from "./DeveloperHint-B_QCCafl.js";
|
|
8
8
|
import { RotateCwIcon as P, TrashIcon as D, EyeOffIcon as R, EyeIcon as q, CheckIcon as O, CopyIcon as z } from "lucide-react";
|
|
9
9
|
import { useState as p } from "react";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "./jsx-runtime-B6kdoens.js";
|
|
2
|
-
import { o as u } from "./index-
|
|
2
|
+
import { o as u } from "./index-Dso_b0di.js";
|
|
3
3
|
import "./ZudokuContext-MRoel6bS.js";
|
|
4
4
|
import "lucide-react";
|
|
5
5
|
import "zudoku/openapi-worker";
|
|
6
|
-
import "./index-
|
|
6
|
+
import "./index-Ch8VO_uX.js";
|
|
7
7
|
import "./ErrorPage-DqqAV1dr.js";
|
|
8
8
|
import "./Markdown-Y__eLG0x.js";
|
|
9
9
|
import "./joinPath-B7kNnUX4.js";
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import { j as n } from "./jsx-runtime-B6kdoens.js";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
o,
|
|
6
|
-
() => "client",
|
|
7
|
-
() => "server"
|
|
8
|
-
) === "client" ? e.children : null, l = {
|
|
2
|
+
import { lazy as a } from "react";
|
|
3
|
+
import { C as i } from "./ClientOnly-CVN6leDu.js";
|
|
4
|
+
const o = {
|
|
9
5
|
theme: {
|
|
10
6
|
components: {
|
|
11
7
|
AIChatPageWrapper: {
|
|
@@ -23,29 +19,29 @@ const o = () => () => {
|
|
|
23
19
|
}
|
|
24
20
|
}
|
|
25
21
|
}
|
|
26
|
-
}, p = {},
|
|
22
|
+
}, p = {}, c = a(() => import("./InkeepCustomTrigger-CE5-K5ex.js")), l = ({
|
|
27
23
|
prefilledQuery: e,
|
|
28
24
|
isOpen: r,
|
|
29
25
|
onClose: t,
|
|
30
26
|
settings: s
|
|
31
27
|
}) => /* @__PURE__ */ n.jsx(
|
|
32
|
-
|
|
28
|
+
c,
|
|
33
29
|
{
|
|
34
30
|
isOpen: r,
|
|
35
31
|
onClose: t,
|
|
36
|
-
baseSettings: { ...
|
|
32
|
+
baseSettings: { ...o, ...s },
|
|
37
33
|
aiChatSettings: p,
|
|
38
34
|
searchSettings: {
|
|
39
35
|
prefilledQuery: e || void 0
|
|
40
36
|
}
|
|
41
37
|
}
|
|
42
|
-
),
|
|
38
|
+
), d = (e) => ({
|
|
43
39
|
renderSearch: ({
|
|
44
40
|
isOpen: r,
|
|
45
41
|
onClose: t
|
|
46
|
-
}) => /* @__PURE__ */ n.jsx(
|
|
42
|
+
}) => /* @__PURE__ */ n.jsx(i, { children: /* @__PURE__ */ n.jsx(l, { isOpen: r, onClose: t, settings: e }) })
|
|
47
43
|
});
|
|
48
44
|
export {
|
|
49
|
-
|
|
45
|
+
d as inkeepSearchPlugin
|
|
50
46
|
};
|
|
51
47
|
//# sourceMappingURL=zudoku.plugin-search-inkeep.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zudoku.plugin-search-inkeep.js","sources":["../src/lib/
|
|
1
|
+
{"version":3,"file":"zudoku.plugin-search-inkeep.js","sources":["../src/lib/plugins/search-inkeep/inkeep.ts","../src/lib/plugins/search-inkeep/index.tsx"],"sourcesContent":["import {\n InkeepAIChatSettings,\n InkeepModalSettings,\n InkeepSearchSettings,\n} from \"@inkeep/widgets\";\n\nconst baseSettings = {\n theme: {\n components: {\n AIChatPageWrapper: {\n defaultProps: {\n size: \"shrink-vertically\",\n variant: \"no-shadow\",\n },\n },\n SearchBarTrigger: {\n defaultProps: {\n size: \"expand\",\n variant: \"subtle\", // Choose from 'emphasized' or 'subtle'\n },\n },\n },\n },\n} as const;\n\nconst modalSettings: InkeepModalSettings = {};\n\nconst searchSettings: InkeepSearchSettings = {};\n\nconst aiChatSettings: InkeepAIChatSettings = {};\n\nexport { aiChatSettings, baseSettings, modalSettings, searchSettings };\n","import type { InkeepWidgetBaseSettings } from \"@inkeep/widgets\";\nimport { lazy } from \"react\";\nimport { ClientOnly } from \"../../components/ClientOnly.js\";\nimport type { DevPortalPlugin } from \"../../core/plugins.js\";\nimport { aiChatSettings, baseSettings } from \"./inkeep.js\";\n\ntype PickedPluginInkeepBaseSettings =\n | \"apiKey\"\n | \"integrationId\"\n | \"organizationId\"\n | \"primaryBrandColor\"\n | \"organizationDisplayName\";\n\ntype PluginInkeepBaseSettings = Pick<\n InkeepWidgetBaseSettings,\n PickedPluginInkeepBaseSettings\n>;\n\nconst Inkeep = lazy(() => import(\"./InkeepCustomTrigger.js\"));\n\nconst InkeepSearch = ({\n prefilledQuery,\n isOpen,\n onClose,\n settings,\n}: {\n isOpen: boolean;\n onClose: () => void;\n prefilledQuery?: string | null;\n settings: PluginInkeepBaseSettings;\n}) => {\n return (\n <Inkeep\n isOpen={isOpen}\n onClose={onClose}\n baseSettings={{ ...baseSettings, ...settings }}\n aiChatSettings={aiChatSettings}\n searchSettings={{\n prefilledQuery: prefilledQuery || undefined,\n }}\n />\n );\n};\n\nexport const inkeepSearchPlugin = (\n settings: PluginInkeepBaseSettings,\n): DevPortalPlugin => {\n return {\n renderSearch: ({\n isOpen,\n onClose,\n }: {\n isOpen: boolean;\n onClose: () => void;\n }) => {\n return (\n <ClientOnly>\n <InkeepSearch isOpen={isOpen} onClose={onClose} settings={settings} />\n </ClientOnly>\n );\n },\n };\n};\n"],"names":["baseSettings","aiChatSettings","Inkeep","lazy","InkeepSearch","prefilledQuery","isOpen","onClose","settings","jsx","inkeepSearchPlugin","ClientOnly"],"mappings":";;;AAMA,MAAMA,IAAe;AAAA,EACnB,OAAO;AAAA,IACL,YAAY;AAAA,MACV,mBAAmB;AAAA,QACjB,cAAc;AAAA,UACZ,MAAM;AAAA,UACN,SAAS;AAAA,QACX;AAAA,MACF;AAAA,MACA,kBAAkB;AAAA,QAChB,cAAc;AAAA,UACZ,MAAM;AAAA,UACN,SAAS;AAAA;AAAA,QACX;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF,GAMMC,IAAuC,CAAC,GCXxCC,IAASC,EAAK,MAAM,OAAO,mCAA0B,CAAC,GAEtDC,IAAe,CAAC;AAAA,EACpB,gBAAAC;AAAA,EACA,QAAAC;AAAA,EACA,SAAAC;AAAA,EACA,UAAAC;AACF,MAOIC,gBAAAA,EAAA;AAAA,EAACP;AAAA,EAAA;AAAA,IACC,QAAAI;AAAA,IACA,SAAAC;AAAA,IACA,cAAc,EAAE,GAAGP,GAAc,GAAGQ,EAAS;AAAA,IAC7C,gBAAAP;AAAA,IACA,gBAAgB;AAAA,MACd,gBAAgBI,KAAkB;AAAA,IACpC;AAAA,EAAA;AAAA,GAKOK,IAAqB,CAChCF,OAEO;AAAA,EACL,cAAc,CAAC;AAAA,IACb,QAAAF;AAAA,IACA,SAAAC;AAAA,EAAA,4BAMGI,GACC,EAAA,UAAAF,gBAAAA,EAAAA,IAACL,KAAa,QAAAE,GAAgB,SAAAC,GAAkB,UAAAC,EAAoB,CAAA,EACtE,CAAA;AAEJ;"}
|
package/package.json
CHANGED
package/src/app/main.tsx
CHANGED
|
@@ -5,11 +5,11 @@ import { configuredAuthProvider } from "virtual:zudoku-auth";
|
|
|
5
5
|
import { configuredCustomPagesPlugin } from "virtual:zudoku-custom-pages-plugin";
|
|
6
6
|
import { configuredDocsPlugins } from "virtual:zudoku-docs-plugins";
|
|
7
7
|
import { configuredRedirectPlugin } from "virtual:zudoku-redirect-plugin";
|
|
8
|
+
import { configuredSearchPlugin } from "virtual:zudoku-search-plugin";
|
|
8
9
|
import { configuredSidebar } from "virtual:zudoku-sidebar";
|
|
9
10
|
import "virtual:zudoku-theme.css";
|
|
10
11
|
import { DevPortal, Layout, RouterError } from "zudoku/components";
|
|
11
12
|
import { isNavigationPlugin } from "zudoku/internal";
|
|
12
|
-
import { inkeepSearchPlugin } from "zudoku/plugins/search-inkeep";
|
|
13
13
|
import type { ZudokuConfig } from "../config/config.js";
|
|
14
14
|
import { traverseSidebar } from "../lib/components/navigation/utils.js";
|
|
15
15
|
import type { ZudokuContextOptions } from "../lib/core/DevPortalContext.js";
|
|
@@ -53,11 +53,9 @@ export const convertZudokuConfigToOptions = (
|
|
|
53
53
|
mdx: config.mdx,
|
|
54
54
|
authentication: configuredAuthProvider,
|
|
55
55
|
plugins: [
|
|
56
|
-
...(config.search?.type === "inkeep"
|
|
57
|
-
? [inkeepSearchPlugin(config.search)]
|
|
58
|
-
: []),
|
|
59
56
|
...configuredDocsPlugins,
|
|
60
57
|
...configuredApiPlugins,
|
|
58
|
+
...(configuredSearchPlugin ? [configuredSearchPlugin] : []),
|
|
61
59
|
...(configuredRedirectPlugin ? [configuredRedirectPlugin] : []),
|
|
62
60
|
...(configuredApiKeysPlugin ? [configuredApiKeysPlugin] : []),
|
|
63
61
|
...(configuredCustomPagesPlugin ? [configuredCustomPagesPlugin] : []),
|
|
@@ -2,6 +2,7 @@ import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
|
|
|
2
2
|
import { cx } from "class-variance-authority";
|
|
3
3
|
import { MenuIcon } from "lucide-react";
|
|
4
4
|
import { NavLink } from "react-router-dom";
|
|
5
|
+
import { useAuth } from "../authentication/hook.js";
|
|
5
6
|
import {
|
|
6
7
|
Drawer,
|
|
7
8
|
DrawerClose,
|
|
@@ -11,9 +12,12 @@ import {
|
|
|
11
12
|
} from "../ui/Drawer.js";
|
|
12
13
|
import { useZudoku } from "./context/ZudokuContext.js";
|
|
13
14
|
import { Search } from "./Search.js";
|
|
15
|
+
import { isHiddenItem } from "./TopNavigation.js";
|
|
14
16
|
|
|
15
17
|
export const MobileTopNavigation = () => {
|
|
16
18
|
const { topNavigation } = useZudoku();
|
|
19
|
+
const { isAuthenticated } = useAuth();
|
|
20
|
+
|
|
17
21
|
return (
|
|
18
22
|
<Drawer direction="right">
|
|
19
23
|
<div className="flex lg:hidden justify-self-end">
|
|
@@ -32,7 +36,7 @@ export const MobileTopNavigation = () => {
|
|
|
32
36
|
<Search />
|
|
33
37
|
</div>
|
|
34
38
|
<ul className="flex flex-col items-center gap-4 p-4">
|
|
35
|
-
{topNavigation.map((item) => (
|
|
39
|
+
{topNavigation.filter(isHiddenItem(isAuthenticated)).map((item) => (
|
|
36
40
|
<li key={item.label}>
|
|
37
41
|
<NavLink
|
|
38
42
|
className={({ isActive }) =>
|
|
@@ -1,10 +1,23 @@
|
|
|
1
1
|
import { cx } from "class-variance-authority";
|
|
2
2
|
import { NavLink } from "react-router-dom";
|
|
3
3
|
|
|
4
|
+
import { useAuth } from "../authentication/hook.js";
|
|
4
5
|
import { useZudoku } from "./context/ZudokuContext.js";
|
|
5
6
|
|
|
7
|
+
export const isHiddenItem =
|
|
8
|
+
(isAuthenticated?: boolean) =>
|
|
9
|
+
(item: { display?: "auth" | "anon" | "always" }) => {
|
|
10
|
+
return (
|
|
11
|
+
(item.display === "auth" && isAuthenticated) ||
|
|
12
|
+
(item.display === "anon" && !isAuthenticated) ||
|
|
13
|
+
!item.display ||
|
|
14
|
+
item.display === "always"
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
|
|
6
18
|
export const TopNavigation = () => {
|
|
7
19
|
const { topNavigation } = useZudoku();
|
|
20
|
+
const { isAuthenticated } = useAuth();
|
|
8
21
|
|
|
9
22
|
// Hide top nav if there is only one item
|
|
10
23
|
if (topNavigation.length <= 1) {
|
|
@@ -14,7 +27,7 @@ export const TopNavigation = () => {
|
|
|
14
27
|
return (
|
|
15
28
|
<nav className="hidden lg:block border-b text-sm px-12 h-[--top-nav-height]">
|
|
16
29
|
<ul className="flex flex-row items-center gap-8">
|
|
17
|
-
{topNavigation.map((item) => (
|
|
30
|
+
{topNavigation.filter(isHiddenItem(isAuthenticated)).map((item) => (
|
|
18
31
|
<li key={item.label}>
|
|
19
32
|
<NavLink
|
|
20
33
|
className={({ isActive }) =>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useMDXComponents as useMDXComponentsImport } from "@mdx-js/react";
|
|
2
2
|
import { Helmet } from "@zudoku/react-helmet-async";
|
|
3
3
|
import { Link as LinkImport } from "react-router-dom";
|
|
4
|
+
import { useAuthState } from "../authentication/state.js";
|
|
4
5
|
import { RouterError as RouterErrorImport } from "../errors/RouterError.js";
|
|
5
6
|
import { ServerError as ServerErrorImport } from "../errors/ServerError.js";
|
|
6
7
|
import { Button as ButtonImport } from "../ui/Button.js";
|
|
@@ -9,17 +10,25 @@ import {
|
|
|
9
10
|
Bootstrap as BootstrapImport,
|
|
10
11
|
BootstrapStatic as BootstrapStaticImport,
|
|
11
12
|
} from "./Bootstrap.js";
|
|
13
|
+
import { ClientOnly as ClientOnlyImport } from "./ClientOnly.js";
|
|
12
14
|
import { DevPortal as DevPortalImport } from "./DevPortal.js";
|
|
13
15
|
import { Layout as LayoutImport } from "./Layout.js";
|
|
14
|
-
|
|
16
|
+
import { useZudoku as useZudokuImport } from "./context/ZudokuContext.js";
|
|
15
17
|
export const useMDXComponents = /*@__PURE__*/ useMDXComponentsImport;
|
|
16
|
-
export const Callout = /*@__PURE__*/ CalloutImport;
|
|
17
18
|
export const DevPortal = /*@__PURE__*/ DevPortalImport;
|
|
18
19
|
export const Layout = /*@__PURE__*/ LayoutImport;
|
|
19
|
-
export const Link: typeof LinkImport = /*@__PURE__*/ LinkImport;
|
|
20
20
|
export const RouterError = /*@__PURE__*/ RouterErrorImport;
|
|
21
21
|
export const ServerError = /*@__PURE__*/ ServerErrorImport;
|
|
22
22
|
export const Bootstrap = /*@__PURE__*/ BootstrapImport;
|
|
23
23
|
export const BootstrapStatic = /*@__PURE__*/ BootstrapStaticImport;
|
|
24
|
-
|
|
24
|
+
|
|
25
25
|
export const Head = /*@__PURE__*/ Helmet;
|
|
26
|
+
|
|
27
|
+
export const useZudoku = /*@__PURE__*/ useZudokuImport;
|
|
28
|
+
export const useAuth = /*@__PURE__*/ useAuthState;
|
|
29
|
+
export const Zudoku = /*@__PURE__*/ DevPortalImport;
|
|
30
|
+
|
|
31
|
+
export const Callout = /*@__PURE__*/ CalloutImport;
|
|
32
|
+
export const ClientOnly = /*@__PURE__*/ ClientOnlyImport;
|
|
33
|
+
export const Button = /*@__PURE__*/ ButtonImport;
|
|
34
|
+
export const Link: typeof LinkImport = /*@__PURE__*/ LinkImport;
|
|
@@ -60,7 +60,12 @@ export type ZudokuContextOptions = {
|
|
|
60
60
|
metadata?: Metadata;
|
|
61
61
|
page?: Page;
|
|
62
62
|
authentication?: AuthenticationProvider;
|
|
63
|
-
topNavigation?: Array<{
|
|
63
|
+
topNavigation?: Array<{
|
|
64
|
+
id: string;
|
|
65
|
+
label: string;
|
|
66
|
+
default?: string;
|
|
67
|
+
display?: "auth" | "anon" | "always";
|
|
68
|
+
}>;
|
|
64
69
|
sidebars?: SidebarConfig;
|
|
65
70
|
plugins?: DevPortalPlugin[];
|
|
66
71
|
slotlets?: Slotlets;
|