react-native-chatbot-ai 0.2.0

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.
Files changed (43) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +37 -0
  3. package/lib/module/components/chat/index.js +15 -0
  4. package/lib/module/components/chat/index.js.map +1 -0
  5. package/lib/module/context/ChatContext.js +15 -0
  6. package/lib/module/context/ChatContext.js.map +1 -0
  7. package/lib/module/ignore.d.js +2 -0
  8. package/lib/module/ignore.d.js.map +1 -0
  9. package/lib/module/index.js +4 -0
  10. package/lib/module/index.js.map +1 -0
  11. package/lib/module/package.json +1 -0
  12. package/lib/module/services/apis.js +7 -0
  13. package/lib/module/services/apis.js.map +1 -0
  14. package/lib/module/services/index.js +4 -0
  15. package/lib/module/services/index.js.map +1 -0
  16. package/lib/module/types/chat.js +4 -0
  17. package/lib/module/types/chat.js.map +1 -0
  18. package/lib/module/types/dto.js +2 -0
  19. package/lib/module/types/dto.js.map +1 -0
  20. package/lib/typescript/package.json +1 -0
  21. package/lib/typescript/src/components/chat/index.d.ts +2 -0
  22. package/lib/typescript/src/components/chat/index.d.ts.map +1 -0
  23. package/lib/typescript/src/context/ChatContext.d.ts +4 -0
  24. package/lib/typescript/src/context/ChatContext.d.ts.map +1 -0
  25. package/lib/typescript/src/index.d.ts +2 -0
  26. package/lib/typescript/src/index.d.ts.map +1 -0
  27. package/lib/typescript/src/services/apis.d.ts +4 -0
  28. package/lib/typescript/src/services/apis.d.ts.map +1 -0
  29. package/lib/typescript/src/services/index.d.ts +2 -0
  30. package/lib/typescript/src/services/index.d.ts.map +1 -0
  31. package/lib/typescript/src/types/chat.d.ts +6 -0
  32. package/lib/typescript/src/types/chat.d.ts.map +1 -0
  33. package/lib/typescript/src/types/dto.d.ts +1 -0
  34. package/lib/typescript/src/types/dto.d.ts.map +1 -0
  35. package/package.json +161 -0
  36. package/src/components/chat/index.tsx +12 -0
  37. package/src/context/ChatContext.tsx +14 -0
  38. package/src/ignore.d.ts +3 -0
  39. package/src/index.tsx +1 -0
  40. package/src/services/apis.ts +7 -0
  41. package/src/services/index.ts +1 -0
  42. package/src/types/chat.ts +5 -0
  43. package/src/types/dto.ts +0 -0
