@seqera/docusaurus-theme-seqera 1.0.25 → 1.0.26

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.
@@ -0,0 +1,325 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ .searchQueryInput,
9
+ .searchVersionInput {
10
+ border-radius: 0.5rem;
11
+ border: 1px solid #d1d5db;
12
+ font-size: 0.875rem;
13
+ height: 2.25rem;
14
+ padding: 0 0.75rem;
15
+ width: 100%;
16
+ background: white;
17
+ color: #111827;
18
+ margin-bottom: 0.5rem;
19
+ transition: border-color 0.15s;
20
+ }
21
+
22
+ .searchQueryInput:focus,
23
+ .searchVersionInput:focus {
24
+ border-color: #6b7280;
25
+ outline: none;
26
+ }
27
+
28
+ .searchQueryInput::placeholder {
29
+ color: #6b7280;
30
+ }
31
+
32
+ [data-theme='dark'] .searchQueryInput,
33
+ [data-theme='dark'] .searchVersionInput {
34
+ background: #111827;
35
+ border-color: #374151;
36
+ color: white;
37
+ }
38
+
39
+ [data-theme='dark'] .searchQueryInput:focus,
40
+ [data-theme='dark'] .searchVersionInput:focus {
41
+ border-color: #4b5563;
42
+ }
43
+
44
+ [data-theme='dark'] .searchQueryInput::placeholder {
45
+ color: #6b7280;
46
+ }
47
+
48
+ .searchInputRow {
49
+ display: flex;
50
+ gap: 0.5rem;
51
+ align-items: center;
52
+ flex-wrap: wrap;
53
+ }
54
+
55
+ .searchInputRow .searchQueryInput {
56
+ flex: 1;
57
+ margin-bottom: 0;
58
+ }
59
+
60
+ /* At narrow widths the input takes the full first row;
61
+ the filter and search button drop together to the next row */
62
+ @media (max-width: 640px) {
63
+ .searchInputRow .searchQueryInput {
64
+ flex: 0 0 100%;
65
+ }
66
+ }
67
+
68
+ .searchQueryButton {
69
+ border-radius: 4px;
70
+ transition: all 0.3s;
71
+ color: black;
72
+ background: var(--color-nextflow-500);
73
+ border: 1px solid var(--color-nextflow-700);
74
+ font-weight: 500;
75
+ font-size: 0.9rem;
76
+ text-align: center;
77
+ padding: 0.3rem 1rem;
78
+ cursor: pointer;
79
+ white-space: nowrap;
80
+ }
81
+
82
+ .searchQueryButton:hover {
83
+ background: var(--color-nextflow-700);
84
+ border-color: var(--color-nextflow-700);
85
+ }
86
+
87
+ [data-theme='dark'] .searchQueryButton {
88
+ color: black;
89
+ background: var(--color-nextflow-400);
90
+ border: 1px solid var(--color-nextflow-400);
91
+ }
92
+
93
+ [data-theme='dark'] .searchQueryButton:hover {
94
+ background: var(--color-nextflow-600);
95
+ border-color: var(--color-nextflow-700);
96
+ }
97
+
98
+ .filterSelectWrapper {
99
+ position: relative;
100
+ width: 16.25rem;
101
+ }
102
+
103
+ /* Matches VersionSwitcher: rounded-lg border border-gray-300 overflow-hidden bg-white */
104
+ .filterBox {
105
+ border-radius: 0.5rem;
106
+ border: 1px solid #d1d5db;
107
+ overflow: hidden;
108
+ background: white;
109
+ }
110
+
111
+ /* Matches VersionSwitcher: rounded-b-none when open */
112
+ .filterBoxOpen {
113
+ border-bottom-left-radius: 0;
114
+ border-bottom-right-radius: 0;
115
+ }
116
+
117
+ /* Matches VersionSwitcher trigger: h-9 px-3 text-sm text-gray-900 bg-transparent hover:bg-gray-100 */
118
+ .filterTrigger {
119
+ display: flex;
120
+ align-items: center;
121
+ justify-content: space-between;
122
+ gap: 0.5rem;
123
+ height: 2.25rem;
124
+ width: 100%;
125
+ padding: 0 0.75rem;
126
+ background: transparent;
127
+ border: none;
128
+ color: #111827;
129
+ font-size: 0.875rem;
130
+ text-align: left;
131
+ cursor: pointer;
132
+ white-space: nowrap;
133
+ transition: background 0.15s;
134
+ }
135
+
136
+ .filterTrigger:hover {
137
+ background: #f3f4f6;
138
+ }
139
+
140
+ .filterTrigger:focus {
141
+ outline: none;
142
+ }
143
+
144
+ .filterTriggerChevron {
145
+ display: block;
146
+ width: 1.25rem;
147
+ height: 1.25rem;
148
+ flex-shrink: 0;
149
+ transition: transform 0.2s;
150
+ }
151
+
152
+ .filterTriggerChevronOpen {
153
+ transform: rotate(0deg);
154
+ }
155
+
156
+ .filterTriggerChevronClosed {
157
+ transform: rotate(-90deg);
158
+ }
159
+
160
+ /* Matches VersionSwitcher dropdown: bg-white border-gray-300 border-t-gray-200 rounded-b-lg */
161
+ .filterDropdown {
162
+ position: absolute;
163
+ top: 100%;
164
+ left: 0;
165
+ min-width: 100%;
166
+ margin: -1px 0 0;
167
+ padding: 0;
168
+ list-style: none;
169
+ background: white;
170
+ border: 1px solid #d1d5db;
171
+ border-top-color: #e5e7eb;
172
+ border-bottom-left-radius: 0.5rem;
173
+ border-bottom-right-radius: 0.5rem;
174
+ overflow: hidden;
175
+ z-index: 50;
176
+ }
177
+
178
+ /* Matches VersionSwitcher items: h-9 px-3 text-sm text-gray-900 border-t border-gray-200 hover:bg-gray-100 */
179
+ .filterOption {
180
+ display: flex;
181
+ align-items: center;
182
+ justify-content: space-between;
183
+ height: 2.25rem;
184
+ padding: 0 0.75rem;
185
+ font-size: 0.875rem;
186
+ color: #111827;
187
+ cursor: pointer;
188
+ white-space: nowrap;
189
+ user-select: none;
190
+ border-top: 1px solid #e5e7eb;
191
+ transition: background 0.15s;
192
+ }
193
+
194
+ .filterOption:first-child {
195
+ border-top: none;
196
+ }
197
+
198
+ .filterOption:hover {
199
+ background: #f3f4f6;
200
+ }
201
+
202
+ .filterOptionActive {
203
+ color: var(--ifm-color-primary);
204
+ }
205
+
206
+ .filterExpandChevron {
207
+ display: block;
208
+ width: 1.25rem;
209
+ height: 1.25rem;
210
+ margin-left: 0.5rem;
211
+ flex-shrink: 0;
212
+ transition: transform 0.2s;
213
+ }
214
+
215
+ .filterSubOption {
216
+ padding-left: 1.5rem;
217
+ }
218
+
219
+ /* Dark mode — matches VersionSwitcher: dark:bg-gray-900 dark:border-gray-700 dark:text-white dark:hover:bg-gray-800 */
220
+ [data-theme='dark'] .filterBox {
221
+ background: #111827;
222
+ border-color: #374151;
223
+ }
224
+
225
+ [data-theme='dark'] .filterTrigger {
226
+ color: white;
227
+ }
228
+
229
+ [data-theme='dark'] .filterTrigger:hover {
230
+ background: #1f2937;
231
+ }
232
+
233
+ [data-theme='dark'] .filterDropdown {
234
+ background: #111827;
235
+ border-color: #374151;
236
+ border-top-color: #4b5563;
237
+ }
238
+
239
+ [data-theme='dark'] .filterOption {
240
+ color: white;
241
+ border-top-color: #374151;
242
+ }
243
+
244
+ [data-theme='dark'] .filterOption:hover {
245
+ background: #1f2937;
246
+ }
247
+
248
+ .searchResultsColumn {
249
+ font-size: 0.9rem;
250
+ font-weight: bold;
251
+ }
252
+
253
+ .algoliaLogo {
254
+ max-width: 150px;
255
+ }
256
+
257
+ .algoliaLogoPathFill {
258
+ fill: var(--ifm-font-color-base);
259
+ }
260
+
261
+ .searchResultItem {
262
+ padding: 1rem 0;
263
+ border-bottom: 1px solid var(--ifm-toc-border-color);
264
+ }
265
+
266
+ .searchResultItemHeading {
267
+ font-weight: 400;
268
+ margin-bottom: 0;
269
+ }
270
+
271
+ .searchResultItemPath {
272
+ font-size: 0.8rem;
273
+ color: var(--ifm-font-color-base);
274
+ --ifm-breadcrumb-separator-size-multiplier: 1;
275
+ }
276
+
277
+ .searchResultItemPath :global(.breadcrumbs__item:not(:last-child))::after {
278
+ margin: 0 0.1875rem;
279
+ }
280
+
281
+ .searchResultItemSummary {
282
+ margin: 0.5rem 0 0;
283
+ font-style: italic;
284
+ }
285
+
286
+ @media only screen and (max-width: 996px) {
287
+ .searchResultsColumn {
288
+ max-width: 60% !important;
289
+ }
290
+
291
+ .searchLogoColumn {
292
+ max-width: 40% !important;
293
+ padding-left: 0 !important;
294
+ }
295
+ }
296
+
297
+ .loadingSpinner {
298
+ width: 3rem;
299
+ height: 3rem;
300
+ border: 0.4em solid #eee;
301
+ border-top-color: var(--ifm-color-primary);
302
+ border-radius: 50%;
303
+ animation: loading-spin 1s linear infinite;
304
+ margin: 2rem auto 0;
305
+ }
306
+
307
+ @keyframes loading-spin {
308
+ 100% {
309
+ transform: rotate(360deg);
310
+ }
311
+ }
312
+
313
+ .loader {
314
+ margin-top: 6rem;
315
+ }
316
+
317
+ :global(.search-page-wrapper .theme-layout-main) {
318
+ width: 100%;
319
+ }
320
+
321
+ :global(.search-result-match) {
322
+ color: var(--docsearch-hit-color);
323
+ background: rgb(255 215 142 / 25%);
324
+ padding: 0.09em 0;
325
+ }
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Copyright (c) Facebook, Inc. and its affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ // Source: https://github.com/facebook/docusaurus/blob/a308fb7c81832cca354192fe2984f52749441249/packages/docusaurus-theme-common/src/hooks/useSearchPage.ts
8
+ // Context: https://github.com/typesense/docusaurus-theme-search-typesense/issues/27#issuecomment-1415757477
9
+ import {useState, useEffect, useCallback} from 'react';
10
+ import {useHistory} from '@docusaurus/router';
11
+ import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
12
+
13
+ const SEARCH_PARAM_QUERY = 'q';
14
+ const SEARCH_PARAM_FILTER = 'filter';
15
+
16
+ export function useSearchPage() {
17
+ const history = useHistory();
18
+ const {
19
+ siteConfig: {baseUrl},
20
+ } = useDocusaurusContext();
21
+ const [searchQuery, setSearchQueryState] = useState('');
22
+ const [selectedFilter, setSelectedFilterState] = useState('');
23
+
24
+ // Init search query and filter just after React hydration
25
+ useEffect(() => {
26
+ const params = new URLSearchParams(window.location.search);
27
+ setSearchQueryState(params.get(SEARCH_PARAM_QUERY) ?? '');
28
+ setSelectedFilterState(params.get(SEARCH_PARAM_FILTER) ?? '');
29
+ }, []);
30
+
31
+ const setSearchQuery = useCallback(
32
+ (newSearchQuery: string) => {
33
+ const searchParams = new URLSearchParams(window.location.search);
34
+ if (newSearchQuery) {
35
+ searchParams.set(SEARCH_PARAM_QUERY, newSearchQuery);
36
+ } else {
37
+ searchParams.delete(SEARCH_PARAM_QUERY);
38
+ }
39
+ history.replace({search: searchParams.toString()});
40
+ setSearchQueryState(newSearchQuery);
41
+ },
42
+ [history],
43
+ );
44
+
45
+ const setSelectedFilter = useCallback(
46
+ (newFilter: string) => {
47
+ const searchParams = new URLSearchParams(window.location.search);
48
+ if (newFilter) {
49
+ searchParams.set(SEARCH_PARAM_FILTER, newFilter);
50
+ } else {
51
+ searchParams.delete(SEARCH_PARAM_FILTER);
52
+ }
53
+ history.replace({search: searchParams.toString()});
54
+ setSelectedFilterState(newFilter);
55
+ },
56
+ [history],
57
+ );
58
+
59
+ const generateSearchPageLink = useCallback(
60
+ (targetSearchQuery: string) =>
61
+ // Refer to https://github.com/facebook/docusaurus/pull/2838
62
+ `${baseUrl}search?${SEARCH_PARAM_QUERY}=${encodeURIComponent(targetSearchQuery)}`,
63
+ [baseUrl],
64
+ );
65
+
66
+ return {searchQuery, setSearchQuery, selectedFilter, setSelectedFilter, generateSearchPageLink};
67
+ }
@@ -26,6 +26,9 @@ declare module '@seqera/docusaurus-theme-seqera' {
26
26
  customCss?: string[] | string;
27
27
  };
28
28
 
29
+ // [urlPrefix, label, pluginId | null, customTag | null]
30
+ export type ProductRoute = [string, string, string | null, string | null];
31
+
29
32
  export const getSwizzleConfig: PluginModule['getSwizzleConfig'];
30
33
 
31
34
  type DeepOverwrite<T, U> = U extends (infer V)[]
@@ -1 +0,0 @@
1
- export { default } from '@docusaurus/Noop';
@@ -1,5 +0,0 @@
1
- // By default, the classic theme does not provide any SearchBar implementation
2
- // If you swizzled this, it is your responsibility to provide an implementation
3
- // Tip: swizzle the SearchBar from the Algolia theme for inspiration:
4
- // npm run swizzle @docusaurus/theme-search-algolia SearchBar
5
- export {default} from '@docusaurus/Noop';
@@ -1,8 +0,0 @@
1
-
2
-
3
- // By default, the classic theme does not provide any SearchBar implementation
4
- // If you swizzled this, it is your responsibility to provide an implementation
5
- // Tip: swizzle the SearchBar from the Algolia theme for inspiration:
6
- // npm run swizzle @docusaurus/theme-search-algolia SearchBar
7
-
8
- export {default} from '@docusaurus/Noop';