@levi-gemcommerce/analytics 1.0.0-dev.30 → 1.0.0-dev.31

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/esm/index.js CHANGED
@@ -20941,7 +20941,7 @@ const useResizeObserver = () => {
20941
20941
  };
20942
20942
 
20943
20943
  function useBrowserCheck() {
20944
- const userAgent = navigator?.userAgent;
20944
+ const userAgent = typeof navigator !== 'undefined' ? navigator.userAgent : '';
20945
20945
  return useMemo(() => {
20946
20946
  const isFirefox = userAgent.includes('Firefox');
20947
20947
  const isChromium = userAgent.includes('Chrome');
@@ -23124,8 +23124,11 @@ function TooltipTitle({ children, theme, color }) {
23124
23124
  }
23125
23125
 
23126
23126
  const useRootContainer = (id) => {
23127
- const ref = useRef(document.getElementById(id));
23127
+ const ref = useRef(typeof document !== 'undefined' ? document.getElementById(id) : null);
23128
23128
  function getRootElem() {
23129
+ if (typeof document === 'undefined') {
23130
+ return null;
23131
+ }
23129
23132
  if (!ref.current) {
23130
23133
  ref.current = document.createElement('div');
23131
23134
  ref.current.id = id;
@@ -23138,6 +23141,9 @@ const useRootContainer = (id) => {
23138
23141
 
23139
23142
  function TooltipWithPortal({ children }) {
23140
23143
  const container = useRootContainer(TOOLTIP_ID);
23144
+ if (!container) {
23145
+ return null;
23146
+ }
23141
23147
  return createPortal(children, container);
23142
23148
  }
23143
23149
 
@@ -20941,7 +20941,7 @@ const useResizeObserver = () => {
20941
20941
  };
20942
20942
 
20943
20943
  function useBrowserCheck() {
20944
- const userAgent = navigator?.userAgent;
20944
+ const userAgent = typeof navigator !== 'undefined' ? navigator.userAgent : '';
20945
20945
  return useMemo(() => {
20946
20946
  const isFirefox = userAgent.includes('Firefox');
20947
20947
  const isChromium = userAgent.includes('Chrome');
@@ -23124,8 +23124,11 @@ function TooltipTitle({ children, theme, color }) {
23124
23124
  }
23125
23125
 
23126
23126
  const useRootContainer = (id) => {
23127
- const ref = useRef(document.getElementById(id));
23127
+ const ref = useRef(typeof document !== 'undefined' ? document.getElementById(id) : null);
23128
23128
  function getRootElem() {
23129
+ if (typeof document === 'undefined') {
23130
+ return null;
23131
+ }
23129
23132
  if (!ref.current) {
23130
23133
  ref.current = document.createElement('div');
23131
23134
  ref.current.id = id;
@@ -23138,6 +23141,9 @@ const useRootContainer = (id) => {
23138
23141
 
23139
23142
  function TooltipWithPortal({ children }) {
23140
23143
  const container = useRootContainer(TOOLTIP_ID);
23144
+ if (!container) {
23145
+ return null;
23146
+ }
23141
23147
  return createPortal(children, container);
23142
23148
  }
23143
23149
 
@@ -1,4 +1,4 @@
1
1
  import type { ReactNode } from 'react';
2
2
  export declare function TooltipWithPortal({ children }: {
3
3
  children: ReactNode;
4
- }): import("react").ReactPortal;
4
+ }): import("react").ReactPortal | null;
@@ -1 +1 @@
1
- export declare const useRootContainer: (id: string) => HTMLElement;
1
+ export declare const useRootContainer: (id: string) => HTMLElement | null;
@@ -1,4 +1,4 @@
1
1
  import type { ReactNode } from 'react';
2
2
  export declare function TooltipWithPortal({ children }: {
3
3
  children: ReactNode;
4
- }): import("react").ReactPortal;
4
+ }): import("react").ReactPortal | null;
@@ -1 +1 @@
1
- export declare const useRootContainer: (id: string) => HTMLElement;
1
+ export declare const useRootContainer: (id: string) => HTMLElement | null;