@webinex/chatify 1.0.0-build2 → 1.0.0-rc2

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 (56) hide show
  1. package/package.json +90 -90
  2. package/src/ChatifyContext.tsx +41 -41
  3. package/src/core/action.tsx +319 -319
  4. package/src/core/client.ts +137 -137
  5. package/src/core/index.ts +14 -14
  6. package/src/core/models.tsx +75 -75
  7. package/src/core/reducer.tsx +86 -86
  8. package/src/core/state.ts +38 -38
  9. package/src/core/useAccounts.tsx +11 -11
  10. package/src/core/useAddChat.tsx +12 -12
  11. package/src/core/useAddMember.tsx +12 -12
  12. package/src/core/useAddMessage.tsx +40 -40
  13. package/src/core/useChat.tsx +12 -12
  14. package/src/core/useChatList.tsx +10 -10
  15. package/src/core/useLoadMore.tsx +42 -42
  16. package/src/core/useMessages.tsx +23 -23
  17. package/src/core/useMutation.tsx +48 -48
  18. package/src/core/useQuery.tsx +45 -45
  19. package/src/core/useReadMonitor.tsx +31 -31
  20. package/src/core/useRemoveMember.tsx +12 -12
  21. package/src/core/useSignalRMonitor.tsx +52 -52
  22. package/src/index.ts +3 -3
  23. package/src/ui/AddChat.tsx +55 -55
  24. package/src/ui/AddChatButton.tsx +19 -19
  25. package/src/ui/Aside.tsx +41 -41
  26. package/src/ui/Avatar.tsx +18 -18
  27. package/src/ui/Chat.tsx +26 -26
  28. package/src/ui/ChatBody.tsx +43 -43
  29. package/src/ui/ChatHeader.tsx +33 -33
  30. package/src/ui/ChatHeaderMembers.tsx +30 -30
  31. package/src/ui/ChatHeaderSettingsButton.tsx +26 -26
  32. package/src/ui/ChatListItem.tsx +101 -101
  33. package/src/ui/ChatName.tsx +15 -15
  34. package/src/ui/ChatSettings.tsx +59 -59
  35. package/src/ui/Chatify.tsx +106 -106
  36. package/src/ui/Footer.tsx +7 -7
  37. package/src/ui/Header.tsx +14 -14
  38. package/src/ui/Icon.tsx +21 -21
  39. package/src/ui/InputForm.tsx +51 -51
  40. package/src/ui/LoadMore.tsx +40 -40
  41. package/src/ui/Main.tsx +16 -16
  42. package/src/ui/Message.tsx +118 -118
  43. package/src/ui/MessageSkeleton.tsx +19 -19
  44. package/src/ui/SendingMessage.tsx +50 -50
  45. package/src/ui/SystemMessage.tsx +32 -32
  46. package/src/ui/index.ts +11 -11
  47. package/src/ui/localizer.tsx +68 -68
  48. package/src/ui/styles/aside.scss +94 -94
  49. package/src/ui/styles/index.scss +248 -248
  50. package/src/ui/styles/keyframes.scss +14 -14
  51. package/src/ui/styles/mixins.scss +20 -20
  52. package/src/ui/styles/variables.scss +10 -10
  53. package/src/util/customize.tsx +45 -45
  54. package/src/util/index.ts +3 -3
  55. package/src/util/uniqBy.tsx +17 -17
  56. package/src/util/uniqId.tsx +3 -3
