veryfront 0.1.846 → 0.1.847

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/esm/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.846",
3
+ "version": "0.1.847",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "minimumDependencyAge": {
@@ -1 +1 @@
1
- {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../../src/src/html/hydration-script-builder/templates/router.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,cAy0B3B,CAAC"}
1
+ {"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../../../../src/src/html/hydration-script-builder/templates/router.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,cA+0B3B,CAAC"}
@@ -628,9 +628,19 @@ export const getRouterScript = () => `
628
628
  // Prefetching on hover
629
629
  // ============================================
630
630
  let prefetchTimeout = null;
631
+ let currentHoverLink = null;
631
632
  const prefetchedPaths = new Set();
632
633
  const inFlightPrefetches = new Set();
633
634
 
635
+ function cancelScheduledPrefetch() {
636
+ if (prefetchTimeout) {
637
+ clearTimeout(prefetchTimeout);
638
+ prefetchTimeout = null;
639
+ }
640
+
641
+ currentHoverLink = null;
642
+ }
643
+
634
644
  function getPageDataModulePaths(pageData) {
635
645
  const layoutPaths = (pageData.layouts || []).map((l) => l.path).filter(Boolean);
636
646
  const allPaths = [pageData.pagePath, ...layoutPaths].filter(Boolean);
@@ -660,6 +670,7 @@ export const getRouterScript = () => `
660
670
  }
661
671
 
662
672
  function prefetchPage(href) {
673
+ if (isNavigating) return;
663
674
  if (prefetchedPaths.has(href) || inFlightPrefetches.has(href)) return;
664
675
 
665
676
  const cachedPageData = getCachedPageData(href);
@@ -780,11 +791,10 @@ export const getRouterScript = () => `
780
791
  }
781
792
 
782
793
  e.preventDefault();
794
+ cancelScheduledPrefetch();
783
795
  void navigateSPA(href, true);
784
796
  });
785
797
 
786
- let currentHoverLink = null;
787
-
788
798
  document.addEventListener(
789
799
  'mouseenter',
790
800
  (e) => {
@@ -819,11 +829,7 @@ export const getRouterScript = () => `
819
829
  const relatedTarget = e.relatedTarget;
820
830
  if (currentHoverLink && relatedTarget && currentHoverLink.contains(relatedTarget)) return;
821
831
 
822
- if (prefetchTimeout) {
823
- clearTimeout(prefetchTimeout);
824
- prefetchTimeout = null;
825
- }
826
- currentHoverLink = null;
832
+ cancelScheduledPrefetch();
827
833
  },
828
834
  true
829
835
  );
@@ -1,3 +1,3 @@
1
1
  /** Shared version value. */
2
- export declare const VERSION = "0.1.846";
2
+ export declare const VERSION = "0.1.847";
3
3
  //# sourceMappingURL=version-constant.d.ts.map
@@ -1,4 +1,4 @@
1
1
  // Keep in sync with deno.json version.
2
2
  // scripts/release.ts updates this constant during releases.
3
3
  /** Shared version value. */
4
- export const VERSION = "0.1.846";
4
+ export const VERSION = "0.1.847";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veryfront",
3
- "version": "0.1.846",
3
+ "version": "0.1.847",
4
4
  "description": "The simplest way to build AI-powered apps",
5
5
  "keywords": [
6
6
  "react",