@rspress-theme-anatole/theme-default 0.1.5 → 0.1.7

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/LICENSE ADDED
@@ -0,0 +1,19 @@
1
+ MIT License
2
+
3
+ Copyright (c) [2025] [Anatole.Tong]
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9
+ of the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all copies
13
+ or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16
+ INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
17
+ PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
18
+ FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/dist/bundle.css CHANGED
@@ -3507,4 +3507,195 @@ p {
3507
3507
 
3508
3508
  .rspress-nav {
3509
3509
  border-bottom: 1px solid var(--Colors-Neutral-3, #D2D5DA);
3510
+ }
3511
+
3512
+ .top-search-suggestions-label {
3513
+ font-weight: 600;
3514
+ font-size: 16px;
3515
+ line-height: 34px;
3516
+ letter-spacing: 0%;
3517
+ vertical-align: middle;
3518
+ color: #32363E;
3519
+ margin-left: 40px;
3520
+ }
3521
+
3522
+ .top-search-suggestion-item {
3523
+ font-weight: 400;
3524
+ font-size: 16px;
3525
+ line-height: 18px;
3526
+ vertical-align: middle;
3527
+ color: #32363E;
3528
+ height: 34;
3529
+ padding-top: 6px;
3530
+ padding-right: 10px;
3531
+ padding-bottom: 6px;
3532
+ padding-left: 10px;
3533
+ gap: 10px;
3534
+ border-radius: 100px;
3535
+ background-color: #FFFFFF;
3536
+ border: 1px solid var(--Colors-Neutral-3, #D2D5DA);
3537
+ }
3538
+
3539
+ .topics-title {
3540
+ font-weight: 700;
3541
+ font-size: 24px;
3542
+ line-height: 32px;
3543
+ letter-spacing: -2%;
3544
+ vertical-align: middle;
3545
+ color: #32363E;
3546
+ }
3547
+
3548
+ .topics-show-more {
3549
+ font-weight: 600;
3550
+ font-size: 18px;
3551
+ line-height: 24px;
3552
+ letter-spacing: -1%;
3553
+ text-align: right;
3554
+ vertical-align: middle;
3555
+ text-decoration: underline;
3556
+ text-decoration-style: solid;
3557
+ text-decoration-thickness: 0%;
3558
+ color: #1781D9;
3559
+ }
3560
+
3561
+ .topics-div {
3562
+ margin: 72px 40px 0px 40px;
3563
+ }
3564
+
3565
+ .topics-item {
3566
+ width: 100%;
3567
+ height: 184;
3568
+ border-radius: 8px;
3569
+ border-width: 1px;
3570
+ padding: 24px;
3571
+ background-color: #FFFFFF;
3572
+ border: 1px solid var(--Colors-Neutral-3, #D2D5DA);
3573
+ }
3574
+
3575
+ .topics-item-text {
3576
+ font-weight: 700;
3577
+ font-size: 20px;
3578
+ line-height: 28px;
3579
+ letter-spacing: -2%;
3580
+ vertical-align: middle;
3581
+ color: #32363E;
3582
+ margin-top: 8px;
3583
+ }
3584
+
3585
+ .topics-item-desc {
3586
+ font-weight: 400;
3587
+ font-size: 16px;
3588
+ line-height: 22px;
3589
+ letter-spacing: 0%;
3590
+ vertical-align: middle;
3591
+ color: #494F5A;
3592
+ margin-top: 8px;
3593
+ }
3594
+
3595
+ .topics-item-icon {
3596
+ font-family: 'Font Awesome 6 Free';
3597
+ font-weight: 900;
3598
+ font-size: 32px;
3599
+ line-height: 100%;
3600
+ letter-spacing: 0%;
3601
+ text-align: center;
3602
+ vertical-align: middle;
3603
+ color: #EF483D;
3604
+ }
3605
+
3606
+ .features-item-icon-div {
3607
+ width: 40;
3608
+ height: 40;
3609
+ border-radius: 8px;
3610
+ background-color: #EF483D;
3611
+ text-align: center;
3612
+ padding-top: 8px;
3613
+ }
3614
+
3615
+ .features-item-icon {
3616
+ font-size: 22px;
3617
+ color: #FFFFFF;
3618
+ }
3619
+
3620
+ .features-div {
3621
+ margin: 45px 40px 0px 40px;
3622
+ }
3623
+
3624
+ .faqs-div {
3625
+ background-color: #F1F2F4;
3626
+ }
3627
+
3628
+ .faqs-item-question {
3629
+ font-weight: 600;
3630
+ font-size: 20px;
3631
+ line-height: 28px;
3632
+ letter-spacing: -2%;
3633
+ color: #32363E;
3634
+ justify-content: space-between;
3635
+ display: flex;
3636
+ }
3637
+
3638
+ .faqs-item-answer {
3639
+ font-weight: 400;
3640
+ font-size: 16px;
3641
+ line-height: 22px;
3642
+ letter-spacing: 0%;
3643
+ color: #32363E;
3644
+ padding: 24px;
3645
+ }
3646
+
3647
+ .faqs-box {
3648
+ background-color: white;
3649
+ margin: 24px 0 0 0;
3650
+ }
3651
+
3652
+ .faqs-box-item {
3653
+ /* height: 76; */
3654
+ border-bottom-width: 1px;
3655
+ padding: 24px;
3656
+ border-color: #D2D5DA;
3657
+ }
3658
+
3659
+ .contact-us-p1 {
3660
+ font-weight: 700;
3661
+ font-size: 24px;
3662
+ line-height: 32px;
3663
+ letter-spacing: -2%;
3664
+ text-align: center;
3665
+ vertical-align: middle;
3666
+ color: #32363E;
3667
+ }
3668
+
3669
+ .contact-us-p2 {
3670
+ font-weight: 400;
3671
+ font-size: 16px;
3672
+ line-height: 22px;
3673
+ letter-spacing: 0%;
3674
+ vertical-align: middle;
3675
+ color: #32363E;
3676
+ margin-top: 24px;
3677
+ text-align: center;
3678
+ }
3679
+
3680
+ .contact-us-btn {
3681
+ width: 203;
3682
+ height: 50;
3683
+ border-radius: 100px;
3684
+ background-color: #EF483D;
3685
+ margin: 24px 0 72px 0;
3686
+ color: white;
3687
+ text-align: center;
3688
+ }
3689
+
3690
+ .contactus-div {
3691
+ justify-self: center;
3692
+ margin-top: 72px;
3693
+ }
3694
+
3695
+ .pb-12 {
3696
+ padding-bottom: 0 !important;
3697
+ }
3698
+
3699
+ .rspress-nav-search-button {
3700
+ display: none;
3510
3701
  }
package/dist/bundle.js CHANGED
@@ -41,6 +41,7 @@ import * as __WEBPACK_EXTERNAL_MODULE__theme_assets_jump_20d3ca88__ from "@theme
41
41
  import * as __WEBPACK_EXTERNAL_MODULE__theme_assets_title_56a7311e__ from "@theme-assets/title";
42
42
  import * as __WEBPACK_EXTERNAL_MODULE__theme_assets_github_cac38251__ from "@theme-assets/github";
43
43
  import * as __WEBPACK_EXTERNAL_MODULE__theme_assets_gitlab_a0e4f082__ from "@theme-assets/gitlab";
44
+
44
45
  function isMobileDevice() {
45
46
  return window.innerWidth < 1280;
46
47
  }
@@ -1193,14 +1194,18 @@ function HomepageLayout(props) {
1193
1194
  frontmatter: frontmatter,
1194
1195
  routePath: routePath
1195
1196
  }),
1196
- // (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(HomeHero, {
1197
- // frontmatter: frontmatter,
1198
- // routePath: routePath
1199
- // }),
1200
- // (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(HomeFeature, {
1201
- // frontmatter: frontmatter,
1202
- // routePath: routePath
1203
- // }),
1197
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(HomepageTopics, {
1198
+ frontmatter: frontmatter,
1199
+ routePath: routePath
1200
+ }),
1201
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(HomepageFeatures, {
1202
+ frontmatter: frontmatter,
1203
+ routePath: routePath
1204
+ }),
1205
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(HomepageFaqs, {
1206
+ frontmatter: frontmatter,
1207
+ routePath: routePath
1208
+ }),
1204
1209
  ]
1205
1210
  }),
