quickblox-react-ui-kit 0.3.1 → 0.4.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 (46) hide show
  1. package/README.md +0 -324
  2. package/dist/CommonTypes/CommonTypes.d.ts +1 -0
  3. package/dist/Data/source/remote/IRemoteDataSource.d.ts +3 -0
  4. package/dist/Data/source/remote/RemoteDataSource.d.ts +3 -0
  5. package/dist/Domain/use_cases/ai/AIAnswerAssistWithSDKUseCase.d.ts +11 -0
  6. package/dist/Domain/use_cases/ai/AITranslateWithSDKUseCase.d.ts +12 -0
  7. package/dist/Presentation/Views/Dialog/AIWidgets/UseDefaultAIAssistAnswerWidgetWithSDK.d.ts +3 -0
  8. package/dist/Presentation/Views/Dialog/AIWidgets/UseDefaultAITranslateWidgetWithSDK.d.ts +3 -0
  9. package/dist/Presentation/ui-components/TextField/TextField.d.ts +1 -1
  10. package/dist/index-ui.js +500 -3
  11. package/dist/index-ui.js.map +1 -1
  12. package/dist/qb-api-calls/index.d.ts +3 -1
  13. package/package.json +3 -5
  14. package/src/CommonTypes/CommonTypes.ts +1 -0
  15. package/src/Data/DefaultConfigurations.ts +3 -0
  16. package/src/Data/repository/ConnectionRepository.ts +2 -1
  17. package/src/Data/source/remote/IRemoteDataSource.ts +13 -0
  18. package/src/Data/source/remote/RemoteDataSource.ts +22 -0
  19. package/src/Domain/use_cases/ai/AIAnswerAssistWithSDKUseCase.ts +50 -0
  20. package/src/Domain/use_cases/ai/AITranslateWithSDKUseCase.ts +107 -0
  21. package/src/Presentation/Views/Dialog/AIWidgets/UseDefaultAIAssistAnswerWidgetWithSDK.tsx +74 -0
  22. package/src/Presentation/Views/Dialog/AIWidgets/UseDefaultAITranslateWidgetWithSDK.tsx +70 -0
  23. package/src/Presentation/layouts/Desktop/QuickBloxUIKitDesktopLayout.tsx +14 -2
  24. package/src/QBconfig.ts +3 -0
  25. package/src/package_artan_react_ui.json +91 -0
  26. package/src/package_original.json +115 -0
  27. package/src/qb-api-calls/index.ts +49 -0
  28. package/storybook-static/{703.776b9f13.iframe.bundle.js → 703.f12f2e71.iframe.bundle.js} +2 -2
  29. package/storybook-static/{703.776b9f13.iframe.bundle.js.map → 703.f12f2e71.iframe.bundle.js.map} +1 -1
  30. package/storybook-static/docs-Introduction-mdx.9dc275f1.iframe.bundle.js +10 -0
  31. package/storybook-static/{docs-Introduction-mdx.bcb06844.iframe.bundle.js.map → docs-Introduction-mdx.9dc275f1.iframe.bundle.js.map} +1 -1
  32. package/storybook-static/docs-Styling-mdx.72149f36.iframe.bundle.js +10 -0
  33. package/storybook-static/{docs-Styling-mdx.1d6c1212.iframe.bundle.js.map → docs-Styling-mdx.72149f36.iframe.bundle.js.map} +1 -1
  34. package/storybook-static/iframe.html +1 -1
  35. package/storybook-static/index.html +4 -8
  36. package/storybook-static/project.json +1 -1
  37. package/storybook-static/{runtime~main.3464b25a.iframe.bundle.js → runtime~main.72d6302b.iframe.bundle.js} +1 -1
  38. package/tsconfig.buildlib.json +33 -0
  39. package/storybook-static/docs-Introduction-mdx.bcb06844.iframe.bundle.js +0 -10
  40. package/storybook-static/docs-Styling-mdx.1d6c1212.iframe.bundle.js +0 -10
  41. package/storybook-static/sb-addons/onboarding-7/manager-bundle.js +0 -503
  42. package/storybook-static/sb-addons/onboarding-7/manager-bundle.js.LEGAL.txt +0 -48
  43. /package/storybook-static/sb-addons/{interactions-8 → interactions-7}/manager-bundle.js +0 -0
  44. /package/storybook-static/sb-addons/{interactions-8 → interactions-7}/manager-bundle.js.LEGAL.txt +0 -0
  45. /package/storybook-static/sb-addons/{viewport-9 → viewport-8}/manager-bundle.js +0 -0
  46. /package/storybook-static/sb-addons/{viewport-9 → viewport-8}/manager-bundle.js.LEGAL.txt +0 -0
