boltdocs 1.0.4 → 1.3.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 (41) hide show
  1. package/dist/{SearchDialog-R36WKAQ7.mjs → SearchDialog-5EDRACEG.mjs} +1 -1
  2. package/dist/{SearchDialog-PYF3QMYG.css → SearchDialog-X57WPTNN.css} +54 -126
  3. package/dist/cache-EHR7SXRU.mjs +12 -0
  4. package/dist/chunk-GSYECEZY.mjs +381 -0
  5. package/dist/{chunk-TWSRXUFF.mjs → chunk-NS7WHDYA.mjs} +229 -418
  6. package/dist/client/index.css +54 -126
  7. package/dist/client/index.d.mts +5 -4
  8. package/dist/client/index.d.ts +5 -4
  9. package/dist/client/index.js +555 -580
  10. package/dist/client/index.mjs +304 -16
  11. package/dist/client/ssr.css +54 -126
  12. package/dist/client/ssr.js +257 -580
  13. package/dist/client/ssr.mjs +1 -1
  14. package/dist/{config-D2XmHJYe.d.mts → config-BD5ZHz15.d.mts} +7 -0
  15. package/dist/{config-D2XmHJYe.d.ts → config-BD5ZHz15.d.ts} +7 -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 +457 -118
  19. package/dist/node/index.mjs +93 -136
  20. package/package.json +2 -2
  21. package/src/client/app/index.tsx +25 -54
  22. package/src/client/theme/components/mdx/mdx-components.css +39 -20
  23. package/src/client/theme/styles/markdown.css +1 -1
  24. package/src/client/theme/styles.css +0 -1
  25. package/src/client/theme/ui/Layout/Layout.tsx +2 -13
  26. package/src/client/theme/ui/Layout/responsive.css +0 -4
  27. package/src/client/theme/ui/Link/Link.tsx +52 -0
  28. package/src/client/theme/ui/NotFound/NotFound.tsx +0 -1
  29. package/src/client/theme/ui/OnThisPage/OnThisPage.tsx +45 -2
  30. package/src/client/theme/ui/Sidebar/Sidebar.tsx +44 -40
  31. package/src/client/theme/ui/Sidebar/sidebar.css +25 -58
  32. package/src/node/cache.ts +360 -46
  33. package/src/node/config.ts +7 -0
  34. package/src/node/mdx.ts +83 -4
  35. package/src/node/plugin/index.ts +3 -0
  36. package/src/node/routes/cache.ts +5 -1
  37. package/src/node/routes/index.ts +17 -2
  38. package/src/node/ssg/index.ts +4 -0
  39. package/dist/Playground-B2FA34BC.mjs +0 -6
  40. package/dist/chunk-WPT4MWTQ.mjs +0 -89
  41. package/src/client/theme/styles/home.css +0 -60
