@loyalytics/swan-react-native-sdk 2.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.
- package/LICENSE +55 -0
- package/README.md +67 -0
- package/docs/IOS_NOTIFICATION_EXTENSION_SETUP.md +335 -0
- package/ios/README.md +64 -0
- package/ios/SwanNotificationServiceExtension/Info.plist +31 -0
- package/ios/SwanNotificationServiceExtension/NotificationService.swift +337 -0
- package/ios/SwanNotificationServiceExtension/SwanNotificationServiceExtension.entitlements +10 -0
- package/lib/commonjs/components/FooterView.js +125 -0
- package/lib/commonjs/components/FooterView.js.map +1 -0
- package/lib/commonjs/components/FullScreenView.js +172 -0
- package/lib/commonjs/components/FullScreenView.js.map +1 -0
- package/lib/commonjs/components/HeaderView.js +205 -0
- package/lib/commonjs/components/HeaderView.js.map +1 -0
- package/lib/commonjs/components/PopUpView.js +186 -0
- package/lib/commonjs/components/PopUpView.js.map +1 -0
- package/lib/commonjs/config/BatchConfig.js +53 -0
- package/lib/commonjs/config/BatchConfig.js.map +1 -0
- package/lib/commonjs/constants/ApiUrls.js +56 -0
- package/lib/commonjs/constants/ApiUrls.js.map +1 -0
- package/lib/commonjs/core/EventQueueManager.js +345 -0
- package/lib/commonjs/core/EventQueueManager.js.map +1 -0
- package/lib/commonjs/core/FlushManager.js +245 -0
- package/lib/commonjs/core/FlushManager.js.map +1 -0
- package/lib/commonjs/core/NetworkMonitor.js +97 -0
- package/lib/commonjs/core/NetworkMonitor.js.map +1 -0
- package/lib/commonjs/index.js +3506 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/providers/FirebasePushProvider.js +130 -0
- package/lib/commonjs/providers/FirebasePushProvider.js.map +1 -0
- package/lib/commonjs/providers/NullPushProvider.js +59 -0
- package/lib/commonjs/providers/NullPushProvider.js.map +1 -0
- package/lib/commonjs/providers/PushNotificationProvider.js +30 -0
- package/lib/commonjs/providers/PushNotificationProvider.js.map +1 -0
- package/lib/commonjs/services/DeviceRegistrationService.js +248 -0
- package/lib/commonjs/services/DeviceRegistrationService.js.map +1 -0
- package/lib/commonjs/services/PushTokenService.js +284 -0
- package/lib/commonjs/services/PushTokenService.js.map +1 -0
- package/lib/commonjs/state/AuthStateMachine.js +161 -0
- package/lib/commonjs/state/AuthStateMachine.js.map +1 -0
- package/lib/commonjs/state/DeviceStateMachine.js +104 -0
- package/lib/commonjs/state/DeviceStateMachine.js.map +1 -0
- package/lib/commonjs/state/PushStateMachine.js +129 -0
- package/lib/commonjs/state/PushStateMachine.js.map +1 -0
- package/lib/commonjs/types/EventQueue.js +50 -0
- package/lib/commonjs/types/EventQueue.js.map +1 -0
- package/lib/commonjs/types/SDK.js +2 -0
- package/lib/commonjs/types/SDK.js.map +1 -0
- package/lib/commonjs/utils/FirebaseNotificationManager.js +492 -0
- package/lib/commonjs/utils/FirebaseNotificationManager.js.map +1 -0
- package/lib/commonjs/utils/Logger.js +56 -0
- package/lib/commonjs/utils/Logger.js.map +1 -0
- package/lib/commonjs/utils/SharedCredentialsManager.js +146 -0
- package/lib/commonjs/utils/SharedCredentialsManager.js.map +1 -0
- package/lib/commonjs/version.js +12 -0
- package/lib/commonjs/version.js.map +1 -0
- package/lib/module/components/FooterView.js +121 -0
- package/lib/module/components/FooterView.js.map +1 -0
- package/lib/module/components/FullScreenView.js +167 -0
- package/lib/module/components/FullScreenView.js.map +1 -0
- package/lib/module/components/HeaderView.js +199 -0
- package/lib/module/components/HeaderView.js.map +1 -0
- package/lib/module/components/PopUpView.js +181 -0
- package/lib/module/components/PopUpView.js.map +1 -0
- package/lib/module/config/BatchConfig.js +49 -0
- package/lib/module/config/BatchConfig.js.map +1 -0
- package/lib/module/constants/ApiUrls.js +52 -0
- package/lib/module/constants/ApiUrls.js.map +1 -0
- package/lib/module/core/EventQueueManager.js +340 -0
- package/lib/module/core/EventQueueManager.js.map +1 -0
- package/lib/module/core/FlushManager.js +240 -0
- package/lib/module/core/FlushManager.js.map +1 -0
- package/lib/module/core/NetworkMonitor.js +92 -0
- package/lib/module/core/NetworkMonitor.js.map +1 -0
- package/lib/module/index.js +3494 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/providers/FirebasePushProvider.js +124 -0
- package/lib/module/providers/FirebasePushProvider.js.map +1 -0
- package/lib/module/providers/NullPushProvider.js +53 -0
- package/lib/module/providers/NullPushProvider.js.map +1 -0
- package/lib/module/providers/PushNotificationProvider.js +26 -0
- package/lib/module/providers/PushNotificationProvider.js.map +1 -0
- package/lib/module/services/DeviceRegistrationService.js +243 -0
- package/lib/module/services/DeviceRegistrationService.js.map +1 -0
- package/lib/module/services/PushTokenService.js +278 -0
- package/lib/module/services/PushTokenService.js.map +1 -0
- package/lib/module/state/AuthStateMachine.js +155 -0
- package/lib/module/state/AuthStateMachine.js.map +1 -0
- package/lib/module/state/DeviceStateMachine.js +98 -0
- package/lib/module/state/DeviceStateMachine.js.map +1 -0
- package/lib/module/state/PushStateMachine.js +123 -0
- package/lib/module/state/PushStateMachine.js.map +1 -0
- package/lib/module/types/EventQueue.js +46 -0
- package/lib/module/types/EventQueue.js.map +1 -0
- package/lib/module/types/SDK.js +2 -0
- package/lib/module/types/SDK.js.map +1 -0
- package/lib/module/utils/FirebaseNotificationManager.js +486 -0
- package/lib/module/utils/FirebaseNotificationManager.js.map +1 -0
- package/lib/module/utils/Logger.js +52 -0
- package/lib/module/utils/Logger.js.map +1 -0
- package/lib/module/utils/SharedCredentialsManager.js +140 -0
- package/lib/module/utils/SharedCredentialsManager.js.map +1 -0
- package/lib/module/version.js +8 -0
- package/lib/module/version.js.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/src/components/FooterView.d.ts +3 -0
- package/lib/typescript/commonjs/src/components/FooterView.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/FullScreenView.d.ts +3 -0
- package/lib/typescript/commonjs/src/components/FullScreenView.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/HeaderView.d.ts +3 -0
- package/lib/typescript/commonjs/src/components/HeaderView.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/PopUpView.d.ts +3 -0
- package/lib/typescript/commonjs/src/components/PopUpView.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/config/BatchConfig.d.ts +7 -0
- package/lib/typescript/commonjs/src/config/BatchConfig.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/constants/ApiUrls.d.ts +56 -0
- package/lib/typescript/commonjs/src/constants/ApiUrls.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/core/EventQueueManager.d.ts +63 -0
- package/lib/typescript/commonjs/src/core/EventQueueManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/core/FlushManager.d.ts +63 -0
- package/lib/typescript/commonjs/src/core/FlushManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/core/NetworkMonitor.d.ts +38 -0
- package/lib/typescript/commonjs/src/core/NetworkMonitor.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +663 -0
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/FirebasePushProvider.d.ts +28 -0
- package/lib/typescript/commonjs/src/providers/FirebasePushProvider.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/NullPushProvider.d.ts +25 -0
- package/lib/typescript/commonjs/src/providers/NullPushProvider.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/providers/PushNotificationProvider.d.ts +105 -0
- package/lib/typescript/commonjs/src/providers/PushNotificationProvider.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/services/DeviceRegistrationService.d.ts +60 -0
- package/lib/typescript/commonjs/src/services/DeviceRegistrationService.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/services/PushTokenService.d.ts +82 -0
- package/lib/typescript/commonjs/src/services/PushTokenService.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/state/AuthStateMachine.d.ts +61 -0
- package/lib/typescript/commonjs/src/state/AuthStateMachine.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/state/DeviceStateMachine.d.ts +51 -0
- package/lib/typescript/commonjs/src/state/DeviceStateMachine.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/state/PushStateMachine.d.ts +61 -0
- package/lib/typescript/commonjs/src/state/PushStateMachine.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/EventQueue.d.ts +85 -0
- package/lib/typescript/commonjs/src/types/EventQueue.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/SDK.d.ts +54 -0
- package/lib/typescript/commonjs/src/types/SDK.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/FirebaseNotificationManager.d.ts +169 -0
- package/lib/typescript/commonjs/src/utils/FirebaseNotificationManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/Logger.d.ts +32 -0
- package/lib/typescript/commonjs/src/utils/Logger.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/SharedCredentialsManager.d.ts +54 -0
- package/lib/typescript/commonjs/src/utils/SharedCredentialsManager.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/version.d.ts +2 -0
- package/lib/typescript/commonjs/src/version.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/src/components/FooterView.d.ts +3 -0
- package/lib/typescript/module/src/components/FooterView.d.ts.map +1 -0
- package/lib/typescript/module/src/components/FullScreenView.d.ts +3 -0
- package/lib/typescript/module/src/components/FullScreenView.d.ts.map +1 -0
- package/lib/typescript/module/src/components/HeaderView.d.ts +3 -0
- package/lib/typescript/module/src/components/HeaderView.d.ts.map +1 -0
- package/lib/typescript/module/src/components/PopUpView.d.ts +3 -0
- package/lib/typescript/module/src/components/PopUpView.d.ts.map +1 -0
- package/lib/typescript/module/src/config/BatchConfig.d.ts +7 -0
- package/lib/typescript/module/src/config/BatchConfig.d.ts.map +1 -0
- package/lib/typescript/module/src/constants/ApiUrls.d.ts +56 -0
- package/lib/typescript/module/src/constants/ApiUrls.d.ts.map +1 -0
- package/lib/typescript/module/src/core/EventQueueManager.d.ts +63 -0
- package/lib/typescript/module/src/core/EventQueueManager.d.ts.map +1 -0
- package/lib/typescript/module/src/core/FlushManager.d.ts +63 -0
- package/lib/typescript/module/src/core/FlushManager.d.ts.map +1 -0
- package/lib/typescript/module/src/core/NetworkMonitor.d.ts +38 -0
- package/lib/typescript/module/src/core/NetworkMonitor.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +663 -0
- package/lib/typescript/module/src/index.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/FirebasePushProvider.d.ts +28 -0
- package/lib/typescript/module/src/providers/FirebasePushProvider.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/NullPushProvider.d.ts +25 -0
- package/lib/typescript/module/src/providers/NullPushProvider.d.ts.map +1 -0
- package/lib/typescript/module/src/providers/PushNotificationProvider.d.ts +105 -0
- package/lib/typescript/module/src/providers/PushNotificationProvider.d.ts.map +1 -0
- package/lib/typescript/module/src/services/DeviceRegistrationService.d.ts +60 -0
- package/lib/typescript/module/src/services/DeviceRegistrationService.d.ts.map +1 -0
- package/lib/typescript/module/src/services/PushTokenService.d.ts +82 -0
- package/lib/typescript/module/src/services/PushTokenService.d.ts.map +1 -0
- package/lib/typescript/module/src/state/AuthStateMachine.d.ts +61 -0
- package/lib/typescript/module/src/state/AuthStateMachine.d.ts.map +1 -0
- package/lib/typescript/module/src/state/DeviceStateMachine.d.ts +51 -0
- package/lib/typescript/module/src/state/DeviceStateMachine.d.ts.map +1 -0
- package/lib/typescript/module/src/state/PushStateMachine.d.ts +61 -0
- package/lib/typescript/module/src/state/PushStateMachine.d.ts.map +1 -0
- package/lib/typescript/module/src/types/EventQueue.d.ts +85 -0
- package/lib/typescript/module/src/types/EventQueue.d.ts.map +1 -0
- package/lib/typescript/module/src/types/SDK.d.ts +54 -0
- package/lib/typescript/module/src/types/SDK.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/FirebaseNotificationManager.d.ts +169 -0
- package/lib/typescript/module/src/utils/FirebaseNotificationManager.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/Logger.d.ts +32 -0
- package/lib/typescript/module/src/utils/Logger.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/SharedCredentialsManager.d.ts +54 -0
- package/lib/typescript/module/src/utils/SharedCredentialsManager.d.ts.map +1 -0
- package/lib/typescript/module/src/version.d.ts +2 -0
- package/lib/typescript/module/src/version.d.ts.map +1 -0
- package/package.json +230 -0
- package/scripts/generate-version.js +25 -0
- package/scripts/setup-ios-extension.js +275 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SharedCredentialsManager = void 0;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _reactNativeSharedGroupPreferences = _interopRequireDefault(require("react-native-shared-group-preferences"));
|
|
9
|
+
var _reactNativeBase = _interopRequireDefault(require("react-native-base64"));
|
|
10
|
+
var _Logger = _interopRequireDefault(require("./Logger.js"));
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
/**
|
|
13
|
+
* SharedCredentialsManager
|
|
14
|
+
*
|
|
15
|
+
* Manages credentials storage in iOS App Groups for sharing between
|
|
16
|
+
* the main app and Notification Service Extension.
|
|
17
|
+
*
|
|
18
|
+
* This allows the extension to send delivery ACKs even when the app is killed.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
class SharedCredentialsManager {
|
|
22
|
+
static APP_GROUP_ID = 'group.swan.sdk.notifications';
|
|
23
|
+
static CREDENTIALS_KEY = 'swanCredentials';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Save credentials to iOS App Group (for Notification Service Extension)
|
|
27
|
+
* On Android, this is a no-op as extensions don't exist.
|
|
28
|
+
*/
|
|
29
|
+
static async saveToAppGroup(credentials) {
|
|
30
|
+
if (_reactNative.Platform.OS !== 'ios') {
|
|
31
|
+
// Android doesn't need shared App Group
|
|
32
|
+
_Logger.default.log('[SharedCredentials] Skipping App Group save on Android');
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
try {
|
|
36
|
+
// Encode credentials as base64 JSON
|
|
37
|
+
const credentialsJson = JSON.stringify(credentials);
|
|
38
|
+
const credentialsBase64 = _reactNativeBase.default.encode(credentialsJson);
|
|
39
|
+
|
|
40
|
+
// Save to App Group
|
|
41
|
+
await _reactNativeSharedGroupPreferences.default.setItem(this.CREDENTIALS_KEY, credentialsBase64, this.APP_GROUP_ID);
|
|
42
|
+
_Logger.default.log('[SharedCredentials] ✅ Credentials saved to iOS App Group');
|
|
43
|
+
_Logger.default.log('[SharedCredentials] App Group ID:', this.APP_GROUP_ID);
|
|
44
|
+
_Logger.default.log('[SharedCredentials] Saved credentials:', {
|
|
45
|
+
appId: credentials.appId,
|
|
46
|
+
deviceId: credentials.deviceId,
|
|
47
|
+
hasCDID: !!credentials.cdid,
|
|
48
|
+
isProduction: credentials.isProduction
|
|
49
|
+
});
|
|
50
|
+
} catch (error) {
|
|
51
|
+
_Logger.default.error('[SharedCredentials] ❌ Failed to save to App Group:', error);
|
|
52
|
+
_Logger.default.error('[SharedCredentials] Make sure react-native-shared-group-preferences is installed');
|
|
53
|
+
_Logger.default.error('[SharedCredentials] Make sure App Group is configured in Xcode');
|
|
54
|
+
// Don't throw - this is not critical for main app functionality
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Read credentials from iOS App Group
|
|
60
|
+
* Useful for debugging or fallback scenarios.
|
|
61
|
+
*/
|
|
62
|
+
static async readFromAppGroup() {
|
|
63
|
+
if (_reactNative.Platform.OS !== 'ios') {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
try {
|
|
67
|
+
const credentialsBase64 = await _reactNativeSharedGroupPreferences.default.getItem(this.CREDENTIALS_KEY, this.APP_GROUP_ID);
|
|
68
|
+
if (!credentialsBase64) {
|
|
69
|
+
_Logger.default.log('[SharedCredentials] No credentials found in App Group');
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
const credentialsJson = _reactNativeBase.default.decode(credentialsBase64);
|
|
73
|
+
const credentials = JSON.parse(credentialsJson);
|
|
74
|
+
_Logger.default.log('[SharedCredentials] ✅ Credentials read from App Group');
|
|
75
|
+
return credentials;
|
|
76
|
+
} catch (error) {
|
|
77
|
+
_Logger.default.error('[SharedCredentials] ❌ Failed to read from App Group:', error);
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Clear credentials from iOS App Group
|
|
84
|
+
* Useful during logout or SDK reset.
|
|
85
|
+
*/
|
|
86
|
+
static async clearFromAppGroup() {
|
|
87
|
+
if (_reactNative.Platform.OS !== 'ios') {
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
try {
|
|
91
|
+
await _reactNativeSharedGroupPreferences.default.setItem(this.CREDENTIALS_KEY, '', this.APP_GROUP_ID);
|
|
92
|
+
_Logger.default.log('[SharedCredentials] ✅ Credentials cleared from App Group');
|
|
93
|
+
} catch (error) {
|
|
94
|
+
_Logger.default.error('[SharedCredentials] ❌ Failed to clear from App Group:', error);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Configure custom App Group ID
|
|
100
|
+
* Call this before SDK init if you want to use a different App Group ID.
|
|
101
|
+
*
|
|
102
|
+
* @param appGroupId - Custom App Group ID (e.g., "group.com.yourcompany.app")
|
|
103
|
+
*/
|
|
104
|
+
static setAppGroupId(appGroupId) {
|
|
105
|
+
this.APP_GROUP_ID = appGroupId;
|
|
106
|
+
_Logger.default.log('[SharedCredentials] App Group ID configured:', appGroupId);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Get current App Group ID
|
|
111
|
+
*/
|
|
112
|
+
static getAppGroupId() {
|
|
113
|
+
return this.APP_GROUP_ID;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Check if iOS Notification Service Extension is active/configured
|
|
118
|
+
* Returns true if App Group is accessible (meaning NES is configured)
|
|
119
|
+
*
|
|
120
|
+
* This is used to determine if delivery ACKs should be skipped in the
|
|
121
|
+
* React Native background handler (since NES handles them)
|
|
122
|
+
*/
|
|
123
|
+
static async isNotificationServiceExtensionActive() {
|
|
124
|
+
if (_reactNative.Platform.OS !== 'ios') {
|
|
125
|
+
return false; // Android doesn't have extension
|
|
126
|
+
}
|
|
127
|
+
try {
|
|
128
|
+
// Try to access App Group - if successful, NES is configured
|
|
129
|
+
const isNesActive = await _reactNativeSharedGroupPreferences.default.getItem('swanNESActive', this.APP_GROUP_ID);
|
|
130
|
+
if (!isNesActive) {
|
|
131
|
+
_Logger.default.log('[SharedCredentials] Notification Service Extension is not configured');
|
|
132
|
+
return false;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// If we can access App Group, NES is configured
|
|
136
|
+
_Logger.default.log('[SharedCredentials] ✅ Notification Service Extension is active');
|
|
137
|
+
return true;
|
|
138
|
+
} catch (error) {
|
|
139
|
+
// If App Group is not accessible, NES is not configured
|
|
140
|
+
_Logger.default.log('[SharedCredentials] Notification Service Extension is not configured');
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
exports.SharedCredentialsManager = SharedCredentialsManager;
|
|
146
|
+
//# sourceMappingURL=SharedCredentialsManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_reactNativeSharedGroupPreferences","_interopRequireDefault","_reactNativeBase","_Logger","e","__esModule","default","SharedCredentialsManager","APP_GROUP_ID","CREDENTIALS_KEY","saveToAppGroup","credentials","Platform","OS","Logger","log","credentialsJson","JSON","stringify","credentialsBase64","Base64","encode","SharedGroupPreferences","setItem","appId","deviceId","hasCDID","cdid","isProduction","error","readFromAppGroup","getItem","decode","parse","clearFromAppGroup","setAppGroupId","appGroupId","getAppGroupId","isNotificationServiceExtensionActive","isNesActive","exports"],"sourceRoot":"../../../src","sources":["utils/SharedCredentialsManager.ts"],"mappings":";;;;;;AASA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,kCAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,gBAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,OAAA,GAAAF,sBAAA,CAAAF,OAAA;AAA8B,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAZ9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAeO,MAAMG,wBAAwB,CAAC;EACpC,OAAeC,YAAY,GAAG,8BAA8B;EAC5D,OAAeC,eAAe,GAAG,iBAAiB;;EAElD;AACF;AACA;AACA;EACE,aAAaC,cAAcA,CAACC,WAA8B,EAAiB;IACzE,IAAIC,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;MACzB;MACAC,eAAM,CAACC,GAAG,CAAC,wDAAwD,CAAC;MACpE;IACF;IAEA,IAAI;MACF;MACA,MAAMC,eAAe,GAAGC,IAAI,CAACC,SAAS,CAACP,WAAW,CAAC;MACnD,MAAMQ,iBAAiB,GAAGC,wBAAM,CAACC,MAAM,CAACL,eAAe,CAAC;;MAExD;MACA,MAAMM,0CAAsB,CAACC,OAAO,CAClC,IAAI,CAACd,eAAe,EACpBU,iBAAiB,EACjB,IAAI,CAACX,YACP,CAAC;MAEDM,eAAM,CAACC,GAAG,CAAC,0DAA0D,CAAC;MACtED,eAAM,CAACC,GAAG,CAAC,mCAAmC,EAAE,IAAI,CAACP,YAAY,CAAC;MAClEM,eAAM,CAACC,GAAG,CAAC,wCAAwC,EAAE;QACnDS,KAAK,EAAEb,WAAW,CAACa,KAAK;QACxBC,QAAQ,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YACP,CAAC;MAEDM,eAAM,CAACC,GAAG,CAAC,0DAA0D,CAAC;IACxE,CAAC,CAAC,OAAOc,KAAK,EAAE;MACdf,eAAM,CAACe,KAAK,CAAC,uDAAuD,EAAEA,KAAK,CAAC;IAC9E;EACF;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,OAAOM,aAAaA,CAACC,UAAkB,EAAQ;IAC7C,IAAI,CAAC5B,YAAY,GAAG4B,UAAU;IAC9BtB,eAAM,CAACC,GAAG,CAAC,8CAA8C,EAAEqB,UAAU,CAAC;EACxE;;EAEA;AACF;AACA;EACE,OAAOC,aAAaA,CAAA,EAAW;IAC7B,OAAO,IAAI,CAAC7B,YAAY;EAC1B;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACE,aAAa8B,oCAAoCA,CAAA,EAAqB;IACpE,IAAI1B,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;MACzB,OAAO,KAAK,CAAC,CAAC;IAChB;IAEA,IAAI;MACF;MACA,MAAM0B,WAAW,GAAG,MAAMjB,0CAAsB,CAACS,OAAO,CACtD,eAAe,EACf,IAAI,CAACvB,YACP,CAAC;MAED,IAAI,CAAC+B,WAAW,EAAE;QAChBzB,eAAM,CAACC,GAAG,CAAC,sEAAsE,CAAC;QAClF,OAAO,KAAK;MACd;;MAEA;MACAD,eAAM,CAACC,GAAG,CAAC,gEAAgE,CAAC;MAC5E,OAAO,IAAI;IACb,CAAC,CAAC,OAAOc,KAAK,EAAE;MACd;MACAf,eAAM,CAACC,GAAG,CAAC,sEAAsE,CAAC;MAClF,OAAO,KAAK;IACd;EACF;AACF;AAACyB,OAAA,CAAAjC,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SDK_VERSION = void 0;
|
|
7
|
+
// Auto-generated file. Do not edit manually.
|
|
8
|
+
// This file is generated from package.json version during build.
|
|
9
|
+
// See scripts/generate-version.js
|
|
10
|
+
|
|
11
|
+
const SDK_VERSION = exports.SDK_VERSION = '2.0.1';
|
|
12
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["SDK_VERSION","exports"],"sourceRoot":"../../src","sources":["version.ts"],"mappings":";;;;;;AAAA;AACA;AACA;;AAEO,MAAMA,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,OAAO","ignoreList":[]}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { View, Text, Image, StyleSheet, TouchableOpacity, Dimensions } from 'react-native';
|
|
4
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
const {
|
|
6
|
+
width: screenWidth,
|
|
7
|
+
height: screenHeight
|
|
8
|
+
} = Dimensions.get('window');
|
|
9
|
+
const FooterNotification = ({
|
|
10
|
+
designConfig,
|
|
11
|
+
onClose,
|
|
12
|
+
onButtonClick
|
|
13
|
+
}) => {
|
|
14
|
+
const {
|
|
15
|
+
commId = '',
|
|
16
|
+
themeBackgroundColor = '#ffffff',
|
|
17
|
+
crossButtonColor = '#000000',
|
|
18
|
+
iconURL = null,
|
|
19
|
+
descriptionColor = '#000000',
|
|
20
|
+
description = 'Default description.',
|
|
21
|
+
onClickAction,
|
|
22
|
+
onClickActionType
|
|
23
|
+
} = designConfig;
|
|
24
|
+
return /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
25
|
+
style: [styles.notification, {
|
|
26
|
+
backgroundColor: themeBackgroundColor
|
|
27
|
+
}],
|
|
28
|
+
onPress: () => {
|
|
29
|
+
onButtonClick({
|
|
30
|
+
type: 'primary',
|
|
31
|
+
event: 'clicked',
|
|
32
|
+
action: onClickAction,
|
|
33
|
+
actionType: onClickActionType,
|
|
34
|
+
commId
|
|
35
|
+
});
|
|
36
|
+
},
|
|
37
|
+
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
38
|
+
onPress: onClose,
|
|
39
|
+
style: styles.closeButton,
|
|
40
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
41
|
+
style: [styles.closeIcon, {
|
|
42
|
+
color: crossButtonColor
|
|
43
|
+
}],
|
|
44
|
+
children: "\xD7"
|
|
45
|
+
})
|
|
46
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
47
|
+
style: styles.content,
|
|
48
|
+
children: [iconURL && /*#__PURE__*/_jsx(View, {
|
|
49
|
+
style: styles.iconContainer,
|
|
50
|
+
children: /*#__PURE__*/_jsx(Image, {
|
|
51
|
+
source: {
|
|
52
|
+
uri: iconURL
|
|
53
|
+
},
|
|
54
|
+
style: styles.icon,
|
|
55
|
+
resizeMode: "cover"
|
|
56
|
+
})
|
|
57
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
58
|
+
style: [styles.description, {
|
|
59
|
+
color: descriptionColor
|
|
60
|
+
}],
|
|
61
|
+
numberOfLines: 3,
|
|
62
|
+
children: description
|
|
63
|
+
})]
|
|
64
|
+
})]
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
const styles = StyleSheet.create({
|
|
68
|
+
notification: {
|
|
69
|
+
position: 'absolute',
|
|
70
|
+
bottom: screenHeight * 0.05,
|
|
71
|
+
// Positioned 5% from the bottom of the screen
|
|
72
|
+
left: screenWidth * 0.05,
|
|
73
|
+
// Centered with 5% padding on each side
|
|
74
|
+
width: screenWidth * 0.9,
|
|
75
|
+
// 90% of screen width
|
|
76
|
+
padding: 16,
|
|
77
|
+
shadowColor: '#000',
|
|
78
|
+
shadowOffset: {
|
|
79
|
+
width: 0,
|
|
80
|
+
height: 4
|
|
81
|
+
},
|
|
82
|
+
shadowOpacity: 0.2,
|
|
83
|
+
shadowRadius: 6,
|
|
84
|
+
elevation: 4
|
|
85
|
+
},
|
|
86
|
+
closeButton: {
|
|
87
|
+
position: 'absolute',
|
|
88
|
+
right: 4
|
|
89
|
+
},
|
|
90
|
+
closeIcon: {
|
|
91
|
+
fontSize: 18,
|
|
92
|
+
fontWeight: 'bold'
|
|
93
|
+
},
|
|
94
|
+
content: {
|
|
95
|
+
flexDirection: 'row',
|
|
96
|
+
alignItems: 'center'
|
|
97
|
+
},
|
|
98
|
+
iconContainer: {
|
|
99
|
+
width: 48,
|
|
100
|
+
// Fixed size for icon
|
|
101
|
+
height: 48,
|
|
102
|
+
borderRadius: 24,
|
|
103
|
+
overflow: 'hidden',
|
|
104
|
+
backgroundColor: '#f0f0f0',
|
|
105
|
+
justifyContent: 'center',
|
|
106
|
+
alignItems: 'center',
|
|
107
|
+
marginRight: 12
|
|
108
|
+
},
|
|
109
|
+
icon: {
|
|
110
|
+
width: '100%',
|
|
111
|
+
height: '100%'
|
|
112
|
+
},
|
|
113
|
+
description: {
|
|
114
|
+
fontSize: 14,
|
|
115
|
+
lineHeight: 18,
|
|
116
|
+
flex: 1,
|
|
117
|
+
textAlign: 'left'
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
export default FooterNotification;
|
|
121
|
+
//# sourceMappingURL=FooterView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["View","Text","Image","StyleSheet","TouchableOpacity","Dimensions","jsx","_jsx","jsxs","_jsxs","width","screenWidth","height","screenHeight","get","FooterNotification","designConfig","onClose","onButtonClick","commId","themeBackgroundColor","crossButtonColor","iconURL","descriptionColor","description","onClickAction","onClickActionType","style","styles","notification","backgroundColor","onPress","type","event","action","actionType","children","closeButton","closeIcon","color","content","iconContainer","source","uri","icon","resizeMode","numberOfLines","create","position","bottom","left","padding","shadowColor","shadowOffset","shadowOpacity","shadowRadius","elevation","right","fontSize","fontWeight","flexDirection","alignItems","borderRadius","overflow","justifyContent","marginRight","lineHeight","flex","textAlign"],"sourceRoot":"../../../src","sources":["components/FooterView.tsx"],"mappings":";;AAAA,SACEA,IAAI,EACJC,IAA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D,YAAY,EAAE,EAAE;IAChBC,QAAQ,EAAE,QAAQ;IAClBjC,eAAe,EAAE,SAAS;IAC1BkC,cAAc,EAAE,QAAQ;IACxBH,UAAU,EAAE,QAAQ;IACpBI,WAAW,EAAE;EACf,CAAC;EACDrB,IAAI,EAAE;IACJlC,KAAK,EAAE,MAAM;IACbE,MAAM,EAAE;EACV,CAAC;EACDY,WAAW,EAAE;IACXkC,QAAQ,EAAE,EAAE;IACZQ,UAAU,EAAE,EAAE;IACdC,IAAI,EAAE,CAAC;IACPC,SAAS,EAAE;EACb;AACF,CAAC,CAAC;AAEF,eAAerD,kBAAkB","ignoreList":[]}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/* eslint-disable react-native/no-inline-styles */
|
|
4
|
+
import { View, Text, Image, StyleSheet, TouchableOpacity } from 'react-native';
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
const FullScreenView = ({
|
|
7
|
+
designConfig,
|
|
8
|
+
onClose,
|
|
9
|
+
onButtonClick
|
|
10
|
+
}) => {
|
|
11
|
+
const {
|
|
12
|
+
commId = '',
|
|
13
|
+
backgroundImageURL,
|
|
14
|
+
crossButtonColor,
|
|
15
|
+
primaryButtonColor,
|
|
16
|
+
primaryButtonFontColor,
|
|
17
|
+
primaryButtonSwitch,
|
|
18
|
+
primaryButtonText,
|
|
19
|
+
primaryButtonAction = '',
|
|
20
|
+
primaryButtonActionType = '',
|
|
21
|
+
secondaryButtonColor,
|
|
22
|
+
secondaryButtonFontColor,
|
|
23
|
+
secondaryButtonSwitch,
|
|
24
|
+
secondaryButtonText,
|
|
25
|
+
secondaryButtonAction = '',
|
|
26
|
+
secondaryButtonActionType = ''
|
|
27
|
+
} = designConfig;
|
|
28
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
29
|
+
style: [styles.notification, {
|
|
30
|
+
backgroundColor: 'steelblue' // You can replace this with a dynamic value if needed
|
|
31
|
+
}],
|
|
32
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
33
|
+
style: styles.backgroundContainer,
|
|
34
|
+
children: backgroundImageURL && /*#__PURE__*/_jsx(Image, {
|
|
35
|
+
source: {
|
|
36
|
+
uri: backgroundImageURL
|
|
37
|
+
},
|
|
38
|
+
style: styles.backgroundImage,
|
|
39
|
+
resizeMode: "stretch"
|
|
40
|
+
})
|
|
41
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
42
|
+
style: styles.foreground,
|
|
43
|
+
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
44
|
+
onPress: onClose,
|
|
45
|
+
style: styles.closeButton,
|
|
46
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
47
|
+
style: [styles.closeIcon, {
|
|
48
|
+
color: crossButtonColor
|
|
49
|
+
}],
|
|
50
|
+
children: "\xD7"
|
|
51
|
+
})
|
|
52
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
53
|
+
style: styles.buttonContainer,
|
|
54
|
+
children: [primaryButtonSwitch && /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
55
|
+
onPress: () => {
|
|
56
|
+
onButtonClick({
|
|
57
|
+
type: 'primary',
|
|
58
|
+
event: 'clicked',
|
|
59
|
+
action: primaryButtonAction,
|
|
60
|
+
actionType: primaryButtonActionType,
|
|
61
|
+
commId
|
|
62
|
+
});
|
|
63
|
+
},
|
|
64
|
+
style: [styles.button, {
|
|
65
|
+
backgroundColor: primaryButtonColor,
|
|
66
|
+
marginRight: secondaryButtonSwitch ? 15 : 0
|
|
67
|
+
}],
|
|
68
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
69
|
+
style: {
|
|
70
|
+
color: primaryButtonFontColor
|
|
71
|
+
},
|
|
72
|
+
children: primaryButtonText
|
|
73
|
+
})
|
|
74
|
+
}), secondaryButtonSwitch && /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
75
|
+
onPress: () => {
|
|
76
|
+
onButtonClick({
|
|
77
|
+
type: 'secondary',
|
|
78
|
+
event: 'clicked',
|
|
79
|
+
action: secondaryButtonAction,
|
|
80
|
+
actionType: secondaryButtonActionType,
|
|
81
|
+
commId
|
|
82
|
+
});
|
|
83
|
+
},
|
|
84
|
+
style: [styles.button, {
|
|
85
|
+
backgroundColor: secondaryButtonColor
|
|
86
|
+
}],
|
|
87
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
88
|
+
style: {
|
|
89
|
+
color: secondaryButtonFontColor
|
|
90
|
+
},
|
|
91
|
+
children: secondaryButtonText
|
|
92
|
+
})
|
|
93
|
+
})]
|
|
94
|
+
})]
|
|
95
|
+
})]
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
const styles = StyleSheet.create({
|
|
99
|
+
notification: {
|
|
100
|
+
borderRadius: 10,
|
|
101
|
+
overflow: 'hidden',
|
|
102
|
+
position: 'absolute',
|
|
103
|
+
flexDirection: 'column',
|
|
104
|
+
width: '90%',
|
|
105
|
+
top: '5%',
|
|
106
|
+
// Approx. 2.5% from the top
|
|
107
|
+
height: '92%',
|
|
108
|
+
backgroundColor: 'steelblue' // Can be customized if necessary
|
|
109
|
+
},
|
|
110
|
+
backgroundContainer: {
|
|
111
|
+
position: 'absolute',
|
|
112
|
+
top: 0,
|
|
113
|
+
zIndex: 0,
|
|
114
|
+
width: '100%',
|
|
115
|
+
height: '100%'
|
|
116
|
+
},
|
|
117
|
+
backgroundImage: {
|
|
118
|
+
width: '100%',
|
|
119
|
+
height: '100%'
|
|
120
|
+
},
|
|
121
|
+
placeholderImage: {
|
|
122
|
+
height: 50,
|
|
123
|
+
// Approx. 5rem
|
|
124
|
+
width: 50,
|
|
125
|
+
// Approx. 5rem
|
|
126
|
+
transform: [{
|
|
127
|
+
translateX: 130
|
|
128
|
+
}, {
|
|
129
|
+
translateY: 250
|
|
130
|
+
}] // Approx. (13rem, 25rem)
|
|
131
|
+
},
|
|
132
|
+
foreground: {
|
|
133
|
+
zIndex: 1,
|
|
134
|
+
position: 'absolute',
|
|
135
|
+
width: '100%',
|
|
136
|
+
height: '100%',
|
|
137
|
+
justifyContent: 'flex-end',
|
|
138
|
+
alignItems: 'center',
|
|
139
|
+
paddingBottom: 20
|
|
140
|
+
},
|
|
141
|
+
closeButton: {
|
|
142
|
+
position: 'absolute',
|
|
143
|
+
top: 10,
|
|
144
|
+
right: 10
|
|
145
|
+
},
|
|
146
|
+
closeIcon: {
|
|
147
|
+
fontSize: 30,
|
|
148
|
+
fontWeight: 'bold'
|
|
149
|
+
},
|
|
150
|
+
buttonContainer: {
|
|
151
|
+
flexDirection: 'row',
|
|
152
|
+
position: 'absolute',
|
|
153
|
+
bottom: '5%',
|
|
154
|
+
// Approx. 89% from the top
|
|
155
|
+
left: '5%',
|
|
156
|
+
width: '90%',
|
|
157
|
+
justifyContent: 'space-between'
|
|
158
|
+
},
|
|
159
|
+
button: {
|
|
160
|
+
flex: 1,
|
|
161
|
+
padding: 10,
|
|
162
|
+
justifyContent: 'center',
|
|
163
|
+
alignItems: 'center'
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
export default FullScreenView;
|
|
167
|
+
//# sourceMappingURL=FullScreenView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["View","Text","Image","StyleSheet","TouchableOpacity","jsx","_jsx","jsxs","_jsxs","FullScreenView","designConfig","onClose","onButtonClick","commId","backgroundImageURL","crossButtonColor","primaryButtonColor","primaryButtonFontColor","primaryButtonSwitch","primaryButtonText","primaryButtonAction","primaryButtonActionType","secondaryButtonColor","secondaryButtonFontColor","secondaryButtonSwitch","secondaryButtonText","secondaryButtonAction","secondaryButtonActionType","style","styles","notification","backgroundColor","children","backgroundContainer","source","uri","backgroundImage","resizeMode","foreground","onPress","closeButton","closeIcon","color","buttonContainer","type","event","action","actionType","button","marginRight","create","borderRadius","overflow","position","flexDirection","width","top","height","zIndex","placeholderImage","transform","translateX","translateY","justifyContent","alignItems","paddingBottom","right","fontSize","fontWeight","bottom","left","flex","padding"],"sourceRoot":"../../../src","sources":["components/FullScreenView.tsx"],"mappings":";;AAAA;AACA,SAASA,IAAI,EAAEC,IAAI,EAAEC,KAAK,EAAEC,UAAU,EAAEC,gBAAgB,QAAQ,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE/E,MAAMC,cAAc,GAAGA,CAAC;EAAEC,YAAY;EAAEC,OAAO;EAAEC;AAAmB,CAAC,KAAK;EACxE,MAAM;IACJC,MAAM,GAAG,EAAE;IACXC,kBAAkB;IAClBC,gBAAgB;IAChBC,kBAAkB;IAClBC,sBAAsB;IACtBC,mBAAmB;IACnBC,iBAAiB;IACjBC,mBAAmB,GAAG,EAAE;IACxBC,uBAAuB,GAAG,EAAE;IAC5BC,oBAAoB;IACpBC,wBAAwB;IACxBC,qBAAqB;IACrBC,mBAAmB;IACnBC,qBAAqB,GAAG,EAAE;IAC1BC,yBAAyB,GAAG;EAC9B,CAAC,GAAGjB,YAAY;EAEhB,oBACEF,KAAA,CAACR,IAAI;IACH4B,KAAK,EAAE,CACLC,MAAM,CAACC,YAAY,EACnB;MACEC,eAAe,EAAE,WAAW,CAAE;IAChC,CAAC,CACD;IAAAC,QAAA,gBAGF1B,IAAA,CAACN,IAAI;MAAC4B,KAAK,EAAEC,MAAM,CAACI,mBAAoB;MAAAD,QAAA,EACrClB,kBAAkB,iBACjBR,IAAA,CAACJ,KAAK;QACJgC,MAAM,EAAE;UAAEC,GAAG,EAAErB;QAAmB,CAAE;QACpCc,KAAK,EAAEC,MAAM,CAACO,eAAgB;QAC9BC,UAAU,EAAC;MAAS,CACrB;IACF,CACG,CAAC,eAGP7B,KAAA,CAACR,IAAI;MAAC4B,KAAK,EAAEC,MAAM,CAACS,UAAW;MAAAN,QAAA,gBAE7B1B,IAAA,CAACF,gBAAgB;QAACmC,OAAO,EAAE5B,OAAQ;QAACiB,KAAK,EAAEC,MAAM,CAACW,WAAY;QAAAR,QAAA,eAC5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KAAK;IACpBD,QAAQ,EAAE,UAAU;IACpBgB,MAAM,EAAE,IAAI;IAAE;IACdC,IAAI,EAAE,IAAI;IACVf,KAAK,EAAE,KAAK;IACZQ,cAAc,EAAE;EAClB,CAAC;EACDf,MAAM,EAAE;IACNuB,IAAI,EAAE,CAAC;IACPC,OAAO,EAAE,EAAE;IACXT,cAAc,EAAE,QAAQ;IACxBC,UAAU,EAAE;EACd;AACF,CAAC,CAAC;AAEF,eAAevD,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { View, Text, Image, TouchableOpacity, StyleSheet, Dimensions } from 'react-native';
|
|
4
|
+
import Icon from 'react-native-vector-icons/MaterialIcons'; // Install with `npm install react-native-vector-icons`
|
|
5
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
const {
|
|
7
|
+
width
|
|
8
|
+
} = Dimensions.get('window'); // Screen dimensions for responsive layout
|
|
9
|
+
|
|
10
|
+
const HeaderView = ({
|
|
11
|
+
designConfig = {},
|
|
12
|
+
onClose,
|
|
13
|
+
onButtonClick
|
|
14
|
+
}) => {
|
|
15
|
+
const {
|
|
16
|
+
commId = '',
|
|
17
|
+
themeBackgroundColor = '#f5f5f5',
|
|
18
|
+
crossButtonColor = '#000',
|
|
19
|
+
backgroundImageURL,
|
|
20
|
+
iconURL,
|
|
21
|
+
title = 'Title',
|
|
22
|
+
titleColor = '#333',
|
|
23
|
+
description = 'Description',
|
|
24
|
+
descriptionColor = '#666',
|
|
25
|
+
primaryButtonSwitch = true,
|
|
26
|
+
primaryButtonColor = '#007BFF',
|
|
27
|
+
primaryButtonFontColor = '#FFF',
|
|
28
|
+
primaryButtonText = 'Primary Action',
|
|
29
|
+
primaryButtonAction = '',
|
|
30
|
+
primaryButtonActionType = '',
|
|
31
|
+
secondaryButtonSwitch = true,
|
|
32
|
+
secondaryButtonColor = '#6C757D',
|
|
33
|
+
secondaryButtonFontColor = '#FFF',
|
|
34
|
+
secondaryButtonText = 'Secondary Action',
|
|
35
|
+
secondaryButtonAction = '',
|
|
36
|
+
secondaryButtonActionType = ''
|
|
37
|
+
} = designConfig;
|
|
38
|
+
|
|
39
|
+
// Render Buttons
|
|
40
|
+
const renderButton = (type, text, bgColor, fontColor, action, actionType, extraStyle) => /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
41
|
+
style: [styles.button, {
|
|
42
|
+
backgroundColor: bgColor
|
|
43
|
+
}, extraStyle],
|
|
44
|
+
onPress: () => {
|
|
45
|
+
onButtonClick({
|
|
46
|
+
type,
|
|
47
|
+
event: 'clicked',
|
|
48
|
+
action,
|
|
49
|
+
actionType,
|
|
50
|
+
commId
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
54
|
+
style: [styles.buttonText, {
|
|
55
|
+
color: fontColor
|
|
56
|
+
}],
|
|
57
|
+
numberOfLines: 1,
|
|
58
|
+
children: text
|
|
59
|
+
})
|
|
60
|
+
});
|
|
61
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
62
|
+
style: [styles.notification, {
|
|
63
|
+
backgroundColor: themeBackgroundColor
|
|
64
|
+
}],
|
|
65
|
+
children: [backgroundImageURL && /*#__PURE__*/_jsx(Image, {
|
|
66
|
+
source: {
|
|
67
|
+
uri: backgroundImageURL
|
|
68
|
+
},
|
|
69
|
+
style: styles.background,
|
|
70
|
+
resizeMode: "cover"
|
|
71
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
72
|
+
style: styles.foreground,
|
|
73
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
74
|
+
style: styles.content,
|
|
75
|
+
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
76
|
+
style: styles.close,
|
|
77
|
+
onPress: onClose,
|
|
78
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
79
|
+
name: "close",
|
|
80
|
+
size: 20,
|
|
81
|
+
color: crossButtonColor
|
|
82
|
+
})
|
|
83
|
+
}), iconURL && /*#__PURE__*/_jsx(View, {
|
|
84
|
+
style: styles.iconContainer,
|
|
85
|
+
children: /*#__PURE__*/_jsx(Image, {
|
|
86
|
+
source: {
|
|
87
|
+
uri: iconURL
|
|
88
|
+
},
|
|
89
|
+
style: styles.icon,
|
|
90
|
+
resizeMode: "cover"
|
|
91
|
+
})
|
|
92
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
93
|
+
style: styles.textContainer,
|
|
94
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
95
|
+
style: [styles.title, {
|
|
96
|
+
color: titleColor
|
|
97
|
+
}],
|
|
98
|
+
numberOfLines: 1,
|
|
99
|
+
children: title
|
|
100
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
101
|
+
style: [styles.description, {
|
|
102
|
+
color: descriptionColor
|
|
103
|
+
}],
|
|
104
|
+
numberOfLines: 3,
|
|
105
|
+
children: description
|
|
106
|
+
})]
|
|
107
|
+
})]
|
|
108
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
109
|
+
style: styles.buttonContainer,
|
|
110
|
+
children: [primaryButtonSwitch && renderButton('primary', primaryButtonText, primaryButtonColor, primaryButtonFontColor, primaryButtonAction, primaryButtonActionType, {
|
|
111
|
+
marginRight: secondaryButtonSwitch ? 5 : 0
|
|
112
|
+
}), secondaryButtonSwitch && renderButton('secondary', secondaryButtonText, secondaryButtonColor, secondaryButtonFontColor, secondaryButtonAction, secondaryButtonActionType, {})]
|
|
113
|
+
})]
|
|
114
|
+
})]
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
const styles = StyleSheet.create({
|
|
118
|
+
notification: {
|
|
119
|
+
overflow: 'hidden',
|
|
120
|
+
position: 'absolute',
|
|
121
|
+
flexDirection: 'column',
|
|
122
|
+
width: width * 0.85,
|
|
123
|
+
top: 50,
|
|
124
|
+
left: width * 0.075,
|
|
125
|
+
elevation: 5,
|
|
126
|
+
// Shadow for Android
|
|
127
|
+
shadowColor: '#000',
|
|
128
|
+
// Shadow for iOS
|
|
129
|
+
shadowOffset: {
|
|
130
|
+
width: 0,
|
|
131
|
+
height: 2
|
|
132
|
+
},
|
|
133
|
+
shadowOpacity: 0.2,
|
|
134
|
+
shadowRadius: 4
|
|
135
|
+
},
|
|
136
|
+
background: {
|
|
137
|
+
position: 'absolute',
|
|
138
|
+
top: 0,
|
|
139
|
+
zIndex: 0,
|
|
140
|
+
width: '100%',
|
|
141
|
+
height: 150
|
|
142
|
+
},
|
|
143
|
+
foreground: {
|
|
144
|
+
zIndex: 1
|
|
145
|
+
},
|
|
146
|
+
content: {
|
|
147
|
+
flexDirection: 'row',
|
|
148
|
+
alignItems: 'center',
|
|
149
|
+
padding: 15
|
|
150
|
+
},
|
|
151
|
+
close: {
|
|
152
|
+
position: 'absolute',
|
|
153
|
+
right: 10,
|
|
154
|
+
top: 10
|
|
155
|
+
},
|
|
156
|
+
iconContainer: {
|
|
157
|
+
width: 50,
|
|
158
|
+
height: 50,
|
|
159
|
+
borderRadius: 25,
|
|
160
|
+
overflow: 'hidden'
|
|
161
|
+
},
|
|
162
|
+
icon: {
|
|
163
|
+
width: '100%',
|
|
164
|
+
height: '100%'
|
|
165
|
+
},
|
|
166
|
+
textContainer: {
|
|
167
|
+
marginLeft: 10,
|
|
168
|
+
flex: 1
|
|
169
|
+
},
|
|
170
|
+
title: {
|
|
171
|
+
fontWeight: '600',
|
|
172
|
+
fontSize: 16,
|
|
173
|
+
overflow: 'hidden'
|
|
174
|
+
},
|
|
175
|
+
description: {
|
|
176
|
+
fontSize: 14,
|
|
177
|
+
lineHeight: 18,
|
|
178
|
+
overflow: 'hidden',
|
|
179
|
+
marginTop: 3
|
|
180
|
+
},
|
|
181
|
+
buttonContainer: {
|
|
182
|
+
flexDirection: 'row',
|
|
183
|
+
marginTop: 5,
|
|
184
|
+
marginHorizontal: 10,
|
|
185
|
+
marginBottom: 10
|
|
186
|
+
},
|
|
187
|
+
button: {
|
|
188
|
+
flex: 1,
|
|
189
|
+
padding: 10,
|
|
190
|
+
alignItems: 'center',
|
|
191
|
+
justifyContent: 'center'
|
|
192
|
+
},
|
|
193
|
+
buttonText: {
|
|
194
|
+
fontSize: 14,
|
|
195
|
+
fontWeight: '500'
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
export default HeaderView;
|
|
199
|
+
//# sourceMappingURL=HeaderView.js.map
|