1206
1211
  (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(HomeFooter, {})
@@ -1221,18 +1226,10 @@ function HomeLayout(props) {
1221
1226
  (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
1222
1227
  className: "pb-12",
1223
1228
  children: [
1224
- beforeHero,
1225
- (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__theme_75e53063__.HomeHero, {
1226
- frontmatter: frontmatter,
1227
- routePath: routePath
1228
- }),
1229
- afterHero,
1230
- beforeFeatures,
1231
1229
  (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__theme_75e53063__.HomeFeature, {
1232
1230
  frontmatter: frontmatter,
1233
1231
  routePath: routePath
1234
1232
  }),
1235
- afterFeatures
1236
1233
  ]
1237
1234
  }),
1238
1235
  (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__theme_75e53063__.HomeFooter, {})
@@ -2521,6 +2518,221 @@ function HomeFeature({ frontmatter, routePath }) {
2521
2518
  });
2522
2519
  }
2523
2520
 
2521
+ function HomepageTopics({ frontmatter, routePath }) {
2522
+ const topics = frontmatter?.topics;
2523
+ return (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
2524
+ children: [
2525
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
2526
+ children: [
2527
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("h2", {
2528
+ children: topics.title ?? 'Topics',
2529
+ className: "topics-title"
2530
+ }),
2531
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("a", {
2532
+ children: 'Show more',
2533
+ className: "topics-show-more"
2534
+ }),
2535
+ ],
2536
+ style: {
2537
+ display: 'flex',
2538
+ justifyContent: 'space-between',
2539
+ width: '100%',
2540
+ }
2541
+ }),
2542
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
2543
+ children: topics.items.map((topicItem) => {
2544
+ return (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
2545
+ className: "topics-item",
2546
+ children: [
2547
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("i", {
2548
+ className: topicItem.icon + " topics-item-icon",
2549
+ }),
2550
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("a", {
2551
+ children: (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("h3", {
2552
+ className: "topics-item-text",
2553
+ children: topicItem.text
2554
+ }),
2555
+ href: topicItem.link
2556
+ }),
2557
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("p", {
2558
+ className: "topics-item-desc",
2559
+ children: topicItem.desc
2560
+ }),
2561
+ ]
2562
+ }, topicItem.text);
2563
+ }),
2564
+ style: {
2565
+ display: 'flex',
2566
+ justifyContent: 'space-between',
2567
+ width: '100%',
2568
+ marginTop: '24px',
2569
+ gap: '24px',
2570
+ }
2571
+ }),
2572
+
2573
+ ],
2574
+ className: "topics-div",
2575
+ });
2576
+ }
2577
+
2578
+ function HomepageFeatures({ frontmatter, routePath }) {
2579
+ const features = frontmatter?.features;
2580
+
2581
+ return (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
2582
+ children: [
2583
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
2584
+ children: [
2585
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("h2", {
2586
+ children: features.title ?? 'Features',
2587
+ className: "topics-title"
2588
+ }),
2589
+ ],
2590
+ style: {
2591
+ display: 'flex',
2592
+ justifyContent: 'space-between',
2593
+ width: '100%',
2594
+ }
2595
+ }),
2596
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
2597
+ children: features.rows.map((featuresRow) => {
2598
+ return (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
2599
+ children: featuresRow.items.map((featureItem) => {
2600
+ return (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
2601
+ className: "topics-item",
2602
+ children: [
2603
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
2604
+ children: (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("i", {
2605
+ className: featureItem.icon + " features-item-icon",
2606
+ }),
2607
+ className: "features-item-icon-div"
2608
+ }),
2609
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("a", {
2610
+ children: (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("h3", {
2611
+ className: "topics-item-text",
2612
+ children: featureItem.text
2613
+ }),
2614
+ href: featureItem.link
2615
+ }),
2616
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("p", {
2617
+ className: "topics-item-desc",
2618
+ children: featureItem.desc
2619
+ }),
2620
+ ]
2621
+ }, featureItem.text);
2622
+ }),
2623
+
2624
+ style: {
2625
+ display: 'flex',
2626
+ justifyContent: 'space-between',
2627
+ width: '100%',
2628
+ gap: '24px',
2629
+ marginTop: '24px',
2630
+ }
2631
+ }, featuresRow.items[0].text);
2632
+ }),
2633
+ style: {
2634
+ }
2635
+ }),
2636
+ ],
2637
+ className: "features-div",
2638
+ });
2639
+ }
2640
+
2641
+ function HomepageFaqs({ frontmatter, routePath }) {
2642
+ const faqs = frontmatter?.faqs;
2643
+ const contactus = frontmatter?.contactus;
2644
+
2645
+ return (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
2646
+ children: [
2647
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
2648
+ children: [
2649
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("h2", {
2650
+ children: faqs.title ?? 'FAQs',
2651
+ className: "topics-title"
2652
+ }),
2653
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
2654
+ children: faqs.items.map((faqItem) => {
2655
+ return (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
2656
+ children: [
2657
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("p", {
2658
+ children: [
2659
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
2660
+ children: faqItem.question,
2661
+ }),
2662
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
2663
+ children: (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("i", {
2664
+ className: "fa-solid fa-chevron-down",
2665
+ }),
2666
+ onClick: (e) => {
2667
+ if (document.querySelector('.faqs-item-answer')) {
2668
+ if (e.currentTarget.parentElement.nextElementSibling.style.display === 'none') {
2669
+ e.currentTarget.parentElement.nextElementSibling.style.display = 'block';
2670
+ e.currentTarget.querySelector('i').className = "fa-solid fa-chevron-up";
2671
+ }
2672
+ else {
2673
+ e.currentTarget.parentElement.nextElementSibling.style.display = 'none';
2674
+ e.currentTarget.querySelector('i').className = "fa-solid fa-chevron-down";
2675
+ }
2676
+ }
2677
+ },
2678
+ }),
2679
+ ],
2680
+ className: "faqs-item-question",
2681
+ }),
2682
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("p", {
2683
+ dangerouslySetInnerHTML: {
2684
+ __html: faqItem.answer
2685
+ },
2686
+ className: "faqs-item-answer",
2687
+ style: {
2688
+ display: "none",
2689
+ }
2690
+ }),
2691
+ ],
2692
+ className: "faqs-box-item",
2693
+ }, faqItem.question);
2694
+ }),
2695
+ className: "faqs-box"
2696
+ }),
2697
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
2698
+ children: [
2699
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("p", {
2700
+ children: contactus.p1,
2701
+ className: "contact-us-p1"
2702
+ }),
2703
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("p", {
2704
+ children: contactus.p2,
2705
+ className: "contact-us-p2"
2706
+ }),
2707
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
2708
+ children: (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("a", {
2709
+ href: contactus.btnLink,
2710
+ children: (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("button", {
2711
+ children: contactus.btn ?? 'Contact us',
2712
+ className: "contact-us-btn",
2713
+ }),
2714
+ }),
2715
+ style: {
2716
+ width: '100%',
2717
+ display: 'flex',
2718
+ justifyContent: 'center',
2719
+ }
2720
+ }),
2721
+ ],
2722
+ className: "contactus-div"
2723
+ }),
2724
+ ],
2725
+ style: {
2726
+ width: '100%',
2727
+ marginTop: '72px',
2728
+ padding: '72px 40px 0 40px',
2729
+ }
2730
+ }),
2731
+ ],
2732
+ className: "faqs-div",
2733
+ });
2734
+ }
2735
+
2524
2736
  function HomeFooter() {
2525
2737
  const { siteData } = (0, __WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.usePageData)();
2526
2738
  const { group, message, links, social } = siteData.themeConfig.footer || {};
@@ -2529,7 +2741,7 @@ function HomeFooter() {
2529
2741
  children: [
2530
2742
  (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("p", {
2531
2743
  dangerouslySetInnerHTML: {
2532
- __html: group.map((groupItem) => { return `<a href="${groupItem.link}" class="">${groupItem.text}</a>` }).join("")
2744
+ __html: group.map((groupItem) => { return `<span class="">${groupItem.text}</span>` }).join("")
2533
2745
  },
2534
2746
  style: {
2535
2747
  gap: "20px",
@@ -2598,17 +2810,15 @@ const DEFAULT_HERO = {
2598
2810
  };
2599
2811
 
2600
2812
  function HomepageTopSearch({ frontmatter, routePath }) {
2601
- const hero = frontmatter?.hero || DEFAULT_HERO;
2602
- const hasImage = void 0 !== hero.image;
2603
- const textMaxWidth = hasImage ? 'sm:max-w-xl' : 'sm:max-w-4xl';
2604
- const multiHeroText = hero.text ? hero.text.toString().split(/\n/g).filter((text) => '' !== text) : [];
2605
- const imageSrc = 'string' == typeof hero.image?.src ? {
2606
- light: hero.image.src,
2607
- dark: hero.image.src
2608
- } : hero.image?.src || {
2813
+ const topSearch = frontmatter?.topSearch || DEFAULT_HERO;
2814
+ const imageSrc = 'string' == typeof topSearch.image?.src ? {
2815
+ light: topSearch.image.src,
2816
+ dark: topSearch.image.src
2817
+ } : topSearch.image?.src || {
2609
2818
  light: '',
2610
2819
  dark: ''
2611
2820
  };
2821
+ const [query, setQuery] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)('');
2612
2822
 
2613
2823
  return (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
2614
2824
  children: [
@@ -2619,33 +2829,104 @@ function HomepageTopSearch({ frontmatter, routePath }) {
2619
2829
  (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("h1", {
2620
2830
  children: (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
2621
2831
  style: {
2622
- lineHeight: '1.3'
2832
+ fontWeight: '700',
2833
+ fontSize: '40px',
2834
+ lineHeight: '100%',
2835
+ letterSpacing: '-2%',
2836
+ textAlign: 'center',
2837
+ verticalAlign: 'middle',
2838
+ margin: '103px 0 0 40px',
2623
2839
  },
2624
- children: renderHtmlOrText(hero.name)
2625
- })
2840
+ children: renderHtmlOrText(topSearch.text)
2841
+ }),
2842
+ style: {
2843
+ paddingTop: '103px'
2844
+ }
2626
2845
  }),
2627
- 0 !== multiHeroText.length && multiHeroText.map((heroText) => (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("p", {
2846
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
2847
+ children: [
2848
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("i", {
2849
+ className: "fa-solid fa-magnifying-glass",
2850
+ style: {
2851
+ color: '#7E8695',
2852
+ fontSize: '20px',
2853
+ fontWeight: '900',
2854
+ lineHeight: '18px',
2855
+ letterSpacing: '-1%',
2856
+ zIndex: '100',
2857
+ margin: '22px -50px 0 20px',
2858
+ },
2859
+ onClick: () => {
2860
+ document.querySelector('.rspress-nav-search-button').click();
2861
+ },
2862
+ }),
2863
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("input", {
2864
+ type: "search",
2865
+ placeholder: topSearch.placeholder,
2866
+ className: "top-search-input",
2867
+ style: {
2868
+ width: 500,
2869
+ height: 58,
2870
+ borderRadius: '100px',
2871
+ borderWidth: '1px',
2872
+ paddingRight: '18px',
2873
+ paddingLeft: '50px',
2874
+ },
2875
+ onClick: () => {
2876
+ document.querySelector('.rspress-nav-search-button').click();
2877
+ },
2878
+ }),
2879
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("button", {
2880
+ children: 'Search',
2881
+ style: {
2882
+ width: '100px',
2883
+ height: '58px',
2884
+ borderRadius: '100px',
2885
+ paddingRight: '18px',
2886
+ paddingLeft: '18px',
2887
+ backgroundColor: '#EF483D',
2888
+ textalign: 'center',
2889
+ color: 'white'
2890
+ },
2891
+ onClick: () => {
2892
+ document.querySelector('.rspress-nav-search-button').click();
2893
+ },
2894
+ }),
2895
+ ],
2628
2896
  style: {
2629
- lineHeight: '1.2'
2630
- },
2631
- children: renderHtmlOrText(heroText)
2632
- }, heroText)),
2897
+ display: 'flex',
2898
+ gap: '10px',
2899
+ margin: '24px 0 0 40px',
2900
+ }
2901
+ }),
2633
2902
  (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("p", {
2634
- children: renderHtmlOrText(hero.tagline)
2903
+ children: [
2904
+ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
2905
+ children: "Suggestions:",
2906
+ className: 'top-search-suggestions-label'
2907
+ }),
2908
+ topSearch.suggestions.map((suggestion) => {
2909
+ return (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)('button', {
2910
+ children: suggestion.text,
2911
+ className: 'top-search-suggestion-item',
2912
+ onClick: () => {
2913
+ document.querySelector('.rspress-nav-search-button').click();
2914
+ setTimeout(() => {
2915
+ const searchInput = document.querySelector('.rspress-search-panel-input');
2916
+ searchInput.value = suggestion.text;
2917
+ const event = new Event('keyup', { bubbles: true });
2918
+ searchInput.dispatchEvent(event);
2919
+ }, 100);
2920
+ }
2921
+ }, suggestion.text + '-btn');
2922
+ }),
2923
+ ],
2924
+ style: {
2925
+ marginTop: '20px',
2926
+ display: 'flex',
2927
+ gap: '8px',
2928
+ }
2635
2929
  }),
2636
- hero.actions?.length && (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
2637
- children: hero.actions.map((action) => {
2638
- const link = (0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.isExternalUrl)(action.link) ? action.link : (0, __WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.normalizeHrefInRuntime)((0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.withBase)(action.link, routePath));
2639
- return (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
2640
- children: (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__theme_75e53063__.Button, {
2641
- type: "a",
2642
- href: link,
2643
- text: renderHtmlOrText(action.text),
2644
- theme: action.theme,
2645
- })
2646
- }, link);
2647
- })
2648
- })
2649
2930
  ]
2650
2931
  }),
2651
2932
  ]
