@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 CHANGED
@@ -35,7 +35,7 @@ export const exportCommand = new Command('export')
35
35
  const link = removeLeadingSlash(item.link);
36
36
  pages.push({
37
37
  key: link,
38
- path: config.base + link + '.html?print=true',
38
+ path: config.base + link + '.html?print',
39
39
  title: item.text,
40
40
  });
41
41
  }
@@ -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 && !['0', 'false'].includes(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
- return (_jsx("div", { className: "doom-tabs", children: _jsx(Tabs_, { ...props, ref: ref, children: children }) }));
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 isPrint = searchParams.get('print') === 'true';
7
- return isPrint;
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') {
@@ -1 +1,2 @@
1
1
  export declare const ACP_BASE = "/container_platform/";
2
+ export declare const FALSY_VALUES: Set<string>;
@@ -1 +1,2 @@
1
1
  export const ACP_BASE = '/container_platform/';
2
+ export const FALSY_VALUES = new Set(['0', 'false', 'no', 'off', 'n', 'f']);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alauda/doom",
3
- "version": "0.17.1",
3
+ "version": "0.17.2",
4
4
  "type": "module",
5
5
  "description": "Doctor Doom making docs.",
6
6
  "repository": "https://gitlab-ce.alauda.cn/idp/Doom.git",
@@ -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
- }