idcmd 0.0.12 → 0.0.14
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/package.json
CHANGED
package/src/render/layout.tsx
CHANGED
|
@@ -107,57 +107,6 @@ const Sidebar = ({
|
|
|
107
107
|
</aside>
|
|
108
108
|
);
|
|
109
109
|
|
|
110
|
-
const SearchForm = ({ query }: { query?: string }): JSX.Element => (
|
|
111
|
-
<form
|
|
112
|
-
method="get"
|
|
113
|
-
action="/search/"
|
|
114
|
-
class="flex w-full items-center"
|
|
115
|
-
role="search"
|
|
116
|
-
novalidate
|
|
117
|
-
>
|
|
118
|
-
{/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}
|
|
119
|
-
<label for="site-search" class="sr-only">
|
|
120
|
-
Search pages
|
|
121
|
-
</label>
|
|
122
|
-
<input
|
|
123
|
-
id="site-search"
|
|
124
|
-
name="q"
|
|
125
|
-
type="search"
|
|
126
|
-
autocomplete="off"
|
|
127
|
-
spellcheck={false}
|
|
128
|
-
placeholder="Search..."
|
|
129
|
-
value={escapeText(query ?? "")}
|
|
130
|
-
class="w-full border-b border-input bg-transparent px-1 py-1.5 text-sm placeholder:text-muted-foreground focus:border-foreground focus:outline-none transition-colors"
|
|
131
|
-
/>
|
|
132
|
-
</form>
|
|
133
|
-
);
|
|
134
|
-
|
|
135
|
-
const TopNavbar = ({
|
|
136
|
-
query,
|
|
137
|
-
siteName,
|
|
138
|
-
}: {
|
|
139
|
-
query?: string;
|
|
140
|
-
siteName: string;
|
|
141
|
-
}): JSX.Element => (
|
|
142
|
-
<header class="sticky top-0 z-30 border-b border-border bg-background/80 backdrop-blur-sm">
|
|
143
|
-
<div class="mx-auto max-w-6xl px-8 py-3">
|
|
144
|
-
<div class="flex items-center gap-4">
|
|
145
|
-
<a
|
|
146
|
-
href="/"
|
|
147
|
-
class="text-sm font-medium tracking-tight font-mono lg:hidden"
|
|
148
|
-
data-prefetch="hover"
|
|
149
|
-
>
|
|
150
|
-
<span class="text-muted-foreground">~/</span>
|
|
151
|
-
{escapeText(siteName)}
|
|
152
|
-
</a>
|
|
153
|
-
<div class="not-prose w-full max-w-xs ml-auto">
|
|
154
|
-
<SearchForm query={query} />
|
|
155
|
-
</div>
|
|
156
|
-
</div>
|
|
157
|
-
</div>
|
|
158
|
-
</header>
|
|
159
|
-
);
|
|
160
|
-
|
|
161
110
|
interface DocumentHeadProps {
|
|
162
111
|
canonicalUrl?: string;
|
|
163
112
|
description?: string;
|
|
@@ -226,7 +175,6 @@ interface DocumentBodyProps {
|
|
|
226
175
|
rightRail: ResolvedRightRailConfig;
|
|
227
176
|
scriptPaths: string[];
|
|
228
177
|
scrollSpyDataset: ScrollSpyDataset;
|
|
229
|
-
searchQuery?: string;
|
|
230
178
|
shouldShowRightRail: boolean;
|
|
231
179
|
siteName: string;
|
|
232
180
|
tocItems: TocItem[];
|
|
@@ -241,7 +189,6 @@ const DocumentBody = ({
|
|
|
241
189
|
rightRail,
|
|
242
190
|
scriptPaths,
|
|
243
191
|
scrollSpyDataset,
|
|
244
|
-
searchQuery,
|
|
245
192
|
shouldShowRightRail,
|
|
246
193
|
siteName,
|
|
247
194
|
tocItems,
|
|
@@ -259,7 +206,6 @@ const DocumentBody = ({
|
|
|
259
206
|
currentPath={currentPath}
|
|
260
207
|
/>
|
|
261
208
|
<div class="main-wrapper">
|
|
262
|
-
<TopNavbar query={searchQuery} siteName={siteName} />
|
|
263
209
|
<main class="main-content">
|
|
264
210
|
<div class="mx-auto flex w-full max-w-6xl items-start gap-10">
|
|
265
211
|
<article
|
|
@@ -300,7 +246,6 @@ const Layout = ({
|
|
|
300
246
|
currentPath,
|
|
301
247
|
navigation,
|
|
302
248
|
scriptPaths = [],
|
|
303
|
-
searchQuery,
|
|
304
249
|
showRightRail = true,
|
|
305
250
|
rightRailComponent = RightRail,
|
|
306
251
|
rightRail,
|
|
@@ -330,7 +275,6 @@ const Layout = ({
|
|
|
330
275
|
rightRail={rightRail}
|
|
331
276
|
scriptPaths={scriptPaths}
|
|
332
277
|
scrollSpyDataset={scrollSpyDataset}
|
|
333
|
-
searchQuery={searchQuery}
|
|
334
278
|
shouldShowRightRail={shouldShowRightRail}
|
|
335
279
|
siteName={siteName}
|
|
336
280
|
tocItems={tocItems}
|
|
@@ -215,8 +215,8 @@ const getPanelClass = (
|
|
|
215
215
|
placement: ResolvedRightRailConfig["placement"]
|
|
216
216
|
): string =>
|
|
217
217
|
placement === "viewport"
|
|
218
|
-
? "fixed top-
|
|
219
|
-
: "sticky top-
|
|
218
|
+
? "fixed top-8 bottom-0 right-8 z-20 w-64 flex flex-col gap-6 min-h-0"
|
|
219
|
+
: "sticky top-8 h-[calc(100vh-2rem)] flex flex-col gap-6 min-h-0";
|
|
220
220
|
|
|
221
221
|
export interface RightRailProps {
|
|
222
222
|
canonicalUrl?: string;
|
|
@@ -64,57 +64,6 @@ const Sidebar = ({
|
|
|
64
64
|
</aside>
|
|
65
65
|
);
|
|
66
66
|
|
|
67
|
-
const SearchForm = ({ query }: { query?: string }): JSX.Element => (
|
|
68
|
-
<form
|
|
69
|
-
method="get"
|
|
70
|
-
action="/search/"
|
|
71
|
-
class="flex w-full items-center"
|
|
72
|
-
role="search"
|
|
73
|
-
novalidate
|
|
74
|
-
>
|
|
75
|
-
{/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}
|
|
76
|
-
<label for="site-search" class="sr-only">
|
|
77
|
-
Search pages
|
|
78
|
-
</label>
|
|
79
|
-
<input
|
|
80
|
-
id="site-search"
|
|
81
|
-
name="q"
|
|
82
|
-
type="search"
|
|
83
|
-
autocomplete="off"
|
|
84
|
-
spellcheck={false}
|
|
85
|
-
placeholder="Search..."
|
|
86
|
-
value={escapeText(query ?? "")}
|
|
87
|
-
class="w-full border-b border-input bg-transparent px-1 py-1.5 text-sm placeholder:text-muted-foreground focus:border-foreground focus:outline-none transition-colors"
|
|
88
|
-
/>
|
|
89
|
-
</form>
|
|
90
|
-
);
|
|
91
|
-
|
|
92
|
-
const TopNavbar = ({
|
|
93
|
-
query,
|
|
94
|
-
siteName,
|
|
95
|
-
}: {
|
|
96
|
-
query?: LayoutProps["searchQuery"];
|
|
97
|
-
siteName: LayoutProps["siteName"];
|
|
98
|
-
}): JSX.Element => (
|
|
99
|
-
<header class="sticky top-0 z-30 border-b border-border bg-background/80 backdrop-blur-sm">
|
|
100
|
-
<div class="mx-auto max-w-6xl px-8 py-3">
|
|
101
|
-
<div class="flex items-center gap-4">
|
|
102
|
-
<a
|
|
103
|
-
href="/"
|
|
104
|
-
class="text-sm font-mono font-medium tracking-tight lg:hidden"
|
|
105
|
-
data-prefetch="hover"
|
|
106
|
-
>
|
|
107
|
-
<span class="text-muted-foreground">~/</span>
|
|
108
|
-
{escapeText(siteName)}
|
|
109
|
-
</a>
|
|
110
|
-
<div class="not-prose ml-auto w-full max-w-xs">
|
|
111
|
-
<SearchForm query={query} />
|
|
112
|
-
</div>
|
|
113
|
-
</div>
|
|
114
|
-
</div>
|
|
115
|
-
</header>
|
|
116
|
-
);
|
|
117
|
-
|
|
118
67
|
const buildHtmlClass = (
|
|
119
68
|
smoothScroll: LayoutProps["rightRail"]["smoothScroll"]
|
|
120
69
|
): string => (smoothScroll ? "dark smooth-scroll" : "dark");
|
|
@@ -148,7 +97,6 @@ const Layout = ({
|
|
|
148
97
|
currentPath,
|
|
149
98
|
navigation,
|
|
150
99
|
scriptPaths = [],
|
|
151
|
-
searchQuery,
|
|
152
100
|
showRightRail = true,
|
|
153
101
|
rightRail,
|
|
154
102
|
tocItems,
|
|
@@ -200,7 +148,6 @@ const Layout = ({
|
|
|
200
148
|
currentPath={currentPath}
|
|
201
149
|
/>
|
|
202
150
|
<div class="main-wrapper">
|
|
203
|
-
<TopNavbar query={searchQuery} siteName={siteName} />
|
|
204
151
|
<main class="main-content">
|
|
205
152
|
<div class="mx-auto flex w-full max-w-6xl items-start gap-10">
|
|
206
153
|
<article
|
|
@@ -218,8 +218,8 @@ const getPanelClass = (
|
|
|
218
218
|
placement: RightRailProps["rightRailConfig"]["placement"]
|
|
219
219
|
): string =>
|
|
220
220
|
placement === "viewport"
|
|
221
|
-
? "fixed top-
|
|
222
|
-
: "sticky top-
|
|
221
|
+
? "fixed top-8 bottom-0 right-8 z-20 w-64 flex flex-col gap-6 min-h-0"
|
|
222
|
+
: "sticky top-8 h-[calc(100vh-2rem)] flex flex-col gap-6 min-h-0";
|
|
223
223
|
|
|
224
224
|
export const RightRail = ({
|
|
225
225
|
canonicalUrl,
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
}
|
|
123
123
|
html,
|
|
124
124
|
body {
|
|
125
|
-
/*
|
|
125
|
+
/* Keep vertical overscroll behavior predictable across browsers. */
|
|
126
126
|
overscroll-behavior-y: none;
|
|
127
127
|
}
|
|
128
128
|
body {
|
|
@@ -134,15 +134,6 @@ html.smooth-scroll {
|
|
|
134
134
|
scroll-behavior: smooth;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
/*
|
|
138
|
-
Sticky + backdrop-filter can jitter on fast scroll in some browsers.
|
|
139
|
-
Forcing the header into its own composited layer tends to reduce jumping.
|
|
140
|
-
*/
|
|
141
|
-
header {
|
|
142
|
-
transform: translateZ(0);
|
|
143
|
-
will-change: transform;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
137
|
/* ============================================
|
|
147
138
|
LAYOUT - Sidebar and main content structure
|
|
148
139
|
============================================ */
|