@developer_tribe/react-native-comnyx 0.1.0 → 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.
- package/lib/commonjs/App.js +59 -0
- package/lib/commonjs/App.js.map +1 -0
- package/lib/commonjs/__dev__.js +29 -0
- package/lib/commonjs/__dev__.js.map +1 -0
- package/lib/commonjs/api/api.js +22 -0
- package/lib/commonjs/api/api.js.map +1 -0
- package/lib/commonjs/api/conversations.js +37 -0
- package/lib/commonjs/api/conversations.js.map +1 -0
- package/lib/commonjs/api/customers.js +15 -0
- package/lib/commonjs/api/customers.js.map +1 -0
- package/lib/commonjs/api/index.js +33 -0
- package/lib/commonjs/api/index.js.map +1 -0
- package/lib/commonjs/api/messages.js +27 -0
- package/lib/commonjs/api/messages.js.map +1 -0
- package/lib/commonjs/assets/clock.png +0 -0
- package/lib/commonjs/assets/double-check.png +0 -0
- package/lib/commonjs/assets/down.png +0 -0
- package/lib/commonjs/assets/send.png +0 -0
- package/lib/commonjs/components/AppText.js +38 -0
- package/lib/commonjs/components/AppText.js.map +1 -0
- package/lib/commonjs/components/ChatList.js +268 -0
- package/lib/commonjs/components/ChatList.js.map +1 -0
- package/lib/commonjs/components/CustomerForm.js +213 -0
- package/lib/commonjs/components/CustomerForm.js.map +1 -0
- package/lib/commonjs/components/EmptyList.js +40 -0
- package/lib/commonjs/components/EmptyList.js.map +1 -0
- package/lib/commonjs/components/InitFailed.js +51 -0
- package/lib/commonjs/components/InitFailed.js.map +1 -0
- package/lib/commonjs/components/MessageInput.js +119 -0
- package/lib/commonjs/components/MessageInput.js.map +1 -0
- package/lib/commonjs/components/MessageItem.js +117 -0
- package/lib/commonjs/components/MessageItem.js.map +1 -0
- package/lib/commonjs/constants/translations.js +219 -0
- package/lib/commonjs/constants/translations.js.map +1 -0
- package/lib/commonjs/data/fake/conversations.js +95 -0
- package/lib/commonjs/data/fake/conversations.js.map +1 -0
- package/lib/commonjs/data/fake/customers.js +24 -0
- package/lib/commonjs/data/fake/customers.js.map +1 -0
- package/lib/commonjs/data/fake/messages.js +67 -0
- package/lib/commonjs/data/fake/messages.js.map +1 -0
- package/lib/commonjs/hooks/useLocalize.js +20 -0
- package/lib/commonjs/hooks/useLocalize.js.map +1 -0
- package/lib/commonjs/hooks/usePolling.js +50 -0
- package/lib/commonjs/hooks/usePolling.js.map +1 -0
- package/lib/commonjs/hooks/useThemeColors.js +17 -0
- package/lib/commonjs/hooks/useThemeColors.js.map +1 -0
- package/lib/commonjs/index.js +15 -6
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/register.js +21 -0
- package/lib/commonjs/register.js.map +1 -0
- package/lib/commonjs/store.js +79 -0
- package/lib/commonjs/store.js.map +1 -0
- package/lib/commonjs/types/ApiOptions.js +2 -0
- package/lib/commonjs/types/ApiOptions.js.map +1 -0
- package/lib/commonjs/types/Conversation.js +2 -0
- package/lib/commonjs/types/Conversation.js.map +1 -0
- package/lib/commonjs/types/Customer.js +2 -0
- package/lib/commonjs/types/Customer.js.map +1 -0
- package/lib/commonjs/types/Language.js +2 -0
- package/lib/commonjs/types/Language.js.map +1 -0
- package/lib/commonjs/types/LocalizationKeys.js +2 -0
- package/lib/commonjs/types/LocalizationKeys.js.map +1 -0
- package/lib/commonjs/types/MessageResponse.js +2 -0
- package/lib/commonjs/types/MessageResponse.js.map +1 -0
- package/lib/commonjs/types/Theme.js +29 -0
- package/lib/commonjs/types/Theme.js.map +1 -0
- package/lib/commonjs/utils/date.js +17 -0
- package/lib/commonjs/utils/date.js.map +1 -0
- package/lib/module/App.js +55 -0
- package/lib/module/App.js.map +1 -0
- package/lib/module/__dev__.js +29 -0
- package/lib/module/__dev__.js.map +1 -0
- package/lib/module/api/api.js +17 -0
- package/lib/module/api/api.js.map +1 -0
- package/lib/module/api/conversations.js +32 -0
- package/lib/module/api/conversations.js.map +1 -0
- package/lib/module/api/customers.js +11 -0
- package/lib/module/api/customers.js.map +1 -0
- package/lib/module/api/index.js +6 -0
- package/lib/module/api/index.js.map +1 -0
- package/lib/module/api/messages.js +23 -0
- package/lib/module/api/messages.js.map +1 -0
- package/lib/module/assets/clock.png +0 -0
- package/lib/module/assets/double-check.png +0 -0
- package/lib/module/assets/down.png +0 -0
- package/lib/module/assets/send.png +0 -0
- package/lib/module/components/AppText.js +34 -0
- package/lib/module/components/AppText.js.map +1 -0
- package/lib/module/components/ChatList.js +265 -0
- package/lib/module/components/ChatList.js.map +1 -0
- package/lib/module/components/CustomerForm.js +209 -0
- package/lib/module/components/CustomerForm.js.map +1 -0
- package/lib/module/components/EmptyList.js +36 -0
- package/lib/module/components/EmptyList.js.map +1 -0
- package/lib/module/components/InitFailed.js +47 -0
- package/lib/module/components/InitFailed.js.map +1 -0
- package/lib/module/components/MessageInput.js +115 -0
- package/lib/module/components/MessageInput.js.map +1 -0
- package/lib/module/components/MessageItem.js +114 -0
- package/lib/module/components/MessageItem.js.map +1 -0
- package/lib/module/constants/translations.js +215 -0
- package/lib/module/constants/translations.js.map +1 -0
- package/lib/module/data/fake/conversations.js +88 -0
- package/lib/module/data/fake/conversations.js.map +1 -0
- package/lib/module/data/fake/customers.js +20 -0
- package/lib/module/data/fake/customers.js.map +1 -0
- package/lib/module/data/fake/messages.js +63 -0
- package/lib/module/data/fake/messages.js.map +1 -0
- package/lib/module/hooks/useLocalize.js +16 -0
- package/lib/module/hooks/useLocalize.js.map +1 -0
- package/lib/module/hooks/usePolling.js +46 -0
- package/lib/module/hooks/usePolling.js.map +1 -0
- package/lib/module/hooks/useThemeColors.js +13 -0
- package/lib/module/hooks/useThemeColors.js.map +1 -0
- package/lib/module/index.js +3 -4
- package/lib/module/index.js.map +1 -1
- package/lib/module/register.js +17 -0
- package/lib/module/register.js.map +1 -0
- package/lib/module/store.js +74 -0
- package/lib/module/store.js.map +1 -0
- package/lib/module/types/ApiOptions.js +2 -0
- package/lib/module/types/ApiOptions.js.map +1 -0
- package/lib/module/types/Conversation.js +2 -0
- package/lib/module/types/Conversation.js.map +1 -0
- package/lib/module/types/Customer.js +2 -0
- package/lib/module/types/Customer.js.map +1 -0
- package/lib/module/types/Language.js +2 -0
- package/lib/module/types/Language.js.map +1 -0
- package/lib/module/types/LocalizationKeys.js +2 -0
- package/lib/module/types/LocalizationKeys.js.map +1 -0
- package/lib/module/types/MessageResponse.js +2 -0
- package/lib/module/types/MessageResponse.js.map +1 -0
- package/lib/module/types/Theme.js +25 -0
- package/lib/module/types/Theme.js.map +1 -0
- package/lib/module/utils/date.js +12 -0
- package/lib/module/utils/date.js.map +1 -0
- package/lib/typescript/commonjs/src/App.d.ts +9 -0
- package/lib/typescript/commonjs/src/App.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/__dev__.d.ts +2 -0
- package/lib/typescript/commonjs/src/__dev__.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/api/api.d.ts +4 -0
- package/lib/typescript/commonjs/src/api/api.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/api/conversations.d.ts +7 -0
- package/lib/typescript/commonjs/src/api/conversations.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/api/customers.d.ts +4 -0
- package/lib/typescript/commonjs/src/api/customers.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/api/index.d.ts +4 -0
- package/lib/typescript/commonjs/src/api/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/api/messages.d.ts +4 -0
- package/lib/typescript/commonjs/src/api/messages.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/AppText.d.ts +10 -0
- package/lib/typescript/commonjs/src/components/AppText.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/ChatList.d.ts +2 -0
- package/lib/typescript/commonjs/src/components/ChatList.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/CustomerForm.d.ts +2 -0
- package/lib/typescript/commonjs/src/components/CustomerForm.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/EmptyList.d.ts +2 -0
- package/lib/typescript/commonjs/src/components/EmptyList.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/InitFailed.d.ts +6 -0
- package/lib/typescript/commonjs/src/components/InitFailed.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/MessageInput.d.ts +4 -0
- package/lib/typescript/commonjs/src/components/MessageInput.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/components/MessageItem.d.ts +5 -0
- package/lib/typescript/commonjs/src/components/MessageItem.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/constants/translations.d.ts +4 -0
- package/lib/typescript/commonjs/src/constants/translations.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/data/fake/conversations.d.ts +5 -0
- package/lib/typescript/commonjs/src/data/fake/conversations.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/data/fake/customers.d.ts +3 -0
- package/lib/typescript/commonjs/src/data/fake/customers.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/data/fake/messages.d.ts +3 -0
- package/lib/typescript/commonjs/src/data/fake/messages.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/useLocalize.d.ts +3 -0
- package/lib/typescript/commonjs/src/hooks/useLocalize.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/usePolling.d.ts +2 -0
- package/lib/typescript/commonjs/src/hooks/usePolling.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/hooks/useThemeColors.d.ts +3 -0
- package/lib/typescript/commonjs/src/hooks/useThemeColors.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/index.d.ts +4 -1
- package/lib/typescript/commonjs/src/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/register.d.ts +5 -0
- package/lib/typescript/commonjs/src/register.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/store.d.ts +35 -0
- package/lib/typescript/commonjs/src/store.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/ApiOptions.d.ts +4 -0
- package/lib/typescript/commonjs/src/types/ApiOptions.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/Conversation.d.ts +26 -0
- package/lib/typescript/commonjs/src/types/Conversation.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/Customer.d.ts +30 -0
- package/lib/typescript/commonjs/src/types/Customer.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/Language.d.ts +2 -0
- package/lib/typescript/commonjs/src/types/Language.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/LocalizationKeys.d.ts +22 -0
- package/lib/typescript/commonjs/src/types/LocalizationKeys.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/MessageResponse.d.ts +59 -0
- package/lib/typescript/commonjs/src/types/MessageResponse.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/types/Theme.d.ts +18 -0
- package/lib/typescript/commonjs/src/types/Theme.d.ts.map +1 -0
- package/lib/typescript/commonjs/src/utils/date.d.ts +7 -0
- package/lib/typescript/commonjs/src/utils/date.d.ts.map +1 -0
- package/lib/typescript/module/src/App.d.ts +9 -0
- package/lib/typescript/module/src/App.d.ts.map +1 -0
- package/lib/typescript/module/src/__dev__.d.ts +2 -0
- package/lib/typescript/module/src/__dev__.d.ts.map +1 -0
- package/lib/typescript/module/src/api/api.d.ts +4 -0
- package/lib/typescript/module/src/api/api.d.ts.map +1 -0
- package/lib/typescript/module/src/api/conversations.d.ts +7 -0
- package/lib/typescript/module/src/api/conversations.d.ts.map +1 -0
- package/lib/typescript/module/src/api/customers.d.ts +4 -0
- package/lib/typescript/module/src/api/customers.d.ts.map +1 -0
- package/lib/typescript/module/src/api/index.d.ts +4 -0
- package/lib/typescript/module/src/api/index.d.ts.map +1 -0
- package/lib/typescript/module/src/api/messages.d.ts +4 -0
- package/lib/typescript/module/src/api/messages.d.ts.map +1 -0
- package/lib/typescript/module/src/components/AppText.d.ts +10 -0
- package/lib/typescript/module/src/components/AppText.d.ts.map +1 -0
- package/lib/typescript/module/src/components/ChatList.d.ts +2 -0
- package/lib/typescript/module/src/components/ChatList.d.ts.map +1 -0
- package/lib/typescript/module/src/components/CustomerForm.d.ts +2 -0
- package/lib/typescript/module/src/components/CustomerForm.d.ts.map +1 -0
- package/lib/typescript/module/src/components/EmptyList.d.ts +2 -0
- package/lib/typescript/module/src/components/EmptyList.d.ts.map +1 -0
- package/lib/typescript/module/src/components/InitFailed.d.ts +6 -0
- package/lib/typescript/module/src/components/InitFailed.d.ts.map +1 -0
- package/lib/typescript/module/src/components/MessageInput.d.ts +4 -0
- package/lib/typescript/module/src/components/MessageInput.d.ts.map +1 -0
- package/lib/typescript/module/src/components/MessageItem.d.ts +5 -0
- package/lib/typescript/module/src/components/MessageItem.d.ts.map +1 -0
- package/lib/typescript/module/src/constants/translations.d.ts +4 -0
- package/lib/typescript/module/src/constants/translations.d.ts.map +1 -0
- package/lib/typescript/module/src/data/fake/conversations.d.ts +5 -0
- package/lib/typescript/module/src/data/fake/conversations.d.ts.map +1 -0
- package/lib/typescript/module/src/data/fake/customers.d.ts +3 -0
- package/lib/typescript/module/src/data/fake/customers.d.ts.map +1 -0
- package/lib/typescript/module/src/data/fake/messages.d.ts +3 -0
- package/lib/typescript/module/src/data/fake/messages.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/useLocalize.d.ts +3 -0
- package/lib/typescript/module/src/hooks/useLocalize.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/usePolling.d.ts +2 -0
- package/lib/typescript/module/src/hooks/usePolling.d.ts.map +1 -0
- package/lib/typescript/module/src/hooks/useThemeColors.d.ts +3 -0
- package/lib/typescript/module/src/hooks/useThemeColors.d.ts.map +1 -0
- package/lib/typescript/module/src/index.d.ts +4 -1
- package/lib/typescript/module/src/index.d.ts.map +1 -1
- package/lib/typescript/module/src/register.d.ts +5 -0
- package/lib/typescript/module/src/register.d.ts.map +1 -0
- package/lib/typescript/module/src/store.d.ts +35 -0
- package/lib/typescript/module/src/store.d.ts.map +1 -0
- package/lib/typescript/module/src/types/ApiOptions.d.ts +4 -0
- package/lib/typescript/module/src/types/ApiOptions.d.ts.map +1 -0
- package/lib/typescript/module/src/types/Conversation.d.ts +26 -0
- package/lib/typescript/module/src/types/Conversation.d.ts.map +1 -0
- package/lib/typescript/module/src/types/Customer.d.ts +30 -0
- package/lib/typescript/module/src/types/Customer.d.ts.map +1 -0
- package/lib/typescript/module/src/types/Language.d.ts +2 -0
- package/lib/typescript/module/src/types/Language.d.ts.map +1 -0
- package/lib/typescript/module/src/types/LocalizationKeys.d.ts +22 -0
- package/lib/typescript/module/src/types/LocalizationKeys.d.ts.map +1 -0
- package/lib/typescript/module/src/types/MessageResponse.d.ts +59 -0
- package/lib/typescript/module/src/types/MessageResponse.d.ts.map +1 -0
- package/lib/typescript/module/src/types/Theme.d.ts +18 -0
- package/lib/typescript/module/src/types/Theme.d.ts.map +1 -0
- package/lib/typescript/module/src/utils/date.d.ts +7 -0
- package/lib/typescript/module/src/utils/date.d.ts.map +1 -0
- package/package.json +10 -2
- package/src/App.tsx +59 -0
- package/src/__dev__.ts +22 -0
- package/src/api/api.ts +16 -0
- package/src/api/conversations.ts +53 -0
- package/src/api/customers.ts +16 -0
- package/src/api/index.ts +6 -0
- package/src/api/messages.ts +33 -0
- package/src/assets/clock.png +0 -0
- package/src/assets/double-check.png +0 -0
- package/src/assets/down.png +0 -0
- package/src/assets/send.png +0 -0
- package/src/components/AppText.tsx +43 -0
- package/src/components/ChatList.tsx +305 -0
- package/src/components/CustomerForm.tsx +203 -0
- package/src/components/EmptyList.tsx +32 -0
- package/src/components/InitFailed.tsx +46 -0
- package/src/components/MessageInput.tsx +133 -0
- package/src/components/MessageItem.tsx +141 -0
- package/src/constants/translations.ts +232 -0
- package/src/data/fake/conversations.ts +558 -0
- package/src/data/fake/customers.ts +19 -0
- package/src/data/fake/messages.ts +64 -0
- package/src/hooks/useLocalize.ts +18 -0
- package/src/hooks/usePolling.ts +46 -0
- package/src/hooks/useThemeColors.ts +10 -0
- package/src/index.tsx +4 -5
- package/src/register.ts +17 -0
- package/src/store.ts +85 -0
- package/src/types/ApiOptions.ts +4 -0
- package/src/types/Conversation.ts +29 -0
- package/src/types/Customer.ts +31 -0
- package/src/types/Language.ts +11 -0
- package/src/types/LocalizationKeys.ts +21 -0
- package/src/types/MessageResponse.ts +58 -0
- package/src/types/Theme.ts +40 -0
- package/src/utils/date.ts +11 -0
- package/.editorconfig +0 -15
- package/.gitattributes +0 -3
- package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -68
- package/.github/ISSUE_TEMPLATE/config.yml +0 -8
- package/.github/actions/setup/action.yml +0 -36
- package/.github/workflows/ci.yml +0 -165
- package/.gitignore +0 -86
- package/.idea/.gitignore +0 -8
- package/.idea/codeStyles/Project.xml +0 -59
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/comnyx-rn.iml +0 -12
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/prettier.xml +0 -6
- package/.idea/vcs.xml +0 -6
- package/.idea/workspace.xml +0 -71
- package/.nvmrc +0 -1
- package/.watchmanconfig +0 -1
- package/.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs +0 -541
- package/.yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs +0 -28
- package/.yarn/releases/yarn-3.6.1.cjs +0 -874
- package/.yarnrc.yml +0 -10
- package/CODE_OF_CONDUCT.md +0 -133
- package/CONTRIBUTING.md +0 -130
- package/babel.config.js +0 -3
- package/example/.bundle/config +0 -2
- package/example/.watchmanconfig +0 -1
- package/example/Gemfile +0 -10
- package/example/README.md +0 -97
- package/example/android/app/build.gradle +0 -133
- package/example/android/app/debug.keystore +0 -0
- package/example/android/app/proguard-rules.pro +0 -10
- package/example/android/app/src/debug/AndroidManifest.xml +0 -9
- package/example/android/app/src/main/AndroidManifest.xml +0 -26
- package/example/android/app/src/main/java/comnyx/example/MainActivity.kt +0 -22
- package/example/android/app/src/main/java/comnyx/example/MainApplication.kt +0 -44
- package/example/android/app/src/main/res/drawable/rn_edit_text_material.xml +0 -37
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/example/android/app/src/main/res/values/strings.xml +0 -3
- package/example/android/app/src/main/res/values/styles.xml +0 -9
- package/example/android/build.gradle +0 -21
- package/example/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/example/android/gradle/wrapper/gradle-wrapper.properties +0 -7
- package/example/android/gradle.properties +0 -39
- package/example/android/gradlew +0 -251
- package/example/android/gradlew.bat +0 -94
- package/example/android/settings.gradle +0 -6
- package/example/app.json +0 -4
- package/example/babel.config.js +0 -12
- package/example/index.js +0 -5
- package/example/ios/.xcode.env +0 -11
- package/example/ios/ComnyxExample/AppDelegate.swift +0 -30
- package/example/ios/ComnyxExample/Images.xcassets/AppIcon.appiconset/Contents.json +0 -53
- package/example/ios/ComnyxExample/Images.xcassets/Contents.json +0 -6
- package/example/ios/ComnyxExample/Info.plist +0 -52
- package/example/ios/ComnyxExample/LaunchScreen.storyboard +0 -47
- package/example/ios/ComnyxExample/PrivacyInfo.xcprivacy +0 -37
- package/example/ios/ComnyxExample.xcodeproj/project.pbxproj +0 -505
- package/example/ios/ComnyxExample.xcodeproj/xcshareddata/xcschemes/ComnyxExample.xcscheme +0 -88
- package/example/ios/Podfile +0 -43
- package/example/jest.config.js +0 -3
- package/example/metro.config.js +0 -18
- package/example/package.json +0 -31
- package/example/react-native.config.js +0 -21
- package/example/src/App.tsx +0 -20
- package/lefthook.yml +0 -14
- package/lib/typescript/commonjs/src/__tests__/index.test.d.ts +0 -1
- package/lib/typescript/commonjs/src/__tests__/index.test.d.ts.map +0 -1
- package/lib/typescript/module/src/__tests__/index.test.d.ts +0 -1
- package/lib/typescript/module/src/__tests__/index.test.d.ts.map +0 -1
- package/src/__tests__/index.test.tsx +0 -1
- package/tsconfig.build.json +0 -4
- package/tsconfig.json +0 -30
- package/turbo.json +0 -36
- package/yarn.lock +0 -9251
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["require","_register","_App"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;;;;;;;;;;;;;AAAAA,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AAEA,IAAAE,IAAA,GAAAF,OAAA","ignoreList":[]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.registerComnyx = registerComnyx;
|
|
7
|
+
var _api = require("./api/api.js");
|
|
8
|
+
var _store = require("./store.js");
|
|
9
|
+
function registerComnyx(registerOptions) {
|
|
10
|
+
if (!registerOptions.externalId) {
|
|
11
|
+
throw new Error('External ID is required for initialization');
|
|
12
|
+
}
|
|
13
|
+
if (!registerOptions.token) {
|
|
14
|
+
throw new Error('Authentication token is required');
|
|
15
|
+
}
|
|
16
|
+
(0, _api.initApi)(registerOptions.token);
|
|
17
|
+
_store.useAppStore.getState().init({
|
|
18
|
+
externalId: registerOptions.externalId
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=register.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_api","require","_store","registerComnyx","registerOptions","externalId","Error","token","initApi","useAppStore","getState","init"],"sourceRoot":"../../src","sources":["register.ts"],"mappings":";;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEO,SAASE,cAAcA,CAACC,eAG9B,EAAE;EACD,IAAI,CAACA,eAAe,CAACC,UAAU,EAAE;IAC/B,MAAM,IAAIC,KAAK,CAAC,4CAA4C,CAAC;EAC/D;EACA,IAAI,CAACF,eAAe,CAACG,KAAK,EAAE;IAC1B,MAAM,IAAID,KAAK,CAAC,kCAAkC,CAAC;EACrD;EAEA,IAAAE,YAAO,EAACJ,eAAe,CAACG,KAAK,CAAC;EAC9BE,kBAAW,CAACC,QAAQ,CAAC,CAAC,CAACC,IAAI,CAAC;IAAEN,UAAU,EAAED,eAAe,CAACC;EAAW,CAAC,CAAC;AACzE","ignoreList":[]}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useAppStore = void 0;
|
|
7
|
+
var _middleware = require("zustand/middleware");
|
|
8
|
+
var _shallow = require("zustand/shallow");
|
|
9
|
+
var _traditional = require("zustand/traditional");
|
|
10
|
+
var _asyncStorage = _interopRequireDefault(require("@react-native-async-storage/async-storage"));
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
const storeCreator = (set, get) => ({
|
|
13
|
+
initialized: false,
|
|
14
|
+
customer: null,
|
|
15
|
+
data: null,
|
|
16
|
+
externalId: null,
|
|
17
|
+
language: 'en',
|
|
18
|
+
theme: 'light',
|
|
19
|
+
fake: false,
|
|
20
|
+
firstMessage: null,
|
|
21
|
+
setData: cb => {
|
|
22
|
+
const newData = cb(get().data);
|
|
23
|
+
set({
|
|
24
|
+
data: newData
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
setFirstMessage: message => {
|
|
28
|
+
set({
|
|
29
|
+
firstMessage: message
|
|
30
|
+
});
|
|
31
|
+
},
|
|
32
|
+
init: ({
|
|
33
|
+
externalId
|
|
34
|
+
}) => {
|
|
35
|
+
set({
|
|
36
|
+
externalId: externalId,
|
|
37
|
+
initialized: true
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
initForm: createCustomerResponse => {
|
|
41
|
+
set({
|
|
42
|
+
customer: createCustomerResponse
|
|
43
|
+
});
|
|
44
|
+
},
|
|
45
|
+
setLanguage: language => {
|
|
46
|
+
set({
|
|
47
|
+
language
|
|
48
|
+
});
|
|
49
|
+
},
|
|
50
|
+
setTheme: theme => {
|
|
51
|
+
set({
|
|
52
|
+
theme
|
|
53
|
+
});
|
|
54
|
+
},
|
|
55
|
+
setFake: fake => {
|
|
56
|
+
set({
|
|
57
|
+
fake
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
const useAppStore = exports.useAppStore = (0, _traditional.createWithEqualityFn)()((0, _middleware.persist)(storeCreator, {
|
|
62
|
+
name: 'appStore-9',
|
|
63
|
+
storage: (0, _middleware.createJSONStorage)(() => _asyncStorage.default),
|
|
64
|
+
skipHydration: false,
|
|
65
|
+
partialize: state => ({
|
|
66
|
+
customer: state.customer,
|
|
67
|
+
externalId: state.externalId,
|
|
68
|
+
data: []
|
|
69
|
+
/* data: state.data
|
|
70
|
+
?.filter((message) => message.approved)
|
|
71
|
+
.map((message) => ({
|
|
72
|
+
...message,
|
|
73
|
+
created_at: message.created_at
|
|
74
|
+
? new Date(message.created_at)
|
|
75
|
+
: undefined,
|
|
76
|
+
})),*/
|
|
77
|
+
})
|
|
78
|
+
}), _shallow.shallow);
|
|
79
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_middleware","require","_shallow","_traditional","_asyncStorage","_interopRequireDefault","e","__esModule","default","storeCreator","set","get","initialized","customer","data","externalId","language","theme","fake","firstMessage","setData","cb","newData","setFirstMessage","message","init","initForm","createCustomerResponse","setLanguage","setTheme","setFake","useAppStore","exports","createWithEqualityFn","persist","name","storage","createJSONStorage","AsyncStorage","skipHydration","partialize","state","shallow"],"sourceRoot":"../../src","sources":["store.ts"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAEA,IAAAG,aAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAAqE,SAAAI,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AA2BrE,MAAMG,YAAyC,GAAGA,CAACC,GAAG,EAAEC,GAAG,MAAM;EAC/DC,WAAW,EAAE,KAAK;EAClBC,QAAQ,EAAE,IAAI;EACdC,IAAI,EAAE,IAAI;EACVC,UAAU,EAAE,IAAI;EAChBC,QAAQ,EAAE,IAAI;EACdC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,KAAK;EACXC,YAAY,EAAE,IAAI;EAClBC,OAAO,EAAGC,EAAE,IAAK;IACf,MAAMC,OAAO,GAAGD,EAAE,CAACV,GAAG,CAAC,CAAC,CAACG,IAAI,CAAC;IAC9BJ,GAAG,CAAC;MAAEI,IAAI,EAAEQ;IAAQ,CAAC,CAAC;EACxB,CAAC;EACDC,eAAe,EAAGC,OAAO,IAAK;IAC5Bd,GAAG,CAAC;MAAES,YAAY,EAAEK;IAAQ,CAAC,CAAC;EAChC,CAAC;EACDC,IAAI,EAAEA,CAAC;IAAEV;EAAmC,CAAC,KAAK;IAChDL,GAAG,CAAC;MAAEK,UAAU,EAAEA,UAAU;MAAEH,WAAW,EAAE;IAAK,CAAC,CAAC;EACpD,CAAC;EACDc,QAAQ,EAAGC,sBAAgC,IAAK;IAC9CjB,GAAG,CAAC;MAAEG,QAAQ,EAAEc;IAAuB,CAAC,CAAC;EAC3C,CAAC;EACDC,WAAW,EAAGZ,QAAsB,IAAK;IACvCN,GAAG,CAAC;MAAEM;IAAS,CAAC,CAAC;EACnB,CAAC;EACDa,QAAQ,EAAGZ,KAAuB,IAAK;IACrCP,GAAG,CAAC;MAAEO;IAAM,CAAC,CAAC;EAChB,CAAC;EACDa,OAAO,EAAGZ,IAAa,IAAK;IAC1BR,GAAG,CAAC;MAAEQ;IAAK,CAAC,CAAC;EACf;AACF,CAAC,CAAC;AAEK,MAAMa,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,IAAAE,iCAAoB,EAAgB,CAAC,CAC9D,IAAAC,mBAAO,EAACzB,YAAY,EAAE;EACpB0B,IAAI,EAAE,YAAY;EAClBC,OAAO,EAAE,IAAAC,6BAAiB,EAAC,MAAMC,qBAAY,CAAC;EAC9CC,aAAa,EAAE,KAAK;EACpBC,UAAU,EAAGC,KAAK,KAAM;IACtB5B,QAAQ,EAAE4B,KAAK,CAAC5B,QAAQ;IACxBE,UAAU,EAAE0B,KAAK,CAAC1B,UAAU;IAC5BD,IAAI,EAAE;IACN;AACN;AACA;AACA;AACA;AACA;AACA;AACA;EACI,CAAC;AACH,CAAC,CAAC,EACF4B,gBACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/ApiOptions.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/Conversation.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/Customer.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/Language.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/LocalizationKeys.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/MessageResponse.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.lightTheme = exports.darkTheme = void 0;
|
|
7
|
+
const lightTheme = exports.lightTheme = {
|
|
8
|
+
primary: '#4361EE',
|
|
9
|
+
secondary: '#3A0CA3',
|
|
10
|
+
background: '#FFFFFF',
|
|
11
|
+
text: '#212529',
|
|
12
|
+
error: '#FF3B30',
|
|
13
|
+
success: '#34C759',
|
|
14
|
+
warning: '#FF9500',
|
|
15
|
+
info: '#007AFF',
|
|
16
|
+
border: '#E9ECEF'
|
|
17
|
+
};
|
|
18
|
+
const darkTheme = exports.darkTheme = {
|
|
19
|
+
primary: '#4361EE',
|
|
20
|
+
secondary: '#3A0CA3',
|
|
21
|
+
background: '#121212',
|
|
22
|
+
text: '#FFFFFF',
|
|
23
|
+
error: '#FF453A',
|
|
24
|
+
success: '#32D74B',
|
|
25
|
+
warning: '#FF9F0A',
|
|
26
|
+
info: '#0A84FF',
|
|
27
|
+
border: '#2C2C2C'
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=Theme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["lightTheme","exports","primary","secondary","background","text","error","success","warning","info","border","darkTheme"],"sourceRoot":"../../../src","sources":["types/Theme.ts"],"mappings":";;;;;;AAYO,MAAMA,UAAuB,GAAAC,OAAA,CAAAD,UAAA,GAAG;EACrCE,OAAO,EAAE,SAAS;EAClBC,SAAS,EAAE,SAAS;EACpBC,UAAU,EAAE,SAAS;EACrBC,IAAI,EAAE,SAAS;EACfC,KAAK,EAAE,SAAS;EAChBC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE,SAAS;EAClBC,IAAI,EAAE,SAAS;EACfC,MAAM,EAAE;AACV,CAAC;AAEM,MAAMC,SAAsB,GAAAV,OAAA,CAAAU,SAAA,GAAG;EACpCT,OAAO,EAAE,SAAS;EAClBC,SAAS,EAAE,SAAS;EACpBC,UAAU,EAAE,SAAS;EACrBC,IAAI,EAAE,SAAS;EACfC,KAAK,EAAE,SAAS;EAChBC,OAAO,EAAE,SAAS;EAClBC,OAAO,EAAE,SAAS;EAClBC,IAAI,EAAE,SAAS;EACfC,MAAM,EAAE;AACV,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.dateToUnixTimestamp = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* Converts a Date object to Unix timestamp (seconds)
|
|
9
|
+
* @param date - The Date object to convert
|
|
10
|
+
* @returns Unix timestamp in seconds, or undefined if date is undefined
|
|
11
|
+
*/
|
|
12
|
+
const dateToUnixTimestamp = date => {
|
|
13
|
+
if (!date) return undefined;
|
|
14
|
+
return Math.floor(date.getTime() / 1000);
|
|
15
|
+
};
|
|
16
|
+
exports.dateToUnixTimestamp = dateToUnixTimestamp;
|
|
17
|
+
//# sourceMappingURL=date.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["dateToUnixTimestamp","date","undefined","Math","floor","getTime","exports"],"sourceRoot":"../../../src","sources":["utils/date.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACO,MAAMA,mBAAmB,GAC9BC,IAAsB,IACC;EACvB,IAAI,CAACA,IAAI,EAAE,OAAOC,SAAS;EAC3B,OAAOC,IAAI,CAACC,KAAK,CAACH,IAAI,CAACI,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;AAC1C,CAAC;AAACC,OAAA,CAAAN,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { View, StyleSheet } from 'react-native';
|
|
4
|
+
import { useAppStore } from "./store.js";
|
|
5
|
+
import { ChatList } from "./components/ChatList.js";
|
|
6
|
+
import { CustomerForm } from "./components/CustomerForm.js";
|
|
7
|
+
import { useEffect } from 'react';
|
|
8
|
+
import { AppText } from "./components/AppText.js";
|
|
9
|
+
import { useThemeColors } from "./hooks/useThemeColors.js";
|
|
10
|
+
import { usePolling } from "./hooks/usePolling.js";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
export function Comnyx({
|
|
13
|
+
language = 'en',
|
|
14
|
+
theme = 'dark',
|
|
15
|
+
fake = false
|
|
16
|
+
}) {
|
|
17
|
+
const {
|
|
18
|
+
initialized,
|
|
19
|
+
customer
|
|
20
|
+
} = useAppStore(s => ({
|
|
21
|
+
initialized: s.initialized,
|
|
22
|
+
customer: s.customer
|
|
23
|
+
}));
|
|
24
|
+
const themeColors = useThemeColors();
|
|
25
|
+
usePolling();
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
useAppStore.getState().setLanguage(language);
|
|
28
|
+
useAppStore.getState().setTheme(theme);
|
|
29
|
+
useAppStore.getState().setFake(fake);
|
|
30
|
+
}, [language, theme, fake]);
|
|
31
|
+
if (!initialized) {
|
|
32
|
+
return /*#__PURE__*/_jsx(View, {
|
|
33
|
+
style: [styles.container, {
|
|
34
|
+
backgroundColor: themeColors.background
|
|
35
|
+
}],
|
|
36
|
+
children: /*#__PURE__*/_jsx(AppText, {
|
|
37
|
+
localization: "app.initialization.required"
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
} else if (!customer) {
|
|
41
|
+
return /*#__PURE__*/_jsx(CustomerForm, {});
|
|
42
|
+
}
|
|
43
|
+
return /*#__PURE__*/_jsx(View, {
|
|
44
|
+
style: [styles.container, {
|
|
45
|
+
backgroundColor: themeColors.background
|
|
46
|
+
}],
|
|
47
|
+
children: /*#__PURE__*/_jsx(ChatList, {})
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
const styles = StyleSheet.create({
|
|
51
|
+
container: {
|
|
52
|
+
flex: 1
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=App.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["View","StyleSheet","useAppStore","ChatList","CustomerForm","useEffect","AppText","useThemeColors","usePolling","jsx","_jsx","Comnyx","language","theme","fake","initialized","customer","s","themeColors","getState","setLanguage","setTheme","setFake","style","styles","container","backgroundColor","background","children","localization","create","flex"],"sourceRoot":"../../src","sources":["App.tsx"],"mappings":";;AAAA,SAASA,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAC/C,SAASC,WAAW,QAAQ,YAAS;AACrC,SAASC,QAAQ,QAAQ,0BAAuB;AAChD,SAASC,YAAY,QAAQ,8BAA2B;AAExD,SAASC,SAAS,QAAQ,OAAO;AACjC,SAASC,OAAO,QAAQ,yBAAsB;AAC9C,SAASC,cAAc,QAAQ,2BAAwB;AACvD,SAASC,UAAU,QAAQ,uBAAoB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAQhD,OAAO,SAASC,MAAMA,CAAC;EACrBC,QAAQ,GAAG,IAAI;EACfC,KAAK,GAAG,MAAM;EACdC,IAAI,GAAG;AACI,CAAC,EAAE;EACd,MAAM;IAAEC,WAAW;IAAEC;EAAS,CAAC,GAAGd,WAAW,CAAEe,CAAC,KAAM;IACpDF,WAAW,EAAEE,CAAC,CAACF,WAAW;IAC1BC,QAAQ,EAAEC,CAAC,CAACD;EACd,CAAC,CAAC,CAAC;EACH,MAAME,WAAW,GAAGX,cAAc,CAAC,CAAC;EACpCC,UAAU,CAAC,CAAC;EACZH,SAAS,CAAC,MAAM;IACdH,WAAW,CAACiB,QAAQ,CAAC,CAAC,CAACC,WAAW,CAACR,QAAQ,CAAC;IAC5CV,WAAW,CAACiB,QAAQ,CAAC,CAAC,CAACE,QAAQ,CAACR,KAAK,CAAC;IACtCX,WAAW,CAACiB,QAAQ,CAAC,CAAC,CAACG,OAAO,CAACR,IAAI,CAAC;EACtC,CAAC,EAAE,CAACF,QAAQ,EAAEC,KAAK,EAAEC,IAAI,CAAC,CAAC;EAE3B,IAAI,CAACC,WAAW,EAAE;IAChB,oBACEL,IAAA,CAACV,IAAI;MACHuB,KAAK,EAAE,CAACC,MAAM,CAACC,SAAS,EAAE;QAAEC,eAAe,EAAER,WAAW,CAACS;MAAW,CAAC,CAAE;MAAAC,QAAA,eAEvElB,IAAA,CAACJ,OAAO;QAACuB,YAAY,EAAC;MAA6B,CAAE;IAAC,CAClD,CAAC;EAEX,CAAC,MAAM,IAAI,CAACb,QAAQ,EAAE;IACpB,oBAAON,IAAA,CAACN,YAAY,IAAE,CAAC;EACzB;EAEA,oBACEM,IAAA,CAACV,IAAI;IACHuB,KAAK,EAAE,CAACC,MAAM,CAACC,SAAS,EAAE;MAAEC,eAAe,EAAER,WAAW,CAACS;IAAW,CAAC,CAAE;IAAAC,QAAA,eAEvElB,IAAA,CAACP,QAAQ,IAAE;EAAC,CACR,CAAC;AAEX;AAEA,MAAMqB,MAAM,GAAGvB,UAAU,CAAC6B,MAAM,CAAC;EAC/BL,SAAS,EAAE;IACTM,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useAppStore } from "./store.js";
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
global.clearStorage = async () => {
|
|
6
|
+
useAppStore.setState({
|
|
7
|
+
data: null
|
|
8
|
+
});
|
|
9
|
+
console.info('Storage cleared');
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// @ts-ignore
|
|
13
|
+
global.changeLanguage = language => {
|
|
14
|
+
useAppStore.setState({
|
|
15
|
+
language: language
|
|
16
|
+
});
|
|
17
|
+
console.info(`Language changed to: ${language}`);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
global.toggleTheme = () => {
|
|
22
|
+
const currentTheme = useAppStore.getState().theme;
|
|
23
|
+
const newTheme = currentTheme === 'light' ? 'dark' : 'light';
|
|
24
|
+
useAppStore.setState({
|
|
25
|
+
theme: newTheme
|
|
26
|
+
});
|
|
27
|
+
console.info(`Theme changed to: ${newTheme}`);
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=__dev__.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useAppStore","global","clearStorage","setState","data","console","info","changeLanguage","language","toggleTheme","currentTheme","getState","theme","newTheme"],"sourceRoot":"../../src","sources":["__dev__.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,YAAS;AAGrC;AACAC,MAAM,CAACC,YAAY,GAAG,YAAY;EAChCF,WAAW,CAACG,QAAQ,CAAC;IAAEC,IAAI,EAAE;EAAK,CAAC,CAAC;EACpCC,OAAO,CAACC,IAAI,CAAC,iBAAiB,CAAC;AACjC,CAAC;;AAED;AACAL,MAAM,CAACM,cAAc,GAAIC,QAAgB,IAAK;EAC5CR,WAAW,CAACG,QAAQ,CAAC;IAAEK,QAAQ,EAAEA;EAAyB,CAAC,CAAC;EAC5DH,OAAO,CAACC,IAAI,CAAC,wBAAwBE,QAAQ,EAAE,CAAC;AAClD,CAAC;;AAED;AACAP,MAAM,CAACQ,WAAW,GAAG,MAAM;EACzB,MAAMC,YAAY,GAAGV,WAAW,CAACW,QAAQ,CAAC,CAAC,CAACC,KAAK;EACjD,MAAMC,QAAQ,GAAGH,YAAY,KAAK,OAAO,GAAG,MAAM,GAAG,OAAO;EAC5DV,WAAW,CAACG,QAAQ,CAAC;IAAES,KAAK,EAAEC;EAAS,CAAC,CAAC;EACzCR,OAAO,CAACC,IAAI,CAAC,qBAAqBO,QAAQ,EAAE,CAAC;AAC/C,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import axios from 'axios';
|
|
4
|
+
const axiosInstance = axios.create({
|
|
5
|
+
//baseURL: 'https://api.comnyx.com',
|
|
6
|
+
baseURL: 'https://stage.comnyx.com',
|
|
7
|
+
headers: {
|
|
8
|
+
'Content-Type': 'application/json'
|
|
9
|
+
},
|
|
10
|
+
timeout: 1000
|
|
11
|
+
});
|
|
12
|
+
export function initApi(token) {
|
|
13
|
+
axiosInstance.defaults.headers.common['Content-Type'] = 'application/json';
|
|
14
|
+
axiosInstance.defaults.headers.common.Authorization = 'Bearer ' + token;
|
|
15
|
+
}
|
|
16
|
+
export { axiosInstance };
|
|
17
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["axios","axiosInstance","create","baseURL","headers","timeout","initApi","token","defaults","common","Authorization"],"sourceRoot":"../../../src","sources":["api/api.ts"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,MAAMC,aAAa,GAAGD,KAAK,CAACE,MAAM,CAAC;EACjC;EACAC,OAAO,EAAE,0BAA0B;EACnCC,OAAO,EAAE;IACP,cAAc,EAAE;EAClB,CAAC;EACDC,OAAO,EAAE;AACX,CAAC,CAAC;AAEF,OAAO,SAASC,OAAOA,CAACC,KAAa,EAAE;EACrCN,aAAa,CAACO,QAAQ,CAACJ,OAAO,CAACK,MAAM,CAAC,cAAc,CAAC,GAAG,kBAAkB;EAC1ER,aAAa,CAACO,QAAQ,CAACJ,OAAO,CAACK,MAAM,CAACC,aAAa,GAAG,SAAS,GAAGH,KAAK;AACzE;AAEA,SAASN,aAAa","ignoreList":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { getFakeConversationResponse, getFakePaginatedConversationResponse } from "../data/fake/conversations.js";
|
|
4
|
+
import { axiosInstance } from "./api.js";
|
|
5
|
+
import { dateToUnixTimestamp } from "../utils/date.js";
|
|
6
|
+
const PER_PAGE = 25;
|
|
7
|
+
export function getCustomerConversation(externalId, created_at, page = 0, options) {
|
|
8
|
+
if (options.fake) {
|
|
9
|
+
return getFakePaginatedConversationResponse(page, options.per_page ?? PER_PAGE);
|
|
10
|
+
}
|
|
11
|
+
return axiosInstance.get(`/api/customers/${externalId}/conversation`, {
|
|
12
|
+
params: {
|
|
13
|
+
page,
|
|
14
|
+
// per_page: PER_PAGE,
|
|
15
|
+
getOld: 1,
|
|
16
|
+
getFrom: dateToUnixTimestamp(created_at)
|
|
17
|
+
}
|
|
18
|
+
}).then(res => res.data);
|
|
19
|
+
}
|
|
20
|
+
export function getNewCustomerConversation(externalId, created_at, options) {
|
|
21
|
+
if (options.fake) {
|
|
22
|
+
return getFakeConversationResponse(25, 0, 0, true);
|
|
23
|
+
}
|
|
24
|
+
return axiosInstance.get(`/api/customers/${externalId}/conversation`, {
|
|
25
|
+
params: {
|
|
26
|
+
page: 1,
|
|
27
|
+
// per_page: 25,
|
|
28
|
+
getFrom: dateToUnixTimestamp(created_at)
|
|
29
|
+
}
|
|
30
|
+
}).then(res => res.data);
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=conversations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getFakeConversationResponse","getFakePaginatedConversationResponse","axiosInstance","dateToUnixTimestamp","PER_PAGE","getCustomerConversation","externalId","created_at","page","options","fake","per_page","get","params","getOld","getFrom","then","res","data","getNewCustomerConversation"],"sourceRoot":"../../../src","sources":["api/conversations.ts"],"mappings":";;AAEA,SACEA,2BAA2B,EAC3BC,oCAAoC,QAC/B,+BAA4B;AACnC,SAASC,aAAa,QAAQ,UAAO;AACrC,SAASC,mBAAmB,QAAQ,kBAAe;AAEnD,MAAMC,QAAQ,GAAG,EAAE;AAEnB,OAAO,SAASC,uBAAuBA,CACrCC,UAAkB,EAClBC,UAA4B,EAC5BC,IAAY,GAAG,CAAC,EAChBC,OAA2C,EACZ;EAC/B,IAAIA,OAAO,CAACC,IAAI,EAAE;IAChB,OAAOT,oCAAoC,CACzCO,IAAI,EACJC,OAAO,CAACE,QAAQ,IAAIP,QACtB,CAAC;EACH;EACA,OAAOF,aAAa,CACjBU,GAAG,CAAuB,kBAAkBN,UAAU,eAAe,EAAE;IACtEO,MAAM,EAAE;MACNL,IAAI;MACJ;MACAM,MAAM,EAAE,CAAC;MACTC,OAAO,EAAEZ,mBAAmB,CAACI,UAAU;IACzC;EACF,CAAC,CAAC,CACDS,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC;AAC5B;AAEA,OAAO,SAASC,0BAA0BA,CACxCb,UAAkB,EAClBC,UAA4B,EAC5BE,OAAmB,EACY;EAC/B,IAAIA,OAAO,CAACC,IAAI,EAAE;IAChB,OAAOV,2BAA2B,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC;EACpD;EACA,OAAOE,aAAa,CACjBU,GAAG,CAAuB,kBAAkBN,UAAU,eAAe,EAAE;IACtEO,MAAM,EAAE;MACNL,IAAI,EAAE,CAAC;MACP;MACAO,OAAO,EAAEZ,mBAAmB,CAACI,UAAU;IACzC;EACF,CAAC,CAAC,CACDS,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC;AAC5B","ignoreList":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { getFakeCustomer } from "../data/fake/customers.js";
|
|
4
|
+
import { axiosInstance } from "./api.js";
|
|
5
|
+
export function createCustomer(customerData, options) {
|
|
6
|
+
if (options.fake) {
|
|
7
|
+
return Promise.resolve(getFakeCustomer(customerData));
|
|
8
|
+
}
|
|
9
|
+
return axiosInstance.post('/api/customers/create', customerData).then(res => res.data);
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=customers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getFakeCustomer","axiosInstance","createCustomer","customerData","options","fake","Promise","resolve","post","then","res","data"],"sourceRoot":"../../../src","sources":["api/customers.ts"],"mappings":";;AAEA,SAASA,eAAe,QAAQ,2BAAwB;AACxD,SAASC,aAAa,QAAQ,UAAO;AAErC,OAAO,SAASC,cAAcA,CAC5BC,YAAmC,EACnCC,OAAmB,EACA;EACnB,IAAIA,OAAO,CAACC,IAAI,EAAE;IAChB,OAAOC,OAAO,CAACC,OAAO,CAACP,eAAe,CAACG,YAAY,CAAC,CAAC;EACvD;EACA,OAAOF,aAAa,CACjBO,IAAI,CAAC,uBAAuB,EAAEL,YAAY,CAAC,CAC3CM,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC;AAC5B","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createCustomer","getCustomerConversation","getNewCustomerConversation","sendCustomerMessage"],"sourceRoot":"../../../src","sources":["api/index.ts"],"mappings":";;AAAA,SAASA,cAAc,QAAQ,gBAAa;AAC5C,SACEC,uBAAuB,EACvBC,0BAA0B,QACrB,oBAAiB;AACxB,SAASC,mBAAmB,QAAQ,eAAY","ignoreList":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { getFakeMessageResponse } from "../data/fake/messages.js";
|
|
4
|
+
import { axiosInstance } from "./api.js";
|
|
5
|
+
export function sendCustomerMessage(externalId, content, options) {
|
|
6
|
+
if (options.fake) {
|
|
7
|
+
return new Promise((resolve, _) => {
|
|
8
|
+
setTimeout(() => {
|
|
9
|
+
resolve(getFakeMessageResponse(content));
|
|
10
|
+
}, 500);
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
return axiosInstance.post('/api/customers/message', {
|
|
14
|
+
externalId,
|
|
15
|
+
content
|
|
16
|
+
}, {
|
|
17
|
+
headers: {
|
|
18
|
+
'Accept': 'application/json',
|
|
19
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
20
|
+
}
|
|
21
|
+
}).then(res => res.data);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=messages.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getFakeMessageResponse","axiosInstance","sendCustomerMessage","externalId","content","options","fake","Promise","resolve","_","setTimeout","post","headers","then","res","data"],"sourceRoot":"../../../src","sources":["api/messages.ts"],"mappings":";;AAEA,SAASA,sBAAsB,QAAQ,0BAAuB;AAC9D,SAASC,aAAa,QAAQ,UAAO;AAErC,OAAO,SAASC,mBAAmBA,CACjCC,UAAkB,EAClBC,OAAe,EACfC,OAAmB,EACO;EAC1B,IAAIA,OAAO,CAACC,IAAI,EAAE;IAChB,OAAO,IAAIC,OAAO,CAAkB,CAACC,OAAO,EAAEC,CAAC,KAAK;MAClDC,UAAU,CAAC,MAAM;QACfF,OAAO,CAACR,sBAAsB,CAACI,OAAO,CAAC,CAAC;MAC1C,CAAC,EAAE,GAAG,CAAC;IACT,CAAC,CAAC;EACJ;EACA,OAAOH,aAAa,CACjBU,IAAI,CACH,wBAAwB,EACxB;IACER,UAAU;IACVC;EACF,CAAC,EACD;IACEQ,OAAO,EAAE;MACP,QAAQ,EAAE,kBAAkB;MAC5B,cAAc,EAAE;IAClB;EACF,CACF,CAAC,CACAC,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC;AAC5B","ignoreList":[]}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Text } from 'react-native';
|
|
4
|
+
import { LocalizationList } from "../constants/translations.js";
|
|
5
|
+
import { useAppStore } from "../store.js";
|
|
6
|
+
import { useThemeColors } from "../hooks/useThemeColors.js";
|
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
|
+
export function AppText({
|
|
9
|
+
style,
|
|
10
|
+
localization,
|
|
11
|
+
children,
|
|
12
|
+
...props
|
|
13
|
+
}) {
|
|
14
|
+
const themeColors = useThemeColors();
|
|
15
|
+
const {
|
|
16
|
+
language
|
|
17
|
+
} = useAppStore(s => ({
|
|
18
|
+
language: s.language
|
|
19
|
+
}));
|
|
20
|
+
const localizedText = localization ? (LocalizationList[language] || LocalizationList.en)[localization] : undefined;
|
|
21
|
+
const content = localizedText || children;
|
|
22
|
+
if (!content) {
|
|
23
|
+
console.warn('AppText: No content provided. Either localization or children must be provided.');
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
27
|
+
style: [{
|
|
28
|
+
color: themeColors.text
|
|
29
|
+
}, style],
|
|
30
|
+
...props,
|
|
31
|
+
children: content
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=AppText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Text","LocalizationList","useAppStore","useThemeColors","jsx","_jsx","AppText","style","localization","children","props","themeColors","language","s","localizedText","en","undefined","content","console","warn","color","text"],"sourceRoot":"../../../src","sources":["components/AppText.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,cAAc;AAEnC,SAASC,gBAAgB,QAAQ,8BAA2B;AAC5D,SAASC,WAAW,QAAQ,aAAU;AACtC,SAASC,cAAc,QAAQ,4BAAyB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAQzD,OAAO,SAASC,OAAOA,CAAC;EACtBC,KAAK;EACLC,YAAY;EACZC,QAAQ;EACR,GAAGC;AACS,CAAC,EAAE;EACf,MAAMC,WAAW,GAAGR,cAAc,CAAC,CAAC;EACpC,MAAM;IAAES;EAAS,CAAC,GAAGV,WAAW,CAAEW,CAAC,KAAM;IACvCD,QAAQ,EAAEC,CAAC,CAACD;EACd,CAAC,CAAC,CAAC;EAEH,MAAME,aAAa,GAAGN,YAAY,GAC9B,CAACP,gBAAgB,CAACW,QAAQ,CAAkC,IAC1DX,gBAAgB,CAACc,EAAE,EAAEP,YAAY,CAAC,GACpCQ,SAAS;EAEb,MAAMC,OAAO,GAAGH,aAAa,IAAIL,QAAQ;EAEzC,IAAI,CAACQ,OAAO,EAAE;IACZC,OAAO,CAACC,IAAI,CACV,iFACF,CAAC;IACD,OAAO,IAAI;EACb;EAEA,oBACEd,IAAA,CAACL,IAAI;IAACO,KAAK,EAAE,CAAC;MAAEa,KAAK,EAAET,WAAW,CAACU;IAAK,CAAC,EAAEd,KAAK,CAAE;IAAA,GAAKG,KAAK;IAAAD,QAAA,EACzDQ;EAAO,CACJ,CAAC;AAEX","ignoreList":[]}
|