@@ -2660,100 +2941,6 @@ function HomepageTopSearch({ frontmatter, routePath }) {
2660
2941
  });
2661
2942
  }
2662
2943
 
2663
- function HomeHero({ frontmatter, routePath }) {
2664
- const hero = frontmatter?.hero || DEFAULT_HERO;
2665
- const hasImage = void 0 !== hero.image;
2666
- const textMaxWidth = hasImage ? 'sm:max-w-xl' : 'sm:max-w-4xl';
2667
- const multiHeroText = hero.text ? hero.text.toString().split(/\n/g).filter((text) => '' !== text) : [];
2668
- const imageSrc = 'string' == typeof hero.image?.src ? {
2669
- light: hero.image.src,
2670
- dark: hero.image.src
2671
- } : hero.image?.src || {
2672
- light: '',
2673
- dark: ''
2674
- };
2675
- return (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
2676
- className: "m-auto pt-0 px-6 pb-12 sm:pt-10 sm:px-16 md:pt-16 md:px-16 md:pb-16 relative",
2677
- children: [
2678
- (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
2679
- className: HomeHero_index_module.mask,
2680
- style: {
2681
- left: hasImage ? '75%' : '50%'
2682
- }
2683
- }),
2684
- (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
2685
- className: "m-auto flex flex-col md:flex-row max-w-6xl min-h-[50vh] mt-12 sm:mt-0",
2686
- children: [
2687
- (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
2688
- className: "flex flex-col justify-center items-center text-center max-w-xl sm:max-w-4xl m-auto order-2 md:order-1",
2689
- children: [
2690
- (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("h1", {
2691
- className: "font-bold text-3xl pb-2 sm:text-6xl md:text-7xl m-auto sm:m-4 md:m-0 md:pb-3 lg:pb-2 leading-tight z-10",
2692
- children: (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("span", {
2693
- className: HomeHero_index_module.clip,
2694
- style: {
2695
- lineHeight: '1.3'
2696
- },
2697
- children: renderHtmlOrText(hero.name)
2698
- })
2699
- }),
2700
- 0 !== multiHeroText.length && multiHeroText.map((heroText) => (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("p", {
2701
- className: `rspress-home-hero-text mx-auto md:m-0 text-3xl sm:text-5xl md:text-6xl sm:pb-2 font-bold z-10 ${textMaxWidth}`,
2702
- style: {
2703
- lineHeight: '1.2'
2704
- },
2705
- children: renderHtmlOrText(heroText)
2706
- }, heroText)),
2707
- (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("p", {
2708
- className: `rspress-home-hero-tagline whitespace-pre-wrap pt-4 m-auto md:m-0 text-sm sm:tex-xl md:text-[1.5rem] text-text-2 font-medium z-10 ${textMaxWidth}`,
2709
- children: renderHtmlOrText(hero.tagline)
2710
- }),
2711
- hero.actions?.length && (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
2712
- className: "grid md:flex md:flex-wrap md:justify-center gap-3 m--1.5 pt-6 sm:pt-8 z-10",
2713
- children: hero.actions.map((action) => {
2714
- const link = (0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.isExternalUrl)(action.link) ? action.link : (0, __WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.normalizeHrefInRuntime)((0, __WEBPACK_EXTERNAL_MODULE__rspress_shared_baa012d0__.withBase)(action.link, routePath));
2715
- return (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("div", {
2716
- className: "flex flex-shrink-0 p-1",
2717
- children: (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(__WEBPACK_EXTERNAL_MODULE__theme_75e53063__.Button, {
2718
- type: "a",
2719
- href: link,
2720
- text: renderHtmlOrText(action.text),
2721
- theme: action.theme,
2722
- className: "w-full"
2723
- })
2724
- }, link);
2725
- })
2726
- })
2727
- ]
2728
- }),
2729
- hasImage ? (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsxs)("div", {
2730
- className: "rspress-home-hero-image md:flex-center m-auto order-1 md:order-2 sm:flex md:none lg:flex",
2731
- children: [
2732
- (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("img", {
2733
- src: (0, __WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.normalizeImagePath)(imageSrc.light),
2734
- alt: hero.image?.alt,
2735
- srcSet: normalizeSrcsetAndSizes(hero.image?.srcset),
2736
- sizes: normalizeSrcsetAndSizes(hero.image?.sizes),
2737
- width: 375,
2738
- height: 375,
2739
- className: "dark:hidden"
2740
- }),
2741
- (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("img", {
2742
- src: (0, __WEBPACK_EXTERNAL_MODULE__rspress_runtime_0abd3046__.normalizeImagePath)(imageSrc.dark),
2743
- alt: hero.image?.alt,
2744
- srcSet: normalizeSrcsetAndSizes(hero.image?.srcset),
2745
- sizes: normalizeSrcsetAndSizes(hero.image?.sizes),
2746
- width: 375,
2747
- height: 375,
2748
- className: "hidden dark:block"
2749
- })
2750
- ]
2751
- }) : null
2752
- ]
2753
- })
2754
- ]
2755
- });
2756
- }
2757
2944
  function normalizeSrcsetAndSizes(field) {
2758
2945
  const r = (Array.isArray(field) ? field : [
2759
2946
  field
@@ -2936,7 +3123,7 @@ function NavMenuSingleItem(item) {
2936
3123
  }
2937
3124
  }),
2938
3125
  (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("i", {
2939
- class: item.rightIcon,
3126
+ className: item.rightIcon,
2940
3127
  style: {
2941
3128
  marginLeft: '8px',
2942
3129
  fontSize: '12px',
@@ -4886,7 +5073,8 @@ function SearchPanel({ focused, setFocused }) {
4886
5073
  "aria-label": "SearchPanelInput",
4887
5074
  autoComplete: "off",
4888
5075
  autoFocus: true,
4889
- onChange: (e) => handleQueryChange(e.target.value)
5076
+ // onChange: (e) => handleQueryChange(e.target.value)
5077
+ onKeyUp: (e) => handleQueryChange(e.target.value)
4890
5078
  }),
4891
5079
  (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)("label", {
4892
5080
  children: (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime_225474f2__.jsx)(SvgWrapper, {
@@ -5064,4 +5252,4 @@ const src_rslib_entry_ = {
5064
5252
  HomeLayout: HomeLayout,
5065
5253
  setup: setup
5066
5254
  };
5067
- export { Aside, Badge, Button, Card, DocFooter, DocLayout, EditLink, HomeFeature, HomeFooter, HomeHero, HomeLayout, HomepageLayout, LastUpdated, Layout, Link, LinkCard, Nav, NotFoundLayout, Overview, PackageManagerTabs, PrevNextPage, types_RenderType as RenderType, ScrollToTop, Search, SearchPanel, Sidebar, SidebarList, SocialLinks, SourceCode, Steps, SwitchAppearance, Tab, Tabs, Tag, Toc, bindingAsideScroll, src_rslib_entry_ as default, getCustomMDXComponent, isMobileDevice, parseInlineMarkdownText, renderHtmlOrText, renderInlineMarkdown, scrollToTarget, setup, useEditLink, useEnableNav, useFullTextSearch, useHiddenNav, useLocaleSiteData, usePathUtils, usePrevNextPage, useRedirect4FirstVisit, useSidebarData, useThemeState };
5255
+ export { Aside, Badge, Button, Card, DocFooter, DocLayout, EditLink, HomeFeature, HomeFooter, HomeLayout, HomepageLayout, HomepageTopSearch, HomepageTopics, HomepageFeatures, HomepageFaqs, LastUpdated, Layout, Link, LinkCard, Nav, NotFoundLayout, Overview, PackageManagerTabs, PrevNextPage, types_RenderType as RenderType, ScrollToTop, Search, SearchPanel, Sidebar, SidebarList, SocialLinks, SourceCode, Steps, SwitchAppearance, Tab, Tabs, Tag, Toc, bindingAsideScroll, src_rslib_entry_ as default, getCustomMDXComponent, isMobileDevice, parseInlineMarkdownText, renderHtmlOrText, renderInlineMarkdown, scrollToTarget, setup, useEditLink, useEnableNav, useFullTextSearch, useHiddenNav, useLocaleSiteData, usePathUtils, usePrevNextPage, useRedirect4FirstVisit, useSidebarData, useThemeState };
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.1.5",
4
+ "version": "0.1.7",
5
5
  "license": "MIT",
6
6
  "sideEffects": [
7
7
  "*.css",
@@ -33,7 +33,7 @@
33
33
  "react-helmet-async": "^1.3.0",
34
34
  "react-syntax-highlighter": "^15.6.1",
35
35
  "@rspress/runtime": "1.43.8",
36
- "@rspress-theme-anatole/shared": "0.1.5"
36
+ "@rspress-theme-anatole/shared": "0.1.7"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@microsoft/api-extractor": "^7.49.2",