@onside/install-widget 1.0.0 → 1.0.1

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.
@@ -1,5 +1,5 @@
1
+ import { CSSProperties } from 'react';
1
2
  import { JSX } from 'react/jsx-runtime';
2
- import { MouseEvent as MouseEvent_2 } from 'react';
3
3
  import { PropsWithChildren } from 'react';
4
4
 
5
5
  export declare const AVERAGE_CHECK_TIME: number;
@@ -10,10 +10,9 @@ export declare const AVERAGE_LOADING_TIME: number;
10
10
 
11
11
  declare type ButtonLocation = "hero" | "header" | "fixed_bottom" | "install_guide" | "get_approved" | "go_to_safari" | "update_ios" | "unavailable_outside_eu" | "debug";
12
12
 
13
- export declare const createInstallAnalyticsHandler: (analyticsProps?: Record<string, unknown>) => {
14
- trackInstallEvent: (eventType: string) => void;
15
- trackOpenModalEvent: (modalName: string) => void;
16
- };
13
+ export declare interface InstallAnalyticsCallbacks {
14
+ onEvent?: (payload: TrackedAnalyticsEvent) => void;
15
+ }
17
16
 
18
17
  export declare const InstallAppButton: (props: PropsWithChildren<InstallAppButtonProps>) => JSX.Element;
19
18
 
@@ -21,11 +20,13 @@ export declare interface InstallAppButtonProps {
21
20
  className?: string;
22
21
  androidClassName?: string;
23
22
  androidTextClassName?: string;
23
+ captionClassName?: string;
24
+ customAnalytics?: InstallAnalyticsCallbacks;
24
25
  handleCustomStep?: () => void;
25
- onClick?: (e: MouseEvent_2) => void;
26
26
  location?: ButtonLocation;
27
27
  caption?: string;
28
28
  showCaption?: boolean;
29
+ styleVars?: InstallWidgetStyleVars;
29
30
  id?: string;
30
31
  showLoaderOnly?: boolean;
31
32
  }
@@ -46,22 +47,28 @@ export declare interface InstallModalBaseProps {
46
47
  onClose: () => void;
47
48
  }
48
49
 
49
- export declare const useInstallConditions: () => {
50
- canInstall: boolean;
51
- shouldGoToSafari: boolean;
52
- shouldUpdateIOS: boolean;
53
- isIOS186PlusVersion: boolean;
54
- isAndroid: boolean;
55
- };
50
+ export declare const InstallWidgetProvider: ({ children }: PropsWithChildren) => JSX.Element;
56
51
 
57
- export declare const useInstallUrl: (isAvailable?: boolean) => {
58
- installUrl: string | null;
59
- attribution_token: string | null;
60
- isEligible: boolean | null;
61
- onside_token: string | null;
62
- isLoading: boolean;
63
- error: Error | null;
64
- fetchInstallData: () => Promise<void>;
52
+ declare type InstallWidgetStyleVars = CSSProperties & {
53
+ "--onside-btn-bg"?: string;
54
+ "--onside-btn-text"?: string;
55
+ "--onside-btn-bg-hover"?: string;
56
+ "--onside-btn-disabled-bg"?: string;
57
+ "--onside-btn-radius"?: string;
58
+ "--onside-btn-px"?: string;
59
+ "--onside-btn-py"?: string;
60
+ "--onside-btn-font-size"?: string;
61
+ "--onside-caption-color"?: string;
62
+ "--onside-caption-size"?: string;
63
+ "--onside-caption-line-height"?: string;
65
64
  };
66
65
 
66
+ declare interface TrackedAnalyticsEvent {
67
+ event: "amplitude_event";
68
+ event_name: string;
69
+ event_properties: Record<string, unknown>;
70
+ user_properties?: Record<string, unknown>;
71
+ url: string;
72
+ }
73
+
67
74
  export { }