boltdocs 1.10.2 → 1.11.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 (225) hide show
  1. package/package.json +29 -7
  2. package/src/client/app/config-context.tsx +18 -0
  3. package/src/client/app/docs-layout.tsx +14 -0
  4. package/src/client/app/index.tsx +132 -260
  5. package/src/client/app/mdx-component.tsx +52 -0
  6. package/src/client/app/mdx-components-context.tsx +23 -0
  7. package/src/client/app/mdx-page.tsx +20 -0
  8. package/src/client/app/preload.tsx +38 -30
  9. package/src/client/app/router.tsx +30 -0
  10. package/src/client/app/scroll-handler.tsx +40 -0
  11. package/src/client/app/theme-context.tsx +75 -0
  12. package/src/client/components/default-layout.tsx +80 -0
  13. package/src/client/components/docs-layout.tsx +105 -0
  14. package/src/client/components/icons-dev.tsx +74 -0
  15. package/src/client/components/mdx/admonition.tsx +107 -0
  16. package/src/client/components/mdx/badge.tsx +41 -0
  17. package/src/client/components/mdx/button.tsx +35 -0
  18. package/src/client/components/mdx/card.tsx +124 -0
  19. package/src/client/components/mdx/code-block.tsx +119 -0
  20. package/src/client/components/mdx/component-preview.tsx +47 -0
  21. package/src/client/components/mdx/component-props.tsx +83 -0
  22. package/src/client/components/mdx/field.tsx +66 -0
  23. package/src/client/components/mdx/file-tree.tsx +287 -0
  24. package/src/client/components/mdx/hooks/use-code-block.ts +56 -0
  25. package/src/client/components/mdx/hooks/use-component-preview.ts +16 -0
  26. package/src/client/components/mdx/hooks/useTable.ts +74 -0
  27. package/src/client/components/mdx/hooks/useTabs.ts +68 -0
  28. package/src/client/components/mdx/image.tsx +23 -0
  29. package/src/client/components/mdx/index.ts +53 -0
  30. package/src/client/components/mdx/link.tsx +38 -0
  31. package/src/client/components/mdx/list.tsx +192 -0
  32. package/src/client/components/mdx/table.tsx +156 -0
  33. package/src/client/components/mdx/tabs.tsx +135 -0
  34. package/src/client/components/mdx/video.tsx +68 -0
  35. package/src/client/components/primitives/breadcrumbs.tsx +79 -0
  36. package/src/client/components/primitives/button-group.tsx +54 -0
  37. package/src/client/components/primitives/button.tsx +145 -0
  38. package/src/client/components/primitives/helpers/observer.ts +120 -0
  39. package/src/client/components/primitives/index.ts +17 -0
  40. package/src/client/components/primitives/link.tsx +122 -0
  41. package/src/client/components/primitives/menu.tsx +159 -0
  42. package/src/client/components/primitives/navbar.tsx +359 -0
  43. package/src/client/components/primitives/navigation-menu.tsx +116 -0
  44. package/src/client/components/primitives/on-this-page.tsx +461 -0
  45. package/src/client/components/primitives/page-nav.tsx +87 -0
  46. package/src/client/components/primitives/popover.tsx +47 -0
  47. package/src/client/components/primitives/search-dialog.tsx +183 -0
  48. package/src/client/components/primitives/sidebar.tsx +154 -0
  49. package/src/client/components/primitives/tabs.tsx +90 -0
  50. package/src/client/components/primitives/tooltip.tsx +83 -0
  51. package/src/client/components/primitives/types.ts +11 -0
  52. package/src/client/components/ui-base/breadcrumbs.tsx +42 -0
  53. package/src/client/components/ui-base/copy-markdown.tsx +112 -0
  54. package/src/client/components/ui-base/error-boundary.tsx +52 -0
  55. package/src/client/components/ui-base/github-stars.tsx +27 -0
  56. package/src/client/components/ui-base/head.tsx +69 -0
  57. package/src/client/components/ui-base/loading.tsx +87 -0
  58. package/src/client/components/ui-base/navbar.tsx +138 -0
  59. package/src/client/components/ui-base/not-found.tsx +24 -0
  60. package/src/client/components/ui-base/on-this-page.tsx +152 -0
  61. package/src/client/components/ui-base/page-nav.tsx +39 -0
  62. package/src/client/components/ui-base/powered-by.tsx +19 -0
  63. package/src/client/components/ui-base/progress-bar.tsx +67 -0
  64. package/src/client/components/ui-base/search-dialog.tsx +82 -0
  65. package/src/client/components/ui-base/sidebar.tsx +104 -0
  66. package/src/client/components/ui-base/tabs.tsx +65 -0
  67. package/src/client/components/ui-base/theme-toggle.tsx +32 -0
  68. package/src/client/hooks/index.ts +12 -0
  69. package/src/client/hooks/use-breadcrumbs.ts +22 -0
  70. package/src/client/hooks/use-i18n.ts +84 -0
  71. package/src/client/hooks/use-localized-to.ts +95 -0
  72. package/src/client/hooks/use-location.ts +5 -0
  73. package/src/client/hooks/use-navbar.ts +60 -0
  74. package/src/client/hooks/use-onthispage.ts +23 -0
  75. package/src/client/hooks/use-page-nav.ts +22 -0
  76. package/src/client/hooks/use-routes.ts +72 -0
  77. package/src/client/hooks/use-search.ts +71 -0
  78. package/src/client/hooks/use-sidebar.ts +49 -0
  79. package/src/client/hooks/use-tabs.ts +43 -0
  80. package/src/client/hooks/use-version.ts +78 -0
  81. package/src/client/index.ts +55 -17
  82. package/src/client/integrations/codesandbox.ts +179 -0
  83. package/src/client/ssr.tsx +27 -16
  84. package/src/client/theme/neutral.css +360 -0
  85. package/src/client/types.ts +131 -27
  86. package/src/client/utils/cn.ts +6 -0
  87. package/src/client/utils/copy-clipboard.ts +22 -0
  88. package/src/client/utils/get-base-file-path.ts +21 -0
  89. package/src/client/utils/github.ts +121 -0
  90. package/src/client/utils/use-on-change.ts +15 -0
  91. package/src/client/virtual.d.ts +24 -0
  92. package/src/node/cache.ts +156 -156
  93. package/src/node/config.ts +159 -103
  94. package/src/node/index.ts +13 -13
  95. package/src/node/mdx.ts +213 -61
  96. package/src/node/plugin/entry.ts +29 -18
  97. package/src/node/plugin/html.ts +11 -11
  98. package/src/node/plugin/index.ts +161 -83
  99. package/src/node/plugin/types.ts +2 -4
  100. package/src/node/routes/cache.ts +6 -6
  101. package/src/node/routes/index.ts +206 -113
  102. package/src/node/routes/parser.ts +106 -81
  103. package/src/node/routes/sorter.ts +15 -15
  104. package/src/node/routes/types.ts +24 -24
  105. package/src/node/ssg/index.ts +46 -46
  106. package/src/node/ssg/meta.ts +4 -4
  107. package/src/node/ssg/options.ts +5 -5
  108. package/src/node/ssg/sitemap.ts +14 -14
  109. package/src/node/utils.ts +31 -31
  110. package/tsconfig.json +25 -20
  111. package/tsup.config.ts +23 -14
  112. package/dist/PackageManagerTabs-NVT7G625.mjs +0 -99
  113. package/dist/SearchDialog-AGVF6JBO.mjs +0 -194
  114. package/dist/SearchDialog-YPDOM7Q6.css +0 -2847
  115. package/dist/Video-KNTY5BNO.mjs +0 -6
  116. package/dist/cache-KNL5B4EE.mjs +0 -12
  117. package/dist/chunk-7SFUJWTB.mjs +0 -211
  118. package/dist/chunk-FFBNU6IJ.mjs +0 -386
  119. package/dist/chunk-FMTOYQLO.mjs +0 -37
  120. package/dist/chunk-TKLQWU7H.mjs +0 -1920
  121. package/dist/chunk-Z7JHYNAS.mjs +0 -57
  122. package/dist/client/index.css +0 -2847
  123. package/dist/client/index.d.mts +0 -372
  124. package/dist/client/index.d.ts +0 -372
  125. package/dist/client/index.js +0 -3630
  126. package/dist/client/index.mjs +0 -697
  127. package/dist/client/ssr.css +0 -2847
  128. package/dist/client/ssr.d.mts +0 -27
  129. package/dist/client/ssr.d.ts +0 -27
  130. package/dist/client/ssr.js +0 -2928
  131. package/dist/client/ssr.mjs +0 -33
  132. package/dist/config-BsFQ-ErD.d.mts +0 -159
  133. package/dist/config-BsFQ-ErD.d.ts +0 -159
  134. package/dist/node/index.d.mts +0 -91
  135. package/dist/node/index.d.ts +0 -91
  136. package/dist/node/index.js +0 -1187
  137. package/dist/node/index.mjs +0 -762
  138. package/dist/types-Dj-bfnC3.d.mts +0 -74
  139. package/dist/types-Dj-bfnC3.d.ts +0 -74
  140. package/src/client/theme/components/CodeBlock/CodeBlock.tsx +0 -61
  141. package/src/client/theme/components/CodeBlock/index.ts +0 -1
  142. package/src/client/theme/components/PackageManagerTabs/PackageManagerTabs.tsx +0 -131
  143. package/src/client/theme/components/PackageManagerTabs/index.ts +0 -1
  144. package/src/client/theme/components/PackageManagerTabs/pkg-tabs.css +0 -64
  145. package/src/client/theme/components/Playground/Playground.tsx +0 -180
  146. package/src/client/theme/components/Playground/index.ts +0 -1
  147. package/src/client/theme/components/Playground/playground.css +0 -238
  148. package/src/client/theme/components/Video/Video.tsx +0 -84
  149. package/src/client/theme/components/Video/index.ts +0 -1
  150. package/src/client/theme/components/Video/video.css +0 -41
  151. package/src/client/theme/components/mdx/Admonition.tsx +0 -80
  152. package/src/client/theme/components/mdx/Badge.tsx +0 -31
  153. package/src/client/theme/components/mdx/Button.tsx +0 -50
  154. package/src/client/theme/components/mdx/Card.tsx +0 -80
  155. package/src/client/theme/components/mdx/Field.tsx +0 -60
  156. package/src/client/theme/components/mdx/FileTree.tsx +0 -229
  157. package/src/client/theme/components/mdx/List.tsx +0 -57
  158. package/src/client/theme/components/mdx/Table.tsx +0 -151
  159. package/src/client/theme/components/mdx/Tabs.tsx +0 -123
  160. package/src/client/theme/components/mdx/index.ts +0 -27
  161. package/src/client/theme/components/mdx/mdx-components.css +0 -764
  162. package/src/client/theme/icons/bun.tsx +0 -62
  163. package/src/client/theme/icons/deno.tsx +0 -20
  164. package/src/client/theme/icons/discord.tsx +0 -12
  165. package/src/client/theme/icons/github.tsx +0 -15
  166. package/src/client/theme/icons/npm.tsx +0 -13
  167. package/src/client/theme/icons/pnpm.tsx +0 -72
  168. package/src/client/theme/icons/twitter.tsx +0 -12
  169. package/src/client/theme/styles/markdown.css +0 -394
  170. package/src/client/theme/styles/variables.css +0 -175
  171. package/src/client/theme/styles.css +0 -39
  172. package/src/client/theme/ui/Breadcrumbs/Breadcrumbs.tsx +0 -68
  173. package/src/client/theme/ui/Breadcrumbs/index.ts +0 -1
  174. package/src/client/theme/ui/CopyMarkdown/CopyMarkdown.tsx +0 -82
  175. package/src/client/theme/ui/CopyMarkdown/copy-markdown.css +0 -112
  176. package/src/client/theme/ui/CopyMarkdown/index.ts +0 -1
  177. package/src/client/theme/ui/ErrorBoundary/ErrorBoundary.tsx +0 -50
  178. package/src/client/theme/ui/ErrorBoundary/error-boundary.css +0 -55
  179. package/src/client/theme/ui/ErrorBoundary/index.ts +0 -1
  180. package/src/client/theme/ui/Footer/footer.css +0 -32
  181. package/src/client/theme/ui/Head/Head.tsx +0 -69
  182. package/src/client/theme/ui/Head/index.ts +0 -1
  183. package/src/client/theme/ui/LanguageSwitcher/LanguageSwitcher.tsx +0 -125
  184. package/src/client/theme/ui/LanguageSwitcher/index.ts +0 -1
  185. package/src/client/theme/ui/LanguageSwitcher/language-switcher.css +0 -98
  186. package/src/client/theme/ui/Layout/Layout.tsx +0 -203
  187. package/src/client/theme/ui/Layout/base.css +0 -106
  188. package/src/client/theme/ui/Layout/index.ts +0 -2
  189. package/src/client/theme/ui/Layout/pagination.css +0 -72
  190. package/src/client/theme/ui/Layout/responsive.css +0 -47
  191. package/src/client/theme/ui/Link/Link.tsx +0 -392
  192. package/src/client/theme/ui/Link/LinkPreview.tsx +0 -59
  193. package/src/client/theme/ui/Link/index.ts +0 -2
  194. package/src/client/theme/ui/Link/link-preview.css +0 -48
  195. package/src/client/theme/ui/Loading/Loading.tsx +0 -10
  196. package/src/client/theme/ui/Loading/index.ts +0 -1
  197. package/src/client/theme/ui/Loading/loading.css +0 -30
  198. package/src/client/theme/ui/Navbar/GithubStars.tsx +0 -27
  199. package/src/client/theme/ui/Navbar/Navbar.tsx +0 -193
  200. package/src/client/theme/ui/Navbar/Tabs.tsx +0 -99
  201. package/src/client/theme/ui/Navbar/index.ts +0 -2
  202. package/src/client/theme/ui/Navbar/navbar.css +0 -347
  203. package/src/client/theme/ui/NotFound/NotFound.tsx +0 -19
  204. package/src/client/theme/ui/NotFound/index.ts +0 -1
  205. package/src/client/theme/ui/NotFound/not-found.css +0 -64
  206. package/src/client/theme/ui/OnThisPage/OnThisPage.tsx +0 -244
  207. package/src/client/theme/ui/OnThisPage/index.ts +0 -1
  208. package/src/client/theme/ui/OnThisPage/toc.css +0 -152
  209. package/src/client/theme/ui/PoweredBy/PoweredBy.tsx +0 -18
  210. package/src/client/theme/ui/PoweredBy/index.ts +0 -1
  211. package/src/client/theme/ui/PoweredBy/powered-by.css +0 -76
  212. package/src/client/theme/ui/ProgressBar/ProgressBar.css +0 -17
  213. package/src/client/theme/ui/ProgressBar/ProgressBar.tsx +0 -51
  214. package/src/client/theme/ui/ProgressBar/index.ts +0 -1
  215. package/src/client/theme/ui/SearchDialog/SearchDialog.tsx +0 -209
  216. package/src/client/theme/ui/SearchDialog/index.ts +0 -1
  217. package/src/client/theme/ui/SearchDialog/search.css +0 -152
  218. package/src/client/theme/ui/Sidebar/Sidebar.tsx +0 -244
  219. package/src/client/theme/ui/Sidebar/index.ts +0 -1
  220. package/src/client/theme/ui/Sidebar/sidebar.css +0 -230
  221. package/src/client/theme/ui/ThemeToggle/ThemeToggle.tsx +0 -69
  222. package/src/client/theme/ui/ThemeToggle/index.ts +0 -1
  223. package/src/client/theme/ui/VersionSwitcher/VersionSwitcher.tsx +0 -136
  224. package/src/client/theme/ui/VersionSwitcher/index.ts +0 -1
  225. package/src/client/utils.ts +0 -49
