@rspress/core 0.0.9 → 0.0.11

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.
Files changed (42) hide show
  1. package/dist/index.d.ts +1 -10
  2. package/dist/index.js +237 -264
  3. package/dist/index.js.map +1 -1
  4. package/dist/loader.d.ts +1 -1
  5. package/dist/loader.js +0 -3
  6. package/dist/loader.js.map +1 -1
  7. package/dist/theme/bundle.css +96 -159
  8. package/dist/theme/bundle.d.ts +1 -1
  9. package/dist/theme/bundle.js +879 -802
  10. package/dist/theme/bundle.js.map +1 -1
  11. package/package.json +15 -15
  12. package/src/theme-default/components/Aside/index.css +23 -0
  13. package/src/theme-default/components/Aside/index.tsx +7 -13
  14. package/src/theme-default/components/EditLink/index.module.scss +3 -3
  15. package/src/theme-default/components/EditLink/index.tsx +0 -5
  16. package/src/theme-default/components/HomeHero/index.module.scss +6 -0
  17. package/src/theme-default/components/HomeHero/index.tsx +4 -4
  18. package/src/theme-default/components/Nav/NavMenuGroup.tsx +43 -23
  19. package/src/theme-default/components/Nav/NavMenuSingleItem.tsx +12 -4
  20. package/src/theme-default/components/Nav/index.module.scss +0 -1
  21. package/src/theme-default/components/Nav/index.tsx +4 -3
  22. package/src/theme-default/components/NavScreenMenuGroup/NavScreenMenuGroup.tsx +18 -7
  23. package/src/theme-default/components/Search/logic/providers/LocalProvider.ts +1 -2
  24. package/src/theme-default/components/Sidebar/SidebarGroup.tsx +180 -0
  25. package/src/theme-default/components/Sidebar/SidebarItem.tsx +61 -0
  26. package/src/theme-default/components/Sidebar/index.module.scss +22 -5
  27. package/src/theme-default/components/Sidebar/index.tsx +39 -248
  28. package/src/theme-default/components/Tabs/index.module.scss +11 -18
  29. package/src/theme-default/components/Tabs/index.tsx +1 -1
  30. package/src/theme-default/layout/DocLayout/index.module.scss +17 -18
  31. package/src/theme-default/layout/Layout/index.tsx +19 -7
  32. package/src/theme-default/logic/sideEffects.ts +3 -1
  33. package/src/theme-default/logic/useEditLink.ts +6 -3
  34. package/src/theme-default/logic/useLocaleSiteData.ts +1 -1
  35. package/src/theme-default/logic/useSidebarData.ts +1 -1
  36. package/src/theme-default/styles/{doc/code.css → code.css} +4 -1
  37. package/src/theme-default/styles/index.ts +1 -3
  38. package/src/theme-default/styles/vars.css +2 -2
  39. package/src/theme-default/assets/edit.svg +0 -1
  40. package/src/theme-default/styles/doc/container.css +0 -103
  41. package/src/theme-default/styles/doc/index.css +0 -6
  42. /package/dist/theme/{index.ts → index.js} +0 -0
@@ -9,7 +9,6 @@ export function useLocaleSiteData(): NormalizedLocales {
9
9
  const themeConfig = pageData?.siteData?.themeConfig ?? {};
10
10
  const defaultLang = pageData.siteData.lang ?? '';
11
11
  const locales = themeConfig?.locales;
12
-
13
12
  if (!locales || locales.length === 0) {
14
13
  return {
15
14
  nav: themeConfig.nav,
@@ -19,6 +18,7 @@ export function useLocaleSiteData(): NormalizedLocales {
19
18
  } as NormalizedLocales;
20
19
  }
21
20
  const localeInfo = locales.find(locale => locale.lang === lang)!;
21
+
22
22
  return {
23
23
  ...localeInfo,
24
24
  langRoutePrefix: lang === defaultLang ? '/' : lang,
@@ -67,7 +67,7 @@ export function useSidebarData(): SidebarData {
67
67
  useEffect(() => {
68
68
  const newSidebarData = getSidebarGroupData(sidebar, pathname);
69
69
  setSidebarData(newSidebarData);
70
- }, [pathname, sidebar]);
70
+ }, [pathname, localeData.lang]);
71
71
 
72
72
  return sidebarData;
73
73
  }
@@ -57,7 +57,7 @@
57
57
  margin: 16px 0;
58
58
  background-color: var(--rp-code-block-bg);
59
59
  overflow-x: auto;
60
- transition: background-color 0.5s;
60
+ transition: none;
61
61
  }
62
62
 
63
63
  .rspress-doc .rspress-code-title {
@@ -71,6 +71,9 @@
71
71
  .rspress-doc div[class*='language-'] {
72
72
  border-radius: 16px;
73
73
  margin: 24px 0;
74
+ /* box-shadow: 0px 0.8px 2px rgba(0, 0, 0, 0.032), */
75
+ /* 0px 2.7px 6.7px rgba(0, 0, 0, 0.048), 0px 12px 30px rgba(0, 0, 0, 0.08); */
76
+ contain: content;
74
77
  }
75
78
  }
76
79
 
@@ -3,7 +3,5 @@
3
3
  */
4
4
  import './vars.css';
5
5
  import './base.css';
