Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Thank you for your interest in developing ChativeWidget! Below is a detailed gui

1. Clone the repository to your local machine:
```
git clone https://github.com/botstar/chative-react-native-widget.git
cd chative-react-native-widget
git clone https://github.com/botstar/@chative.io/react-native-widget.git
cd @chative.io/react-native-widget
```

2. Install dependencies:
Expand Down Expand Up @@ -58,7 +58,7 @@ After you've completed your changes and want to test them:
yarn livechat
```
This command will perform the following steps:
- Remove the current version of chative-react-native-widget
- Remove the current version of @chative.io/react-native-widget
- Clear the yarn cache
- Install the new version from the .tgz file

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ Chative Widget is a React Native component that provides an easy-to-use chat wid
## Installation

```bash
npm install chative-react-native-widget
npm install @chative.io/react-native-widget
# or
yarn add chative-react-native-widget
yarn add @chative.io/react-native-widget
```

This library depends on [react-native-webview](https://www.npmjs.com/package/react-native-webview) and [async-storage](https://github.com/react-native-async-storage/async-storage). Please follow the instructions provided in the docs.
Expand All @@ -31,7 +31,7 @@ Here's a basic example of how to use the ChativeWidget in your React Native appl
```jsx
import React, { useRef } from 'react';
import { Button, View } from 'react-native';
import ChativeWidget from 'chative-react-native-widget';
import ChativeWidget from '@chative.io/react-native-widget';

