zudoku 0.48.0 → 0.48.2
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/config/loader.js +1 -1
- package/dist/config/loader.js.map +1 -1
- package/dist/flat-config.d.ts +320 -0
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js +3 -2
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
- package/dist/lib/plugins/api-keys/index.js +23 -2
- package/dist/lib/plugins/api-keys/index.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -1
- package/dist/lib/ui/Alert.d.ts +5 -4
- package/dist/lib/ui/Alert.js +12 -10
- package/dist/lib/ui/Alert.js.map +1 -1
- package/dist/lib/ui/CodeBlock.d.ts +1 -2
- package/dist/lib/ui/CodeBlock.js +9 -9
- package/dist/lib/ui/CodeBlock.js.map +1 -1
- package/dist/lib/ui/EmbeddedCodeBlock.d.ts +15 -0
- package/dist/lib/ui/EmbeddedCodeBlock.js +18 -0
- package/dist/lib/ui/EmbeddedCodeBlock.js.map +1 -0
- package/dist/lib/ui/SyntaxHighlight.d.ts +3 -1
- package/dist/lib/ui/SyntaxHighlight.js +3 -2
- package/dist/lib/ui/SyntaxHighlight.js.map +1 -1
- package/dist/lib/util/MdxComponents.d.ts +3 -1
- package/dist/vite/config.js +11 -2
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/plugin-frontmatter.js +2 -0
- package/dist/vite/plugin-frontmatter.js.map +1 -1
- package/lib/{Markdown-DCAIYXF5.js → Markdown-BQ8YqLsz.js} +80 -88
- package/lib/{Markdown-DCAIYXF5.js.map → Markdown-BQ8YqLsz.js.map} +1 -1
- package/lib/{MdxPage-Cf9YXWoC.js → MdxPage-DJvKmI-r.js} +3 -3
- package/lib/{MdxPage-Cf9YXWoC.js.map → MdxPage-DJvKmI-r.js.map} +1 -1
- package/lib/{OasProvider-JMVTfG6_.js → OasProvider-BC0q5m3u.js} +2 -2
- package/lib/{OasProvider-JMVTfG6_.js.map → OasProvider-BC0q5m3u.js.map} +1 -1
- package/lib/{OperationList-m4tFCI4S.js → OperationList-Dpip6ozi.js} +6 -5
- package/lib/{OperationList-m4tFCI4S.js.map → OperationList-Dpip6ozi.js.map} +1 -1
- package/lib/{SchemaList-_wRy4aQ0.js → SchemaList-t4BIfh6Z.js} +5 -5
- package/lib/{SchemaList-_wRy4aQ0.js.map → SchemaList-t4BIfh6Z.js.map} +1 -1
- package/lib/{SchemaView-CRl_cQYH.js → SchemaView-CLxthVcA.js} +3 -3
- package/lib/{SchemaView-CRl_cQYH.js.map → SchemaView-CLxthVcA.js.map} +1 -1
- package/lib/{Slot-BkYrj_uC.js → Slot-CSEIvwwO.js} +57 -56
- package/lib/Slot-CSEIvwwO.js.map +1 -0
- package/lib/{SyntaxHighlight-CH9OUJre.js → SyntaxHighlight-C5ja40ix.js} +715 -714
- package/lib/{SyntaxHighlight-CH9OUJre.js.map → SyntaxHighlight-C5ja40ix.js.map} +1 -1
- package/lib/{Toc-DRxqEsFc.js → Toc-BS0f4GTe.js} +2 -2
- package/lib/{Toc-DRxqEsFc.js.map → Toc-BS0f4GTe.js.map} +1 -1
- package/lib/{circular-wJaV4vh_.js → circular-DfOaDE_x.js} +2 -2
- package/lib/{circular-wJaV4vh_.js.map → circular-DfOaDE_x.js.map} +1 -1
- package/lib/{createServer-DN5AJLcN.js → createServer-DjOMygls.js} +3 -3
- package/lib/{createServer-DN5AJLcN.js.map → createServer-DjOMygls.js.map} +1 -1
- package/lib/{index-DJVaRmzI.js → index-DW2qmCJa.js} +7 -7
- package/lib/{index-DJVaRmzI.js.map → index-DW2qmCJa.js.map} +1 -1
- package/lib/ui/Alert.js +54 -38
- package/lib/ui/Alert.js.map +1 -1
- package/lib/ui/CodeBlock.js +54 -62
- package/lib/ui/CodeBlock.js.map +1 -1
- package/lib/ui/EmbeddedCodeBlock.js +80 -0
- package/lib/ui/EmbeddedCodeBlock.js.map +1 -0
- package/lib/ui/SyntaxHighlight.js +3 -2
- package/lib/ui/SyntaxHighlight.js.map +1 -1
- package/lib/zudoku.components.js +2 -2
- package/lib/zudoku.plugin-api-catalog.js +1 -1
- package/lib/zudoku.plugin-api-keys.js +268 -200
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +1 -1
- package/package.json +1 -1
- package/src/app/main.css +4 -1
- package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +22 -3
- package/src/lib/plugins/api-keys/index.tsx +26 -4
- package/src/lib/plugins/openapi/Sidecar.tsx +1 -0
- package/src/lib/ui/Alert.tsx +44 -38
- package/src/lib/ui/CodeBlock.tsx +39 -53
- package/src/lib/ui/EmbeddedCodeBlock.tsx +94 -0
- package/src/lib/ui/SyntaxHighlight.tsx +11 -3
- package/lib/Slot-BkYrj_uC.js.map +0 -1
package/lib/ui/Alert.js
CHANGED
|
@@ -1,51 +1,67 @@
|
|
|
1
1
|
import { j as a } from "../jsx-runtime-C5mzlN2N.js";
|
|
2
|
-
import { c as
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
"relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
|
|
2
|
+
import { c as i } from "../index-DI5SPFK9.js";
|
|
3
|
+
import { c as e } from "../cn-wvCW-ho6.js";
|
|
4
|
+
const l = i(
|
|
5
|
+
"relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",
|
|
7
6
|
{
|
|
8
7
|
variants: {
|
|
9
8
|
variant: {
|
|
10
|
-
default: "bg-
|
|
11
|
-
destructive: "
|
|
9
|
+
default: "bg-card text-card-foreground",
|
|
10
|
+
destructive: "text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"
|
|
12
11
|
}
|
|
13
12
|
},
|
|
14
13
|
defaultVariants: {
|
|
15
14
|
variant: "default"
|
|
16
15
|
}
|
|
17
16
|
}
|
|
18
|
-
)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
17
|
+
);
|
|
18
|
+
function o({
|
|
19
|
+
className: t,
|
|
20
|
+
variant: r,
|
|
21
|
+
...s
|
|
22
|
+
}) {
|
|
23
|
+
return /* @__PURE__ */ a.jsx(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
"data-slot": "alert",
|
|
27
|
+
role: "alert",
|
|
28
|
+
className: e(l({ variant: r }), t),
|
|
29
|
+
...s
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
function g({ className: t, ...r }) {
|
|
34
|
+
return /* @__PURE__ */ a.jsx(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
"data-slot": "alert-title",
|
|
38
|
+
className: e(
|
|
39
|
+
"col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",
|
|
40
|
+
t
|
|
41
|
+
),
|
|
42
|
+
...r
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
function u({
|
|
47
|
+
className: t,
|
|
48
|
+
...r
|
|
49
|
+
}) {
|
|
50
|
+
return /* @__PURE__ */ a.jsx(
|
|
51
|
+
"div",
|
|
52
|
+
{
|
|
53
|
+
"data-slot": "alert-description",
|
|
54
|
+
className: e(
|
|
55
|
+
"text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",
|
|
56
|
+
t
|
|
57
|
+
),
|
|
58
|
+
...r
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
}
|
|
46
62
|
export {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
63
|
+
o as Alert,
|
|
64
|
+
u as AlertDescription,
|
|
65
|
+
g as AlertTitle
|
|
50
66
|
};
|
|
51
67
|
//# sourceMappingURL=Alert.js.map
|
package/lib/ui/Alert.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.js","sources":["../../src/lib/ui/Alert.tsx"],"sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\
|
|
1
|
+
{"version":3,"file":"Alert.js","sources":["../../src/lib/ui/Alert.tsx"],"sourcesContent":["import { cva, type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\nimport { cn } from \"../util/cn.js\";\n\nconst alertVariants = cva(\n \"relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current\",\n {\n variants: {\n variant: {\n default: \"bg-card text-card-foreground\",\n destructive:\n \"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nfunction Alert({\n className,\n variant,\n ...props\n}: React.ComponentProps<\"div\"> & VariantProps<typeof alertVariants>) {\n return (\n <div\n data-slot=\"alert\"\n role=\"alert\"\n className={cn(alertVariants({ variant }), className)}\n {...props}\n />\n );\n}\n\nfunction AlertTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"alert-title\"\n className={cn(\n \"col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction AlertDescription({\n className,\n ...props\n}: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"alert-description\"\n className={cn(\n \"text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed\",\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Alert, AlertDescription, AlertTitle };\n"],"names":["alertVariants","cva","Alert","className","variant","props","jsx","cn","AlertTitle","AlertDescription"],"mappings":";;;AAIA,MAAMA,IAAgBC;AAAA,EACpB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,aACE;AAAA,MAAA;AAAA,IAEN;AAAA,IACA,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ;AAEA,SAASC,EAAM;AAAA,EACb,WAAAC;AAAA,EACA,SAAAC;AAAA,EACA,GAAGC;AACL,GAAqE;AAEjE,SAAAC,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,MAAK;AAAA,MACL,WAAWC,EAAGP,EAAc,EAAE,SAAAI,EAAS,CAAA,GAAGD,CAAS;AAAA,MAClD,GAAGE;AAAA,IAAA;AAAA,EACN;AAEJ;AAEA,SAASG,EAAW,EAAE,WAAAL,GAAW,GAAGE,KAAsC;AAEtE,SAAAC,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWC;AAAA,QACT;AAAA,QACAJ;AAAA,MACF;AAAA,MACC,GAAGE;AAAA,IAAA;AAAA,EACN;AAEJ;AAEA,SAASI,EAAiB;AAAA,EACxB,WAAAN;AAAA,EACA,GAAGE;AACL,GAAgC;AAE5B,SAAAC,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAU;AAAA,MACV,WAAWC;AAAA,QACT;AAAA,QACAJ;AAAA,MACF;AAAA,MACC,GAAGE;AAAA,IAAA;AAAA,EACN;AAEJ;"}
|
package/lib/ui/CodeBlock.js
CHANGED
|
@@ -1,77 +1,69 @@
|
|
|
1
1
|
import { j as e } from "../jsx-runtime-C5mzlN2N.js";
|
|
2
|
-
import { CheckIcon as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { c as
|
|
5
|
-
const
|
|
6
|
-
children:
|
|
7
|
-
title:
|
|
8
|
-
language:
|
|
9
|
-
showCopy:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
showLineNumbers: u,
|
|
2
|
+
import { CheckIcon as u, CopyIcon as x } from "lucide-react";
|
|
3
|
+
import { useState as p, useRef as b } from "react";
|
|
4
|
+
import { c as o } from "../cn-wvCW-ho6.js";
|
|
5
|
+
const j = ({
|
|
6
|
+
children: r,
|
|
7
|
+
title: a = "Code",
|
|
8
|
+
language: n,
|
|
9
|
+
showCopy: i = "hover",
|
|
10
|
+
showLanguageIndicator: c = !1,
|
|
11
|
+
showLineNumbers: d,
|
|
13
12
|
...m
|
|
14
13
|
}) => {
|
|
15
|
-
const [
|
|
16
|
-
return
|
|
14
|
+
const [s, l] = p(!1), t = b(null);
|
|
15
|
+
return r ? /* @__PURE__ */ e.jsxs(
|
|
17
16
|
"div",
|
|
18
17
|
{
|
|
19
|
-
className:
|
|
20
|
-
"code-block-wrapper relative group bg-muted/50 rounded-md",
|
|
21
|
-
|
|
18
|
+
className: o(
|
|
19
|
+
"border code-block-wrapper relative group bg-muted/50 rounded-md overflow-hidden",
|
|
20
|
+
d && "line-numbers"
|
|
22
21
|
),
|
|
23
22
|
children: [
|
|
24
|
-
|
|
23
|
+
/* @__PURE__ */ e.jsxs("div", { className: "border-b flex items-center h-10 font-sans bg-black/2", children: [
|
|
24
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex-1 text-sm w-full px-4", children: [
|
|
25
|
+
a,
|
|
26
|
+
c && /* @__PURE__ */ e.jsxs("span", { className: "text-muted-foreground ml-2", children: [
|
|
27
|
+
"(",
|
|
28
|
+
n,
|
|
29
|
+
")"
|
|
30
|
+
] })
|
|
31
|
+
] }),
|
|
32
|
+
" ",
|
|
33
|
+
i !== "never" && /* @__PURE__ */ e.jsx(
|
|
34
|
+
"button",
|
|
35
|
+
{
|
|
36
|
+
type: "button",
|
|
37
|
+
"aria-label": "Copy code",
|
|
38
|
+
title: "Copy code",
|
|
39
|
+
className: o(
|
|
40
|
+
"cursor:pointer h-full hover:border-l-border active:shadow-none active:inset-shadow-xs hover:inset-shadow-xs flex items-center gap-2 px-4 outline-border text-sm hover:bg-black/5 transition-all"
|
|
41
|
+
),
|
|
42
|
+
disabled: s,
|
|
43
|
+
onClick: () => {
|
|
44
|
+
t.current?.textContent && (l(!0), navigator.clipboard.writeText(t.current.textContent), setTimeout(() => l(!1), 2e3));
|
|
45
|
+
},
|
|
46
|
+
children: s ? /* @__PURE__ */ e.jsx(
|
|
47
|
+
u,
|
|
48
|
+
{
|
|
49
|
+
className: "text-emerald-600",
|
|
50
|
+
size: 14,
|
|
51
|
+
strokeWidth: 2.5,
|
|
52
|
+
absoluteStrokeWidth: !0
|
|
53
|
+
}
|
|
54
|
+
) : /* @__PURE__ */ e.jsx(x, { size: 14 })
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
] }),
|
|
25
58
|
/* @__PURE__ */ e.jsx(
|
|
26
59
|
"div",
|
|
27
60
|
{
|
|
28
|
-
className:
|
|
61
|
+
className: o(
|
|
29
62
|
"code-block text-sm not-prose scrollbar overflow-x-auto scrollbar p-4",
|
|
30
63
|
m.className
|
|
31
64
|
),
|
|
32
|
-
ref:
|
|
33
|
-
children:
|
|
34
|
-
}
|
|
35
|
-
),
|
|
36
|
-
c && /* @__PURE__ */ e.jsx(
|
|
37
|
-
"span",
|
|
38
|
-
{
|
|
39
|
-
className: t(
|
|
40
|
-
"absolute top-1.5 end-3 !text-[11px] font-mono text-muted-foreground transition group-hover:opacity-0",
|
|
41
|
-
o && "top-12",
|
|
42
|
-
r === "always" && "hidden"
|
|
43
|
-
),
|
|
44
|
-
children: l
|
|
45
|
-
}
|
|
46
|
-
),
|
|
47
|
-
r !== "never" && /* @__PURE__ */ e.jsxs(
|
|
48
|
-
"button",
|
|
49
|
-
{
|
|
50
|
-
type: "button",
|
|
51
|
-
"aria-label": "Copy code",
|
|
52
|
-
title: "Copy code",
|
|
53
|
-
className: t(
|
|
54
|
-
"absolute top-2 end-2 p-2 transition hover:shadow-xs active:shadow-none active:inset-shadow-xs hover:outline outline-border rounded-md text-sm text-muted-foreground",
|
|
55
|
-
o && "top-10",
|
|
56
|
-
r === "hover" && "opacity-0 group-hover:opacity-100",
|
|
57
|
-
a && "flex gap-2 items-center font-medium"
|
|
58
|
-
),
|
|
59
|
-
disabled: d,
|
|
60
|
-
onClick: () => {
|
|
61
|
-
s.current?.textContent && (i(!0), navigator.clipboard.writeText(s.current.textContent), setTimeout(() => i(!1), 2e3));
|
|
62
|
-
},
|
|
63
|
-
children: [
|
|
64
|
-
d ? /* @__PURE__ */ e.jsx(
|
|
65
|
-
p,
|
|
66
|
-
{
|
|
67
|
-
className: "text-emerald-600",
|
|
68
|
-
size: 16,
|
|
69
|
-
strokeWidth: 2.5,
|
|
70
|
-
absoluteStrokeWidth: !0
|
|
71
|
-
}
|
|
72
|
-
) : /* @__PURE__ */ e.jsx(x, { size: 16 }),
|
|
73
|
-
a && "Copy"
|
|
74
|
-
]
|
|
65
|
+
ref: t,
|
|
66
|
+
children: r
|
|
75
67
|
}
|
|
76
68
|
)
|
|
77
69
|
]
|
|
@@ -79,6 +71,6 @@ const C = ({
|
|
|
79
71
|
) : null;
|
|
80
72
|
};
|
|
81
73
|
export {
|
|
82
|
-
|
|
74
|
+
j as CodeBlock
|
|
83
75
|
};
|
|
84
76
|
//# sourceMappingURL=CodeBlock.js.map
|
package/lib/ui/CodeBlock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeBlock.js","sources":["../../src/lib/ui/CodeBlock.tsx"],"sourcesContent":["import { CheckIcon, CopyIcon } from \"lucide-react\";\nimport type { ReactNode } from \"react\";\nimport { useRef, useState } from \"react\";\nimport { cn } from \"../util/cn.js\";\n\nexport type CodeBlockProps = {\n className?: string;\n noBackground?: boolean;\n wrapLines?: boolean;\n showLanguageIndicator?: boolean;\n language?: string;\n title?: string;\n children?: ReactNode;\n code?: ReactNode;\n showCopy?: \"hover\" | \"always\" | \"never\";\n
|
|
1
|
+
{"version":3,"file":"CodeBlock.js","sources":["../../src/lib/ui/CodeBlock.tsx"],"sourcesContent":["import { CheckIcon, CopyIcon } from \"lucide-react\";\nimport type { ReactNode } from \"react\";\nimport { useRef, useState } from \"react\";\nimport { cn } from \"../util/cn.js\";\n\nexport type CodeBlockProps = {\n className?: string;\n noBackground?: boolean;\n wrapLines?: boolean;\n showLanguageIndicator?: boolean;\n language?: string;\n title?: string;\n children?: ReactNode;\n code?: ReactNode;\n showCopy?: \"hover\" | \"always\" | \"never\";\n disabled?: boolean;\n showLineNumbers?: boolean;\n};\n\nexport const CodeBlock = ({\n children,\n title = \"Code\",\n language,\n showCopy = \"hover\",\n showLanguageIndicator = false,\n showLineNumbers,\n ...props\n}: CodeBlockProps) => {\n const [isCopied, setIsCopied] = useState(false);\n const ref = useRef<HTMLDivElement>(null);\n\n if (!children) return null;\n\n return (\n <div\n className={cn(\n \"border code-block-wrapper relative group bg-muted/50 rounded-md overflow-hidden\",\n showLineNumbers && \"line-numbers\",\n )}\n >\n <div className=\"border-b flex items-center h-10 font-sans bg-black/2\">\n <div className=\"flex-1 text-sm w-full px-4\">\n {title}\n {showLanguageIndicator && (\n <span className=\"text-muted-foreground ml-2\">({language})</span>\n )}\n </div>{\" \"}\n {showCopy !== \"never\" && (\n <button\n type=\"button\"\n aria-label=\"Copy code\"\n title=\"Copy code\"\n className={cn(\n \"cursor:pointer h-full hover:border-l-border active:shadow-none active:inset-shadow-xs hover:inset-shadow-xs flex items-center gap-2 px-4 outline-border text-sm hover:bg-black/5 transition-all\",\n )}\n disabled={isCopied}\n onClick={() => {\n if (!ref.current?.textContent) return;\n\n setIsCopied(true);\n void navigator.clipboard.writeText(ref.current.textContent);\n setTimeout(() => setIsCopied(false), 2000);\n }}\n >\n {isCopied ? (\n <CheckIcon\n className=\"text-emerald-600\"\n size={14}\n strokeWidth={2.5}\n absoluteStrokeWidth\n />\n ) : (\n <CopyIcon size={14} />\n )}\n </button>\n )}\n </div>\n <div\n className={cn(\n \"code-block text-sm not-prose scrollbar overflow-x-auto scrollbar p-4\",\n props.className,\n )}\n ref={ref}\n >\n {children}\n </div>\n </div>\n );\n};\n"],"names":["CodeBlock","children","title","language","showCopy","showLanguageIndicator","showLineNumbers","props","isCopied","setIsCopied","useState","ref","useRef","jsxs","cn","jsx","CheckIcon","CopyIcon"],"mappings":";;;;AAmBO,MAAMA,IAAY,CAAC;AAAA,EACxB,UAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,uBAAAC,IAAwB;AAAA,EACxB,iBAAAC;AAAA,EACA,GAAGC;AACL,MAAsB;AACpB,QAAM,CAACC,GAAUC,CAAW,IAAIC,EAAS,EAAK,GACxCC,IAAMC,EAAuB,IAAI;AAEnC,SAACX,IAGHY,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACT;AAAA,QACAR,KAAmB;AAAA,MACrB;AAAA,MAEA,UAAA;AAAA,QAACO,gBAAAA,EAAAA,KAAA,OAAA,EAAI,WAAU,wDACb,UAAA;AAAA,UAACA,gBAAAA,EAAAA,KAAA,OAAA,EAAI,WAAU,8BACZ,UAAA;AAAA,YAAAX;AAAA,YACAG,KACCQ,gBAAAA,EAAA,KAAC,QAAK,EAAA,WAAU,8BAA6B,UAAA;AAAA,cAAA;AAAA,cAAEV;AAAA,cAAS;AAAA,YAAA,EAAC,CAAA;AAAA,UAAA,GAE7D;AAAA,UAAO;AAAA,UACNC,MAAa,WACZW,gBAAAA,EAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,cAAW;AAAA,cACX,OAAM;AAAA,cACN,WAAWD;AAAA,gBACT;AAAA,cACF;AAAA,cACA,UAAUN;AAAA,cACV,SAAS,MAAM;AACT,gBAACG,EAAI,SAAS,gBAElBF,EAAY,EAAI,GACX,UAAU,UAAU,UAAUE,EAAI,QAAQ,WAAW,GAC1D,WAAW,MAAMF,EAAY,EAAK,GAAG,GAAI;AAAA,cAC3C;AAAA,cAEC,UACCD,IAAAO,gBAAAA,EAAA;AAAA,gBAACC;AAAA,gBAAA;AAAA,kBACC,WAAU;AAAA,kBACV,MAAM;AAAA,kBACN,aAAa;AAAA,kBACb,qBAAmB;AAAA,gBAAA;AAAA,cAGrB,IAAAD,gBAAAA,MAACE,GAAS,EAAA,MAAM,GAAI,CAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAExB,GAEJ;AAAA,QACAF,gBAAAA,EAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWD;AAAA,cACT;AAAA,cACAP,EAAM;AAAA,YACR;AAAA,YACA,KAAAI;AAAA,YAEC,UAAAV;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EACF,IAvDoB;AAyDxB;"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { j as e } from "../jsx-runtime-C5mzlN2N.js";
|
|
2
|
+
import { CheckIcon as m, CopyIcon as p } from "lucide-react";
|
|
3
|
+
import { useState as x, useRef as b } from "react";
|
|
4
|
+
import { c as t } from "../cn-wvCW-ho6.js";
|
|
5
|
+
const j = ({
|
|
6
|
+
children: s,
|
|
7
|
+
language: d,
|
|
8
|
+
showCopy: o = "hover",
|
|
9
|
+
showCopyText: n,
|
|
10
|
+
showLanguageIndicator: l = !0,
|
|
11
|
+
showLineNumbers: c,
|
|
12
|
+
...u
|
|
13
|
+
}) => {
|
|
14
|
+
const [a, i] = x(!1), r = b(null);
|
|
15
|
+
return s ? /* @__PURE__ */ e.jsxs(
|
|
16
|
+
"div",
|
|
17
|
+
{
|
|
18
|
+
className: t(
|
|
19
|
+
"code-block-wrapper relative group bg-muted/50 rounded-md",
|
|
20
|
+
c && "line-numbers"
|
|
21
|
+
),
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ e.jsx(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
className: t(
|
|
27
|
+
"code-block text-sm not-prose scrollbar overflow-x-auto scrollbar p-4",
|
|
28
|
+
u.className
|
|
29
|
+
),
|
|
30
|
+
ref: r,
|
|
31
|
+
children: s
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
l && /* @__PURE__ */ e.jsx(
|
|
35
|
+
"span",
|
|
36
|
+
{
|
|
37
|
+
className: t(
|
|
38
|
+
"absolute top-1.5 end-3 !text-[11px] font-mono text-muted-foreground transition group-hover:opacity-0",
|
|
39
|
+
o === "always" && "hidden"
|
|
40
|
+
),
|
|
41
|
+
children: d
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
o !== "never" && /* @__PURE__ */ e.jsxs(
|
|
45
|
+
"button",
|
|
46
|
+
{
|
|
47
|
+
type: "button",
|
|
48
|
+
"aria-label": "Copy code",
|
|
49
|
+
title: "Copy code",
|
|
50
|
+
className: t(
|
|
51
|
+
"absolute top-2 end-2 p-2 transition hover:shadow-xs active:shadow-none active:inset-shadow-xs hover:outline outline-border rounded-md text-sm text-muted-foreground",
|
|
52
|
+
o === "hover" && "opacity-0 group-hover:opacity-100",
|
|
53
|
+
n && "flex gap-2 items-center font-medium"
|
|
54
|
+
),
|
|
55
|
+
disabled: a,
|
|
56
|
+
onClick: () => {
|
|
57
|
+
r.current?.textContent && (i(!0), navigator.clipboard.writeText(r.current.textContent), setTimeout(() => i(!1), 2e3));
|
|
58
|
+
},
|
|
59
|
+
children: [
|
|
60
|
+
a ? /* @__PURE__ */ e.jsx(
|
|
61
|
+
m,
|
|
62
|
+
{
|
|
63
|
+
className: "text-emerald-600",
|
|
64
|
+
size: 16,
|
|
65
|
+
strokeWidth: 2.5,
|
|
66
|
+
absoluteStrokeWidth: !0
|
|
67
|
+
}
|
|
68
|
+
) : /* @__PURE__ */ e.jsx(p, { size: 16 }),
|
|
69
|
+
n && "Copy"
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
) : null;
|
|
76
|
+
};
|
|
77
|
+
export {
|
|
78
|
+
j as EmbeddedCodeBlock
|
|
79
|
+
};
|
|
80
|
+
//# sourceMappingURL=EmbeddedCodeBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EmbeddedCodeBlock.js","sources":["../../src/lib/ui/EmbeddedCodeBlock.tsx"],"sourcesContent":["import { CheckIcon, CopyIcon } from \"lucide-react\";\nimport type { ReactNode } from \"react\";\nimport { useRef, useState } from \"react\";\nimport { cn } from \"../util/cn.js\";\n\nexport type CodeBlockProps = {\n className?: string;\n noBackground?: boolean;\n wrapLines?: boolean;\n showLanguageIndicator?: boolean;\n language?: string;\n children?: ReactNode;\n code?: ReactNode;\n showCopy?: \"hover\" | \"always\" | \"never\";\n showCopyText?: boolean;\n disabled?: boolean;\n showLineNumbers?: boolean;\n};\n\nexport const EmbeddedCodeBlock = ({\n children,\n language,\n showCopy = \"hover\",\n showCopyText,\n showLanguageIndicator = true,\n showLineNumbers,\n ...props\n}: CodeBlockProps) => {\n const [isCopied, setIsCopied] = useState(false);\n const ref = useRef<HTMLDivElement>(null);\n\n if (!children) return null;\n\n return (\n <div\n className={cn(\n \"code-block-wrapper relative group bg-muted/50 rounded-md\",\n showLineNumbers && \"line-numbers\",\n )}\n >\n <div\n className={cn(\n \"code-block text-sm not-prose scrollbar overflow-x-auto scrollbar p-4\",\n props.className,\n )}\n ref={ref}\n >\n {children}\n </div>\n {showLanguageIndicator && (\n <span\n className={cn(\n \"absolute top-1.5 end-3 !text-[11px] font-mono text-muted-foreground transition group-hover:opacity-0\",\n showCopy === \"always\" && \"hidden\",\n )}\n >\n {language}\n </span>\n )}\n {showCopy !== \"never\" && (\n <button\n type=\"button\"\n aria-label=\"Copy code\"\n title=\"Copy code\"\n className={cn(\n \"absolute top-2 end-2 p-2 transition hover:shadow-xs active:shadow-none active:inset-shadow-xs hover:outline outline-border rounded-md text-sm text-muted-foreground\",\n showCopy === \"hover\" && \"opacity-0 group-hover:opacity-100\",\n showCopyText && \"flex gap-2 items-center font-medium\",\n )}\n disabled={isCopied}\n onClick={() => {\n if (!ref.current?.textContent) return;\n\n setIsCopied(true);\n void navigator.clipboard.writeText(ref.current.textContent);\n setTimeout(() => setIsCopied(false), 2000);\n }}\n >\n {isCopied ? (\n <CheckIcon\n className=\"text-emerald-600\"\n size={16}\n strokeWidth={2.5}\n absoluteStrokeWidth\n />\n ) : (\n <CopyIcon size={16} />\n )}\n {showCopyText && \"Copy\"}\n </button>\n )}\n </div>\n );\n};\n"],"names":["EmbeddedCodeBlock","children","language","showCopy","showCopyText","showLanguageIndicator","showLineNumbers","props","isCopied","setIsCopied","useState","ref","useRef","jsxs","cn","jsx","CheckIcon","CopyIcon"],"mappings":";;;;AAmBO,MAAMA,IAAoB,CAAC;AAAA,EAChC,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,cAAAC;AAAA,EACA,uBAAAC,IAAwB;AAAA,EACxB,iBAAAC;AAAA,EACA,GAAGC;AACL,MAAsB;AACpB,QAAM,CAACC,GAAUC,CAAW,IAAIC,EAAS,EAAK,GACxCC,IAAMC,EAAuB,IAAI;AAEnC,SAACX,IAGHY,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,QACT;AAAA,QACAR,KAAmB;AAAA,MACrB;AAAA,MAEA,UAAA;AAAA,QAAAS,gBAAAA,EAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWD;AAAA,cACT;AAAA,cACAP,EAAM;AAAA,YACR;AAAA,YACA,KAAAI;AAAA,YAEC,UAAAV;AAAA,UAAA;AAAA,QACH;AAAA,QACCI,KACCU,gBAAAA,EAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWD;AAAA,cACT;AAAA,cACAX,MAAa,YAAY;AAAA,YAC3B;AAAA,YAEC,UAAAD;AAAA,UAAA;AAAA,QACH;AAAA,QAEDC,MAAa,WACZU,gBAAAA,EAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,cAAW;AAAA,YACX,OAAM;AAAA,YACN,WAAWC;AAAA,cACT;AAAA,cACAX,MAAa,WAAW;AAAA,cACxBC,KAAgB;AAAA,YAClB;AAAA,YACA,UAAUI;AAAA,YACV,SAAS,MAAM;AACT,cAACG,EAAI,SAAS,gBAElBF,EAAY,EAAI,GACX,UAAU,UAAU,UAAUE,EAAI,QAAQ,WAAW,GAC1D,WAAW,MAAMF,EAAY,EAAK,GAAG,GAAI;AAAA,YAC3C;AAAA,YAEC,UAAA;AAAA,cACCD,IAAAO,gBAAAA,EAAA;AAAA,gBAACC;AAAA,gBAAA;AAAA,kBACC,WAAU;AAAA,kBACV,MAAM;AAAA,kBACN,aAAa;AAAA,kBACb,qBAAmB;AAAA,gBAAA;AAAA,cAGrB,IAAAD,gBAAAA,EAAA,IAACE,GAAS,EAAA,MAAM,GAAI,CAAA;AAAA,cAErBb,KAAgB;AAAA,YAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MACnB;AAAA,IAAA;AAAA,EAEJ,IA5DoB;AA8DxB;"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import "../jsx-runtime-C5mzlN2N.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "../hook-CHXroBFt.js";
|
|
4
|
-
import { S as
|
|
4
|
+
import { S as h } from "../SyntaxHighlight-C5ja40ix.js";
|
|
5
5
|
import "../invariant-DAFpPywt.js";
|
|
6
6
|
import "./CodeBlock.js";
|
|
7
|
+
import "./EmbeddedCodeBlock.js";
|
|
7
8
|
export {
|
|
8
|
-
|
|
9
|
+
h as SyntaxHighlight
|
|
9
10
|
};
|
|
10
11
|
//# sourceMappingURL=SyntaxHighlight.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SyntaxHighlight.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SyntaxHighlight.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
|
package/lib/zudoku.components.js
CHANGED
|
@@ -3,7 +3,7 @@ import { z as ht, J as cn } from "./index--oeBayMa.js";
|
|
|
3
3
|
import { R as un, S as ln, u as se, f as ye, g as dn, L as we, O as ft } from "./chunk-DQRVZFIR-BblmKnHy.js";
|
|
4
4
|
import { S as pt, r as mt, Q as hn, n as C, v as Oe, w as Se, x as T, y as fn, z as pn, A as mn, B as gn, D as Ie, E as Te, F as vn, h as Ae, G as De, H as xn, e as gt, I as vt, l as yn, k as E, i as H, J as xt, K as yt, j as F, L as wn, u as _n, d as bn, N as jn, Z as kn, m as zn, C as Zn } from "./hook-CHXroBFt.js";
|
|
5
5
|
import { B as wt, R as $n } from "./RouteGuard-gV7nvzi7.js";
|
|
6
|
-
import { E as _t, S as N, a as Pn, R as Nn } from "./Slot-
|
|
6
|
+
import { E as _t, S as N, a as Pn, R as Nn } from "./Slot-CSEIvwwO.js";
|
|
7
7
|
import { j as s } from "./jsx-runtime-C5mzlN2N.js";
|
|
8
8
|
import { Button as bt } from "./ui/Button.js";
|
|
9
9
|
import { Callout as Cn } from "./ui/Callout.js";
|
|
@@ -14,7 +14,7 @@ import * as Tn from "react-dom";
|
|
|
14
14
|
import { CircleFadingArrowUpIcon as An, LoaderCircleIcon as Dn, ExternalLink as Rn, CircleXIcon as Mn, ChevronRightIcon as Un, SearchIcon as Fn, SunIcon as qn, MoonIcon as Ln, MenuIcon as Qn, PanelLeftIcon as Bn } from "lucide-react";
|
|
15
15
|
import { C as ie } from "./ClientOnly-E7hGysn1.js";
|
|
16
16
|
import { c as $ } from "./cn-wvCW-ho6.js";
|
|
17
|
-
import { A as Hn, d as Kn, s as Wn, N as Me, a as Vn, H as Jn, P as Gn, b as Xn, V as Yn, M as er } from "./Markdown-
|
|
17
|
+
import { A as Hn, d as Kn, s as Wn, N as Me, a as Vn, H as Jn, P as Gn, b as Xn, V as Yn, M as er } from "./Markdown-BQ8YqLsz.js";
|
|
18
18
|
import { S as zt } from "./Spinner-mNLZ6awP.js";
|
|
19
19
|
import { C as tr } from "./CategoryHeading-Cu2RwgjC.js";
|
|
20
20
|
import { isSearchPlugin as nr, isProfileMenuPlugin as rr, isNavigationPlugin as Ue, isAuthenticationPlugin as or, isEventConsumerPlugin as sr, needsInitialization as ir, isApiIdentityPlugin as ar, isMdxProviderPlugin as cr, hasHead as ur } from "./zudoku.plugins.js";
|
|
@@ -4,7 +4,7 @@ import { d as b, m as j } from "./chunk-DQRVZFIR-BblmKnHy.js";
|
|
|
4
4
|
import { u as x, d as v, j as d } from "./hook-CHXroBFt.js";
|
|
5
5
|
import { H as y } from "./index.esm-BFcSKCe-.js";
|
|
6
6
|
import { Link as N } from "./zudoku.components.js";
|
|
7
|
-
import { H as k, M as S } from "./Markdown-
|
|
7
|
+
import { H as k, M as S } from "./Markdown-BQ8YqLsz.js";
|
|
8
8
|
const w = ({
|
|
9
9
|
items: n,
|
|
10
10
|
filterCatalogItems: o = (r) => r,
|