@alauda/doom 0.14.16 → 0.14.18

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.
@@ -1,5 +1,6 @@
1
+ import { type NormalizedTermItem } from '../../terms.js';
1
2
  export interface TermsTableProps {
2
- named?: boolean;
3
+ terms?: NormalizedTermItem[];
3
4
  }
4
- export declare const TermsTable: ({ named }: TermsTableProps) => import("react/jsx-runtime").JSX.Element;
5
+ export declare const TermsTable: ({ terms }: TermsTableProps) => import("react/jsx-runtime").JSX.Element;
5
6
  export default TermsTable;
@@ -1,18 +1,14 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { getCustomMDXComponent } from '@rspress/core/theme';
3
3
  import { useState } from 'react';
4
- import { allTermItems, namedTermItems, unnamedTermItems, } from '../../terms.js';
4
+ import { namedTermItems } from '../../terms.js';
5
5
  import { useTranslation } from '../hooks/index.js';
6
- export const TermsTable = ({ named }) => {
6
+ export const TermsTable = ({ terms }) => {
7
7
  const [X] = useState(getCustomMDXComponent);
8
8
  const t = useTranslation();
9
- const noNamed = named === false;
10
- const terms = named
11
- ? namedTermItems
12
- : noNamed
13
- ? unnamedTermItems
14
- : allTermItems;
9
+ const normalized = terms ?? namedTermItems;
10
+ const withName = normalized.some(({ name }) => name);
15
11
  const renderBadCases = (list) => list?.length ? (_jsx(X.ul, { children: list.map((item, index) => (_jsx(X.li, { children: item }, index))) })) : ('-');
16
- return (_jsxs(X.table, { children: [_jsx("thead", { children: _jsxs(X.tr, { children: [noNamed || _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: terms.map((term, index) => (_jsxs(X.tr, { children: [noNamed || _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
+ 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))) })] }));
17
13
  };
18
14
  export default TermsTable;
package/lib/terms.d.ts CHANGED
@@ -8,7 +8,6 @@ export interface TermItem {
8
8
  en?: string[];
9
9
  };
10
10
  }
11
- export declare const unnamedTermItems: TermItem[];
12
11
  declare const terms: {
13
12
  readonly company: {
14
13
  readonly en: "Alauda";
@@ -33,5 +32,4 @@ export interface NamedTermItem extends TermItem {
33
32
  export type NormalizedTermItem = SetOptional<NamedTermItem, 'name'>;
34
33
  export declare const namedTerms: NamedTerms;
35
34
  export declare const namedTermItems: NamedTermItem[];
36
- export declare const allTermItems: NormalizedTermItem[];
37
35
  export {};
package/lib/terms.js CHANGED
@@ -1,4 +1,3 @@
1
- export const unnamedTermItems = [];
2
1
  const terms = {
3
2
  company: {
4
3
  en: 'Alauda',
@@ -23,7 +22,3 @@ export const namedTermItems = Object.keys(terms).map((name_) => {
23
22
  ...terms[name],
24
23
  };
25
24
  });
26
- export const allTermItems = [
27
- ...namedTermItems,
28
- ...unnamedTermItems,
29
- ];
package/lib/types.d.ts CHANGED
@@ -21,7 +21,7 @@ declare module '@rspress/shared' {
21
21
  userBase?: string;
22
22
  api?: Omit<ApiPluginOptions, 'localBasePath'>;
23
23
  sites?: DoomSite[];
24
- permission?: PermissionPluginOptions;
24
+ permission?: Omit<PermissionPluginOptions, 'localBasePath'>;
25
25
  reference?: ReferenceItem[];
26
26
  sidebar?: Omit<AutoSidebarPluginOptions, 'download' | 'excludeRoutes'>;
27
27
  releaseNotes?: ReleaseNotesOptions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alauda/doom",
3
- "version": "0.14.16",
3
+ "version": "0.14.18",
4
4
  "type": "module",
5
5
  "description": "Doctor Doom making docs.",
6
6
  "repository": {