@@ -1,89 +0,0 @@
1
- // src/client/theme/components/Playground/Playground.tsx
2
- import React, { useState } from "react";
3
- import { LiveProvider, LiveEditor, LiveError, LivePreview } from "react-live";
4
- import { Copy, Check, Terminal, Play } from "lucide-react";
5
- import { jsx, jsxs } from "react/jsx-runtime";
6
- function prepareCode(raw) {
7
- const trimmed = raw.trim();
8
- const fnMatch = trimmed.match(/export\s+default\s+function\s+(\w+)/);
9
- if (fnMatch) {
10
- const name = fnMatch[1];
11
- const code = trimmed.replace(/export\s+default\s+/, "") + `
12
-
13
- render(<${name} />);`;
14
- return { code, noInline: true };
15
- }
16
- const varMatch = trimmed.match(/export\s+default\s+(\w+)\s*;?\s*$/);
17
- if (varMatch) {
18
- const name = varMatch[1];
19
- const code = trimmed.replace(/export\s+default\s+\w+\s*;?\s*$/, "") + `
20
- render(<${name} />);`;
21
- return { code, noInline: true };
22
- }
23
- return { code: trimmed, noInline: false };
24
- }
25
- function Playground({
26
- code,
27
- children,
28
- scope = {},
29
- readonly = false,
30
- noInline: forceNoInline
31
- }) {
32
- let initialCode = code || "";
33
- if (!initialCode && typeof children === "string") {
34
- initialCode = children;
35
- }
36
- const prepared = prepareCode(initialCode);
37
- const useNoInline = forceNoInline ?? prepared.noInline;
38
- const [copied, setCopied] = useState(false);
39
- const [activeCode, setActiveCode] = useState(prepared.code);
40
- const handleCopy = () => {
41
- navigator.clipboard.writeText(activeCode);
42
- setCopied(true);
43
- setTimeout(() => setCopied(false), 2e3);
44
- };
45
- const extendedScope = { React, ...scope };
46
- return /* @__PURE__ */ jsx("div", { className: "boltdocs-playground", "data-readonly": readonly, children: /* @__PURE__ */ jsx(
47
- LiveProvider,
48
- {
49
- code: activeCode,
50
- scope: extendedScope,
51
- theme: void 0,
52
- noInline: useNoInline,
53
- children: /* @__PURE__ */ jsxs("div", { className: "playground-split-container", children: [
54
- /* @__PURE__ */ jsxs("div", { className: "playground-panel playground-editor-panel", children: [
55
- /* @__PURE__ */ jsxs("div", { className: "playground-panel-header", children: [
56
- /* @__PURE__ */ jsxs("div", { className: "playground-panel-title", children: [
57
- /* @__PURE__ */ jsx(Terminal, { size: 14 }),
58
- /* @__PURE__ */ jsx("span", { children: readonly ? "Code Example" : "Live Editor" })
59
- ] }),
60
- /* @__PURE__ */ jsx(
61
- "button",
62
- {
63
- className: "playground-copy-btn",
64
- onClick: handleCopy,
65
- title: "Copy code",
66
- children: copied ? /* @__PURE__ */ jsx(Check, { size: 14 }) : /* @__PURE__ */ jsx(Copy, { size: 14 })
67
- }
68
- )
69
- ] }),
70
- /* @__PURE__ */ jsx("div", { className: "playground-panel-content playground-editor", children: /* @__PURE__ */ jsx(LiveEditor, { disabled: readonly, onChange: setActiveCode }) })
71
- ] }),
72
- /* @__PURE__ */ jsxs("div", { className: "playground-panel playground-preview-panel", children: [
73
- /* @__PURE__ */ jsx("div", { className: "playground-panel-header", children: /* @__PURE__ */ jsxs("div", { className: "playground-panel-title", children: [
74
- /* @__PURE__ */ jsx(Play, { size: 14 }),
75
- /* @__PURE__ */ jsx("span", { children: "Preview" })
76
- ] }) }),
77
- /* @__PURE__ */ jsxs("div", { className: "playground-panel-content playground-preview", children: [
78
- /* @__PURE__ */ jsx(LivePreview, {}),
79
- /* @__PURE__ */ jsx(LiveError, { className: "playground-error" })
80
- ] })
81
- ] })
82
- ] })
83
- }
84
- ) });
85
- }
86
-
87
- export {
88
- Playground
89
- };
@@ -1,60 +0,0 @@
1
- /* ═══════════════════════════════════════════════════════════
2
- HOME / LANDING PAGE — Layout only
3
- Component styles (badge, buttons, cards) now live in
4
- mdx-components.css and use the shared UI components.
5
- ═══════════════════════════════════════════════════════════ */
6
- .boltdocs-home {
7
- min-height: calc(100vh - var(--ld-navbar-height));
8
- }
9
-
10
- .home-hero {
11
- display: flex;
12
- align-items: center;
13
- justify-content: center;
14
- padding: 6rem 2rem 4rem;
15
- text-align: center;
16
- }
17
-
18
- .hero-content {
19
- max-width: 680px;
20
- }
21
-
22
- .hero-title {
23
- font-size: 3.5rem;
24
- font-weight: 900;
25
- line-height: 1.1;
26
- margin: 0 0 1.25rem;
27
- letter-spacing: -0.03em;
28
- color: var(--ld-text-main);
29
- }
30
-
31
- .hero-highlight {
32
- background: linear-gradient(
33
- 135deg,
34
- var(--ld-gradient-from),
35
- var(--ld-gradient-to)
36
- );
37
- -webkit-background-clip: text;
38
- -webkit-text-fill-color: transparent;
39
- background-clip: text;
40
- }
41
-
42
- .hero-description {
43
- font-size: 1.125rem;
44
- color: var(--ld-text-muted);
45
- line-height: 1.7;
46
- margin-bottom: 2rem;
47
- }
48
-
49
- .hero-actions {
50
- display: flex;
51
- gap: 0.75rem;
52
- justify-content: center;
53
- flex-wrap: wrap;
54
- }
55
-
56
- .home-features {
57
- padding: 2rem 2rem 6rem;
58
- max-width: 1000px;
59
- margin: 0 auto;
60
- }