export default function App() {
const widgetRef = useRef(null);
Expand Down Expand Up @@ -98,7 +98,7 @@ You can customize the appearance of the widget by providing a custom header comp
This module includes TypeScript declarations. You can import types like this:

```typescript
import ChativeWidget, { ChativeWidgetRef } from 'chative-react-native-widget';
import ChativeWidget, { ChativeWidgetRef } from '@chative.io/react-native-widget';
```

## License
Expand Down
2 changes: 1 addition & 1 deletion examples/App.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ChativeWidget from 'chative-react-native-widget';
import ChativeWidget from '@chative.io/react-native-widget';
import React, { useRef } from 'react';
import { Button, SafeAreaView, StyleSheet, View } from 'react-native';

Expand Down
52 changes: 0 additions & 52 deletions examples/WebView.js

This file was deleted.

6 changes: 3 additions & 3 deletions examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"livechat": "yarn remove chative-react-native-widget && yarn cache clean && yarn add ../chative-react-native-widget-v0.0.1.tgz"
"livechat": "yarn remove @chative.io/react-native-widget && yarn cache clean && yarn add ../chative.io-react-native-widget-v0.0.1.tgz"
},
"dependencies": {
"@chative.io/react-native-widget": "../chative.io-react-native-widget-v0.0.1.tgz",
"@react-native-async-storage/async-storage": "^1.23.1",
"chative-react-native-widget": "../chative-react-native-widget-v0.0.1.tgz",
"expo": "~51.0.20",
"expo-status-bar": "~1.12.1",
"react": "18.2.0",
"react-native": "0.74.3",
"react-native-webview": "^13.8.6"
"react-native-webview": "13.8.6"
},
"devDependencies": {
"@babel/core": "^7.20.0"
Expand Down
68 changes: 34 additions & 34 deletions examples/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@
trim-right "^1.0.1"

"@babel/generator@^7.20.0", "@babel/generator@^7.20.5", "@babel/generator@^7.24.8", "@babel/generator@^7.24.9":
version "7.24.9"
resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.24.9.tgz#5c2575a1070e661bbbc9df82a853989c9a656f12"
integrity sha512-G8v3jRg+z8IwY1jHFxvCNhOPYPterE4XljNgdGTYfSTtzzwjIswIzIaSPSLs3R7yFuqnqNeay5rjICfqVr+/6A==
version "7.24.10"
resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.24.10.tgz#a4ab681ec2a78bbb9ba22a3941195e28a81d8e76"
integrity sha512-o9HBZL1G2129luEUlG1hB4N/nlYNWHnpwlND9eOMclRqqu1YDy2sSYVCFUZwl8I1Gxh+QSRrP2vD7EpUmFVXxg==
dependencies:
"@babel/types" "^7.24.9"
"@jridgewell/gen-mapping" "^0.3.5"
Expand Down Expand Up @@ -796,6 +796,10 @@
"@babel/helper-validator-identifier" "^7.24.7"
to-fast-properties "^2.0.0"

"@chative.io/react-native-widget@../chative.io-react-native-widget-v0.0.1.tgz":
version "0.0.1"
resolved "../chative.io-react-native-widget-v0.0.1.tgz#2a83d779d7f53b04c981b12c1f666ce221e6c532"

"@expo/bunyan@^4.0.0":
version "4.0.0"
resolved "https://registry.yarnpkg.com/@expo/bunyan/-/bunyan-4.0.0.tgz#be0c1de943c7987a9fbd309ea0b1acd605890c7b"
Expand Down Expand Up @@ -1289,9 +1293,9 @@
integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==

"@react-native-async-storage/async-storage@^1.23.1":
version "1.23.1"
resolved "https://registry.yarnpkg.com/@react-native-async-storage/async-storage/-/async-storage-1.23.1.tgz#cad3cd4fab7dacfe9838dce6ecb352f79150c883"
integrity sha512-Qd2kQ3yi6Y3+AcUlrHxSLlnBvpdCEMVGFlVBneVOjaFaPU61g1huc38g339ysXspwY1QZA2aNhrk/KlHGO+ewA==
version "1.24.0"
resolved "https://registry.yarnpkg.com/@react-native-async-storage/async-storage/-/async-storage-1.24.0.tgz#888efbc62a26f7d9464b32f4d3027b7f2771999b"
integrity sha512-W4/vbwUOYOjco0x3toB8QCr7EjIP6nE9G7o8PMguvvjYT5Awg09lyV4enACRx4s++PPulBiBSjL0KTFx2u0Z/g==
dependencies:
merge-options "^3.0.4"

Expand Down Expand Up @@ -1690,16 +1694,16 @@
"@types/node" "*"

"@types/node@*":
version "20.14.10"
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.14.10.tgz#a1a218290f1b6428682e3af044785e5874db469a"
integrity sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==
version "20.14.11"
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.14.11.tgz#09b300423343460455043ddd4d0ded6ac579b74b"
integrity sha512-kprQpL8MMeszbz6ojB5/tU8PLN4kesnN8Gjzw349rDlNgsSzg90lAVj3llK99Dh7JON+t9AuscPPFW6mPbTnSA==
dependencies:
undici-types "~5.26.4"

"@types/node@^18.0.0":
version "18.19.39"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.39.tgz#c316340a5b4adca3aee9dcbf05de385978590593"
integrity sha512-nPwTRDKUctxw3di5b4TfT3I0sWDiWoPQCZjXhvdkINntwr8lcoVCKsTgnXeRubKIlfnV+eN/HYk6Jb40tbcEAQ==
version "18.19.40"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.40.tgz#e9213ba98122992dafd8d55a2196f2ebb56b2555"
integrity sha512-MIxieZHrm4Ee8XArBIc+Or9HINt2StOmCbgRcXGSJl8q14svRvkZPe7LJq9HKtTI1SK3wU8b91TjntUm7T69Pg==
dependencies:
undici-types "~5.26.4"

Expand Down Expand Up @@ -2263,10 +2267,6 @@ charenc@0.0.2, charenc@~0.0.1:
resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.2.tgz#c0a1d2f3a7092e03774bfa83f14c0fc5790a8667"
integrity sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==

chative-react-native-widget@../chative-react-native-widget-v0.0.1.tgz:
version "0.0.1"
resolved "../chative-react-native-widget-v0.0.1.tgz#6b64d0e39773d3160899c53c54fe01236f1e76e2"

chownr@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece"
Expand Down Expand Up @@ -2955,10 +2955,10 @@ expo-file-system@~17.0.1:
resolved "https://registry.yarnpkg.com/expo-file-system/-/expo-file-system-17.0.1.tgz#b9f8af8c1c06ec71d96fd7a0d2567fa9e1c88f15"
integrity sha512-dYpnZJqTGj6HCYJyXAgpFkQWsiCH3HY1ek2cFZVHFoEc5tLz9gmdEgTF6nFHurvmvfmXqxi7a5CXyVm0aFYJBw==

expo-font@~12.0.8:
version "12.0.8"
resolved "https://registry.yarnpkg.com/expo-font/-/expo-font-12.0.8.tgz#23b769063ba72484c767a4fdb0ff3a26d23645d2"
integrity sha512-xK9kOEyD/vnREicM5yS2uVwzB83weu+UE6QwJRH2dhoQcdJiWGGKOj+blJ8GrtU+BqtyNijyWcwfBbYOJnf8eQ==
expo-font@~12.0.9:
version "12.0.9"
resolved "https://registry.yarnpkg.com/expo-font/-/expo-font-12.0.9.tgz#096860a6b8b5dd54152262eafd318593ec2db48c"
integrity sha512-seTCyf0tbgkAnp3ZI9ZfK9QVtURQUgFnuj+GuJ5TSnN0XsOtVe1s2RxTvmMgkfuvfkzcjJ69gyRpsZS1cC8hjw==
dependencies:
fontfaceobserver "^2.1.0"

Expand Down Expand Up @@ -2991,9 +2991,9 @@ expo-status-bar@~1.12.1:
integrity sha512-/t3xdbS8KB0prj5KG5w7z+wZPFlPtkgs95BsmrP/E7Q0xHXTcDcQ6Cu2FkFuRM+PKTb17cJDnLkawyS5vDLxMA==

expo@~51.0.20:
version "51.0.20"
resolved "https://registry.yarnpkg.com/expo/-/expo-51.0.20.tgz#e34ce895875e29bb46a818ff5be7178b4fce2bfb"
integrity sha512-EmNZel6j7pU4YF1QcIcgpVdYsA1lASQcEw9PPSevjreNT6nlge2CNHB6mAphAKGz5PdgcWYBn/v4qQj1/FJuZQ==
version "51.0.21"
resolved "https://registry.yarnpkg.com/expo/-/expo-51.0.21.tgz#91cb8b78d25ebed4e849f3a25881f25b75bcfe18"
integrity sha512-tCKJUw4U4F15FecFPwJTFnAwHZMmUD1Wm7FX0Z/Oj3Jr14MOkom8Lnt2OkBK6BtM91lz33EF9OhgqReX6kchLA==
dependencies:
"@babel/runtime" "^7.20.0"
"@expo/cli" "0.18.25"
Expand All @@ -3004,7 +3004,7 @@ expo@~51.0.20:
babel-preset-expo "~11.0.12"
expo-asset "~10.0.10"
expo-file-system "~17.0.1"
expo-font "~12.0.8"
expo-font "~12.0.9"
expo-keep-awake "~13.0.2"
expo-modules-autolinking "1.11.1"
expo-modules-core "1.12.19"
Expand Down Expand Up @@ -4717,9 +4717,9 @@ node-int64@^0.4.0:
integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==

node-releases@^2.0.14:
version "2.0.14"
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.14.tgz#2ffb053bceb8b2be8495ece1ab6ce600c4461b0b"
integrity sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==
version "2.0.17"
resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.17.tgz#d74bc4fec38d839eec5db2a3c9c963d4f33cb366"
integrity sha512-Ww6ZlOiEQfPfXM45v17oabk77Z7mg5bOt7AjDyzy7RjK9OrLrLC8dyZQoAPEOtFX9SaNf1Tdvr5gRJWdTJj7GA==

node-stream-zip@^1.9.1:
version "1.15.0"
Expand Down Expand Up @@ -5235,7 +5235,7 @@ react-is@^17.0.1:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0"
integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==

react-native-webview@^13.8.6:
react-native-webview@13.8.6:
version "13.8.6"
resolved "https://registry.yarnpkg.com/react-native-webview/-/react-native-webview-13.8.6.tgz#5d4a62cb311d5ef8d910a8e112b3f1f2807bcd18"
integrity sha512-jtZ9OgB2AN6rhDwto6dNL3PtOtl/SI4VN93pZEPbMLvRjqHfxiUrilGllL5fKAXq5Ry5FJyfUi82A4Ii8olZ7A==
Expand Down Expand Up @@ -5575,9 +5575,9 @@ semver@^6.3.1:
integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==

semver@^7.3.5, semver@^7.5.2, semver@^7.5.4, semver@^7.6.0:
version "7.6.2"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13"
integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==
version "7.6.3"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143"
integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==

send@0.18.0, send@^0.18.0:
version "0.18.0"
Expand Down Expand Up @@ -6062,9 +6062,9 @@ terminal-link@^2.1.1:
supports-hyperlinks "^2.0.0"

terser@^5.15.0:
version "5.31.2"
resolved "https://registry.yarnpkg.com/terser/-/terser-5.31.2.tgz#b5ca188107b706084dca82f988089fa6102eba11"
integrity sha512-LGyRZVFm/QElZHy/CPr/O4eNZOZIzsrQ92y4v9UJe/pFJjypje2yI3C2FmPtvUEnhadlSbmG2nXtdcjHOjCfxw==
version "5.31.3"
resolved "https://registry.yarnpkg.com/terser/-/terser-5.31.3.tgz#b24b7beb46062f4653f049eea4f0cd165d0f0c38"
integrity sha512-pAfYn3NIZLyZpa83ZKigvj6Rn9c/vd5KfYGX7cN1mnzqgDcxWvrU5ZtAfIKhEXz9nRecw4z3LXkjaq96/qZqAA==
dependencies:
"@jridgewell/source-map" "^0.3.3"
acorn "^8.8.2"
Expand Down
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { ReactElement } from 'react';
import { ViewStyle } from 'react-native';

declare module 'chative-react-native-widget' {
declare module '@chative.io/react-native-widget' {
export interface ChativeWidgetProps {
channelId: string;
headerComponent?: ReactElement;
Expand Down
35 changes: 25 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chative-react-native-widget",
"version": "0.0.1",
"name": "@chative.io/react-native-widget",
"version": "0.1.0",
"description": "React Native SDK for Chative",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -41,14 +41,29 @@
]
},
"keywords": [
"sdk",
"livechat",
"react",
"native",
"chative",
"widget",
"chat",
"customer-support"
"sdk",
"livechat",
"react",
"native",
"chative",
"widget",
"chat",
"customer-support",
"react-native",
"messaging",
"real-time",
"communication",
"mobile",
"ios",
"android",
"support-tool",
"customer-service",
"engagement",
"chatbot",
"helpdesk",
"crm",
"conversational-ui",
"cross-platform"
],
"author": "chative",
"license": "MIT",
Expand Down
1 change: 0 additions & 1 deletion src/ChativeWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ const styles = StyleSheet.create({
left: 0,
right: 0,
bottom: 0,
backgroundColor: 'red',
},
mainView: {
flex: 1,
Expand Down
2 changes: 1 addition & 1 deletion src/WebView.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const WebViewComponent = forwardRef(({ channelId, onLoaded, onClosedWidget, onNe
}}
onLoadEnd={() => {
webViewRef.current?.injectJavaScript(javascript);
onLoaded();
onLoaded && onLoaded();
}}
onMessage={(event) => {
const { data } = event.nativeEvent;
Expand Down