zudoku 0.3.0-dev.79 → 0.3.0-dev.80

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 (45) hide show
  1. package/dist/lib/plugins/openapi/Sidecar.d.ts +4 -0
  2. package/dist/lib/plugins/openapi/Sidecar.js +1 -1
  3. package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
  4. package/dist/lib/plugins/openapi/index.js +25 -5
  5. package/dist/lib/plugins/openapi/index.js.map +1 -1
  6. package/lib/{AuthenticationPlugin-CngUn5DP.js → AuthenticationPlugin-XS0DoAhE.js} +2 -2
  7. package/lib/{AuthenticationPlugin-CngUn5DP.js.map → AuthenticationPlugin-XS0DoAhE.js.map} +1 -1
  8. package/lib/{Combination-CS4rK8IJ.js → Combination-C442XfGG.js} +368 -347
  9. package/lib/Combination-C442XfGG.js.map +1 -0
  10. package/lib/{DevPortalProvider-BTFqdAEL.js → DevPortalProvider-BWeAysxF.js} +6 -5
  11. package/lib/{DevPortalProvider-BTFqdAEL.js.map → DevPortalProvider-BWeAysxF.js.map} +1 -1
  12. package/lib/{Input-GFpPXs5b.js → Input-3IEt27jb.js} +3 -3
  13. package/lib/{Input-GFpPXs5b.js.map → Input-3IEt27jb.js.map} +1 -1
  14. package/lib/{MdxPage-V4FCB0C_.js → MdxPage-CA1WmW14.js} +2 -2
  15. package/lib/{MdxPage-V4FCB0C_.js.map → MdxPage-CA1WmW14.js.map} +1 -1
  16. package/lib/OperationList-rv6Z3wD3.js +431 -0
  17. package/lib/OperationList-rv6Z3wD3.js.map +1 -0
  18. package/lib/{Route-CogU1ofM.js → Route-Clw81GSR.js} +2 -2
  19. package/lib/{Route-CogU1ofM.js.map → Route-Clw81GSR.js.map} +1 -1
  20. package/lib/{SlotletProvider-D_Vz-7c_.js → SlotletProvider-B71hNEUL.js} +24 -45
  21. package/lib/SlotletProvider-B71hNEUL.js.map +1 -0
  22. package/lib/{Spinner-oNQQyp-I.js → Spinner-Coi7ORUV.js} +2 -2
  23. package/lib/{Spinner-oNQQyp-I.js.map → Spinner-Coi7ORUV.js.map} +1 -1
  24. package/lib/{index-D4bOMg7f.js → index-BH-Ub36F.js} +5 -5
  25. package/lib/{index-D4bOMg7f.js.map → index-BH-Ub36F.js.map} +1 -1
  26. package/lib/index-CLkuJSxj.js +5950 -0
  27. package/lib/index-CLkuJSxj.js.map +1 -0
  28. package/lib/zudoku.auth-clerk.js +1 -1
  29. package/lib/zudoku.auth-openid.js +1 -1
  30. package/lib/zudoku.components.js +25 -25
  31. package/lib/zudoku.plugin-api-keys.js +12 -12
  32. package/lib/zudoku.plugin-markdown.js +2 -2
  33. package/lib/zudoku.plugin-openapi.js +4 -3
  34. package/lib/zudoku.plugin-openapi.js.map +1 -1
  35. package/package.json +1 -1
  36. package/src/lib/plugins/openapi/Sidecar.tsx +1 -1
  37. package/src/lib/plugins/openapi/index.tsx +52 -16
  38. package/lib/Combination-CS4rK8IJ.js.map +0 -1
  39. package/lib/OperationList-C-M33Hxu.js +0 -4368
  40. package/lib/OperationList-C-M33Hxu.js.map +0 -1
  41. package/lib/SlotletProvider-D_Vz-7c_.js.map +0 -1
  42. package/lib/context-_fYfJFgk.js +0 -14
  43. package/lib/context-_fYfJFgk.js.map +0 -1
  44. package/lib/index-Uqja2h2M.js +0 -1960
  45. package/lib/index-Uqja2h2M.js.map +0 -1
@@ -1,7 +1,7 @@
1
1
  var u = Object.defineProperty;