@@ -0,0 +1,115 @@
1
+ {
2
+ "name": "quickblox-react-ui-kit",
3
+ "version": "0.2.5",
4
+ "main": "dist/index-ui.js",
5
+ "license": "MIT",
6
+ "keywords": [
7
+ "quickblox",
8
+ "javascript",
9
+ "react",
10
+ "typescript",
11
+ "uikit",
12
+ "chat",
13
+ "communication",
14
+ "messaging"
15
+ ],
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git://github.com/QuickBlox/react-ui-kit.git"
19
+ },
20
+ "bugs": {
21
+ "url": "https://github.com/QuickBlox/react-ui-kit/issues"
22
+ },
23
+ "dependencies": {
24
+ "@types/node": "^16.18.6",
25
+ "@types/react": "^18.0.26",
26
+ "@types/react-dom": "^18.0.9",
27
+ "classnames": "^2.3.2",
28
+ "qb-ai-answer-assistant": "^0.1.0",
29
+ "qb-ai-core": "^0.1.0",
30
+ "qb-ai-rephrase": "^0.1.0",
31
+ "qb-ai-translate": "^0.1.0",
32
+ "react": "^18.2.0",
33
+ "react-dom": "^18.2.0",
34
+ "react-router-dom": "^6.11.1",
35
+ "react-scripts": "5.0.1",
36
+ "rxjs": "^7.8.0",
37
+ "typescript": "^4.9.3",
38
+ "web-vitals": "^2.1.4"
39
+ },
40
+ "devDependencies": {
41
+ "@typescript-eslint/eslint-plugin-tslint": "^5.45.1",
42
+ "@typescript-eslint/parser": "^5.45.1",
43
+ "classnames": "^2.3.2",
44
+ "eslint": "^8.29.0",
45
+ "eslint-config-airbnb": "^19.0.4",
46
+ "eslint-config-prettier": "^8.5.0",
47
+ "eslint-import-resolver-typescript": "^3.5.2",
48
+ "eslint-plugin-import": "^2.26.0",
49
+ "eslint-plugin-jsx-a11y": "^6.6.1",
50
+ "eslint-plugin-no-loops": "^0.3.0",
51
+ "eslint-plugin-optimize-regex": "^1.2.1",
52
+ "eslint-plugin-prettier": "^4.2.1",
53
+ "eslint-plugin-promise": "^6.1.1",
54
+ "eslint-plugin-react": "^7.31.11",
55
+ "eslint-plugin-react-hooks": "^4.6.0",
56
+ "prettier": "^2.8.0",
57
+ "@testing-library/jest-dom": "^5.16.5",
58
+ "@testing-library/react": "^13.4.0",
59
+ "@testing-library/user-event": "^13.5.0",
60
+ "@types/jest": "^27.5.2",
61
+ "@types/node": "^16.18.6",
62
+ "@types/react": "^18.0.26",
63
+ "@types/react-dom": "^18.0.9",
64
+ "css-loader": "^6.7.3",
65
+ "react": "^18.2.0",
66
+ "react-dom": "^18.2.0",
67
+ "react-router-dom": "^6.4.3",
68
+ "react-scripts": "5.0.1",
69
+ "sass": "^1.62.1",
70
+ "sass-loader": "^13.2.2",
71
+ "style-loader": "^3.3.2",
72
+ "ts-loader": "^9.4.2",
73
+ "typedoc": "^0.23.22",
74
+ "typescript": "^4.9.3",
75
+ "web-vitals": "^2.1.4",
76
+ "webpack": "^5.82.1",
77
+ "webpack-cli": "^5.1.1"
78
+ },
79
+ "peerDependencies": {
80
+ "react": "^17.0.0",
81
+ "typescript": "^4.9.3",
82
+ "quickblox": "^2.15.5"
83
+ },
84
+ "files": ["dist","README.md","LICENSE.md","global.d.ts"],
85
+ "scripts": {
86
+ "start": "react-scripts start",
87
+ "build": "react-scripts build",
88
+ "build:lib": "webpack",
89
+ "test": "react-scripts test",
90
+ "lint": "eslint ./src",
91
+ "eject": "react-scripts eject",
92
+ "prepublishOnly": "npm run build:lib"
93
+ },
94
+ "lint-staged": {
95
+ "src/**/*.{ts,tsx}": "eslint"
96
+ },
97
+ "eslintConfig": {
98
+ "extends": [
99
+ "react-app",
100
+ "react-app/jest"
101
+ ]
102
+ },
103
+ "browserslist": {
104
+ "production": [
105
+ ">0.2%",
106
+ "not dead",
107
+ "not op_mini all"
108
+ ],
109
+ "development": [
110
+ "last 1 chrome version",
111
+ "last 1 firefox version",
112
+ "last 1 safari version"
113
+ ]
114
+ }
115
+ }
@@ -1,4 +1,6 @@
1
1
  import QB, {
2
+ AIAnswerResponse,
3
+ AIChatHistory,
2
4
  ChatConnectParams,
3
5
  GetMessagesResult,
4
6
  GetUserParams,
@@ -619,3 +621,50 @@ export function QBWebRTCSessionGetUserMedia(
619
621
  });
620
622
  });
621
623
  }
624
+ // export interface AIAnswerResponse {
625
+ // answer: string;
626
+ // } // artim 19.05.2024
627
+
628
+ export function QBAnswerAssist(
629
+ smartChatAssistantId: string,
630
+ messageToAssist: string,
631
+ history: AIChatHistory,
632
+ ) {
633
+ return new Promise<AIAnswerResponse>((resolve, reject) => {
634
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
635
+ QB.ai.answerAssist(
636
+ smartChatAssistantId,
637
+ messageToAssist,
638
+ history,
639
+ (err, res) => {
640
+ if (err) {
641
+ reject(err);
642
+ } else {
643
+ resolve(res as unknown as AIAnswerResponse);
644
+ }
645
+ },
646
+ );
647
+ });
648
+ }
649
+
650
+ export function QBTranslate(
651
+ smartChatAssistantId: string,
652
+ textToTranslate: string,
653
+ languageCode: string,
654
+ ) {
655
+ return new Promise<AIAnswerResponse>((resolve, reject) => {
656
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call
657
+ QB.ai.translate(
658
+ smartChatAssistantId,
659
+ textToTranslate,
660
+ languageCode,
661
+ (err, res) => {
662
+ if (err) {
663
+ reject(err);
664
+ } else {
665
+ resolve(res as unknown as AIAnswerResponse);
666
+ }
667
+ },
668
+ );
669
+ });
670
+ }