6
- import './doc/index.css';
7
- import './doc/code.css';
8
- import './doc/container.css';
6
+ import './code.css';
9
7
  import './scrollbar.css';
@@ -4,8 +4,8 @@
4
4
  :root {
5
5
  --rp-layout-max-width: 1440px;
6
6
  --rp-nav-height: 72px;
7
- --rp-sidebar-width: 280px;
8
- --rp-aside-width: 256px;
7
+ --rp-sidebar-width: 320px;
8
+ --rp-aside-width: 368px;
9
9
  }
10
10
 
11
11
  :root {
@@ -1 +0,0 @@
1
- <svg width="18" height="18" viewBox="0 0 32 32"><path fill="currentColor" d="M2 26h28v2H2zM25.4 9c.8-.8.8-2 0-2.8l-3.6-3.6c-.8-.8-2-.8-2.8 0l-15 15V24h6.4l15-15zm-5-5L24 7.6l-3 3L17.4 7l3-3zM6 22v-3.6l10-10l3.6 3.6l-10 10H6z"/></svg>
@@ -1,103 +0,0 @@
1
- /*
2
- * Container Style, the dom structure is Related to `@modern-js/remark-container`.
3
- */
4
- :root {
5
- --rp-container-info-border: rgba(7, 156, 112, 0.3);
6
- --rp-container-info-text: #399c70;
7
- --rp-container-info-bg: rgba(7, 156, 112, 0.02);
8
- --rp-container-info-code-bg: rgba(7, 156, 112, 0.1);
9
-
10
- --rp-container-warning-border: rgba(255, 197, 23, 0.5);
11
- --rp-container-warning-text: #ad850e;
12
- --rp-container-warning-bg: rgba(255, 197, 23, 0.02);
13
- --rp-container-warning-code-bg: rgba(255, 197, 23, 0.1);
14
-
15
- --rp-container-danger-border: rgba(237, 60, 80, 0.5);
16
- --rp-container-danger-text: #ab2131;
17
- --rp-container-danger-bg: rgba(237, 60, 80, 0.02);
18
- --rp-container-danger-code-bg: rgba(237, 60, 80, 0.1);
19
- }
20
-
21
- .dark {
22
- --rp-container-warning-border: rgba(255, 197, 23, 0.25);
23
- --rp-container-warning-text: #fcd253;
24
-
25
- --rp-container-danger-border: rgba(237, 60, 80, 0.25);
26
- --rp-container-danger-text: #f54e82;
27
- }
28
-
29
- .rspress-doc .modern-directive {
30
- border: 1px solid transparent;
31
- border-radius: 16px;
32
- padding: 20px 24px 12px;
33
- line-height: 1.7;
34
- font-size: 14px;
35
- font-weight: 500;
36
- margin: 24px 0;
37
- }
38
-
39
- .rspress-doc .modern-directive .modern-directive-title {
40
- margin-bottom: 8px;
41
- font-weight: 600;
42
- font-size: 16px;
43
- }
44
-
45
- .rspress-doc .modern-directive .modern-directive-content p {
46
- margin: 8px 0;
47
- }
48
-
49
- .rspress-doc .modern-directive .modern-directive-icon {
50
- display: inline-block;
51
- width: 20px;
52
- height: 20px;
53
- margin-right: 3px;
54
- }
55
-
56
- .rspress-doc .modern-directive p {
57
- margin: 8px 0;
58
- }
59
-
60
- .rspress-doc .modern-directive code {
61
- color: inherit;
62
- font-weight: bold;
63
- font-size: 13px;
64
- }
65
-
66
- .rspress-doc .modern-directive.tip,
67
- .rspress-doc .modern-directive.note,
68
- .rspress-doc .modern-directive.info {
69
- border-color: var(--rp-container-info-border);
70
- color: var(--rp-container-info-text);
71
- background-color: var(--rp-container-info-bg);
72
- }
73
-
74
- .rspress-doc .modern-directive.tip code,
75
- .rspress-doc .modern-directive.note code {
76
- background-color: var(--rp-container-info-code-bg);
77
- }
78
-
79
- .rspress-doc .modern-directive.info code {
80
- background-color: var(--rp-container-info-code-bg);
81
- }
82
-
83
- .rspress-doc .modern-directive.warning {
84
- border-color: var(--rp-container-warning-border);
85
- color: var(--rp-container-warning-text);
86
- background-color: var(--rp-container-warning-bg);
87
- }
88
-
89
- .rspress-doc .modern-directive.warning code {
90
- background-color: var(--rp-container-warning-code-bg);
91
- }
92
-
93
- .rspress-doc .modern-directive.caution,
94
- .rspress-doc .modern-directive.danger {
95
- border-color: var(--rp-container-danger-border);
96
- color: var(--rp-container-danger-text);
97
- background-color: var(--rp-container-danger-bg);
98
- }
99
-
100
- .rspress-doc .modern-directive.caution code,
101
- .rspress-doc .modern-directive.danger code {
102
- background-color: var(--rp-container-danger-code-bg);
103
- }
@@ -1,6 +0,0 @@
1
- .aside-active,
2
- .aside-active:hover {
3
- color: var(--rp-c-brand-dark) !important;
4
- font-weight: bold !important;
5
- font-size: 14px !important;
6
- }
File without changes