zudoku 0.13.4 → 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.
@@ -1,11 +1,7 @@
1
1
  import { j as n } from "./jsx-runtime-B6kdoens.js";
2
- import { useSyncExternalStore as a, lazy as i } from "react";
3
- const o = () => () => {
4
- }, c = (e) => a(
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 = {}, u = i(() => import("./InkeepCustomTrigger-CE5-K5ex.js")), h = ({
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
- u,
28
+ c,
33
29
  {
34
30
  isOpen: r,
35
31
  onClose: t,
36
- baseSettings: { ...l, ...s },
32
+ baseSettings: { ...o, ...s },
37
33
  aiChatSettings: p,
38
34
  searchSettings: {
39
35
  prefilledQuery: e || void 0
40
36
  }
41
37
  }
42
- ), g = (e) => ({
38
+ ), d = (e) => ({
43
39
  renderSearch: ({
44
40
  isOpen: r,
45
41
  onClose: t
46
- }) => /* @__PURE__ */ n.jsx(c, { children: /* @__PURE__ */ n.jsx(h, { isOpen: r, onClose: t, settings: e }) })
42
+ }) => /* @__PURE__ */ n.jsx(i, { children: /* @__PURE__ */ n.jsx(l, { isOpen: r, onClose: t, settings: e }) })
47
43
  });
48
44
  export {
49
- g as inkeepSearchPlugin
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/components/ClientOnly.tsx","../src/lib/plugins/search-inkeep/inkeep.ts","../src/lib/plugins/search-inkeep/index.tsx"],"sourcesContent":["import { useSyncExternalStore } from \"react\";\n\nconst noop = () => () => {};\n\nexport const ClientOnly = (props: { children: React.ReactNode }) => {\n const value = useSyncExternalStore(\n noop,\n () => \"client\",\n () => \"server\",\n );\n\n return value === \"client\" ? props.children : null;\n};\n","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":["noop","ClientOnly","props","useSyncExternalStore","baseSettings","aiChatSettings","Inkeep","lazy","InkeepSearch","prefilledQuery","isOpen","onClose","settings","jsx","inkeepSearchPlugin"],"mappings":";;AAEA,MAAMA,IAAO,MAAM,MAAM;AAAC,GAEbC,IAAa,CAACC,MACXC;AAAA,EACZH;AAAA,EACA,MAAM;AAAA,EACN,MAAM;AAAA,MAGS,WAAWE,EAAM,WAAW,MCLzCE,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,4BAMGV,GACC,EAAA,UAAAY,gBAAAA,EAAAA,IAACL,KAAa,QAAAE,GAAgB,SAAAC,GAAkB,UAAAC,EAAoB,CAAA,EACtE,CAAA;AAEJ;"}
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zudoku",
3
- "version": "0.13.4",
3
+ "version": "0.13.5",
4
4
  "type": "module",
5
5
  "homepage": "https://zudoku.dev",
6
6
  "repository": {
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] : []),
@@ -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,19 +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
-
16
17
  export const useMDXComponents = /*@__PURE__*/ useMDXComponentsImport;
17
- export const Callout = /*@__PURE__*/ CalloutImport;
18
18
  export const DevPortal = /*@__PURE__*/ DevPortalImport;
19
19
  export const Layout = /*@__PURE__*/ LayoutImport;
20
- export const Link: typeof LinkImport = /*@__PURE__*/ LinkImport;
21
20
  export const RouterError = /*@__PURE__*/ RouterErrorImport;
22
21
  export const ServerError = /*@__PURE__*/ ServerErrorImport;
23
22
  export const Bootstrap = /*@__PURE__*/ BootstrapImport;
24
23
  export const BootstrapStatic = /*@__PURE__*/ BootstrapStaticImport;
25
- export const Button = /*@__PURE__*/ ButtonImport;
24
+
26
25
  export const Head = /*@__PURE__*/ Helmet;
26
+
27
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;