@novu/react-native 2.2.0-rc.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 ADDED
@@ -0,0 +1,43 @@
1
+ # Novu's React Native SDK for building custom inbox notification experiences.
2
+
3
+ Novu provides the `@novu/react-native` a React library that helps to add a fully functioning Inbox to your mobile application in minutes. Let's do a quick recap on how you can easily use it in your application.
4
+ See full documentation [here](https://docs.novu.co/inbox/react-native/quickstart).
5
+
6
+ ## Installation
7
+
8
+ - Install `@novu/react-native` npm package in your react app
9
+
10
+ ```bash
11
+ npm install @novu/react-native
12
+ ```
13
+
14
+ ## Getting Started
15
+
16
+ - Add the below code in the app.tsx file
17
+
18
+ ```jsx
19
+ import { NovuProvider } from '@novu/react-native';
20
+
21
+ import { useNotifications } from '@novu/react';
22
+
23
+ function YourCustomInbox() {
24
+ const { notifications, isLoading, fetchMore, hasMore } = useNotifications();
25
+
26
+ return (
27
+ <Show when={!isLoading} fallback={<NotificationListSkeleton />}>
28
+ <Show when={notifications && notifications.length > 0} fallback={<EmptyNotificationList />}>
29
+ <InfiniteScroll
30
+ dataLength={notifications?.length ?? 0}
31
+ fetchMore={fetchMore}
32
+ hasMore={hasMore}
33
+ loader={<LoadMoreSkeleton />}
34
+ >
35
+ {notifications?.map((notification) => {
36
+ return <NotificationItem key={notification.id} notification={notification} />;
37
+ })}
38
+ </InfiniteScroll>
39
+ </Show>
40
+ </Show>
41
+ );
42
+ }
43
+ ```
@@ -0,0 +1 @@
1
+ export * from '@novu/react/hooks';
@@ -0,0 +1 @@
1
+ export * from '@novu/react/hooks';
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+
17
+ // src/index.ts
18
+ var src_exports = {};
19
+ module.exports = __toCommonJS(src_exports);
20
+ __reExport(src_exports, require("@novu/react/hooks"), module.exports);
21
+ // Annotate the CommonJS export names for ESM import in node:
22
+ 0 && (module.exports = {
23
+ ...require("@novu/react/hooks")
24
+ });
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from '@novu/react/hooks';\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,wBAAc,8BAAd;","names":[]}
@@ -0,0 +1,3 @@
1
+ // src/index.ts
2
+ export * from "@novu/react/hooks";
3
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/index.ts"],"sourcesContent":["export * from '@novu/react/hooks';\n"],"mappings":";AAAA,cAAc;","names":[]}
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "@novu/react-native",
3
+ "version": "2.2.0-rc.1",
4
+ "repository": "https://github.com/novuhq/novu",
5
+ "description": "Novu's React Native SDK for building custom inbox notification experiences",
6
+ "author": "",
7
+ "license": "ISC",
8
+ "main": "dist/client/client.js",
9
+ "module": "dist/client/index.mjs",
10
+ "types": "dist/client/index.d.ts",
11
+ "files": [
12
+ "dist",
13
+ "dist/client/**/*"
14
+ ],
15
+ "sideEffects": false,
16
+ "private": false,
17
+ "publishConfig": {
18
+ "access": "public"
19
+ },
20
+ "scripts": {
21
+ "build:watch": "tsup --watch",
22
+ "build": "tsup && pnpm run check-exports",
23
+ "lint": "eslint src",
24
+ "check-exports": "attw --pack .",
25
+ "release:preview": "pnpx pkg-pr-new publish"
26
+ },
27
+ "devDependencies": {
28
+ "@arethetypeswrong/cli": "^0.15.4",
29
+ "@types/node": "^20.14.12",
30
+ "@types/react": "*",
31
+ "@types/react-dom": "*",
32
+ "tsup": "^8.2.1",
33
+ "typescript": "5.6.2"
34
+ },
35
+ "peerDependencies": {
36
+ "react": ">=17"
37
+ },
38
+ "dependencies": {
39
+ "@novu/react": "workspace:*"
40
+ }
41
+ }