@rspress-theme-anatole/theme-default 0.7.40 → 0.7.42

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/dist/bundle.css CHANGED
@@ -3763,7 +3763,7 @@ p {
3763
3763
  }
3764
3764
 
3765
3765
  .features-item-icon-div.features-item-icon-div--fa {
3766
- background-color: linear-gradient(135deg, #C72281, #7B2FBE);
3766
+ background: linear-gradient(135deg, #C72281, #7B2FBE);
3767
3767
  padding-top: 8px;
3768
3768
  }
3769
3769
 
package/dist/bundle.js CHANGED
@@ -3700,12 +3700,17 @@ function HomepageFeaturesTabs({ frontmatter, routePath }) {
3700
3700
  }
3701
3701
 
3702
3702
  function HomepageFaqs({ frontmatter, routePath }) {
3703
- const tabs = frontmatter?.faqTabs || [];
3704
- const [activeTab, setActiveTab] = __WEBPACK_EXTERNAL_MODULE_react__.useState(tabs[0]?.title || '');
3703
+ const tabs = frontmatter?.faqTabs;
3704
+ const allTabs = tabs?.tabItems || [];
3705
+ const [activeTab, setActiveTab] = __WEBPACK_EXTERNAL_MODULE_react__.useState(allTabs[0]?.title || '');
3705
3706
  const [isExpanded, setIsExpanded] = __WEBPACK_EXTERNAL_MODULE_react__.useState(false);
3706
3707
  const DEFAULT_VISIBLE_COUNT = 5;
3708
+
3709
+ if (!tabs || !allTabs.length) {
3710
+ return null;
3711
+ }
3707
3712
 
3708
- const activeFaqs = tabs.find(tab => tab.title === activeTab);
3713
+ const activeFaqs = allTabs.find(tab => tab.title === activeTab);
3709
3714
 
3710
3715
  const handleTabClick = (title) => {
3711
3716
  setActiveTab(title);
@@ -3782,13 +3787,13 @@ function HomepageFaqs({ frontmatter, routePath }) {
3782
3787
  : [];
3783
3788
  const hasMoreItems = activeFaqs && activeFaqs.items.length > DEFAULT_VISIBLE_COUNT;
3784
3789
 
3785
- return tabs.length > 0 ? (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
3790
+ return allTabs.length > 0 ? (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
3786
3791
  className: "faqs-div",
3787
3792
  children: [
3788
3793
  // Tab menu
3789
3794
  (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
3790
3795
  className: "faqs-tabs",
3791
- children: tabs.map((tab) =>
3796
+ children: allTabs.map((tab) =>
3792
3797
  (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
3793
3798
  className: activeTab === tab.title ? "faqs-tab active" : "faqs-tab",
3794
3799
  onClick: () => handleTabClick(tab.title),
@@ -3823,7 +3828,7 @@ function HomepageFaqs({ frontmatter, routePath }) {
3823
3828
  gap: '6px',
3824
3829
  },
3825
3830
  children: [
3826
- isExpanded ? "Show less" : "Show more",
3831
+ isExpanded ? (tabs.showLessText ?? "Show less") : (tabs.showMoreText ?? "Show more"),
3827
3832
  (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("i", {
3828
3833
  className: isExpanded ? "fa-solid fa-chevron-up" : "fa-solid fa-chevron-down",
3829
3834
  style: { fontSize: '20px' }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rspress-theme-anatole/theme-default",
3
3
  "author": "Anatole Tong",
4
- "version": "0.7.40",
4
+ "version": "0.7.42",
5
5
  "license": "MIT",
6
6
  "sideEffects": [
7
7
  "*.css",
@@ -21,8 +21,8 @@
21
21
  "types": "./dist/bundle.d.ts",
22
22
  "dependencies": {
23
23
  "@mdx-js/react": "2.3.0",
24
- "@rspress-theme-anatole/rspress-plugin-mermaid": "0.7.40",
25
- "@rspress-theme-anatole/shared": "0.7.40",
24
+ "@rspress-theme-anatole/rspress-plugin-mermaid": "0.7.42",
25
+ "@rspress-theme-anatole/shared": "0.7.42",
26
26
  "@rspress/runtime": "1.43.8",
27
27
  "body-scroll-lock": "4.0.0-beta.0",
28
28
  "copy-to-clipboard": "^3.3.3",