@alauda/doom 1.16.0 → 1.16.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.
@@ -19,5 +19,5 @@ export declare const parseTerms: () => Promise<{
19
19
  zh?: string[];
20
20
  ru?: string[];
21
21
  } | undefined;
22
- name?: "company" | "product" | "productShort" | undefined;
22
+ name?: "company" | "product" | "productShort" | "alaudaCloudLink" | undefined;
23
23
  }[]>;
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { NoSSR, useSearchParams } from '@rspress/core/runtime';
2
+ import { NoSSR, useDark, useSearchParams } from '@rspress/core/runtime';
3
3
  import { useCallback } from 'react';
4
4
  import { useNavigate } from 'react-router-dom';
5
5
  import { X } from "../runtime/components/_X.js";
@@ -16,10 +16,10 @@ const Login = () => {
16
16
  const onLoggedIn = useCallback(() => {
17
17
  navigate(from || '/');
18
18
  }, [from, navigate]);
19
+ const dark = useDark();
19
20
  const t = useTranslation();
20
21
  return (_jsx("div", { className: classes.container, style: {
21
- '--login-bg': `url(${bg})`,
22
- '--login-bg-dark': `url(${darkBg})`,
22
+ backgroundImage: `url(${dark ? darkBg : bg})`,
23
23
  }, children: _jsxs("div", { className: classes.loginForm, children: [_jsx("div", { className: classes.title, children: t('user_login') }), _jsxs("div", { className: classes.content, children: [t('user_login_tip1'), _jsx(X.a, { href: getCloudOrigin(), children: t(`customer_portal_${isIoSite() ? 'global' : 'china'}`) }), t('user_login_tip2')] }), _jsx(LoginForm, { onLoggedIn: onLoggedIn })] }) }));
24
24
  };
25
25
  export default () => (_jsx(NoSSR, { children: _jsx(Login, {}) }));
@@ -1,3 +1,4 @@
1
- export declare const Markdown: ({ children }: {
1
+ export declare const Markdown: ({ children, inline, }: {
2
2
  children?: string;
3
+ inline?: boolean;
3
4
  }) => "" | import("react/jsx-runtime").JSX.Element | undefined;
@@ -7,4 +7,14 @@ import remarkGfm from 'remark-gfm';
7
7
  import { X } from './_X.js';
8
8
  const remarkPlugins = [remarkGfm];
9
9
  const rehypePlugins = [rehypeRaw, rehypeSanitize];
10
- export const Markdown = ({ children }) => children && (_jsx(ReactMarkdown, { remarkPlugins: remarkPlugins, rehypePlugins: rehypePlugins, components: X, children: children }));
10
+ const rehypeUnwrap = () => (tree) => {
11
+ if (tree.children.length !== 1) {
12
+ return;
13
+ }
14
+ const child = tree.children[0];
15
+ if (child.type === 'element' && child.tagName === 'p') {
16
+ tree.children = child.children;
17
+ }
18
+ };
19
+ const inlineRehypePlugins = [rehypeRaw, rehypeUnwrap, rehypeSanitize];
20
+ export const Markdown = ({ children, inline, }) => children && (_jsx(ReactMarkdown, { remarkPlugins: remarkPlugins, rehypePlugins: inline ? inlineRehypePlugins : rehypePlugins, components: X, children: children }));
@@ -125,7 +125,11 @@ export const OpenAPIPath = ({ path, openapiPath: openapiPath_, pathPrefix: pathP
125
125
  const requestBodyRef = requestBody &&
126
126
  ('$ref' in requestBody
127
127
  ? requestBody.$ref
128
- : requestBody.content['application/json'].schema?.$ref);
128
+ : /* eslint-disable @typescript-eslint/no-unnecessary-condition */
129
+ (requestBody.content['application/json'] ||
130
+ requestBody.content['application/json-patch+json'] ||
131
+ requestBody.content['*/*'])?.schema?.$ref);
132
+ /* eslint-enable @typescript-eslint/no-unnecessary-condition */
129
133
  const requestBodySchema = requestBodyRef
130
134
  ? resolveRef(openapi, requestBodyRef)
131
135
  : undefined;
@@ -3,5 +3,5 @@ export interface TermProps {
3
3
  name: TermName;
4
4
  textCase?: 'lower' | 'upper' | 'capitalize';
5
5
  }
6
- export declare const Term: ({ name, textCase }: TermProps) => string;
6
+ export declare const Term: ({ name, textCase }: TermProps) => import("react/jsx-runtime").JSX.Element;
7
7
  export default Term;
@@ -1,7 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import { capitalize } from 'es-toolkit';
2
3
  import { useMemo } from 'react';
3
4
  import { useSiteOverrides } from '../hooks/index.js';
4
5
  import { handleCJKWhitespaces } from '../utils.js';
6
+ import { Markdown } from './Markdown.js';
5
7
  export const Term = ({ name, textCase }) => {
6
8
  const { terms } = useSiteOverrides();
7
9
  const text = useMemo(() => {
@@ -24,6 +26,6 @@ export const Term = ({ name, textCase }) => {
24
26
  }
25
27
  }
26
28
  }, [terms, name, textCase]);
27
- return text;
29
+ return _jsx(Markdown, { inline: true, children: text });
28
30
  };
29
31
  export default Term;
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { namedTermItems } from '../../terms.js';
3
3
  import { useTranslation } from '../hooks/index.js';
4
+ import { Markdown } from './Markdown.js';
4
5
  import { X } from './_X.js';
5
6
  export const TermsTable = ({ terms }) => {
6
7
  const t = useTranslation();
@@ -8,7 +9,7 @@ export const TermsTable = ({ terms }) => {
8
9
  const withName = normalized.some(({ name }) => name);
9
10
  const renderBadCases = (list) => list?.length ? (_jsx(X.ul, { children: list.map((item, index) => (
10
11
  // eslint-disable-next-line @eslint-react/no-array-index-key
11
- _jsx(X.li, { children: item }, index))) })) : ('-');
12
- return (_jsxs(X.table, { children: [_jsx("thead", { children: _jsxs(X.tr, { children: [withName && _jsx(X.th, { children: t('name') }), _jsx(X.th, { children: t('chinese') }), _jsx(X.th, { children: t('chinese_bad_cases') }), _jsx(X.th, { children: t('english') }), _jsx(X.th, { children: t('english_bad_cases') }), _jsx(X.th, { children: t('description') })] }) }), _jsx("tbody", { children: normalized.map((term, index) => (_jsxs(X.tr, { children: [withName && _jsx(X.td, { children: term.name || '-' }), _jsx(X.td, { children: term.zh || term.en }), _jsx(X.td, { children: renderBadCases(term.badCases?.zh) }), _jsx(X.td, { children: term.en }), _jsx(X.td, { children: renderBadCases(term.badCases?.en) }), _jsx(X.td, { children: term.description || '-' })] }, term.name || index))) })] }));
12
+ _jsx(X.li, { children: _jsx(Markdown, { children: item }) }, index))) })) : ('-');
13
+ return (_jsxs(X.table, { children: [_jsx("thead", { children: _jsxs(X.tr, { children: [withName && _jsx(X.th, { children: t('name') }), _jsx(X.th, { children: t('chinese') }), _jsx(X.th, { children: t('chinese_bad_cases') }), _jsx(X.th, { children: t('english') }), _jsx(X.th, { children: t('english_bad_cases') }), _jsx(X.th, { children: t('description') })] }) }), _jsx("tbody", { children: normalized.map((term, index) => (_jsxs(X.tr, { children: [withName && _jsx(X.td, { children: term.name || '-' }), _jsx(X.td, { children: _jsx(Markdown, { children: term.zh || term.en }) }), _jsx(X.td, { children: renderBadCases(term.badCases?.zh) }), _jsx(X.td, { children: _jsx(Markdown, { children: term.en }) }), _jsx(X.td, { children: renderBadCases(term.badCases?.en) }), _jsx(X.td, { children: term.description ? _jsx(Markdown, { children: term.description }) : '-' })] }, term.name || index))) })] }));
13
14
  };
