@alauda/doom 1.10.11 → 1.10.12

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.
@@ -24,7 +24,6 @@ const concatTitle = (title, suffix) => {
24
24
  return `${title} ${suffix}`;
25
25
  };
26
26
  export const SiteOverrides = () => {
27
- // eslint-disable-next-line @typescript-eslint/no-deprecated -- `usePage` is not exported...
28
27
  const { siteData, page } = usePageData();
29
28
  const { pageType,
30
29
  // Inject by remark-plugin-toc
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { isProduction, NoSSR, usePageData, withBase, } from '@rspress/core/runtime';
2
+ import { isProduction, NoSSR, useSite, withBase } from '@rspress/core/runtime';
3
3
  import {} from '@rspress/shared';
4
4
  import virtual from 'doom-@global-virtual';
5
5
  import { noop } from 'es-toolkit';
@@ -27,11 +27,10 @@ if (!isProduction()) {
27
27
  ALLOWED_LEGACY_DOMAINS.add('localhost');
28
28
  }
29
29
  const VersionsNav_ = () => {
30
- // eslint-disable-next-line @typescript-eslint/no-deprecated -- `usePage` is not exported...
31
- const { siteData } = usePageData();
30
+ const { site } = useSite();
32
31
  const lang = useLang();
33
32
  const t = useTranslation();
34
- const siteTitle = siteData.originalTitle ?? siteData.title;
33
+ const siteTitle = site.originalTitle ?? site.title;
35
34
  const downloadLink = useMemo(() => {
36
35
  if (!virtual.download) {
37
36
  return;
@@ -1,5 +1,5 @@
1
1
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
- import { NoSSR, useLang, usePageData } from '@rspress/core/runtime';
2
+ import { NoSSR, useLang, useSite } from '@rspress/core/runtime';
3
3
  import { addTrailingSlash, isExternalUrl, normalizeHref, parseUrl, removeLeadingSlash, } from '@rspress/shared';
4
4
  import { DEFAULT_PAGE_EXTENSIONS } from '@rspress/shared/constants';
5
5
  import { clsx } from 'clsx';
@@ -11,8 +11,7 @@ import { useIsPrint } from '../hooks/index.js';
11
11
  import { Directive } from './Directive.js';
12
12
  const ExternalSiteLink_ = ({ name, href = '', className, ...props }) => {
13
13
  const isPrint = useIsPrint();
14
- // eslint-disable-next-line @typescript-eslint/no-deprecated -- `usePage` is not exported...
15
- const { siteData } = usePageData();
14
+ const { site: siteData } = useSite();
16
15
  const site = useMemo(() => virtual.sites?.find((s) => s.name === name), [name]);
17
16
  const lang = useLang();
18
17
  if (!site) {
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { usePageData } from '@rspress/core/runtime';
2
+ import { usePage } from '@rspress/core/runtime';
3
3
  import openapisMap from 'doom-@api-openapisMap';
4
4
  import { useId, useMemo } from 'react';
5
5
  import { modelName, omitRoutePathRefs, resolveRef } from '../utils.js';
@@ -70,8 +70,7 @@ const getRefsForSchema = (openapi, schema, knownRefs) => {
70
70
  return Array.from(refs);
71
71
  };
72
72
  export const OpenAPIRef = ({ schema, openapiPath: openapiPath_, isCommonRef = true, collectRefs = true, }) => {
73
- // eslint-disable-next-line @typescript-eslint/no-deprecated -- `usePage` is not exported...
74
- const { page } = usePageData();
73
+ const { page } = usePage();
75
74
  let uid = useUid();
76
75
  const innerUid = useId();
77
76
  if (isCommonRef) {
@@ -17,9 +17,7 @@ const getChildLink = (traverseItem) => {
17
17
  // In overpage page, we select all the related sidebar groups and show the groups in the page.
18
18
  // In the meantime, some sidebar items also should be shown in the page, we collect them in the group named 'Others' and show them in the page.
19
19
  export function Overview(props) {
20
- const { siteData, page: { routePath, frontmatter, title },
21
- // eslint-disable-next-line @typescript-eslint/no-deprecated -- `usePage` is not exported...
22
- } = usePageData();
20
+ const { siteData, page: { routePath, frontmatter, title }, } = usePageData();
23
21
  const { content, groups: customGroups, defaultGroupTitle = 'Others' } = props;
24
22
  const subFilter = useCallback((link) =>
25
23
  // sidebar items link without base path
package/lib/theme.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useLang, usePageData, withBase } from '@rspress/core/runtime';
2
+ import { useLang, useSite, withBase } from '@rspress/core/runtime';
3
3
  import { Search as OriginalSearch, Layout as OriginalLayout, getCustomMDXComponent, } from '@rspress/core/theme';
4
4
  import { Search as AlgoliaSearch, ZH_LOCALES, } from '@rspress/plugin-algolia/runtime';
5
5
  import virtual from 'doom-@global-virtual';
@@ -33,7 +33,7 @@ const getClosestSidebar_ = (sidebarItems, pathname, exportItem, matched, depth =
33
33
  depth,
34
34
  };
35
35
  }
36
- const sidebarLink = cleanupUrlPath(withBase(sidebar.link));
36
+ const sidebarLink = cleanupUrlPath(sidebar.link || '');
37
37
  if (sidebarLink === pathname) {
38
38
  return matched;
39
39
  }
@@ -60,9 +60,7 @@ const getClosestSidebar = (sidebarItems, pathname) => {
60
60
  };
61
61
  // eslint-disable-next-line import-x/export
62
62
  export const Layout = () => {
63
- const { siteData: { lang: siteLang, themeConfig },
64
- // eslint-disable-next-line @typescript-eslint/no-deprecated -- `usePage` is not exported...
65
- } = usePageData();
63
+ const { site: { lang: siteLang, themeConfig }, } = useSite();
66
64
  const lang = useLang();
67
65
  const t = useTranslation();
68
66
  const { pathname } = useLocation();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alauda/doom",
3
- "version": "1.10.11",
3
+ "version": "1.10.12",
4
4
  "type": "module",
5
5
  "description": "Doctor Doom making docs.",
6
6
  "repository": "git+https://github.com/alauda/doom.git",
@@ -37,18 +37,18 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@cspell/eslint-plugin": "^8.19.4 || ^9.2.0",
40
- "@eslint-react/eslint-plugin": "^1.52.4",
41
- "@inquirer/prompts": "^7.8.2",
40
+ "@eslint-react/eslint-plugin": "^1.52.5",
41
+ "@inquirer/prompts": "^7.8.3",
42
42
  "@openapi-contrib/openapi-schema-to-json-schema": "^5.1.0",
43
43
  "@playwright/browser-chromium": "^1.54.2",
44
44
  "@rsbuild/plugin-react": "^1.3.5",
45
45
  "@rsbuild/plugin-sass": "^1.3.5",
46
46
  "@rsbuild/plugin-svgr": "^1.2.2",
47
47
  "@rsbuild/plugin-yaml": "^1.0.3",
48
- "@rspress/core": "2.0.0-beta.26",
49
- "@rspress/plugin-algolia": "2.0.0-beta.26",
50
- "@rspress/plugin-llms": "2.0.0-beta.26",
51
- "@rspress/shared": "2.0.0-beta.26",
48
+ "@rspress/core": "2.0.0-beta.27",
49
+ "@rspress/plugin-algolia": "2.0.0-beta.27",
50
+ "@rspress/plugin-llms": "2.0.0-beta.27",
51
+ "@rspress/shared": "2.0.0-beta.27",
52
52
  "@shikijs/transformers": "^3.9.2",
53
53
  "@total-typescript/ts-reset": "^0.6.1",
54
54
  "chokidar": "^4.0.3",
@@ -56,7 +56,7 @@
56
56
  "clsx": "^2.1.1",
57
57
  "commander": "^13.1.0 || ^14.0.0",
58
58
  "ejs": "^3.1.10",
59
- "es-toolkit": "^1.39.9",
59
+ "es-toolkit": "^1.39.10",
60
60
  "eslint": "^9.33.0",
61
61
  "eslint-plugin-mdx": "^3.6.2",
62
62
  "globals": "^16.3.0",