boltdocs 2.7.10 → 2.7.11

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 (137) hide show
  1. package/dist/client/index.cjs +1929 -1
  2. package/dist/client/index.js +1880 -1
  3. package/dist/client/mdx.cjs +7 -1
  4. package/dist/client/mdx.js +7 -1
  5. package/dist/client/primitives.cjs +60 -1
  6. package/dist/client/primitives.js +20 -1
  7. package/dist/docs-layout-BXHV0xw_.cjs +1431 -0
  8. package/dist/docs-layout-DwFndmj5.js +1231 -0
  9. package/dist/icons-dev-3cZMyt8r.cjs +1204 -0
  10. package/dist/icons-dev-Df8OQ481.js +839 -0
  11. package/dist/image-DtrI2cw3.cjs +268 -0
  12. package/dist/image-jxPb-2iV.js +214 -0
  13. package/dist/mdx-BdWkJTeB.cjs +523 -0
  14. package/dist/mdx-UTTLFWJq.js +494 -0
  15. package/dist/node/cli-entry.cjs +1 -1
  16. package/dist/node/cli-entry.mjs +1 -1
  17. package/dist/node/index.cjs +1 -1
  18. package/dist/node/index.mjs +1 -1
  19. package/dist/{node-DtEDyN1u.cjs → node-BSM4qcDK.cjs} +1 -1
  20. package/dist/{node-_1jhMGYx.mjs → node-BspZN3R2.mjs} +1 -1
  21. package/dist/{package-DrwtlXfk.cjs → package-DIIrjuWI.cjs} +1 -1
  22. package/dist/{package--0Yf0t1N.mjs → package-K0zsjGIz.mjs} +1 -1
  23. package/dist/{search-dialog-ByvGScjt.js → search-dialog-BHuIiUC6.js} +3 -1
  24. package/dist/search-dialog-BNF10tDl.js +375 -0
  25. package/dist/search-dialog-BwkDuI9R.cjs +220 -0
  26. package/dist/search-dialog-C7xuvyNk.cjs +386 -0
  27. package/dist/search-dialog-CIQg6k8c.cjs +8 -0
  28. package/dist/search-dialog-D-DDN7zJ.js +208 -0
  29. package/package.json +3 -4
  30. package/dist/docs-layout-KoWNZc8_.js +0 -6
  31. package/dist/docs-layout-x2yKt2cL.cjs +0 -6
  32. package/dist/icons-dev-B_RZIyxu.js +0 -6
  33. package/dist/icons-dev-BlV3wWFT.cjs +0 -6
  34. package/dist/image-BHhTvQzr.cjs +0 -6
  35. package/dist/image-CqKzYD8f.js +0 -6
  36. package/dist/mdx-DudBEac0.js +0 -7
  37. package/dist/mdx-r4cDQxWu.cjs +0 -7
  38. package/dist/search-dialog-B584t9ZF.js +0 -6
  39. package/dist/search-dialog-BvBopRsZ.cjs +0 -6
  40. package/dist/search-dialog-Cyko6TJm.cjs +0 -6
  41. package/dist/search-dialog-D6BNohIJ.js +0 -6
  42. package/dist/search-dialog-DuYTIefy.cjs +0 -6
  43. package/src/client/app/config-context.tsx +0 -51
  44. package/src/client/app/doc-page.tsx +0 -38
  45. package/src/client/app/docs-layout.tsx +0 -28
  46. package/src/client/app/head.tsx +0 -122
  47. package/src/client/app/helmet-compat.tsx +0 -36
  48. package/src/client/app/mdx-component.tsx +0 -8
  49. package/src/client/app/mdx-components-context.tsx +0 -72
  50. package/src/client/app/routes-context.tsx +0 -34
  51. package/src/client/app/scroll-handler.tsx +0 -74
  52. package/src/client/app/theme-context.tsx +0 -103
  53. package/src/client/app/ui-context.tsx +0 -42
  54. package/src/client/components/docs-layout-default.tsx +0 -85
  55. package/src/client/components/icons-dev.tsx +0 -282
  56. package/src/client/components/mdx/callout.tsx +0 -97
  57. package/src/client/components/mdx/card.tsx +0 -99
  58. package/src/client/components/mdx/cards.tsx +0 -27
  59. package/src/client/components/mdx/code-block.tsx +0 -184
  60. package/src/client/components/mdx/field.tsx +0 -33
  61. package/src/client/components/mdx/image.tsx +0 -44
  62. package/src/client/components/mdx/index.ts +0 -19
  63. package/src/client/components/mdx/table.tsx +0 -54
  64. package/src/client/components/mdx/typographics.tsx +0 -120
  65. package/src/client/components/mdx/use-code-block.ts +0 -34
  66. package/src/client/components/primitives/breadcrumbs.tsx +0 -54
  67. package/src/client/components/primitives/button-group.tsx +0 -54
  68. package/src/client/components/primitives/button.tsx +0 -6
  69. package/src/client/components/primitives/code-block.tsx +0 -120
  70. package/src/client/components/primitives/docs-layout.tsx +0 -125
  71. package/src/client/components/primitives/error-boundary.tsx +0 -107
  72. package/src/client/components/primitives/heading.tsx +0 -128
  73. package/src/client/components/primitives/helpers/observer.ts +0 -141
  74. package/src/client/components/primitives/image.tsx +0 -26
  75. package/src/client/components/primitives/link.tsx +0 -102
  76. package/src/client/components/primitives/menu.tsx +0 -137
  77. package/src/client/components/primitives/navbar.tsx +0 -466
  78. package/src/client/components/primitives/on-this-page.tsx +0 -430
  79. package/src/client/components/primitives/page-nav.tsx +0 -51
  80. package/src/client/components/primitives/popover.tsx +0 -28
  81. package/src/client/components/primitives/search-dialog.tsx +0 -193
  82. package/src/client/components/primitives/sidebar.tsx +0 -423
  83. package/src/client/components/primitives/skeleton.tsx +0 -26
  84. package/src/client/components/primitives/tabs.tsx +0 -70
  85. package/src/client/components/primitives/tooltip.tsx +0 -81
  86. package/src/client/components/primitives/types.ts +0 -11
  87. package/src/client/components/ui-base/banner.tsx +0 -66
  88. package/src/client/components/ui-base/breadcrumbs.tsx +0 -44
  89. package/src/client/components/ui-base/copy-markdown.tsx +0 -107
  90. package/src/client/components/ui-base/error-boundary.tsx +0 -15
  91. package/src/client/components/ui-base/github-stars.tsx +0 -29
  92. package/src/client/components/ui-base/icons.tsx +0 -240
  93. package/src/client/components/ui-base/index.ts +0 -16
  94. package/src/client/components/ui-base/last-updated.tsx +0 -27
  95. package/src/client/components/ui-base/navbar.tsx +0 -266
  96. package/src/client/components/ui-base/not-found.tsx +0 -26
  97. package/src/client/components/ui-base/on-this-page.tsx +0 -57
  98. package/src/client/components/ui-base/page-nav.tsx +0 -50
  99. package/src/client/components/ui-base/search-dialog.tsx +0 -163
  100. package/src/client/components/ui-base/search-highlight.tsx +0 -10
  101. package/src/client/components/ui-base/sidebar.tsx +0 -92
  102. package/src/client/components/ui-base/tabs.tsx +0 -83
  103. package/src/client/components/ui-base/theme-toggle.tsx +0 -130
  104. package/src/client/components/ui-base/version-i18n.tsx +0 -80
  105. package/src/client/hooks/index.ts +0 -13
  106. package/src/client/hooks/use-analytics.ts +0 -272
  107. package/src/client/hooks/use-breadcrumbs.ts +0 -22
  108. package/src/client/hooks/use-i18n.ts +0 -182
  109. package/src/client/hooks/use-localized-to.ts +0 -113
  110. package/src/client/hooks/use-location.ts +0 -5
  111. package/src/client/hooks/use-navbar.ts +0 -130
  112. package/src/client/hooks/use-page-nav.ts +0 -46
  113. package/src/client/hooks/use-routes.ts +0 -108
  114. package/src/client/hooks/use-search-highlight.ts +0 -185
  115. package/src/client/hooks/use-search.ts +0 -118
  116. package/src/client/hooks/use-sidebar.ts +0 -205
  117. package/src/client/hooks/use-tabs.ts +0 -46
  118. package/src/client/hooks/use-version.ts +0 -111
  119. package/src/client/index.ts +0 -31
  120. package/src/client/mdx.ts +0 -2
  121. package/src/client/primitives.ts +0 -19
  122. package/src/client/ssg/boltdocs-shell.tsx +0 -148
  123. package/src/client/ssg/create-routes.tsx +0 -473
  124. package/src/client/ssg/index.ts +0 -4
  125. package/src/client/ssg/mdx-page.tsx +0 -38
  126. package/src/client/store/boltdocs-context.tsx +0 -137
  127. package/src/client/theme/neutral.css +0 -141
  128. package/src/client/theme/reset.css +0 -189
  129. package/src/client/types.ts +0 -116
  130. package/src/client/utils/cn.ts +0 -6
  131. package/src/client/utils/copy-clipboard.ts +0 -22
  132. package/src/client/utils/get-base-file-path.ts +0 -21
  133. package/src/client/utils/github.ts +0 -121
  134. package/src/client/utils/i18n.ts +0 -23
  135. package/src/client/utils/path.ts +0 -9
  136. package/src/client/utils/react-to-text.ts +0 -34
  137. package/src/client/virtual.d.ts +0 -24
