boltdocs 1.3.2 → 1.3.3
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/CodeBlock-QYIKJMEB.mjs +7 -0
- package/dist/PackageManagerTabs-XW3AVXVX.mjs +99 -0
- package/dist/{SearchDialog-5EDRACEG.mjs → SearchDialog-FBNGKRPK.mjs} +2 -1
- package/dist/{SearchDialog-X57WPTNN.css → SearchDialog-O3V36MXA.css} +32 -27
- package/dist/{chunk-NS7WHDYA.mjs → chunk-D7YBQG6H.mjs} +7 -20
- package/dist/chunk-FMTOYQLO.mjs +37 -0
- package/dist/chunk-KS5B3O6W.mjs +43 -0
- package/dist/{PackageManagerTabs-XEKI3L7P.mjs → chunk-S5G55FBI.mjs} +4 -105
- package/dist/client/index.css +32 -27
- package/dist/client/index.js +113 -88
- package/dist/client/index.mjs +73 -31
- package/dist/client/ssr.css +32 -27
- package/dist/client/ssr.js +44 -59
- package/dist/client/ssr.mjs +2 -1
- package/package.json +1 -1
- package/src/client/index.ts +1 -0
- package/src/client/theme/components/CodeBlock/CodeBlock.tsx +11 -36
- package/src/client/theme/components/PackageManagerTabs/PackageManagerTabs.tsx +12 -35
- package/src/client/theme/components/mdx/Tabs.tsx +36 -4
- package/src/client/theme/components/mdx/mdx-components.css +8 -0
- package/src/client/theme/icons/yarn.tsx +16 -0
- package/src/client/theme/styles/markdown.css +26 -29
- package/src/client/utils.ts +23 -0
- package/tsconfig.json +1 -1
- package/dist/CodeBlock-V3Z5EKGR.mjs +0 -6
- package/dist/chunk-2YRDWM6O.mjs +0 -56
package/dist/client/index.js
CHANGED
|
@@ -611,7 +611,7 @@ async function getStarsRepo(repo) {
|
|
|
611
611
|
return "0";
|
|
612
612
|
}
|
|
613
613
|
}
|
|
614
|
-
var formatStars;
|
|
614
|
+
var formatStars, copyToClipboard;
|
|
615
615
|
var init_utils = __esm({
|
|
616
616
|
"src/client/utils.ts"() {
|
|
617
617
|
"use strict";
|
|
@@ -621,6 +621,22 @@ var init_utils = __esm({
|
|
|
621
621
|
compactDisplay: "short"
|
|
622
622
|
}).format(count);
|
|
623
623
|
};
|
|
624
|
+
copyToClipboard = async (text) => {
|
|
625
|
+
try {
|
|
626
|
+
await navigator.clipboard.writeText(text);
|
|
627
|
+
return true;
|
|
628
|
+
} catch {
|
|
629
|
+
const textarea = document.createElement("textarea");
|
|
630
|
+
textarea.value = text;
|
|
631
|
+
textarea.style.position = "fixed";
|
|
632
|
+
textarea.style.opacity = "0";
|
|
633
|
+
document.body.appendChild(textarea);
|
|
634
|
+
textarea.select();
|
|
635
|
+
document.execCommand("copy");
|
|
636
|
+
document.body.removeChild(textarea);
|
|
637
|
+
return true;
|
|
638
|
+
}
|
|
639
|
+
};
|
|
624
640
|
}
|
|
625
641
|
});
|
|
626
642
|
|
|
@@ -1703,37 +1719,20 @@ function CodeBlock({ children, ...props }) {
|
|
|
1703
1719
|
}
|
|
1704
1720
|
const handleCopy = (0, import_react13.useCallback)(async () => {
|
|
1705
1721
|
const code = preRef.current?.textContent || "";
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
setTimeout(() => setCopied(false), 2e3);
|
|
1710
|
-
} catch {
|
|
1711
|
-
const textarea = document.createElement("textarea");
|
|
1712
|
-
textarea.value = code;
|
|
1713
|
-
textarea.style.position = "fixed";
|
|
1714
|
-
textarea.style.opacity = "0";
|
|
1715
|
-
document.body.appendChild(textarea);
|
|
1716
|
-
textarea.select();
|
|
1717
|
-
document.execCommand("copy");
|
|
1718
|
-
document.body.removeChild(textarea);
|
|
1719
|
-
setCopied(true);
|
|
1720
|
-
setTimeout(() => setCopied(false), 2e3);
|
|
1721
|
-
}
|
|
1722
|
+
copyToClipboard(code);
|
|
1723
|
+
setCopied(true);
|
|
1724
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
1722
1725
|
}, []);
|
|
1723
1726
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)("div", { className: "code-block-wrapper", children: [
|
|
1724
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
"
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react12.Check, { size: 20 }) }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_jsx_runtime20.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react12.Copy, { size: 20 }) })
|
|
1734
|
-
}
|
|
1735
|
-
)
|
|
1736
|
-
] }),
|
|
1727
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1728
|
+
"button",
|
|
1729
|
+
{
|
|
1730
|
+
className: `code-block-copy ${copied ? "copied" : ""}`,
|
|
1731
|
+
onClick: handleCopy,
|
|
1732
|
+
"aria-label": "Copy code",
|
|
1733
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react12.Check, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lucide_react12.Copy, { size: 16 })
|
|
1734
|
+
}
|
|
1735
|
+
),
|
|
1737
1736
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)("pre", { ref: preRef, ...props, children })
|
|
1738
1737
|
] });
|
|
1739
1738
|
}
|
|
@@ -1743,6 +1742,7 @@ var init_CodeBlock = __esm({
|
|
|
1743
1742
|
"use strict";
|
|
1744
1743
|
import_react13 = __toESM(require("react"));
|
|
1745
1744
|
import_lucide_react12 = require("lucide-react");
|
|
1745
|
+
init_utils();
|
|
1746
1746
|
import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1747
1747
|
}
|
|
1748
1748
|
});
|
|
@@ -2099,22 +2099,9 @@ function PackageManagerTabs({
|
|
|
2099
2099
|
const [copied, setCopied] = (0, import_react15.useState)(false);
|
|
2100
2100
|
const activeCommand = getCommandForManager(activeTab, command, pkg);
|
|
2101
2101
|
const handleCopy = (0, import_react15.useCallback)(async () => {
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
setTimeout(() => setCopied(false), 2e3);
|
|
2106
|
-
} catch {
|
|
2107
|
-
const textarea = document.createElement("textarea");
|
|
2108
|
-
textarea.value = activeCommand;
|
|
2109
|
-
textarea.style.position = "fixed";
|
|
2110
|
-
textarea.style.opacity = "0";
|
|
2111
|
-
document.body.appendChild(textarea);
|
|
2112
|
-
textarea.select();
|
|
2113
|
-
document.execCommand("copy");
|
|
2114
|
-
document.body.removeChild(textarea);
|
|
2115
|
-
setCopied(true);
|
|
2116
|
-
setTimeout(() => setCopied(false), 2e3);
|
|
2117
|
-
}
|
|
2102
|
+
copyToClipboard(activeCommand);
|
|
2103
|
+
setCopied(true);
|
|
2104
|
+
setTimeout(() => setCopied(false), 2e3);
|
|
2118
2105
|
}, [activeCommand]);
|
|
2119
2106
|
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: `pkg-tabs-wrapper ${className}`, children: [
|
|
2120
2107
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "pkg-tabs-header", children: MANAGERS.map((mgr) => {
|
|
@@ -2136,19 +2123,16 @@ function PackageManagerTabs({
|
|
|
2136
2123
|
);
|
|
2137
2124
|
}) }),
|
|
2138
2125
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "code-block-wrapper pkg-tabs-content", children: [
|
|
2139
|
-
/* @__PURE__ */ (0, import_jsx_runtime26.
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
"
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
}
|
|
2150
|
-
)
|
|
2151
|
-
] }),
|
|
2126
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
2127
|
+
"button",
|
|
2128
|
+
{
|
|
2129
|
+
className: `code-block-copy ${copied ? "copied" : ""}`,
|
|
2130
|
+
onClick: handleCopy,
|
|
2131
|
+
type: "button",
|
|
2132
|
+
"aria-label": "Copy code",
|
|
2133
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react13.Check, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react13.Copy, { size: 14 })
|
|
2134
|
+
}
|
|
2135
|
+
),
|
|
2152
2136
|
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("pre", { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("code", { children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "line", children: activeCommand }) }) })
|
|
2153
2137
|
] })
|
|
2154
2138
|
] });
|
|
@@ -2163,6 +2147,7 @@ var init_PackageManagerTabs = __esm({
|
|
|
2163
2147
|
init_pnpm();
|
|
2164
2148
|
init_bun();
|
|
2165
2149
|
init_deno();
|
|
2150
|
+
init_utils();
|
|
2166
2151
|
import_jsx_runtime26 = require("react/jsx-runtime");
|
|
2167
2152
|
MANAGERS = [
|
|
2168
2153
|
{ id: "npm", label: "npm", icon: NPM },
|
|
@@ -2627,10 +2612,46 @@ function Card({
|
|
|
2627
2612
|
|
|
2628
2613
|
// src/client/theme/components/mdx/Tabs.tsx
|
|
2629
2614
|
var import_react20 = require("react");
|
|
2615
|
+
init_CodeBlock2();
|
|
2616
|
+
init_npm();
|
|
2617
|
+
init_pnpm();
|
|
2618
|
+
init_bun();
|
|
2619
|
+
init_deno();
|
|
2620
|
+
|
|
2621
|
+
// src/client/theme/icons/yarn.tsx
|
|
2630
2622
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2623
|
+
var Yarn = (props) => /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("svg", { ...props, viewBox: "0 0 256 256", children: [
|
|
2624
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2625
|
+
"path",
|
|
2626
|
+
{
|
|
2627
|
+
fill: "#2C8EBB",
|
|
2628
|
+
d: "M128 0C57.307 0 0 57.307 0 128s57.307 128 128 128 128-57.307 128-128S198.693 0 128 0zm0 234.667C69.195 234.667 21.333 186.805 21.333 128S69.195 21.333 128 21.333 234.667 69.195 234.667 128 186.805 234.667 128 234.667z"
|
|
2629
|
+
}
|
|
2630
|
+
),
|
|
2631
|
+
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
2632
|
+
"path",
|
|
2633
|
+
{
|
|
2634
|
+
fill: "#2C8EBB",
|
|
2635
|
+
d: "M173.045 74.053c-4.632-4.632-12.144-4.632-16.776 0L128 102.323l-28.269-28.27c-4.632-4.632-12.144-4.632-16.776 0-4.632 4.632-4.632 12.144 0 16.776L111.224 119.1l-28.269 28.269c-4.632 4.632-4.632 12.144 0 16.776 2.316 2.316 5.352 3.474 8.388 3.474s6.072-1.158 8.388-3.474L128 135.877l28.269 28.268c2.316 2.316 5.352 3.474 8.388 3.474s6.072-1.158 8.388-3.474c4.632-4.632 4.632-12.144 0-16.776L144.776 119.1l28.269-28.271 c4.632-4.632 4.632-12.144 0-16.776z"
|
|
2636
|
+
}
|
|
2637
|
+
)
|
|
2638
|
+
] });
|
|
2639
|
+
|
|
2640
|
+
// src/client/theme/components/mdx/Tabs.tsx
|
|
2641
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2631
2642
|
function Tab({ children }) {
|
|
2632
|
-
|
|
2643
|
+
const content = typeof children === "string" ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CodeBlock, { className: "language-bash", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("code", { children: children.trim() }) }) : children;
|
|
2644
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "ld-tab-panel", children: content });
|
|
2633
2645
|
}
|
|
2646
|
+
var getIconForLabel = (label) => {
|
|
2647
|
+
const l = label.toLowerCase();
|
|
2648
|
+
if (l.includes("npm")) return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(NPM, {});
|
|
2649
|
+
if (l.includes("pnpm")) return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Pnpm, {});
|
|
2650
|
+
if (l.includes("yarn")) return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Yarn, {});
|
|
2651
|
+
if (l.includes("bun")) return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Bun, {});
|
|
2652
|
+
if (l.includes("deno")) return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Deno, {});
|
|
2653
|
+
return null;
|
|
2654
|
+
};
|
|
2634
2655
|
function Tabs({ defaultIndex = 0, children }) {
|
|
2635
2656
|
const [active, setActive] = (0, import_react20.useState)(defaultIndex);
|
|
2636
2657
|
const tabRefs = (0, import_react20.useRef)([]);
|
|
@@ -2649,10 +2670,11 @@ function Tabs({ defaultIndex = 0, children }) {
|
|
|
2649
2670
|
tabRefs.current[newIndex]?.focus();
|
|
2650
2671
|
}
|
|
2651
2672
|
};
|
|
2652
|
-
return /* @__PURE__ */ (0,
|
|
2653
|
-
/* @__PURE__ */ (0,
|
|
2673
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "ld-tabs", children: [
|
|
2674
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "ld-tabs__bar", role: "tablist", onKeyDown: handleKeyDown, children: tabs.map((child, i) => {
|
|
2654
2675
|
const label = child.props.label;
|
|
2655
|
-
|
|
2676
|
+
const Icon = getIconForLabel(label);
|
|
2677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
2656
2678
|
"button",
|
|
2657
2679
|
{
|
|
2658
2680
|
role: "tab",
|
|
@@ -2665,12 +2687,15 @@ function Tabs({ defaultIndex = 0, children }) {
|
|
|
2665
2687
|
},
|
|
2666
2688
|
className: `ld-tabs__trigger ${i === active ? "ld-tabs__trigger--active" : ""}`,
|
|
2667
2689
|
onClick: () => setActive(i),
|
|
2668
|
-
children:
|
|
2690
|
+
children: [
|
|
2691
|
+
Icon,
|
|
2692
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { children: label })
|
|
2693
|
+
]
|
|
2669
2694
|
},
|
|
2670
2695
|
i
|
|
2671
2696
|
);
|
|
2672
2697
|
}) }),
|
|
2673
|
-
/* @__PURE__ */ (0,
|
|
2698
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
2674
2699
|
"div",
|
|
2675
2700
|
{
|
|
2676
2701
|
className: "ld-tabs__content",
|
|
@@ -2685,13 +2710,13 @@ function Tabs({ defaultIndex = 0, children }) {
|
|
|
2685
2710
|
|
|
2686
2711
|
// src/client/theme/components/mdx/Admonition.tsx
|
|
2687
2712
|
var import_lucide_react16 = require("lucide-react");
|
|
2688
|
-
var
|
|
2713
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2689
2714
|
var ICON_MAP2 = {
|
|
2690
|
-
note: /* @__PURE__ */ (0,
|
|
2691
|
-
tip: /* @__PURE__ */ (0,
|
|
2692
|
-
info: /* @__PURE__ */ (0,
|
|
2693
|
-
warning: /* @__PURE__ */ (0,
|
|
2694
|
-
danger: /* @__PURE__ */ (0,
|
|
2715
|
+
note: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react16.Bookmark, { size: 18 }),
|
|
2716
|
+
tip: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react16.Lightbulb, { size: 18 }),
|
|
2717
|
+
info: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react16.Info, { size: 18 }),
|
|
2718
|
+
warning: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react16.AlertTriangle, { size: 18 }),
|
|
2719
|
+
danger: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react16.ShieldAlert, { size: 18 })
|
|
2695
2720
|
};
|
|
2696
2721
|
var LABEL_MAP = {
|
|
2697
2722
|
note: "Note",
|
|
@@ -2707,35 +2732,35 @@ function Admonition({
|
|
|
2707
2732
|
className = "",
|
|
2708
2733
|
...rest
|
|
2709
2734
|
}) {
|
|
2710
|
-
return /* @__PURE__ */ (0,
|
|
2735
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
2711
2736
|
"div",
|
|
2712
2737
|
{
|
|
2713
2738
|
className: `ld-admonition ld-admonition--${type} ${className}`.trim(),
|
|
2714
2739
|
role: type === "warning" || type === "danger" ? "alert" : "note",
|
|
2715
2740
|
...rest,
|
|
2716
2741
|
children: [
|
|
2717
|
-
/* @__PURE__ */ (0,
|
|
2718
|
-
/* @__PURE__ */ (0,
|
|
2719
|
-
/* @__PURE__ */ (0,
|
|
2742
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)("div", { className: "ld-admonition__header", children: [
|
|
2743
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "ld-admonition__icon", children: ICON_MAP2[type] }),
|
|
2744
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { className: "ld-admonition__title", children: title || LABEL_MAP[type] })
|
|
2720
2745
|
] }),
|
|
2721
|
-
/* @__PURE__ */ (0,
|
|
2746
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: "ld-admonition__body", children })
|
|
2722
2747
|
]
|
|
2723
2748
|
}
|
|
2724
2749
|
);
|
|
2725
2750
|
}
|
|
2726
|
-
var Note = (props) => /* @__PURE__ */ (0,
|
|
2727
|
-
var Tip = (props) => /* @__PURE__ */ (0,
|
|
2728
|
-
var Warning = (props) => /* @__PURE__ */ (0,
|
|
2729
|
-
var Danger = (props) => /* @__PURE__ */ (0,
|
|
2730
|
-
var InfoBox = (props) => /* @__PURE__ */ (0,
|
|
2751
|
+
var Note = (props) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Admonition, { type: "note", ...props });
|
|
2752
|
+
var Tip = (props) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Admonition, { type: "tip", ...props });
|
|
2753
|
+
var Warning = (props) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Admonition, { type: "warning", ...props });
|
|
2754
|
+
var Danger = (props) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Admonition, { type: "danger", ...props });
|
|
2755
|
+
var InfoBox = (props) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Admonition, { type: "info", ...props });
|
|
2731
2756
|
|
|
2732
2757
|
// src/client/theme/components/mdx/List.tsx
|
|
2733
2758
|
var import_react21 = __toESM(require("react"));
|
|
2734
2759
|
var import_lucide_react17 = require("lucide-react");
|
|
2735
|
-
var
|
|
2760
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2736
2761
|
var ICON_MAP3 = {
|
|
2737
|
-
checked: /* @__PURE__ */ (0,
|
|
2738
|
-
arrow: /* @__PURE__ */ (0,
|
|
2762
|
+
checked: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react17.Check, { size: 14, className: "ld-list__icon" }),
|
|
2763
|
+
arrow: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_lucide_react17.ChevronRight, { size: 14, className: "ld-list__icon" })
|
|
2739
2764
|
};
|
|
2740
2765
|
function List({
|
|
2741
2766
|
variant = "default",
|
|
@@ -2744,14 +2769,14 @@ function List({
|
|
|
2744
2769
|
...rest
|
|
2745
2770
|
}) {
|
|
2746
2771
|
if (variant === "default") {
|
|
2747
|
-
return /* @__PURE__ */ (0,
|
|
2772
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("ul", { className: `ld-list ${className}`.trim(), ...rest, children });
|
|
2748
2773
|
}
|
|
2749
2774
|
const icon = ICON_MAP3[variant];
|
|
2750
|
-
return /* @__PURE__ */ (0,
|
|
2775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("ul", { className: `ld-list ld-list--${variant} ${className}`.trim(), ...rest, children: import_react21.Children.map(children, (child) => {
|
|
2751
2776
|
if (!import_react21.default.isValidElement(child)) return child;
|
|
2752
|
-
return /* @__PURE__ */ (0,
|
|
2777
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("li", { className: "ld-list__item", children: [
|
|
2753
2778
|
icon,
|
|
2754
|
-
/* @__PURE__ */ (0,
|
|
2779
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "ld-list__text", children: child.props.children })
|
|
2755
2780
|
] });
|
|
2756
2781
|
}) });
|
|
2757
2782
|
}
|
package/dist/client/index.mjs
CHANGED
|
@@ -9,13 +9,20 @@ import {
|
|
|
9
9
|
Sidebar,
|
|
10
10
|
ThemeLayout,
|
|
11
11
|
createBoltdocsApp
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-D7YBQG6H.mjs";
|
|
13
13
|
import {
|
|
14
14
|
CodeBlock
|
|
15
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-KS5B3O6W.mjs";
|
|
16
16
|
import {
|
|
17
17
|
Video
|
|
18
18
|
} from "../chunk-Z7JHYNAS.mjs";
|
|
19
|
+
import {
|
|
20
|
+
Bun,
|
|
21
|
+
Deno,
|
|
22
|
+
NPM,
|
|
23
|
+
Pnpm
|
|
24
|
+
} from "../chunk-S5G55FBI.mjs";
|
|
25
|
+
import "../chunk-FMTOYQLO.mjs";
|
|
19
26
|
|
|
20
27
|
// src/client/theme/components/Playground/Playground.tsx
|
|
21
28
|
import React, { useState } from "react";
|
|
@@ -186,10 +193,41 @@ function Card({
|
|
|
186
193
|
|
|
187
194
|
// src/client/theme/components/mdx/Tabs.tsx
|
|
188
195
|
import { useState as useState2, Children, isValidElement, useRef } from "react";
|
|
196
|
+
|
|
197
|
+
// src/client/theme/icons/yarn.tsx
|
|
189
198
|
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
199
|
+
var Yarn = (props) => /* @__PURE__ */ jsxs3("svg", { ...props, viewBox: "0 0 256 256", children: [
|
|
200
|
+
/* @__PURE__ */ jsx5(
|
|
201
|
+
"path",
|
|
202
|
+
{
|
|
203
|
+
fill: "#2C8EBB",
|
|
204
|
+
d: "M128 0C57.307 0 0 57.307 0 128s57.307 128 128 128 128-57.307 128-128S198.693 0 128 0zm0 234.667C69.195 234.667 21.333 186.805 21.333 128S69.195 21.333 128 21.333 234.667 69.195 234.667 128 186.805 234.667 128 234.667z"
|
|
205
|
+
}
|
|
206
|
+
),
|
|
207
|
+
/* @__PURE__ */ jsx5(
|
|
208
|
+
"path",
|
|
209
|
+
{
|
|
210
|
+
fill: "#2C8EBB",
|
|
211
|
+
d: "M173.045 74.053c-4.632-4.632-12.144-4.632-16.776 0L128 102.323l-28.269-28.27c-4.632-4.632-12.144-4.632-16.776 0-4.632 4.632-4.632 12.144 0 16.776L111.224 119.1l-28.269 28.269c-4.632 4.632-4.632 12.144 0 16.776 2.316 2.316 5.352 3.474 8.388 3.474s6.072-1.158 8.388-3.474L128 135.877l28.269 28.268c2.316 2.316 5.352 3.474 8.388 3.474s6.072-1.158 8.388-3.474c4.632-4.632 4.632-12.144 0-16.776L144.776 119.1l28.269-28.271 c4.632-4.632 4.632-12.144 0-16.776z"
|
|
212
|
+
}
|
|
213
|
+
)
|
|
214
|
+
] });
|
|
215
|
+
|
|
216
|
+
// src/client/theme/components/mdx/Tabs.tsx
|
|
217
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
190
218
|
function Tab({ children }) {
|
|
191
|
-
|
|
219
|
+
const content = typeof children === "string" ? /* @__PURE__ */ jsx6(CodeBlock, { className: "language-bash", children: /* @__PURE__ */ jsx6("code", { children: children.trim() }) }) : children;
|
|
220
|
+
return /* @__PURE__ */ jsx6("div", { className: "ld-tab-panel", children: content });
|
|
192
221
|
}
|
|
222
|
+
var getIconForLabel = (label) => {
|
|
223
|
+
const l = label.toLowerCase();
|
|
224
|
+
if (l.includes("npm")) return /* @__PURE__ */ jsx6(NPM, {});
|
|
225
|
+
if (l.includes("pnpm")) return /* @__PURE__ */ jsx6(Pnpm, {});
|
|
226
|
+
if (l.includes("yarn")) return /* @__PURE__ */ jsx6(Yarn, {});
|
|
227
|
+
if (l.includes("bun")) return /* @__PURE__ */ jsx6(Bun, {});
|
|
228
|
+
if (l.includes("deno")) return /* @__PURE__ */ jsx6(Deno, {});
|
|
229
|
+
return null;
|
|
230
|
+
};
|
|
193
231
|
function Tabs({ defaultIndex = 0, children }) {
|
|
194
232
|
const [active, setActive] = useState2(defaultIndex);
|
|
195
233
|
const tabRefs = useRef([]);
|
|
@@ -208,10 +246,11 @@ function Tabs({ defaultIndex = 0, children }) {
|
|
|
208
246
|
tabRefs.current[newIndex]?.focus();
|
|
209
247
|
}
|
|
210
248
|
};
|
|
211
|
-
return /* @__PURE__ */
|
|
212
|
-
/* @__PURE__ */
|
|
249
|
+
return /* @__PURE__ */ jsxs4("div", { className: "ld-tabs", children: [
|
|
250
|
+
/* @__PURE__ */ jsx6("div", { className: "ld-tabs__bar", role: "tablist", onKeyDown: handleKeyDown, children: tabs.map((child, i) => {
|
|
213
251
|
const label = child.props.label;
|
|
214
|
-
|
|
252
|
+
const Icon = getIconForLabel(label);
|
|
253
|
+
return /* @__PURE__ */ jsxs4(
|
|
215
254
|
"button",
|
|
216
255
|
{
|
|
217
256
|
role: "tab",
|
|
@@ -224,12 +263,15 @@ function Tabs({ defaultIndex = 0, children }) {
|
|
|
224
263
|
},
|
|
225
264
|
className: `ld-tabs__trigger ${i === active ? "ld-tabs__trigger--active" : ""}`,
|
|
226
265
|
onClick: () => setActive(i),
|
|
227
|
-
children:
|
|
266
|
+
children: [
|
|
267
|
+
Icon,
|
|
268
|
+
/* @__PURE__ */ jsx6("span", { children: label })
|
|
269
|
+
]
|
|
228
270
|
},
|
|
229
271
|
i
|
|
230
272
|
);
|
|
231
273
|
}) }),
|
|
232
|
-
/* @__PURE__ */
|
|
274
|
+
/* @__PURE__ */ jsx6(
|
|
233
275
|
"div",
|
|
234
276
|
{
|
|
235
277
|
className: "ld-tabs__content",
|
|
@@ -250,13 +292,13 @@ import {
|
|
|
250
292
|
ShieldAlert,
|
|
251
293
|
Bookmark
|
|
252
294
|
} from "lucide-react";
|
|
253
|
-
import { jsx as
|
|
295
|
+
import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
254
296
|
var ICON_MAP = {
|
|
255
|
-
note: /* @__PURE__ */
|
|
256
|
-
tip: /* @__PURE__ */
|
|
257
|
-
info: /* @__PURE__ */
|
|
258
|
-
warning: /* @__PURE__ */
|
|
259
|
-
danger: /* @__PURE__ */
|
|
297
|
+
note: /* @__PURE__ */ jsx7(Bookmark, { size: 18 }),
|
|
298
|
+
tip: /* @__PURE__ */ jsx7(Lightbulb, { size: 18 }),
|
|
299
|
+
info: /* @__PURE__ */ jsx7(Info, { size: 18 }),
|
|
300
|
+
warning: /* @__PURE__ */ jsx7(AlertTriangle, { size: 18 }),
|
|
301
|
+
danger: /* @__PURE__ */ jsx7(ShieldAlert, { size: 18 })
|
|
260
302
|
};
|
|
261
303
|
var LABEL_MAP = {
|
|
262
304
|
note: "Note",
|
|
@@ -272,35 +314,35 @@ function Admonition({
|
|
|
272
314
|
className = "",
|
|
273
315
|
...rest
|
|
274
316
|
}) {
|
|
275
|
-
return /* @__PURE__ */
|
|
317
|
+
return /* @__PURE__ */ jsxs5(
|
|
276
318
|
"div",
|
|
277
319
|
{
|
|
278
320
|
className: `ld-admonition ld-admonition--${type} ${className}`.trim(),
|
|
279
321
|
role: type === "warning" || type === "danger" ? "alert" : "note",
|
|
280
322
|
...rest,
|
|
281
323
|
children: [
|
|
282
|
-
/* @__PURE__ */
|
|
283
|
-
/* @__PURE__ */
|
|
284
|
-
/* @__PURE__ */
|
|
324
|
+
/* @__PURE__ */ jsxs5("div", { className: "ld-admonition__header", children: [
|
|
325
|
+
/* @__PURE__ */ jsx7("span", { className: "ld-admonition__icon", children: ICON_MAP[type] }),
|
|
326
|
+
/* @__PURE__ */ jsx7("span", { className: "ld-admonition__title", children: title || LABEL_MAP[type] })
|
|
285
327
|
] }),
|
|
286
|
-
/* @__PURE__ */
|
|
328
|
+
/* @__PURE__ */ jsx7("div", { className: "ld-admonition__body", children })
|
|
287
329
|
]
|
|
288
330
|
}
|
|
289
331
|
);
|
|
290
332
|
}
|
|
291
|
-
var Note = (props) => /* @__PURE__ */
|
|
292
|
-
var Tip = (props) => /* @__PURE__ */
|
|
293
|
-
var Warning = (props) => /* @__PURE__ */
|
|
294
|
-
var Danger = (props) => /* @__PURE__ */
|
|
295
|
-
var InfoBox = (props) => /* @__PURE__ */
|
|
333
|
+
var Note = (props) => /* @__PURE__ */ jsx7(Admonition, { type: "note", ...props });
|
|
334
|
+
var Tip = (props) => /* @__PURE__ */ jsx7(Admonition, { type: "tip", ...props });
|
|
335
|
+
var Warning = (props) => /* @__PURE__ */ jsx7(Admonition, { type: "warning", ...props });
|
|
336
|
+
var Danger = (props) => /* @__PURE__ */ jsx7(Admonition, { type: "danger", ...props });
|
|
337
|
+
var InfoBox = (props) => /* @__PURE__ */ jsx7(Admonition, { type: "info", ...props });
|
|
296
338
|
|
|
297
339
|
// src/client/theme/components/mdx/List.tsx
|
|
298
340
|
import React3, { Children as Children2 } from "react";
|
|
299
341
|
import { Check as Check2, ChevronRight } from "lucide-react";
|
|
300
|
-
import { jsx as
|
|
342
|
+
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
301
343
|
var ICON_MAP2 = {
|
|
302
|
-
checked: /* @__PURE__ */
|
|
303
|
-
arrow: /* @__PURE__ */
|
|
344
|
+
checked: /* @__PURE__ */ jsx8(Check2, { size: 14, className: "ld-list__icon" }),
|
|
345
|
+
arrow: /* @__PURE__ */ jsx8(ChevronRight, { size: 14, className: "ld-list__icon" })
|
|
304
346
|
};
|
|
305
347
|
function List({
|
|
306
348
|
variant = "default",
|
|
@@ -309,14 +351,14 @@ function List({
|
|
|
309
351
|
...rest
|
|
310
352
|
}) {
|
|
311
353
|
if (variant === "default") {
|
|
312
|
-
return /* @__PURE__ */
|
|
354
|
+
return /* @__PURE__ */ jsx8("ul", { className: `ld-list ${className}`.trim(), ...rest, children });
|
|
313
355
|
}
|
|
314
356
|
const icon = ICON_MAP2[variant];
|
|
315
|
-
return /* @__PURE__ */
|
|
357
|
+
return /* @__PURE__ */ jsx8("ul", { className: `ld-list ld-list--${variant} ${className}`.trim(), ...rest, children: Children2.map(children, (child) => {
|
|
316
358
|
if (!React3.isValidElement(child)) return child;
|
|
317
|
-
return /* @__PURE__ */
|
|
359
|
+
return /* @__PURE__ */ jsxs6("li", { className: "ld-list__item", children: [
|
|
318
360
|
icon,
|
|
319
|
-
/* @__PURE__ */
|
|
361
|
+
/* @__PURE__ */ jsx8("span", { className: "ld-list__text", children: child.props.children })
|
|
320
362
|
] });
|
|
321
363
|
}) });
|
|
322
364
|
}
|
package/dist/client/ssr.css
CHANGED
|
@@ -1061,49 +1061,47 @@ a {
|
|
|
1061
1061
|
overflow: hidden;
|
|
1062
1062
|
border: 1px solid var(--ld-border-subtle);
|
|
1063
1063
|
background-color: var(--ld-code-bg);
|
|
1064
|
-
|
|
1065
|
-
.code-block-header {
|
|
1066
|
-
display: flex;
|
|
1067
|
-
align-items: center;
|
|
1068
|
-
justify-content: space-between;
|
|
1069
|
-
padding: 0.5rem 1.25rem;
|
|
1070
|
-
background-color: var(--ld-code-header);
|
|
1071
|
-
border-bottom: 1px solid var(--ld-border-subtle);
|
|
1072
|
-
font-size: 0.75rem;
|
|
1073
|
-
}
|
|
1074
|
-
.code-block-lang {
|
|
1075
|
-
color: var(--ld-text-dim);
|
|
1076
|
-
font-family: var(--ld-font-mono);
|
|
1077
|
-
font-weight: 500;
|
|
1078
|
-
text-transform: uppercase;
|
|
1079
|
-
letter-spacing: 0.05em;
|
|
1064
|
+
position: relative;
|
|
1080
1065
|
}
|
|
1081
1066
|
.code-block-copy {
|
|
1082
1067
|
display: flex;
|
|
1083
1068
|
align-items: center;
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1069
|
+
justify-content: center;
|
|
1070
|
+
position: absolute;
|
|
1071
|
+
top: 0.75rem;
|
|
1072
|
+
right: 0.75rem;
|
|
1073
|
+
z-index: 50;
|
|
1074
|
+
padding: 0.4rem;
|
|
1075
|
+
background-color: rgba(20, 20, 30, 0.8);
|
|
1076
|
+
backdrop-filter: blur(8px);
|
|
1077
|
+
-webkit-backdrop-filter: blur(8px);
|
|
1087
1078
|
border: 1px solid var(--ld-border-subtle);
|
|
1088
|
-
border-radius:
|
|
1079
|
+
border-radius: 6px;
|
|
1089
1080
|
color: var(--ld-text-dim);
|
|
1090
|
-
font-family: var(--ld-font-sans);
|
|
1091
|
-
font-size: 0.6875rem;
|
|
1092
1081
|
cursor: pointer;
|
|
1093
|
-
transition: all 0.2s;
|
|
1082
|
+
transition: all 0.2s ease;
|
|
1083
|
+
opacity: 0;
|
|
1084
|
+
visibility: hidden;
|
|
1085
|
+
pointer-events: none;
|
|
1086
|
+
}
|
|
1087
|
+
.code-block-wrapper:hover .code-block-copy {
|
|
1088
|
+
opacity: 1;
|
|
1089
|
+
visibility: visible;
|
|
1090
|
+
pointer-events: auto;
|
|
1094
1091
|
}
|
|
1095
1092
|
.code-block-copy:hover {
|
|
1096
1093
|
color: var(--ld-text-main);
|
|
1097
1094
|
border-color: var(--ld-border-strong);
|
|
1098
|
-
background-color: rgba(255, 255, 255, 0.
|
|
1095
|
+
background-color: rgba(255, 255, 255, 0.08);
|
|
1099
1096
|
}
|
|
1100
1097
|
.code-block-copy.copied {
|
|
1101
1098
|
color: #22c55e;
|
|
1102
|
-
border-color: rgba(34, 197, 94, 0.
|
|
1099
|
+
border-color: rgba(34, 197, 94, 0.4);
|
|
1100
|
+
opacity: 1;
|
|
1103
1101
|
}
|
|
1104
1102
|
.code-block-copy svg {
|
|
1105
|
-
width:
|
|
1106
|
-
height:
|
|
1103
|
+
width: 16px;
|
|
1104
|
+
height: 16px;
|
|
1107
1105
|
}
|
|
1108
1106
|
.code-block-wrapper pre {
|
|
1109
1107
|
margin: 0 !important;
|
|
@@ -1446,6 +1444,9 @@ a {
|
|
|
1446
1444
|
}
|
|
1447
1445
|
.ld-tabs__trigger {
|
|
1448
1446
|
position: relative;
|
|
1447
|
+
display: flex;
|
|
1448
|
+
align-items: center;
|
|
1449
|
+
gap: 0.5rem;
|
|
1449
1450
|
padding: 0.65rem 1.25rem;
|
|
1450
1451
|
background: none;
|
|
1451
1452
|
border: none;
|
|
@@ -1458,6 +1459,10 @@ a {
|
|
|
1458
1459
|
transition: all 0.2s ease;
|
|
1459
1460
|
white-space: nowrap;
|
|
1460
1461
|
}
|
|
1462
|
+
.ld-tabs__trigger svg {
|
|
1463
|
+
width: 1rem;
|
|
1464
|
+
height: 1rem;
|
|
1465
|
+
}
|
|
1461
1466
|
.ld-tabs__trigger:hover {
|
|
1462
1467
|
color: var(--ld-text-main);
|
|
1463
1468
|
background-color: rgba(255, 255, 255, 0.03);
|