@@ -1,64 +0,0 @@
1
- /* ═══════════════════════════════════════════════════════════
2
- 404 NOT FOUND
3
- ═══════════════════════════════════════════════════════════ */
4
- .boltdocs-not-found {
5
- display: flex;
6
- align-items: center;
7
- justify-content: center;
8
- min-height: 60vh;
9
- text-align: center;
10
- padding: 2rem;
11
- }
12
-
13
- .not-found-content {
14
- max-width: 420px;
15
- }
16
-
17
- .not-found-code {
18
- display: block;
19
- font-size: 6rem;
20
- font-weight: 900;
21
- line-height: 1;
22
- background: linear-gradient(
23
- 135deg,
24
- var(--ld-gradient-from),
25
- var(--ld-gradient-to)
26
- );
27
- -webkit-background-clip: text;
28
- -webkit-text-fill-color: transparent;
29
- background-clip: text;
30
- margin-bottom: 0.5rem;
31
- }
32
-
33
- .not-found-title {
34
- font-size: 1.5rem;
35
- font-weight: 700;
36
- margin: 0 0 0.75rem;
37
- color: var(--ld-text-main);
38
- }
39
-
40
- .not-found-text {
41
- color: var(--ld-text-muted);
42
- margin-bottom: 1.5rem;
43
- }
44
-
45
- a.not-found-link {
46
- display: inline-flex;
47
- align-items: center;
48
- gap: 0.5rem;
49
- padding: 0.6rem 1.5rem;
50
- background-color: var(--ld-btn-primary-bg);
51
- color: var(--ld-btn-primary-text) !important;
52
- border-radius: var(--ld-radius-md);
53
- text-decoration: none;
54
- font-weight: 600;
55
- transition: all 0.2s;
56
- }
57
-
58
- a.not-found-link:hover {
59
- background-color: var(--ld-btn-primary-bg);
60
- opacity: 0.9;
61
- transform: translateY(-1px);
62
- box-shadow: 0 4px 16px var(--ld-color-primary-glow);
63
- color: var(--ld-btn-primary-text) !important;
64
- }
@@ -1,244 +0,0 @@
1
- import React, { useEffect, useState, useRef, useCallback } from "react";
2
- import { useLocation } from "react-router-dom";
3
- import { Pencil, CircleHelp, TextAlignStart } from "lucide-react";
4
-
5
- interface TocHeading {
6
- id: string;
7
- text: string;
8
- level: number;
9
- }
10
-
11
- export function OnThisPage({
12
- headings = [],
13
- editLink,
14
- communityHelp,
15
- filePath,
16
- }: {
17
- headings?: TocHeading[];
18
- editLink?: string;
19
- communityHelp?: string;
20
- filePath?: string;
21
- }) {
22
- const [activeId, setActiveId] = useState<string | null>(null);
23
- const [indicatorStyle, setIndicatorStyle] = useState<React.CSSProperties>({});
24
- const observerRef = useRef<IntersectionObserver | null>(null);
25
- const location = useLocation();
26
- const listRef = useRef<HTMLUListElement>(null);
27
- const visibleIdsRef = useRef<Set<string>>(new Set());
28
-
29
- // Reset active ID when path changes
30
- useEffect(() => {
31
- if (headings.length > 0) {
32
- const hash = window.location.hash.substring(1);
33
- if (hash && headings.some((h) => h.id === hash)) {
34
- setActiveId(hash);
35
- } else {
36
- setActiveId(headings[0].id);
37
- }
38
- }
39
- }, [location.pathname, headings]);
40
-
41
- // Update indicator position for the single active ID
42
- useEffect(() => {
43
- if (!activeId || !listRef.current) return;
44
-
45
- const activeLink = listRef.current.querySelector(
46
- `a[href="#${activeId}"]`,
47
- ) as HTMLElement;
48
-
49
- if (activeLink) {
50
- const top = activeLink.offsetTop;
51
- const height = activeLink.offsetHeight;
52
-
53
- setIndicatorStyle({
54
- transform: `translateY(${top}px)`,
55
- height: `${height}px`,
56
- opacity: 1,
57
- });
58
- }
59
- }, [activeId, headings]);
60
-
61
- // IntersectionObserver for active heading tracking
62
- useEffect(() => {
63
- if (headings.length === 0) return;
64
-
65
- // Reset visible tracking on re-run
66
- visibleIdsRef.current.clear();
67
-
68
- if (observerRef.current) {
69
- observerRef.current.disconnect();
70
- }
71
-
72
- const callback: IntersectionObserverCallback = (entries) => {
73
- entries.forEach((entry) => {
74
- if (entry.isIntersecting) {
75
- visibleIdsRef.current.add(entry.target.id);
76
- } else {
77
- visibleIdsRef.current.delete(entry.target.id);
78
- }
79
- });
80
-
81
- // Selection logic: first visible heading in document order
82
- const firstVisible = headings.find((h) => visibleIdsRef.current.has(h.id));
83
-
84
- if (firstVisible) {
85
- setActiveId(firstVisible.id);
86
- } else {
87
- // Fallback: If nothing is visible, determine if we are at the top or bottom
88
- const firstEl = document.getElementById(headings[0].id);
89
- if (firstEl) {
90
- const rect = firstEl.getBoundingClientRect();
91
- if (rect.top > 200) {
92
- setActiveId(headings[0].id);
93
- return;
94
- }
95
- }
96
-
97
- // If we are deep in the doc, don't change it (keep previous)
98
- }
99
- };
100
-
101
- const observerOptions: IntersectionObserverInit = {
102
- root: document.querySelector(".boltdocs-content"),
103
- rootMargin: "-20% 0px -70% 0px",
104
- threshold: [0, 1],
105
- };
106
-
107
- observerRef.current = new IntersectionObserver(callback, observerOptions);
108
-
109
- const observeHeadings = () => {
110
- headings.forEach(({ id }) => {
111
- const el = document.getElementById(id);
112
- if (el) {
113
- observerRef.current!.observe(el);
114
- }
115
- });
116
- };
117
-
118
- observeHeadings();
119
- const timeoutId = setTimeout(observeHeadings, 1000);
120
-
121
- const handleScroll = () => {
122
- const scrollPosition = window.innerHeight + window.pageYOffset;
123
- const bodyHeight = document.documentElement.scrollHeight;
124
-
125
- if (scrollPosition >= bodyHeight - 50) {
126
- setActiveId(headings[headings.length - 1].id);
127
- }
128
- };
129
-
130
- window.addEventListener("scroll", handleScroll, { passive: true });
131
-
132
- return () => {
133
- observerRef.current?.disconnect();
134
- clearTimeout(timeoutId);
135
- window.removeEventListener("scroll", handleScroll);
136
- };
137
- }, [headings, location.pathname]);
138
-
139
- // Autoscroll TOC list when the activeId changes
140
- useEffect(() => {
141
- if (!activeId || !listRef.current) return;
142
-
143
- const activeLink = listRef.current.querySelector(
144
- `a[href="#${activeId}"]`,
145
- ) as HTMLElement;
146
-
147
- if (activeLink) {
148
- const container = listRef.current.parentElement as HTMLElement;
149
- if (!container) return;
150
-
151
- const linkRect = activeLink.getBoundingClientRect();
152
- const containerRect = container.getBoundingClientRect();
153
-
154
- const isVisible =
155
- linkRect.top >= containerRect.top &&
156
- linkRect.bottom <= containerRect.bottom;
157
-
158
- if (!isVisible) {
159
- activeLink.scrollIntoView({
160
- behavior: "auto",
161
- block: "nearest",
162
- });
163
- }
164
- }
165
- }, [activeId]);
166
-
167
- const handleClick = useCallback(
168
- (e: React.MouseEvent<HTMLAnchorElement>, id: string) => {
169
- e.preventDefault();
170
- const el = document.getElementById(id);
171
- if (el) {
172
- el.scrollIntoView({
173
- behavior: "smooth",
174
- });
175
-
176
- setActiveId(id);
177
- window.history.pushState(null, "", `#${id}`);
178
- }
179
- },
180
- [],
181
- );
182
-
183
- if (headings.length === 0) return null;
184
-
185
- return (
186
- <nav className="boltdocs-on-this-page" aria-label="Table of contents">
187
- <p className="on-this-page-title">On this page</p>
188
- <div className="on-this-page-container">
189
- <div className="on-this-page-list-container">
190
- <div className="toc-indicator" style={indicatorStyle} />
191
- <ul className="on-this-page-list" ref={listRef}>
192
- {headings.map((h) => (
193
- <li key={h.id} className={h.level === 3 ? "toc-indent" : ""}>
194
- <a
195
- href={`#${h.id}`}
196
- className={`toc-link ${activeId === h.id ? "active" : ""}`}
197
- aria-current={activeId === h.id ? "true" : undefined}
198
- onClick={(e) => handleClick(e, h.id)}
199
- >
200
- {h.text}
201
- </a>
202
- </li>
203
- ))}
204
- </ul>
205
- </div>
206
- </div>
207
-
208
- {/* Need help? section */}
209
- {(editLink || communityHelp) && (
210
- <div className="toc-help">
211
- <p className="toc-help-title">Need help?</p>
212
- <ul className="toc-help-links">
213
- {editLink && filePath && (
214
- <li>
215
- <a
216
- href={editLink.replace(":path", filePath)}
217
- target="_blank"
218
- rel="noopener noreferrer"
219
- className="toc-help-link"
220
- >
221
- <Pencil size={16} />
222
- Edit this page
223
- </a>
224
- </li>
225
- )}
226
- {communityHelp && (
227
- <li>
228
- <a
229
- href={communityHelp}
230
- target="_blank"
231
- rel="noopener noreferrer"
232
- className="toc-help-link"
233
- >
234
- <CircleHelp size={16} />
235
- Community help
236
- </a>
237
- </li>
238
- )}
239
- </ul>
240
- </div>
241
- )}
242
- </nav>
243
- );
244
- }
@@ -1 +0,0 @@
1
- export { OnThisPage } from "./OnThisPage";
@@ -1,152 +0,0 @@
1
- /* ═══════════════════════════════════════════════════════════
2
- ON THIS PAGE (TOC)
3
- ═══════════════════════════════════════════════════════════ */
4
- .boltdocs-on-this-page {
5
- width: var(--ld-toc-width);
6
- flex-shrink: 0;
7
- padding: 1.5rem 1rem;
8
- height: 100%;
9
- display: flex;
10
- flex-direction: column;
11
- /* Hardware acceleration */
12
- transform: translate3d(0, 0, 0);
13
- backface-visibility: hidden;
14
- }
15
-
16
- .on-this-page-title {
17
- font-size: 0.6875rem;
18
- font-weight: 700;
19
- text-transform: uppercase;
20
- letter-spacing: 0.08em;
21
- color: var(--ld-text-dim);
22
- margin: 0 0 0.75rem;
23
- padding-left: 0.75rem;
24
- flex-shrink: 0;
25
- }
26
-
27
- .on-this-page-container {
28
- position: relative;
29
- padding-left: 2px;
30
- flex: 0 1 auto;
31
- min-height: 0; /* Important for children overflow */
32
- display: flex;
33
- flex-direction: column;
34
- }
35
-
36
- .on-this-page-list-container {
37
- overflow-y: auto;
38
- max-height: 50vh; /* Constrain height for large docs */
39
- flex: 0 1 auto;
40
- position: relative;
41
- scrollbar-width: none;
42
- }
43
-
44
- .on-this-page-list-container::-webkit-scrollbar {
45
- display: none;
46
- }
47
-
48
- .on-this-page-list {
49
- list-style: none;
50
- padding: 0;
51
- margin: 0;
52
- border-left: 1px solid var(--ld-border-subtle);
53
- }
54
-
55
- .toc-indicator {
56
- position: absolute;
57
- left: 0;
58
- width: 2px;
59
- background-color: var(--ld-color-accent);
60
- transition:
61
- transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
62
- height 0.25s cubic-bezier(0.4, 0, 0.2, 1),
63
- opacity 0.2s ease;
64
- z-index: 1;
65
- border-radius: 2px;
66
- pointer-events: none;
67
- opacity: 0;
68
- }
69
-
70
- .on-this-page-list li {
71
- margin: 0;
72
- }
73
-
74
- .on-this-page-list li.toc-indent {
75
- padding-left: 0.75rem;
76
- }
77
-
78
- .toc-link {
79
- display: block;
80
- padding: 0.35rem 0.75rem;
81
- font-size: 0.8125rem;
82
- color: var(--ld-text-dim);
83
- text-decoration: none;
84
- border-left: 2px solid transparent;
85
- margin-left: -2px;
86
- line-height: 1.4;
87
- transition:
88
- color 0.2s,
89
- font-weight 0.2s;
90
- }
91
-
92
- .toc-link:hover {
93
- color: var(--ld-text-main);
94
- }
95
-
96
- .toc-link.active {
97
- color: var(--ld-color-primary);
98
- font-weight: 500;
99
- }
100
-
101
- /* ─── Need Help Section ──────────────────────────────────── */
102
- .toc-help {
103
- margin-top: 1.5rem;
104
- padding-top: 1rem;
105
- border-top: 1px solid var(--ld-border-subtle);
106
- flex-shrink: 0;
107
- }
108
-
109
- .toc-help-title {
110
- font-size: 0.6875rem;
111
- font-weight: 700;
112
- text-transform: uppercase;
113
- letter-spacing: 0.08em;
114
- color: var(--ld-text-dim);
115
- margin: 0 0 0.5rem;
116
- padding-left: 0.75rem;
117
- }
118
-
119
- .toc-help-links {
120
- list-style: none;
121
- padding: 0;
122
- margin: 0;
123
- }
124
-
125
- .toc-help-links li {
126
- margin-bottom: 2px;
127
- }
128
-
129
- .toc-help-link {
130
- display: flex;
131
- align-items: center;
132
- gap: 0.4rem;
133
- padding: 0.3rem 0.75rem;
134
- font-size: 0.8rem;
135
- color: var(--ld-text-dim);
136
- text-decoration: none;
137
- border-radius: var(--ld-radius-md);
138
- transition:
139
- color 0.2s,
140
- background-color 0.2s;
141
- }
142
-
143
- .toc-help-link:hover {
144
- color: var(--ld-text-main);
145
- background-color: var(--ld-bg-mute);
146
- }
147
-
148
- .toc-help-link svg {
149
- width: 14px;
150
- height: 14px;
151
- opacity: 0.6;
152
- }
@@ -1,18 +0,0 @@
1
- import { Zap } from "lucide-react";
2
-
3
- export function PoweredBy() {
4
- return (
5
- <div className="powered-by-container">
6
- <a
7
- href="https://github.com/jesusalcaladev/boltdocs"
8
- target="_blank"
9
- rel="noopener noreferrer"
10
- className="powered-by-link"
11
- >
12
- <Zap className="powered-by-icon" size={12} fill="currentColor" />
13
- <span>Powered by</span>
14
- <span className="powered-by-brand">LiteDocs</span>
15
- </a>
16
- </div>
17
- );
18
- }
@@ -1 +0,0 @@
1
- export { PoweredBy } from "./PoweredBy";
@@ -1,76 +0,0 @@
1
- .powered-by-container {
2
- display: flex;
3
- justify-content: center;
4
- padding: 1rem 0.6rem;
5
- }
6
-
7
- .powered-by-link {
8
- position: relative;
9
- display: inline-flex;
10
- align-items: center;
11
- gap: 0.45rem;
12
- padding: 0.45rem 1rem;
13
- border-radius: var(--ld-radius-full);
14
- background: rgba(255, 255, 255, 0.03);
15
- backdrop-filter: blur(8px);
16
- -webkit-backdrop-filter: blur(8px);
17
- border: 1px solid rgba(255, 255, 255, 0.08);
18
- color: var(--ld-text-dim);
19
- font-size: 0.725rem;
20
- font-weight: 500;
21
- text-decoration: none;
22
- transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
23
- letter-spacing: 0.01em;
24
- overflow: hidden;
25
- }
26
-
27
- .powered-by-link::before {
28
- content: "";
29
- position: absolute;
30
- top: 0;
31
- left: -100%;
32
- width: 100%;
33
- height: 100%;
34
- background: linear-gradient(
35
- 90deg,
36
- transparent,
37
- rgba(255, 255, 255, 0.05),
38
- transparent
39
- );
40
- transition: 0.5s;
41
- }
42
-
43
- .powered-by-link:hover::before {
44
- left: 100%;
45
- }
46
-
47
- .powered-by-link:hover {
48
- background: rgba(255, 255, 255, 0.06);
49
- border-color: rgba(255, 255, 255, 0.2);
50
- color: var(--ld-text-main);
51
- transform: translateY(-2px);
52
- box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
53
- }
54
-
55
- .powered-by-icon {
56
- color: var(--ld-color-primary);
57
- filter: drop-shadow(0 0 4px var(--ld-color-primary));
58
- transition: transform 0.3s ease;
59
- }
60
-
61
- .powered-by-link:hover .powered-by-icon {
62
- transform: scale(1.2) rotate(-10deg);
63
- filter: drop-shadow(0 0 8px var(--ld-color-primary));
64
- }
65
-
66
- .powered-by-brand {
67
- color: var(--ld-color-primary);
68
- font-weight: 700;
69
- text-shadow: 0 0 10px rgba(var(--ld-color-primary-rgb, 56, 189, 248), 0.3);
70
- }
71
-
72
- @media (max-width: 768px) {
73
- .powered-by-container {
74
- padding: 0.75rem 0.5rem;
75
- }
76
- }
@@ -1,17 +0,0 @@
1
- .boltdocs-progress-container {
2
- position: fixed;
3
- top: 0;
4
- left: 0;
5
- width: 100%;
6
- height: 2px;
7
- z-index: 1000;
8
- pointer-events: none;
9
- background: transparent;
10
- }
11
-
12
- .boltdocs-progress-bar {
13
- height: 100%;
14
- background: linear-gradient(90deg, var(--ld-color-primary), var(--ld-gradient-to, var(--ld-color-primary)));
15
- box-shadow: 0 0 8px var(--ld-color-primary-glow);
16
- transition: width 0.1s ease-out;
17
- }
@@ -1,51 +0,0 @@
1
- import React, { useEffect, useState } from "react";
2
- import "./ProgressBar.css";
3
-
4
- export function ProgressBar() {
5
- const [progress, setProgress] = useState(0);
6
-
7
- useEffect(() => {
8
- let container: Element | null = null;
9
- let timer: any;
10
-
11
- const handleScroll = () => {
12
- if (!container) return;
13
- const { scrollTop, scrollHeight, clientHeight } = container;
14
- if (scrollHeight <= clientHeight) {
15
- setProgress(0);
16
- return;
17
- }
18
- const scrollPercent = (scrollTop / (scrollHeight - clientHeight)) * 100;
19
- setProgress(Math.min(100, Math.max(0, scrollPercent)));
20
- };
21
-
22
- const attachListener = () => {
23
- container = document.querySelector(".boltdocs-content");
24
- if (container) {
25
- container.addEventListener("scroll", handleScroll);
26
- handleScroll();
27
- if (timer) clearInterval(timer);
28
- return true;
29
- }
30
- return false;
31
- };
32
-
33
- if (!attachListener()) {
34
- timer = setInterval(attachListener, 100);
35
- }
36
-
37
- return () => {
38
- if (container) container.removeEventListener("scroll", handleScroll);
39
- if (timer) clearInterval(timer);
40
- };
41
- }, []);
42
-
43
- return (
44
- <div className="boltdocs-progress-container">
45
- <div
46
- className="boltdocs-progress-bar"
47
- style={{ width: `${progress}%` }}
48
- />
49
- </div>
50
- );
51
- }
@@ -1 +0,0 @@
1
- export * from "./ProgressBar";