@alauda/doom 0.17.1 → 0.17.2
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/lib/cli/export.js +1 -1
- package/lib/cli/helpers.js +2 -2
- package/lib/runtime/components/Tabs.js +4 -2
- package/lib/runtime/components/index.d.ts +0 -1
- package/lib/runtime/components/index.js +0 -1
- package/lib/runtime/hooks/useIsPrint.js +3 -2
- package/lib/shared/constants.d.ts +1 -0
- package/lib/shared/constants.js +1 -0
- package/package.json +1 -1
- package/styles/quick-nav.module.scss +0 -59
package/lib/cli/export.js
CHANGED
package/lib/cli/helpers.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import { glob } from 'tinyglobby';
|
|
3
|
-
import { isDoc } from '../shared/index.js';
|
|
4
|
-
export const parseBoolean = (value) => !!value && !
|
|
3
|
+
import { FALSY_VALUES, isDoc } from '../shared/index.js';
|
|
4
|
+
export const parseBoolean = (value) => !!value && !FALSY_VALUES.has(value);
|
|
5
5
|
export const getMatchedDocFilePaths = (matched) => Promise.all(matched.map(async (it) => {
|
|
6
6
|
const stat = await fs.stat(it);
|
|
7
7
|
if (stat.isDirectory()) {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Tabs as Tabs_ } from '@rspress/core/theme';
|
|
3
|
-
import { forwardRef, } from 'react';
|
|
3
|
+
import { Children, forwardRef, } from 'react';
|
|
4
|
+
import { useIsPrint } from '../hooks/index.js';
|
|
4
5
|
export const Tabs = forwardRef(({ children, ...props }, ref) => {
|
|
5
|
-
|
|
6
|
+
const isPrint = useIsPrint();
|
|
7
|
+
return (_jsx("div", { className: "doom-tabs", ref: ref, children: isPrint ? (Children.map(children, (child, index) => (_jsx(Tabs_, { ...props, children: child }, index)))) : (_jsx(Tabs_, { ...props, children: children })) }));
|
|
6
8
|
});
|
|
7
9
|
export default Tabs;
|
|
@@ -15,7 +15,6 @@ export * from './OpenAPIPath.js';
|
|
|
15
15
|
export * from './OpenAPIRef.js';
|
|
16
16
|
export * from './Overview.js';
|
|
17
17
|
export * from './PackageManagerTabs.js';
|
|
18
|
-
export * from './QuickNav.js';
|
|
19
18
|
export * from './Steps.js';
|
|
20
19
|
export * from './Tab.js';
|
|
21
20
|
export * from './Tabs.js';
|
|
@@ -15,7 +15,6 @@ export * from './OpenAPIPath.js';
|
|
|
15
15
|
export * from './OpenAPIRef.js';
|
|
16
16
|
export * from './Overview.js';
|
|
17
17
|
export * from './PackageManagerTabs.js';
|
|
18
|
-
export * from './QuickNav.js';
|
|
19
18
|
export * from './Steps.js';
|
|
20
19
|
export * from './Tab.js';
|
|
21
20
|
export * from './Tabs.js';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { useState, useEffect, useMemo, useCallback } from 'react';
|
|
2
2
|
import { useLocation } from 'react-router';
|
|
3
|
+
import { FALSY_VALUES } from '../../shared/index.js';
|
|
3
4
|
export function useIsPrintQuery() {
|
|
4
5
|
const { search } = useLocation();
|
|
5
6
|
const searchParams = useMemo(() => new URLSearchParams(search), [search]);
|
|
6
|
-
const
|
|
7
|
-
return
|
|
7
|
+
const print = searchParams.get('print');
|
|
8
|
+
return print != null && !FALSY_VALUES.has(print);
|
|
8
9
|
}
|
|
9
10
|
const getPrintMediaQuery = () => {
|
|
10
11
|
if (typeof document === 'undefined') {
|
package/lib/shared/constants.js
CHANGED
package/package.json
CHANGED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
background-color: var(--rp-c-bg-soft);
|
|
3
|
-
padding: 12px;
|
|
4
|
-
margin: 32px 0;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.item {
|
|
8
|
-
background-color: var(--rp-c-bg);
|
|
9
|
-
padding: 32px;
|
|
10
|
-
display: flex;
|
|
11
|
-
align-items: center;
|
|
12
|
-
|
|
13
|
-
+ .item {
|
|
14
|
-
margin-top: 12px;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.title {
|
|
19
|
-
display: inline-flex;
|
|
20
|
-
align-items: center;
|
|
21
|
-
gap: 12px;
|
|
22
|
-
font-weight: bold;
|
|
23
|
-
width: 150px;
|
|
24
|
-
|
|
25
|
-
img {
|
|
26
|
-
width: 32px;
|
|
27
|
-
height: 32px;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.divider {
|
|
32
|
-
width: 1px;
|
|
33
|
-
height: inherit;
|
|
34
|
-
align-self: stretch;
|
|
35
|
-
border: 0;
|
|
36
|
-
background-color: var(--rp-c-divider);
|
|
37
|
-
margin: 0 40px;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.links {
|
|
41
|
-
display: flex;
|
|
42
|
-
flex: 1;
|
|
43
|
-
flex-wrap: wrap;
|
|
44
|
-
overflow: hidden;
|
|
45
|
-
|
|
46
|
-
li {
|
|
47
|
-
width: 50%;
|
|
48
|
-
display: flex;
|
|
49
|
-
padding-right: 20px;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
a {
|
|
53
|
-
overflow: hidden;
|
|
54
|
-
text-overflow: ellipsis;
|
|
55
|
-
white-space: nowrap;
|
|
56
|
-
color: var(--rp-c-link);
|
|
57
|
-
font-size: 14px;
|
|
58
|
-
}
|
|
59
|
-
}
|