14
15
  export default TermsTable;
package/lib/terms.d.ts CHANGED
@@ -25,6 +25,10 @@ declare const terms: {
25
25
  readonly en: "ACP";
26
26
  readonly description: "产品品牌简称";
27
27
  };
28
+ readonly alaudaCloudLink: {
29
+ readonly en: "[Alauda Cloud](https://cloud.alauda.io)";
30
+ readonly zh: "[Alauda Cloud](https://cloud.alauda.cn)";
31
+ };
28
32
  };
29
33
  export type TermName = keyof typeof terms;
30
34
  export type NamedTerms = Record<TermName, TermItem>;
package/lib/terms.js CHANGED
@@ -13,6 +13,10 @@ const terms = {
13
13
  en: 'ACP',
14
14
  description: '产品品牌简称',
15
15
  },
16
+ alaudaCloudLink: {
17
+ en: '[Alauda Cloud](https://cloud.alauda.io)',
18
+ zh: '[Alauda Cloud](https://cloud.alauda.cn)',
19
+ },
16
20
  };
17
21
  export const namedTerms = terms;
18
22
  export const namedTermItems = Object.keys(terms).map((name_) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alauda/doom",
3
- "version": "1.16.0",
3
+ "version": "1.16.2",
4
4
  "type": "module",
5
5
  "description": "Doctor Doom making docs.",
6
6
  "repository": {
@@ -16,32 +16,24 @@ body:has(.container) :global {
16
16
  .container {
17
17
  padding: 100px 0 200px;
18
18
  background: no-repeat 0 100px;
19
- background-image: var(--login-bg);
20
19
  }
21
20
 
22
21
  :root {
23
22
  &:global(.dark) {
24
- .container {
25
- background-image: var(--login-bg-dark);
26
- }
27
-
28
23
  .login-form {
29
- --login-form-bg: #434652;
30
- --login-form-shadow: 0 3px 5px #000;
24
+ background-color: #434652;
25
+ box-shadow: 0 3px 5px #000;
31
26
  }
32
27
  }
33
28
  }
34
29
 
35
30
  .login-form {
36
- --login-form-bg: #fefefe;
37
- --login-form-shadow: 0 0 8px #3c3c3c4a;
38
-
39
31
  margin-left: auto;
40
32
  padding: 40px 60px;
41
33
  width: min(452px, 100%);
42
34
  border-radius: 4px;
43
- box-shadow: var(--login-form-shadow);
44
- background-color: var(--login-form-bg);
35
+ background-color: #fefefe;
36
+ box-shadow: 0 0 8px #3c3c3c4a;
45
37
  }
46
38
 
47
39
  .title {