package/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 hoangphandroppii
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all
12
+ copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,37 @@
1
+ # react-native-chatbot-ai
2
+
3
+ React Native library for Chatbot AI
4
+
5
+ ## Installation
6
+
7
+
8
+ ```sh
9
+ npm install react-native-chatbot-ai
10
+ ```
11
+
12
+
13
+ ## Usage
14
+
15
+
16
+ ```js
17
+ import { multiply } from 'react-native-chatbot-ai';
18
+
19
+ // ...
20
+
21
+ const result = await multiply(3, 7);
22
+ ```
23
+
24
+
25
+ ## Contributing
26
+
27
+ - [Development workflow](CONTRIBUTING.md#development-workflow)
28
+ - [Sending a pull request](CONTRIBUTING.md#sending-a-pull-request)
29
+ - [Code of conduct](CODE_OF_CONDUCT.md)
30
+
31
+ ## License
32
+
33
+ MIT
34
+
35
+ ---
36
+
37
+ Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ import { KContainer, KLabel } from '@droppii/libs';
4
+ import { ChatProvider } from "../../context/ChatContext.js";
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ export const ChatBotAI = () => {
7
+ return /*#__PURE__*/_jsx(ChatProvider, {
8
+ children: /*#__PURE__*/_jsx(KContainer.Page, {
9
+ children: /*#__PURE__*/_jsx(KLabel.Text, {
10
+ children: "ChatBotAI"
11
+ })
12
+ })
13
+ });
14
+ };
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["KContainer","KLabel","ChatProvider","jsx","_jsx","ChatBotAI","children","Page","Text"],"sourceRoot":"../../../../src","sources":["components/chat/index.tsx"],"mappings":";;AAAA,SAASA,UAAU,EAAEC,MAAM,QAAQ,eAAe;AAClD,SAASC,YAAY,QAAQ,8BAA2B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEzD,OAAO,MAAMC,SAAS,GAAGA,CAAA,KAAM;EAC7B,oBACED,IAAA,CAACF,YAAY;IAAAI,QAAA,eACXF,IAAA,CAACJ,UAAU,CAACO,IAAI;MAAAD,QAAA,eACdF,IAAA,CAACH,MAAM,CAACO,IAAI;QAAAF,QAAA,EAAC;MAAS,CAAa;IAAC,CACrB;EAAC,CACN,CAAC;AAEnB,CAAC","ignoreList":[]}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ import { createContext } from 'react';
4
+ import { ChatBotAI } from "../components/chat/index.js";
5
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
+ export const ChatContext = /*#__PURE__*/createContext({});
7
+ export const ChatProvider = ({
8
+ children
9
+ }) => {
10
+ return /*#__PURE__*/_jsxs(ChatContext.Provider, {
11
+ value: {},
12
+ children: [children, /*#__PURE__*/_jsx(ChatBotAI, {})]
13
+ });
14
+ };
15
+ //# sourceMappingURL=ChatContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createContext","ChatBotAI","jsx","_jsx","jsxs","_jsxs","ChatContext","ChatProvider","children","Provider","value"],"sourceRoot":"../../../src","sources":["context/ChatContext.tsx"],"mappings":";;AAAA,SAASA,aAAa,QAAQ,OAAO;AAErC,SAASC,SAAS,QAAQ,6BAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE/C,OAAO,MAAMC,WAAW,gBAAGN,aAAa,CAAkB,CAAC,CAAC,CAAC;AAE7D,OAAO,MAAMO,YAAY,GAAGA,CAAC;EAAEC;AAA4B,CAAC,KAAK;EAC/D,oBACEH,KAAA,CAACC,WAAW,CAACG,QAAQ;IAACC,KAAK,EAAE,CAAC,CAAE;IAAAF,QAAA,GAC7BA,QAAQ,eACTL,IAAA,CAACF,SAAS,IAAE,CAAC;EAAA,CACO,CAAC;AAE3B,CAAC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=ignore.d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../src","sources":["ignore.d.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export { ChatBotAI } from "./components/chat/index.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ChatBotAI"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,SAAS,QAAQ,4BAAmB","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+
3
+ export let apiInstance = null;
4
+ export function initApiInstance(api) {
5
+ apiInstance = api;
6
+ }
7
+ //# sourceMappingURL=apis.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["apiInstance","initApiInstance","api"],"sourceRoot":"../../../src","sources":["services/apis.ts"],"mappings":";;AAEA,OAAO,IAAIA,WAAiC,GAAG,IAAI;AAEnD,OAAO,SAASC,eAAeA,CAACC,GAAkB,EAAE;EAClDF,WAAW,GAAGE,GAAG;AACnB","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export * from "./apis.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["services/index.ts"],"mappings":";;AAAA,cAAc,WAAQ","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+
3
+ export {};
4
+ //# sourceMappingURL=chat.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/chat.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/dto.ts"],"mappings":"","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,2 @@
1
+ export declare const ChatBotAI: () => import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/chat/index.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS,+CAQrB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { ChatContextType, ChatProviderProps } from '../types/chat';
2
+ export declare const ChatContext: import("react").Context<ChatContextType>;
3
+ export declare const ChatProvider: ({ children }: ChatProviderProps) => import("react/jsx-runtime").JSX.Element;
4
+ //# sourceMappingURL=ChatContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatContext.d.ts","sourceRoot":"","sources":["../../../../src/context/ChatContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAGxE,eAAO,MAAM,WAAW,0CAAqC,CAAC;AAE9D,eAAO,MAAM,YAAY,GAAI,cAAc,iBAAiB,4CAO3D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { ChatBotAI } from './components/chat';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { type AxiosInstance } from 'axios';
2
+ export declare let apiInstance: AxiosInstance | null;
3
+ export declare function initApiInstance(api: AxiosInstance): void;
4
+ //# sourceMappingURL=apis.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apis.d.ts","sourceRoot":"","sources":["../../../../src/services/apis.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,eAAO,IAAI,WAAW,EAAE,aAAa,GAAG,IAAW,CAAC;AAEpD,wBAAgB,eAAe,CAAC,GAAG,EAAE,aAAa,QAEjD"}
@@ -0,0 +1,2 @@
1
+ export * from './apis';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { PropsWithChildren } from 'react';
2
+ export interface ChatContextType {
3
+ }
4
+ export interface ChatProviderProps extends PropsWithChildren {
5
+ }
6
+ //# sourceMappingURL=chat.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../../src/types/chat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,MAAM,WAAW,eAAe;CAAG;AAEnC,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB;CAAG"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dto.d.ts","sourceRoot":"","sources":["../../../../src/types/dto.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,161 @@
1
+ {
2
+ "name": "react-native-chatbot-ai",
3
+ "version": "0.2.0",
4
+ "description": "React Native library for Chatbot AI",
5
+ "main": "./lib/module/index.js",
6
+ "types": "./lib/typescript/src/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "source": "./src/index.tsx",
10
+ "types": "./lib/typescript/src/index.d.ts",
11
+ "default": "./lib/module/index.js"
12
+ },
13
+ "./package.json": "./package.json"
14
+ },
15
+ "files": [
16
+ "src",
17
+ "lib",
18
+ "android",
19
+ "ios",
20
+ "cpp",
21
+ "*.podspec",
22
+ "react-native.config.js",
23
+ "!ios/build",
24
+ "!android/build",
25
+ "!android/gradle",
26
+ "!android/gradlew",
27
+ "!android/gradlew.bat",
28
+ "!android/local.properties",
29
+ "!**/__tests__",
30
+ "!**/__fixtures__",
31
+ "!**/__mocks__",
32
+ "!**/.*"
33
+ ],
34
+ "scripts": {
35
+ "example": "yarn workspace react-native-chatbot-ai-example",
36
+ "test": "jest",
37
+ "typecheck": "tsc",
38
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
39
+ "clean": "del-cli lib",
40
+ "prepare": "bob build",
41
+ "release": "release-it --only-version"
42
+ },
43
+ "keywords": [
44
+ "react-native",
45
+ "ios",
46
+ "android"
47
+ ],
48
+ "repository": {
49
+ "type": "git",
50
+ "url": "git+https://github.com/droppii/react-native-chatbot-ai.git"
51
+ },
52
+ "author": "hoangphandroppii <hoang.phan@droppii.com> (https://github.com/hoangphandroppii)",
53
+ "license": "MIT",
54
+ "bugs": {
55
+ "url": "https://github.com/droppii/react-native-chatbot-ai/issues"
56
+ },
57
+ "homepage": "https://github.com/droppii/react-native-chatbot-ai#readme",
58
+ "publishConfig": {
59
+ "registry": "https://registry.npmjs.org/"
60
+ },
61
+ "devDependencies": {
62
+ "@commitlint/config-conventional": "^19.8.1",
63
+ "@droppii/libs": "git+ssh://git@github.com:droppii/mobile-components.git#v1.0.77",
64
+ "@eslint/compat": "^1.3.2",
65
+ "@eslint/eslintrc": "^3.3.1",
66
+ "@eslint/js": "^9.35.0",
67
+ "@evilmartians/lefthook": "^1.12.3",
68
+ "@react-native/babel-preset": "0.81.1",
69
+ "@react-native/eslint-config": "^0.81.1",
70
+ "@release-it/conventional-changelog": "^10.0.1",
71
+ "@types/jest": "^29.5.14",
72
+ "@types/react": "^19.1.12",
73
+ "commitlint": "^19.8.1",
74
+ "del-cli": "^6.0.0",
75
+ "eslint": "^9.35.0",
76
+ "eslint-config-prettier": "^10.1.8",
77
+ "eslint-plugin-prettier": "^5.5.4",
78
+ "jest": "^29.7.0",
79
+ "prettier": "^3.6.2",
80
+ "react": "19.1.0",
81
+ "react-native": "0.81.4",
82
+ "react-native-builder-bob": "^0.40.13",
83
+ "release-it": "^19.0.4",
84
+ "typescript": "^5.9.2"
85
+ },
86
+ "peerDependencies": {
87
+ "@droppii/libs": "*",
88
+ "react": "*",
89
+ "react-native": "*"
90
+ },
91
+ "workspaces": [
92
+ "example"
93
+ ],
94
+ "packageManager": "yarn@3.6.1",
95
+ "jest": {
96
+ "preset": "react-native",
97
+ "modulePathIgnorePatterns": [
98
+ "<rootDir>/example/node_modules",
99
+ "<rootDir>/lib/"
100
+ ]
101
+ },
102
+ "commitlint": {
103
+ "extends": [
104
+ "@commitlint/config-conventional"
105
+ ]
106
+ },
107
+ "release-it": {
108
+ "git": {
109
+ "commitMessage": "chore: release ${version}",
110
+ "tagName": "v${version}"
111
+ },
112
+ "npm": {
113
+ "publish": true
114
+ },
115
+ "github": {
116
+ "release": true
117
+ },
118
+ "plugins": {
119
+ "@release-it/conventional-changelog": {
120
+ "preset": {
121
+ "name": "angular"
122
+ }
123
+ }
124
+ }
125
+ },
126
+ "prettier": {
127
+ "quoteProps": "consistent",
128
+ "singleQuote": true,
129
+ "tabWidth": 2,
130
+ "trailingComma": "es5",
131
+ "useTabs": false
132
+ },
133
+ "react-native-builder-bob": {
134
+ "source": "src",
135
+ "output": "lib",
136
+ "targets": [
137
+ [
138
+ "module",
139
+ {
140
+ "esm": true
141
+ }
142
+ ],
143
+ [
144
+ "typescript",
145
+ {
146
+ "project": "tsconfig.build.json"
147
+ }
148
+ ]
149
+ ]
150
+ },
151
+ "create-react-native-library": {
152
+ "languages": "js",
153
+ "type": "library",
154
+ "version": "0.54.5"
155
+ },
156
+ "dependencies": {
157
+ "@tanstack/react-query": "^5.90.2",
158
+ "axios": "^1.12.2",
159
+ "zustand": "^5.0.8"
160
+ }
161
+ }
@@ -0,0 +1,12 @@
1
+ import { KContainer, KLabel } from '@droppii/libs';
2
+ import { ChatProvider } from '../../context/ChatContext';
3
+
4
+ export const ChatBotAI = () => {
5
+ return (
6
+ <ChatProvider>
7
+ <KContainer.Page>
8
+ <KLabel.Text>ChatBotAI</KLabel.Text>
9
+ </KContainer.Page>
10
+ </ChatProvider>
11
+ );
12
+ };
@@ -0,0 +1,14 @@
1
+ import { createContext } from 'react';
2
+ import type { ChatContextType, ChatProviderProps } from '../types/chat';
3
+ import { ChatBotAI } from '../components/chat';
4
+
5
+ export const ChatContext = createContext<ChatContextType>({});
6
+
7
+ export const ChatProvider = ({ children }: ChatProviderProps) => {
8
+ return (
9
+ <ChatContext.Provider value={{}}>
10
+ {children}
11
+ <ChatBotAI />
12
+ </ChatContext.Provider>
13
+ );
14
+ };
@@ -0,0 +1,3 @@
1
+ declare module '@droppii/libs/*';
2
+ declare module '@droppii/libs';
3
+ declare module '*';
package/src/index.tsx ADDED
@@ -0,0 +1 @@
1
+ export { ChatBotAI } from './components/chat';
@@ -0,0 +1,7 @@
1
+ import { type AxiosInstance } from 'axios';
2
+
3
+ export let apiInstance: AxiosInstance | null = null;
4
+
5
+ export function initApiInstance(api: AxiosInstance) {
6
+ apiInstance = api;
7
+ }
@@ -0,0 +1 @@
1
+ export * from './apis';
@@ -0,0 +1,5 @@
1
+ import type { PropsWithChildren } from 'react';
2
+
3
+ export interface ChatContextType {}
4
+
5
+ export interface ChatProviderProps extends PropsWithChildren {}
File without changes