@mintlify/msft-sdk 1.1.66 → 1.1.68
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/api-playground-2/ApiExamples.js +19 -21
- package/dist/api-playground-2/components/Example/GeneratedRequestExample.js +104 -105
- package/dist/api-playground-2/components/Example/RequestExample.js +37 -37
- package/dist/api-playground-2/hooks/useSendPlaygroundRequest.js +98 -98
- package/dist/components/apiPage.js +57 -54
- package/dist/components/docsPage.js +38 -39
- package/dist/constants/index.js +5 -2
- package/dist/contexts/ConfigContext.js +39 -31
- package/dist/hooks/useApiPlaygroundDisplay.js +6 -11
- package/dist/hooks/useSendPlaygroundRequest.js +9 -10
- package/dist/index.d.ts +13 -2
- package/package.json +1 -1
- package/dist/hooks/useEndpoint.js +0 -15
|
@@ -1,106 +1,106 @@
|
|
|
1
|
-
import { useCallback as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
const
|
|
1
|
+
import { useContext as w, useCallback as x } from "react";
|
|
2
|
+
import { encodeBasicAuth as z } from "../schemaGraph/utils.js";
|
|
3
|
+
import { usePlaygroundInputsStore as O } from "./usePlaygroundInputsStore.js";
|
|
4
|
+
import { ApiReferenceContext2 as F } from "../../contexts/ConfigContext.js";
|
|
5
|
+
const L = ({
|
|
6
6
|
apiReferenceData: t,
|
|
7
|
-
baseUrl:
|
|
7
|
+
baseUrl: r,
|
|
8
8
|
contentType: o = "application/json",
|
|
9
|
-
setResult:
|
|
10
|
-
setIsSending:
|
|
9
|
+
setResult: e,
|
|
10
|
+
setIsSending: a
|
|
11
11
|
}) => {
|
|
12
|
-
var
|
|
13
|
-
const n =
|
|
14
|
-
return
|
|
15
|
-
const
|
|
16
|
-
if (
|
|
17
|
-
|
|
12
|
+
var m, b, g;
|
|
13
|
+
const { requestEndpointUrl: s, fileRequestEndpointUrl: n } = w(F), i = O((d) => d.getApiPlaygroundInputs), h = (m = t.operation) == null ? void 0 : m.disableProxy, p = (b = t.operation) == null ? void 0 : b.path, f = (g = t.operation) == null ? void 0 : g.method;
|
|
14
|
+
return x(async () => {
|
|
15
|
+
const d = i();
|
|
16
|
+
if (a(!0), !p || !r || !f || !o || !r) {
|
|
17
|
+
a(!1), e({
|
|
18
18
|
error: !0,
|
|
19
19
|
errorMessage: "Missing required fields to send a playground request"
|
|
20
20
|
}), console.error(
|
|
21
21
|
`Missing some required field to send a playground request:
|
|
22
22
|
|
|
23
|
-
path=${
|
|
24
|
-
method=${
|
|
23
|
+
path=${p}
|
|
24
|
+
method=${f}
|
|
25
25
|
contentType=${o}
|
|
26
|
-
baseUrl=${
|
|
26
|
+
baseUrl=${r}`
|
|
27
27
|
);
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
|
-
const A = await import("axios").then((
|
|
31
|
-
let
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
method:
|
|
30
|
+
const A = await import("axios").then((c) => c.default), j = P(p, d.path), S = C($(r, d.server), j);
|
|
31
|
+
let u = E(d.header, o);
|
|
32
|
+
u = B(u);
|
|
33
|
+
const l = {
|
|
34
|
+
method: f,
|
|
35
35
|
url: S,
|
|
36
|
-
header:
|
|
37
|
-
body:
|
|
38
|
-
cookie:
|
|
39
|
-
query:
|
|
36
|
+
header: u,
|
|
37
|
+
body: d.body,
|
|
38
|
+
cookie: d.cookie,
|
|
39
|
+
query: d.query
|
|
40
40
|
};
|
|
41
|
-
let
|
|
41
|
+
let y;
|
|
42
42
|
try {
|
|
43
|
-
if (
|
|
44
|
-
const
|
|
45
|
-
|
|
43
|
+
if (h) {
|
|
44
|
+
const c = await D(l);
|
|
45
|
+
y = c.status, e({
|
|
46
46
|
error: !1,
|
|
47
47
|
response: {
|
|
48
|
-
status:
|
|
49
|
-
statusText:
|
|
50
|
-
headers:
|
|
51
|
-
data:
|
|
48
|
+
status: c.status,
|
|
49
|
+
statusText: c.statusText,
|
|
50
|
+
headers: c.headers,
|
|
51
|
+
data: c.data
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
} else if (o && o.includes("multipart/form-data")) {
|
|
55
|
-
const
|
|
56
|
-
"response" in
|
|
55
|
+
const c = await J(l, n);
|
|
56
|
+
"response" in c && (y = c.response.status), e(c);
|
|
57
57
|
} else {
|
|
58
|
-
const { data:
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
const { data: c } = await A.post(
|
|
59
|
+
s,
|
|
60
|
+
l
|
|
61
61
|
);
|
|
62
|
-
"response" in
|
|
62
|
+
"response" in c && (y = c.response.status), e(c);
|
|
63
63
|
}
|
|
64
|
-
} catch (
|
|
65
|
-
|
|
64
|
+
} catch (c) {
|
|
65
|
+
e({
|
|
66
66
|
error: !0,
|
|
67
67
|
errorMessage: "unable to complete request"
|
|
68
|
-
}), console.error(
|
|
68
|
+
}), console.error(c);
|
|
69
69
|
}
|
|
70
|
-
|
|
70
|
+
a(!1);
|
|
71
71
|
}, [
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
f,
|
|
73
|
+
p,
|
|
74
|
+
a,
|
|
75
|
+
i,
|
|
74
76
|
r,
|
|
75
|
-
n,
|
|
76
|
-
e,
|
|
77
77
|
o,
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
h,
|
|
79
|
+
e
|
|
80
80
|
]);
|
|
81
|
-
},
|
|
81
|
+
}, P = (t, r) => Object.entries(r).reduce((o, [e, a]) => a == null ? o : o.replace(`{${e}}`, encodeURIComponent(a.toString())), t), $ = (t, r) => {
|
|
82
82
|
let o = t;
|
|
83
|
-
return Object.entries(
|
|
84
|
-
|
|
83
|
+
return Object.entries(r).forEach(([e, a]) => {
|
|
84
|
+
a && (o = o.replace(`{${e}}`, a));
|
|
85
85
|
}), o;
|
|
86
|
-
},
|
|
86
|
+
}, C = (t, r) => t.replace(/\/$/, "") + "/" + r.replace(/^\//, ""), E = (t, r) => Object.keys(t).some((o) => o.toLowerCase() === "content-type") ? t : {
|
|
87
87
|
...t,
|
|
88
|
-
"content-type":
|
|
89
|
-
},
|
|
90
|
-
const
|
|
91
|
-
(
|
|
88
|
+
"content-type": r
|
|
89
|
+
}, D = async (t) => {
|
|
90
|
+
const r = await import("axios").then((s) => s.default), o = Object.keys(t.header).find(
|
|
91
|
+
(s) => s.toLowerCase() === "content-type"
|
|
92
92
|
);
|
|
93
|
-
let
|
|
93
|
+
let e = t.body, a = t.header;
|
|
94
94
|
if (o != null && o.includes("multipart/form-data")) {
|
|
95
|
-
const { data:
|
|
96
|
-
|
|
95
|
+
const { data: s, headers: n } = N(t);
|
|
96
|
+
e = s, a = n;
|
|
97
97
|
}
|
|
98
|
-
return
|
|
98
|
+
return r({
|
|
99
99
|
url: t.url,
|
|
100
100
|
method: t.method,
|
|
101
101
|
params: t.query,
|
|
102
|
-
data:
|
|
103
|
-
headers:
|
|
102
|
+
data: e,
|
|
103
|
+
headers: a,
|
|
104
104
|
// prevent axios from adding [] after array query params
|
|
105
105
|
paramsSerializer: {
|
|
106
106
|
indexes: null
|
|
@@ -110,11 +110,11 @@ baseUrl=${e}`
|
|
|
110
110
|
validateStatus: () => !0,
|
|
111
111
|
// prevent axios from parsing json, losing whitespace information, and using default utf-8 encoding
|
|
112
112
|
// we can't use `responseEncoding` as it's ignored client-side
|
|
113
|
-
transformResponse: (
|
|
113
|
+
transformResponse: (s) => Buffer.from(s).toString("base64")
|
|
114
114
|
});
|
|
115
|
-
},
|
|
116
|
-
const
|
|
117
|
-
|
|
115
|
+
}, J = async (t, r) => {
|
|
116
|
+
const o = await import("axios").then((s) => s.default), e = new FormData();
|
|
117
|
+
e.append(
|
|
118
118
|
"requestInfo",
|
|
119
119
|
JSON.stringify({
|
|
120
120
|
method: t.method,
|
|
@@ -123,46 +123,46 @@ baseUrl=${e}`
|
|
|
123
123
|
query: t.query,
|
|
124
124
|
cookie: t.cookie
|
|
125
125
|
})
|
|
126
|
-
), typeof t.body == "object" && t.body !== null && Object.entries(t.body).forEach(([
|
|
127
|
-
n instanceof File ?
|
|
128
|
-
|
|
129
|
-
}) : n != null &&
|
|
126
|
+
), typeof t.body == "object" && t.body !== null && Object.entries(t.body).forEach(([s, n]) => {
|
|
127
|
+
n instanceof File ? e.append(s, n) : Array.isArray(n) ? n.forEach((i) => {
|
|
128
|
+
i instanceof File ? e.append(s, i) : i != null && e.append(s, typeof i == "object" ? JSON.stringify(i) : i.toString());
|
|
129
|
+
}) : n != null && e.append(s, typeof n == "object" ? JSON.stringify(n) : n.toString());
|
|
130
130
|
});
|
|
131
|
-
const { data:
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
const { data: a } = await o.post(
|
|
132
|
+
r,
|
|
133
|
+
e
|
|
134
134
|
);
|
|
135
|
-
return
|
|
136
|
-
},
|
|
137
|
-
var
|
|
138
|
-
let
|
|
135
|
+
return a;
|
|
136
|
+
}, N = (t) => {
|
|
137
|
+
var e;
|
|
138
|
+
let r = t.body;
|
|
139
139
|
const o = t.header;
|
|
140
|
-
if ((
|
|
141
|
-
const
|
|
142
|
-
typeof
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
typeof
|
|
140
|
+
if ((e = o["content-type"]) != null && e.includes("multipart/form-data")) {
|
|
141
|
+
const a = new FormData();
|
|
142
|
+
typeof r == "object" && r !== null && (Object.entries(r).forEach(([s, n]) => {
|
|
143
|
+
n instanceof File ? a.append(s, n) : Array.isArray(n) ? n.forEach((i) => {
|
|
144
|
+
i instanceof File ? a.append(s, i) : i != null && a.append(
|
|
145
|
+
s,
|
|
146
|
+
typeof i == "object" ? JSON.stringify(i) : i.toString()
|
|
147
147
|
);
|
|
148
|
-
}) :
|
|
149
|
-
|
|
150
|
-
typeof
|
|
148
|
+
}) : n != null && a.append(
|
|
149
|
+
s,
|
|
150
|
+
typeof n == "object" ? JSON.stringify(n) : n.toString()
|
|
151
151
|
);
|
|
152
|
-
}),
|
|
152
|
+
}), r = a, delete o["content-type"]);
|
|
153
153
|
}
|
|
154
|
-
return { data:
|
|
155
|
-
},
|
|
154
|
+
return { data: r, headers: o };
|
|
155
|
+
}, B = (t) => {
|
|
156
156
|
if (!t.Authorization || typeof t.Authorization != "object") return t;
|
|
157
157
|
if (typeof t.Authorization == "object") {
|
|
158
|
-
const
|
|
159
|
-
t.Authorization = `Basic ${
|
|
158
|
+
const r = "username" in t.Authorization ? t.Authorization.username : "", o = "password" in t.Authorization ? t.Authorization.password : "", e = z(r, o);
|
|
159
|
+
t.Authorization = `Basic ${e}`, delete t.Authorization.username, delete t.Authorization.password;
|
|
160
160
|
}
|
|
161
161
|
return t;
|
|
162
162
|
};
|
|
163
163
|
export {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
164
|
+
P as addPathParams,
|
|
165
|
+
$ as addServerVariables,
|
|
166
|
+
C as joinWithSingleSlash,
|
|
167
|
+
L as useSendPlaygroundRequest
|
|
168
168
|
};
|
|
@@ -1,46 +1,51 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useEffect as
|
|
3
|
-
import { ApiExamples as
|
|
4
|
-
import { ComponentsProvider as
|
|
1
|
+
import { jsx as t, jsxs as o } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect as P } from "react";
|
|
3
|
+
import { ApiExamples as _ } from "../api-playground-2/ApiExamples.js";
|
|
4
|
+
import { ComponentsProvider as R } from "../context/components-context.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
import { cn as e } from "../utils/cn.js";
|
|
7
|
-
import { MDXRenderer as
|
|
8
|
-
import { PageContextMenu as
|
|
9
|
-
import { Api as
|
|
10
|
-
import { PageProvider as
|
|
11
|
-
|
|
7
|
+
import { MDXRenderer as F } from "./mdx-renderer.js";
|
|
8
|
+
import { PageContextMenu as L } from "./page-context-menu.js";
|
|
9
|
+
import { Api as S } from "../api-playground-2/Api.js";
|
|
10
|
+
import { PageProvider as A, ApiReferenceProvider2 as B } from "../contexts/ConfigContext.js";
|
|
11
|
+
import { MINTLIFY_FILE_REQUEST_ENDPOINT_URL as U, MINTLIFY_REQUEST_ENDPOINT_URL as j } from "../constants/index.js";
|
|
12
|
+
function $({
|
|
12
13
|
theme: a,
|
|
13
|
-
className:
|
|
14
|
-
pathname:
|
|
15
|
-
markdownContent:
|
|
14
|
+
className: f = "",
|
|
15
|
+
pathname: l,
|
|
16
|
+
markdownContent: h,
|
|
16
17
|
allPages: b,
|
|
17
|
-
baseUrl:
|
|
18
|
-
LinkComponent:
|
|
19
|
-
contextMenu:
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
baseUrl: p,
|
|
19
|
+
LinkComponent: g,
|
|
20
|
+
contextMenu: i,
|
|
21
|
+
contextMenuEnabled: w = !0,
|
|
22
|
+
apiReferenceData: r,
|
|
23
|
+
pageMetadata: n,
|
|
24
|
+
playgroundDisplay: u = "simple",
|
|
25
|
+
requestEndpointUrl: x = j,
|
|
26
|
+
fileRequestEndpointUrl: v = U
|
|
22
27
|
}) {
|
|
23
|
-
return
|
|
28
|
+
return P(() => {
|
|
24
29
|
const { hash: s } = window.location;
|
|
25
30
|
if (!s) return;
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
if (m &&
|
|
29
|
-
const
|
|
31
|
+
const k = setTimeout(() => {
|
|
32
|
+
const N = s.substring(1), m = document.getElementById("main-content"), c = document.getElementById(N);
|
|
33
|
+
if (m && c) {
|
|
34
|
+
const d = window.getComputedStyle(document.documentElement), E = parseFloat(d.getPropertyValue("--scroll-mt") || "0"), T = parseFloat(d.fontSize), y = E * T, I = m.getBoundingClientRect(), C = c.getBoundingClientRect().top - I.top + m.scrollTop - y;
|
|
30
35
|
m.scrollTo({
|
|
31
|
-
top:
|
|
36
|
+
top: C,
|
|
32
37
|
behavior: "instant"
|
|
33
38
|
});
|
|
34
39
|
}
|
|
35
40
|
}, 100);
|
|
36
|
-
return () => clearTimeout(
|
|
37
|
-
}, [
|
|
41
|
+
return () => clearTimeout(k);
|
|
42
|
+
}, [l]), /* @__PURE__ */ t(R, { LinkComponent: g, children: /* @__PURE__ */ t(
|
|
38
43
|
"div",
|
|
39
44
|
{
|
|
40
45
|
className: e(
|
|
41
46
|
"mintlify-docs",
|
|
42
47
|
a === "dark" && "dark",
|
|
43
|
-
|
|
48
|
+
f,
|
|
44
49
|
"mint:flex mint:flex-col mint:flex-1 mint:min-h-0 mint:h-full mint:overflow-hidden"
|
|
45
50
|
),
|
|
46
51
|
children: /* @__PURE__ */ t(
|
|
@@ -60,60 +65,58 @@ function K({
|
|
|
60
65
|
className: e(
|
|
61
66
|
"mint:flex-1 mint:p-8 mint:overflow-y-auto mint:overflow-x-hidden mint:rounded-tl-2xl mint:bg-white mint:dark:bg-[#1f1f1f] [scrollbar-gutter:stable] mint:overscroll-contain mint:lg:px-16 mint:lg:pt-12 [scrollbar-width:thin] [scrollbar-color:rgba(0,0,0,0.2)_transparent] dark:[scrollbar-color:rgba(255,255,255,0.2)_transparent] mint:[&::-webkit-scrollbar]:w-1 mint:[&::-webkit-scrollbar-track]:bg-transparent mint:[&::-webkit-scrollbar-thumb]:bg-black/20 mint:dark:[&::-webkit-scrollbar-thumb]:bg-white/20 mint:[&::-webkit-scrollbar-thumb]:rounded mint:[&::-webkit-scrollbar-thumb:hover]:bg-black/30 mint:dark:[&::-webkit-scrollbar-thumb:hover]:bg-white/30"
|
|
62
67
|
),
|
|
63
|
-
children: /* @__PURE__ */
|
|
68
|
+
children: /* @__PURE__ */ o(
|
|
64
69
|
"div",
|
|
65
70
|
{
|
|
66
71
|
className: "mint:flex mint:flex-row-reverse mint:gap-12 mint:justify-center mint:mx-auto mint:w-full",
|
|
67
72
|
id: "content-layout-container",
|
|
68
73
|
children: [
|
|
69
|
-
(
|
|
70
|
-
(i == null ? void 0 : i.operation) && /* @__PURE__ */ l(
|
|
74
|
+
(r == null ? void 0 : r.operation) && /* @__PURE__ */ t(
|
|
71
75
|
"div",
|
|
72
76
|
{
|
|
73
77
|
className: "mint:self-start mint:sticky mint:flex-col mint:w-[448px] mint:top-4 mint:gap-6 mint:hidden mint:lg:flex",
|
|
74
|
-
|
|
75
|
-
children: [
|
|
76
|
-
/* @__PURE__ */ t("div", { style: { color: "white", padding: "10px" }, children: "SIDEBAR IS RENDERING" }),
|
|
77
|
-
/* @__PURE__ */ t(C, { apiReferenceData: i, noInputs: !0 })
|
|
78
|
-
]
|
|
78
|
+
children: /* @__PURE__ */ t(_, { apiReferenceData: r, noInputs: !0 })
|
|
79
79
|
}
|
|
80
80
|
),
|
|
81
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ o(
|
|
82
82
|
"div",
|
|
83
83
|
{
|
|
84
84
|
className: e(
|
|
85
85
|
"mint:w-full mint:overflow-x-visible mint:max-w-[730px]"
|
|
86
86
|
),
|
|
87
87
|
children: [
|
|
88
|
-
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
/* @__PURE__ */ t("h1", { className: "mint:text-[1.875rem] mint:font-bold mint:text-[#141414] mint:dark:text-white mint:m-0 mint:leading-[1.2] mint:pt-3", children:
|
|
91
|
-
|
|
88
|
+
n.title && /* @__PURE__ */ t("header", { className: "mint:mb-6", children: /* @__PURE__ */ o("div", { className: "mint:flex mint:flex-col mint:gap-5", children: [
|
|
89
|
+
/* @__PURE__ */ o("div", { className: "mint:flex mint:flex-col mint:gap-2 mint:items-start", children: [
|
|
90
|
+
/* @__PURE__ */ t("h1", { className: "mint:text-[1.875rem] mint:font-bold mint:text-[#141414] mint:dark:text-white mint:m-0 mint:leading-[1.2] mint:pt-3", children: n.title }),
|
|
91
|
+
n.description && /* @__PURE__ */ t("p", { className: "mint:text-lg mint:text-[#4b5563] mint:dark:text-[#d1d5db] mint:m-0", children: n.description })
|
|
92
92
|
] }),
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
l && w && /* @__PURE__ */ t(
|
|
94
|
+
L,
|
|
95
95
|
{
|
|
96
96
|
className: "mint:shrink-0",
|
|
97
|
-
pathname:
|
|
98
|
-
markdownContent:
|
|
97
|
+
pathname: l,
|
|
98
|
+
markdownContent: h,
|
|
99
99
|
allPages: b,
|
|
100
|
-
baseUrl:
|
|
101
|
-
onCopyMarkdown:
|
|
102
|
-
onViewMarkdown:
|
|
100
|
+
baseUrl: p,
|
|
101
|
+
onCopyMarkdown: i == null ? void 0 : i.onCopyMarkdown,
|
|
102
|
+
onViewMarkdown: i == null ? void 0 : i.onViewMarkdown
|
|
103
103
|
}
|
|
104
104
|
)
|
|
105
105
|
] }) }),
|
|
106
|
-
/* @__PURE__ */ t("div", { className: "mint:pt-4", children: /* @__PURE__ */ t(
|
|
107
|
-
pageMetadata:
|
|
108
|
-
pathname:
|
|
106
|
+
/* @__PURE__ */ t("div", { className: "mint:pt-4", children: /* @__PURE__ */ t(F, { children: /* @__PURE__ */ t(A, { value: {
|
|
107
|
+
pageMetadata: n,
|
|
108
|
+
pathname: l
|
|
109
109
|
}, children: /* @__PURE__ */ t(
|
|
110
|
-
|
|
110
|
+
B,
|
|
111
111
|
{
|
|
112
|
-
|
|
112
|
+
playgroundDisplay: u,
|
|
113
|
+
pageMetadata: n,
|
|
113
114
|
docsConfig: void 0,
|
|
114
115
|
mdxExtracts: void 0,
|
|
115
|
-
apiReferenceData2:
|
|
116
|
-
|
|
116
|
+
apiReferenceData2: r,
|
|
117
|
+
requestEndpointUrl: x,
|
|
118
|
+
fileRequestEndpointUrl: v,
|
|
119
|
+
children: /* @__PURE__ */ t(S, {})
|
|
117
120
|
}
|
|
118
121
|
) }) }) })
|
|
119
122
|
]
|
|
@@ -132,5 +135,5 @@ function K({
|
|
|
132
135
|
) });
|
|
133
136
|
}
|
|
134
137
|
export {
|
|
135
|
-
|
|
138
|
+
$ as ApiPage
|
|
136
139
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { TextAlignLeftFilled as
|
|
3
|
-
import { useEffect as
|
|
4
|
-
import { ComponentsProvider as
|
|
1
|
+
import { jsx as t, jsxs as e } from "react/jsx-runtime";
|
|
2
|
+
import { TextAlignLeftFilled as S } from "@fluentui/react-icons";
|
|
3
|
+
import { useEffect as j } from "react";
|
|
4
|
+
import { ComponentsProvider as A } from "../context/components-context.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
import { cn as d } from "../utils/cn.js";
|
|
7
|
-
import { MDXRenderer as
|
|
8
|
-
import { PageContextMenu as
|
|
7
|
+
import { MDXRenderer as B } from "./mdx-renderer.js";
|
|
8
|
+
import { PageContextMenu as R } from "./page-context-menu.js";
|
|
9
9
|
import { TableOfContents as H } from "./toc/index.js";
|
|
10
10
|
import { PivotAwareTOC as V } from "./toc/pivot-aware-toc.js";
|
|
11
|
-
import { ApiExamples as
|
|
11
|
+
import { ApiExamples as G } from "../api-playground-2/ApiExamples.js";
|
|
12
12
|
import { ApiReferenceProvider2 as Z } from "../contexts/ConfigContext.js";
|
|
13
13
|
import { ZonePivotProvider as _ } from "./content-components/zone-pivots/zone-pivot-context.js";
|
|
14
14
|
import { ZonePivotSelector as M } from "./content-components/zone-pivots/zone-pivot-selector.js";
|
|
15
15
|
function dt({
|
|
16
16
|
payload: i,
|
|
17
|
-
toc:
|
|
17
|
+
toc: o,
|
|
18
18
|
navTree: W,
|
|
19
19
|
activeHref: X,
|
|
20
|
-
theme:
|
|
20
|
+
theme: b,
|
|
21
21
|
className: x = "",
|
|
22
22
|
pathname: s,
|
|
23
23
|
markdownContent: w,
|
|
@@ -27,13 +27,11 @@ function dt({
|
|
|
27
27
|
LinkComponent: k,
|
|
28
28
|
localization: N,
|
|
29
29
|
telemetry: J,
|
|
30
|
-
contextMenu:
|
|
31
|
-
apiReferenceData:
|
|
30
|
+
contextMenu: n,
|
|
31
|
+
apiReferenceData: r
|
|
32
32
|
}) {
|
|
33
|
-
var
|
|
34
|
-
const T = i.serializedContent,
|
|
35
|
-
console.log("[DEBUG] DocsPage - apiReferenceData from props:", n), console.log("[DEBUG] DocsPage - Has operation:", !!(n != null && n.operation));
|
|
36
|
-
const C = { ...{
|
|
33
|
+
var f, h;
|
|
34
|
+
const T = i.serializedContent, a = ((f = i.mdxExtracts) == null ? void 0 : f.zonePivotGroups) || [], c = (h = i.mdxExtracts) == null ? void 0 : h.pivotTocItems, P = !i.title, C = { ...{
|
|
37
35
|
onThisPage: "On this page",
|
|
38
36
|
loading: "Loading...",
|
|
39
37
|
errorTitle: "Error",
|
|
@@ -41,26 +39,26 @@ function dt({
|
|
|
41
39
|
notFoundTitle: "Page not found",
|
|
42
40
|
notFoundMessage: "The page you're looking for doesn't exist"
|
|
43
41
|
}, ...N };
|
|
44
|
-
return
|
|
42
|
+
return j(() => {
|
|
45
43
|
const { hash: m } = window.location;
|
|
46
44
|
if (!m) return;
|
|
47
|
-
const
|
|
48
|
-
const
|
|
45
|
+
const y = setTimeout(() => {
|
|
46
|
+
const E = m.substring(1), l = document.getElementById("main-content"), g = document.getElementById(E);
|
|
49
47
|
if (l && g) {
|
|
50
|
-
const
|
|
48
|
+
const p = window.getComputedStyle(document.documentElement), z = parseFloat(p.getPropertyValue("--scroll-mt") || "0"), I = parseFloat(p.fontSize), F = z * I, L = l.getBoundingClientRect(), O = g.getBoundingClientRect().top - L.top + l.scrollTop - F;
|
|
51
49
|
l.scrollTo({
|
|
52
|
-
top:
|
|
50
|
+
top: O,
|
|
53
51
|
behavior: "instant"
|
|
54
52
|
});
|
|
55
53
|
}
|
|
56
54
|
}, 100);
|
|
57
|
-
return () => clearTimeout(
|
|
58
|
-
}, [s]), /* @__PURE__ */ t(
|
|
55
|
+
return () => clearTimeout(y);
|
|
56
|
+
}, [s]), /* @__PURE__ */ t(A, { LinkComponent: k, children: /* @__PURE__ */ t(
|
|
59
57
|
"div",
|
|
60
58
|
{
|
|
61
59
|
className: d(
|
|
62
60
|
"mintlify-docs",
|
|
63
|
-
|
|
61
|
+
b === "dark" && "dark",
|
|
64
62
|
x,
|
|
65
63
|
"mint:flex mint:flex-col mint:flex-1 mint:min-h-0 mint:h-full mint:overflow-hidden"
|
|
66
64
|
),
|
|
@@ -81,29 +79,30 @@ function dt({
|
|
|
81
79
|
className: d(
|
|
82
80
|
"mint:flex-1 mint:p-8 mint:overflow-y-auto mint:overflow-x-hidden mint:rounded-tl-2xl mint:bg-white mint:dark:bg-[#1f1f1f] [scrollbar-gutter:stable] mint:overscroll-contain mint:lg:px-16 mint:lg:pt-12 [scrollbar-width:thin] [scrollbar-color:rgba(0,0,0,0.2)_transparent] dark:[scrollbar-color:rgba(255,255,255,0.2)_transparent] mint:[&::-webkit-scrollbar]:w-1 mint:[&::-webkit-scrollbar-track]:bg-transparent mint:[&::-webkit-scrollbar-thumb]:bg-black/20 mint:dark:[&::-webkit-scrollbar-thumb]:bg-white/20 mint:[&::-webkit-scrollbar-thumb]:rounded mint:[&::-webkit-scrollbar-thumb:hover]:bg-black/30 mint:dark:[&::-webkit-scrollbar-thumb:hover]:bg-white/30"
|
|
83
81
|
),
|
|
84
|
-
children: /* @__PURE__ */ t(_, { groups:
|
|
82
|
+
children: /* @__PURE__ */ t(_, { groups: a, children: /* @__PURE__ */ e(
|
|
85
83
|
"div",
|
|
86
84
|
{
|
|
87
85
|
className: "mint:flex mint:flex-row-reverse mint:gap-12 mint:justify-center mint:mx-auto mint:w-full",
|
|
88
86
|
id: "content-layout-container",
|
|
89
87
|
children: [
|
|
90
|
-
|
|
88
|
+
r != null && r.operation ? /* @__PURE__ */ t("aside", { className: "mint:w-[448px] mint:shrink-0 mint:ml-8 mint:hidden mint:lg:block", children: /* @__PURE__ */ t("div", { className: "mint:sticky mint:top-4 mint:flex mint:flex-col mint:gap-6", children: /* @__PURE__ */ t(
|
|
91
89
|
Z,
|
|
92
90
|
{
|
|
93
91
|
pageMetadata: { title: i.title, description: i.description },
|
|
94
92
|
docsConfig: void 0,
|
|
95
93
|
mdxExtracts: void 0,
|
|
96
|
-
apiReferenceData2:
|
|
97
|
-
|
|
94
|
+
apiReferenceData2: r,
|
|
95
|
+
playgroundDisplay: "simple",
|
|
96
|
+
children: /* @__PURE__ */ t(G, { noInputs: !0 })
|
|
98
97
|
}
|
|
99
|
-
) }) }) :
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
/* @__PURE__ */ t(
|
|
98
|
+
) }) }) : o && o.length > 0 ? /* @__PURE__ */ t("aside", { className: "mint:w-68 mint:shrink-0 mint:ml-8 mint:max-xl:hidden mint:xl:block", children: /* @__PURE__ */ e("div", { className: "mint:sticky mint:top-2 mint:p-2 mint:pb-6 mint:max-h-[calc(100vh-3.5rem)] mint:overflow-y-auto", children: [
|
|
99
|
+
/* @__PURE__ */ e("div", { className: "mint:flex mint:items-center mint:gap-2 mint:mb-4", children: [
|
|
100
|
+
/* @__PURE__ */ t(S, { className: "mint:w-4 mint:h-4 mint:text-[#4b5563] mint:dark:text-[#adadad]" }),
|
|
102
101
|
/* @__PURE__ */ t("h2", { className: "mint:text-sm mint:font-semibold mint:text-[#141414] mint:dark:text-white", children: C.onThisPage })
|
|
103
102
|
] }),
|
|
104
|
-
|
|
103
|
+
c && Object.keys(c).length > 0 ? /* @__PURE__ */ t(V, { baseToc: o, pivotTocItems: c }) : /* @__PURE__ */ t(H, { toc: o })
|
|
105
104
|
] }) }) : null,
|
|
106
|
-
/* @__PURE__ */
|
|
105
|
+
/* @__PURE__ */ e(
|
|
107
106
|
"div",
|
|
108
107
|
{
|
|
109
108
|
className: d(
|
|
@@ -111,25 +110,25 @@ function dt({
|
|
|
111
110
|
P && "mint:max-w-none!"
|
|
112
111
|
),
|
|
113
112
|
children: [
|
|
114
|
-
i.title && /* @__PURE__ */ t("header", { className: "mint:mb-6", children: /* @__PURE__ */
|
|
115
|
-
/* @__PURE__ */
|
|
113
|
+
i.title && /* @__PURE__ */ t("header", { className: "mint:mb-6", children: /* @__PURE__ */ e("div", { className: "mint:flex mint:flex-col mint:gap-5", children: [
|
|
114
|
+
/* @__PURE__ */ e("div", { className: "mint:flex mint:flex-col mint:gap-2 mint:items-start", children: [
|
|
116
115
|
/* @__PURE__ */ t("h1", { className: "mint:text-[1.875rem] mint:font-bold mint:text-[#141414] mint:dark:text-white mint:m-0 mint:leading-[1.2] mint:pt-3", children: i.title }),
|
|
117
116
|
i.description && /* @__PURE__ */ t("p", { className: "mint:text-lg mint:text-[#4b5563] mint:dark:text-[#d1d5db] mint:m-0", children: i.description })
|
|
118
117
|
] }),
|
|
119
118
|
s && /* @__PURE__ */ t(
|
|
120
|
-
|
|
119
|
+
R,
|
|
121
120
|
{
|
|
122
121
|
className: "mint:shrink-0",
|
|
123
122
|
pathname: s,
|
|
124
123
|
markdownContent: w,
|
|
125
124
|
allPages: v,
|
|
126
125
|
baseUrl: u,
|
|
127
|
-
onCopyMarkdown:
|
|
128
|
-
onViewMarkdown:
|
|
126
|
+
onCopyMarkdown: n == null ? void 0 : n.onCopyMarkdown,
|
|
127
|
+
onViewMarkdown: n == null ? void 0 : n.onViewMarkdown
|
|
129
128
|
}
|
|
130
129
|
)
|
|
131
130
|
] }) }),
|
|
132
|
-
|
|
131
|
+
a.length > 0 && /* @__PURE__ */ t("div", { className: "mint:mb-6 mint:flex mint:flex-wrap mint:gap-4", children: a.map((m) => /* @__PURE__ */ t(
|
|
133
132
|
M,
|
|
134
133
|
{
|
|
135
134
|
group: m,
|
|
@@ -137,7 +136,7 @@ function dt({
|
|
|
137
136
|
},
|
|
138
137
|
m.id
|
|
139
138
|
)) }),
|
|
140
|
-
/* @__PURE__ */ t("div", { className: "mint:pt-4", children: /* @__PURE__ */ t(
|
|
139
|
+
/* @__PURE__ */ t("div", { className: "mint:pt-4", children: /* @__PURE__ */ t(B, { children: /* @__PURE__ */ t(T, {}) }) })
|
|
141
140
|
]
|
|
142
141
|
}
|
|
143
142
|
)
|
package/dist/constants/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { NEXT_PUBLIC as _ } from "../env.js";
|
|
2
|
+
const T = 5e4, t = `${_.BASE_PATH}/_mintlify/api/request`, I = `${_.BASE_PATH}/_mintlify/api/file-request`;
|
|
2
3
|
export {
|
|
3
|
-
|
|
4
|
+
T as MAX_PREVIEW_BYTES,
|
|
5
|
+
I as MINTLIFY_FILE_REQUEST_ENDPOINT_URL,
|
|
6
|
+
t as MINTLIFY_REQUEST_ENDPOINT_URL
|
|
4
7
|
};
|