boltdocs 1.4.1 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/{SearchDialog-FBNGKRPK.mjs → SearchDialog-5ISK64QY.mjs} +1 -1
  2. package/dist/{SearchDialog-O3V36MXA.css → SearchDialog-CEVPEMT3.css} +54 -5
  3. package/dist/{chunk-D7YBQG6H.mjs → chunk-FMQ4HRKZ.mjs} +311 -133
  4. package/dist/client/index.css +54 -5
  5. package/dist/client/index.d.mts +3 -3
  6. package/dist/client/index.d.ts +3 -3
  7. package/dist/client/index.js +624 -475
  8. package/dist/client/index.mjs +2 -4
  9. package/dist/client/ssr.css +54 -5
  10. package/dist/client/ssr.d.mts +1 -1
  11. package/dist/client/ssr.d.ts +1 -1
  12. package/dist/client/ssr.js +544 -395
  13. package/dist/client/ssr.mjs +1 -1
  14. package/dist/{config-BD5ZHz15.d.mts → config-DkZg5aCf.d.mts} +2 -0
  15. package/dist/{config-BD5ZHz15.d.ts → config-DkZg5aCf.d.ts} +2 -0
  16. package/dist/node/index.d.mts +2 -2
  17. package/dist/node/index.d.ts +2 -2
  18. package/dist/node/index.js +5 -1
  19. package/dist/node/index.mjs +5 -1
  20. package/dist/{types-CvrzTbEX.d.mts → types-DGIo1VKD.d.mts} +2 -0
  21. package/dist/{types-CvrzTbEX.d.ts → types-DGIo1VKD.d.ts} +2 -0
  22. package/package.json +1 -1
  23. package/src/client/app/index.tsx +2 -12
  24. package/src/client/app/preload.tsx +3 -1
  25. package/src/client/theme/components/CodeBlock/CodeBlock.tsx +0 -11
  26. package/src/client/theme/styles/markdown.css +1 -5
  27. package/src/client/theme/ui/Link/Link.tsx +156 -18
  28. package/src/client/theme/ui/Link/LinkPreview.tsx +64 -0
  29. package/src/client/theme/ui/Link/link-preview.css +64 -0
  30. package/src/client/types.ts +2 -0
  31. package/src/node/config.ts +2 -0
  32. package/src/node/routes/parser.ts +14 -1
  33. package/dist/CodeBlock-QYIKJMEB.mjs +0 -7
  34. package/dist/chunk-KS5B3O6W.mjs +0 -43
@@ -1,43 +0,0 @@
1
- import {
2
- copyToClipboard
3
- } from "./chunk-FMTOYQLO.mjs";
4
-
5
- // src/client/theme/components/CodeBlock/CodeBlock.tsx
6
- import React, { useState, useRef, useCallback } from "react";
7
- import { Copy, Check } from "lucide-react";
8
- import { jsx, jsxs } from "react/jsx-runtime";
9
- function CodeBlock({ children, ...props }) {
10
- const [copied, setCopied] = useState(false);
11
- const preRef = useRef(null);
12
- let language = "";
13
- if (React.isValidElement(children)) {
14
- const childProps = children.props;
15
- language = childProps?.["data-language"] || "";
16
- if (!language && childProps?.className) {
17
- const match = childProps.className.match(/language-(\w+)/);
18
- if (match) language = match[1];
19
- }
20
- }
21
- const handleCopy = useCallback(async () => {
22
- const code = preRef.current?.textContent || "";
23
- copyToClipboard(code);
24
- setCopied(true);
25
- setTimeout(() => setCopied(false), 2e3);
26
- }, []);
27
- return /* @__PURE__ */ jsxs("div", { className: "code-block-wrapper", children: [
28
- /* @__PURE__ */ jsx(
29
- "button",
30
- {
31
- className: `code-block-copy ${copied ? "copied" : ""}`,
32
- onClick: handleCopy,
33
- "aria-label": "Copy code",
34
- children: copied ? /* @__PURE__ */ jsx(Check, { size: 16 }) : /* @__PURE__ */ jsx(Copy, { size: 16 })
35
- }
36
- ),
37
- /* @__PURE__ */ jsx("pre", { ref: preRef, ...props, children })
38
- ] });
39
- }
40
-
41
- export {
42
- CodeBlock
43
- };