@mintlify/msft-sdk 1.1.59 → 1.1.60
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,12 +1,13 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import i from "@sindresorhus/slugify";
|
|
3
|
+
import "../../../contexts/EndpointLocationContext.js";
|
|
4
|
+
const s = (r, t, e, $) => i(
|
|
5
|
+
`${r ? `${r}-` : ""}${e ? `${e}-` : ""}${t || ""}-`,
|
|
5
6
|
{
|
|
6
7
|
decamelize: !0
|
|
7
8
|
}
|
|
8
|
-
),
|
|
9
|
+
), m = (r, t) => r ? `${t ? `${t}` : ""}${r}.` : "";
|
|
9
10
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
s as buildRecursiveParamFieldId,
|
|
12
|
+
m as getRecursiveParentName
|
|
12
13
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import "../../contexts/EndpointLocationContext.js";
|
|
3
|
+
import { useOpenApiEndpoint as t } from "../../hooks/useEndpoint.js";
|
|
4
|
+
const i = () => (t(), null);
|
|
4
5
|
export {
|
|
5
|
-
|
|
6
|
+
i as default
|
|
6
7
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ClipboardCheckmarkRegular as
|
|
3
|
-
import
|
|
1
|
+
import { jsxs as w, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { ClipboardCheckmarkRegular as j, Copy20Regular as E } from "@fluentui/react-icons";
|
|
3
|
+
import g from "prismjs";
|
|
4
4
|
import "prismjs/components/prism-bash.js";
|
|
5
5
|
import "prismjs/components/prism-csharp.js";
|
|
6
6
|
import "prismjs/components/prism-javascript.js";
|
|
@@ -9,167 +9,173 @@ import "prismjs/components/prism-markdown.js";
|
|
|
9
9
|
import "prismjs/components/prism-powershell.js";
|
|
10
10
|
import "prismjs/components/prism-python.js";
|
|
11
11
|
import "prismjs/components/prism-typescript.js";
|
|
12
|
-
import
|
|
13
|
-
import { cn as
|
|
14
|
-
import { getNodeText as
|
|
15
|
-
import { getCodeBlockScrollbarClassname as
|
|
16
|
-
const
|
|
12
|
+
import P, { useState as _, useEffect as z } from "react";
|
|
13
|
+
import { cn as p } from "../../utils/cn.js";
|
|
14
|
+
import { getNodeText as F } from "../../utils/get-node-text.js";
|
|
15
|
+
import { getCodeBlockScrollbarClassname as D } from "../../utils/getScrollbarClassname.js";
|
|
16
|
+
const v = ["image/png", "text/plain"];
|
|
17
17
|
function y() {
|
|
18
|
-
const [t, e] =
|
|
18
|
+
const [t, e] = _(!1), r = async (n) => {
|
|
19
19
|
try {
|
|
20
20
|
await navigator.clipboard.writeText(n), e(!0), setTimeout(() => e(!1), 2e3);
|
|
21
|
-
} catch (
|
|
22
|
-
console.error("Failed to copy to clipboard:",
|
|
21
|
+
} catch (i) {
|
|
22
|
+
console.error("Failed to copy to clipboard:", i);
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
return { isCopied: t, copy:
|
|
25
|
+
return { isCopied: t, copy: r, copyBlob: async (n, i) => {
|
|
26
26
|
try {
|
|
27
|
-
if (
|
|
28
|
-
const
|
|
29
|
-
[
|
|
27
|
+
if (v.includes(i)) {
|
|
28
|
+
const a = await n.arrayBuffer(), m = new Blob([a], { type: i }), u = new ClipboardItem({
|
|
29
|
+
[i]: m
|
|
30
30
|
});
|
|
31
|
-
await navigator.clipboard.write([
|
|
31
|
+
await navigator.clipboard.write([u]), e(!0), setTimeout(() => e(!1), 2e3);
|
|
32
32
|
} else {
|
|
33
|
-
const
|
|
34
|
-
await
|
|
33
|
+
const a = await n.text();
|
|
34
|
+
await r(a);
|
|
35
35
|
}
|
|
36
|
-
} catch (
|
|
37
|
-
console.error("Failed to copy blob to clipboard:",
|
|
36
|
+
} catch (a) {
|
|
37
|
+
console.error("Failed to copy blob to clipboard:", a);
|
|
38
38
|
try {
|
|
39
|
-
const
|
|
40
|
-
await
|
|
41
|
-
} catch (
|
|
42
|
-
console.error("Failed to copy as text fallback:",
|
|
39
|
+
const m = await n.text();
|
|
40
|
+
await r(m);
|
|
41
|
+
} catch (m) {
|
|
42
|
+
console.error("Failed to copy as text fallback:", m);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
} };
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
return /* @__PURE__ */
|
|
49
|
-
|
|
50
|
-
/* @__PURE__ */
|
|
47
|
+
function C({ onClick: t, isCopied: e, showTooltip: r = !0 }) {
|
|
48
|
+
return /* @__PURE__ */ w("div", { className: "mint:relative", children: [
|
|
49
|
+
r && e && /* @__PURE__ */ o("div", { className: "mint:absolute mint:bottom-[calc(100%+0.5rem)] mint:left-1/2 mint:-translate-x-1/2 mint:bg-white mint:dark:bg-[#1a1a1a] mint:text-[#171717] mint:dark:text-[#fafafa] mint:px-2.5 mint:py-1.5 mint:rounded-md mint:text-xs mint:font-medium mint:whitespace-nowrap mint:shadow-[0_4px_6px_-1px_rgba(0,0,0,0.1),0_2px_4px_-1px_rgba(0,0,0,0.06)] mint:dark:shadow-[0_4px_6px_-1px_rgba(0,0,0,0.3),0_2px_4px_-1px_rgba(0,0,0,0.2)] mint:z-10 mint:animate-[fadeIn_0.15s_ease-out] mint:after:content-[''] mint:after:absolute mint:after:top-full mint:after:left-1/2 mint:after:-translate-x-1/2 mint:after:w-0 mint:after:h-0 mint:after:border-l-[6px] mint:after:border-l-transparent mint:after:border-r-[6px] mint:after:border-r-transparent mint:after:border-t-[6px] mint:after:border-t-white mint:dark:after:border-t-[#1a1a1a]", children: "Copied!" }),
|
|
50
|
+
/* @__PURE__ */ o(
|
|
51
51
|
"button",
|
|
52
52
|
{
|
|
53
53
|
onClick: t,
|
|
54
54
|
className: "mint:flex mint:items-center mint:gap-1.5 mint:px-2 mint:py-1 mint:text-xs mint:text-[#737373] mint:dark:text-[#a3a3a3] mint:rounded mint:transition-colors mint:duration-150 mint:border-none mint:bg-transparent mint:cursor-pointer mint:hover:text-[#9263f1] mint:dark:hover:text-[#c9aaf9]",
|
|
55
55
|
"aria-label": e ? "Copied" : "Copy code",
|
|
56
|
-
children: e ? /* @__PURE__ */
|
|
56
|
+
children: e ? /* @__PURE__ */ o(j, { className: "mint:w-5 mint:h-5 mint:text-[#737373] mint:dark:text-[#a3a3a3]" }) : /* @__PURE__ */ o(E, { className: "mint:w-5 mint:h-5" })
|
|
57
57
|
}
|
|
58
58
|
)
|
|
59
59
|
] });
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function G({
|
|
62
62
|
textToCopy: t,
|
|
63
63
|
showTooltip: e = !0
|
|
64
64
|
}) {
|
|
65
|
-
const { isCopied:
|
|
66
|
-
return /* @__PURE__ */
|
|
65
|
+
const { isCopied: r, copy: c } = y();
|
|
66
|
+
return /* @__PURE__ */ o(C, { onClick: () => {
|
|
67
67
|
c(t);
|
|
68
|
-
}, isCopied:
|
|
68
|
+
}, isCopied: r, showTooltip: e });
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function tt({
|
|
71
71
|
data: t,
|
|
72
72
|
showTooltip: e = !0
|
|
73
73
|
}) {
|
|
74
|
-
const { isCopied:
|
|
75
|
-
return /* @__PURE__ */
|
|
76
|
-
t.contentType &&
|
|
77
|
-
}, isCopied:
|
|
74
|
+
const { isCopied: r, copy: c, copyBlob: n } = y();
|
|
75
|
+
return /* @__PURE__ */ o(C, { onClick: () => {
|
|
76
|
+
t.contentType && v.includes(t.contentType) ? n(t.blob, t.contentType) : t.type === "other" && t.content ? c(t.content) : console.error("Unsupported content type for clipboard");
|
|
77
|
+
}, isCopied: r, showTooltip: e });
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function et({
|
|
80
80
|
children: t,
|
|
81
81
|
className: e,
|
|
82
|
-
fileName:
|
|
82
|
+
fileName: r,
|
|
83
83
|
language: c,
|
|
84
84
|
blob: n,
|
|
85
|
-
contentType:
|
|
86
|
-
dataGroup:
|
|
85
|
+
contentType: i,
|
|
86
|
+
dataGroup: a = !1
|
|
87
87
|
}) {
|
|
88
|
-
const [
|
|
89
|
-
|
|
90
|
-
const s = c || (e == null ? void 0 : e.replace(/^language-/, "")) || "text", u = j(t), T = !!o, g = A.useMemo(() => {
|
|
91
|
-
var x, C;
|
|
88
|
+
const [m, u] = _(""), { isCopied: T, copy: B, copyBlob: N } = y(), s = c || (e == null ? void 0 : e.replace(/^language-/, "")) || "text", d = F(t), I = !!r, h = P.useMemo(() => {
|
|
89
|
+
var x, k;
|
|
92
90
|
if (typeof t != "object" || t == null)
|
|
93
91
|
return !1;
|
|
94
|
-
const
|
|
95
|
-
for (const l of
|
|
92
|
+
const f = Array.isArray(t) ? t : [t];
|
|
93
|
+
for (const l of f)
|
|
96
94
|
if (typeof l == "object" && l != null && "props" in l && ((x = l.props) != null && x.children)) {
|
|
97
|
-
const
|
|
98
|
-
for (const b of
|
|
99
|
-
if (typeof b == "object" && b != null && "props" in b && ((
|
|
95
|
+
const R = Array.isArray(l.props.children) ? l.props.children : [l.props.children];
|
|
96
|
+
for (const b of R)
|
|
97
|
+
if (typeof b == "object" && b != null && "props" in b && ((k = b.props) != null && k.className))
|
|
100
98
|
return !0;
|
|
101
99
|
}
|
|
102
100
|
return !1;
|
|
103
101
|
}, [t]);
|
|
104
|
-
|
|
105
|
-
if (!
|
|
102
|
+
z(() => {
|
|
103
|
+
if (!h)
|
|
106
104
|
try {
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
} catch (
|
|
110
|
-
console.error("Failed to highlight code:",
|
|
105
|
+
const f = g.languages[s] || g.languages.plaintext, x = g.highlight(d, f, s);
|
|
106
|
+
u(x);
|
|
107
|
+
} catch (f) {
|
|
108
|
+
console.error("Failed to highlight code:", f), u(d);
|
|
111
109
|
}
|
|
112
|
-
}, [
|
|
113
|
-
const
|
|
114
|
-
|
|
110
|
+
}, [d, s, h]);
|
|
111
|
+
const S = () => {
|
|
112
|
+
n && i ? N(n, i) : B(d);
|
|
113
|
+
}, A = D("system", a);
|
|
114
|
+
return /* @__PURE__ */ w(
|
|
115
115
|
"div",
|
|
116
116
|
{
|
|
117
|
-
className:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
117
|
+
className: p(
|
|
118
|
+
"mint:relative",
|
|
119
|
+
I ? "mint:flex mint:flex-col mint:gap-2 mint:px-0.5 mint:pb-0.5 mint:rounded-xl mint:overflow-hidden" : void 0
|
|
120
|
+
),
|
|
121
|
+
"data-group": a,
|
|
122
|
+
children: [
|
|
123
|
+
/* @__PURE__ */ o("div", { className: "mint:absolute mint:top-2 mint:right-2 mint:z-10", children: /* @__PURE__ */ o(C, { onClick: S, isCopied: T, showTooltip: !0 }) }),
|
|
124
|
+
/* @__PURE__ */ o(
|
|
125
|
+
"div",
|
|
126
|
+
{
|
|
127
|
+
className: p(
|
|
128
|
+
"not-prose mint:relative mint:rounded-xl mint:bg-[#f5f5f5] mint:dark:bg-[#141414] code-block-wrapper",
|
|
129
|
+
"mint:px-4 mint:py-2 mint:overflow-scroll mint:[scrollbar-gutter:stable] mint:scrollbar-track-zinc-200 mint:dark:scrollbar-track-zinc-800",
|
|
130
|
+
A,
|
|
131
|
+
a && "mint:group"
|
|
132
|
+
),
|
|
133
|
+
children: /* @__PURE__ */ o(
|
|
134
|
+
"pre",
|
|
135
|
+
{
|
|
136
|
+
className: p(
|
|
137
|
+
"mint:m-0 mint:whitespace-pre mint:text-sm"
|
|
138
|
+
),
|
|
139
|
+
children: h ? /* @__PURE__ */ o(
|
|
140
|
+
"code",
|
|
141
|
+
{
|
|
142
|
+
className: p(
|
|
143
|
+
`language-${s}`,
|
|
144
|
+
"mint:block mint:text-[#24292e] mint:dark:text-[#e6edf3]"
|
|
145
|
+
),
|
|
146
|
+
children: t
|
|
147
|
+
}
|
|
148
|
+
) : m ? /* @__PURE__ */ o(
|
|
149
|
+
"code",
|
|
150
|
+
{
|
|
151
|
+
className: p(
|
|
152
|
+
`language-${s}`,
|
|
153
|
+
"mint:block mint:text-[#24292e] mint:dark:text-[#e6edf3]"
|
|
154
|
+
),
|
|
155
|
+
dangerouslySetInnerHTML: { __html: m }
|
|
156
|
+
}
|
|
157
|
+
) : /* @__PURE__ */ o(
|
|
158
|
+
"code",
|
|
159
|
+
{
|
|
160
|
+
className: p(
|
|
161
|
+
`language-${s}`,
|
|
162
|
+
"mint:block mint:text-[#24292e] mint:dark:text-[#e6edf3]"
|
|
163
|
+
),
|
|
164
|
+
children: d
|
|
165
|
+
}
|
|
166
|
+
)
|
|
167
|
+
}
|
|
168
|
+
)
|
|
169
|
+
}
|
|
170
|
+
)
|
|
171
|
+
]
|
|
166
172
|
}
|
|
167
173
|
);
|
|
168
174
|
}
|
|
169
175
|
export {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
176
|
+
et as CodeBlock,
|
|
177
|
+
tt as CopyDataToClipboardButton,
|
|
178
|
+
C as CopyIconButton,
|
|
179
|
+
G as CopyToClipboardButton,
|
|
174
180
|
y as useCopyToClipboard
|
|
175
181
|
};
|