zudoku 0.23.4 → 0.23.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.
Files changed (38) hide show
  1. package/dist/config/validators/common.d.ts +37 -37
  2. package/dist/config/validators/common.js +4 -1
  3. package/dist/config/validators/common.js.map +1 -1
  4. package/dist/config/validators/validate.d.ts +14 -14
  5. package/dist/lib/plugins/openapi/OperationList.js +7 -33
  6. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  7. package/dist/lib/plugins/openapi/Route.d.ts +4 -2
  8. package/dist/lib/plugins/openapi/Route.js +25 -2
  9. package/dist/lib/plugins/openapi/Route.js.map +1 -1
  10. package/dist/lib/plugins/openapi/context.d.ts +3 -3
  11. package/dist/lib/plugins/openapi/index.js +12 -12
  12. package/dist/lib/plugins/openapi/index.js.map +1 -1
  13. package/dist/lib/plugins/openapi/interfaces.d.ts +19 -0
  14. package/dist/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.d.ts +1 -0
  15. package/dist/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.js +27 -0
  16. package/dist/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.js.map +1 -0
  17. package/dist/vite/config.js +2 -1
  18. package/dist/vite/config.js.map +1 -1
  19. package/dist/vite/plugin-api.js +35 -14
  20. package/dist/vite/plugin-api.js.map +1 -1
  21. package/lib/{OperationList-C7ac3kR5.js → OperationList-wvY-BrxS.js} +1173 -1157
  22. package/lib/OperationList-wvY-BrxS.js.map +1 -0
  23. package/lib/Route-C8nwd9A2.js +37 -0
  24. package/lib/Route-C8nwd9A2.js.map +1 -0
  25. package/lib/context-h_UkBLvr.js.map +1 -1
  26. package/lib/{index-C8ubT49C.js → index-C_ul-2fb.js} +442 -437
  27. package/lib/{index-C8ubT49C.js.map → index-C_ul-2fb.js.map} +1 -1
  28. package/lib/zudoku.plugin-openapi.js +1 -1
  29. package/package.json +1 -1
  30. package/src/lib/plugins/openapi/OperationList.tsx +42 -50
  31. package/src/lib/plugins/openapi/Route.tsx +45 -9
  32. package/src/lib/plugins/openapi/context.tsx +2 -2
  33. package/src/lib/plugins/openapi/index.tsx +35 -28
  34. package/src/lib/plugins/openapi/interfaces.ts +22 -1
  35. package/src/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.tsx +32 -0
  36. package/lib/OperationList-C7ac3kR5.js.map +0 -1
  37. package/lib/Route-C9cYcP-j.js +0 -11
  38. package/lib/Route-C9cYcP-j.js.map +0 -1