@@ -1,137 +0,0 @@
1
- import { createContext, use, useMemo, useState, useEffect } from 'react'
2
-
3
- const PREFERENCES_KEY = 'boltdocs-user-preferences'
4
-
5
- interface PersistedState {
6
- locale?: string
7
- version?: string
8
- }
9
-
10
- export interface BoltdocsState {
11
- currentLocale: string
12
- currentVersion: string
13
- setLocale: (locale: string) => void
14
- setVersion: (version: string) => void
15
- hasHydrated: boolean
16
- setHasHydrated: (hasHydrated: boolean) => void
17
- }
18
-
19
- const BOLTDOCS_CONTEXT_SYMBOL = Symbol.for('__BDOCS_BOLTDOCS_CONTEXT__')
20
- const BOLTDOCS_INSTANCE_SYMBOL = Symbol.for('__BDOCS_BOLTDOCS_INSTANCE__')
21
-
22
- const BoltdocsContext =
23
- (globalThis as any)[BOLTDOCS_CONTEXT_SYMBOL] ||
24
- ((globalThis as any)[BOLTDOCS_CONTEXT_SYMBOL] = createContext<
25
- BoltdocsState | undefined
26
- >(undefined))
27
-
28
- export function BoltdocsProvider({
29
- children,
30
- initialLocale = '',
31
- initialVersion = '',
32
- }: {
33
- children: React.ReactNode
34
- initialLocale?: string
35
- initialVersion?: string
36
- }) {
37
- // Helper to read from storage safely
38
- const getSavedPrefs = (): PersistedState => {
39
- if (typeof window === 'undefined') return {}
40
- try {
41
- const raw = localStorage.getItem(PREFERENCES_KEY)
42
- return raw ? JSON.parse(raw) : {}
43
- } catch {
44
- return {}
45
- }
46
- }
47
-
48
- // 1. Lazy state initializers prioritize passed URL state, falling back to LocalStorage preference immediately
49
- const [locale, setLocaleState] = useState(() => {
50
- if (initialLocale) return initialLocale
51
- const prefs = getSavedPrefs()
52
- return prefs.locale || ''
53
- })
54
-
55
- const [version, setVersionState] = useState(() => {
56
- if (initialVersion) return initialVersion
57
- const prefs = getSavedPrefs()
58
- return prefs.version || ''
59
- })
60
-
61
- const [hasHydrated, setHasHydrated] = useState(() => {
62
- return typeof window !== 'undefined'
63
- })
64
-
65
- // Ensure the hydrator runs once client is definitely booted
66
- useEffect(() => {
67
- setHasHydrated(true)
68
- }, [])
69
-
70
- const value = useMemo(() => {
71
- const updateLocale = (l: string) => {
72
- const newL = l || ''
73
- setLocaleState(newL)
74
- if (typeof window !== 'undefined') {
75
- try {
76
- const prefs = getSavedPrefs()
77
- localStorage.setItem(
78
- PREFERENCES_KEY,
79
- JSON.stringify({ ...prefs, locale: newL }),
80
- )
81
- } catch (e) {}
82
- }
83
- }
84
-
85
- const updateVersion = (v: string) => {
86
- const newV = v || ''
87
- setVersionState(newV)
88
- if (typeof window !== 'undefined') {
89
- try {
90
- const prefs = getSavedPrefs()
91
- localStorage.setItem(
92
- PREFERENCES_KEY,
93
- JSON.stringify({ ...prefs, version: newV }),
94
- )
95
- } catch (e) {}
96
- }
97
- }
98
-
99
- return {
100
- currentLocale: locale,
101
- currentVersion: version,
102
- setLocale: updateLocale,
103
- setVersion: updateVersion,
104
- hasHydrated,
105
- setHasHydrated,
106
- }
107
- }, [locale, version, hasHydrated])
108
-
109
- // Sync with global registry for dual-package fallback
110
- if (typeof globalThis !== 'undefined') {
111
- ;(globalThis as any)[BOLTDOCS_INSTANCE_SYMBOL] = value
112
- }
113
-
114
- return (
115
- <BoltdocsContext.Provider value={value}>
116
- {children}
117
- </BoltdocsContext.Provider>
118
- )
119
- }
120
-
121
- export function useBoltdocsContext() {
122
- const context = use(BoltdocsContext)
123
-
124
- // Fallback to global registry if context is missing (dual-package hazard safety net)
125
- if (
126
- !context &&
127
- typeof globalThis !== 'undefined' &&
128
- (globalThis as any)[BOLTDOCS_INSTANCE_SYMBOL]
129
- ) {
130
- return (globalThis as any)[BOLTDOCS_INSTANCE_SYMBOL] as BoltdocsState
131
- }
132
-
133
- if (!context) {
134
- throw new Error('useBoltdocsContext must be used within a BoltdocsProvider')
135
- }
136
- return context as BoltdocsState
137
- }
@@ -1,141 +0,0 @@
1
- @theme {
2
- --font-display: "Inter", "ui-sans-serif", "system-ui", sans-serif;
3
- --font-sans: "Inter", "ui-sans-serif", "system-ui", sans-serif;
4
- --font-mono:
5
- "JetBrains Mono", "ui-monospace", "SFMono-Regular", Menlo, Monaco, Consolas,
6
- "liberation mono", "courier new", monospace;
7
-
8
- --breakpoint-3xl: 120rem;
9
-
10
- /* Premium Terracotta brand Palette (#eb5828) */
11
- --color-primary-50: #fef4f0;
12
- --color-primary-100: #fde4da;
13
- --color-primary-200: #fbc8b6;
14
- --color-primary-300: #faa184;
15
- --color-primary-400: #f6724a;
16
- --color-primary-500: #eb5828;
17
- /* Core brand Terracotta Orange */
18
- --color-primary-600: #d34013;
19
- --color-primary-700: #ab300c;
20
- --color-primary-800: #842308;
21
- --color-primary-900: #5a1503;
22
-
23
- /* Intellectual warm Neutral Palette (#faf9f5 / #141413) */
24
- --color-neutral-50: #faf9f5;
25
- /* Elegant Light Background */
26
- --color-neutral-100: #f5f4ee;
27
- /* Soft backgrounds and cards */
28
- --color-neutral-200: #eae8de;
29
- /* Subtle border */
30
- --color-neutral-300: #d9d6c7;
31
- /* Strong border */
32
- --color-neutral-400: #b5b19c;
33
- --color-neutral-500: #8a8670;
34
- /* Muted warm gray text */
35
- --color-neutral-600: #706c57;
36
- --color-neutral-700: #4a483a;
37
- /* Paragraph text */
38
- --color-neutral-800: #25241d;
39
- --color-neutral-900: #141413;
40
- /* Elegant Soft Black text / Dark mode main background */
41
- --color-neutral-950: #080807;
42
-
43
- /* Semantic Status Colors */
44
- --color-danger-500: oklch(0.63 0.24 27);
45
- --color-success-500: oklch(0.72 0.19 150);
46
- --color-warning-500: oklch(0.78 0.17 75);
47
- --color-info-500: oklch(0.62 0.19 260);
48
-
49
- /* Modern Organic Rounded Radii (Warmer and More Rounded) */
50
- --radius-sm: 0.375rem;
51
- --radius-md: 0.5rem;
52
- --radius-lg: 1rem;
53
- /* 16px */
54
- --radius-xl: 1.25rem;
55
- /* 20px */
56
- --radius-2xl: 1.5rem;
57
- /* 24px */
58
- --radius-full: 99999rem;
59
-
60
- --ease-fluid: cubic-bezier(0.3, 0, 0, 1);
61
- --ease-snappy: cubic-bezier(0.2, 0, 0, 1);
62
-
63
- /* Semantic Colors - Default (Light Parchment) */
64
- --color-main: var(--color-neutral-50);
65
- --color-surface: #ffffff;
66
- /* Pure soft white for cards */
67
- --color-soft: var(--color-neutral-100);
68
- --color-body: var(--color-neutral-900);
69
- --color-paragraph: var(--color-neutral-700);
70
- --color-muted: var(--color-neutral-500);
71
- --color-dim: var(--color-neutral-400);
72
- --color-subtle: var(--color-neutral-200);
73
- --color-strong: var(--color-neutral-300);
74
- --color-code-bg: var(--color-neutral-100);
75
- --color-code-text: #eb5828;
76
-
77
- /* Semantic Colors - Dark Override (handled via standard CSS overrides below the @theme block) */
78
-
79
- /* Spacing and Dimensions */
80
- --spacing-navbar: 3.5rem;
81
- --spacing-sidebar: 16rem;
82
- --spacing-toc: 16rem;
83
- --spacing-content-max: 54rem;
84
-
85
- @keyframes pulse {
86
- 0%,
87
- 100% {
88
- opacity: 1;
89
- }
90
-
91
- 50% {
92
- opacity: 0.5;
93
- }
94
- }
95
-
96
- @keyframes fade-in {
97
- from {
98
- opacity: 0;
99
- }
100
-
101
- to {
102
- opacity: 1;
103
- }
104
- }
105
- }
106
-
107
- @variant dark
108
- (
109
- &:where(.dark, .dark *));
110
-
111
- .animate-pulse {
112
- animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
113
- }
114
-
115
- .animate-fade-in {
116
- animation: fade-in 0.1s ease-out forwards;
117
- }
118
-
119
- :root[data-theme="dark"],
120
- :root.dark {
121
- --color-main: #141413;
122
- /* Deep warm charcoal background */
123
- --color-surface: #1e1e1d;
124
- /* Slightly lighter warm charcoal for cards */
125
- --color-soft: #252524;
126
- /* Warm dark gray for containers */
127
- --color-body: #f3f3f2;
128
- /* Soft warm white body text */
129
- --color-paragraph: #d5d5d3;
130
- /* Warm light gray text */
131
- --color-muted: #9a9a97;
132
- /* Warm muted text */
133
- --color-dim: #767673;
134
- --color-subtle: #2c2c2a;
135
- /* Subtle dark border */
136
- --color-strong: #3c3c39;
137
- /* Strong dark border */
138
- --color-code-bg: #1c1c1b;
139
- --color-code-text: #eb5828;
140
- /* Outstanding terracotta orange inline code */
141
- }
@@ -1,189 +0,0 @@
1
- @layer base {
2
- *,
3
- *::before,
4
- *::after {
5
- box-sizing: border-box;
6
- }
7
-
8
- html,
9
- body {
10
- margin: 0;
11
- padding: 0;
12
- min-height: 100%;
13
- overflow-x: hidden;
14
- }
15
-
16
- body {
17
- @apply bg-main text-body antialiased;
18
- font-family: var(--font-sans);
19
- line-height: 1.7;
20
- }
21
-
22
- a {
23
- text-decoration: none;
24
- }
25
-
26
- /* Scroll-margin-top for anchor scrolling */
27
- h1,
28
- h2,
29
- h3,
30
- h4,
31
- h5,
32
- h6 {
33
- scroll-margin-top: 6rem;
34
- }
35
-
36
- /* Scrollbar */
37
- ::-webkit-scrollbar {
38
- width: 6px;
39
- height: 6px;
40
- }
41
-
42
- ::-webkit-scrollbar-track {
43
- background: transparent;
44
- }
45
-
46
- ::-webkit-scrollbar-thumb {
47
- background-color: var(--color-strong);
48
- border-radius: 9999px;
49
- }
50
-
51
- ::-webkit-scrollbar-thumb:hover {
52
- background-color: var(--color-muted);
53
- }
54
-
55
- /* ═══ Content Area ═══ */
56
- .boltdocs-content {
57
- scrollbar-width: none;
58
- }
59
-
60
- .boltdocs-content::-webkit-scrollbar {
61
- display: none;
62
- }
63
-
64
- /* ═══ MDX Page - Mobile Text Overflow Prevention ═══ */
65
- .boltdocs-page {
66
- overflow-wrap: break-word;
67
- word-break: break-word;
68
- }
69
-
70
- /* Inline code inside prose shouldn't force horizontal overflow */
71
- .boltdocs-page :not(pre) > code {
72
- word-break: break-all;
73
- }
74
-
75
- .scrollbar-hide {
76
- scrollbar-width: none;
77
- -ms-overflow-style: none;
78
- }
79
-
80
- .scrollbar-hide::-webkit-scrollbar {
81
- display: none;
82
- }
83
-
84
- /* Hide native search cancel button */
85
- input::-webkit-search-cancel-button,
86
- input::-webkit-search-decoration,
87
- input::-webkit-search-results-button,
88
- input::-webkit-search-results-decoration {
89
- display: none;
90
- }
91
-
92
- /* Shiki Styles are defined below */
93
-
94
- /* ═══ Shiki Styles ═══ */
95
-
96
- /* Shiki Light/Dark Mode */
97
- :root .shiki,
98
- :root .shiki span {
99
- font-family: var(--font-mono);
100
- font-size: 12px !important;
101
- background-color: transparent !important;
102
- }
103
-
104
- :root.dark .shiki,
105
- :root.dark .shiki span {
106
- color: var(--shiki-dark) !important;
107
- }
108
-
109
- /* Base Shiki Pre & Span Styles */
110
- pre.shiki {
111
- @apply py-2 text-[12px] leading-[1.6];
112
- overflow-x: auto;
113
- -webkit-overflow-scrolling: touch;
114
- }
115
-
116
- pre.shiki span.line {
117
- @apply relative block px-4 py-0;
118
- min-height: 1.6em;
119
- }
120
-
121
- /* Shiki Word Wrap */
122
- pre.shiki-word-wrap {
123
- @apply whitespace-pre-wrap break-words;
124
- }
125
-
126
- pre.shiki-word-wrap span.line {
127
- @apply block w-full;
128
- }
129
-
130
- /* Shiki Line Numbers */
131
- pre.shiki-line-numbers code {
132
- counter-reset: step;
133
- counter-increment: step 0;
134
- }
135
-
136
- pre.shiki-line-numbers .line {
137
- @apply !pl-12;
138
- }
139
-
140
- /* Hide the last line if it is completely empty to avoid extra numbers or spacing */
141
- pre.shiki .line:last-child:empty,
142
- pre.shiki .line:last-child:has(> :empty),
143
- pre.shiki-line-numbers .line:last-child:empty,
144
- pre.shiki-line-numbers .line:last-child:has(> :empty) {
145
- display: none;
146
- }
147
-
148
- pre.shiki-line-numbers .line::before {
149
- counter-increment: step;
150
- content: counter(step);
151
- @apply absolute left-0 top-0 inline-flex w-10 justify-end pr-3;
152
- @apply text-[11px] text-muted opacity-30 select-none;
153
- line-height: inherit;
154
- /* Sync with line text */
155
- }
156
-
157
- /* Shiki Highlight */
158
- pre span.shiki-line-highlight {
159
- @apply relative z-0 inline-block w-full;
160
-
161
- &::after {
162
- content: "";
163
- @apply absolute top-0 left-0 -z-10 h-full w-full border-l-2 border-primary-500 !bg-primary-500/10 opacity-100;
164
- }
165
- }
166
-
167
- /* Shiki Notation Diff */
168
- pre.has-diff span.line.diff {
169
- @apply relative inline-block w-full;
170
- }
171
-
172
- pre.has-diff span.line.diff.add {
173
- @apply !bg-emerald-500/10 dark:!bg-emerald-500/10;
174
-
175
- &::before {
176
- content: "+";
177
- @apply absolute left-2 text-emerald-500 font-bold;
178
- }
179
- }
180
-
181
- pre.has-diff span.line.diff.remove {
182
- @apply !bg-danger-500/10 opacity-70;
183
-
184
- &::before {
185
- content: "-";
186
- @apply absolute left-2 text-danger-500 font-bold;
187
- }
188
- }
189
- }
@@ -1,116 +0,0 @@
1
- import type * as React from 'react'
2
- export type { BoltdocsConfig } from '../shared/types'
3
-
4
- /**
5
- * Metadata provided by the server for a specific route.
6
- * Maps closely to the `RouteMeta` type in the Node environment.
7
- */
8
- export interface ComponentRoute {
9
- /** The final URL path */
10
- path: string
11
- /** The absolute filesystem path of the source file */
12
- componentPath: string
13
- /** The page title */
14
- title: string
15
- /** Explicit order in the sidebar */
16
- sidebarPosition?: number
17
- /** The relative path from the docs directory */
18
- filePath: string
19
- /** The group directory name */
20
- group?: string
21
- /** The display title of the group */
22
- groupTitle?: string
23
- /** Explicit order of the group in the sidebar */
24
- groupPosition?: number
25
- /** Extracted markdown headings for search indexing */
26
- headings?: { level: number; text: string; id: string }[]
27
- /** The page summary or description */
28
- description?: string
29
- /** The locale this route belongs to, if i18n is configured */
30
- locale?: string
31
- /** The version this route belongs to, if versioning is configured */
32
- version?: string
33
- /** Optional icon to display (Lucide icon name or raw SVG) */
34
- icon?: string
35
- /** The tab this route belongs to, if tabs are configured */
36
- tab?: string
37
- /** Optional badge to display next to the sidebar item */
38
- badge?: string | { text: 'updated' | 'new' | 'deprecated'; expires?: string }
39
- /** Optional icon for the route's group */
40
- groupIcon?: string
41
- /** The sub-route group this route belongs to (from folders starting with _) */
42
- subRouteGroup?: string
43
- /** The nested sub-routes if this route acts as the parent of a subRouteGroup */
44
- subRoutes?: ComponentRoute[]
45
- /** The extracted plain-text content of the page for search indexing */
46
- _content?: string
47
- /** The raw markdown content of the page */
48
- _rawContent?: string
49
- /** The publication date */
50
- date?: string | Date
51
- /** The last updated timestamp or date */
52
- lastUpdated?: string | number | Date
53
- /** Raw extensible frontmatter data for custom components and formatters */
54
- frontmatter?: Record<string, any>
55
- /** Clean URL segments stripped of locale/version prefixes */
56
- slugParts?: string[]
57
- }
58
-
59
- /**
60
- * Site configuration provided by the server.
61
- */
62
- export type SiteConfig = BoltdocsConfig
63
-
64
- /**
65
- * Tab configuration for the documentation site.
66
- */
67
- export interface BoltdocsTab {
68
- id: string
69
- /** Text to display (can be a string or a map of translations) */
70
- text: string | Record<string, string>
71
- icon?: string
72
- }
73
-
74
- /**
75
- * Props for the Sidebar component.
76
- */
77
- export interface SidebarProps {
78
- routes: ComponentRoute[]
79
- config: BoltdocsConfig
80
- }
81
-
82
- /**
83
- * Props for the OnThisPage (TOC) component.
84
- */
85
- export interface OnThisPageProps {
86
- headings?: { level: number; text: string; id: string }[]
87
- editLink?: string
88
- communityHelp?: string
89
- filePath?: string
90
- }
91
-
92
- /**
93
- * Props for the Tabs component.
94
- */
95
- export interface TabsProps {
96
- tabs: BoltdocsTab[]
97
- routes: ComponentRoute[]
98
- }
99
-
100
- /**
101
- * Props for user-defined layout components (layout.tsx).
102
- */
103
- export interface LayoutProps {
104
- children: React.ReactNode
105
- }
106
-
107
- /**
108
- * Unified type for navbar links.
109
- */
110
- export interface NavbarLink {
111
- label: string | Record<string, string>
112
- href: string
113
- active: boolean
114
- to?: string
115
- items?: NavbarLink[]
116
- }
@@ -1,6 +0,0 @@
1
- import { type ClassValue, clsx } from 'clsx'
2
- import { twMerge } from 'tailwind-merge'
3
-
4
- export function cn(...inputs: ClassValue[]) {
5
- return twMerge(clsx(inputs))
6
- }
@@ -1,22 +0,0 @@
1
- /**
2
- * Copy text to clipboard.
3
- * @param text - The text to copy.
4
- * @returns True if the text was copied successfully.
5
- */
6
- export const copyToClipboard = async (text: string) => {
7
- try {
8
- await navigator.clipboard.writeText(text)
9
- return true
10
- } catch {
11
- // Fallback
12
- const textarea = document.createElement('textarea')
13
- textarea.value = text
14
- textarea.style.position = 'fixed'
15
- textarea.style.opacity = '0'
16
- document.body.appendChild(textarea)
17
- textarea.select()
18
- document.execCommand('copy')
19
- document.body.removeChild(textarea)
20
- return true
21
- }
22
- }
@@ -1,21 +0,0 @@
1
- /**
2
- * Get the base file path by removing version and locale prefixes.
3
- * @param filePath - The full file path.
4
- * @param version - The version to remove from the path.
5
- * @param locale - The locale to remove from the path.
6
- * @returns The base file path.
7
- */
8
- export function getBaseFilePath(
9
- filePath: string,
10
- version: string | undefined,
11
- locale: string | undefined,
12
- ): string {
13
- let path = filePath
14
- if (version && (path === version || path.startsWith(version + '/'))) {
15
- path = path === version ? 'index.md' : path.slice(version.length + 1)
16
- }
17
- if (locale && (path === locale || path.startsWith(locale + '/'))) {
18
- path = path === locale ? 'index.md' : path.slice(locale.length + 1)
19
- }
20
- return path
21
- }