@trycourier/courier-react-native 1.0.9 → 2.0.0-beta1
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/LICENSE +1 -1
- package/README.md +16 -412
- package/android/build.gradle +48 -83
- package/android/src/main/AndroidManifest.xml +0 -1
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/com/courierreactnative/CourierReactNativeActivity.kt +10 -10
- package/android/src/main/java/com/courierreactnative/CourierReactNativeModule.kt +146 -137
- package/android/src/main/java/com/courierreactnative/CourierReactNativePackage.kt +1 -3
- package/android/src/main/java/com/courierreactnative/CourierReactNativeViewManager.kt +43 -0
- package/courier-react-native.podspec +12 -4
- package/ios/CourierReactNative-Bridging-Header.h +0 -1
- package/ios/CourierReactNative.xcodeproj/project.pbxproj +4 -4
- package/ios/CourierReactNative.xcodeproj/project.xcworkspace/contents.xcworkspacedata +4 -0
- package/ios/CourierReactNativeModule.m +53 -0
- package/ios/{CourierReactNative.swift → CourierReactNativeModule.swift} +178 -45
- package/ios/CourierReactNativeViewManager.m +15 -0
- package/ios/CourierReactNativeViewManager.swift +348 -0
- package/lib/commonjs/index.js +86 -210
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/models/CourierInboxListener.js +26 -0
- package/lib/commonjs/models/CourierInboxListener.js.map +1 -0
- package/lib/commonjs/models/CourierInboxTheme.js +2 -0
- package/lib/commonjs/models/CourierInboxTheme.js.map +1 -0
- package/lib/commonjs/models/InboxAction.js +2 -0
- package/lib/commonjs/models/InboxAction.js.map +1 -0
- package/lib/commonjs/models/InboxMessage.js +6 -0
- package/lib/commonjs/models/InboxMessage.js.map +1 -0
- package/lib/commonjs/views/CourierInboxView.js +53 -0
- package/lib/commonjs/views/CourierInboxView.js.map +1 -0
- package/lib/module/index.js +80 -209
- package/lib/module/index.js.map +1 -1
- package/lib/module/models/CourierInboxListener.js +18 -0
- package/lib/module/models/CourierInboxListener.js.map +1 -0
- package/lib/module/models/CourierInboxTheme.js +2 -0
- package/lib/module/models/CourierInboxTheme.js.map +1 -0
- package/lib/module/models/InboxAction.js +2 -0
- package/lib/module/models/InboxAction.js.map +1 -0
- package/lib/module/models/InboxMessage.js +2 -0
- package/lib/module/models/InboxMessage.js.map +1 -0
- package/lib/module/views/CourierInboxView.js +45 -0
- package/lib/module/views/CourierInboxView.js.map +1 -0
- package/lib/typescript/index.d.ts +46 -92
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/models/CourierInboxListener.d.ts +9 -0
- package/lib/typescript/models/CourierInboxListener.d.ts.map +1 -0
- package/lib/typescript/models/CourierInboxTheme.d.ts +34 -0
- package/lib/typescript/models/CourierInboxTheme.d.ts.map +1 -0
- package/lib/typescript/models/InboxAction.d.ts +8 -0
- package/lib/typescript/models/InboxAction.d.ts.map +1 -0
- package/lib/typescript/models/InboxMessage.d.ts +18 -0
- package/lib/typescript/models/InboxMessage.d.ts.map +1 -0
- package/lib/typescript/views/CourierInboxView.d.ts +16 -0
- package/lib/typescript/views/CourierInboxView.d.ts.map +1 -0
- package/package.json +61 -44
- package/src/index.tsx +213 -0
- package/src/models/CourierInboxListener.tsx +25 -0
- package/src/models/CourierInboxTheme.tsx +30 -0
- package/src/models/InboxAction.tsx +5 -0
- package/src/models/InboxMessage.tsx +16 -0
- package/src/views/CourierInboxView.tsx +85 -0
- package/android/.gradle/7.1/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.1/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.1/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/7.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.1/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/compiler.xml +0 -6
- package/android/.idea/gradle.xml +0 -17
- package/android/.idea/jarRepositories.xml +0 -35
- package/android/.idea/misc.xml +0 -10
- package/android/.idea/vcs.xml +0 -6
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -5
- package/android/gradlew +0 -185
- package/android/gradlew.bat +0 -89
- package/android/local.properties +0 -8
- package/android/src/main/java/com/courierreactnative/NotificationPermissionStatus.kt +0 -6
- package/ios/CourierReactNative.m +0 -52
- package/ios/CourierReactNativeDelegate.h +0 -20
- package/ios/CourierReactNativeDelegate.m +0 -125
- package/src/index.ts +0 -337
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
1
|
+
import { CourierInboxListener } from './models/CourierInboxListener';
|
|
2
|
+
import { InboxMessage } from './models/InboxMessage';
|
|
3
|
+
export { CourierInboxView } from './views/CourierInboxView';
|
|
5
4
|
declare class Courier {
|
|
6
|
-
|
|
7
|
-
readonly PUSH_NOTIFICATION_DELIVERED = "pushNotificationDelivered";
|
|
8
|
-
constructor();
|
|
9
|
-
private setDefaults;
|
|
5
|
+
private static _sharedInstance;
|
|
10
6
|
private _isDebugging;
|
|
11
7
|
private debugListener;
|
|
8
|
+
constructor();
|
|
9
|
+
static get shared(): Courier;
|
|
10
|
+
private setDefaults;
|
|
12
11
|
/**
|
|
13
12
|
* Tells native Courier SDKs to show or hide logs.
|
|
14
13
|
* Defaults to the React __DEV__ mode
|
|
@@ -29,6 +28,7 @@ declare class Courier {
|
|
|
29
28
|
* ```
|
|
30
29
|
*await Courier.signIn({
|
|
31
30
|
accessToken: YOUR_COURIER_GENERATED_JWT,
|
|
31
|
+
clientKey: YOUR_CLIENT_KEY,
|
|
32
32
|
userId: YOUR_USER_ID,
|
|
33
33
|
})
|
|
34
34
|
* ```
|
|
@@ -36,103 +36,57 @@ declare class Courier {
|
|
|
36
36
|
* that is requested from your backend
|
|
37
37
|
* https://www.courier.com/docs/reference/auth/issue-token/
|
|
38
38
|
*/
|
|
39
|
-
signIn(
|
|
39
|
+
signIn(props: {
|
|
40
40
|
accessToken: string;
|
|
41
|
+
clientKey?: string;
|
|
41
42
|
userId: string;
|
|
42
43
|
}): Promise<void>;
|
|
43
44
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* @example await Courier.signOut()
|
|
45
|
+
* TODO
|
|
46
|
+
* @param props
|
|
47
|
+
* @returns
|
|
48
48
|
*/
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
* using Courier token management apis
|
|
53
|
-
* @example const apnsToken = await Courier.apnsToken
|
|
54
|
-
*/
|
|
55
|
-
get apnsToken(): Promise<string | undefined>;
|
|
49
|
+
readMessage(props: {
|
|
50
|
+
messageId: string;
|
|
51
|
+
}): Promise<void>;
|
|
56
52
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* @
|
|
53
|
+
* TODO
|
|
54
|
+
* @param props
|
|
55
|
+
* @returns
|
|
60
56
|
*/
|
|
61
|
-
|
|
57
|
+
unreadMessage(props: {
|
|
58
|
+
messageId: string;
|
|
59
|
+
}): Promise<void>;
|
|
62
60
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* @
|
|
61
|
+
* TODO
|
|
62
|
+
* @param props
|
|
63
|
+
* @returns
|
|
66
64
|
*/
|
|
67
|
-
|
|
65
|
+
readAllInboxMessages(): Promise<void>;
|
|
68
66
|
/**
|
|
69
|
-
*
|
|
70
|
-
* @
|
|
71
|
-
*
|
|
72
|
-
*const messageId = await sendPush({
|
|
73
|
-
authKey: YOUR_AUTH_KEY_THAT_SHOULD_NOT_STAY_IN_YOUR_PRODUCTION_APP,
|
|
74
|
-
userId: USER_ID,
|
|
75
|
-
title: 'This is a title',
|
|
76
|
-
body: 'This is a body',
|
|
77
|
-
providers: [CourierProvider.APNS, CourierProvider.FCM],
|
|
78
|
-
});
|
|
79
|
-
* ```
|
|
80
|
-
* @returns promise
|
|
81
|
-
*/
|
|
82
|
-
sendPush({ authKey, userId, title, body, providers, }: {
|
|
83
|
-
authKey: string;
|
|
84
|
-
userId: string;
|
|
85
|
-
title?: string;
|
|
86
|
-
body?: string;
|
|
87
|
-
providers: CourierProvider[];
|
|
88
|
-
}): Promise<string>;
|
|
89
|
-
/**
|
|
90
|
-
* Gets notification permission status at a system level.
|
|
91
|
-
* @example const permissionStatus = await Courier.getNotificationPermissionStatus()
|
|
67
|
+
* TODO
|
|
68
|
+
* @param props
|
|
69
|
+
* @returns
|
|
92
70
|
*/
|
|
93
|
-
|
|
71
|
+
addInboxListener(props: {
|
|
72
|
+
onInitialLoad?: () => void;
|
|
73
|
+
onError?: (error: string) => void;
|
|
74
|
+
onMessagesChanged?: (messages: InboxMessage[], unreadMessageCount: number, totalMessageCount: number, canPaginate: boolean) => void;
|
|
75
|
+
}): CourierInboxListener;
|
|
94
76
|
/**
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
* if the user has already been asked for permission.
|
|
99
|
-
* @example const permissionStatus = await Courier.requestNotificationPermission()
|
|
77
|
+
* TODO
|
|
78
|
+
* @param props
|
|
79
|
+
* @returns
|
|
100
80
|
*/
|
|
101
|
-
|
|
81
|
+
removeInboxListener(props: {
|
|
82
|
+
listenerId: string;
|
|
83
|
+
}): string;
|
|
102
84
|
/**
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* Defaults to sound, badge, list and/or banner.
|
|
107
|
-
*
|
|
108
|
-
* @example iOSForegroundPresentationOptions({options: ['sound']});
|
|
85
|
+
* TODO
|
|
86
|
+
* @param props
|
|
87
|
+
* @returns
|
|
109
88
|
*/
|
|
110
|
-
|
|
111
|
-
options: ('sound' | 'badge' | 'list' | 'banner')[];
|
|
112
|
-
}): Promise<void>;
|
|
113
|
-
/**
|
|
114
|
-
* @example
|
|
115
|
-
*```
|
|
116
|
-
const unsubPushListeners = () => {
|
|
117
|
-
return Courier.registerPushNotificationListeners<YOUR_NOTIFICATION_TYPE>({
|
|
118
|
-
onPushNotificationClicked: (push) => {
|
|
119
|
-
...
|
|
120
|
-
},
|
|
121
|
-
onPushNotificationDelivered: (push) => {
|
|
122
|
-
...
|
|
123
|
-
},
|
|
124
|
-
})
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// To unsubscribe the listeners
|
|
128
|
-
unsubPushListeners()
|
|
129
|
-
*```
|
|
130
|
-
* @returns function that can be used to unsubscribe from registered listeners
|
|
131
|
-
*/
|
|
132
|
-
registerPushNotificationListeners({ onPushNotificationClicked, onPushNotificationDelivered, }: {
|
|
133
|
-
onPushNotificationClicked: (_push: any) => void;
|
|
134
|
-
onPushNotificationDelivered: (_push: any) => void;
|
|
135
|
-
}): () => void;
|
|
89
|
+
refreshInbox(): Promise<void>;
|
|
136
90
|
}
|
|
137
|
-
|
|
138
|
-
|
|
91
|
+
export default Courier;
|
|
92
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAuB5D,cAAM,OAAO;IAEX,OAAO,CAAC,MAAM,CAAC,eAAe,CAAU;IACxC,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,aAAa,CAAkC;;IAWvD,WAAkB,MAAM,IAAI,OAAO,CAQlC;YAEa,WAAW;IAazB;;;;OAIG;IACU,cAAc,CAAC,WAAW,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAmBnE,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED;;;OAGG;IACH,IAAI,MAAM,IAAI,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAExC;IAED;;;;;;;;;;;;;;;OAeG;IACI,MAAM,CAAC,KAAK,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhG;;;;OAIG;IACI,WAAW,CAAC,KAAK,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAI/D;;;;OAIG;IACI,aAAa,CAAC,KAAK,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjE;;;;OAIG;IACI,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAI5C;;;;OAIG;IACI,gBAAgB,CAAC,KAAK,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;QAAC,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,EAAE,kBAAkB,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,KAAK,IAAI,CAAA;KAAE,GAAG,oBAAoB;IAkC5P;;;;OAIG;IACI,mBAAmB,CAAC,KAAK,EAAE;QAAE,UAAU,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM;IAIjE;;;;OAIG;IACU,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;CAI3C;AAED,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EmitterSubscription } from "react-native";
|
|
2
|
+
export declare class CourierInboxListener {
|
|
3
|
+
listenerId?: string;
|
|
4
|
+
onInitialLoad?: EmitterSubscription;
|
|
5
|
+
onError?: EmitterSubscription;
|
|
6
|
+
onMessagesChanged?: EmitterSubscription;
|
|
7
|
+
remove(): void;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=CourierInboxListener.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CourierInboxListener.d.ts","sourceRoot":"","sources":["../../../src/models/CourierInboxListener.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGnD,qBAAa,oBAAoB;IAExB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,aAAa,CAAC,EAAE,mBAAmB,CAAA;IACnC,OAAO,CAAC,EAAE,mBAAmB,CAAA;IAC7B,iBAAiB,CAAC,EAAE,mBAAmB,CAAA;IAEvC,MAAM;CAcd"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface CourierInboxFont {
|
|
2
|
+
family?: string;
|
|
3
|
+
size?: number;
|
|
4
|
+
color?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface CourierInboxButtonStyles {
|
|
7
|
+
font?: CourierInboxFont;
|
|
8
|
+
backgroundColor?: string;
|
|
9
|
+
cornerRadius?: number;
|
|
10
|
+
}
|
|
11
|
+
export default interface CourierInboxTheme {
|
|
12
|
+
unreadIndicatorBarColor?: string;
|
|
13
|
+
loadingIndicatorColor?: string;
|
|
14
|
+
titleFont?: CourierInboxFont;
|
|
15
|
+
timeFont?: CourierInboxFont;
|
|
16
|
+
bodyFont?: CourierInboxFont;
|
|
17
|
+
detailTitleFont?: CourierInboxFont;
|
|
18
|
+
buttonStyles?: CourierInboxButtonStyles;
|
|
19
|
+
iOS?: {
|
|
20
|
+
messageAnimationStyle?: 'fade' | 'right' | 'left' | 'top' | 'bottom' | 'none' | 'middle' | 'automatic';
|
|
21
|
+
cellStyles?: {
|
|
22
|
+
separatorStyle?: 'none' | 'singleLine' | 'singleLineEtched';
|
|
23
|
+
separatorInsets?: {
|
|
24
|
+
top?: number;
|
|
25
|
+
left?: number;
|
|
26
|
+
bottom?: number;
|
|
27
|
+
right?: number;
|
|
28
|
+
};
|
|
29
|
+
separatorColor?: string;
|
|
30
|
+
selectionStyle?: 'none' | 'blue' | 'gray' | 'default';
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=CourierInboxTheme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CourierInboxTheme.d.ts","sourceRoot":"","sources":["../../../src/models/CourierInboxTheme.tsx"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,EAAE,gBAAgB,CAAA;IACvB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,iBAAiB;IACxC,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,SAAS,CAAC,EAAE,gBAAgB,CAAA;IAC5B,QAAQ,CAAC,EAAE,gBAAgB,CAAA;IAC3B,QAAQ,CAAC,EAAE,gBAAgB,CAAA;IAC3B,eAAe,CAAC,EAAE,gBAAgB,CAAA;IAClC,YAAY,CAAC,EAAE,wBAAwB,CAAA;IACvC,GAAG,CAAC,EAAE;QACJ,qBAAqB,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,WAAW,CAAC;QACvG,UAAU,CAAC,EAAE;YACX,cAAc,CAAC,EAAE,MAAM,GAAG,YAAY,GAAG,kBAAkB,CAAC;YAC5D,eAAe,CAAC,EAAE;gBAAE,GAAG,CAAC,EAAE,MAAM,CAAC;gBAAC,IAAI,CAAC,EAAE,MAAM,CAAC;gBAAC,MAAM,CAAC,EAAE,MAAM,CAAC;gBAAC,KAAK,CAAC,EAAE,MAAM,CAAA;aAAE,CAAC;YACnF,cAAc,CAAC,EAAE,MAAM,CAAC;YACxB,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;SACtD,CAAA;KACF,CAAA;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InboxAction.d.ts","sourceRoot":"","sources":["../../../src/models/InboxAction.tsx"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,IAAI,CAAC;CACtC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { InboxAction } from "./InboxAction";
|
|
2
|
+
export interface InboxMessage {
|
|
3
|
+
messageId: string;
|
|
4
|
+
title?: string | null;
|
|
5
|
+
body?: string | null;
|
|
6
|
+
preview?: string | null;
|
|
7
|
+
created?: string | null;
|
|
8
|
+
actions?: InboxAction[] | null;
|
|
9
|
+
data?: {
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
} | null;
|
|
12
|
+
read?: boolean | null;
|
|
13
|
+
opened?: boolean | null;
|
|
14
|
+
archived?: boolean | null;
|
|
15
|
+
subtitle?: string | null;
|
|
16
|
+
time?: string;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=InboxMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InboxMessage.d.ts","sourceRoot":"","sources":["../../../src/models/InboxMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;IAC/B,IAAI,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,GAAG,IAAI,CAAC;IACrC,IAAI,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;IACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ViewStyle } from "react-native";
|
|
3
|
+
import CourierInboxTheme from "src/models/CourierInboxTheme";
|
|
4
|
+
import { InboxAction } from "src/models/InboxAction";
|
|
5
|
+
import { InboxMessage } from "src/models/InboxMessage";
|
|
6
|
+
type CourierInboxViewProps = {
|
|
7
|
+
lightTheme?: CourierInboxTheme;
|
|
8
|
+
darkTheme?: CourierInboxTheme;
|
|
9
|
+
onClickInboxMessageAtIndex?: (message: InboxMessage, index: number) => void;
|
|
10
|
+
onClickInboxActionForMessageAtIndex?: (action: InboxAction, message: InboxMessage, index: number) => void;
|
|
11
|
+
onScrollInbox?: (offsetY: number, offsetX: number) => void;
|
|
12
|
+
style?: ViewStyle;
|
|
13
|
+
};
|
|
14
|
+
export declare const CourierInboxView: (props: CourierInboxViewProps) => React.JSX.Element;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=CourierInboxView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CourierInboxView.d.ts","sourceRoot":"","sources":["../../../src/views/CourierInboxView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAA+C,SAAS,EAAE,MAAM,cAAc,CAAC;AACtF,OAAO,iBAAiB,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,KAAK,qBAAqB,GAAG;IAC3B,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,0BAA0B,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5E,mCAAmC,CAAC,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1G,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3D,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC;AAiBF,eAAO,MAAM,gBAAgB,UAAW,qBAAqB,sBAsD5D,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trycourier/courier-react-native",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "2.0.0-beta1",
|
|
4
|
+
"description": "Inbox & Push Notifications for React Native",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
7
7
|
"types": "lib/typescript/index.d.ts",
|
|
@@ -13,24 +13,30 @@
|
|
|
13
13
|
"android",
|
|
14
14
|
"ios",
|
|
15
15
|
"cpp",
|
|
16
|
-
"
|
|
16
|
+
"*.podspec",
|
|
17
17
|
"!lib/typescript/example",
|
|
18
|
-
"!android/build",
|
|
19
18
|
"!ios/build",
|
|
19
|
+
"!android/build",
|
|
20
|
+
"!android/gradle",
|
|
21
|
+
"!android/gradlew",
|
|
22
|
+
"!android/gradlew.bat",
|
|
23
|
+
"!android/local.properties",
|
|
20
24
|
"!**/__tests__",
|
|
21
25
|
"!**/__fixtures__",
|
|
22
|
-
"!**/__mocks__"
|
|
26
|
+
"!**/__mocks__",
|
|
27
|
+
"!**/.*"
|
|
23
28
|
],
|
|
24
29
|
"scripts": {
|
|
25
30
|
"test": "jest",
|
|
26
|
-
"
|
|
31
|
+
"typecheck": "tsc --noEmit",
|
|
27
32
|
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
28
|
-
"
|
|
33
|
+
"prepack": "bob build",
|
|
29
34
|
"release": "release-it",
|
|
30
35
|
"example": "yarn --cwd example",
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
36
|
+
"build:android": "cd example/android && ./gradlew assembleDebug --no-daemon --console=plain -PreactNativeArchitectures=arm64-v8a",
|
|
37
|
+
"build:ios": "cd example/ios && xcodebuild -workspace CourierReactNativeExample.xcworkspace -scheme CourierReactNativeExample -configuration Debug -sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO",
|
|
38
|
+
"bootstrap": "yarn example && yarn install && yarn example pods",
|
|
39
|
+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build"
|
|
34
40
|
},
|
|
35
41
|
"keywords": [
|
|
36
42
|
"react-native",
|
|
@@ -38,7 +44,7 @@
|
|
|
38
44
|
"android"
|
|
39
45
|
],
|
|
40
46
|
"repository": "https://github.com/trycourier/courier-react-native",
|
|
41
|
-
"author": "
|
|
47
|
+
"author": "mikemilla <mike@mikemiller.design> (https://github.com/mikemilla)",
|
|
42
48
|
"license": "MIT",
|
|
43
49
|
"bugs": {
|
|
44
50
|
"url": "https://github.com/trycourier/courier-react-native/issues"
|
|
@@ -48,33 +54,27 @@
|
|
|
48
54
|
"registry": "https://registry.npmjs.org/"
|
|
49
55
|
},
|
|
50
56
|
"devDependencies": {
|
|
51
|
-
"@babel/eslint-parser": "^7.18.2",
|
|
52
57
|
"@commitlint/config-conventional": "^17.0.2",
|
|
53
|
-
"@
|
|
58
|
+
"@evilmartians/lefthook": "^1.2.2",
|
|
59
|
+
"@react-native-community/eslint-config": "^3.0.2",
|
|
54
60
|
"@release-it/conventional-changelog": "^5.0.0",
|
|
55
61
|
"@types/jest": "^28.1.2",
|
|
56
62
|
"@types/react": "~17.0.21",
|
|
57
|
-
"@types/react-native": "0.
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"cz-conventional-changelog": "^3.3.0",
|
|
62
|
-
"eslint": "^8.27.0",
|
|
63
|
-
"eslint-config-airbnb": "^19.0.4",
|
|
63
|
+
"@types/react-native": "0.70.0",
|
|
64
|
+
"commitlint": "^17.0.2",
|
|
65
|
+
"del-cli": "^5.0.0",
|
|
66
|
+
"eslint": "^8.4.1",
|
|
64
67
|
"eslint-config-prettier": "^8.5.0",
|
|
65
|
-
"eslint-plugin-
|
|
66
|
-
"eslint-plugin-jsx-a11y": "^6.6.1",
|
|
67
|
-
"eslint-plugin-prettier": "^4.2.1",
|
|
68
|
-
"eslint-plugin-react": "^7.31.10",
|
|
68
|
+
"eslint-plugin-prettier": "^4.0.0",
|
|
69
69
|
"jest": "^28.1.1",
|
|
70
|
-
"lefthook": "^1.2.0",
|
|
71
70
|
"pod-install": "^0.1.0",
|
|
72
|
-
"prettier": "^2.
|
|
73
|
-
"react": "
|
|
74
|
-
"react-native": "0.
|
|
75
|
-
"react-native-builder-bob": "^0.
|
|
71
|
+
"prettier": "^2.0.5",
|
|
72
|
+
"react": "18.2.0",
|
|
73
|
+
"react-native": "0.72.4",
|
|
74
|
+
"react-native-builder-bob": "^0.21.3",
|
|
76
75
|
"release-it": "^15.0.0",
|
|
77
|
-
"
|
|
76
|
+
"turbo": "^1.10.7",
|
|
77
|
+
"typescript": "^5.0.2"
|
|
78
78
|
},
|
|
79
79
|
"resolutions": {
|
|
80
80
|
"@types/react": "17.0.21"
|
|
@@ -83,14 +83,15 @@
|
|
|
83
83
|
"react": "*",
|
|
84
84
|
"react-native": "*"
|
|
85
85
|
},
|
|
86
|
+
"engines": {
|
|
87
|
+
"node": ">= 16.0.0"
|
|
88
|
+
},
|
|
89
|
+
"packageManager": "^yarn@1.22.15",
|
|
86
90
|
"jest": {
|
|
87
91
|
"preset": "react-native",
|
|
88
92
|
"modulePathIgnorePatterns": [
|
|
89
93
|
"<rootDir>/example/node_modules",
|
|
90
94
|
"<rootDir>/lib/"
|
|
91
|
-
],
|
|
92
|
-
"setupFiles": [
|
|
93
|
-
"./src/__mocks__/native-module-bridge.js"
|
|
94
95
|
]
|
|
95
96
|
},
|
|
96
97
|
"commitlint": {
|
|
@@ -115,14 +116,36 @@
|
|
|
115
116
|
}
|
|
116
117
|
}
|
|
117
118
|
},
|
|
119
|
+
"eslintConfig": {
|
|
120
|
+
"root": true,
|
|
121
|
+
"extends": [
|
|
122
|
+
"@react-native-community",
|
|
123
|
+
"prettier"
|
|
124
|
+
],
|
|
125
|
+
"rules": {
|
|
126
|
+
"prettier/prettier": [
|
|
127
|
+
"error",
|
|
128
|
+
{
|
|
129
|
+
"quoteProps": "consistent",
|
|
130
|
+
"singleQuote": true,
|
|
131
|
+
"tabWidth": 2,
|
|
132
|
+
"trailingComma": "off",
|
|
133
|
+
"useTabs": false
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
}
|
|
137
|
+
},
|
|
118
138
|
"eslintIgnore": [
|
|
119
139
|
"node_modules/",
|
|
120
|
-
"lib/"
|
|
121
|
-
"**/babel.config.**",
|
|
122
|
-
"**/metro.config.**",
|
|
123
|
-
"**/react-native.config.**",
|
|
124
|
-
"**/scripts/**"
|
|
140
|
+
"lib/"
|
|
125
141
|
],
|
|
142
|
+
"prettier": {
|
|
143
|
+
"quoteProps": "consistent",
|
|
144
|
+
"singleQuote": true,
|
|
145
|
+
"tabWidth": 2,
|
|
146
|
+
"trailingComma": "es5",
|
|
147
|
+
"useTabs": false
|
|
148
|
+
},
|
|
126
149
|
"react-native-builder-bob": {
|
|
127
150
|
"source": "src",
|
|
128
151
|
"output": "lib",
|
|
@@ -136,11 +159,5 @@
|
|
|
136
159
|
}
|
|
137
160
|
]
|
|
138
161
|
]
|
|
139
|
-
},
|
|
140
|
-
"dependencies": {},
|
|
141
|
-
"config": {
|
|
142
|
-
"commitizen": {
|
|
143
|
-
"path": "./node_modules/cz-conventional-changelog"
|
|
144
|
-
}
|
|
145
162
|
}
|
|
146
163
|
}
|