package/package.json CHANGED
@@ -1,90 +1,90 @@
1
- {
2
- "name": "@webinex/chatify",
3
- "description": "Webinex Wispo",
4
- "private": false,
5
- "version": "1.0.0-build2",
6
- "author": "Webinex Dev",
7
- "license": "Apache-2.0",
8
- "main": "dist/cjs/index.js",
9
- "module": "dist/esm/index.js",
10
- "types": "dist/index.d.ts",
11
- "type": "module",
12
- "targets": {
13
- "demo": {
14
- "source": "./example/index.html",
15
- "isLibrary": false
16
- }
17
- },
18
- "files": [
19
- "dist",
20
- "src"
21
- ],
22
- "scripts": {
23
- "build": "rimraf dist && rimraf add && rollup -c --environment ENV:production --failAfterWarnings",
24
- "start": "rollup -c -w",
25
- "lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"",
26
- "prettier:write": "prettier --write \"src/**/*.{js,jsx,ts,tsx}\"",
27
- "prettier:check": "prettier --check \"src/**/*.{js,jsx,ts,tsx}\"",
28
- "parcel": "parcel --target demo --dist-dir ./dist/demo",
29
- "parcel:build": "rimraf ../Webinex.Chatify.Example/wwwroot && cross-env NODE_ENV=production parcel build --target demo --dist-dir ../Webinex.Chatify.Example/wwwroot"
30
- },
31
- "devDependencies": {
32
- "@microsoft/signalr": "^8.0.0",
33
- "@parcel/transformer-sass": "2.9.2",
34
- "@rollup/plugin-commonjs": "^24.0.1",
35
- "@rollup/plugin-eslint": "^9.0.3",
36
- "@rollup/plugin-image": "^3.0.2",
37
- "@rollup/plugin-node-resolve": "^15.0.2",
38
- "@rollup/plugin-typescript": "^11.1.0",
39
- "@types/react": "^18.0.33",
40
- "@types/react-dom": "^18.0.11",
41
- "antd": "^5.11.5",
42
- "axios": "^1.6.2",
43
- "buffer": "^5.5.0||^6.0.0",
44
- "classnames": "^2.3.2",
45
- "cross-env": "^7.0.3",
46
- "dayjs": "^1.11.7",
47
- "eslint": "^8.38.0",
48
- "eslint-config-react-app": "^7.0.1",
49
- "is-hotkey": "^0.2.0",
50
- "parcel": "^2.10.3",
51
- "postcss": "^8.4.21",
52
- "prettier": "^2.8.7",
53
- "process": "^0.11.10",
54
- "react": "^18.2.0",
55
- "react-dom": "^18.2.0",
56
- "rimraf": "^5.0.5",
57
- "rollup": "^3.20.2",
58
- "rollup-plugin-copy": "^3.4.0",
59
- "rollup-plugin-dts": "^5.3.0",
60
- "rollup-plugin-peer-deps-external": "^2.2.4",
61
- "rollup-plugin-postcss": "^4.0.2",
62
- "rollup-plugin-scss": "^4.0.0",
63
- "rollup-plugin-terser": "^7.0.2",
64
- "rollup-plugin-visualizer": "^5.11.0",
65
- "sass": "^1.66.1",
66
- "shallow-equal": "^3.1.0",
67
- "slate": "^0.94.1",
68
- "slate-history": "^0.93.0",
69
- "slate-react": "^0.98.3",
70
- "tslib": "^2.6.2",
71
- "typescript": "^5.2.2"
72
- },
73
- "peerDependencies": {
74
- "@ant-design/icons": "^5.2.6",
75
- "@ctrl/tinycolor": "^4.0.2",
76
- "@microsoft/signalr": "^8.0.0",
77
- "antd": ">=5",
78
- "axios": ">=1",
79
- "classnames": ">=2",
80
- "dayjs": ">=1.8",
81
- "is-hotkey": ">=0",
82
- "react": ">=16",
83
- "react-dom": ">=16",
84
- "shallow-equal": ">=3",
85
- "slate": "^0.94.1",
86
- "slate-history": "^0.93.0",
87
- "slate-react": "^0.98.3"
88
- },
89
- "dependencies": {}
90
- }
1
+ {
2
+ "name": "@webinex/chatify",
3
+ "description": "Webinex Wispo",
4
+ "private": false,
5
+ "version": "1.0.0-rc2",
6
+ "author": "Webinex Dev",
7
+ "license": "Apache-2.0",
8
+ "main": "dist/cjs/index.js",
9
+ "module": "dist/esm/index.js",
10
+ "types": "dist/index.d.ts",
11
+ "type": "module",
12
+ "targets": {
13
+ "demo": {
14
+ "source": "./example/index.html",
15
+ "isLibrary": false
16
+ }
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "src"
21
+ ],
22
+ "scripts": {
23
+ "build": "rimraf dist && rimraf add && rollup -c --environment ENV:production --failAfterWarnings",
24
+ "start": "rollup -c -w",
25
+ "lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"",
26
+ "prettier:write": "prettier --write \"src/**/*.{js,jsx,ts,tsx}\"",
27
+ "prettier:check": "prettier --check \"src/**/*.{js,jsx,ts,tsx}\"",
28
+ "parcel": "parcel --target demo --dist-dir ./dist/demo",
29
+ "parcel:build": "rimraf ../Webinex.Chatify.Example/wwwroot && cross-env NODE_ENV=production parcel build --target demo --dist-dir ../Webinex.Chatify.Example/wwwroot"
30
+ },
31
+ "devDependencies": {
32
+ "@microsoft/signalr": "^8.0.0",
33
+ "@parcel/transformer-sass": "2.9.2",
34
+ "@rollup/plugin-commonjs": "^24.0.1",
35
+ "@rollup/plugin-eslint": "^9.0.3",
36
+ "@rollup/plugin-image": "^3.0.2",
37
+ "@rollup/plugin-node-resolve": "^15.0.2",
38
+ "@rollup/plugin-typescript": "^11.1.0",
39
+ "@types/react": "^18.0.33",
40
+ "@types/react-dom": "^18.0.11",
41
+ "antd": "^5.11.5",
42
+ "axios": "^1.6.2",
43
+ "buffer": "^5.5.0||^6.0.0",
44
+ "classnames": "^2.3.2",
45
+ "cross-env": "^7.0.3",
46
+ "dayjs": "^1.11.7",
47
+ "eslint": "^8.38.0",
48
+ "eslint-config-react-app": "^7.0.1",
49
+ "is-hotkey": "^0.2.0",
50
+ "parcel": "^2.10.3",
51
+ "postcss": "^8.4.21",
52
+ "prettier": "^2.8.7",
53
+ "process": "^0.11.10",
54
+ "react": "^18.2.0",
55
+ "react-dom": "^18.2.0",
56
+ "rimraf": "^5.0.5",
57
+ "rollup": "^3.20.2",
58
+ "rollup-plugin-copy": "^3.4.0",
59
+ "rollup-plugin-dts": "^5.3.0",
60
+ "rollup-plugin-peer-deps-external": "^2.2.4",
61
+ "rollup-plugin-postcss": "^4.0.2",
62
+ "rollup-plugin-scss": "^4.0.0",
63
+ "rollup-plugin-terser": "^7.0.2",
64
+ "rollup-plugin-visualizer": "^5.11.0",
65
+ "sass": "^1.66.1",
66
+ "shallow-equal": "^3.1.0",
67
+ "slate": "^0.94.1",
68
+ "slate-history": "^0.93.0",
69
+ "slate-react": "^0.98.3",
70
+ "tslib": "^2.6.2",
71
+ "typescript": "^5.2.2"
72
+ },
73
+ "peerDependencies": {
74
+ "@ant-design/icons": "^5.2.6",
75
+ "@ctrl/tinycolor": "^4.0.2",
76
+ "@microsoft/signalr": "^8.0.0",
77
+ "antd": ">=5",
78
+ "axios": ">=1",
79
+ "classnames": ">=2",
80
+ "dayjs": ">=1.8",
81
+ "is-hotkey": ">=0",
82
+ "react": ">=16",
83
+ "react-dom": ">=16",
84
+ "shallow-equal": ">=3",
85
+ "slate": "^0.94.1",
86
+ "slate-history": "^0.93.0",
87
+ "slate-react": "^0.98.3"
88
+ },
89
+ "dependencies": {}
90
+ }
@@ -1,41 +1,41 @@
1
- import React, { PropsWithChildren, useContext } from 'react';
2
- import { ReducerProvider } from './core/reducer';
3
- import { ChatifyClient } from './core/client';
4
- import { useSignalRMonitor } from './core/useSignalRMonitor';
5
-
6
- const MeContext = React.createContext<string>(null!);
7
- const ClientContext = React.createContext<ChatifyClient>(null!);
8
-
9
- export function useClient() {
10
- return useContext(ClientContext);
11
- }
12
-
13
- export function useMe() {
14
- return useContext(MeContext);
15
- }
16
-
17
- export interface ChatifyContextValue {
18
- me: string;
19
- client: ChatifyClient;
20
- }
21
-
22
- function ChatifyContextWrapper(props: PropsWithChildren<{}>) {
23
- const { children } = props;
24
- const me = useMe();
25
- const client = useClient();
26
- useSignalRMonitor(me, client);
27
-
28
- return <>{children}</>;
29
- }
30
-
31
- export function ChatifyContext({ value, children }: PropsWithChildren<{ value: ChatifyContextValue }>) {
32
- return (
33
- <ClientContext.Provider value={value.client}>
34
- <MeContext.Provider value={value.me}>
35
- <ReducerProvider>
36
- <ChatifyContextWrapper>{children}</ChatifyContextWrapper>
37
- </ReducerProvider>
38
- </MeContext.Provider>
39
- </ClientContext.Provider>
40
- );
41
- }
1
+ import React, { PropsWithChildren, useContext } from 'react';
2
+ import { ReducerProvider } from './core/reducer';
3
+ import { ChatifyClient } from './core/client';
4
+ import { useSignalRMonitor } from './core/useSignalRMonitor';
5
+
6
+ const MeContext = React.createContext<string>(null!);
7
+ const ClientContext = React.createContext<ChatifyClient>(null!);
8
+
9
+ export function useClient() {
10
+ return useContext(ClientContext);
11
+ }
12
+
13
+ export function useMe() {
14
+ return useContext(MeContext);
15
+ }
16
+
17
+ export interface ChatifyContextValue {
18
+ me: string;
19
+ client: ChatifyClient;
20
+ }
21
+
22
+ function ChatifyContextWrapper(props: PropsWithChildren<{}>) {
23
+ const { children } = props;
24
+ const me = useMe();
25
+ const client = useClient();
26
+ useSignalRMonitor(me, client);
27
+
28
+ return <>{children}</>;
29
+ }
30
+
31
+ export function ChatifyContext({ value, children }: PropsWithChildren<{ value: ChatifyContextValue }>) {
32
+ return (
33
+ <ClientContext.Provider value={value.client}>
34
+ <MeContext.Provider value={value.me}>
35
+ <ReducerProvider>
36
+ <ChatifyContextWrapper>{children}</ChatifyContextWrapper>
37
+ </ReducerProvider>
38
+ </MeContext.Provider>
39
+ </ClientContext.Provider>
40
+ );
41
+ }