@@ -0,0 +1,37 @@
1
+ import { j as e } from "./jsx-runtime-Dx-03ztt.js";
2
+ import { c as u, O as m } from "./chunk-D52XG6IA-Dl7HLe6j.js";
3
+ import { j } from "./utils-B4O1uet5.js";
4
+ import { O, G as l } from "./context-h_UkBLvr.js";
5
+ const h = ({
6
+ basePath: i,
7
+ versions: s,
8
+ config: t,
9
+ client: n
10
+ }) => {
11
+ const { version: r } = u(), a = t.type === "file" ? {
12
+ type: t.type,
13
+ input: r ? t.input[r] : Object.values(t.input).at(0)
14
+ } : { type: t.type, input: t.input }, o = r ?? s.at(0);
15
+ if (!o)
16
+ throw new Error("No version found");
17
+ return /* @__PURE__ */ e.jsx(
18
+ O,
19
+ {
20
+ value: {
21
+ config: {
22
+ ...t,
23
+ version: o,
24
+ versions: Object.fromEntries(
25
+ s.map((p) => [p, j(i, p)])
26
+ ),
27
+ ...a
28
+ }
29
+ },
30
+ children: /* @__PURE__ */ e.jsx(l, { client: n, children: /* @__PURE__ */ e.jsx(m, {}) })
31
+ }
32
+ );
33
+ };
34
+ export {
35
+ h as OpenApiRoute
36
+ };
37
+ //# sourceMappingURL=Route-C8nwd9A2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Route-C8nwd9A2.js","sources":["../src/lib/plugins/openapi/Route.tsx"],"sourcesContent":["import { Outlet, useParams } from \"react-router\";\nimport { joinPath } from \"../../util/joinPath.js\";\nimport type { GraphQLClient } from \"./client/GraphQLClient.js\";\nimport { GraphQLProvider } from \"./client/GraphQLContext.js\";\nimport { OasConfigProvider } from \"./context.js\";\nimport { type OasPluginConfig } from \"./interfaces.js\";\n\nexport const OpenApiRoute = ({\n basePath,\n versions,\n config,\n client,\n}: {\n basePath: string;\n versions: string[];\n config: OasPluginConfig;\n client: GraphQLClient;\n}) => {\n const { version } = useParams<\"version\">();\n\n const input =\n config.type === \"file\"\n ? {\n type: config.type,\n input: version\n ? config.input[version]!\n : Object.values(config.input).at(0)!,\n }\n : { type: config.type, input: config.input };\n\n const currentVersion = version ?? versions.at(0);\n\n if (!currentVersion) {\n throw new Error(\"No version found\");\n }\n\n return (\n <OasConfigProvider\n value={{\n config: {\n ...config,\n version: currentVersion,\n versions: Object.fromEntries(\n versions.map((version) => [version, joinPath(basePath, version)]),\n ),\n ...input,\n },\n }}\n >\n <GraphQLProvider client={client}>\n <Outlet />\n </GraphQLProvider>\n </OasConfigProvider>\n );\n};\n"],"names":["OpenApiRoute","basePath","versions","config","client","version","useParams","input","currentVersion","jsx","OasConfigProvider","joinPath","GraphQLProvider","Outlet"],"mappings":";;;;AAOO,MAAMA,IAAe,CAAC;AAAA,EAC3B,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,QAAAC;AACF,MAKM;AACE,QAAA,EAAE,SAAAC,EAAQ,IAAIC,EAAqB,GAEnCC,IACJJ,EAAO,SAAS,SACZ;AAAA,IACE,MAAMA,EAAO;AAAA,IACb,OAAOE,IACHF,EAAO,MAAME,CAAO,IACpB,OAAO,OAAOF,EAAO,KAAK,EAAE,GAAG,CAAC;AAAA,EAAA,IAEtC,EAAE,MAAMA,EAAO,MAAM,OAAOA,EAAO,MAAM,GAEzCK,IAAiBH,KAAWH,EAAS,GAAG,CAAC;AAE/C,MAAI,CAACM;AACG,UAAA,IAAI,MAAM,kBAAkB;AAIlC,SAAAC,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,OAAO;AAAA,QACL,QAAQ;AAAA,UACN,GAAGP;AAAA,UACH,SAASK;AAAA,UACT,UAAU,OAAO;AAAA,YACfN,EAAS,IAAI,CAACG,MAAY,CAACA,GAASM,EAASV,GAAUI,CAAO,CAAC,CAAC;AAAA,UAClE;AAAA,UACA,GAAGE;AAAA,QAAA;AAAA,MAEP;AAAA,MAEA,UAACE,gBAAAA,EAAAA,IAAAG,GAAA,EAAgB,QAAAR,GACf,UAAAK,gBAAAA,EAAA,IAACI,KAAO,EACV,CAAA;AAAA,IAAA;AAAA,EACF;AAEJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"context-h_UkBLvr.js","sources":["../src/lib/plugins/openapi/client/GraphQLContext.tsx","../src/lib/plugins/openapi/context.tsx"],"sourcesContent":["import { createContext, type ReactNode } from \"react\";\nimport { GraphQLClient } from \"./GraphQLClient.js\";\n\nexport const GraphQLContext = createContext<GraphQLClient | undefined>(\n undefined,\n);\n\nexport const GraphQLProvider = ({\n children,\n client,\n}: {\n children: ReactNode;\n client: GraphQLClient;\n}) => (\n <GraphQLContext.Provider value={client}>{children}</GraphQLContext.Provider>\n);\n","import { createContext, useContext } from \"react\";\nimport { OasPluginConfig } from \"./interfaces.js\";\n\nconst OasContext = createContext<{ config: OasPluginConfig } | undefined>(\n undefined,\n);\n\nexport const OasConfigProvider = OasContext.Provider;\n\nexport const useOasConfig = () => {\n const ctx = useContext(OasContext);\n if (!ctx) {\n throw new Error(\"useOasConfig must be used within a OasConfigProvider\");\n }\n return ctx.config;\n};\n"],"names":["GraphQLContext","createContext","GraphQLProvider","children","client","OasContext","OasConfigProvider","useOasConfig","ctx","useContext"],"mappings":";;AAGO,MAAMA,IAAiBC;AAAA,EAC5B;AACF,GAEaC,IAAkB,CAAC;AAAA,EAC9B,UAAAC;AAAA,EACA,QAAAC;AACF,4BAIGJ,EAAe,UAAf,EAAwB,OAAOI,GAAS,UAAAD,EAAS,CAAA,GCX9CE,IAAaJ;AAAA,EACjB;AACF,GAEaK,IAAoBD,EAAW,UAE/BE,IAAe,MAAM;AAC1B,QAAAC,IAAMC,EAAWJ,CAAU;AACjC,MAAI,CAACG;AACG,UAAA,IAAI,MAAM,sDAAsD;AAExE,SAAOA,EAAI;AACb;"}
1
+ {"version":3,"file":"context-h_UkBLvr.js","sources":["../src/lib/plugins/openapi/client/GraphQLContext.tsx","../src/lib/plugins/openapi/context.tsx"],"sourcesContent":["import { createContext, type ReactNode } from \"react\";\nimport { GraphQLClient } from \"./GraphQLClient.js\";\n\nexport const GraphQLContext = createContext<GraphQLClient | undefined>(\n undefined,\n);\n\nexport const GraphQLProvider = ({\n children,\n client,\n}: {\n children: ReactNode;\n client: GraphQLClient;\n}) => (\n <GraphQLContext.Provider value={client}>{children}</GraphQLContext.Provider>\n);\n","import { createContext, useContext } from \"react\";\nimport { OasPluginContext } from \"./interfaces.js\";\n\nconst OasContext = createContext<{ config: OasPluginContext } | undefined>(\n undefined,\n);\n\nexport const OasConfigProvider = OasContext.Provider;\n\nexport const useOasConfig = () => {\n const ctx = useContext(OasContext);\n if (!ctx) {\n throw new Error(\"useOasConfig must be used within a OasConfigProvider\");\n }\n return ctx.config;\n};\n"],"names":["GraphQLContext","createContext","GraphQLProvider","children","client","OasContext","OasConfigProvider","useOasConfig","ctx","useContext"],"mappings":";;AAGO,MAAMA,IAAiBC;AAAA,EAC5B;AACF,GAEaC,IAAkB,CAAC;AAAA,EAC9B,UAAAC;AAAA,EACA,QAAAC;AACF,4BAIGJ,EAAe,UAAf,EAAwB,OAAOI,GAAS,UAAAD,EAAS,CAAA,GCX9CE,IAAaJ;AAAA,EACjB;AACF,GAEaK,IAAoBD,EAAW,UAE/BE,IAAe,MAAM;AAC1B,QAAAC,IAAMC,EAAWJ,CAAU;AACjC,MAAI,CAACG;AACG,UAAA,IAAI,MAAM,sDAAsD;AAExE,SAAOA,EAAI;AACb;"}