@rpcbase/client 0.389.0 → 0.391.0

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/index.js CHANGED
@@ -6,8 +6,8 @@ import { getNavigationGuards, createRoutesFromElements, createBrowserRouter, Rou
6
6
  import { hydrateRoot } from "react-dom/client";
7
7
  import { r as reportClientException } from "./errorReporting-CVoUUKxW.js";
8
8
  import { s } from "./errorReporting-CVoUUKxW.js";
9
- import { n as hydrateRtsFromWindow, v as useQuery } from "./useQuery-ClKeTB8S.js";
10
- import { R, S, p, q, t } from "./useQuery-ClKeTB8S.js";
9
+ import { n as hydrateRtsFromWindow, v as useQuery } from "./useQuery-CUjwBdkK.js";
10
+ import { R, S, p, q, t } from "./useQuery-CUjwBdkK.js";
11
11
  const emptyUnsubscribe = () => {
12
12
  };
13
13
  const useMediaQuery = (query) => {
@@ -491,6 +491,17 @@ const cleanupURL = () => {
491
491
  });
492
492
  }
493
493
  };
494
+ const isDesktopDevice = () => {
495
+ if (typeof window === "undefined") {
496
+ return false;
497
+ }
498
+ if (typeof window.matchMedia !== "function") {
499
+ return false;
500
+ }
501
+ const hasDesktopPointer = window.matchMedia("(hover: hover) and (pointer: fine)").matches;
502
+ const hasTouch = typeof navigator !== "undefined" && navigator.maxTouchPoints > 0;
503
+ return hasDesktopPointer && !hasTouch;
504
+ };
494
505
  const DEFAULT_PRIORITY = 0;
495
506
  const canBlockNavigation = (guard, {
496
507
  isPathnameChange,
@@ -957,7 +968,7 @@ const initWithRoutes = async (routesElement, opts) => {
957
968
  /* @__PURE__ */ jsx(ClientOnly, { children: /* @__PURE__ */ jsx(Toaster, {}) })
958
969
  ] }) }), hydrationOptions);
959
970
  };
960
- if (!isProduction && !env.SSR) {
971
+ if (!isProduction && !env.SSR && isDesktopDevice()) {
961
972
  import("react-grab/core").then(({
962
973
  init
963
974
  }) => {