2
2
  var d = (n, i, e) => i in n ? u(n, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[i] = e;
3
3
  var a = (n, i, e) => d(n, typeof i != "symbol" ? i + "" : i, e);
4
- import { A as w } from "./AuthenticationPlugin-CngUn5DP.js";
4
+ import { A as w } from "./AuthenticationPlugin-XS0DoAhE.js";
5
5
  import { u as l } from "./state-DsXXkBLH.js";
6
6
  class g extends w {
7
7
  constructor(e) {
@@ -3,7 +3,7 @@ var Re = (t, e, n) => e in t ? Ee(t, e, { enumerable: !0, configurable: !0, writ
3
3
  var g = (t, e, n) => Re(t, typeof e != "symbol" ? e + "" : e, n);
4
4
  import { j as Pe } from "./jsx-runtime-CJBdjYYx.js";
5
5
  import { c as Ue, a as xe } from "./_commonjsHelpers-BVfed4GL.js";
6
- import { A as Le } from "./AuthenticationPlugin-CngUn5DP.js";
6
+ import { A as Le } from "./AuthenticationPlugin-XS0DoAhE.js";
7
7
  import { u as ne } from "./state-DsXXkBLH.js";
8
8
  var de = { exports: {} };
9
9
  (function(t) {
@@ -15,17 +15,17 @@ var Ce = (t, e, n, r) => ({
15
15
  });
16
16
  import { H as _t, a as Ge, M as ur, A as lr, u as dr } from "./AnchorLink-BZcpTwOs.js";
17
17
  import { d as hr, R as pr, N as $e, L as Ee } from "./index-Dt-pU7Vu.js";
18
- import { E as Et, u as fr, S as mr, a as Se, R as gr } from "./SlotletProvider-D_Vz-7c_.js";
19
- import { j as o, d as vr, u as J, a as xr, b as yr, O as St } from "./jsx-runtime-CJBdjYYx.js";
20
- import { M as wr, c as Mr, a as jt, b as Nt, A as br, u as fe, h as Cr, d as y, e as Pr, F as Rr, D as _r, C as Er, P as ie, f as qe, g as Sr, i as Dt, R as jr, S as Nr, j as Dr, k as Ir, l as It, m as Ar, n as je, o as At, B as Be } from "./Combination-CS4rK8IJ.js";
18
+ import { E as Et, S as fr, a as Se, R as mr } from "./SlotletProvider-B71hNEUL.js";
19
+ import { j as o, d as gr, u as J, a as vr, b as xr, O as St } from "./jsx-runtime-CJBdjYYx.js";
20
+ import { M as yr, c as wr, a as jt, b as Nt, A as Mr, u as fe, h as br, d as y, e as Cr, F as Pr, D as Rr, C as _r, P as ie, f as qe, g as Er, i as Dt, R as Sr, S as jr, j as Nr, k as Dr, l as It, m as Ir, n as je, o as At, p as Ar, B as Be } from "./Combination-C442XfGG.js";
21
21
  import { c as me, a as P, C as Or, b as Tr, u as kr, M as Fr, T as Lr, V as Kr, d as He, e as $r, f as Br } from "./Markdown-QsZ-PHET.js";
22
22
  import * as u from "react";
23
23
  import Qr, { StrictMode as Ot, createContext as Tt, Component as Ur, createElement as pt, isValidElement as Gr, memo as kt, useMemo as Le, useState as le, useContext as qr, useRef as ge, useEffect as W, Fragment as Hr, forwardRef as zr, Suspense as Vr } from "react";
24
24
  import { g as ze } from "./_commonjsHelpers-BVfed4GL.js";
25
25
  import { r as Yr } from "./router-BiRCp01d.js";
26
- import { S as Qe, R as Ft, T as Lt, C as Kt } from "./index-D4bOMg7f.js";
27
- import { S as $t, h as Bt, Q as Xr, n as j, m as ft, a as mt, b as Q, e as Wr, c as Jr, d as Zr, f as ea, o as gt, r as vt, g as ta, i as xt, p as yt, s as na, u as Ve, j as ra, D as aa, k as Ye, l as wt, q as Qt, t as oa, v as sa, w as ia } from "./DevPortalProvider-BTFqdAEL.js";
28
- import { c as Ut, P as Ie, R as ca, I as ua, S as la } from "./Spinner-oNQQyp-I.js";
26
+ import { S as Qe, R as Ft, T as Lt, C as Kt } from "./index-BH-Ub36F.js";
27
+ import { S as $t, h as Bt, Q as Xr, n as j, m as ft, a as mt, b as Q, e as Wr, c as Jr, d as Zr, f as ea, o as gt, r as vt, g as ta, i as xt, p as yt, s as na, u as Ve, j as ra, D as aa, k as Ye, l as wt, q as Qt, t as oa, v as sa, w as ia } from "./DevPortalProvider-BWeAysxF.js";
28
+ import { c as Ut, P as Ie, R as ca, I as ua, S as la } from "./Spinner-Coi7ORUV.js";
29
29
  /**
30
30
  * @license lucide-react v0.378.0 - ISC
31
31
  *
@@ -87,7 +87,7 @@ function ma({ error: t }) {
87
87
  return /* @__PURE__ */ o.jsx(Et, { error: t });
88
88
  }
89
89
  var ve = {};
90
- const ga = /* @__PURE__ */ ze(Yr), va = /* @__PURE__ */ ze(vr), xa = /* @__PURE__ */ ze(hr);
90
+ const ga = /* @__PURE__ */ ze(Yr), va = /* @__PURE__ */ ze(gr), xa = /* @__PURE__ */ ze(hr);
91
91
  Object.defineProperty(ve, "__esModule", { value: !0 });
92
92
  var ya = Qr, K = ga, We = va, U = xa;
93
93
  function wa(t) {
@@ -443,7 +443,7 @@ var L, Ct, Oa = (Ct = class extends $t {
443
443
  this.config = e, b(this, S, /* @__PURE__ */ new Map()), b(this, pe, Date.now());
444
444
  }
445
445
  build(e, n, r) {
446
- const a = new wr({
446
+ const a = new yr({
447
447
  mutationCache: this,
448
448
  mutationId: ++Ce(this, pe)._,
449
449
  options: e.defaultMutationOptions(n),
@@ -940,12 +940,12 @@ var Ue = ["Enter", " "], Xa = ["ArrowDown", "PageUp", "Home"], Vt = ["ArrowUp",
940
940
  }, Za = {
941
941
  ltr: ["ArrowLeft"],
942
942
  rtl: ["ArrowRight"]
943
- }, xe = "Menu", [de, eo, to] = Mr(xe), [Z, Yt] = jt(xe, [
943
+ }, xe = "Menu", [de, eo, to] = wr(xe), [Z, Yt] = jt(xe, [
944
944
  to,
945
945
  Nt,
946
946
  Ut
947
947
  ]), ye = Nt(), Xt = Ut(), [Wt, V] = Z(xe), [no, we] = Z(xe), Jt = (t) => {
948
- const { __scopeMenu: e, open: n = !1, children: r, dir: a, onOpenChange: s, modal: i = !0 } = t, c = ye(e), [l, p] = u.useState(null), f = u.useRef(!1), d = qe(s), g = Ir(a);
948
+ const { __scopeMenu: e, open: n = !1, children: r, dir: a, onOpenChange: s, modal: i = !0 } = t, c = ye(e), [l, p] = u.useState(null), f = u.useRef(!1), d = qe(s), g = Dr(a);
949
949
  return u.useEffect(() => {
950
950
  const v = () => {
951
951
  f.current = !0, document.addEventListener("pointerdown", x, { capture: !0, once: !0 }), document.addEventListener("pointermove", x, { capture: !0, once: !0 });
@@ -979,7 +979,7 @@ Jt.displayName = xe;
979
979
  var ro = "MenuAnchor", Je = u.forwardRef(
980
980
  (t, e) => {
981
981
  const { __scopeMenu: n, ...r } = t, a = ye(n);
982
- return /* @__PURE__ */ o.jsx(br, { ...a, ...r, ref: e });
982
+ return /* @__PURE__ */ o.jsx(Mr, { ...a, ...r, ref: e });
983
983
  }
984
984
  );
985
985
  Je.displayName = ro;
@@ -987,7 +987,7 @@ var Ze = "MenuPortal", [ao, Zt] = Z(Ze, {
987
987
  forceMount: void 0
988
988
  }), en = (t) => {
989
989
  const { __scopeMenu: e, forceMount: n, children: r, container: a } = t, s = V(Ze, e);
990
- return /* @__PURE__ */ o.jsx(ao, { scope: e, forceMount: n, children: /* @__PURE__ */ o.jsx(Ie, { present: n || s.open, children: /* @__PURE__ */ o.jsx(Ar, { asChild: !0, container: a, children: r }) }) });
990
+ return /* @__PURE__ */ o.jsx(ao, { scope: e, forceMount: n, children: /* @__PURE__ */ o.jsx(Ie, { present: n || s.open, children: /* @__PURE__ */ o.jsx(Ir, { asChild: !0, container: a, children: r }) }) });
991
991
  };
992
992
  en.displayName = Ze;
993
993
  var T = "MenuContent", [oo, et] = Z(T), tn = u.forwardRef(
@@ -1000,7 +1000,7 @@ var T = "MenuContent", [oo, et] = Z(T), tn = u.forwardRef(
1000
1000
  const n = V(T, t.__scopeMenu), r = u.useRef(null), a = fe(e, r);
1001
1001
  return u.useEffect(() => {
1002
1002
  const s = r.current;
1003
- if (s) return Cr(s);
1003
+ if (s) return br(s);
1004
1004
  }, []), /* @__PURE__ */ o.jsx(
1005
1005
  tt,
1006
1006
  {
@@ -1048,14 +1048,14 @@ var T = "MenuContent", [oo, et] = Z(T), tn = u.forwardRef(
1048
1048
  onDismiss: v,
1049
1049
  disableOutsideScroll: x,
1050
1050
  ...R
1051
- } = t, N = V(T, n), _ = we(T, n), D = ye(n), w = Xt(n), E = eo(n), [$, Y] = u.useState(null), ee = u.useRef(null), Me = fe(e, ee, N.onContentChange), X = u.useRef(0), be = u.useRef(""), rr = u.useRef(0), Oe = u.useRef(null), it = u.useRef("right"), Te = u.useRef(0), ar = x ? jr : u.Fragment, or = x ? { as: Nr, allowPinchZoom: !0 } : void 0, sr = (m) => {
1051
+ } = t, N = V(T, n), _ = we(T, n), D = ye(n), w = Xt(n), E = eo(n), [$, Y] = u.useState(null), ee = u.useRef(null), Me = fe(e, ee, N.onContentChange), X = u.useRef(0), be = u.useRef(""), rr = u.useRef(0), Oe = u.useRef(null), it = u.useRef("right"), Te = u.useRef(0), ar = x ? Sr : u.Fragment, or = x ? { as: jr, allowPinchZoom: !0 } : void 0, sr = (m) => {
1052
1052
  var ne, ut;
1053
1053
  const I = be.current + m, k = E().filter((B) => !B.disabled), G = document.activeElement, ke = (ne = k.find((B) => B.ref.current === G)) == null ? void 0 : ne.textValue, Fe = k.map((B) => B.textValue), ct = wo(Fe, I, ke), ce = (ut = k.find((B) => B.textValue === ct)) == null ? void 0 : ut.ref.current;
1054
1054
  (function B(lt) {
1055
1055
  be.current = lt, window.clearTimeout(X.current), lt !== "" && (X.current = window.setTimeout(() => B(""), 1e3));
1056
1056
  })(I), ce && setTimeout(() => ce.focus());
1057
1057
  };
1058
- u.useEffect(() => () => window.clearTimeout(X.current), []), Pr();
1058
+ u.useEffect(() => () => window.clearTimeout(X.current), []), Cr();
1059
1059
  const te = u.useCallback((m) => {
1060
1060
  var k, G;
1061
1061
  return it.current === ((k = Oe.current) == null ? void 0 : k.side) && bo(m, (G = Oe.current) == null ? void 0 : G.area);
@@ -1089,7 +1089,7 @@ var T = "MenuContent", [oo, et] = Z(T), tn = u.forwardRef(
1089
1089
  Oe.current = m;
1090
1090
  }, []),
1091
1091
  children: /* @__PURE__ */ o.jsx(ar, { ...or, children: /* @__PURE__ */ o.jsx(
1092
- Rr,
1092
+ Pr,
1093
1093
  {
1094
1094
  asChild: !0,
1095
1095
  trapped: a,
@@ -1099,7 +1099,7 @@ var T = "MenuContent", [oo, et] = Z(T), tn = u.forwardRef(
1099
1099
  }),
1100
1100
  onUnmountAutoFocus: i,
1101
1101
  children: /* @__PURE__ */ o.jsx(
1102
- _r,
1102
+ Rr,
1103
1103
  {
1104
1104
  asChild: !0,
1105
1105
  disableOutsidePointerEvents: c,
@@ -1123,7 +1123,7 @@ var T = "MenuContent", [oo, et] = Z(T), tn = u.forwardRef(
1123
1123
  }),
1124
1124
  preventScrollOnEntryFocus: !0,
1125
1125
  children: /* @__PURE__ */ o.jsx(
1126
- Er,
1126
+ _r,
1127
1127
  {
1128
1128
  role: "menu",
1129
1129
  "aria-orientation": "vertical",
@@ -1189,7 +1189,7 @@ var Ne = "MenuItem", bt = "menu.itemSelect", Ae = u.forwardRef(
1189
1189
  const d = s.current;
1190
1190
  if (!n && d) {
1191
1191
  const g = new CustomEvent(bt, { bubbles: !0, cancelable: !0 });
1192
- d.addEventListener(bt, (v) => r == null ? void 0 : r(v), { once: !0 }), Dr(d, g), g.defaultPrevented ? p.current = !1 : i.onClose();
1192
+ d.addEventListener(bt, (v) => r == null ? void 0 : r(v), { once: !0 }), Nr(d, g), g.defaultPrevented ? p.current = !1 : i.onClose();
1193
1193
  }
1194
1194
  };
1195
1195
  return /* @__PURE__ */ o.jsx(
@@ -1351,7 +1351,7 @@ hn.displayName = mo;
1351
1351
  var go = "MenuArrow", pn = u.forwardRef(
1352
1352
  (t, e) => {
1353
1353
  const { __scopeMenu: n, ...r } = t, a = ye(n);
1354
- return /* @__PURE__ */ o.jsx(Sr, { ...a, ...r, ref: e });
1354
+ return /* @__PURE__ */ o.jsx(Er, { ...a, ...r, ref: e });
1355
1355
  }
1356
1356
  );
1357
1357
  pn.displayName = go;
@@ -1844,7 +1844,7 @@ const hs = () => {
1844
1844
  /* @__PURE__ */ o.jsx(Wn, { item: e }, n)
1845
1845
  )) }) })
1846
1846
  ] }, t.label) : /* @__PURE__ */ o.jsx(Ee, { to: t.path ?? "", children: /* @__PURE__ */ o.jsx(Vn, { children: t.label }, t.label) }), Jn = kt(function() {
1847
- const [e, n] = kr(), { isAuthenticated: r, profile: a, isAuthEnabled: s } = fr(), { pathname: i } = J(), c = Ve(), { page: l, plugins: p } = c, f = e ? pa : fa;
1847
+ const [e, n] = kr(), { isAuthenticated: r, profile: a, isAuthEnabled: s } = Ar(), { pathname: i } = J(), c = Ve(), { page: l, plugins: p } = c, f = e ? pa : fa;
1848
1848
  return /* @__PURE__ */ o.jsx("header", { className: "fixed top-0 w-full z-10 bg-background/80 backdrop-blur", children: /* @__PURE__ */ o.jsxs("div", { className: "max-w-screen-2xl mx-auto", children: [
1849
1849
  /* @__PURE__ */ o.jsxs("div", { className: "grid grid-cols-[calc(var(--side-nav-width))_1fr] lg:gap-12 items-center border-b px-12 h-[--top-header-height]", children: [
1850
1850
  /* @__PURE__ */ o.jsx("div", { className: "flex", children: /* @__PURE__ */ o.jsx(Ee, { to: "/", children: /* @__PURE__ */ o.jsxs("div", { className: "flex items-center gap-3.5", children: [
@@ -1926,10 +1926,10 @@ const hs = () => {
1926
1926
  ...Fr,
1927
1927
  ...(D = e.mdx) == null ? void 0 : D.components
1928
1928
  };
1929
- }, [(R = e.mdx) == null ? void 0 : R.components, e.plugins]), [a, s] = le(!1), { stagger: i } = qr(Qe), [c, l] = le(!1), p = xr(), f = ge("idle"), d = Le(
1929
+ }, [(R = e.mdx) == null ? void 0 : R.components, e.plugins]), [a, s] = le(!1), { stagger: i } = qr(Qe), [c, l] = le(!1), p = vr(), f = ge("idle"), d = Le(
1930
1930
  () => c ? { stagger: !0 } : { stagger: i },
1931
1931
  [i, c]
1932
- ), g = yr();
1932
+ ), g = xr();
1933
1933
  W(() => {
1934
1934
  c || l(!0);
1935
1935
  }, [c, g.location]);
@@ -1945,7 +1945,7 @@ const hs = () => {
1945
1945
  });
1946
1946
  return a ? /* @__PURE__ */ o.jsxs(ra, { client: zt, children: [
1947
1947
  /* @__PURE__ */ o.jsx(Ge, { children: x }),
1948
- /* @__PURE__ */ o.jsx(Qe.Provider, { value: d, children: /* @__PURE__ */ o.jsx(aa, { value: v, children: /* @__PURE__ */ o.jsx(ur, { components: r, children: /* @__PURE__ */ o.jsx(Lr, { children: /* @__PURE__ */ o.jsx(fs, { value: n, children: /* @__PURE__ */ o.jsx(mr, { slotlets: e.slotlets, children: /* @__PURE__ */ o.jsx(Kr, { children: t ?? /* @__PURE__ */ o.jsx(St, {}) }) }) }) }) }) }) })
1948
+ /* @__PURE__ */ o.jsx(Qe.Provider, { value: d, children: /* @__PURE__ */ o.jsx(aa, { value: v, children: /* @__PURE__ */ o.jsx(ur, { components: r, children: /* @__PURE__ */ o.jsx(Lr, { children: /* @__PURE__ */ o.jsx(fs, { value: n, children: /* @__PURE__ */ o.jsx(fr, { slotlets: e.slotlets, children: /* @__PURE__ */ o.jsx(Kr, { children: t ?? /* @__PURE__ */ o.jsx(St, {}) }) }) }) }) }) }) })
1949
1949
  ] }) : null;
1950
1950
  }, gs = kt(ms), er = (t) => /* @__PURE__ */ o.jsx($a, { FallbackComponent: Ya, children: /* @__PURE__ */ o.jsx(gs, { ...t }) });
1951
1951
  er.displayName = "DevPortal";
@@ -2196,7 +2196,7 @@ const vs = () => {
2196
2196
  }
2197
2197
  ) })
2198
2198
  ] });
2199
- }, Ls = dr, Ks = Br, $s = er, Bs = Cs, Qs = Ee, Us = gr, Gs = ma, qs = Ia, Hs = Aa, zs = Be, Vs = Ge;
2199
+ }, Ls = dr, Ks = Br, $s = er, Bs = Cs, Qs = Ee, Us = mr, Gs = ma, qs = Ia, Hs = Aa, zs = Be, Vs = Ge;
2200
2200
  export {
2201
2201
  qs as Bootstrap,
2202
2202
  Hs as BootstrapStatic,
@@ -1,9 +1,9 @@
1
1
  import { a as f, j as e, O as j } from "./jsx-runtime-CJBdjYYx.js";
2
- import { u as g, a as x, R as v } from "./SlotletProvider-D_Vz-7c_.js";
3
- import { u as w, a as h, I as k, S as b, b as K, c as N, d as A, e as E, f as p } from "./Input-GFpPXs5b.js";
2
+ import { a as x, R as g } from "./SlotletProvider-B71hNEUL.js";
3
+ import { u as v, a as h, I as w, S as k, b, c as K, d as N, e as A, f as p } from "./Input-3IEt27jb.js";
4
4
  import { L as u } from "./index-Dt-pU7Vu.js";
5
- import { u as m, x as S, y as I } from "./DevPortalProvider-BTFqdAEL.js";
6
- import { B as o } from "./Combination-CS4rK8IJ.js";
5
+ import { u as m, x as E, y as S } from "./DevPortalProvider-BWeAysxF.js";
6
+ import { B as o, p as I } from "./Combination-C442XfGG.js";
7
7
  import { D as P } from "./DeveloperHint-DQVwIery.js";
8
8
  import { useState as C } from "react";
9
9
  import { c as l, a as D } from "./Markdown-QsZ-PHET.js";
@@ -71,7 +71,7 @@ class M extends Error {
71
71
  }
72
72
  }
73
73
  const L = ({ service: t }) => {
74
- const n = m(), r = f(), a = w({
74
+ const n = m(), r = f(), a = v({
75
75
  defaultValues: {
76
76
  expiresOn: "30"
77
77
  }
@@ -95,16 +95,16 @@ const L = ({ service: t }) => {
95
95
  onSubmit: a.handleSubmit((s) => i.mutate(s)),
96
96
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 flex-col", children: [
97
97
  "Note",
98
- /* @__PURE__ */ e.jsx(k, { ...a.register("description") }),
98
+ /* @__PURE__ */ e.jsx(w, { ...a.register("description") }),
99
99
  "Expiration",
100
100
  /* @__PURE__ */ e.jsxs(
101
- b,
101
+ k,
102
102
  {
103
103
  onValueChange: (s) => a.setValue("expiresOn", s),
104
104
  defaultValue: a.getValues("expiresOn"),
105
105
  children: [
106
- /* @__PURE__ */ e.jsx(K, { children: /* @__PURE__ */ e.jsx(N, {}) }),
107
- /* @__PURE__ */ e.jsx(A, { children: /* @__PURE__ */ e.jsxs(E, { children: [
106
+ /* @__PURE__ */ e.jsx(b, { children: /* @__PURE__ */ e.jsx(K, {}) }),
107
+ /* @__PURE__ */ e.jsx(N, { children: /* @__PURE__ */ e.jsxs(A, { children: [
108
108
  [7, 30, 60, 90].map((s) => /* @__PURE__ */ e.jsxs(p, { value: String(s), children: [
109
109
  s,
110
110
  " days"
@@ -126,7 +126,7 @@ const L = ({ service: t }) => {
126
126
  const n = /* @__PURE__ */ new Date();
127
127
  return n.setDate(n.getDate() + t), n.toISOString();
128
128
  }, F = () => {
129
- const t = g();
129
+ const t = I();
130
130
  return t.isAuthEnabled && t.isPending ? null : t.isAuthenticated ? /* @__PURE__ */ e.jsx(j, {}) : t.isAuthEnabled ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col justify-center gap-2 items-center h-1/2", children: [
131
131
  "Please login first to view this page",
132
132
  /* @__PURE__ */ e.jsx(o, { onClick: () => t.login(), children: "Login" })
@@ -136,7 +136,7 @@ const L = ({ service: t }) => {
136
136
  "."
137
137
  ] }) });
138
138
  }, V = ({ service: t }) => {
139
- const n = m(), r = S(), { data: a } = I({
139
+ const n = m(), r = E(), { data: a } = S({
140
140
  queryFn: () => t.getKeys(n),
141
141
  queryKey: ["api-keys"],
142
142
  retry: !1
@@ -282,7 +282,7 @@ const L = ({ service: t }) => {
282
282
  getRoutes: () => [
283
283
  {
284
284
  element: /* @__PURE__ */ e.jsx(F, {}),
285
- errorElement: /* @__PURE__ */ e.jsx(v, {}),
285
+ errorElement: /* @__PURE__ */ e.jsx(g, {}),
286
286
  children: [
287
287
  {
288
288
  path: "/settings/api-keys",
@@ -1,5 +1,5 @@
1
1
  import { j as o, N as x } from "./jsx-runtime-CJBdjYYx.js";
2
- import { v as d, z as g, l as h } from "./DevPortalProvider-BTFqdAEL.js";
2
+ import { v as d, z as g, l as h } from "./DevPortalProvider-BWeAysxF.js";
3
3
  const f = (t, e) => {
4
4
  const a = Object.entries(t).flatMap(
5
5
  ([n, m]) => {
@@ -9,7 +9,7 @@ const f = (t, e) => {
9
9
  return {
10
10
  path: i.at(-1) === "index" ? i.slice(0, -1).join("/") : s,
11
11
  lazy: async () => {
12
- const { MdxPage: u } = await import("./MdxPage-V4FCB0C_.js"), { default: c, ...l } = await m();
12
+ const { MdxPage: u } = await import("./MdxPage-CA1WmW14.js"), { default: c, ...l } = await m();
13
13
  return {
14
14
  element: /* @__PURE__ */ o.jsx(
15
15
  u,
@@ -1,11 +1,12 @@
1
1
  import "./jsx-runtime-CJBdjYYx.js";
2
- import { o as a } from "./index-Uqja2h2M.js";
2
+ import { o as f } from "./index-CLkuJSxj.js";
3
3
  import "./urql-DrBfkb92.js";
4
+ import "./DevPortalProvider-BWeAysxF.js";
4
5
  import "zudoku/openapi-worker";
6
+ import "./Combination-C442XfGG.js";
5
7
  import "./Markdown-QsZ-PHET.js";
6
- import "./Combination-CS4rK8IJ.js";
7
8
  import "./router-BiRCp01d.js";
8
9
  export {
9
- a as openApiPlugin
10
+ f as openApiPlugin
10
11
  };
11
12
  //# sourceMappingURL=zudoku.plugin-openapi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"zudoku.plugin-openapi.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
1
+ {"version":3,"file":"zudoku.plugin-openapi.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zudoku",
3
- "version": "0.3.0-dev.79",
3
+ "version": "0.3.0-dev.80",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -61,7 +61,7 @@ const getConverted = (snippet: HTTPSnippet, option: string) => {
61
61
  return converted ? converted[0] : "";
62
62
  };
63
63
 
64
- const GetServerQuery = graphql(/* GraphQL */ `
64
+ export const GetServerQuery = graphql(/* GraphQL */ `
65
65
  query getServerQuery($input: JSON!, $type: SchemaType!) {
66
66
  schema(input: $input, type: $type) {
67
67
  url
@@ -3,24 +3,25 @@ import {
3
3
  type DevPortalPlugin,
4
4
  type PluginNavigationCategory,
5
5
  } from "../../core/plugins.js";
6
- import { MethodBadge } from "./MethodBadge.js";
7
6
  import { graphql } from "./graphql/index.js";
7
+ import { MethodBadge } from "./MethodBadge.js";
8
8
  import {
9
9
  Client as UrqlClient,
10
10
  cacheExchange,
11
11
  fetchExchange,
12
12
  } from "./util/urql.js";
13
13
 
14
- import { CirclePlayIcon } from "lucide-react";
14
+ import { useQuery } from "@tanstack/react-query";
15
+ import { CirclePlayIcon, LogInIcon } from "lucide-react";
15
16
  import { createClient } from "zudoku/openapi-worker";
17
+ import { useAuth } from "../../authentication/hook.js";
16
18
  import { ErrorPage } from "../../components/ErrorPage.js";
17
19
  import { SyntaxHighlight } from "../../components/SyntaxHighlight.js";
18
20
  import { Button } from "../../ui/Button.js";
19
21
  import { OasPluginConfig } from "./interfaces.js";
20
- import {
21
- PlaygroundDialog,
22
- type PlaygroundDialogProps,
23
- } from "./playground/PlaygroundDialog.js";
22
+ import type { PlaygroundContentProps } from "./playground/Playground.js";
23
+ import { PlaygroundDialog } from "./playground/PlaygroundDialog.js";
24
+ import { GetServerQuery } from "./Sidecar.js";
24
25
 
25
26
  const GetCategoriesQuery = graphql(`
26
27
  query GetCategories($input: JSON!, $type: SchemaType!) {
@@ -88,19 +89,54 @@ export const openApiPlugin = (
88
89
  }
89
90
  },
90
91
  getMdxComponents: () => ({
91
- OpenPlaygroundButton: (props: PlaygroundDialogProps) => (
92
- <div>
93
- <PlaygroundDialog {...props}>
92
+ OpenPlaygroundButton: ({
93
+ requireAuth,
94
+ server,
95
+ method,
96
+ url,
97
+ ...props
98
+ }: Partial<PlaygroundContentProps> & { requireAuth: boolean }) => {
99
+ const auth = useAuth();
100
+ const serverQuery = useQuery({
101
+ queryFn: async () => {
102
+ const result = await client.query(GetServerQuery, {
103
+ type: config.type,
104
+ input: config.input,
105
+ });
106
+
107
+ return result.data;
108
+ },
109
+ enabled: !server,
110
+ queryKey: ["playground-server"],
111
+ });
112
+
113
+ if (requireAuth && !auth.isAuthenticated) {
114
+ return (
115
+ <Button
116
+ className="gap-2 items-center"
117
+ variant="outline"
118
+ onClick={auth.login}
119
+ >
120
+ Login to open in Playground <LogInIcon size={16} />
121
+ </Button>
122
+ );
123
+ }
124
+
125
+ return (
126
+ <PlaygroundDialog
127
+ url={url ?? "/"}
128
+ method={method ?? "get"}
129
+ server={
130
+ server ?? serverQuery.data?.schema.url ?? "https://example.com"
131
+ }
132
+ {...props}
133
+ >
94
134
  <Button className="gap-2 items-center" variant="outline">
95
- {props.children ?? (
96
- <>
97
- Open in Playground <CirclePlayIcon size={16} />
98
- </>
99
- )}
135
+ Open in Playground <CirclePlayIcon size={16} />
100
136
  </Button>
101
137
  </PlaygroundDialog>
102
- </div>
103
- ),
138
+ );
139
+ },
104
140
  }),
105
141
  getNavigation: async (path: string) => {
106
142
  if (!matchPath({ path: basePath, end: false }, path)) {