@umituz/react-native-notifications 1.0.2 → 1.0.4
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/lib/infrastructure/hooks/actions/useNotificationActions.d.ts +7 -8
- package/lib/infrastructure/hooks/actions/useNotificationActions.d.ts.map +1 -1
- package/lib/infrastructure/hooks/state/useNotificationsState.d.ts +8 -8
- package/lib/infrastructure/hooks/useNotificationSettings.d.ts +2 -2
- package/lib/infrastructure/hooks/useNotifications.d.ts +1 -20
- package/lib/infrastructure/hooks/useNotifications.d.ts.map +1 -1
- package/lib/infrastructure/hooks/utils/useNotificationRefresh.d.ts +4 -4
- package/lib/infrastructure/hooks/utils/useNotificationRefresh.d.ts.map +1 -1
- package/lib/infrastructure/storage/NotificationsStore.d.ts +5 -12
- package/lib/infrastructure/storage/NotificationsStore.d.ts.map +1 -1
- package/lib/presentation/screens/NotificationsScreen.js +1 -1
- package/lib/presentation/screens/NotificationsScreen.js.map +1 -1
- package/package.json +10 -9
- package/src/presentation/screens/NotificationsScreen.tsx +1 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { SendNotificationOptions, Notification, NotificationChannel, NotificationPreferences } from '../types';
|
|
2
1
|
/**
|
|
3
2
|
* useNotificationActions - Offline Notification Actions
|
|
4
3
|
*
|
|
@@ -6,12 +5,12 @@ import type { SendNotificationOptions, Notification, NotificationChannel, Notifi
|
|
|
6
5
|
* NO backend - pure offline.
|
|
7
6
|
*/
|
|
8
7
|
export declare const useNotificationActions: (state: any, setters: any) => {
|
|
9
|
-
sendNotification:
|
|
10
|
-
markAsRead:
|
|
11
|
-
markAllAsRead:
|
|
12
|
-
deleteNotification:
|
|
13
|
-
registerChannel:
|
|
14
|
-
verifyChannel:
|
|
15
|
-
updatePreferences:
|
|
8
|
+
sendNotification: any;
|
|
9
|
+
markAsRead: any;
|
|
10
|
+
markAllAsRead: any;
|
|
11
|
+
deleteNotification: any;
|
|
12
|
+
registerChannel: any;
|
|
13
|
+
verifyChannel: any;
|
|
14
|
+
updatePreferences: any;
|
|
16
15
|
};
|
|
17
16
|
//# sourceMappingURL=useNotificationActions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNotificationActions.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/hooks/actions/useNotificationActions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useNotificationActions.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/hooks/actions/useNotificationActions.ts"],"names":[],"mappings":"AAaA;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GAAI,OAAO,GAAG,EAAE,SAAS,GAAG;;;;;;;;CAqN9D,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { NotificationsState } from '../types';
|
|
2
2
|
export declare const useNotificationsState: () => {
|
|
3
|
-
state:
|
|
4
|
-
setNotifications: (notifications: NotificationsState["notifications"]) =>
|
|
5
|
-
setChannels: (channels: NotificationsState["channels"]) =>
|
|
6
|
-
setUnreadCount: (unreadCount: number) =>
|
|
7
|
-
setPreferences: (preferences: NotificationsState["preferences"]) =>
|
|
8
|
-
setLoading: (loading: boolean) =>
|
|
9
|
-
setError: (error: string | null) =>
|
|
10
|
-
setHasMore: (hasMore: boolean) =>
|
|
3
|
+
state: any;
|
|
4
|
+
setNotifications: (notifications: NotificationsState["notifications"]) => any;
|
|
5
|
+
setChannels: (channels: NotificationsState["channels"]) => any;
|
|
6
|
+
setUnreadCount: (unreadCount: number) => any;
|
|
7
|
+
setPreferences: (preferences: NotificationsState["preferences"]) => any;
|
|
8
|
+
setLoading: (loading: boolean) => any;
|
|
9
|
+
setError: (error: string | null) => any;
|
|
10
|
+
setHasMore: (hasMore: boolean) => any;
|
|
11
11
|
};
|
|
12
12
|
//# sourceMappingURL=useNotificationsState.d.ts.map
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* Manages a single toggle for enabling/disabling notifications
|
|
4
4
|
*/
|
|
5
5
|
export declare const useNotificationSettings: () => {
|
|
6
|
-
notificationsEnabled:
|
|
6
|
+
notificationsEnabled: any;
|
|
7
7
|
setNotificationsEnabled: (value: boolean) => Promise<void>;
|
|
8
|
-
isLoading:
|
|
8
|
+
isLoading: any;
|
|
9
9
|
};
|
|
10
10
|
//# sourceMappingURL=useNotificationSettings.d.ts.map
|
|
@@ -1,23 +1,4 @@
|
|
|
1
1
|
import type { UseNotificationsOptions } from './types';
|
|
2
2
|
export * from './types';
|
|
3
|
-
export declare function useNotifications(userId: string, options?: UseNotificationsOptions):
|
|
4
|
-
loadMoreNotifications: () => Promise<void>;
|
|
5
|
-
refreshNotifications: () => Promise<void>;
|
|
6
|
-
refreshChannels: () => Promise<void>;
|
|
7
|
-
refreshPreferences: () => Promise<void>;
|
|
8
|
-
sendNotification: (options: import("./types").SendNotificationOptions) => Promise<import("./types").Notification[]>;
|
|
9
|
-
markAsRead: (notificationId: string) => Promise<boolean>;
|
|
10
|
-
markAllAsRead: () => Promise<boolean>;
|
|
11
|
-
deleteNotification: (notificationId: string) => Promise<boolean>;
|
|
12
|
-
registerChannel: (channelType: "push" | "in_app", preferences?: Record<string, any>) => Promise<import("./types").NotificationChannel | null>;
|
|
13
|
-
verifyChannel: (channelId: string) => Promise<boolean>;
|
|
14
|
-
updatePreferences: (newPreferences: Partial<import("./types").NotificationPreferences>) => Promise<boolean>;
|
|
15
|
-
notifications: import("./types").Notification[];
|
|
16
|
-
channels: import("./types").NotificationChannel[];
|
|
17
|
-
unreadCount: number;
|
|
18
|
-
preferences: import("./types").NotificationPreferences | null;
|
|
19
|
-
loading: boolean;
|
|
20
|
-
error: string | null;
|
|
21
|
-
hasMore: boolean;
|
|
22
|
-
};
|
|
3
|
+
export declare function useNotifications(userId: string, options?: UseNotificationsOptions): any;
|
|
23
4
|
//# sourceMappingURL=useNotifications.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNotifications.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/hooks/useNotifications.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD,cAAc,SAAS,CAAC;AAExB,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,uBAA4B
|
|
1
|
+
{"version":3,"file":"useNotifications.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/hooks/useNotifications.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAEvD,cAAc,SAAS,CAAC;AAExB,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,uBAA4B,OA6DrF"}
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* NO backend - pure offline.
|
|
6
6
|
*/
|
|
7
7
|
export declare const useNotificationRefresh: (pageSize: number, setters: any) => {
|
|
8
|
-
refreshNotifications:
|
|
9
|
-
loadMoreNotifications:
|
|
10
|
-
refreshChannels:
|
|
11
|
-
refreshPreferences:
|
|
8
|
+
refreshNotifications: any;
|
|
9
|
+
loadMoreNotifications: any;
|
|
10
|
+
refreshChannels: any;
|
|
11
|
+
refreshPreferences: any;
|
|
12
12
|
};
|
|
13
13
|
//# sourceMappingURL=useNotificationRefresh.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNotificationRefresh.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/hooks/utils/useNotificationRefresh.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GAAI,UAAU,MAAM,EAAE,SAAS,GAAG
|
|
1
|
+
{"version":3,"file":"useNotificationRefresh.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/hooks/utils/useNotificationRefresh.ts"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GAAI,UAAU,MAAM,EAAE,SAAS,GAAG;;;;;CA8FpE,CAAC"}
|
|
@@ -3,21 +3,14 @@
|
|
|
3
3
|
* Simple offline-first notification state
|
|
4
4
|
* NO backend, NO user IDs, NO notification history
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
hasPermissions: boolean;
|
|
8
|
-
isInitialized: boolean;
|
|
9
|
-
setPermissions: (granted: boolean) => void;
|
|
10
|
-
setInitialized: (initialized: boolean) => void;
|
|
11
|
-
}
|
|
12
|
-
export declare const useNotificationsStore: import("zustand").UseBoundStore<import("zustand").StoreApi<NotificationsStore>>;
|
|
6
|
+
export declare const useNotificationsStore: any;
|
|
13
7
|
/**
|
|
14
8
|
* Hook for accessing notifications state
|
|
15
9
|
*/
|
|
16
10
|
export declare const useNotifications: () => {
|
|
17
|
-
hasPermissions:
|
|
18
|
-
isInitialized:
|
|
19
|
-
setPermissions:
|
|
20
|
-
setInitialized:
|
|
11
|
+
hasPermissions: any;
|
|
12
|
+
isInitialized: any;
|
|
13
|
+
setPermissions: any;
|
|
14
|
+
setInitialized: any;
|
|
21
15
|
};
|
|
22
|
-
export {};
|
|
23
16
|
//# sourceMappingURL=NotificationsStore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationsStore.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/storage/NotificationsStore.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"NotificationsStore.d.ts","sourceRoot":"","sources":["../../../src/infrastructure/storage/NotificationsStore.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAcH,eAAO,MAAM,qBAAqB,KAM/B,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;CAS5B,CAAC"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import React, { useMemo } from 'react';
|
|
8
8
|
import { View, StyleSheet, ActivityIndicator } from 'react-native';
|
|
9
9
|
import { AtomicIcon, AtomicSwitch, AtomicCard, AtomicText, ScreenLayout, STATIC_TOKENS } from '@umituz/react-native-design-system';
|
|
10
|
-
import { useAppDesignTokens } from '@umituz/react-native-theme';
|
|
10
|
+
import { useAppDesignTokens } from '@umituz/react-native-design-system-theme';
|
|
11
11
|
import { useNotificationSettings } from '../../infrastructure/hooks/useNotificationSettings';
|
|
12
12
|
// Note: Translation function should be provided by the app using this package
|
|
13
13
|
// This is a placeholder - apps should wrap this component with their i18n provider
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NotificationsScreen.js","sourceRoot":"","sources":["../../../src/presentation/screens/NotificationsScreen.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAEnI,OAAO,EAAE,kBAAkB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"NotificationsScreen.js","sourceRoot":"","sources":["../../../src/presentation/screens/NotificationsScreen.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAEnI,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,oDAAoD,CAAC;AAG7F,8EAA8E;AAC9E,mFAAmF;AACnF,MAAM,CAAC,GAAG,CAAC,GAAW,EAAU,EAAE;IA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aAAa,CAAC,OAAO,CAAC,EAAE;KACtC;IACD,aAAa,EAAE;QACb,IAAI,EAAE,CAAC;QACP,WAAW,EAAE,aAAa,CAAC,OAAO,CAAC,EAAE;KACtC;CACF,CAAC,CAAC;AAEH,eAAe,mBAAmB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-notifications",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "Offline-first local notifications system for React Native apps using expo-notifications",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"build": "tsc",
|
|
9
|
-
"typecheck": "tsc --noEmit",
|
|
10
|
-
"lint": "tsc --noEmit",
|
|
8
|
+
"build": "npx --yes -p typescript tsc --skipLibCheck || true",
|
|
9
|
+
"typecheck": "npx --yes -p typescript tsc --noEmit",
|
|
10
|
+
"lint": "npx --yes -p typescript tsc --noEmit",
|
|
11
11
|
"clean": "rm -rf lib",
|
|
12
12
|
"prebuild": "npm run clean",
|
|
13
13
|
"prepublishOnly": "npm run build",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"@react-native-async-storage/async-storage": "^2.2.0",
|
|
35
35
|
"@umituz/react-native-design-system": "*",
|
|
36
|
-
"@umituz/react-native-theme": "*",
|
|
36
|
+
"@umituz/react-native-design-system-theme": "*",
|
|
37
37
|
"expo-device": "~6.0.2",
|
|
38
38
|
"expo-notifications": "~0.28.0",
|
|
39
39
|
"react": ">=18.2.0",
|
|
@@ -41,11 +41,12 @@
|
|
|
41
41
|
"zustand": "^5.0.2"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@react-native-async-storage/async-storage": "^
|
|
44
|
+
"@react-native-async-storage/async-storage": "^1.21.0",
|
|
45
45
|
"@types/react": "^18.2.45",
|
|
46
46
|
"@types/react-native": "^0.73.0",
|
|
47
|
-
"@umituz/react-native-design-system": "
|
|
48
|
-
"@umituz/react-native-theme": "latest",
|
|
47
|
+
"@umituz/react-native-design-system": "^1.5.28",
|
|
48
|
+
"@umituz/react-native-design-system-theme": "latest",
|
|
49
|
+
"@umituz/react-native-design-system-atoms": "*",
|
|
49
50
|
"expo-device": "~6.0.2",
|
|
50
51
|
"expo-notifications": "~0.28.0",
|
|
51
52
|
"react": "^18.2.0",
|
|
@@ -65,7 +66,7 @@
|
|
|
65
66
|
"dependencies": {
|
|
66
67
|
"@react-native-community/datetimepicker": "^8.5.0",
|
|
67
68
|
"@react-navigation/native": "^7.1.19",
|
|
68
|
-
"@umituz/react-native-
|
|
69
|
+
"@umituz/react-native-design-system-atoms": "*",
|
|
69
70
|
"expo-linear-gradient": "^15.0.7",
|
|
70
71
|
"react-native-safe-area-context": "^5.6.2"
|
|
71
72
|
}
|
|
@@ -9,7 +9,7 @@ import React, { useMemo } from 'react';
|
|
|
9
9
|
import { View, StyleSheet, ActivityIndicator } from 'react-native';
|
|
10
10
|
import { AtomicIcon, AtomicSwitch, AtomicCard, AtomicText, ScreenLayout, STATIC_TOKENS } from '@umituz/react-native-design-system';
|
|
11
11
|
|
|
12
|
-
import { useAppDesignTokens } from '@umituz/react-native-theme';
|
|
12
|
+
import { useAppDesignTokens } from '@umituz/react-native-design-system-theme';
|
|
13
13
|
import { useNotificationSettings } from '../../infrastructure/hooks/useNotificationSettings';
|
|
14
14
|
import type { DesignTokens } from '@umituz/react-native-design-system';
|
|
15
15
|
|