@outseta/react 0.3.7 → 0.4.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.
- package/README.md +77 -7
- package/dist/index.js +754 -148
- package/package.json +13 -5
- package/src/components/AuthButton.tsx +33 -0
- package/src/components/AuthEmbed.tsx +4 -0
- package/src/components/EmailListButton.tsx +38 -0
- package/src/components/EmailListEmbed.tsx +28 -0
- package/src/components/EmailListForm.tsx +34 -0
- package/src/components/LeadCaptureButton.tsx +38 -0
- package/src/components/LeadCaptureEmbed.tsx +28 -0
- package/src/components/LoginButton.tsx +18 -0
- package/src/components/LogoutButton.tsx +8 -1
- package/src/components/OutsetaProvider.tsx +36 -7
- package/src/components/ProfileButton.tsx +35 -0
- package/src/components/ProfileEmbed.tsx +8 -2
- package/src/components/PurchaseAddonButton.tsx +8 -4
- package/src/components/SignupButton.tsx +18 -0
- package/src/components/SupportButton.tsx +35 -0
- package/src/components/SupportEmbed.tsx +17 -0
- package/src/components/index.ts +27 -0
- package/src/components/types.ts +33 -4
- package/src/components/utils.ts +13 -0
- package/src/generated/activity/activity.ts +2 -2
- package/src/generated/attribute/attribute.ts +2 -2
- package/src/generated/billing/billing.ts +2 -2
- package/src/generated/crm/crm.ts +2 -2
- package/src/generated/email/email.ts +2 -2
- package/src/generated/outsetaAPI.schemas.ts +5149 -60
- package/src/generated/public/public.ts +2 -2
- package/src/generated/support/support.ts +2 -2
- package/src/index.ts +1 -1
- package/src/mutator.ts +3 -3
- package/src/query.test.ts +276 -0
- package/src/query.ts +352 -0
package/src/components/types.ts
CHANGED
|
@@ -30,11 +30,14 @@ export interface OutsetaUser {
|
|
|
30
30
|
[key: string]: unknown;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
export type OutsetaWidgetMode = "popup" | "embed";
|
|
34
|
+
export type AuthWidgetMode = "login" | "register" | "login|register";
|
|
35
|
+
|
|
33
36
|
export interface AuthWidgetOptions {
|
|
34
|
-
widgetMode?:
|
|
37
|
+
widgetMode?: AuthWidgetMode;
|
|
35
38
|
authenticationCallbackUrl?: string;
|
|
36
|
-
mode?:
|
|
37
|
-
registrationDefaults?: string
|
|
39
|
+
mode?: OutsetaWidgetMode;
|
|
40
|
+
registrationDefaults?: string | Record<string, unknown>;
|
|
38
41
|
[key: string]: unknown;
|
|
39
42
|
}
|
|
40
43
|
|
|
@@ -46,11 +49,28 @@ export interface ProfileWidgetOptions {
|
|
|
46
49
|
| "purchaseAddOn"
|
|
47
50
|
| "passwordChange"
|
|
48
51
|
| "teamMembers";
|
|
49
|
-
mode?:
|
|
52
|
+
mode?: OutsetaWidgetMode;
|
|
50
53
|
stateProps?: Record<string, unknown>;
|
|
51
54
|
[key: string]: unknown;
|
|
52
55
|
}
|
|
53
56
|
|
|
57
|
+
export interface SupportWidgetOptions {
|
|
58
|
+
mode?: OutsetaWidgetMode;
|
|
59
|
+
[key: string]: unknown;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface EmailListWidgetOptions {
|
|
63
|
+
emailListUid: string;
|
|
64
|
+
mode?: OutsetaWidgetMode;
|
|
65
|
+
[key: string]: unknown;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface LeadCaptureWidgetOptions {
|
|
69
|
+
formUid: string;
|
|
70
|
+
mode?: OutsetaWidgetMode;
|
|
71
|
+
[key: string]: unknown;
|
|
72
|
+
}
|
|
73
|
+
|
|
54
74
|
export interface OutsetaEmbed {
|
|
55
75
|
setAccessToken: (token: string) => void;
|
|
56
76
|
getAccessToken: () => Promise<string | null>;
|
|
@@ -63,6 +83,15 @@ export interface OutsetaEmbed {
|
|
|
63
83
|
profile: {
|
|
64
84
|
open: (options?: ProfileWidgetOptions) => void;
|
|
65
85
|
};
|
|
86
|
+
support?: {
|
|
87
|
+
open: (options?: SupportWidgetOptions) => void;
|
|
88
|
+
};
|
|
89
|
+
emailList?: {
|
|
90
|
+
open: (options: EmailListWidgetOptions) => void;
|
|
91
|
+
};
|
|
92
|
+
leadCapture?: {
|
|
93
|
+
open: (options: LeadCaptureWidgetOptions) => void;
|
|
94
|
+
};
|
|
66
95
|
}
|
|
67
96
|
|
|
68
97
|
declare global {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { MouseEventHandler } from "react";
|
|
2
|
+
|
|
3
|
+
export function composeButtonClick(
|
|
4
|
+
onClick: MouseEventHandler<HTMLButtonElement> | undefined,
|
|
5
|
+
action: () => void,
|
|
6
|
+
): MouseEventHandler<HTMLButtonElement> {
|
|
7
|
+
return (event) => {
|
|
8
|
+
onClick?.(event);
|
|
9
|
+
if (!event.defaultPrevented) {
|
|
10
|
+
action();
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
useMutation,
|
|
4
4
|
useQuery
|
|
5
|
-
} from '
|
|
5
|
+
} from '../../query';
|
|
6
6
|
import type {
|
|
7
7
|
MutationFunction,
|
|
8
8
|
QueryFunction,
|
|
@@ -11,7 +11,7 @@ import type {
|
|
|
11
11
|
UseMutationResult,
|
|
12
12
|
UseQueryOptions,
|
|
13
13
|
UseQueryResult
|
|
14
|
-
} from '
|
|
14
|
+
} from '../../query';
|
|
15
15
|
|
|
16
16
|
import type {
|
|
17
17
|
Activity,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import {
|
|
3
3
|
useQuery
|
|
4
|
-
} from '
|
|
4
|
+
} from '../../query';
|
|
5
5
|
import type {
|
|
6
6
|
QueryFunction,
|
|
7
7
|
QueryKey,
|
|
8
8
|
UseQueryOptions,
|
|
9
9
|
UseQueryResult
|
|
10
|
-
} from '
|
|
10
|
+
} from '../../query';
|
|
11
11
|
|
|
12
12
|
import type {
|
|
13
13
|
Definition
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
useMutation,
|
|
4
4
|
useQuery
|
|
5
|
-
} from '
|
|
5
|
+
} from '../../query';
|
|
6
6
|
import type {
|
|
7
7
|
MutationFunction,
|
|
8
8
|
QueryFunction,
|
|
@@ -11,7 +11,7 @@ import type {
|
|
|
11
11
|
UseMutationResult,
|
|
12
12
|
UseQueryOptions,
|
|
13
13
|
UseQueryResult
|
|
14
|
-
} from '
|
|
14
|
+
} from '../../query';
|
|
15
15
|
|
|
16
16
|
import type {
|
|
17
17
|
DiscountCoupon,
|
package/src/generated/crm/crm.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
useMutation,
|
|
4
4
|
useQuery
|
|
5
|
-
} from '
|
|
5
|
+
} from '../../query';
|
|
6
6
|
import type {
|
|
7
7
|
MutationFunction,
|
|
8
8
|
QueryFunction,
|
|
@@ -11,7 +11,7 @@ import type {
|
|
|
11
11
|
UseMutationResult,
|
|
12
12
|
UseQueryOptions,
|
|
13
13
|
UseQueryResult
|
|
14
|
-
} from '
|
|
14
|
+
} from '../../query';
|
|
15
15
|
|
|
16
16
|
import type {
|
|
17
17
|
Account,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
useMutation,
|
|
4
4
|
useQuery
|
|
5
|
-
} from '
|
|
5
|
+
} from '../../query';
|
|
6
6
|
import type {
|
|
7
7
|
MutationFunction,
|
|
8
8
|
QueryFunction,
|
|
@@ -11,7 +11,7 @@ import type {
|
|
|
11
11
|
UseMutationResult,
|
|
12
12
|
UseQueryOptions,
|
|
13
13
|
UseQueryResult
|
|
14
|
-
} from '
|
|
14
|
+
} from '../../query';
|
|
15
15
|
|
|
16
16
|
import type {
|
|
17
17
|
BroadcastCampaign,
|