소스 검색

:fire: removed all the things

tags/0.0.1
J 4 년 전
부모
커밋
ebff4de8c8
100개의 변경된 파일2360개의 추가작업 그리고 33521개의 파일을 삭제
  1. 2359
    23379
      frontend/package-lock.json
  2. 1
    8
      frontend/package.json
  3. 0
    104
      frontend/src/cometchat-pro-vue-ui-kit/package-lock.json
  4. 0
    17
      frontend/src/cometchat-pro-vue-ui-kit/package.json
  5. 0
    322
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Calls/CometChatIncomingCall/CometChatIncomingCall.vue
  6. 0
    25
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Calls/CometChatIncomingCall/controller.js
  7. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Calls/CometChatIncomingCall/resources/incomingaudiocall.png
  8. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Calls/CometChatIncomingCall/resources/incomingvideocall.png
  9. 0
    122
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Calls/CometChatIncomingCall/style.js
  10. 0
    459
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Calls/CometChatOutgoingCall/CometChatOutgoingCall.vue
  11. 0
    28
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Calls/CometChatOutgoingCall/controller.js
  12. 0
    1
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Calls/CometChatOutgoingCall/resources/call-end-white-icon.svg
  13. 0
    113
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Calls/CometChatOutgoingCall/style.js
  14. 0
    2
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Calls/index.js
  15. 0
    1176
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Chats/CometChatConversationList/CometChatConversationList.vue
  16. 0
    146
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Chats/CometChatConversationList/controller.js
  17. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Chats/CometChatConversationList/resources/navigate.png
  18. 0
    78
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Chats/CometChatConversationList/style.js
  19. 0
    67
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Chats/CometChatConversationListActions/index.vue
  20. 0
    7
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Chats/CometChatConversationListActions/resources/delete.svg
  21. 0
    1
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Chats/CometChatConversationListActions/resources/progress.svg
  22. 0
    35
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Chats/CometChatConversationListActions/style.js
  23. 0
    313
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Chats/CometChatConversationListItem/CometChatConversationListItem.vue
  24. 0
    81
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Chats/CometChatConversationListItem/style.js
  25. 0
    354
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Chats/CometChatConversationListWithMessages/CometChatConversationListWithMessages.vue
  26. 0
    64
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Chats/CometChatConversationListWithMessages/style.js
  27. 0
    4
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Chats/index.js
  28. 0
    229
      frontend/src/cometchat-pro-vue-ui-kit/src/components/CometChatUI/CometChatNavBar/CometChatNavBar.vue
  29. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/CometChatUI/CometChatNavBar/resources/chats-blue.png
  30. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/CometChatUI/CometChatNavBar/resources/chats-grey.png
  31. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/CometChatUI/CometChatNavBar/resources/contacts-blue.png
  32. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/CometChatUI/CometChatNavBar/resources/contacts-grey.png
  33. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/CometChatUI/CometChatNavBar/resources/groups-blue.png
  34. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/CometChatUI/CometChatNavBar/resources/groups-grey.png
  35. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/CometChatUI/CometChatNavBar/resources/userInfo-blue.png
  36. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/CometChatUI/CometChatNavBar/resources/userInfo-grey.png
  37. 0
    40
      frontend/src/cometchat-pro-vue-ui-kit/src/components/CometChatUI/CometChatNavBar/style.js
  38. 0
    383
      frontend/src/cometchat-pro-vue-ui-kit/src/components/CometChatUI/CometChatUI.vue
  39. 0
    3
      frontend/src/cometchat-pro-vue-ui-kit/src/components/CometChatUI/index.js
  40. 0
    83
      frontend/src/cometchat-pro-vue-ui-kit/src/components/CometChatUI/style.js
  41. 0
    383
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatAddGroupMemberList/CometChatAddGroupMemberList.vue
  42. 0
    50
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatAddGroupMemberList/controller.js
  43. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatAddGroupMemberList/resources/close.png
  44. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatAddGroupMemberList/resources/search-grey-icon.png
  45. 0
    144
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatAddGroupMemberList/style.js
  46. 0
    118
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatAddGroupMemberListItem/CometChatAddGroupMemberListItem.vue
  47. 0
    1
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatAddGroupMemberListItem/resources/checkbox-blue-active.svg
  48. 0
    16
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatAddGroupMemberListItem/resources/checkbox-inactive.svg
  49. 0
    58
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatAddGroupMemberListItem/style.js
  50. 0
    199
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatBanGroupMemberList/CometChatBanGroupMemberList.vue
  51. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatBanGroupMemberList/resources/close.png
  52. 0
    119
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatBanGroupMemberList/style.js
  53. 0
    147
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatBanGroupMemberListItem/CometChatBanGroupMemberListItem.vue
  54. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatBanGroupMemberListItem/resources/block.png
  55. 0
    55
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatBanGroupMemberListItem/style.js
  56. 0
    297
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatCreateGroup/CometChatCreateGroup.vue
  57. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatCreateGroup/resources/close.png
  58. 0
    111
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatCreateGroup/style.js
  59. 0
    643
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupDetails/CometChatGroupDetails.vue
  60. 0
    130
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupDetails/controller.js
  61. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupDetails/resources/navigate.png
  62. 0
    102
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupDetails/style.js
  63. 0
    689
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupList/CometChatGroupList.vue
  64. 0
    98
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupList/controller.js
  65. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupList/resources/creategroup.png
  66. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupList/resources/navigate.png
  67. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupList/resources/search-grey-icon.png
  68. 0
    112
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupList/style.js
  69. 0
    121
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupListItem/CometChatGroupListItem.vue
  70. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupListItem/resources/lock.png
  71. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupListItem/resources/shield.png
  72. 0
    76
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupListItem/style.js
  73. 0
    391
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupListWithMessages/CometChatGroupListWithMessages.vue
  74. 0
    64
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupListWithMessages/style.js
  75. 0
    260
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatViewGroupMemberList/CometChatViewGroupMemberList.vue
  76. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatViewGroupMemberList/resources/close.png
  77. 0
    92
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatViewGroupMemberList/style.js
  78. 0
    345
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatViewGroupMemberListItem/CometChatViewGroupMemberListItem.vue
  79. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatViewGroupMemberListItem/resources/block.png
  80. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatViewGroupMemberListItem/resources/close.png
  81. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatViewGroupMemberListItem/resources/delete.png
  82. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatViewGroupMemberListItem/resources/done.png
  83. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatViewGroupMemberListItem/resources/edit.png
  84. 0
    116
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatViewGroupMemberListItem/style.js
  85. 0
    11
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/index.js
  86. 0
    161
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatActionMessageBubble/CometChatActionMessageBubble.vue
  87. 0
    15
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatActionMessageBubble/style.js
  88. 0
    107
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatDeleteMessageBubble/CometChatDeleteMessageBubble.vue
  89. 0
    147
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatDeleteMessageBubble/style.js
  90. 0
    78
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatImageViewer/CometChatImageViewer.vue
  91. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatImageViewer/resources/1px.png
  92. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatImageViewer/resources/close.png
  93. 0
    21
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatImageViewer/style.js
  94. 0
    179
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatLiveReactions/CometChatLiveReactions.vue
  95. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatLiveReactions/resources/heart.png
  96. 0
    22
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatLiveReactions/style.js
  97. 0
    167
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatMessageActions/CometChatMessageActions.vue
  98. 0
    32
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatMessageActions/resources/add-reaction.svg
  99. BIN
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatMessageActions/resources/deletemessage.png
  100. 0
    0
      frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatMessageActions/resources/edit.png

+ 2359
- 23379
frontend/package-lock.json
파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
파일 보기


+ 1
- 8
frontend/package.json 파일 보기

@@ -6,17 +6,10 @@
6 6
         "build": "vite build",
7 7
         "serve": "vite preview",
8 8
         "lint": "eslint --ext .js,.vue --fix src",
9
-        "format": "prettier .  --write",
10
-        "go": "vue-cli-service serve"
9
+        "format": "prettier .  --write"
11 10
     },
12 11
     "dependencies": {
13
-        "@cometchat-pro/chat": "^3.0.2-beta1",
14
-        "@vue/cli": "^4.5.15",
15
-        "dateformat": "^4.5.1",
16
-        "events": "^3.3.0",
17 12
         "joi": "^17.4.0",
18
-        "process": "^0.11.10",
19
-        "twemoji": "^13.1.0",
20 13
         "vue": "^3.0.5",
21 14
         "vue-router": "^4.0.12"
22 15
     },

+ 0
- 104
frontend/src/cometchat-pro-vue-ui-kit/package-lock.json 파일 보기

@@ -1,104 +0,0 @@
1
-{
2
-  "name": "cometchat-pro-vue-ui-kit",
3
-  "version": "3.0.2-beta1-1",
4
-  "lockfileVersion": 1,
5
-  "requires": true,
6
-  "dependencies": {
7
-    "@cometchat-pro/chat": {
8
-      "version": "3.0.2-beta1",
9
-      "resolved": "https://registry.npmjs.org/@cometchat-pro/chat/-/chat-3.0.2-beta1.tgz",
10
-      "integrity": "sha512-K5eLrku0beEuMm/qDayUgnM9EtdvMi9lw81sxOZ3TVHCUwEAXgbIiAuQPiQhDhEIJV5GozPSj/lBJteH0jPCBA=="
11
-    },
12
-    "dateformat": {
13
-      "version": "4.5.1",
14
-      "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.5.1.tgz",
15
-      "integrity": "sha512-OD0TZ+B7yP7ZgpJf5K2DIbj3FZvFvxgFUuaqA/V5zTjAtAAXZ1E8bktHxmAGs4x5b7PflqA9LeQ84Og7wYtF7Q=="
16
-    },
17
-    "exec-sh": {
18
-      "version": "0.2.2",
19
-      "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.2.2.tgz",
20
-      "integrity": "sha512-FIUCJz1RbuS0FKTdaAafAByGS0CPvU3R0MeHxgtl+djzCc//F8HakL8GzmVNZanasTbTAY/3DRFA0KpVqj/eAw==",
21
-      "dev": true,
22
-      "requires": {
23
-        "merge": "^1.2.0"
24
-      }
25
-    },
26
-    "fs-extra": {
27
-      "version": "8.1.0",
28
-      "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz",
29
-      "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==",
30
-      "requires": {
31
-        "graceful-fs": "^4.2.0",
32
-        "jsonfile": "^4.0.0",
33
-        "universalify": "^0.1.0"
34
-      },
35
-      "dependencies": {
36
-        "jsonfile": {
37
-          "version": "4.0.0",
38
-          "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",
39
-          "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=",
40
-          "requires": {
41
-            "graceful-fs": "^4.1.6"
42
-          }
43
-        }
44
-      }
45
-    },
46
-    "graceful-fs": {
47
-      "version": "4.2.6",
48
-      "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz",
49
-      "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ=="
50
-    },
51
-    "jsonfile": {
52
-      "version": "5.0.0",
53
-      "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-5.0.0.tgz",
54
-      "integrity": "sha512-NQRZ5CRo74MhMMC3/3r5g2k4fjodJ/wh8MxjFbCViWKFjxrnudWSY5vomh+23ZaXzAS7J3fBZIR2dV6WbmfM0w==",
55
-      "requires": {
56
-        "graceful-fs": "^4.1.6",
57
-        "universalify": "^0.1.2"
58
-      }
59
-    },
60
-    "merge": {
61
-      "version": "1.2.1",
62
-      "resolved": "https://registry.npmjs.org/merge/-/merge-1.2.1.tgz",
63
-      "integrity": "sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ==",
64
-      "dev": true
65
-    },
66
-    "minimist": {
67
-      "version": "1.2.5",
68
-      "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
69
-      "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==",
70
-      "dev": true
71
-    },
72
-    "twemoji": {
73
-      "version": "13.1.0",
74
-      "resolved": "https://registry.npmjs.org/twemoji/-/twemoji-13.1.0.tgz",
75
-      "integrity": "sha512-e3fZRl2S9UQQdBFLYXtTBT6o4vidJMnpWUAhJA+yLGR+kaUTZAt3PixC0cGvvxWSuq2MSz/o0rJraOXrWw/4Ew==",
76
-      "requires": {
77
-        "fs-extra": "^8.0.1",
78
-        "jsonfile": "^5.0.0",
79
-        "twemoji-parser": "13.1.0",
80
-        "universalify": "^0.1.2"
81
-      }
82
-    },
83
-    "twemoji-parser": {
84
-      "version": "13.1.0",
85
-      "resolved": "https://registry.npmjs.org/twemoji-parser/-/twemoji-parser-13.1.0.tgz",
86
-      "integrity": "sha512-AQOzLJpYlpWMy8n+0ATyKKZzWlZBJN+G0C+5lhX7Ftc2PeEVdUU/7ns2Pn2vVje26AIZ/OHwFoUbdv6YYD/wGg=="
87
-    },
88
-    "universalify": {
89
-      "version": "0.1.2",
90
-      "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
91
-      "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg=="
92
-    },
93
-    "watch": {
94
-      "version": "1.0.2",
95
-      "resolved": "https://registry.npmjs.org/watch/-/watch-1.0.2.tgz",
96
-      "integrity": "sha1-NApxe952Vyb6CqB9ch4BR6VR3ww=",
97
-      "dev": true,
98
-      "requires": {
99
-        "exec-sh": "^0.2.0",
100
-        "minimist": "^1.2.0"
101
-      }
102
-    }
103
-  }
104
-}

+ 0
- 17
frontend/src/cometchat-pro-vue-ui-kit/package.json 파일 보기

@@ -1,17 +0,0 @@
1
-{
2
-  "name": "cometchat-pro-vue-ui-kit",
3
-  "version": "3.0.2-beta1-1",
4
-  "description": "CometChat UI Kit for Vue app.",
5
-  "scripts": {
6
-    "develop": "sh develop.sh",
7
-    "dev": "watch 'npm run develop' ."
8
-  },
9
-  "dependencies": {
10
-    "@cometchat-pro/chat": "3.0.2-beta1",
11
-    "dateformat": "^4.5.1",
12
-    "twemoji": "^13.1.0"
13
-  },
14
-  "devDependencies": {
15
-    "watch": "^1.0.2"
16
-  }
17
-}

+ 0
- 322
frontend/src/cometchat-pro-vue-ui-kit/src/components/Calls/CometChatIncomingCall/CometChatIncomingCall.vue 파일 보기

@@ -1,322 +0,0 @@
1
-<template>
2
-  <div
3
-    v-if="incomingCall"
4
-    class="callalert__wrapper"
5
-    :style="styles.incomingCallWrapper"
6
-  >
7
-    <div :style="styles.callContainer">
8
-      <div :style="styles.headerWrapper">
9
-        <div :style="styles.callDetail">
10
-          <div :style="styles.name">
11
-            {{ incomingCall.sender.name }}
12
-          </div>
13
-          <div :style="styles.callType">
14
-            <template v-if="incomingCall.type === 'video'">
15
-              <img :src="icons.video" :alt="STRINGS.INCOMING_VIDEO_CALL" />
16
-              <span :style="styles.callType.span">
17
-                {{ STRINGS.INCOMING_VIDEO_CALL }}
18
-              </span>
19
-            </template>
20
-            <template v-else>
21
-              <img :src="icons.audio" :alt="STRINGS.INCOMING_AUDIO_CALL" />
22
-              <span :style="styles.callType.span">
23
-                {{ STRINGS.INCOMING_AUDIO_CALL }}
24
-              </span>
25
-            </template>
26
-          </div>
27
-        </div>
28
-        <div :style="styles.thumbnail">
29
-          <comet-chat-avatar
30
-            corner-radius="50%"
31
-            :image="incomingCall.sender.avatar"
32
-          />
33
-        </div>
34
-      </div>
35
-      <div :style="styles.headerButton">
36
-        <button :style="styles.declineButton" @click="rejectCall">
37
-          {{ STRINGS.DECLINE }}
38
-        </button>
39
-        <button :style="styles.acceptButton" @click="acceptCall">
40
-          {{ STRINGS.ACCEPT }}
41
-        </button>
42
-      </div>
43
-    </div>
44
-  </div>
45
-</template>
46
-
47
-<!--eslint-disable-->
48
-<script>
49
-import { CometChat } from "@cometchat-pro/chat";
50
-
51
-import {
52
-  COMETCHAT_CONSTANTS,
53
-  DEFAULT_OBJECT_PROP,
54
-} from "../../../resources/constants";
55
-
56
-import { propertyCheck, cometChatCommon } from "../../../mixins/";
57
-
58
-import { CometChatManager } from "../../../util/controller";
59
-import { SvgAvatar } from "../../../util/svgavatar";
60
-import * as enums from "../../../util/enums.js";
61
-
62
-import { CometChatAvatar } from "../../Shared/";
63
-
64
-import { CallAlertManager } from "./controller";
65
-
66
-import * as style from "./style";
67
-
68
-import audioCallIcon from "./resources/incomingaudiocall.png";
69
-import videoCallIcon from "./resources/incomingvideocall.png";
70
-
71
-import { incomingCallAlert } from "../../../resources/audio/";
72
-
73
-let incomingAlert;
74
-let callAlertManager;
75
-
76
-/**
77
- * Displays the incoming call alert.
78
- *
79
- * @displayName CometChatIncomingCall
80
- */
81
-export default {
82
-  name: "CometChatIncomingCall",
83
-  mixins: [propertyCheck, cometChatCommon],
84
-  components: { CometChatAvatar },
85
-  props: {
86
-    /**
87
-     * Theme of the UI.
88
-     */
89
-    theme: { ...DEFAULT_OBJECT_PROP },
90
-    /**
91
-     * The call object that is in progress.
92
-     */
93
-    callInProgress: { ...DEFAULT_OBJECT_PROP },
94
-  },
95
-  data() {
96
-    return {
97
-      incomingCall: null,
98
-    };
99
-  },
100
-  computed: {
101
-    /**
102
-     * Computed styles for the component.
103
-     */
104
-    styles() {
105
-      return {
106
-        name: style.nameStyle(),
107
-        callType: style.callTypeStyle(),
108
-        thumbnail: style.thumbnailStyle(),
109
-        callDetail: style.callDetailStyle(),
110
-        headerButton: style.headerButtonStyle(),
111
-        callContainer: style.callContainerStyle(),
112
-        headerWrapper: style.headerWrapperStyle(),
113
-        acceptButton: style.buttonStyle(this.theme, true),
114
-        declineButton: style.buttonStyle(this.theme, false),
115
-        incomingCallWrapper: style.incomingCallWrapperStyle(this.theme),
116
-      };
117
-    },
118
-    /**
119
-     * Imported icon images.
120
-     */
121
-    icons() {
122
-      return {
123
-        audio: audioCallIcon,
124
-        video: videoCallIcon,
125
-      };
126
-    },
127
-    /**
128
-     * Local string constants.
129
-     */
130
-    STRINGS() {
131
-      return COMETCHAT_CONSTANTS;
132
-    },
133
-  },
134
-  methods: {
135
-    /**
136
-     * Plays the incoming alert tone
137
-     */
138
-    playIncomingAlert() {
139
-      try {
140
-        incomingAlert.currentTime = 0;
141
-        if (typeof incomingAlert.loop == "boolean") {
142
-          incomingAlert.loop = true;
143
-        } else {
144
-          incomingAlert.addEventListener(
145
-            "ended",
146
-            function () {
147
-              this.currentTime = 0;
148
-              this.play();
149
-            },
150
-            false
151
-          );
152
-        }
153
-        incomingAlert.play();
154
-      } catch (error) {
155
-        this.logError("Error playing incoming alert", error);
156
-      }
157
-    },
158
-    /**
159
-     * Pauses the incoming call alert
160
-     */
161
-    pauseIncomingAlert() {
162
-      try {
163
-        incomingAlert.pause();
164
-      } catch (error) {
165
-        this.logError("Error pausing incoming alert", error);
166
-      }
167
-    },
168
-    /**
169
-     * Marks a message as read
170
-     */
171
-    markMessageAsRead(message) {
172
-      try {
173
-        if (this.hasProperty(message, "readAt") === false) {
174
-          CometChat.markAsRead(message);
175
-        }
176
-      } catch (error) {
177
-        this.logError("Error marking message as read", error);
178
-      }
179
-    },
180
-    /**
181
-     * Function to recieve incoming call
182
-     */
183
-    async incomingCallReceived(incomingCall) {
184
-      const activeCall = CometChat.getActiveCall();
185
-
186
-      if (activeCall) {
187
-        try {
188
-          const rejectedCall = await CometChat.rejectCall(
189
-            incomingCall.sessionId,
190
-            CometChat.CALL_STATUS.BUSY
191
-          );
192
-
193
-          this.markMessageAsRead(incomingCall);
194
-          this.emitAction("rejectedIncomingCall", {
195
-            incomingCall,
196
-            rejectedCall,
197
-          });
198
-        } catch (error) {
199
-          this.emitAction("callError", { error });
200
-          this.logError("Call rejection failed with error:", error);
201
-        }
202
-      } else if (this.incomingCall === null) {
203
-        try {
204
-          this.playIncomingAlert();
205
-
206
-          if (incomingCall.sender.avatar === false) {
207
-            const uid = incomingCall.sender.uid;
208
-            const char = incomingCall.sender.name.charAt(0).toUpperCase();
209
-
210
-            incomingCall.sender.avatar = SvgAvatar.getAvatar(uid, char);
211
-          }
212
-
213
-          this.incomingCall = incomingCall;
214
-        } catch (error) {
215
-          this.logError("Call rejection failed with error:", error);
216
-        }
217
-      }
218
-    },
219
-    /**
220
-     * Function to cancel incoming call
221
-     */
222
-    incomingCallCancelled() {
223
-      try {
224
-        this.pauseIncomingAlert();
225
-        this.incomingCall = null;
226
-      } catch (error) {
227
-        this.logError("Call cancel failed with error:", error);
228
-      }
229
-    },
230
-    /**
231
-     * Function to reject incoming call
232
-     */
233
-    async rejectCall() {
234
-      this.pauseIncomingAlert();
235
-
236
-      try {
237
-        const rejectedCall = await CometChatManager.rejectCall(
238
-          this.incomingCall.sessionId,
239
-          CometChat.CALL_STATUS.REJECTED
240
-        );
241
-
242
-        this.emitAction("rejectedIncomingCall", {
243
-          incomingCall: this.incomingCall,
244
-          rejectedCall,
245
-        });
246
-      } catch (error) {
247
-        this.emitAction("callError", { error });
248
-      } finally {
249
-        this.incomingCall = null;
250
-      }
251
-    },
252
-    /**
253
-     * Function to accept call
254
-     */
255
-    acceptCall() {
256
-      try {
257
-        this.pauseIncomingAlert();
258
-        this.emitAction("acceptIncomingCall", {
259
-          incomingCall: this.incomingCall,
260
-        });
261
-
262
-        setTimeout(() => {
263
-          this.incomingCall = null;
264
-        }, 100);
265
-      } catch (error) {
266
-        this.logError("Call accept failed with error:", error);
267
-      }
268
-    },
269
-    /**
270
-     * This function handles the call listeners
271
-     */
272
-    callScreenUpdateHandler(key, call) {
273
-      switch (key) {
274
-        case enums.INCOMING_CALL_RECEIVED:
275
-          this.incomingCallReceived(call);
276
-          break;
277
-        case enums.INCOMING_CALL_CANCELLED:
278
-          this.incomingCallCancelled();
279
-          break;
280
-        default:
281
-          break;
282
-      }
283
-    },
284
-  },
285
-  beforeMount() {
286
-    incomingAlert = new Audio(incomingCallAlert);
287
-
288
-    callAlertManager = new CallAlertManager();
289
-    callAlertManager.attachListeners(this.callScreenUpdateHandler);
290
-  },
291
-  beforeDestroy() {
292
-    if (callAlertManager) {
293
-      callAlertManager.removeListeners();
294
-      callAlertManager = null;
295
-    }
296
-  },
297
-  beforeUnmount() {
298
-    if (callAlertManager) {
299
-      callAlertManager.removeListeners();
300
-      callAlertManager = null;
301
-    }
302
-  }
303
-};
304
-</script>
305
-
306
-<style scoped>
307
-.callalert__wrapper {
308
-  animation: slideDown 250ms ease;
309
-}
310
-.callalert__wrapper * {
311
-  box-sizing: border-box !important;
312
-  font-family: var(--call-alert-font-family) !important;
313
-}
314
-@keyframes slideDown {
315
-  0% {
316
-    transform: translateY(-50px);
317
-  }
318
-  100% {
319
-    transform: translateY(0px);
320
-  }
321
-}
322
-</style>

+ 0
- 25
frontend/src/cometchat-pro-vue-ui-kit/src/components/Calls/CometChatIncomingCall/controller.js 파일 보기

@@ -1,25 +0,0 @@
1
-import { CometChat } from "@cometchat-pro/chat";
2
-
3
-import * as enums from "../../../util/enums.js";
4
-
5
-export class CallAlertManager {
6
-  callListenerId = "incoming_call_" + new Date().getTime();
7
-
8
-  attachListeners(callback) {
9
-    CometChat.addCallListener(
10
-      this.callListenerId,
11
-      new CometChat.CallListener({
12
-        onIncomingCallReceived: (call) => {
13
-          callback(enums.INCOMING_CALL_RECEIVED, call);
14
-        },
15
-        onIncomingCallCancelled: (call) => {
16
-          callback(enums.INCOMING_CALL_CANCELLED, call);
17
-        },
18
-      })
19
-    );
20
-  }
21
-
22
-  removeListeners() {
23
-    CometChat.removeCallListener(this.callListenerId);
24
-  }
25
-}

BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/Calls/CometChatIncomingCall/resources/incomingaudiocall.png 파일 보기


BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/Calls/CometChatIncomingCall/resources/incomingvideocall.png 파일 보기


+ 0
- 122
frontend/src/cometchat-pro-vue-ui-kit/src/components/Calls/CometChatIncomingCall/style.js 파일 보기

@@ -1,122 +0,0 @@
1
-export const incomingCallWrapperStyle = (theme) => {
2
-  let positionValue = "absolute";
3
-  let leftPos = "0";
4
-  let rightPos = "0";
5
-  let topPos = "0";
6
-  let bottomPos = "unset";
7
-  let zIndexValue = "999";
8
-
9
-  return {
10
-    position: positionValue,
11
-    top: topPos,
12
-    left: leftPos,
13
-    bottom: bottomPos,
14
-    right: rightPos,
15
-    borderRadius: "10px",
16
-    margin: "15px",
17
-    backgroundColor: `${theme.backgroundColor.callScreenGrey}`,
18
-    zIndex: zIndexValue,
19
-    color: `${theme.color.white}`,
20
-    textAlign: "center",
21
-    boxSizing: "border-box",
22
-    fontFamily: `${theme.fontFamily}`,
23
-    width: "250px",
24
-    "--call-alert-font-family": `${theme.fontFamily}`,
25
-  };
26
-};
27
-
28
-export const callContainerStyle = () => {
29
-  return {
30
-    display: "flex",
31
-    flexDirection: "column",
32
-    width: "100%",
33
-    padding: "15px",
34
-  };
35
-};
36
-
37
-export const headerWrapperStyle = () => {
38
-  return {
39
-    width: "100%",
40
-    display: "flex",
41
-  };
42
-};
43
-
44
-export const callDetailStyle = () => {
45
-  return {
46
-    width: "calc(100% - 36px)",
47
-    display: "flex",
48
-    flexDirection: "column",
49
-    justifyContent: "center",
50
-    alignItems: "center",
51
-    textAlign: "left",
52
-  };
53
-};
54
-
55
-export const nameStyle = () => {
56
-  return {
57
-    fontSize: "15px",
58
-    fontWeight: "600",
59
-    display: "block",
60
-    width: "100%",
61
-    overflow: "hidden",
62
-    textOverflow: "ellipsis",
63
-    whiteSpace: "nowrap",
64
-    lineHeight: "20px",
65
-  };
66
-};
67
-
68
-export const callTypeStyle = () => {
69
-  return {
70
-    fontSize: "13px",
71
-    width: "100%",
72
-    overflow: "hidden",
73
-    textOverflow: "ellipsis",
74
-    whiteSpace: "nowrap",
75
-    textTransform: "capitalize",
76
-    lineHeight: "20px",
77
-    color: "#8A8A8A",
78
-    display: "flex",
79
-    justifyContent: "start",
80
-    alignItems: "center",
81
-    padding: "2px 0 0 0px",
82
-    span: {
83
-      padding: "0 5px",
84
-    },
85
-  };
86
-};
87
-
88
-export const thumbnailStyle = () => {
89
-  return {
90
-    width: "36px",
91
-    height: "36px",
92
-    display: "flex",
93
-    justifyContent: "center",
94
-  };
95
-};
96
-
97
-export const headerButtonStyle = () => {
98
-  return {
99
-    width: "100%",
100
-    display: "flex",
101
-    justifyContent: "space-between",
102
-    margin: "10px 0 0 0",
103
-  };
104
-};
105
-
106
-export const buttonStyle = (theme, action) => {
107
-  const backgroundColor = action
108
-    ? `${theme.backgroundColor.blue}`
109
-    : `${theme.backgroundColor.red}`;
110
-
111
-  return {
112
-    cursor: "pointer",
113
-    padding: "6px 20px",
114
-    backgroundColor: backgroundColor,
115
-    borderRadius: "5px",
116
-    color: `${theme.color.white}`,
117
-    fontSize: "14px",
118
-    outline: "0",
119
-    border: "0",
120
-    width: "45%",
121
-  };
122
-};

+ 0
- 459
frontend/src/cometchat-pro-vue-ui-kit/src/components/Calls/CometChatOutgoingCall/CometChatOutgoingCall.vue 파일 보기

@@ -1,459 +0,0 @@
1
-<template>
2
-  <div
3
-    v-if="callInProgress"
4
-    ref="callScreenFrame"
5
-    class="callscreen__wrapper"
6
-    :style="styles.callScreenWrapper"
7
-  >
8
-    <div :style="styles.callScreenContainer">
9
-      <div :style="styles.header">
10
-        <span :style="styles.headerDuration"> calling... </span>
11
-        <h6 :style="styles.headerName">
12
-          {{ callInProgress && callInProgress.receiver.name }}
13
-        </h6>
14
-      </div>
15
-      <div :style="styles.thumbnailWrapper">
16
-        <div :style="styles.thumbnail">
17
-          <template v-if="callInProgress">
18
-            <comet-chat-avatar
19
-              border-width="1px"
20
-              corner-radius="50%"
21
-              v-if="type === 'user'"
22
-              :border-color="theme.borderColor.primary"
23
-              :image="callInProgress.receiver.avatar"
24
-            />
25
-            <comet-chat-avatar
26
-              border-width="1px"
27
-              corner-radius="50%"
28
-              v-else-if="type === 'group'"
29
-              :border-color="theme.borderColor.primary"
30
-              :image="callInProgress.receiver.icon"
31
-            />
32
-          </template>
33
-        </div>
34
-      </div>
35
-      <div v-if="errorScreen" :style="styles.errorContainer">
36
-        <div>{{ errorMessage }}</div>
37
-      </div>
38
-
39
-      <div :style="styles.headerIcon">
40
-        <div :style="styles.iconWrapper" @click="cancelCall">
41
-          <div :style="styles.icon"></div>
42
-        </div>
43
-      </div>
44
-    </div>
45
-  </div>
46
-</template>
47
-
48
-<!--eslint-disable-->
49
-<script>
50
-import { CometChat } from "@cometchat-pro/chat";
51
-
52
-import {
53
-  DEFAULT_OBJECT_PROP,
54
-  DEFAULT_STRING_PROP,
55
-} from "../../../resources/constants";
56
-
57
-import { cometChatCommon, propertyCheck } from "../../../mixins/";
58
-
59
-import { CometChatManager } from "../../../util/controller";
60
-import { SvgAvatar } from "../../../util/svgavatar";
61
-import * as enums from "../../../util/enums.js";
62
-
63
-import { CallScreenManager } from "./controller";
64
-
65
-import { CometChatAvatar } from "../../Shared/";
66
-
67
-import * as style from "./style";
68
-
69
-import callIcon from "./resources/call-end-white-icon.svg";
70
-import { outgoingCallAlert } from "../../../resources/audio/";
71
-
72
-let outgoingAlert;
73
-let callScreenManager;
74
-
75
-/**
76
- * Displays the outgoing call window.
77
- *
78
- * @displayName CometChatOutgoingCall
79
- */
80
-export default {
81
-  name: "CometChatOutgoingCall",
82
-  mixins: [cometChatCommon, propertyCheck],
83
-  components: { CometChatAvatar },
84
-  props: {
85
-    /**
86
-     * The selected chat item object.
87
-     */
88
-    item: { ...DEFAULT_OBJECT_PROP },
89
-    /**
90
-     * Type of chat item.
91
-     */
92
-    type: { ...DEFAULT_STRING_PROP },
93
-    /**
94
-     * Theme of the UI.
95
-     */
96
-    theme: { ...DEFAULT_OBJECT_PROP },
97
-    /**
98
-     * Incoming call message object.
99
-     */
100
-    incomingCall: { ...DEFAULT_OBJECT_PROP },
101
-    /**
102
-     * Outgoing call message object.
103
-     */
104
-    outgoingCall: { ...DEFAULT_OBJECT_PROP },
105
-    /**
106
-     * Current logged in user.
107
-     */
108
-    loggedInUser: { ...DEFAULT_OBJECT_PROP },
109
-  },
110
-  data() {
111
-    return {
112
-      errorScreen: false,
113
-      errorMessage: null,
114
-      callInProgress: null,
115
-      outgoingCallScreen: false,
116
-    };
117
-  },
118
-  watch: {
119
-    /**
120
-     * Updates state on outgoing call chnage.
121
-     */
122
-    outgoingCall: {
123
-      handler(newValue, oldValue) {
124
-        if (oldValue !== newValue && newValue) {
125
-          this.playOutgoingAlert();
126
-
127
-          let call = newValue;
128
-
129
-          if (
130
-            call.receiverType === CometChat.RECEIVER_TYPE.GROUP &&
131
-            this.hasProperty(call.receiver, "icon") === false
132
-          ) {
133
-            const uid = call.receiver.guid;
134
-            const char = call.receiver.name.charAt(0).toUpperCase();
135
-
136
-            call.receiver.icon = SvgAvatar.getAvatar(uid, char);
137
-          } else if (
138
-            call.receiverType === CometChat.RECEIVER_TYPE.USER &&
139
-            this.hasProperty(call.receiver, "avatar") === false
140
-          ) {
141
-            const uid = call.receiver.uid;
142
-            const char = call.receiver.name.charAt(0).toUpperCase();
143
-
144
-            call.receiver.avatar = SvgAvatar.getAvatar(uid, char);
145
-          }
146
-
147
-          this.outgoingCallScreen = true;
148
-          this.callInProgress = call;
149
-          this.errorScreen = false;
150
-          this.errorMessage = null;
151
-        }
152
-      },
153
-      deep: true,
154
-    },
155
-    /**
156
-     * Accepts call when change in incoming call is detected.
157
-     */
158
-    incomingCall: {
159
-      handler(newValue, oldValue) {
160
-        if (oldValue !== newValue && newValue) {
161
-          this.acceptCall();
162
-        }
163
-      },
164
-      depp: true,
165
-    },
166
-  },
167
-  computed: {
168
-    /**
169
-     * Computed styles for the component.
170
-     */
171
-    styles() {
172
-      return {
173
-        header: style.headerStyle(),
174
-        thumbnail: style.thumbnailStyle(),
175
-        headerIcon: style.headerIconStyle(),
176
-        headerName: style.headerNameStyle(),
177
-        iconWrapper: style.iconWrapperStyle(),
178
-        icon: style.iconStyle(callIcon, false),
179
-        headerDuration: style.headerDurationStyle(),
180
-        errorContainer: style.errorContainerStyle(),
181
-        thumbnailWrapper: style.thumbnailWrapperStyle(),
182
-        callScreenContainer: style.callScreenContainerStyle(),
183
-        callScreenWrapper: style.callScreenWrapperStyle(this.theme),
184
-      };
185
-    },
186
-  },
187
-  methods: {
188
-    /**
189
-     * Function that handles the call listeners
190
-     */
191
-    callScreenUpdateHandler(key, call) {
192
-      switch (key) {
193
-        case enums.INCOMING_CALL_CANCELLED:
194
-          this.callInProgress = null;
195
-          this.outgoingCallScreen = false;
196
-          break;
197
-        case enums.OUTGOING_CALL_ACCEPTED:
198
-          if (this.outgoingCallScreen === true) {
199
-            this.pauseOutgoingAlert();
200
-
201
-            this.outgoingCallScreen = false;
202
-            this.callInProgress = call;
203
-            this.startCall(call);
204
-          }
205
-          break;
206
-        case enums.OUTGOING_CALL_REJECTED:
207
-          if (call.status && call.status === CometChat.CALL_STATUS.BUSY) {
208
-            this.errorScreen = true;
209
-            this.errorMessage = `${call.sender.name} is on another call.`;
210
-          } else {
211
-            this.pauseOutgoingAlert();
212
-
213
-            this.emitAction("outgoingCallRejected", { call });
214
-
215
-            this.callInProgress = null;
216
-            this.outgoingCallScreen = false;
217
-          }
218
-          break;
219
-        default:
220
-          break;
221
-      }
222
-    },
223
-    /**
224
-     * Function to accept call
225
-     */
226
-    async acceptCall() {
227
-      try {
228
-        const call = await CometChatManager.acceptCall(
229
-          this.incomingCall.sessionId
230
-        );
231
-
232
-        if (
233
-          this.hasProperty(call.receiver, "uid") &&
234
-          this.hasProperty(call.receiver, "avatar") === false
235
-        ) {
236
-          const uid = call.receiver.uid;
237
-          const char = call.receiver.name.charAt(0).toUpperCase();
238
-
239
-          call.receiver.avatar = SvgAvatar.getAvatar(uid, char);
240
-        } else if (
241
-          this.hasProperty(call.receiver, "guid") &&
242
-          this.hasProperty(call.receiver, "icon") === false
243
-        ) {
244
-          const guid = call.receiver.guid;
245
-          const char = call.receiver.name.charAt(0).toUpperCase();
246
-
247
-          call.receiver.icon = SvgAvatar.getAvatar(guid, char);
248
-        }
249
-
250
-        this.emitAction("acceptedIncomingCall", { call });
251
-
252
-        this.outgoingCallScreen = false;
253
-        this.callInProgress = call;
254
-        this.errorScreen = false;
255
-        this.errorMessage = null;
256
-
257
-        this.startCall(call);
258
-      } catch (error) {
259
-        this.logError("[CometChatOutgoingCall] acceptCall -- error", error);
260
-        this.emitAction("callError", { error });
261
-      }
262
-    },
263
-    /**
264
-     * Function to cancel call
265
-     */
266
-    async cancelCall() {
267
-      this.pauseOutgoingAlert();
268
-
269
-      try {
270
-        const call = await CometChatManager.rejectCall(
271
-          this.callInProgress.sessionId,
272
-          CometChat.CALL_STATUS.CANCELLED
273
-        );
274
-
275
-        this.emitAction("outgoingCallCancelled", { call });
276
-      } catch (error) {
277
-        this.emitAction("callError", { error });
278
-      } finally {
279
-        this.outgoingCallScreen = false;
280
-        this.callInProgress = null;
281
-      }
282
-    },
283
-    /**
284
-     * Function to start call
285
-     */
286
-    startCall(call) {
287
-      this.$nextTick(() => {
288
-        const el = this.$refs.callScreenFrame;
289
-
290
-        while (el.firstChild) {
291
-          el.firstChild.remove();
292
-        }
293
-
294
-        const sessionId = call.getSessionId();
295
-        const audioOnly = call.type === CometChat.CALL_TYPE.AUDIO;
296
-
297
-        const callSettings = new CometChat.CallSettingsBuilder()
298
-          .setSessionID(sessionId)
299
-          .enableDefaultLayout(true)
300
-          .setMode(CometChat.CALL_MODE.DEFAULT)
301
-          .setIsAudioOnlyCall(audioOnly)
302
-          .build();
303
-
304
-        CometChat.startCall(
305
-          callSettings,
306
-          el,
307
-          new CometChat.OngoingCallListener({
308
-            onUserJoined: (user) => {
309
-              /* Notification received here if another user joins the call. */
310
-              /* this method can be use to display message or perform any actions if someone joining the call */
311
-
312
-              //call initiator gets the same info in outgoingcallaccpeted event
313
-              if (
314
-                call.callInitiator.uid !== this.loggedInUser.uid &&
315
-                call.callInitiator.uid !== user.uid
316
-              ) {
317
-                this.markMessageAsRead(call);
318
-
319
-                const callMessage = {
320
-                  category: call.category,
321
-                  type: call.type,
322
-                  action: call.action,
323
-                  status: call.status,
324
-                  callInitiator: call.callInitiator,
325
-                  callReceiver: call.callReceiver,
326
-                  receiverId: call.receiverId,
327
-                  receiverType: call.receiverType,
328
-                  sentAt: call.sentAt,
329
-                  sender: { ...user },
330
-                };
331
-
332
-                this.emitAction("userJoinedCall", { call: callMessage });
333
-              }
334
-            },
335
-            onUserLeft: (user) => {
336
-              /* Notification received here if another user left the call. */
337
-              /* this method can be use to display message or perform any actions if someone leaving the call */
338
-
339
-              //call initiator gets the same info in outgoingcallaccpeted event
340
-              if (
341
-                call.callInitiator.uid !== this.loggedInUser.uid &&
342
-                call.callInitiator.uid !== user.uid
343
-              ) {
344
-                this.markMessageAsRead(call);
345
-
346
-                const callMessage = {
347
-                  category: call.category,
348
-                  type: call.type,
349
-                  action: "left",
350
-                  status: call.status,
351
-                  callInitiator: call.callInitiator,
352
-                  callReceiver: call.callReceiver,
353
-                  receiverId: call.receiverId,
354
-                  receiverType: call.receiverType,
355
-                  sentAt: call.sentAt,
356
-                  sender: { ...user },
357
-                };
358
-
359
-                this.emitAction("userLeftCall", { call: callMessage });
360
-              }
361
-            },
362
-            onCallEnded: (endedCall) => {
363
-              /* Notification received here if current ongoing call is ended. */
364
-
365
-              this.showOutgoingScreen = false;
366
-              this.callInProgress = null;
367
-
368
-              this.markMessageAsRead(endedCall);
369
-
370
-              this.emitAction("callEnded", { call: endedCall });
371
-              /* hiding/closing the call screen can be done here. */
372
-            },
373
-          })
374
-        );
375
-      });
376
-    },
377
-    /**
378
-     * Marks a message as read
379
-     */
380
-    markMessageAsRead(message) {
381
-      try {
382
-        if (this.hasProperty(message, "readAt") === false) {
383
-          CometChat.markAsRead(message);
384
-        }
385
-      } catch (error) {
386
-        this.logError("Error marking message as read", error);
387
-      }
388
-    },
389
-    /**
390
-     * Plays the outgoing call alert
391
-     */
392
-    playOutgoingAlert() {
393
-      try {
394
-        outgoingAlert.currentTime = 0;
395
-        if (typeof outgoingAlert.loop == "boolean") {
396
-          outgoingAlert.loop = true;
397
-        } else {
398
-          outgoingAlert.addEventListener(
399
-            "ended",
400
-            function () {
401
-              this.currentTime = 0;
402
-              this.play();
403
-            },
404
-            false
405
-          );
406
-        }
407
-        outgoingAlert.play();
408
-      } catch (error) {
409
-        this.logError("Alert play failed with error:", error);
410
-      }
411
-    },
412
-    /**
413
-     * Pauses the outgoing call alert
414
-     */
415
-    pauseOutgoingAlert() {
416
-      try {
417
-        outgoingAlert.pause();
418
-      } catch (error) {
419
-        this.logError("Alert pause failed with error:", error);
420
-      }
421
-    },
422
-  },
423
-  beforeMount() {
424
-    outgoingAlert = new Audio(outgoingCallAlert);
425
-
426
-    callScreenManager = new CallScreenManager();
427
-    callScreenManager.attachListeners(this.callScreenUpdateHandler);
428
-  },
429
-  beforeDestroy() {
430
-    if (callScreenManager) {
431
-      callScreenManager.removeListeners();
432
-      callScreenManager = null;
433
-    }
434
-  },
435
-  beforeUnmount() {
436
-    if (callScreenManager) {
437
-      callScreenManager.removeListeners();
438
-      callScreenManager = null;
439
-    }
440
-  },
441
-};
442
-</script>
443
-<style scoped>
444
-.callscreen__wrapper {
445
-  animation: fade-animation 250ms ease;
446
-}
447
-.callscreen__wrapper * {
448
-  box-sizing: border-box;
449
-  font-family: var(--call-screen-font-family);
450
-}
451
-@keyframes fade-animation {
452
-  from {
453
-    opacity: 0;
454
-  }
455
-  to {
456
-    opacity: 1;
457
-  }
458
-}
459
-</style>

+ 0
- 28
frontend/src/cometchat-pro-vue-ui-kit/src/components/Calls/CometChatOutgoingCall/controller.js 파일 보기

@@ -1,28 +0,0 @@
1
-import { CometChat } from "@cometchat-pro/chat";
2
-
3
-import * as enums from "../../../util/enums.js";
4
-
5
-export class CallScreenManager {
6
-  callListenerId = "callscreen_" + new Date().getTime();
7
-
8
-  attachListeners(callback) {
9
-    CometChat.addCallListener(
10
-      this.callListenerId,
11
-      new CometChat.CallListener({
12
-        onOutgoingCallAccepted: (call) => {
13
-          callback(enums.OUTGOING_CALL_ACCEPTED, call);
14
-        },
15
-        onOutgoingCallRejected: (call) => {
16
-          callback(enums.OUTGOING_CALL_REJECTED, call);
17
-        },
18
-        onIncomingCallCancelled: (call) => {
19
-          callback(enums.INCOMING_CALL_CANCELLED, call);
20
-        },
21
-      })
22
-    );
23
-  }
24
-
25
-  removeListeners() {
26
-    CometChat.removeCallListener(this.callListenerId);
27
-  }
28
-}

+ 0
- 1
frontend/src/cometchat-pro-vue-ui-kit/src/components/Calls/CometChatOutgoingCall/resources/call-end-white-icon.svg 파일 보기

@@ -1 +0,0 @@
1
-<svg xmlns="http://www.w3.org/2000/svg" width="24" height="9" viewBox="0 0 24 9"><g><g><path fill="#fff" d="M4.514 8.475l2-1.59c.48-.38.76-.96.76-1.57v-2.6c3.02-.98 6.29-.99 9.32 0v2.61c0 .61.28 1.19.76 1.57l1.99 1.58c.8.63 1.94.57 2.66-.15l1.22-1.22c.8-.8.8-2.13-.05-2.88-6.41-5.66-16.07-5.66-22.48 0-.85.75-.85 2.08-.05 2.88l1.22 1.22c.71.72 1.85.78 2.65.15z"/></g></g></svg>

+ 0
- 113
frontend/src/cometchat-pro-vue-ui-kit/src/components/Calls/CometChatOutgoingCall/style.js 파일 보기

@@ -1,113 +0,0 @@
1
-export const callScreenWrapperStyle = (theme) => {
2
-  return {
3
-    width: "inherit",
4
-    height: "inherit",
5
-    position: "absolute",
6
-    top: "0",
7
-    right: "0",
8
-    bottom: "0",
9
-    left: "0",
10
-    backgroundColor: `${theme.backgroundColor.darkGrey}`,
11
-    zIndex: "999",
12
-    color: `${theme.color.white}`,
13
-    textAlign: "center",
14
-    boxSizing: "border-box",
15
-    fontFamily: `${theme.fontFamily}`,
16
-    "--call-screen-font-family": `${theme.fontFamily}`,
17
-  };
18
-};
19
-
20
-export const callScreenContainerStyle = () => {
21
-  return {
22
-    display: "flex",
23
-    flexDirection: "column",
24
-    height: "100%",
25
-    width: "100%",
26
-  };
27
-};
28
-
29
-export const headerStyle = () => {
30
-  return {
31
-    padding: "20px 10px",
32
-    width: "100%",
33
-    height: "20%",
34
-  };
35
-};
36
-
37
-export const headerDurationStyle = () => {
38
-  return {
39
-    fontSize: "13px",
40
-    display: "inline-block",
41
-    padding: "5px",
42
-  };
43
-};
44
-
45
-export const headerNameStyle = () => {
46
-  return {
47
-    margin: "0",
48
-    fontWeight: "700",
49
-    textTransform: "capitalize",
50
-    fontSize: "16px",
51
-  };
52
-};
53
-
54
-export const thumbnailWrapperStyle = () => {
55
-  return {
56
-    width: "100%",
57
-    height: "50%",
58
-    display: "flex",
59
-    justifyContent: "center",
60
-    alignItems: "center",
61
-  };
62
-};
63
-
64
-export const thumbnailStyle = () => {
65
-  return {
66
-    width: "200px",
67
-    flexShrink: "0",
68
-  };
69
-};
70
-
71
-export const headerIconStyle = () => {
72
-  return {
73
-    width: "100%",
74
-    height: "15%",
75
-    padding: "10px",
76
-    display: "flex",
77
-    justifyContent: "center",
78
-  };
79
-};
80
-
81
-export const iconWrapperStyle = () => {
82
-  return {
83
-    display: "flex",
84
-  };
85
-};
86
-
87
-export const iconStyle = (img, callAction) => {
88
-  const bgColor = callAction ? "#008000" : "#ff3b30";
89
-
90
-  return {
91
-    width: "50px",
92
-    height: "50px",
93
-    borderRadius: "27px",
94
-    backgroundColor: "rgba(255, 255, 255, 0.2)",
95
-    display: "block",
96
-    margin: "auto 10px",
97
-    cursor: "pointer",
98
-    background: `url(${img}) center center no-repeat ${bgColor}`,
99
-  };
100
-};
101
-
102
-export const errorContainerStyle = () => {
103
-  return {
104
-    color: "#fff",
105
-    textAlign: "center",
106
-    borderRadius: "2px",
107
-    padding: "13px 10px",
108
-    fontSize: "13px",
109
-    width: "100%",
110
-    height: "10%",
111
-    backgroundColor: "#333",
112
-  };
113
-};

+ 0
- 2
frontend/src/cometchat-pro-vue-ui-kit/src/components/Calls/index.js 파일 보기

@@ -1,2 +0,0 @@
1
-export { default as CometChatIncomingCall } from "./CometChatIncomingCall/CometChatIncomingCall";
2
-export { default as CometChatOutgoingCall } from "./CometChatOutgoingCall/CometChatOutgoingCall";

+ 0
- 1176
frontend/src/cometchat-pro-vue-ui-kit/src/components/Chats/CometChatConversationList/CometChatConversationList.vue
파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
파일 보기


+ 0
- 146
frontend/src/cometchat-pro-vue-ui-kit/src/components/Chats/CometChatConversationList/controller.js 파일 보기

@@ -1,146 +0,0 @@
1
-import { CometChat } from "@cometchat-pro/chat";
2
-
3
-import * as enums from "../../../util/enums.js";
4
-
5
-/**
6
- * ConversationListManager class encapsulates the following functionality:
7
- * - fetching of conversation list
8
- * - attaching Call listeners
9
- * - attaching User listeners
10
- * - attaching Group listeners
11
- * - attaching Message listeners
12
- */
13
-export class ConversationListManager {
14
-  conversationRequest = null;
15
-
16
-  conversationListenerId = "chatlist_" + new Date().getTime();
17
-  userListenerId = "chatlist_user_" + new Date().getTime();
18
-  groupListenerId = "chatlist_group_" + new Date().getTime();
19
-  callListenerId = "chatlist_call_" + new Date().getTime();
20
-
21
-  constructor() {
22
-    this.conversationRequest = new CometChat.ConversationsRequestBuilder()
23
-      .setLimit(30)
24
-      .build();
25
-  }
26
-
27
-  fetchNextConversation() {
28
-    return this.conversationRequest.fetchNext();
29
-  }
30
-
31
-  attachListeners(callback) {
32
-    CometChat.addUserListener(
33
-      this.userListenerId,
34
-      new CometChat.UserListener({
35
-        onUserOnline: (onlineUser) => {
36
-          /* when someuser/friend comes online, user will be received here */
37
-          callback(enums.USER_ONLINE, onlineUser);
38
-        },
39
-        onUserOffline: (offlineUser) => {
40
-          /* when someuser/friend went offline, user will be received here */
41
-          callback(enums.USER_OFFLINE, offlineUser);
42
-        },
43
-      })
44
-    );
45
-
46
-    CometChat.addGroupListener(
47
-      this.groupListenerId,
48
-      new CometChat.GroupListener({
49
-        onGroupMemberScopeChanged: (
50
-          message,
51
-          changedUser,
52
-          newScope,
53
-          oldScope,
54
-          changedGroup
55
-        ) => {
56
-          callback(enums.GROUP_MEMBER_SCOPE_CHANGED, changedGroup, message, {
57
-            user: changedUser,
58
-            scope: newScope,
59
-          });
60
-        },
61
-        onGroupMemberKicked: (message, kickedUser, kickedBy, kickedFrom) => {
62
-          callback(enums.GROUP_MEMBER_KICKED, kickedFrom, message, {
63
-            user: kickedUser,
64
-            hasJoined: false,
65
-          });
66
-        },
67
-        onGroupMemberBanned: (message, bannedUser, bannedBy, bannedFrom) => {
68
-          callback(enums.GROUP_MEMBER_BANNED, bannedFrom, message, {
69
-            user: bannedUser,
70
-          });
71
-        },
72
-        onGroupMemberUnbanned: (
73
-          message,
74
-          unbannedUser,
75
-          unbannedBy,
76
-          unbannedFrom
77
-        ) => {
78
-          callback(enums.GROUP_MEMBER_UNBANNED, unbannedFrom, message, {
79
-            user: unbannedUser,
80
-          });
81
-        },
82
-        onMemberAddedToGroup: (
83
-          message,
84
-          userAdded,
85
-          userAddedBy,
86
-          userAddedIn
87
-        ) => {
88
-          callback(enums.GROUP_MEMBER_ADDED, userAddedIn, message, {
89
-            user: userAdded,
90
-            hasJoined: true,
91
-          });
92
-        },
93
-        onGroupMemberLeft: (message, leavingUser, group) => {
94
-          callback(enums.GROUP_MEMBER_LEFT, group, message, {
95
-            user: leavingUser,
96
-          });
97
-        },
98
-        onGroupMemberJoined: (message, joinedUser, joinedGroup) => {
99
-          callback(enums.GROUP_MEMBER_JOINED, joinedGroup, message, {
100
-            user: joinedUser,
101
-          });
102
-        },
103
-      })
104
-    );
105
-
106
-    CometChat.addMessageListener(
107
-      this.conversationListenerId,
108
-      new CometChat.MessageListener({
109
-        onTextMessageReceived: (textMessage) => {
110
-          callback(enums.TEXT_MESSAGE_RECEIVED, null, textMessage);
111
-        },
112
-        onMediaMessageReceived: (mediaMessage) => {
113
-          callback(enums.MEDIA_MESSAGE_RECEIVED, null, mediaMessage);
114
-        },
115
-        onCustomMessageReceived: (customMessage) => {
116
-          callback(enums.CUSTOM_MESSAGE_RECEIVED, null, customMessage);
117
-        },
118
-        onMessageDeleted: (deletedMessage) => {
119
-          callback(enums.MESSAGE_DELETED, null, deletedMessage);
120
-        },
121
-        onMessageEdited: (editedMessage) => {
122
-          callback(enums.MESSAGE_EDITED, null, editedMessage);
123
-        },
124
-      })
125
-    );
126
-
127
-    CometChat.addCallListener(
128
-      this.callListenerId,
129
-      new CometChat.CallListener({
130
-        onIncomingCallReceived: (call) => {
131
-          callback(enums.INCOMING_CALL_RECEIVED, null, call);
132
-        },
133
-        onIncomingCallCancelled: (call) => {
134
-          callback(enums.INCOMING_CALL_CANCELLED, null, call);
135
-        },
136
-      })
137
-    );
138
-  }
139
-
140
-  removeListeners() {
141
-    CometChat.removeMessageListener(this.conversationListenerId);
142
-    CometChat.removeUserListener(this.userListenerId);
143
-    CometChat.removeGroupListener(this.groupListenerId);
144
-    CometChat.removeCallListener(this.callListenerId);
145
-  }
146
-}

BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/Chats/CometChatConversationList/resources/navigate.png 파일 보기


+ 0
- 78
frontend/src/cometchat-pro-vue-ui-kit/src/components/Chats/CometChatConversationList/style.js 파일 보기

@@ -1,78 +0,0 @@
1
-export const chatsWrapperStyle = () => {
2
-  return {
3
-    display: "flex",
4
-    flexDirection: "column",
5
-    height: "100%",
6
-    boxSizing: "border-box",
7
-  };
8
-};
9
-
10
-export const chatsHeaderStyle = (theme) => {
11
-  return {
12
-    padding: "19px 16px",
13
-    display: "flex",
14
-    alignItems: "center",
15
-    borderBottom: `1px solid ${theme.color.darkSecondary}`,
16
-  };
17
-};
18
-
19
-export const chatsHeaderCloseStyle = (img) => {
20
-  return {
21
-    cursor: "pointer",
22
-    display: "none",
23
-    background: `url(${img}) left center / 18px no-repeat`,
24
-    height: "24px",
25
-    width: "33%",
26
-  };
27
-};
28
-
29
-export const chatsHeaderTitleStyle = (enableCloseMenu) => {
30
-  const alignment = enableCloseMenu
31
-    ? {
32
-        width: "33%",
33
-        textAlign: "center",
34
-      }
35
-    : {};
36
-
37
-  return {
38
-    margin: "0",
39
-    display: "inline-block",
40
-    width: "66%",
41
-    fontWeight: "700",
42
-    textAlign: "left",
43
-    fontSize: "20px",
44
-    ...alignment,
45
-  };
46
-};
47
-
48
-export const chatsMsgStyle = () => {
49
-  return {
50
-    overflow: "hidden",
51
-    width: "100%",
52
-    display: "flex",
53
-    justifyContent: "center",
54
-    alignItems: "center",
55
-    position: "absolute",
56
-    top: "50%",
57
-  };
58
-};
59
-
60
-export const chatsMsgTxtStyle = (theme) => {
61
-  return {
62
-    margin: "0",
63
-    height: "30px",
64
-    color: `${theme.color.secondary}`,
65
-    fontSize: "24px!important",
66
-    fontWeight: "600",
67
-  };
68
-};
69
-
70
-export const chatsListStyle = () => {
71
-  return {
72
-    height: "calc(100% - 75px)",
73
-    width: "100%",
74
-    overflowY: "auto",
75
-    margin: "0",
76
-    padding: "0",
77
-  };
78
-};

+ 0
- 67
frontend/src/cometchat-pro-vue-ui-kit/src/components/Chats/CometChatConversationListActions/index.vue 파일 보기

@@ -1,67 +0,0 @@
1
-<template>
2
-  <ul :style="styles.conversationActionStyle" class="list__item__actions">
3
-    <li>
4
-      <button 
5
-        type="button"
6
-        :style="styles.groupButtonStyle" 
7
-        class="group__button button__delete"
8
-        @click="deleteConversation($event)"
9
-      ></button>
10
-    </li>
11
-  </ul>
12
-</template>
13
-
14
-<script>
15
-
16
-import { DEFAULT_OBJECT_PROP } from "../../../resources/constants";
17
-import { propertyCheck } from "../../../mixins/";
18
-import * as style from "./style";
19
-import { CometChatEvent } from '../../../util/CometChatEvent';
20
-import { EVENTS } from '../../../util/enums';
21
-import loadingIcon from "./resources/progress.svg";
22
-import deleteIcon from "./resources/delete.svg";
23
-
24
-/**
25
- * 
26
- *
27
- * @displayName cometchatConversationListActions
28
- */
29
-export default {
30
-  name: "cometchatConversationListActions",
31
-  mixins: [propertyCheck],
32
-  props: {
33
-    /**
34
-     * Theme of the UI.
35
-     */
36
-    theme: { ...DEFAULT_OBJECT_PROP },
37
-    /**
38
-     * Conversation.
39
-     */
40
-    conversation: { ...DEFAULT_OBJECT_PROP },
41
-  },
42
-  data() {
43
-    return {
44
-      deleteInProgress: false
45
-    }
46
-  },
47
-  computed: {
48
-    /**
49
-     * Computed styles for the component.
50
-     */ styles() {
51
-      return {
52
-        conversationActionStyle: style.conversationActionStyle(this.theme),
53
-        groupButtonStyle: style.groupButtonStyle(this.deleteInProgress, loadingIcon, deleteIcon),
54
-      };
55
-    },
56
-  },
57
-  methods: {
58
-    /**
59
-     * Jump to new messages
60
-     */
61
-    deleteConversation(event) {
62
-      event.stopPropagation();
63
-      CometChatEvent.triggerHandler(EVENTS["DELETE_CONVERSATION"], this.conversation)
64
-    },
65
-  },
66
-};
67
-</script>

+ 0
- 7
frontend/src/cometchat-pro-vue-ui-kit/src/components/Chats/CometChatConversationListActions/resources/delete.svg 파일 보기

@@ -1,7 +0,0 @@
1
-<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
2
-<path d="M17.25 21H6.75C6.35218 21 5.97064 20.842 5.68934 20.5607C5.40804 20.2794 5.25 19.8978 5.25 19.5V6H18.75V19.5C18.75 19.8978 18.592 20.2794 18.3107 20.5607C18.0294 20.842 17.6478 21 17.25 21Z" stroke="#FF0000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3
-<path d="M9.75 16.5V10.5" stroke="#FF0000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
4
-<path d="M14.25 16.5V10.5" stroke="#FF0000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
5
-<path d="M2.25 6H21.75" stroke="#FF0000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
6
-<path d="M14.25 3H9.75C9.35218 3 8.97064 3.15804 8.68934 3.43934C8.40804 3.72064 8.25 4.10218 8.25 4.5V6H15.75V4.5C15.75 4.10218 15.592 3.72064 15.3107 3.43934C15.0294 3.15804 14.6478 3 14.25 3Z" stroke="#FF0000" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
7
-</svg>

+ 0
- 1
frontend/src/cometchat-pro-vue-ui-kit/src/components/Chats/CometChatConversationListActions/resources/progress.svg 파일 보기

@@ -1 +0,0 @@
1
-<?xml version="1.0" encoding="utf-8"?><svg width='24px' height='24px' xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" class="uil-ring"><rect x="0" y="0" width="100" height="100" fill="none" class="bk"></rect><defs><filter id="uil-ring-shadow" x="-100%" y="-100%" width="300%" height="300%"><feOffset result="offOut" in="SourceGraphic" dx="0" dy="0"></feOffset><feGaussianBlur result="blurOut" in="offOut" stdDeviation="0"></feGaussianBlur><feBlend in="SourceGraphic" in2="blurOut" mode="normal"></feBlend></filter></defs><path d="M10,50c0,0,0,0.5,0.1,1.4c0,0.5,0.1,1,0.2,1.7c0,0.3,0.1,0.7,0.1,1.1c0.1,0.4,0.1,0.8,0.2,1.2c0.2,0.8,0.3,1.8,0.5,2.8 c0.3,1,0.6,2.1,0.9,3.2c0.3,1.1,0.9,2.3,1.4,3.5c0.5,1.2,1.2,2.4,1.8,3.7c0.3,0.6,0.8,1.2,1.2,1.9c0.4,0.6,0.8,1.3,1.3,1.9 c1,1.2,1.9,2.6,3.1,3.7c2.2,2.5,5,4.7,7.9,6.7c3,2,6.5,3.4,10.1,4.6c3.6,1.1,7.5,1.5,11.2,1.6c4-0.1,7.7-0.6,11.3-1.6 c3.6-1.2,7-2.6,10-4.6c3-2,5.8-4.2,7.9-6.7c1.2-1.2,2.1-2.5,3.1-3.7c0.5-0.6,0.9-1.3,1.3-1.9c0.4-0.6,0.8-1.3,1.2-1.9 c0.6-1.3,1.3-2.5,1.8-3.7c0.5-1.2,1-2.4,1.4-3.5c0.3-1.1,0.6-2.2,0.9-3.2c0.2-1,0.4-1.9,0.5-2.8c0.1-0.4,0.1-0.8,0.2-1.2 c0-0.4,0.1-0.7,0.1-1.1c0.1-0.7,0.1-1.2,0.2-1.7C90,50.5,90,50,90,50s0,0.5,0,1.4c0,0.5,0,1,0,1.7c0,0.3,0,0.7,0,1.1 c0,0.4-0.1,0.8-0.1,1.2c-0.1,0.9-0.2,1.8-0.4,2.8c-0.2,1-0.5,2.1-0.7,3.3c-0.3,1.2-0.8,2.4-1.2,3.7c-0.2,0.7-0.5,1.3-0.8,1.9 c-0.3,0.7-0.6,1.3-0.9,2c-0.3,0.7-0.7,1.3-1.1,2c-0.4,0.7-0.7,1.4-1.2,2c-1,1.3-1.9,2.7-3.1,4c-2.2,2.7-5,5-8.1,7.1 c-0.8,0.5-1.6,1-2.4,1.5c-0.8,0.5-1.7,0.9-2.6,1.3L66,87.7l-1.4,0.5c-0.9,0.3-1.8,0.7-2.8,1c-3.8,1.1-7.9,1.7-11.8,1.8L47,90.8 c-1,0-2-0.2-3-0.3l-1.5-0.2l-0.7-0.1L41.1,90c-1-0.3-1.9-0.5-2.9-0.7c-0.9-0.3-1.9-0.7-2.8-1L34,87.7l-1.3-0.6 c-0.9-0.4-1.8-0.8-2.6-1.3c-0.8-0.5-1.6-1-2.4-1.5c-3.1-2.1-5.9-4.5-8.1-7.1c-1.2-1.2-2.1-2.7-3.1-4c-0.5-0.6-0.8-1.4-1.2-2 c-0.4-0.7-0.8-1.3-1.1-2c-0.3-0.7-0.6-1.3-0.9-2c-0.3-0.7-0.6-1.3-0.8-1.9c-0.4-1.3-0.9-2.5-1.2-3.7c-0.3-1.2-0.5-2.3-0.7-3.3 c-0.2-1-0.3-2-0.4-2.8c-0.1-0.4-0.1-0.8-0.1-1.2c0-0.4,0-0.7,0-1.1c0-0.7,0-1.2,0-1.7C10,50.5,10,50,10,50z" fill="#ffffff" filter="url(#uil-ring-shadow)"><animateTransform attributeName="transform" type="rotate" from="0 50 50" to="360 50 50" repeatCount="indefinite" dur="1s"></animateTransform></path></svg>

+ 0
- 35
frontend/src/cometchat-pro-vue-ui-kit/src/components/Chats/CometChatConversationListActions/style.js 파일 보기

@@ -1,35 +0,0 @@
1
-export const conversationActionStyle = theme => {
2
-	return {
3
-		display: "flex",
4
-		listStyleType: "none",
5
-		padding: "8px",
6
-		margin: "0",
7
-		width: "72px",
8
-		backgroundColor: `${theme.backgroundColor.primary}`,
9
-		borderRadius: "4px",
10
-		alignItems: "center",
11
-		justifyContent: "flex-end",
12
-		position: "absolute",
13
-		right: "16px",
14
-		top: "0px",
15
-		height: "100%",
16
-	};
17
-};
18
-
19
-export const groupButtonStyle = (actionInProgress, progressIcon, actionIcon) => {
20
-
21
-	const backgroundImage = actionInProgress ? progressIcon : actionIcon;
22
-
23
-	return {
24
-		outline: "0",
25
-		border: "0",
26
-		height: "24px",
27
-		width: "24px",
28
-		borderRadius: "4px",
29
-		alignItems: "center",
30
-		display: "inline-flex",
31
-		justifyContent: "center",
32
-		position: "relative",
33
-		background: `url(${backgroundImage}) center center no-repeat`,
34
-	};
35
-};

+ 0
- 313
frontend/src/cometchat-pro-vue-ui-kit/src/components/Chats/CometChatConversationListItem/CometChatConversationListItem.vue 파일 보기

@@ -1,313 +0,0 @@
1
-<template>
2
-  <div 
3
-    class="chat__item--hover" 
4
-    :style="styles.list" 
5
-    @click="itemClickHandler"
6
-    @mouseenter="handleMouseHover(true)"
7
-    @mouseleave="handleMouseHover(false)"
8
-  >
9
-    <div :style="styles.thumbnail">
10
-      <comet-chat-avatar
11
-        border-width="1px"
12
-        corner-radius="18px"
13
-        :image="getAvatar()"
14
-        :border-color="theme.borderColor.primary"
15
-      />
16
-      <comet-chat-user-presence
17
-        border-width="1px"
18
-        corner-radius="50%"
19
-        :border-color="theme.borderColor.primary"
20
-        :status="conversation.conversationWith.status"
21
-        v-if="conversation.conversationType === 'user'"
22
-      />
23
-    </div>
24
-    <div :style="styles.detail">
25
-      <div :style="styles.row">
26
-        <div
27
-          :style="styles.name"
28
-          @mouseenter="toggleTooltip($event, true)"
29
-          @mouseleave="toggleTooltip($event, false)"
30
-        >
31
-          {{ conversation.conversationWith.name }}
32
-        </div>
33
-        <span
34
-          :style="styles.lastMsgTime"
35
-          class="item__details__timestamp"
36
-          v-if="conversation.lastMessage"
37
-          >{{ getLastMessageTime() }}</span
38
-        >
39
-      </div>
40
-      <div :style="styles.row">
41
-        <div
42
-          :style="styles.lastMsg"
43
-          @mouseenter="toggleTooltip($event, true)"
44
-          @mouseleave="toggleTooltip($event, false)"
45
-        >
46
-          {{ getLastMessage() }}
47
-        </div>
48
-        <comet-chat-badge-count
49
-          :theme="theme"
50
-          :count="conversation.unreadMessageCount"
51
-        />
52
-      </div>
53
-      <div v-if="isHovering">
54
-        <cometchat-conversation-list-actions
55
-          :theme="theme"
56
-          :conversation="conversation"
57
-        />
58
-      </div>
59
-    </div>
60
-  </div>
61
-</template>
62
-<script>
63
-import dateFormat from "dateformat";
64
-import { CometChat } from "@cometchat-pro/chat";
65
-
66
-import {
67
-  COMETCHAT_CONSTANTS,
68
-  DEFAULT_OBJECT_PROP,
69
-} from "../../../resources/constants";
70
-
71
-import { cometChatCommon, propertyCheck, tooltip } from "../../../mixins/";
72
-import * as enums from "../../../util/enums.js";
73
-
74
-import {
75
-  CometChatAvatar,
76
-  CometChatBadgeCount,
77
-  CometChatUserPresence,
78
-} from "../../Shared/";
79
-import cometchatConversationListActions from "../CometChatConversationListActions/index.vue";
80
-
81
-import * as style from "./style";
82
-
83
-/**
84
- * The conversation item for conversation list.
85
- *
86
- * @displayName CometChatConversationListItem
87
- */
88
-export default {
89
-  name: "CometChatConversationListItem",
90
-  mixins: [tooltip, propertyCheck, cometChatCommon],
91
-  components: {
92
-    CometChatAvatar,
93
-    CometChatBadgeCount,
94
-    CometChatUserPresence,
95
-    cometchatConversationListActions,
96
-  },
97
-  props: {
98
-    /**
99
-     * Theme of the UI.
100
-     */
101
-    theme: { ...DEFAULT_OBJECT_PROP },
102
-    /**
103
-     * @ignore
104
-     */
105
-    config: { ...DEFAULT_OBJECT_PROP },
106
-    /**
107
-     * Current logged in user.
108
-     */
109
-    loggedInUser: { ...DEFAULT_OBJECT_PROP },
110
-    /**
111
-     * Current conversation object.
112
-     */
113
-    conversation: { ...DEFAULT_OBJECT_PROP },
114
-    /**
115
-     * Selected conversation object.
116
-     */
117
-    selectedConversation: { ...DEFAULT_OBJECT_PROP },
118
-  },
119
-  data() {
120
-    return {
121
-      isHovering: false,
122
-    }
123
-  },
124
-  computed: {
125
-    /**
126
-     * Computed styles for the component.
127
-     */
128
-    styles() {
129
-      return {
130
-        list: style.listItem(
131
-          this.theme,
132
-          this.conversation,
133
-          this.selectedConversation
134
-        ),
135
-        row: style.itemRowStyle(),
136
-        name: style.itemNameStyle(),
137
-        detail: style.itemDetailStyle(),
138
-        thumbnail: style.itemThumbnailStyle(),
139
-        lastMsg: style.itemLastMsgStyle(this.theme),
140
-        lastMsgTime: style.itemLastMsgTimeStyle(this.theme),
141
-      };
142
-    },
143
-  },
144
-  methods: {
145
-    /**
146
-     * Handles item click
147
-     */
148
-    itemClickHandler() {
149
-      this.emitEvent("click", {
150
-        item: this.conversation.conversationWith,
151
-        type: this.conversation.conversationType,
152
-      });
153
-    },
154
-    handleMouseHover(toggleFlag) {
155
-      if(toggleFlag && !this.isHovering) {
156
-        this.isHovering = true;
157
-      } else if(!toggleFlag && this.isHovering) {
158
-        this.isHovering = false;
159
-      }
160
-    },
161
-    /**
162
-     * Gets SVG avatar
163
-     */
164
-    getAvatar() {
165
-      let avatar;
166
-      if (this.conversation.conversationType === "user") {
167
-        avatar = this.conversation.conversationWith.avatar;
168
-      } else if (this.conversation.conversationType === "group") {
169
-        avatar = this.conversation.conversationWith.icon;
170
-      }
171
-      return avatar;
172
-    },
173
-    /**
174
-     * Gets last message time
175
-     */
176
-    getLastMessageTime() {
177
-      if (!this.conversation) {
178
-        return false;
179
-      }
180
-
181
-      if (this.hasProperty(this.conversation, "lastMessage") === false) {
182
-        return false;
183
-      }
184
-
185
-      if (this.hasProperty(this.conversation.lastMessage, "sentAt") === false) {
186
-        return false;
187
-      }
188
-
189
-      let timestamp = null;
190
-
191
-      const messageTimestamp = new Date(
192
-        this.conversation.lastMessage.sentAt * 1000
193
-      );
194
-      const currentTimestamp = Date.now();
195
-
196
-      const diffTimestamp = currentTimestamp - messageTimestamp;
197
-
198
-      if (diffTimestamp < 24 * 60 * 60 * 1000) {
199
-        timestamp = dateFormat(messageTimestamp, "shortTime");
200
-      } else if (diffTimestamp < 48 * 60 * 60 * 1000) {
201
-        timestamp = COMETCHAT_CONSTANTS.YESTERDAY;
202
-      } else if (diffTimestamp < 7 * 24 * 60 * 60 * 1000) {
203
-        timestamp = dateFormat(messageTimestamp, "dddd");
204
-      } else {
205
-        timestamp = dateFormat(messageTimestamp, "dd/mm/yyyy");
206
-      }
207
-
208
-      return timestamp;
209
-    },
210
-    getLastMessage() {
211
-      if (!this.conversation.lastMessage) return "";
212
-
213
-      const lastMessage = this.conversation.lastMessage;
214
-
215
-      let message = null;
216
-      if (this.hasProperty(lastMessage, "deletedAt")) {
217
-        message =
218
-          this.loggedInUser.uid === lastMessage.sender.uid
219
-            ? COMETCHAT_CONSTANTS.YOU_DELETED_THIS_MESSAGE
220
-            : COMETCHAT_CONSTANTS.THIS_MESSAGE_DELETED;
221
-      } else {
222
-        switch (lastMessage.category) {
223
-          case "message":
224
-            message = this.getMessage(lastMessage);
225
-            break;
226
-          case "call":
227
-            message = this.getCallMessage(lastMessage);
228
-            break;
229
-          case "action":
230
-            message = lastMessage.message;
231
-            break;
232
-          case "custom":
233
-            message = this.getCustomMessage(lastMessage);
234
-            break;
235
-          default:
236
-            break;
237
-        }
238
-      }
239
-      return message;
240
-    },
241
-    getMessage(lastMessage) {
242
-      let message = "";
243
-      switch (lastMessage.type) {
244
-        case CometChat.MESSAGE_TYPE.TEXT:
245
-          message = lastMessage.text;
246
-          break;
247
-        case CometChat.MESSAGE_TYPE.MEDIA:
248
-          message = COMETCHAT_CONSTANTS.MEDIA_MESSAGE;
249
-          break;
250
-        case CometChat.MESSAGE_TYPE.IMAGE:
251
-          message = COMETCHAT_CONSTANTS.MESSAGE_IMAGE;
252
-          break;
253
-        case CometChat.MESSAGE_TYPE.FILE:
254
-          message = COMETCHAT_CONSTANTS.MESSAGE_FILE;
255
-          break;
256
-        case CometChat.MESSAGE_TYPE.VIDEO:
257
-          message = COMETCHAT_CONSTANTS.MESSAGE_VIDEO;
258
-          break;
259
-        case CometChat.MESSAGE_TYPE.AUDIO:
260
-          message = COMETCHAT_CONSTANTS.MESSAGE_AUDIO;
261
-          break;
262
-        case CometChat.MESSAGE_TYPE.CUSTOM:
263
-          message = COMETCHAT_CONSTANTS.CUSTOM_MESSAGE;
264
-          break;
265
-        default:
266
-          break;
267
-      }
268
-
269
-      return message;
270
-    },
271
-    getCallMessage(lastMessage) {
272
-      let message = "";
273
-      const type = lastMessage.type;
274
-
275
-      switch (type) {
276
-        case CometChat.MESSAGE_TYPE.VIDEO:
277
-          message = COMETCHAT_CONSTANTS.VIDEO_CALL;
278
-          break;
279
-        case CometChat.MESSAGE_TYPE.AUDIO:
280
-          message = COMETCHAT_CONSTANTS.AUDIO_CALL;
281
-          break;
282
-        default:
283
-          break;
284
-      }
285
-
286
-      return message;
287
-    },
288
-    getCustomMessage(lastMessage) {
289
-      let message = "";
290
-      switch (lastMessage.type) {
291
-        case enums.CUSTOM_TYPE_POLL:
292
-          message = COMETCHAT_CONSTANTS.CUSTOM_MESSAGE_POLL;
293
-          break;
294
-        case enums.CUSTOM_TYPE_STICKER:
295
-          message = COMETCHAT_CONSTANTS.CUSTOM_MESSAGE_STICKER;
296
-          break;
297
-        case enums.CUSTOM_TYPE_DOCUMENT:
298
-          message = COMETCHAT_CONSTANTS.CUSTOM_MESSAGE_DOCUMENT;
299
-          break;
300
-        default:
301
-          break;
302
-      }
303
-
304
-      return message;
305
-    },
306
-  },
307
-};
308
-</script>
309
-<style scoped>
310
-.chat__item--hover:hover {
311
-  background-color: var(--chat-item-bg-color-hover);
312
-}
313
-</style>

+ 0
- 81
frontend/src/cometchat-pro-vue-ui-kit/src/components/Chats/CometChatConversationListItem/style.js 파일 보기

@@ -1,81 +0,0 @@
1
-export const listItem = (theme, conversation, selectedConversation) => {
2
-  const selectedState =
3
-    conversation &&
4
-    selectedConversation &&
5
-    selectedConversation.conversationId === conversation.conversationId
6
-      ? {
7
-          backgroundColor: `${theme.backgroundColor.primary}`,
8
-        }
9
-      : {};
10
-
11
-  return {
12
-    display: "flex",
13
-    flexDirection: "row",
14
-    justifyContent: "left",
15
-    alignItems: "center",
16
-    cursor: "pointer",
17
-    width: "100%",
18
-    padding: "10px 20px",
19
-    position: "relative",
20
-    ...selectedState,
21
-    "--chat-item-bg-color-hover": `${theme.backgroundColor.primary}`,
22
-  };
23
-};
24
-
25
-export const itemThumbnailStyle = () => {
26
-  return {
27
-    display: "inline-block",
28
-    width: "36px",
29
-    height: "36px",
30
-    flexShrink: "0",
31
-  };
32
-};
33
-
34
-export const itemDetailStyle = () => {
35
-  return {
36
-    width: "calc(100% - 45px)",
37
-    flexGrow: "1",
38
-    paddingLeft: "15px",
39
-  };
40
-};
41
-
42
-export const itemRowStyle = () => {
43
-  return {
44
-    display: "flex",
45
-    justifyContent: "space-between",
46
-    alignItems: "baseline",
47
-  };
48
-};
49
-
50
-export const itemNameStyle = () => {
51
-  return {
52
-    fontSize: "15px",
53
-    fontWeight: "600",
54
-    display: "block",
55
-    width: "calc(100% - 60px)",
56
-    overflow: "hidden",
57
-    textOverflow: "ellipsis",
58
-    whiteSpace: "nowrap",
59
-  };
60
-};
61
-
62
-export const itemLastMsgStyle = (theme) => {
63
-  return {
64
-    margin: "0",
65
-    fontSize: "13px",
66
-    width: "calc(100% - 50px)",
67
-    overflow: "hidden",
68
-    textOverflow: "ellipsis",
69
-    whiteSpace: "nowrap",
70
-    lineHeight: "20px",
71
-    color: `${theme.color.helpText}`,
72
-  };
73
-};
74
-
75
-export const itemLastMsgTimeStyle = (theme) => {
76
-  return {
77
-    fontSize: "11px",
78
-    textTransform: "uppercase",
79
-    color: `${theme.color.helpText}`,
80
-  };
81
-};

+ 0
- 354
frontend/src/cometchat-pro-vue-ui-kit/src/components/Chats/CometChatConversationListWithMessages/CometChatConversationListWithMessages.vue 파일 보기

@@ -1,354 +0,0 @@
1
-<template>
2
-  <div :style="styles.root" class="cometchat__chats">
3
-    <div :style="styles.sidebar" class="chats__sidebar">
4
-      <comet-chat-conversation-list
5
-        :item="item"
6
-        :type="type"
7
-        :theme="themeValue"
8
-        :last-message="lastMessage"
9
-        :group-to-leave="groupToLeave"
10
-        :group-to-delete="groupToDelete"
11
-        :group-to-update="groupToUpdate"
12
-        :enable-close-menu="isItemPresent"
13
-        :message-to-mark-read="messageToMarkRead"
14
-        @action="actionHandler"
15
-      />
16
-    </div>
17
-    <div v-if="isItemPresent" class="chats__main" :style="styles.main">
18
-      <comet-chat-messages
19
-        :tab="tab"
20
-        :item="item"
21
-        :type="type"
22
-        :theme="themeValue"
23
-        :call-message="callMessage"
24
-        :logged-in-user="loggedInUser"
25
-        :group-messages="groupMessages"
26
-        :action-from-listener="actionFromListener"
27
-        :composed-thread-message="composedThreadMessage"
28
-        @action="actionHandler"
29
-      />
30
-    </div>
31
-    <div
32
-      v-if="viewDetailScreen"
33
-      :style="styles.secondary"
34
-      class="chats__secondary-view"
35
-    >
36
-      <comet-chat-user-details
37
-        :item="item"
38
-        :type="type"
39
-        :theme="themeValue"
40
-        v-if="type === 'user'"
41
-        @action="actionHandler"
42
-      />
43
-      <comet-chat-group-details
44
-        :item="item"
45
-        :type="type"
46
-        :theme="themeValue"
47
-        v-else-if="type === 'group'"
48
-        @action="actionHandler"
49
-      />
50
-    </div>
51
-    <div
52
-      v-if="viewThreadMessage"
53
-      :style="styles.secondary"
54
-      class="chats__secondary-view"
55
-    >
56
-      <comet-chat-message-thread
57
-        :tab="tab"
58
-        :theme="themeValue"
59
-        :item="threadMessageItem"
60
-        :type="threadMessageType"
61
-        :logged-in-user="loggedInUser"
62
-        :parent-message="threadMessageParent"
63
-        @action="actionHandler"
64
-      />
65
-    </div>
66
-    <comet-chat-incoming-call :theme="themeValue" @action="actionHandler" />
67
-    <comet-chat-outgoing-call
68
-      :item="item"
69
-      :type="type"
70
-      :theme="themeValue"
71
-      :incoming-call="incomingCall"
72
-      :outgoing-call="outgoingCall"
73
-      :logged-in-user="loggedInUser"
74
-      @action="actionHandler"
75
-    />
76
-    <comet-chat-image-viewer
77
-      :open="true"
78
-      v-if="imageView"
79
-      :message="imageView"
80
-      @action="actionHandler"
81
-    />
82
-  </div>
83
-</template>
84
-
85
-<script>
86
-import { DEFAULT_OBJECT_PROP } from "../../../resources/constants";
87
-
88
-import { CometChatManager } from "../../../util/controller";
89
-import { cometChatScreens } from "../../../mixins/";
90
-
91
-import {
92
-  CometChatMessages,
93
-  CometChatImageViewer,
94
-  CometChatMessageThread,
95
-} from "../../Messages/";
96
-import { CometChatUserDetails } from "../../Users";
97
-import { CometChatGroupDetails } from "../../Groups";
98
-import { CometChatIncomingCall, CometChatOutgoingCall } from "../../Calls";
99
-
100
-import CometChatConversationList from "../CometChatConversationList/CometChatConversationList";
101
-
102
-import { theme } from "../../../resources/theme";
103
-
104
-import * as style from "./style";
105
-
106
-/**
107
- * Displays a list of conversation with messages.
108
- *
109
- * @displayName CometChatConversationListItem
110
- */
111
-export default {
112
-  name: "CometChatConversationListWithMessages",
113
-  mixins: [cometChatScreens],
114
-  components: {
115
-    CometChatImageViewer,
116
-    CometChatIncomingCall,
117
-    CometChatOutgoingCall,
118
-    CometChatUserDetails,
119
-    CometChatGroupDetails,
120
-    CometChatMessageThread,
121
-    CometChatConversationList,
122
-    CometChatMessages,
123
-  },
124
-  props: {
125
-    /**
126
-     * Theme of the UI.
127
-     */
128
-    theme: { ...DEFAULT_OBJECT_PROP },
129
-  },
130
-  data() {
131
-    return {
132
-      item: {},
133
-      type: "",
134
-      imageView: null,
135
-      darkTheme: false,
136
-      lastMessage: {},
137
-      callMessage: {},
138
-      groupToLeave: {},
139
-      groupToDelete: {},
140
-      groupToUpdate: {},
141
-      groupMessages: [],
142
-      viewSidebar: false,
143
-      incomingCall: null,
144
-      outgoingCall: null,
145
-      loggedInUser: null,
146
-      tab: "conversations",
147
-      messageToMarkRead: {},
148
-      threadMessageItem: {},
149
-      actionFromListener: {},
150
-      viewDetailScreen: false,
151
-      threadMessageType: null,
152
-      threadMessageParent: {},
153
-      viewThreadMessage: false,
154
-      composedThreadMessage: {},
155
-    };
156
-  },
157
-  computed: {
158
-    /**
159
-     * Computed styles for the component.
160
-     */
161
-    styles() {
162
-      return {
163
-        root: style.chatScreenStyle(this.themeValue),
164
-        main: style.chatScreenMainStyle(
165
-          this.viewThreadMessage,
166
-          this.viewDetailScreen
167
-        ),
168
-        sidebar: style.chatScreenSidebarStyle(
169
-          this.themeValue,
170
-          this.viewSidebar
171
-        ),
172
-        secondary: style.chatScreenSecondaryStyle(
173
-          this.themeValue,
174
-          this.viewThreadMessage
175
-        ),
176
-      };
177
-    },
178
-    /**
179
-     * Theme computed using default theme and theme coming from prop.
180
-     */
181
-    themeValue() {
182
-      return Object.assign({}, theme, this.theme);
183
-    },
184
-  },
185
-  methods: {
186
-    /**
187
-     * Handler for emitted action events
188
-     */
189
-    actionHandler({
190
-      action,
191
-      key,
192
-      item,
193
-      call,
194
-      type,
195
-      count,
196
-      group,
197
-      members,
198
-      options,
199
-      message,
200
-      messages,
201
-      incomingCall,
202
-      rejectedCall,
203
-    }) {
204
-      switch (action) {
205
-        case "item-click":
206
-          this.itemClicked(item, type);
207
-          break;
208
-        case "blockUser":
209
-          this.blockUser();
210
-          break;
211
-        case "unblockUser":
212
-          this.unblockUser();
213
-          break;
214
-        case "audioCall":
215
-          this.audioCall();
216
-          break;
217
-        case "videoCall":
218
-          this.videoCall();
219
-          break;
220
-        case "viewDetail":
221
-        case "closeDetailClicked":
222
-          this.toggleDetailView();
223
-          break;
224
-        case "menuClicked":
225
-          this.item = {};
226
-          this.toggleSideBar();
227
-          break;
228
-        case "closeMenuClicked":
229
-          this.toggleSideBar();
230
-          break;
231
-        case "groupUpdated":
232
-          this.groupUpdated(key, options);
233
-          break;
234
-        case "groupDeleted":
235
-          this.deleteGroup(group);
236
-          break;
237
-        case "leftGroup":
238
-          this.leaveGroup(group);
239
-          break;
240
-        case "membersUpdated":
241
-          this.updateMembersCount(count);
242
-          break;
243
-        case "viewMessageThread":
244
-          this.viewMessageThread(message);
245
-          break;
246
-        case "closeThreadClicked":
247
-          this.closeThreadMessages();
248
-          break;
249
-        case "threadMessageComposed":
250
-          this.onThreadMessageComposed(messages);
251
-          this.updateLastMessage(messages[0]);
252
-          break;
253
-        case "acceptIncomingCall":
254
-          this.acceptIncomingCall(incomingCall);
255
-          break;
256
-        case "acceptedIncomingCall":
257
-          this.appendCallMessage(call);
258
-          break;
259
-        case "rejectedIncomingCall":
260
-          this.rejectedIncomingCall(incomingCall, rejectedCall);
261
-          break;
262
-        case "outgoingCallRejected":
263
-        case "outgoingCallCancelled":
264
-        case "callEnded":
265
-          this.outgoingCallEnded(call);
266
-          break;
267
-        case "userJoinedCall":
268
-        case "userLeftCall":
269
-          this.appendCallMessage(call);
270
-          break;
271
-        case "viewActualImage":
272
-          this.setImageView(message);
273
-          break;
274
-        case "closeActualImage":
275
-          this.setImageView(null);
276
-          break;
277
-        case "membersAdded":
278
-          this.membersAdded(members);
279
-          break;
280
-        case "memberUnbanned":
281
-          this.memberUnbanned(members);
282
-          break;
283
-        case "memberScopeChanged":
284
-          this.memberScopeChanged(members);
285
-          break;
286
-        case "messageDeleted":
287
-          this.closeThreadMessages();
288
-          break;
289
-        case "messageComposed":
290
-        case "lastMessageEdited":
291
-        case "lastMessageDeleted":
292
-          this.updateLastMessage(messages[0]);
293
-          break;
294
-        case "messageEdited":
295
-          this.updateThreadMessage(message);
296
-          break;
297
-        case "listenerData":
298
-          this.actionFromListener = { action: action, messages: [...messages] };
299
-          break;
300
-        default:
301
-          break;
302
-      }
303
-    },
304
-  },
305
-  beforeMount() {
306
-    if (!Object.keys(this.item).length) {
307
-      this.toggleSideBar();
308
-    }
309
-
310
-    (async () => {
311
-      try {
312
-        this.loggedInUser = await new CometChatManager().getLoggedInUser();
313
-      } catch (error) {
314
-        this.logError(
315
-          "[CometChatConversationScreen] getLoggedInUser error",
316
-          error
317
-        );
318
-      }
319
-    })();
320
-  },
321
-};
322
-</script>
323
-
324
-<style scoped>
325
-.cometchat__chats * {
326
-  box-sizing: border-box;
327
-  font-family: var(--chat-screen-font-family) !important;
328
-}
329
-@media (min-width: 320px) and (max-width: 767px) {
330
-  .chats__sidebar {
331
-    top: 0;
332
-    bottom: 0;
333
-    z-index: 2;
334
-    width: 100% !important;
335
-    transition: all 0.3s ease-out;
336
-    position: absolute !important;
337
-    left: var(--cometchat-chats-sidebar-left);
338
-    background-color: var(--cometchat-chats-sidebar-bg);
339
-    box-shadow: var(--cometchat-chats-sidebar-box-shadow);
340
-  }
341
-  .chats__main {
342
-    width: 100% !important;
343
-  }
344
-  .chats__secondary-view {
345
-    top: 0;
346
-    bottom: 0;
347
-    z-index: 2;
348
-    right: 0 !important;
349
-    width: 100% !important;
350
-    position: absolute !important;
351
-    background-color: var(--chats-secondary-bg-color) !important;
352
-  }
353
-}
354
-</style>

+ 0
- 64
frontend/src/cometchat-pro-vue-ui-kit/src/components/Chats/CometChatConversationListWithMessages/style.js 파일 보기

@@ -1,64 +0,0 @@
1
-export const chatScreenStyle = (theme) => {
2
-  return {
3
-    display: "flex",
4
-    height: "100%",
5
-    width: "100%",
6
-    boxSizing: "border-box",
7
-    fontFamily: `${theme.fontFamily}`,
8
-    "--chat-screen-font-family": `${theme.fontFamily}`,
9
-  };
10
-};
11
-
12
-export const chatScreenSidebarStyle = (theme, sidebarView) => {
13
-  const sidebar = sidebarView
14
-    ? {
15
-        "--cometchat-chats-sidebar-left": "0",
16
-        "--cometchat-chats-sidebar-box-shadow":
17
-          "rgba(0, 0, 0, .4) -30px 0 30px 30px",
18
-      }
19
-    : {};
20
-
21
-  return {
22
-    width: "280px",
23
-    borderRight: `1px solid ${theme.borderColor.primary}`,
24
-    height: "100%",
25
-    position: "relative",
26
-    "--cometchat-chats-sidebar-left": "-100%",
27
-    "--cometchat-chats-sidebar-bg": `${theme.backgroundColor.white}`,
28
-    ...sidebar,
29
-  };
30
-};
31
-
32
-export const chatScreenMainStyle = (threadMessageView, detailView) => {
33
-  const secondaryView = threadMessageView
34
-    ? {
35
-        width: "calc(100% - 680px)",
36
-      }
37
-    : detailView
38
-    ? {
39
-        width: "calc(100% - 580px)",
40
-      }
41
-    : {};
42
-
43
-  return {
44
-    width: "calc(100% - 280px)",
45
-    display: "flex",
46
-    flexDirection: "column",
47
-    height: "100%",
48
-    order: "2",
49
-    ...secondaryView,
50
-  };
51
-};
52
-
53
-export const chatScreenSecondaryStyle = (theme, threadMessageView) => {
54
-  return {
55
-    float: "right",
56
-    borderLeft: `1px solid ${theme.borderColor.primary}`,
57
-    height: "100%",
58
-    width: threadMessageView ? "400px" : "300px",
59
-    display: "flex",
60
-    flexDirection: "column",
61
-    order: "3",
62
-    "--chats-secondary-bg-color": `${theme.backgroundColor.white}`,
63
-  };
64
-};

+ 0
- 4
frontend/src/cometchat-pro-vue-ui-kit/src/components/Chats/index.js 파일 보기

@@ -1,4 +0,0 @@
1
-export { default as CometChatConversationList } from "./CometChatConversationList/CometChatConversationList";
2
-export { default as CometChatConversationListItem } from "./CometChatConversationListItem/CometChatConversationListItem";
3
-export { default as CometChatConversationListWithMessages } from "./CometChatConversationListWithMessages/CometChatConversationListWithMessages";
4
-export { default as cometchatConversationListActions } from "./CometChatConversationListActions/index";

+ 0
- 229
frontend/src/cometchat-pro-vue-ui-kit/src/components/CometChatUI/CometChatNavBar/CometChatNavBar.vue 파일 보기

@@ -1,229 +0,0 @@
1
-<template>
2
-  <div class="cometchat__unified__navbar">
3
-    <template v-if="tab === 'contacts'">
4
-      <comet-chat-user-list
5
-        :item="item"
6
-        :type="type"
7
-        :theme="theme"
8
-        :enable-close-menu="enableCloseMenu"
9
-        @action="actionHandler"
10
-      />
11
-    </template>
12
-    <template v-else-if="tab === 'conversations'">
13
-      <comet-chat-conversation-list
14
-        :item="item"
15
-        :type="type"
16
-        :theme="theme"
17
-        :last-message="lastMessage"
18
-        :group-to-leave="groupToLeave"
19
-        :group-to-delete="groupToDelete"
20
-        :group-to-update="groupToUpdate"
21
-        :enable-close-menu="enableCloseMenu"
22
-        :message-to-mark-read="messageToMarkRead"
23
-        @action="actionHandler"
24
-      />
25
-    </template>
26
-    <template v-else-if="tab === 'groups'">
27
-      <comet-chat-group-list
28
-        :item="item"
29
-        :type="type"
30
-        :theme="theme"
31
-        :group-to-leave="groupToLeave"
32
-        :group-to-delete="groupToDelete"
33
-        :group-to-update="groupToUpdate"
34
-        :enable-close-menu="enableCloseMenu"
35
-        @action="actionHandler"
36
-      />
37
-    </template>
38
-    <template v-else-if="tab === 'info'">
39
-      <comet-chat-user-profile :theme="theme" @action="actionHandler" />
40
-    </template>
41
-    <div :style="styles.footer" class="sidebar__footer">
42
-      <div :style="styles.navbar" class="footer__navbar">
43
-        <div :style="styles.item" @click="changeTab('conversations')">
44
-          <span :style="styles.chatsIcon"></span>
45
-        </div>
46
-        <div :style="styles.item" @click="changeTab('contacts')">
47
-          <span :style="styles.contactIcon"></span>
48
-        </div>
49
-        <div :style="styles.item" @click="changeTab('groups')">
50
-          <span :style="styles.groupIcon"></span>
51
-        </div>
52
-        <div :style="styles.item" @click="changeTab('info')">
53
-          <span :style="styles.moreIcon"></span>
54
-        </div>
55
-      </div>
56
-    </div>
57
-  </div>
58
-</template>
59
-<script>
60
-import {
61
-  DEFAULT_OBJECT_PROP,
62
-  DEFAULT_STRING_PROP,
63
-  DEFAULT_BOOLEAN_PROP,
64
-} from "../../../resources/constants";
65
-
66
-import { cometChatCommon } from "../../../mixins/";
67
-
68
-import { CometChatConversationList } from "../../Chats/";
69
-import { CometChatUserProfile } from "../../UserProfile/";
70
-import { CometChatGroupList } from "../../Groups";
71
-import { CometChatUserList } from "../../Users";
72
-
73
-import contactGreyIcon from "./resources/contacts-grey.png";
74
-import contactBlueIcon from "./resources/contacts-blue.png";
75
-import moreGreyIcon from "./resources/userInfo-grey.png";
76
-import moreBlueIcon from "./resources/userInfo-blue.png";
77
-import groupBlueIcon from "./resources/groups-blue.png";
78
-import groupGreyIcon from "./resources/groups-grey.png";
79
-import chatGreyIcon from "./resources/chats-grey.png";
80
-import chatBlueIcon from "./resources/chats-blue.png";
81
-
82
-import * as style from "./style";
83
-
84
-/**
85
- * Navigation bar for switching tabs in CometChatUI.
86
- *
87
- * @displayName CometChatNavBar
88
- */
89
-export default {
90
-  name: "CometChatNavBar",
91
-  mixins: [cometChatCommon],
92
-  components: {
93
-    CometChatConversationList,
94
-    CometChatUserProfile,
95
-    CometChatGroupList,
96
-    CometChatUserList,
97
-  },
98
-  props: {
99
-    /**
100
-     * Current active tab.
101
-     * @values conversations, contacts, groups, info
102
-     */
103
-    tab: { ...DEFAULT_STRING_PROP },
104
-    /**
105
-     * The selected chat item object.
106
-     */
107
-    item: { ...DEFAULT_OBJECT_PROP },
108
-    /**
109
-     * Type of chat item.
110
-     */
111
-    type: { ...DEFAULT_STRING_PROP },
112
-    /**
113
-     * Theme of the UI.
114
-     */
115
-    theme: { ...DEFAULT_OBJECT_PROP },
116
-    /**
117
-     * Last message in message list.
118
-     */
119
-    lastMessage: { ...DEFAULT_OBJECT_PROP },
120
-    /**
121
-     * The group selected to leave.
122
-     */
123
-    groupToLeave: { ...DEFAULT_OBJECT_PROP },
124
-    /**
125
-     * The group selected to update.
126
-     */
127
-    groupToUpdate: { ...DEFAULT_OBJECT_PROP },
128
-    /**
129
-     * The group selected to delete.
130
-     */
131
-    groupToDelete: { ...DEFAULT_OBJECT_PROP },
132
-    /**
133
-     * Shows/hides the close menu button.
134
-     */
135
-    enableCloseMenu: { ...DEFAULT_BOOLEAN_PROP },
136
-    /**
137
-     * Message marked to read.
138
-     */
139
-    messageToMarkRead: { ...DEFAULT_OBJECT_PROP },
140
-  },
141
-  computed: {
142
-    /**
143
-     * Computed styles for the component.
144
-     */
145
-    styles() {
146
-      return {
147
-        item: style.itemStyle(),
148
-        footer: style.footerStyle(),
149
-        navbar: style.navbarStyle(),
150
-        chatsIcon: style.itemLinkStyle(
151
-          chatGreyIcon,
152
-          chatBlueIcon,
153
-          this.isChatsTabActive
154
-        ),
155
-        contactIcon: style.itemLinkStyle(
156
-          contactGreyIcon,
157
-          contactBlueIcon,
158
-          this.isContactsTabActive
159
-        ),
160
-        groupIcon: style.itemLinkStyle(
161
-          groupGreyIcon,
162
-          groupBlueIcon,
163
-          this.isGroupsTabActive,
164
-          true
165
-        ),
166
-        moreIcon: style.itemLinkStyle(
167
-          moreGreyIcon,
168
-          moreBlueIcon,
169
-          this.isMoreTabActive
170
-        ),
171
-      };
172
-    },
173
-    /**
174
-     * Whether chats tab is active.
175
-     */
176
-    isChatsTabActive() {
177
-      return this.tab === "conversations";
178
-    },
179
-    /**
180
-     * Whether users tab is active.
181
-     */
182
-    isContactsTabActive() {
183
-      return this.tab === "contacts";
184
-    },
185
-    /**
186
-     * Whether groups tab is active.
187
-     */
188
-    isGroupsTabActive() {
189
-      return this.tab === "groups";
190
-    },
191
-    /**
192
-     * Whether info tab is active.
193
-     */
194
-    isMoreTabActive() {
195
-      return this.tab === "info";
196
-    },
197
-  },
198
-  methods: {
199
-    /**
200
-     * Emits change tab event
201
-     */
202
-    changeTab(tab) {
203
-      this.emitAction("tabChanged", { tab });
204
-    },
205
-    /**
206
-     * Handles emitted action events
207
-     */
208
-    actionHandler({ action, ...rest }) {
209
-      this.emitAction(action, { ...rest });
210
-    },
211
-  },
212
-};
213
-</script>
214
-<style scoped>
215
-.cometchat__unified__navbar {
216
-  height: 100%;
217
-  width: 280px;
218
-}
219
-.cometchat__unified__navbar .chats__wrapper,
220
-.cometchat__unified__navbar .groups__wrapper,
221
-.cometchat__unified__navbar .contacts__wrapper {
222
-  height: calc(100% - 50px) !important;
223
-}
224
-@media (min-width: 320px) and (max-width: 767px) {
225
-  .cometchat__unified__navbar {
226
-    width: 100% !important;
227
-  }
228
-}
229
-</style>

BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/CometChatUI/CometChatNavBar/resources/chats-blue.png 파일 보기


BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/CometChatUI/CometChatNavBar/resources/chats-grey.png 파일 보기


BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/CometChatUI/CometChatNavBar/resources/contacts-blue.png 파일 보기


BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/CometChatUI/CometChatNavBar/resources/contacts-grey.png 파일 보기


BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/CometChatUI/CometChatNavBar/resources/groups-blue.png 파일 보기


BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/CometChatUI/CometChatNavBar/resources/groups-grey.png 파일 보기


BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/CometChatUI/CometChatNavBar/resources/userInfo-blue.png 파일 보기


BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/CometChatUI/CometChatNavBar/resources/userInfo-grey.png 파일 보기


+ 0
- 40
frontend/src/cometchat-pro-vue-ui-kit/src/components/CometChatUI/CometChatNavBar/style.js 파일 보기

@@ -1,40 +0,0 @@
1
-export const footerStyle = () => {
2
-  return {
3
-    width: "100%",
4
-    zIndex: "1",
5
-  };
6
-};
7
-
8
-export const navbarStyle = () => {
9
-  return {
10
-    display: "flex",
11
-    flexDirection: "row",
12
-    alignItems: "center",
13
-    justifyContent: "space-around",
14
-  };
15
-};
16
-
17
-export const itemStyle = () => {
18
-  return {
19
-    display: "inline-block",
20
-    padding: "13px",
21
-    cursor: "pointer",
22
-  };
23
-};
24
-
25
-export const itemLinkStyle = (icon, activeStateIcon, isActive, isGroup) => {
26
-  let background = isActive
27
-    ? {
28
-        background: `url(${activeStateIcon}) 0% 0% / contain no-repeat`,
29
-      }
30
-    : {
31
-        background: `url(${icon}) 0% 0% / contain no-repeat`,
32
-      };
33
-
34
-  return {
35
-    height: "20px",
36
-    display: "inline-block",
37
-    width: isGroup ? "28px" : "21px",
38
-    ...background,
39
-  };
40
-};

+ 0
- 383
frontend/src/cometchat-pro-vue-ui-kit/src/components/CometChatUI/CometChatUI.vue 파일 보기

@@ -1,383 +0,0 @@
1
-<template>
2
-  <div :style="styles.root" class="cometchat__unified">
3
-    <div :style="styles.sidebar" class="unified__sidebar">
4
-      <comet-chat-nav-bar
5
-        :tab="tab"
6
-        :item="item"
7
-        :type="type"
8
-        :theme="themeValue"
9
-        :last-message="lastMessage"
10
-        :group-to-leave="groupToLeave"
11
-        :group-to-update="groupToUpdate"
12
-        :group-to-delete="groupToDelete"
13
-        :enable-close-menu="isItemPresent"
14
-        :message-to-mark-read="messageToMarkRead"
15
-        @action="actionHandler"
16
-      />
17
-    </div>
18
-    <div v-if="isItemPresent" class="unified__main" :style="styles.main">
19
-      <comet-chat-messages
20
-        :tab="tab"
21
-        :item="item"
22
-        :type="type"
23
-        :theme="themeValue"
24
-        :call-message="callMessage"
25
-        :logged-in-user="loggedInUser"
26
-        :group-messages="groupMessages"
27
-        :action-from-listener="actionFromListener"
28
-        :composed-thread-message="composedThreadMessage"
29
-        @action="actionHandler"
30
-      />
31
-    </div>
32
-    <div v-else :style="styles.placeholder">
33
-      {{ placeholderMessage }}
34
-    </div>
35
-    <div
36
-      v-if="viewDetailScreen"
37
-      :style="styles.secondary"
38
-      class="unified__secondary"
39
-    >
40
-      <comet-chat-user-details
41
-        :item="item"
42
-        :type="type"
43
-        :theme="themeValue"
44
-        v-if="type === 'user'"
45
-        @action="actionHandler"
46
-      />
47
-      <comet-chat-group-details
48
-        :item="item"
49
-        :type="type"
50
-        :theme="themeValue"
51
-        v-else-if="type === 'group'"
52
-        @action="actionHandler"
53
-      />
54
-    </div>
55
-    <div
56
-      v-if="viewThreadMessage"
57
-      :style="styles.secondary"
58
-      class="unified__secondary"
59
-    >
60
-      <comet-chat-message-thread
61
-        :tab="tab"
62
-        :theme="themeValue"
63
-        :item="threadMessageItem"
64
-        :type="threadMessageType"
65
-        :logged-in-user="loggedInUser"
66
-        :parent-message="threadMessageParent"
67
-        @action="actionHandler"
68
-      />
69
-    </div>
70
-    <comet-chat-incoming-call :theme="themeValue" @action="actionHandler" />
71
-    <comet-chat-outgoing-call
72
-      :item="item"
73
-      :type="type"
74
-      :theme="themeValue"
75
-      :incoming-call="incomingCall"
76
-      :outgoing-call="outgoingCall"
77
-      :logged-in-user="loggedInUser"
78
-      @action="actionHandler"
79
-    />
80
-    <comet-chat-image-viewer
81
-      :open="true"
82
-      v-if="imageView"
83
-      :message="imageView"
84
-      @action="actionHandler"
85
-    />
86
-  </div>
87
-</template>
88
-<script>
89
-import {
90
-  COMETCHAT_CONSTANTS,
91
-  DEFAULT_OBJECT_PROP,
92
-} from "../../resources/constants";
93
-
94
-import { cometChatScreens } from "../../mixins/";
95
-import { CometChatManager } from "../../util/controller";
96
-
97
-import {
98
-  CometChatMessages,
99
-  CometChatImageViewer,
100
-  CometChatMessageThread,
101
-} from "../Messages/";
102
-import { CometChatUserDetails } from "../Users";
103
-import { CometChatGroupDetails } from "../Groups";
104
-import { CometChatIncomingCall, CometChatOutgoingCall } from "../Calls";
105
-
106
-import CometChatNavBar from "./CometChatNavBar/CometChatNavBar";
107
-
108
-import { theme } from "../../resources/theme";
109
-
110
-import * as style from "./style";
111
-
112
-/**
113
- * Displays a fully working chat application.
114
- *
115
- * @displayName CometChatUI
116
- */
117
-export default {
118
-  name: "CometChatUI",
119
-  mixins: [cometChatScreens],
120
-  components: {
121
-    CometChatNavBar,
122
-    CometChatImageViewer,
123
-    CometChatIncomingCall,
124
-    CometChatOutgoingCall,
125
-    CometChatUserDetails,
126
-    CometChatGroupDetails,
127
-    CometChatMessageThread,
128
-    CometChatMessages,
129
-  },
130
-  props: {
131
-    /**
132
-     * Theme of the UI.
133
-     */
134
-    theme: { ...DEFAULT_OBJECT_PROP },
135
-  },
136
-  data() {
137
-    return {
138
-      item: {},
139
-      type: "user",
140
-      imageView: null,
141
-      darkTheme: false,
142
-      lastMessage: {},
143
-      callMessage: {},
144
-      groupToLeave: {},
145
-      groupToDelete: {},
146
-      groupToUpdate: {},
147
-      groupMessages: [],
148
-      viewSidebar: false,
149
-      incomingCall: null,
150
-      outgoingCall: null,
151
-      loggedInUser: null,
152
-      tab: "conversations",
153
-      messageToMarkRead: {},
154
-      threadMessageItem: {},
155
-      actionFromListener: {},
156
-      viewDetailScreen: false,
157
-      threadMessageType: null,
158
-      threadMessageParent: {},
159
-      viewThreadMessage: false,
160
-      composedThreadMessage: {},
161
-    };
162
-  },
163
-  computed: {
164
-    /**
165
-     * Computed styles for the component.
166
-     */
167
-    styles() {
168
-      return {
169
-        main: style.unifiedMainStyle(
170
-          this.viewThreadMessage,
171
-          this.viewDetailScreen
172
-        ),
173
-        secondary: style.unifiedSecondaryStyle(
174
-          this.themeValue,
175
-          this.viewThreadMessage
176
-        ),
177
-        root: style.unifiedStyle(this.themeValue),
178
-        placeholder: style.unifiedPlaceholderStyle(this.themeValue),
179
-        sidebar: style.unifiedSidebarStyle(this.themeValue, this.viewSidebar),
180
-      };
181
-    },
182
-    /**
183
-     * Theme computed using default theme and theme coming from prop.
184
-     */
185
-
186
-    themeValue() {
187
-      return Object.assign({}, theme, this.theme);
188
-    },
189
-    /**
190
-     * Placeholder message when chat item is not selected.
191
-     */
192
-    placeholderMessage() {
193
-      return this.STRINGS[
194
-        this.tab === "info"
195
-          ? "NO_TAB_SELECTED_MESSAGE"
196
-          : "NO_ITEM_SELECTED_MESSAGE"
197
-      ];
198
-    },
199
-    /**
200
-     * Local string constants.
201
-     */
202
-    STRINGS() {
203
-      return COMETCHAT_CONSTANTS;
204
-    },
205
-  },
206
-  methods: {
207
-    /**
208
-     * Handler for emitted action events
209
-     */
210
-    actionHandler({
211
-      action,
212
-      tab,
213
-      item,
214
-      call,
215
-      type,
216
-      count,
217
-      group,
218
-      members,
219
-      message,
220
-      messages,
221
-      incomingCall,
222
-      rejectedCall,
223
-    }) {
224
-      switch (action) {
225
-        case "item-click":
226
-          this.itemClicked(item, type);
227
-          break;
228
-        case "tabChanged":
229
-          this.item = {};
230
-          this.changeTab(tab);
231
-          break;
232
-        case "blockUser":
233
-          this.blockUser();
234
-          break;
235
-        case "unblockUser":
236
-          this.unblockUser();
237
-          break;
238
-        case "audioCall":
239
-          this.audioCall();
240
-          break;
241
-        case "videoCall":
242
-          this.videoCall();
243
-          break;
244
-        case "viewDetail":
245
-        case "closeDetailClicked":
246
-          this.toggleDetailView();
247
-          break;
248
-        case "menuClicked":
249
-          this.item = {};
250
-          this.toggleSideBar();
251
-          break;
252
-        case "closeMenuClicked":
253
-          this.toggleSideBar();
254
-          break;
255
-        case "groupUpdated":
256
-          this.groupUpdated(item, count);
257
-          break;
258
-        case "groupDeleted":
259
-          this.deleteGroup(group);
260
-          break;
261
-        case "leftGroup":
262
-          this.leaveGroup(group);
263
-          break;
264
-        case "membersUpdated":
265
-          this.updateMembersCount(count);
266
-          break;
267
-        case "viewMessageThread":
268
-          this.viewMessageThread(message);
269
-          break;
270
-        case "closeThreadClicked":
271
-          this.closeThreadMessages();
272
-          break;
273
-        case "threadMessageComposed":
274
-          this.onThreadMessageComposed(messages);
275
-          this.updateLastMessage(messages[0]);
276
-          break;
277
-        case "acceptIncomingCall":
278
-          this.acceptIncomingCall(incomingCall);
279
-          break;
280
-        case "acceptedIncomingCall":
281
-          this.callInitiated(call);
282
-          break;
283
-        case "rejectedIncomingCall":
284
-          this.rejectedIncomingCall(incomingCall, rejectedCall);
285
-          break;
286
-        case "outgoingCallRejected":
287
-        case "outgoingCallCancelled":
288
-        case "callEnded":
289
-          this.outgoingCallEnded(call);
290
-          break;
291
-        case "userJoinedCall":
292
-        case "userLeftCall":
293
-          this.appendCallMessage(call);
294
-          break;
295
-        case "viewActualImage":
296
-          this.setImageView(message);
297
-          break;
298
-        case "closeActualImage":
299
-          this.setImageView(null);
300
-          break;
301
-        case "membersAdded":
302
-          this.membersAdded(members, message);
303
-          break;
304
-        case "memberUnbanned":
305
-          this.memberUnbanned(members, message);
306
-          break;
307
-        case "memberScopeChanged":
308
-          this.memberScopeChanged(members, message);
309
-          break;
310
-        case "messageDeleted":
311
-          this.closeThreadMessages();
312
-          break;
313
-        case "messageComposed":
314
-        case "lastMessageEdited":
315
-        case "lastMessageDeleted":
316
-          this.updateLastMessage(messages[0]);
317
-          break;
318
-        case "messageEdited":
319
-          this.updateThreadMessage(message);
320
-          break;
321
-        case "listenerData":
322
-          this.actionFromListener = { action: action, messages: [...messages] };
323
-          break;
324
-        default:
325
-          break;
326
-      }
327
-    },
328
-    /**
329
-     * Changes tab
330
-     */
331
-    changeTab(tab) {
332
-      this.tab = tab;
333
-      this.imageView = null;
334
-      this.viewDetailScreen = false;
335
-      this.viewThreadMessage = false;
336
-    },
337
-  },
338
-  beforeMount() {
339
-    if (!Object.keys(this.item).length) {
340
-      this.toggleSideBar();
341
-    }
342
-
343
-    (async () => {
344
-      try {
345
-        this.loggedInUser = await new CometChatManager().getLoggedInUser();
346
-      } catch (error) {
347
-        this.logError("[CometChatUnified] getLoggedInUser error", error);
348
-      }
349
-    })();
350
-  },
351
-};
352
-</script>
353
-<style scoped>
354
-.cometchat__unified {
355
-  box-sizing: border-box !important;
356
-  font-family: var(--cometchat-unified-font-family) !important;
357
-}
358
-@media (min-width: 320px) and (max-width: 767px) {
359
-  .unified__sidebar {
360
-    top: 0;
361
-    bottom: 0;
362
-    z-index: 2;
363
-    width: 100% !important;
364
-    position: absolute !important;
365
-    transition: all 0.3s ease-out;
366
-    left: var(--cometchat-unified-sidebar-left);
367
-    background-color: var(--cometchat-unified-sidebar-bg-color);
368
-    box-shadow: var(--cometchat-unified-sidebar-box-shadow, none);
369
-  }
370
-  .unified__main {
371
-    width: 100% !important;
372
-  }
373
-  .unified__secondary {
374
-    top: 0;
375
-    bottom: 0;
376
-    z-index: 2;
377
-    right: 0 !important;
378
-    width: 100% !important;
379
-    position: absolute !important;
380
-    background-color: var(--cometchat-unified-sidebar-bg-color);
381
-  }
382
-}
383
-</style>

+ 0
- 3
frontend/src/cometchat-pro-vue-ui-kit/src/components/CometChatUI/index.js 파일 보기

@@ -1,3 +0,0 @@
1
-
2
-export { default as CometChatUI } from "./CometChatUI";
3
-export { default as CometChatNavBar } from "./CometChatNavBar/CometChatNavBar";

+ 0
- 83
frontend/src/cometchat-pro-vue-ui-kit/src/components/CometChatUI/style.js 파일 보기

@@ -1,83 +0,0 @@
1
-export const unifiedStyle = (theme) => {
2
-  return {
3
-    display: "flex",
4
-    height: "100%",
5
-    width: "100%",
6
-    boxSizing: "border-box",
7
-    fontFamily: `${theme.fontFamily}`,
8
-    position: "relative",
9
-    "--cometchat-unified-font-family": `${theme.fontFamily}`,
10
-  };
11
-};
12
-
13
-export const unifiedSidebarStyle = (theme, viewSidebar) => {
14
-  const sidebarView = viewSidebar
15
-    ? {
16
-        "--cometchat-unified-sidebar-left": "0",
17
-        "--cometchat-unified-sidebar-box-shadow":
18
-          "rgba(0, 0, 0, .4) -30px 0 30px 30px",
19
-      }
20
-    : {
21
-        "--cometchat-unified-sidebar-left": "-100%",
22
-      };
23
-
24
-  return {
25
-    width: "280px",
26
-    borderRight: `1px solid ${theme.borderColor.primary}`,
27
-    height: "100%",
28
-    position: "relative",
29
-    display: "flex",
30
-    flexDirection: "column",
31
-    // "> .contacts, .chats, .groups": {
32
-    //   height: "calc(100% - 50px)",
33
-    // },
34
-    "--cometchat-unified-sidebar-bg-color": `${theme.backgroundColor.white}`,
35
-    ...sidebarView,
36
-  };
37
-};
38
-
39
-export const unifiedMainStyle = (threadmessageview, detailview) => {
40
-  const secondaryView = threadmessageview
41
-    ? {
42
-        width: "calc(100% - 680px)",
43
-      }
44
-    : detailview
45
-    ? {
46
-        width: "calc(100% - 580px)",
47
-      }
48
-    : {};
49
-
50
-  return {
51
-    width: "calc(100% - 280px)",
52
-    height: "100%",
53
-    order: "2",
54
-    ...secondaryView,
55
-  };
56
-};
57
-
58
-export const unifiedSecondaryStyle = (theme, threadmessageview) => {
59
-  return {
60
-    float: "right",
61
-    borderLeft: `1px solid ${theme.borderColor.primary}`,
62
-    height: "100%",
63
-    width: threadmessageview ? "400px" : "300px",
64
-    display: "flex",
65
-    flexDirection: "column",
66
-    order: "3",
67
-    "--cometchat-unified-sidebar-bg-color": `${theme.backgroundColor.white}`,
68
-  };
69
-};
70
-
71
-export const unifiedPlaceholderStyle = (theme) => {
72
-  return {
73
-    width: "100%",
74
-    height: "100%",
75
-    opacity: "0.4",
76
-    display: "flex",
77
-    fontSize: "22px",
78
-    fontWeight: "700",
79
-    alignItems: "center",
80
-    justifyContent: "center",
81
-    color: `${theme.color.primary}`,
82
-  };
83
-};

+ 0
- 383
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatAddGroupMemberList/CometChatAddGroupMemberList.vue 파일 보기

@@ -1,383 +0,0 @@
1
-<template>
2
-  <div>
3
-    <comet-chat-backdrop :show="open" @click="emitEvent('close')" />
4
-    <div :style="styles.modalWrapper" class="cometchat__add__members__wrapper">
5
-      <span
6
-        title="Close"
7
-        :style="styles.modalClose"
8
-        @click="emitEvent('close')"
9
-      ></span>
10
-      <div :style="styles.modalBody">
11
-        <table :style="styles.modalTable">
12
-          <caption :style="styles.tableCaption">
13
-            {{
14
-              STRINGS.CONTACTS
15
-            }}
16
-          </caption>
17
-          <caption :style="styles.tableSearch">
18
-            <input
19
-              type="text"
20
-              autoComplete="off"
21
-              placeholder="Search"
22
-              :style="styles.searchInput"
23
-              @input="searchUsers"
24
-            />
25
-          </caption>
26
-          <caption v-if="filteredList.length === 0" :style="styles.contactMsg">
27
-            <p :style="styles.contactMsgTxt">
28
-              {{ decoratorMessage }}
29
-            </p>
30
-          </caption>
31
-          <tbody
32
-            :style="styles.tableBody"
33
-            class="cometchat__add__members__table"
34
-            @scoll="scrollHandler"
35
-          >
36
-            <!--eslint-disable-->
37
-            <template 
38
-              v-for="(user, i) in filteredList"
39
-            >
40
-              <comet-chat-add-group-member-list-item
41
-                :user="user"
42
-                :theme="theme"
43
-                :members="membersList"
44
-                :logged-in-user="loggedInUser"
45
-                @change="membersUpdated"
46
-              />
47
-            </template>
48
-          </tbody>
49
-          <tfoot>
50
-            <tr :style="styles.tableFoot.tr">
51
-              <td colSpan="2" :style="styles.tableFoot.td">
52
-                <button :style="styles.tableFoot.button" @click="updateMembers">
53
-                  {{ membersAdding ? STRINGS.ADDING_MESSSAGE : STRINGS.ADD }}
54
-                </button>
55
-              </td>
56
-            </tr>
57
-          </tfoot>
58
-        </table>
59
-      </div>
60
-    </div>
61
-  </div>
62
-</template>
63
-
64
-<!--eslint-disable-->
65
-<script>
66
-import { CometChat } from "@cometchat-pro/chat";
67
-
68
-import {
69
-  COMETCHAT_CONSTANTS,
70
-  DEFAULT_ARRAY_PROP,
71
-  DEFAULT_OBJECT_PROP,
72
-  DEFAULT_BOOLEAN_PROP,
73
-} from "../../../resources/constants";
74
-
75
-import { cometChatCommon } from "../../../mixins/";
76
-
77
-import { CometChatManager } from "../../../util/controller";
78
-import { SvgAvatar } from "../../../util/svgavatar";
79
-import { AddMembersManager } from "./controller";
80
-
81
-import CometChatAddGroupMemberListItem from "../CometChatAddGroupMemberListItem/CometChatAddGroupMemberListItem";
82
-import { CometChatBackdrop } from "../../Shared";
83
-
84
-import * as style from "./style";
85
-
86
-import searchIcon from "./resources/search-grey-icon.png";
87
-import clearIcon from "./resources/close.png";
88
-
89
-let timeout;
90
-let friendsOnly;
91
-let addMembersManager;
92
-
93
-/**
94
- * Displays list of users for adding in group.
95
- *
96
- * @displayName CometChatAddGroupMemberList
97
- */
98
-export default {
99
-  name: "CometChatAddGroupMemberList",
100
-  mixins: [cometChatCommon],
101
-  components: {
102
-    CometChatBackdrop,
103
-    CometChatAddGroupMemberListItem,
104
-  },
105
-  props: {
106
-    /**
107
-     * Opens the modal.
108
-     */
109
-    open: { ...DEFAULT_BOOLEAN_PROP },
110
-    /**
111
-     * The selected chat item object.
112
-     */
113
-    item: { ...DEFAULT_OBJECT_PROP },
114
-    /**
115
-     * Theme of the UI.
116
-     */
117
-    theme: { ...DEFAULT_OBJECT_PROP },
118
-    /**
119
-     * List of members.
120
-     */
121
-    membersList: { ...DEFAULT_ARRAY_PROP },
122
-    /**
123
-     * Current logged in user.
124
-     */
125
-    loggedInUser: { ...DEFAULT_OBJECT_PROP },
126
-    /**
127
-     * List of banned members.
128
-     */
129
-    bannedMembersList: { ...DEFAULT_ARRAY_PROP },
130
-  },
131
-  data() {
132
-    return {
133
-      userList: [],
134
-      membersToAdd: [],
135
-      filteredList: [],
136
-      membersAdding: false,
137
-      decoratorMessage: COMETCHAT_CONSTANTS.LOADING_MESSSAGE,
138
-    };
139
-  },
140
-  computed: {
141
-    /**
142
-     * Computed styles for the component.
143
-     */
144
-    styles() {
145
-      return {
146
-        modalBody: style.modalBodyCtyle(),
147
-        modalTable: style.modalTableStyle(),
148
-        contactMsg: style.contactMsgStyle(),
149
-        tableSearch: style.tableSearchStyle(),
150
-        tableCaption: style.tableCaptionStyle(),
151
-        tableBody: style.tableBodyStyle(this.theme),
152
-        tableFoot: style.tableFootStyle(this.theme),
153
-        modalClose: style.modalCloseStyle(clearIcon),
154
-        contactMsgTxt: style.contactMsgTxtStyle(this.theme),
155
-        searchInput: style.searchInputStyle(this.theme, searchIcon),
156
-        modalWrapper: style.modalWrapperStyle(this.theme, this.open),
157
-      };
158
-    },
159
-    /**
160
-     * Local string constants.
161
-     */
162
-    STRINGS() {
163
-      return COMETCHAT_CONSTANTS;
164
-    },
165
-  },
166
-  methods: {
167
-    /**
168
-     * Updates a user
169
-     */
170
-    userUpdateHandler(user) {
171
-      try {
172
-        let userlist = [...this.userList];
173
-
174
-        let userKey = userlist.findIndex((u) => u.uid === user.uid);
175
-
176
-        if (userKey > -1) {
177
-          let userObj = userlist[userKey];
178
-          let newUserObj = Object.assign({}, userObj, user);
179
-          userlist.splice(userKey, 1, newUserObj);
180
-
181
-          this.userList = userlist;
182
-        }
183
-      } catch (error) {
184
-        this.logError("Error updating user", error);
185
-      }
186
-    },
187
-    /**
188
-     * Handles scroll in user list
189
-     */
190
-    scrollHandler(e) {
191
-      try {
192
-        const bottom =
193
-          Math.round(
194
-            e.currentTarget.scrollHeight - e.currentTarget.scrollTop
195
-          ) === Math.round(e.currentTarget.clientHeight);
196
-        if (bottom) {
197
-          this.getUsers();
198
-        }
199
-      } catch (error) {
200
-        this.logError("Error in scrollHandler", error);
201
-      }
202
-    },
203
-    searchUsers(event) {
204
-      try {
205
-        if (timeout) {
206
-          clearTimeout(timeout);
207
-        }
208
-
209
-        let val = event.target.value;
210
-        timeout = setTimeout(() => {
211
-          addMembersManager = new AddMembersManager(friendsOnly, val);
212
-
213
-          this.userList = [];
214
-          this.membersToAdd = [];
215
-          this.membersToRemove = [];
216
-
217
-          this.getUsers(true);
218
-        }, 500);
219
-      } catch (error) {
220
-        this.logError("Error in searching users", error);
221
-      }
222
-    },
223
-    async getUsers(search = false) {
224
-      try {
225
-        await new CometChatManager().getLoggedInUser();
226
-
227
-        const userList = await addMembersManager.fetchNextUsers();
228
-
229
-        userList.forEach((user) => (user = this.setAvatar(user)));
230
-
231
-        const filteredUserList = userList.filter((user) => {
232
-          const found = this.membersList.find(
233
-            (member) => user.uid === member.uid
234
-          );
235
-          const foundbanned = this.bannedMembersList.find(
236
-            (member) => user.uid === member.uid
237
-          );
238
-          if (found || foundbanned) {
239
-            return false;
240
-          }
241
-          return true;
242
-        });
243
-
244
-        if (filteredUserList.length === 0) {
245
-          this.decoratorMessage = COMETCHAT_CONSTANTS.ERROR_NO_USERS_FOUND;
246
-        }
247
-
248
-        if (search) {
249
-          this.userList = [...userList];
250
-          this.filteredList = [...filteredUserList];
251
-        } else {
252
-          this.userList = [...this.userList, ...userList];
253
-          this.filteredList = [...this.filteredList, ...filteredUserList];
254
-        }
255
-      } catch (error) {
256
-        this.decoratorMessage = COMETCHAT_CONSTANTS.ERROR;
257
-        this.logError(
258
-          "[CometChatAddGroupMemberList] getUsers fetchNext error",
259
-          error
260
-        );
261
-      }
262
-    },
263
-    setAvatar(user) {
264
-      if (!user.getAvatar()) {
265
-        const uid = user.getUid();
266
-        const char = user.getName().charAt(0).toUpperCase();
267
-        user.setAvatar(SvgAvatar.getAvatar(uid, char));
268
-      }
269
-    },
270
-    membersUpdated({ user, value }) {
271
-      try {
272
-        if (value) {
273
-          const members = [...this.membersToAdd];
274
-          members.push(user);
275
-
276
-          this.membersToAdd = [...members];
277
-        } else {
278
-          const membersToAdd = [...this.membersToAdd];
279
-          const index = membersToAdd.findIndex(
280
-            (member) => member.uid === user.uid
281
-          );
282
-          if (index > -1) {
283
-            membersToAdd.splice(index, 1);
284
-
285
-            this.membersToAdd = [...membersToAdd];
286
-          }
287
-        }
288
-      } catch (error) {
289
-        this.logError("Error in members updated", error);
290
-      }
291
-    },
292
-    async updateMembers() {
293
-      try {
294
-        const guid = this.item.guid;
295
-        const membersList = [];
296
-
297
-        this.membersToAdd.forEach((newmember) => {
298
-          const index = this.membersList.findIndex(
299
-            (member) => member.uid === newmember.uid
300
-          );
301
-          if (index === -1) {
302
-            const newMember = new CometChat.GroupMember(
303
-              newmember.uid,
304
-              CometChat.GROUP_MEMBER_SCOPE.PARTICIPANT
305
-            );
306
-            membersList.push(newMember);
307
-
308
-            newmember["type"] = "add";
309
-          }
310
-        });
311
-
312
-        if (membersList.length) {
313
-          const membersToAdd = [];
314
-          this.membersAdding = true;
315
-
316
-          try {
317
-            const response = await CometChat.addMembersToGroup(
318
-              guid,
319
-              membersList,
320
-              []
321
-            );
322
-
323
-            if (Object.keys(response).length) {
324
-              for (const member in response) {
325
-                if (response[member] === "success") {
326
-                  const found = this.userList.find(
327
-                    (user) => user.uid === member
328
-                  );
329
-                  found["scope"] = CometChat.GROUP_MEMBER_SCOPE.PARTICIPANT;
330
-                  membersToAdd.push(found);
331
-                }
332
-              }
333
-              this.emitAction("addGroupParticipants", {
334
-                members: membersToAdd,
335
-              });
336
-            }
337
-            this.emitEvent("close");
338
-          } catch (error) {
339
-            this.logError("addMembersToGroup failed with exception:", error);
340
-          } finally {
341
-            this.membersAdding = false;
342
-          }
343
-        }
344
-      } catch (error) {
345
-        this.logError("Error in update members", error);
346
-      }
347
-    },
348
-  },
349
-  beforeMount() {
350
-    if (this.friendsOnly) {
351
-      friendsOnly = this.friendsOnly;
352
-    }
353
-
354
-    addMembersManager = new AddMembersManager(this.friendsOnly);
355
-
356
-    this.getUsers();
357
-    addMembersManager.attachListeners(this.userUpdateHandler);
358
-  },
359
-  beforeDestroy() {
360
-    if (addMembersManager) {
361
-      addMembersManager.removeListeners();
362
-      addMembersManager = null;
363
-    }
364
-  },
365
-  beforeUnmount() {
366
-    if (addMembersManager) {
367
-      addMembersManager.removeListeners();
368
-      addMembersManager = null;
369
-    }
370
-  },
371
-};
372
-</script>
373
-<style scoped>
374
-@media (min-width: 320px) and (max-width: 767px) {
375
-  .cometchat__add__members__wrapper {
376
-    width: 100% !important;
377
-    height: 100% !important;
378
-  }
379
-  .cometchat__add__members__table {
380
-    height: 100% !important;
381
-  }
382
-}
383
-</style>

+ 0
- 50
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatAddGroupMemberList/controller.js 파일 보기

@@ -1,50 +0,0 @@
1
-import { CometChat } from "@cometchat-pro/chat";
2
-
3
-/**
4
- * AddMembersManager class encapsulates the following functionality:
5
- * - fetching of User list
6
- * - attaching User listener
7
- */
8
-export class AddMembersManager {
9
-  membersRequest = null;
10
-  userListenerId = new Date().getTime();
11
-
12
-  constructor(friendsOnly, searchKey) {
13
-    if (searchKey) {
14
-      this.membersRequest = new CometChat.UsersRequestBuilder()
15
-        .setLimit(30)
16
-        .friendsOnly(friendsOnly)
17
-        .setSearchKeyword(searchKey)
18
-        .build();
19
-    } else {
20
-      this.membersRequest = new CometChat.UsersRequestBuilder()
21
-        .setLimit(30)
22
-        .friendsOnly(friendsOnly)
23
-        .build();
24
-    }
25
-  }
26
-
27
-  fetchNextUsers() {
28
-    return this.membersRequest.fetchNext();
29
-  }
30
-
31
-  attachListeners(callback) {
32
-    CometChat.addUserListener(
33
-      this.userListenerId,
34
-      new CometChat.UserListener({
35
-        onUserOnline: (onlineUser) => {
36
-          /* when someuser/friend comes online, user will be received here */
37
-          callback(onlineUser);
38
-        },
39
-        onUserOffline: (offlineUser) => {
40
-          /* when someuser/friend went offline, user will be received here */
41
-          callback(offlineUser);
42
-        },
43
-      })
44
-    );
45
-  }
46
-
47
-  removeListeners() {
48
-    CometChat.removeUserListener(this.userListenerId);
49
-  }
50
-}

BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatAddGroupMemberList/resources/close.png 파일 보기


BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatAddGroupMemberList/resources/search-grey-icon.png 파일 보기


+ 0
- 144
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatAddGroupMemberList/style.js 파일 보기

@@ -1,144 +0,0 @@
1
-export const modalWrapperStyle = (theme, open) => {
2
-  const show = open
3
-    ? {
4
-        display: "block",
5
-      }
6
-    : {};
7
-
8
-  return {
9
-    minWidth: "350px",
10
-    minHeight: "450px",
11
-    width: "40%",
12
-    height: "40%",
13
-    overflow: "hidden",
14
-    backgroundColor: `${theme.backgroundColor.white}`,
15
-    position: "fixed",
16
-    left: "50%",
17
-    top: "50%",
18
-    transform: "translate(-50%, -50%)",
19
-    zIndex: "1002",
20
-    margin: "0 auto",
21
-    boxShadow:
22
-      "rgba(20, 20, 20, 0.2) 0 16px 32px, rgba(20, 20, 20, 0.04) 0 0 0 1px",
23
-    borderRadius: "12px",
24
-    display: "none",
25
-    ...show,
26
-  };
27
-};
28
-
29
-export const modalCloseStyle = (img) => {
30
-  return {
31
-    position: "absolute",
32
-    width: "32px",
33
-    height: "32px",
34
-    borderRadius: "50%",
35
-    top: "20px",
36
-    right: "16px",
37
-    background: `url(${img}) center center / 18px no-repeat`,
38
-    cursor: "pointer",
39
-  };
40
-};
41
-
42
-export const modalBodyCtyle = () => {
43
-  return {
44
-    padding: "25px",
45
-    height: "100%",
46
-    width: "100%",
47
-  };
48
-};
49
-
50
-export const modalTableStyle = () => {
51
-  return {
52
-    borderCollapse: "collapse",
53
-    margin: "0",
54
-    padding: "0",
55
-    width: "100%",
56
-    height: "80%",
57
-  };
58
-};
59
-
60
-export const tableCaptionStyle = () => {
61
-  return {
62
-    fontSize: "20px",
63
-    marginBottom: "15px",
64
-    fontWeight: "bold",
65
-    textAlign: "left",
66
-  };
67
-};
68
-
69
-export const tableSearchStyle = () => {
70
-  return {
71
-    fontWeight: "normal",
72
-    marginBottom: "15px",
73
-  };
74
-};
75
-
76
-export const searchInputStyle = (theme, img) => {
77
-  return {
78
-    width: "100%",
79
-    border: "0",
80
-    boxShadow: "rgba(20, 20, 20, 0.04) 0 0 0 1px inset",
81
-    borderRadius: "8px",
82
-    padding: "6px 8px 6px 35px",
83
-    fontSize: "15px",
84
-    outline: "none",
85
-    color: `${theme.color.primary}`,
86
-    background: `url(${img}) 10px center / 16px no-repeat ${theme.backgroundColor.grey}`,
87
-  };
88
-};
89
-
90
-export const tableBodyStyle = (theme) => {
91
-  return {
92
-    height: "100%",
93
-    overflowY: "auto",
94
-    display: "block",
95
-    tr: {
96
-      border: `1px solid ${theme.borderColor.primary}`,
97
-      display: "table",
98
-      width: "100%",
99
-      tableLayout: "fixed",
100
-    },
101
-  };
102
-};
103
-
104
-export const tableFootStyle = (theme) => {
105
-  return {
106
-    button: {
107
-      cursor: "pointer",
108
-      padding: "10px 20px",
109
-      backgroundColor: `${theme.backgroundColor.blue}`,
110
-      borderRadius: "5px",
111
-      color: `${theme.color.white}`,
112
-      fontSize: "14px",
113
-      outline: "0",
114
-      border: "0",
115
-    },
116
-    tr: {
117
-      border: "none",
118
-    },
119
-    td: {
120
-      textAlign: "center",
121
-    },
122
-  };
123
-};
124
-
125
-export const contactMsgStyle = () => {
126
-  return {
127
-    overflow: "hidden",
128
-    width: "100%",
129
-    display: "flex",
130
-    justifyContent: "center",
131
-    alignItems: "center",
132
-    height: "55%",
133
-  };
134
-};
135
-
136
-export const contactMsgTxtStyle = (theme) => {
137
-  return {
138
-    margin: "0",
139
-    height: "30px",
140
-    color: `${theme.color.secondary}`,
141
-    fontSize: "24px!important",
142
-    fontWeight: "600",
143
-  };
144
-};

+ 0
- 118
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatAddGroupMemberListItem/CometChatAddGroupMemberListItem.vue 파일 보기

@@ -1,118 +0,0 @@
1
-<template>
2
-  <tr :style="styles.tableRow" class="addmembers__table__row">
3
-    <td
4
-      :style="styles.tableColumn"
5
-      @mouseenter="toggleTooltip($event, true)"
6
-      @mouseleave="toggleTooltip($event, false)"
7
-    >
8
-      <div :style="styles.avatar">
9
-        <comet-chat-avatar
10
-          border-width="1px"
11
-          corner-radius="50%"
12
-          :image="user.avatar"
13
-          :border-color="theme.borderColor.primary"
14
-        />
15
-        <comet-chat-user-presence
16
-          border-width="1px"
17
-          corner-radius="50%"
18
-          :status="user.status"
19
-          :border-color="theme.borderColor.primary"
20
-        />
21
-      </div>
22
-      <div :style="styles.name">{{ user.name }}</div>
23
-    </td>
24
-    <td :style="styles.selectionColumn">
25
-      <input
26
-        :id="user.uid"
27
-        type="checkbox"
28
-        :checked="checked"
29
-        class="addmember__checkbox"
30
-        :style="styles.selectionBox"
31
-        @change="checkHandler"
32
-      />
33
-      <label :style="styles.selectionBox.label" :for="user.uid">&nbsp;</label>
34
-    </td>
35
-  </tr>
36
-</template>
37
-<script>
38
-import {
39
-  DEFAULT_ARRAY_PROP,
40
-  DEFAULT_OBJECT_PROP,
41
-} from "../../../resources/constants";
42
-
43
-import { tooltip, cometChatCommon } from "../../../mixins/";
44
-
45
-import { CometChatAvatar, CometChatUserPresence } from "../../Shared";
46
-
47
-import * as style from "./style";
48
-
49
-import inactiveIcon from "./resources/checkbox-inactive.svg";
50
-import activeIcon from "./resources/checkbox-blue-active.svg";
51
-
52
-/**
53
- * List item for add group members list.
54
- *
55
- * @displayName CometChatAddGroupMemberListItem
56
- */
57
-export default {
58
-  name: "CometChatAddGroupMemberListItem",
59
-  mixins: [tooltip, cometChatCommon],
60
-  components: {
61
-    CometChatAvatar,
62
-    CometChatUserPresence,
63
-  },
64
-  props: {
65
-    /**
66
-     * User object.
67
-     */
68
-    user: { ...DEFAULT_OBJECT_PROP },
69
-    /**
70
-     * Theme of the UI.
71
-     */
72
-    theme: { ...DEFAULT_OBJECT_PROP },
73
-    /**
74
-     * List of all members.
75
-     */
76
-    members: { ...DEFAULT_ARRAY_PROP },
77
-  },
78
-  data() {
79
-    return {
80
-      checked: false,
81
-    };
82
-  },
83
-  computed: {
84
-    /**
85
-     * Computed styles for the component.
86
-     */
87
-    styles() {
88
-      return {
89
-        name: style.nameStyle(),
90
-        avatar: style.avatarStyle(),
91
-        tableColumn: style.tableColumnStyle(),
92
-        tableRow: style.tableRowStyle(this.theme),
93
-        selectionColumn: style.selectionColumnStyle(),
94
-        selectionBox: style.selectionBoxStyle(inactiveIcon, activeIcon),
95
-      };
96
-    },
97
-  },
98
-  methods: {
99
-    /**
100
-     * Handles checkbox input
101
-     */
102
-    checkHandler() {
103
-      this.checked = !this.checked;
104
-
105
-      this.emitEvent("change", { user: this.user, value: this.checked });
106
-    },
107
-  },
108
-};
109
-</script>
110
-<style scoped>
111
-.addmembers__table__row:not(:first-of-type) {
112
-  border-top: none !important;
113
-}
114
-.addmember__checkbox:checked + label {
115
-  background: var(--active-state-background) !important;
116
-  background-size: 16px;
117
-}
118
-</style>

+ 0
- 1
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatAddGroupMemberListItem/resources/checkbox-blue-active.svg 파일 보기

@@ -1 +0,0 @@
1
-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><g><g><path fill="#39f" d="M0 5a5 5 0 0 1 5-5h6a5 5 0 0 1 5 5v6a5 5 0 0 1-5 5H5a5 5 0 0 1-5-5z"/></g><g><path fill="#fff" d="M10.7 4.4a1 1 0 0 1 1.67 1.095l-.07.105-4.5 6a1 1 0 0 1-1.481.133l-.087-.093-2.5-3a1 1 0 0 1 1.45-1.372l.086.092 1.69 2.027z"/></g></g></svg>

+ 0
- 16
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatAddGroupMemberListItem/resources/checkbox-inactive.svg 파일 보기

@@ -1,16 +0,0 @@
1
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="22" height="22" viewBox="0 0 22 22">
2
-    <defs>
3
-        <path id="a" d="M1.99 0C.892 0 0 .898 0 1.99v16.02C0 19.108.898 20 1.99 20h16.02c1.099 0 1.99-.898 1.99-1.99V1.99C20 .892 19.102 0 18.01 0H1.99z"/>
4
-        <filter id="b" width="115%" height="115%" x="-7.5%" y="-7.5%" filterUnits="objectBoundingBox">
5
-            <feGaussianBlur in="SourceAlpha" result="shadowBlurInner1" stdDeviation=".5"/>
6
-            <feOffset in="shadowBlurInner1" result="shadowOffsetInner1"/>
7
-            <feComposite in="shadowOffsetInner1" in2="SourceAlpha" k2="-1" k3="1" operator="arithmetic" result="shadowInnerInner1"/>
8
-            <feColorMatrix in="shadowInnerInner1" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.5 0"/>
9
-        </filter>
10
-    </defs>
11
-    <g fill="none" fill-rule="evenodd" transform="translate(1 1)">
12
-        <use fill="#FFF" xlink:href="#a"/>
13
-        <use fill="#000" filter="url(#b)" xlink:href="#a"/>
14
-        <path stroke="#969696" d="M1.99-.5h16.02c1.37 0 2.49 1.117 2.49 2.49v16.02c0 1.37-1.117 2.49-2.49 2.49H1.99A2.495 2.495 0 0 1-.5 18.01V1.99C-.5.62.617-.5 1.99-.5z"/>
15
-    </g>
16
-</svg>

+ 0
- 58
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatAddGroupMemberListItem/style.js 파일 보기

@@ -1,58 +0,0 @@
1
-export const tableRowStyle = (theme) => {
2
-  return {
3
-    border: `1px solid ${theme.borderColor.primary}`,
4
-    display: "table",
5
-    width: "100%",
6
-    tableLayout: "fixed",
7
-    fontSize: "14px",
8
-  };
9
-};
10
-
11
-export const tableColumnStyle = () => {
12
-  return {
13
-    padding: "8px",
14
-    width: "100%",
15
-  };
16
-};
17
-
18
-export const avatarStyle = () => {
19
-  return {
20
-    display: "inline-block",
21
-    float: "left",
22
-    width: "36px",
23
-    height: "36px",
24
-    marginRight: "8px",
25
-  };
26
-};
27
-
28
-export const nameStyle = () => {
29
-  return {
30
-    margin: "10px",
31
-    width: "calc(100% - 50px)",
32
-    overflow: "hidden",
33
-    textOverflow: "ellipsis",
34
-    whiteSpace: "nowrap",
35
-  };
36
-};
37
-
38
-export const selectionColumnStyle = () => {
39
-  return {
40
-    padding: "8px",
41
-    width: "50px",
42
-  };
43
-};
44
-
45
-export const selectionBoxStyle = (inactiveStateImg, activeStateImg) => {
46
-  return {
47
-    display: "none",
48
-    label: {
49
-      display: "block",
50
-      cursor: "pointer",
51
-      background: `url(${inactiveStateImg}) right center / 16px no-repeat`,
52
-      "--active-state-background": `url(${activeStateImg}) no-repeat right center`,
53
-      userSelect: "none",
54
-      float: "right",
55
-      padding: ".625em",
56
-    },
57
-  };
58
-};

+ 0
- 199
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatBanGroupMemberList/CometChatBanGroupMemberList.vue 파일 보기

@@ -1,199 +0,0 @@
1
-<template>
2
-  <div>
3
-    <comet-chat-backdrop :show="open" @click="emitEvent('close')" />
4
-    <div :style="styles.modalWrapper" class="cometchat__modal__banmembers">
5
-      <span :style="styles.modalClose" @click="emitEvent('close')"></span>
6
-      <div :style="styles.modalBody">
7
-        <table :style="styles.modalTable">
8
-          <caption :style="styles.tableCaption">
9
-            {{
10
-              STRINGS.BANNED_MEMBERS
11
-            }}
12
-          </caption>
13
-          <thead>
14
-            <tr :style="styles.modalTable.tr">
15
-              <th :style="styles.modalTable.th">Name</th>
16
-              <th
17
-                :style="{ ...styles.modalTable.th, ...styles.roleColumn }"
18
-                class="tablehead__rolecolumn"
19
-              >
20
-                {{ STRINGS.SCOPE }}
21
-              </th>
22
-              <th :style="{ ...styles.modalTable.th, ...styles.actionColumn }">
23
-                {{ STRINGS.UNBAN }}
24
-              </th>
25
-            </tr>
26
-          </thead>
27
-          <caption
28
-            :style="styles.contactMsg"
29
-            v-if="bannedMembersList.length === 0"
30
-          >
31
-            <p :style="styles.contactMsgTxt">{{ decoratorMessage }}</p>
32
-          </caption>
33
-          <tbody :style="styles.tableBody" @scroll="scrollHandler">
34
-            <!-- eslint-disable -->
35
-            <template 
36
-              v-for="(member, i) in bannedMembersList"
37
-            >
38
-              <comet-chat-ban-group-member-list-item
39
-                :item="item"
40
-                :theme="theme"
41
-                :member="member"
42
-                :logged-in-user="loggedInUser"
43
-                @action="memberUpdateHandler"
44
-              />
45
-            </template>
46
-          </tbody>
47
-        </table>
48
-      </div>
49
-    </div>
50
-  </div>
51
-</template>
52
-<script>
53
-import { CometChat } from "@cometchat-pro/chat";
54
-
55
-import {
56
-  COMETCHAT_CONSTANTS,
57
-  DEFAULT_ARRAY_PROP,
58
-  DEFAULT_OBJECT_PROP,
59
-  DEFAULT_BOOLEAN_PROP,
60
-} from "../../../resources/constants";
61
-
62
-import { cometChatCommon } from "../../../mixins/";
63
-
64
-import { CometChatBackdrop } from "../../Shared/";
65
-import CometChatBanGroupMemberListItem from "../CometChatBanGroupMemberListItem/CometChatBanGroupMemberListItem";
66
-
67
-import * as style from "./style";
68
-
69
-import clearIcon from "./resources/close.png";
70
-
71
-/**
72
- * Displays list of banned group members.
73
- *
74
- * @displayName CometChatBanGroupMemberList
75
- */
76
-export default {
77
-  name: "CometChatBanGroupMemberList",
78
-  mixins: [cometChatCommon],
79
-  components: {
80
-    CometChatBackdrop,
81
-    CometChatBanGroupMemberListItem,
82
-  },
83
-  props: {
84
-    /**
85
-     * The selected chat item object.
86
-     */
87
-    item: { ...DEFAULT_OBJECT_PROP },
88
-    /**
89
-     * Opens the modal.
90
-     */
91
-    open: { ...DEFAULT_BOOLEAN_PROP },
92
-    /**
93
-     * Theme of the UI.
94
-     */
95
-    theme: { ...DEFAULT_OBJECT_PROP },
96
-    /**
97
-     * Current logged in user.
98
-     */
99
-    loggedInUser: { ...DEFAULT_OBJECT_PROP },
100
-    /**
101
-     * List of banned group members.
102
-     */
103
-    bannedMembersList: { ...DEFAULT_ARRAY_PROP },
104
-  },
105
-  computed: {
106
-    /**
107
-     * Computed styles for the component.
108
-     */
109
-    styles() {
110
-      return {
111
-        tableBody: style.tableBodyStyle(),
112
-        modalBody: style.modalBodyStyle(),
113
-        contactMsg: style.contactMsgStyle(),
114
-        roleColumn: style.roleColumnStyle(),
115
-        actionColumn: style.actionColumnStyle(),
116
-        tableCaption: style.tableCaptionStyle(),
117
-        modalClose: style.modalCloseStyle(clearIcon),
118
-        modalTable: style.modalTableStyle(this.theme),
119
-        contactMsgTxt: style.contactMsgTxtStyle(this.theme),
120
-        modalWrapper: style.modalWrapperStyle(this.theme, this.open),
121
-      };
122
-    },
123
-    /**
124
-     * Computed decorator message.
125
-     */
126
-    decoratorMessage() {
127
-      return this.bannedMembersList.length === 0
128
-        ? COMETCHAT_CONSTANTS.NO_BANNED_MEMBERS_FOUND
129
-        : COMETCHAT_CONSTANTS.LOADING_MESSSAGE;
130
-    },
131
-    /**
132
-     * Local string constants.
133
-     */
134
-    STRINGS() {
135
-      return COMETCHAT_CONSTANTS;
136
-    },
137
-  },
138
-  methods: {
139
-    /**
140
-     * Unbans a member
141
-     */
142
-    async unbanMember(memberToUnBan) {
143
-      try {
144
-        const guid = this.item.guid;
145
-        const response = await CometChat.unbanGroupMember(
146
-          guid,
147
-          memberToUnBan.uid
148
-        );
149
-
150
-        if (response) {
151
-          this.emitAction("unbanGroupMembers", { members: [memberToUnBan] });
152
-        }
153
-      } catch (error) {
154
-        this.logError("Group member banning failed with error", error);
155
-      }
156
-    },
157
-    /**
158
-     * Handles action emitted by list item
159
-     */
160
-    memberUpdateHandler({ action, member }) {
161
-      switch (action) {
162
-        case "unBan":
163
-          this.unbanMember(member);
164
-          break;
165
-        default:
166
-          break;
167
-      }
168
-    },
169
-    /**
170
-     * Handles list scroll
171
-     */
172
-    scrollHandler(e) {
173
-      try {
174
-        const bottom =
175
-          Math.round(
176
-            e.currentTarget.scrollHeight - e.currentTarget.scrollTop
177
-          ) === Math.round(e.currentTarget.clientHeight);
178
-
179
-        if (bottom) {
180
-          this.emitAction("fetchBannedMembers");
181
-        }
182
-      } catch (error) {
183
-        this.logError("Error in scroll", error);
184
-      }
185
-    },
186
-  },
187
-};
188
-</script>
189
-<style scoped>
190
-@media (min-width: 320px) and (max-width: 767px) {
191
-  .cometchat__modal__banmembers {
192
-    width: 100% !important;
193
-    height: 100% !important;
194
-  }
195
-  .tablehead__rolecolumn {
196
-    width: 115px !important;
197
-  }
198
-}
199
-</style>

BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatBanGroupMemberList/resources/close.png 파일 보기


+ 0
- 119
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatBanGroupMemberList/style.js 파일 보기

@@ -1,119 +0,0 @@
1
-export const modalWrapperStyle = (theme, open) => {
2
-  const show = open
3
-    ? {
4
-        display: "block",
5
-      }
6
-    : {};
7
-
8
-  return {
9
-    minWidth: "350px",
10
-    minHeight: "450px",
11
-    width: "40%",
12
-    height: "40%",
13
-    overflow: "hidden",
14
-    backgroundColor: `${theme.backgroundColor.white}`,
15
-    position: "fixed",
16
-    left: "50%",
17
-    top: "50%",
18
-    transform: "translate(-50%, -50%)",
19
-    zIndex: "1002",
20
-    margin: "0 auto",
21
-    boxShadow:
22
-      "rgba(20, 20, 20, 0.2) 0 16px 32px, rgba(20, 20, 20, 0.04) 0 0 0 1px",
23
-    borderRadius: "12px",
24
-    display: "none",
25
-    ...show,
26
-  };
27
-};
28
-
29
-export const modalCloseStyle = (img) => {
30
-  return {
31
-    position: "absolute",
32
-    width: "32px",
33
-    height: "32px",
34
-    borderRadius: "50%",
35
-    top: "20px",
36
-    right: "16px",
37
-    background: `url(${img}) center center / 18px no-repeat`,
38
-    cursor: "pointer",
39
-  };
40
-};
41
-
42
-export const modalBodyStyle = () => {
43
-  return {
44
-    padding: "25px",
45
-    height: "100%",
46
-    width: "100%",
47
-  };
48
-};
49
-
50
-export const modalTableStyle = (theme) => {
51
-  return {
52
-    borderCollapse: "collapse",
53
-    margin: "0",
54
-    padding: "0",
55
-    width: "100%",
56
-    height: "90%",
57
-    tr: {
58
-      border: `1px solid ${theme.borderColor.primary}`,
59
-      display: "table",
60
-      width: "100%",
61
-      tableLayout: "fixed",
62
-    },
63
-    th: {
64
-      padding: "8px",
65
-      fontSize: "12px",
66
-      textAlign: "left",
67
-    },
68
-  };
69
-};
70
-
71
-export const tableCaptionStyle = () => {
72
-  return {
73
-    fontSize: "20px",
74
-    marginBottom: "15px",
75
-    fontWeight: "bold",
76
-    textAlign: "left",
77
-  };
78
-};
79
-
80
-export const tableBodyStyle = () => {
81
-  return {
82
-    height: "340px",
83
-    overflowY: "auto",
84
-    display: "block",
85
-  };
86
-};
87
-
88
-export const roleColumnStyle = () => {
89
-  return {
90
-    width: "150px",
91
-  };
92
-};
93
-
94
-export const actionColumnStyle = () => {
95
-  return {
96
-    width: "70px",
97
-  };
98
-};
99
-
100
-export const contactMsgStyle = () => {
101
-  return {
102
-    overflow: "hidden",
103
-    width: "100%",
104
-    display: "flex",
105
-    justifyContent: "center",
106
-    alignItems: "center",
107
-    height: "55%",
108
-  };
109
-};
110
-
111
-export const contactMsgTxtStyle = (theme) => {
112
-  return {
113
-    margin: "0",
114
-    height: "30px",
115
-    color: `${theme.color.secondary}`,
116
-    fontSize: "24px!important",
117
-    fontWeight: "600",
118
-  };
119
-};

+ 0
- 147
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatBanGroupMemberListItem/CometChatBanGroupMemberListItem.vue 파일 보기

@@ -1,147 +0,0 @@
1
-<template>
2
-  <tr :style="styles.tableRow" class="banmembers__table__row">
3
-    <td
4
-      :style="styles.tableRow.td"
5
-      @mouseenter="toggleTooltip($event, true)"
6
-      @mouseleave="toggleTooltip($event, false)"
7
-    >
8
-      <div :style="styles.avatar">
9
-        <comet-chat-avatar
10
-          border-width="1px"
11
-          corner-radius="50%"
12
-          :image="member.avatar"
13
-          :border-color="theme.borderColor.primary"
14
-        />
15
-        <comet-chat-user-presence
16
-          border-width="1px"
17
-          corner-radius="50%"
18
-          :status="member.status"
19
-          :border-color="theme.borderColor.primary"
20
-        />
21
-      </div>
22
-      <div :style="styles.name">{{ member.name }}</div>
23
-    </td>
24
-    <td :style="{ ...styles.tableRow.td, ...styles.role }">
25
-      {{ roles[member.scope] }}
26
-    </td>
27
-    <td :style="{ ...styles.tableRow.td, ...styles.action }">
28
-      <img
29
-        v-if="canUnBan"
30
-        :src="unbanImage"
31
-        :alt="STRINGS.UNBAN"
32
-        :style="styles.action.img"
33
-        @click="emitAction('unBan', { member })"
34
-      />
35
-    </td>
36
-  </tr>
37
-</template>
38
-<script>
39
-import { CometChat } from "@cometchat-pro/chat";
40
-
41
-import {
42
-  COMETCHAT_CONSTANTS,
43
-  DEFAULT_OBJECT_PROP,
44
-} from "../../../resources/constants";
45
-
46
-import { cometChatCommon, tooltip } from "../../../mixins/";
47
-
48
-import { CometChatAvatar, CometChatUserPresence } from "../../Shared";
49
-
50
-import * as style from "./style";
51
-
52
-import unban from "./resources/block.png";
53
-
54
-/**
55
- * List item for ban group member list.
56
- *
57
- * @displayName CometChatBanGroupMemberListItem
58
- */
59
-export default {
60
-  name: "CometChatBanGroupMemberListItem",
61
-  mixins: [tooltip, cometChatCommon],
62
-  components: {
63
-    CometChatAvatar,
64
-    CometChatUserPresence,
65
-  },
66
-  props: {
67
-    /**
68
-     * The selected chat item object.
69
-     */
70
-    item: { ...DEFAULT_OBJECT_PROP },
71
-    /**
72
-     * Theme of the UI.
73
-     */
74
-    theme: { ...DEFAULT_OBJECT_PROP },
75
-    /**
76
-     * Member object.
77
-     */
78
-    member: { ...DEFAULT_OBJECT_PROP },
79
-    /**
80
-     * Current logged in user.
81
-     */
82
-    loggedInUser: { ...DEFAULT_OBJECT_PROP },
83
-  },
84
-  computed: {
85
-    /**
86
-     * Computed styles for the component.
87
-     */
88
-    styles() {
89
-      return {
90
-        name: style.nameStyle(),
91
-        role: style.roleStyle(),
92
-        action: style.actionStyle(),
93
-        avatar: style.avatarStyle(),
94
-        tableRow: style.tableRowStyle(this.theme),
95
-      };
96
-    },
97
-    /**
98
-     * Local string constants.
99
-     */
100
-    STRINGS() {
101
-      return COMETCHAT_CONSTANTS;
102
-    },
103
-    /**
104
-     * Unban icon image.
105
-     */
106
-    unbanImage() {
107
-      return unban;
108
-    },
109
-    /**
110
-     * Computed member roles.
111
-     */
112
-    roles() {
113
-      return {
114
-        [CometChat.GROUP_MEMBER_SCOPE.ADMIN]: COMETCHAT_CONSTANTS.ADMINISTRATOR,
115
-        [CometChat.GROUP_MEMBER_SCOPE.MODERATOR]: COMETCHAT_CONSTANTS.MODERATOR,
116
-        [CometChat.GROUP_MEMBER_SCOPE.PARTICIPANT]:
117
-          COMETCHAT_CONSTANTS.PARTICIPANT,
118
-      };
119
-    },
120
-    /**
121
-     * Computes if can unban.
122
-     */
123
-    canUnBan() {
124
-      let unBan = true;
125
-
126
-      if (
127
-        this.item.scope === CometChat.GROUP_MEMBER_SCOPE.MODERATOR &&
128
-        (this.member.scope === CometChat.GROUP_MEMBER_SCOPE.ADMIN ||
129
-          this.member.scope === CometChat.GROUP_MEMBER_SCOPE.MODERATOR)
130
-      ) {
131
-        unBan = false;
132
-      }
133
-
134
-      if (
135
-        this.item.scope === CometChat.GROUP_MEMBER_SCOPE.ADMIN &&
136
-        this.member.scope === CometChat.GROUP_MEMBER_SCOPE.ADMIN
137
-      ) {
138
-        if (this.item.owner !== this.loggedInUser.uid) {
139
-          unBan = false;
140
-        }
141
-      }
142
-
143
-      return unBan;
144
-    },
145
-  },
146
-};
147
-</script>

BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatBanGroupMemberListItem/resources/block.png 파일 보기


+ 0
- 55
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatBanGroupMemberListItem/style.js 파일 보기

@@ -1,55 +0,0 @@
1
-export const tableRowStyle = (theme) => {
2
-  return {
3
-    border: `1px solid ${theme.borderColor.primary}`,
4
-    borderTop: "none",
5
-    display: "table",
6
-    width: "100%",
7
-    tableLayout: "fixed",
8
-    fontSize: "14px",
9
-    td: {
10
-      padding: ".625em",
11
-    },
12
-  };
13
-};
14
-
15
-export const avatarStyle = () => {
16
-  return {
17
-    display: "inline-block",
18
-    float: "left",
19
-    width: "36px",
20
-    height: "36px",
21
-    marginRight: "8px",
22
-    span: {
23
-      top: "26px",
24
-      left: "-8px",
25
-    },
26
-  };
27
-};
28
-
29
-export const nameStyle = () => {
30
-  return {
31
-    margin: "10px",
32
-    width: "calc(100% - 50px)",
33
-    overflow: "hidden",
34
-    textOverflow: "ellipsis",
35
-    whiteSpace: "nowrap",
36
-  };
37
-};
38
-
39
-export const roleStyle = () => {
40
-  return {
41
-    width: "150px",
42
-    fontSize: "12px",
43
-  };
44
-};
45
-
46
-export const actionStyle = () => {
47
-  return {
48
-    width: "70px",
49
-    img: {
50
-      width: "20px!important",
51
-      height: "20px!important",
52
-      cursor: "pointer",
53
-    },
54
-  };
55
-};

+ 0
- 297
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatCreateGroup/CometChatCreateGroup.vue 파일 보기

@@ -1,297 +0,0 @@
1
-<template>
2
-  <div>
3
-    <comet-chat-backdrop :show="open" @click="closeModal" />
4
-    <div :style="styles.modalWrapper" class="modal__creategroup__wrapper">
5
-      <span :style="styles.modalClose" @click="closeModal"></span>
6
-      <div :style="styles.modalBody">
7
-        <table class="modal__creategroup__table" :style="styles.modalTable">
8
-          <caption :style="styles.caption">
9
-            {{
10
-              STRINGS.CREATE_GROUP
11
-            }}
12
-          </caption>
13
-          <tbody
14
-            :style="styles.tableBody"
15
-            class="modal__creategroup__table__body"
16
-          >
17
-            <tr class="error">
18
-              <td>
19
-                <div :style="styles.tableError">
20
-                  {{ error }}
21
-                </div>
22
-              </td>
23
-            </tr>
24
-            <tr>
25
-              <td>
26
-                <input
27
-                  type="text"
28
-                  tabIndex="1"
29
-                  v-model="name"
30
-                  autocomplete="off"
31
-                  placeholder="Enter group name"
32
-                  :style="styles.input"
33
-                />
34
-              </td>
35
-            </tr>
36
-            <tr>
37
-              <td>
38
-                <select tabIndex="2" v-model="type" :style="styles.input">
39
-                  <option value="">{{ STRINGS.SELECT_GROUP_TYPE }}</option>
40
-                  <option value="public">{{ STRINGS.PUBLIC }}</option>
41
-                  <option value="private">{{ STRINGS.PRIVATE }}</option>
42
-                  <option value="protected">
43
-                    {{ STRINGS.PASSWORD_PROTECTED }}
44
-                  </option>
45
-                </select>
46
-              </td>
47
-            </tr>
48
-            <tr v-if="isPasswordInput">
49
-              <td>
50
-                <input
51
-                  tabIndex="3"
52
-                  type="password"
53
-                  autoComplete="off"
54
-                  v-model="password"
55
-                  :style="styles.input"
56
-                  :placeholder="STRINGS.ENTER_GROUP_PASSWORD"
57
-                />
58
-              </td>
59
-            </tr>
60
-          </tbody>
61
-          <tfoot :style="{ display: 'inline-block' }">
62
-            <tr :style="{ border: 'none' }">
63
-              <td :style="{ textAlign: 'center' }">
64
-                <button
65
-                  tabIndex="4"
66
-                  :disabled="creatingGroup"
67
-                  @click="createGroupHandler"
68
-                  :style="styles.tableButton"
69
-                >
70
-                  {{
71
-                    creatingGroup ? STRINGS.CREATING_MESSSAGE : STRINGS.CREATE
72
-                  }}
73
-                </button>
74
-              </td>
75
-            </tr>
76
-          </tfoot>
77
-        </table>
78
-      </div>
79
-    </div>
80
-  </div>
81
-</template>
82
-<script>
83
-import { CometChat } from "@cometchat-pro/chat";
84
-
85
-import {
86
-  COMETCHAT_CONSTANTS,
87
-  DEFAULT_OBJECT_PROP,
88
-  DEFAULT_BOOLEAN_PROP,
89
-} from "../../../resources/constants";
90
-import { cometChatCommon } from "../../../mixins";
91
-
92
-import { CometChatBackdrop } from "../../Shared";
93
-
94
-import closeIcon from "./resources/close.png";
95
-
96
-import * as style from "./style";
97
-
98
-/**
99
- * Modal used to create a group.
100
- *
101
- * @displayName CometChatCreateGroup
102
- */
103
-export default {
104
-  name: "CometChatCreateGroup",
105
-  mixins: [cometChatCommon],
106
-  components: {
107
-    CometChatBackdrop,
108
-  },
109
-  props: {
110
-    /**
111
-     * Opens the modal.
112
-     */
113
-    open: { ...DEFAULT_BOOLEAN_PROP },
114
-    /**
115
-     * Theme of the UI.
116
-     */
117
-    theme: { ...DEFAULT_OBJECT_PROP },
118
-  },
119
-  data() {
120
-    return {
121
-      name: "",
122
-      type: "",
123
-      error: null,
124
-      password: "",
125
-      creatingGroup: false,
126
-      isPasswordInput: false,
127
-    };
128
-  },
129
-  computed: {
130
-    /**
131
-     * Computed group name.
132
-     */
133
-    groupName() {
134
-      return this.name.trim();
135
-    },
136
-    /**
137
-     * Computed group type.
138
-     */
139
-    groupType() {
140
-      return this.type.trim();
141
-    },
142
-    /**
143
-     * Computed styles for the component.
144
-     */
145
-    styles() {
146
-      return {
147
-        modalBody: style.modalBodyStyle(),
148
-        tableBody: style.tableBodyStyle(),
149
-        caption: style.tableCaptionStyle(),
150
-        modalTable: style.modalTableStyle(),
151
-        tableError: style.tableErrorStyle(),
152
-        input: style.inputStyle(this.theme),
153
-        modalClose: style.modalCloseStyle(closeIcon),
154
-        tableButton: style.tableButtonStyle(this.theme),
155
-        modalWrapper: style.modalWrapperStyle(this.theme, this.open),
156
-      };
157
-    },
158
-    /**
159
-     * Local string constants.
160
-     */
161
-    STRINGS() {
162
-      return COMETCHAT_CONSTANTS;
163
-    },
164
-  },
165
-  watch: {
166
-    /**
167
-     * Toggles isPasswordInput on value change
168
-     */
169
-    type: {
170
-      handler(value) {
171
-        this.isPasswordInput = value === "protected";
172
-      },
173
-    },
174
-  },
175
-  methods: {
176
-    /**
177
-     * Handles group creation
178
-     */
179
-    async createGroupHandler() {
180
-      try {
181
-        if (!this.validate()) {
182
-          return false;
183
-        }
184
-
185
-        this.creatingGroup = true;
186
-
187
-        const name = this.groupName;
188
-        const password = this.password;
189
-        const guid = "group_" + new Date().getTime();
190
-
191
-        let type = CometChat.GROUP_TYPE.PUBLIC;
192
-
193
-        switch (this.groupType) {
194
-          case "public":
195
-            type = CometChat.GROUP_TYPE.PUBLIC;
196
-            break;
197
-          case "private":
198
-            type = CometChat.GROUP_TYPE.PRIVATE;
199
-            break;
200
-          case "protected":
201
-            type = CometChat.GROUP_TYPE.PASSWORD;
202
-            break;
203
-          default:
204
-            break;
205
-        }
206
-
207
-        const group = new CometChat.Group(guid, name, type, password);
208
-
209
-        try {
210
-          const createdGroup = await CometChat.createGroup(group);
211
-          this.logError("Group created successfully:", createdGroup);
212
-
213
-          this.clearForm();
214
-
215
-          this.emitAction("groupCreated", { group: createdGroup });
216
-        } catch (error) {
217
-          this.logError("Group creation failed with exception:", error);
218
-          this.error = error;
219
-        } finally {
220
-          this.creatingGroup = false;
221
-        }
222
-      } catch (error) {
223
-        this.logError("Group creation failed with exception:", error);
224
-      }
225
-    },
226
-    /**
227
-     * Validates input
228
-     */
229
-    validate() {
230
-      if (!this.groupName) {
231
-        this.error = COMETCHAT_CONSTANTS.GROUP_NAME_BLANK;
232
-        return false;
233
-      }
234
-
235
-      if (!this.groupType) {
236
-        this.error = COMETCHAT_CONSTANTS.GROUP_TYPE_BLANK;
237
-        return false;
238
-      }
239
-
240
-      let password = "";
241
-      if (this.groupType === "protected") {
242
-        password = this.password;
243
-
244
-        if (!password.length) {
245
-          this.error = COMETCHAT_CONSTANTS.GROUP_PASSWORD_BLANK;
246
-          return false;
247
-        }
248
-      }
249
-      return true;
250
-    },
251
-    /**
252
-     * Closes modal
253
-     */
254
-    closeModal() {
255
-      this.emitEvent("close");
256
-    },
257
-    /**
258
-     * Clears form
259
-     */
260
-    clearForm() {
261
-      this.error = null;
262
-      this.name = "";
263
-      this.type = "";
264
-      this.password = "";
265
-      this.isPasswordInput = false;
266
-    },
267
-  },
268
-};
269
-</script>
270
-<style scoped>
271
-.modal__creategroup__table tr {
272
-  display: table;
273
-  width: 100%;
274
-  table-layout: fixed;
275
-}
276
-.modal__creategroup__table__body td {
277
-  padding: 8px 0px;
278
-  font-size: 14px;
279
-}
280
-.modal__creategroup__table__body input {
281
-  width: 100%;
282
-  border: none;
283
-  outline: none;
284
-  font-size: 14px;
285
-  padding: 10px 14px !important;
286
-}
287
-.modal__creategroup__table__body select {
288
-  outline: none;
289
-  padding: 10px !important;
290
-}
291
-@media (min-width: 320px) and (max-width: 767px) {
292
-  .modal__creategroup__wrapper {
293
-    width: 100% !important;
294
-    height: 100% !important;
295
-  }
296
-}
297
-</style>

BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatCreateGroup/resources/close.png 파일 보기


+ 0
- 111
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatCreateGroup/style.js 파일 보기

@@ -1,111 +0,0 @@
1
-export const modalWrapperStyle = (theme, open) => {
2
-  const show = open
3
-    ? {
4
-        display: "block",
5
-      }
6
-    : {};
7
-
8
-  return {
9
-    minWidth: "350px",
10
-    minHeight: "350px",
11
-    width: "40%",
12
-    height: "40%",
13
-    overflow: "hidden",
14
-    backgroundColor: `${theme.backgroundColor.white}`,
15
-    position: "fixed",
16
-    left: "50%",
17
-    top: "50%",
18
-    transform: "translate(-50%, -50%)",
19
-    zIndex: "1002",
20
-    margin: "0 auto",
21
-    boxShadow:
22
-      "rgba(20, 20, 20, 0.2) 0 16px 32px, rgba(20, 20, 20, 0.04) 0 0 0 1px",
23
-    borderRadius: "12px",
24
-    display: "none",
25
-    ...show,
26
-  };
27
-};
28
-
29
-export const modalCloseStyle = (img) => {
30
-  return {
31
-    position: "absolute",
32
-    width: "32px",
33
-    height: "32px",
34
-    borderRadius: "50%",
35
-    top: "20px",
36
-    right: "16px",
37
-    background: `url(${img}) center center/ 18px no-repeat`,
38
-    cursor: "pointer",
39
-  };
40
-};
41
-
42
-export const modalBodyStyle = () => {
43
-  return {
44
-    padding: "25px",
45
-    height: "100%",
46
-    width: "100%",
47
-  };
48
-};
49
-
50
-export const modalTableStyle = () => {
51
-  return {
52
-    borderCollapse: "collapse",
53
-    margin: "0",
54
-    padding: "0",
55
-    width: "100%",
56
-    height: "90%",
57
-  };
58
-};
59
-
60
-export const tableCaptionStyle = () => {
61
-  return {
62
-    fontSize: "20px",
63
-    marginBottom: "15px",
64
-    fontWeight: "bold",
65
-    textAlign: "left",
66
-  };
67
-};
68
-
69
-export const tableBodyStyle = () => {
70
-  return {
71
-    height: "calc(100% - 40px)",
72
-    overflowY: "auto",
73
-    display: "block",
74
-  };
75
-};
76
-
77
-export const tableErrorStyle = () => {
78
-  return {
79
-    fontSize: "12px",
80
-    color: "red",
81
-    textAlign: "center",
82
-    display: "block",
83
-  };
84
-};
85
-
86
-export const tableButtonStyle = (theme) => {
87
-  return {
88
-    cursor: "pointer",
89
-    padding: "10px 20px",
90
-    backgroundColor: `${theme.backgroundColor.blue}`,
91
-    borderRadius: "5px",
92
-    color: `${theme.color.white}`,
93
-    fontSize: "14px",
94
-    outline: "0",
95
-    border: "0",
96
-  };
97
-};
98
-
99
-export const inputStyle = (theme) => {
100
-  return {
101
-    display: "block",
102
-    width: "100%",
103
-    border: "0",
104
-    boxShadow: "rgba(20, 20, 20, 0.04) 0 0 0 1px inset",
105
-    borderRadius: "8px",
106
-    backgroundColor: `${theme.backgroundColor.grey}`,
107
-    padding: "6px 8px 6px 30px",
108
-    color: `${theme.color.helpText}`,
109
-    fontSize: "15px",
110
-  };
111
-};

+ 0
- 643
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupDetails/CometChatGroupDetails.vue 파일 보기

@@ -1,643 +0,0 @@
1
-<template>
2
-  <div :style="styles.root">
3
-    <div :style="styles.header">
4
-      <div
5
-        :style="styles.headerClose"
6
-        class="cometchat__header__close"
7
-        @click="emitAction('closeDetailClicked')"
8
-      ></div>
9
-      <h4 :style="styles.headerTitle">{{ STRINGS.DETAILS }}</h4>
10
-    </div>
11
-    <div :style="styles.detailPane">
12
-      <div :style="styles.section">
13
-        <h6 :style="styles.sectionHeader">{{ STRINGS.MEMBERS }}</h6>
14
-        <div
15
-          :style="styles.sectionContent"
16
-          class="cometchat__detailpane__section__content"
17
-        >
18
-          <div :style="styles.contentItem">
19
-            <div :style="styles.itemLink" @click="viewMember = true">
20
-              {{ STRINGS.VIEW_MEMBERS }}
21
-            </div>
22
-          </div>
23
-          <div :style="styles.contentItem" v-if="showAddMembersBtn">
24
-            <div :style="styles.itemLink" @click="addMember = true">
25
-              {{ STRINGS.ADD_MEMBERS }}
26
-            </div>
27
-          </div>
28
-          <div :style="styles.contentItem" v-if="showBannedMembersBtn">
29
-            <div :style="styles.itemLink" @click="banMember = true">
30
-              {{ STRINGS.BANNED_MEMBERS }}
31
-            </div>
32
-          </div>
33
-        </div>
34
-      </div>
35
-      <div :style="styles.section">
36
-        <h6 :style="styles.sectionHeader">{{ STRINGS.OPTIONS }}</h6>
37
-        <div
38
-          :style="styles.sectionContent"
39
-          class="cometchat__detailpane__section__content"
40
-        >
41
-          <div :style="styles.contentItem" v-if="showLeaveGroupBtn">
42
-            <span :style="styles.itemLink" @click="leaveGroup">
43
-              {{ STRINGS.LEAVE_GROUP }}
44
-            </span>
45
-          </div>
46
-          <div :style="styles.contentItem" v-if="showDeleteGroupBtn">
47
-            <span :style="styles.redItemLink" @click="deleteGroup">
48
-              {{ STRINGS.DELETE_AND_EXIT }}
49
-            </span>
50
-          </div>
51
-        </div>
52
-      </div>
53
-      <comet-chat-shared-media-view
54
-        :item="item"
55
-        :type="type"
56
-        :theme="theme"
57
-        container-height="225px"
58
-      />
59
-    </div>
60
-    <comet-chat-view-group-member-list
61
-      :item="item"
62
-      :theme="theme"
63
-      v-if="viewMember"
64
-      :open="viewMember"
65
-      :members-list="membersList"
66
-      :logged-in-user="loggedInUser"
67
-      @close="viewMember = false"
68
-      @action="membersActionHandler"
69
-    />
70
-    <comet-chat-add-group-member-list
71
-      :item="item"
72
-      :theme="theme"
73
-      v-if="addMember"
74
-      :open="addMember"
75
-      :members-list="membersList"
76
-      :logged-in-user="loggedInUser"
77
-      :banned-members-list="bannedMembersList"
78
-      @close="addMember = false"
79
-      @action="membersActionHandler"
80
-    />
81
-    <comet-chat-ban-group-member-list
82
-      :item="item"
83
-      :theme="theme"
84
-      v-if="banMember"
85
-      :open="banMember"
86
-      :logged-in-user="loggedInUser"
87
-      :banned-members-list="bannedMembersList"
88
-      @close="banMember = false"
89
-      @action="membersActionHandler"
90
-    />
91
-  </div>
92
-</template>
93
-
94
-<!--eslint-disable-->
95
-<script>
96
-import { CometChat } from "@cometchat-pro/chat";
97
-
98
-import {
99
-  COMETCHAT_CONSTANTS,
100
-  DEFAULT_OBJECT_PROP,
101
-  DEFAULT_STRING_PROP,
102
-} from "../../../resources/constants";
103
-
104
-import { propertyCheck, cometChatCommon } from "../../../mixins/";
105
-import { CometChatManager } from "../../../util/controller";
106
-import { SvgAvatar } from "../../../util/svgavatar";
107
-import * as enums from "../../../util/enums.js";
108
-
109
-import { GroupDetailManager } from "./controller";
110
-
111
-import { CometChatSharedMediaView } from "../../Shared/";
112
-
113
-import CometChatViewGroupMemberList from "../CometChatViewGroupMemberList/CometChatViewGroupMemberList";
114
-import CometChatAddGroupMemberList from "../CometChatAddGroupMemberList/CometChatAddGroupMemberList";
115
-import CometChatBanGroupMemberList from "../CometChatBanGroupMemberList/CometChatBanGroupMemberList";
116
-
117
-import navigateIcon from "./resources/navigate.png";
118
-
119
-import * as style from "./style";
120
-
121
-let groupDetailManager;
122
-
123
-/**
124
- * Shows group details.
125
- *
126
- * @displayName CometChatGroupDetails
127
- */
128
-export default {
129
-  name: "CometChatGroupDetails",
130
-  mixins: [propertyCheck, cometChatCommon],
131
-  components: {
132
-    CometChatSharedMediaView,
133
-    CometChatAddGroupMemberList,
134
-    CometChatBanGroupMemberList,
135
-    CometChatViewGroupMemberList,
136
-  },
137
-  props: {
138
-    /**
139
-     * The selected chat item object.
140
-     */
141
-    item: { ...DEFAULT_OBJECT_PROP },
142
-    /**
143
-     * The type of chat item.
144
-     */
145
-    type: { ...DEFAULT_STRING_PROP },
146
-    /**
147
-     * Theme of the UI.
148
-     */
149
-    theme: { ...DEFAULT_OBJECT_PROP },
150
-  },
151
-  data() {
152
-    return {
153
-      user: {},
154
-      membersList: [],
155
-      loggedInUser: {},
156
-      addMember: false,
157
-      banMember: false,
158
-      viewMember: false,
159
-      moderatorsList: [],
160
-      addModerator: false,
161
-      bannedMembersList: [],
162
-      administratorsList: [],
163
-      addAdministrator: false,
164
-    };
165
-  },
166
-  computed: {
167
-    /**
168
-     * Computed styles for the component.
169
-     */
170
-    styles() {
171
-      return {
172
-        section: style.sectionStyle(),
173
-        root: style.detailStyle(this.theme),
174
-        detailPane: style.detailPaneStyle(),
175
-        header: style.headerStyle(this.theme),
176
-        contentItem: style.contentItemStyle(),
177
-        headerTitle: style.headerTitleStyle(),
178
-        sectionContent: style.sectionContentStyle(),
179
-        itemLink: style.itemLinkStyle(this.theme, false),
180
-        headerClose: style.headerCloseStyle(navigateIcon),
181
-        redItemLink: style.itemLinkStyle(this.theme, true),
182
-        sectionHeader: style.sectionHeaderStyle(this.theme),
183
-      };
184
-    },
185
-    /**
186
-     * Local string constants.
187
-     */ STRINGS() {
188
-      return COMETCHAT_CONSTANTS;
189
-    },
190
-    /**
191
-     * Returns if current user is group owner.
192
-     */
193
-    isOwner() {
194
-      return this.item.owner === this.loggedInUser.uid;
195
-    },
196
-    /**
197
-     * Returns if current user is group admin.
198
-     */
199
-    isAdmin() {
200
-      return this.item.scope === CometChat.GROUP_MEMBER_SCOPE.ADMIN;
201
-    },
202
-    /**
203
-     * Returns if current user is group participant.
204
-     */
205
-    isParticipant() {
206
-      return this.item.scope === CometChat.GROUP_MEMBER_SCOPE.PARTICIPANT;
207
-    },
208
-    /**
209
-     * Shows add members button.
210
-     */
211
-    showAddMembersBtn() {
212
-      return this.isAdmin;
213
-    },
214
-    /**
215
-     * Shows leave group button.
216
-     */
217
-    showLeaveGroupBtn() {
218
-      return !this.isOwner;
219
-    },
220
-    /**
221
-     * Shows delete group button.
222
-     */
223
-    showDeleteGroupBtn() {
224
-      return this.isAdmin;
225
-    },
226
-    /**
227
-     * Shows banned members button.
228
-     */
229
-    showBannedMembersBtn() {
230
-      return !this.isParticipant;
231
-    },
232
-  },
233
-  methods: {
234
-    /**
235
-     * Handles group listener events
236
-     */
237
-    groupUpdateHandler(key, message, group, options) {
238
-      this.logInfo("CometChatGroupDetails: groupUpdateHandler", {
239
-        key,
240
-        message,
241
-        group,
242
-        options,
243
-      });
244
-      if (this.item.guid !== group.guid) {
245
-        return false;
246
-      }
247
-
248
-      const isActionFromHere = message.actionBy.uid === this.loggedInUser.uid;
249
-
250
-      switch (key) {
251
-        case enums.USER_ONLINE:
252
-        case enums.USER_OFFLINE:
253
-          this.groupMemberUpdated(options.user);
254
-          break;
255
-        case enums.GROUP_MEMBER_ADDED:
256
-        case enums.GROUP_MEMBER_JOINED:
257
-          {
258
-            const member = options.user;
259
-            this.setAvatar(member);
260
-
261
-            const updatedMember = Object.assign({}, member, {
262
-              scope: CometChat.GROUP_MEMBER_SCOPE.PARTICIPANT,
263
-            });
264
-
265
-            this.addParticipants([updatedMember], message, isActionFromHere);
266
-          }
267
-          break;
268
-        case enums.GROUP_MEMBER_LEFT:
269
-        case enums.GROUP_MEMBER_KICKED:
270
-          {
271
-            const member = options.user;
272
-            this.removeParticipants(member, true);
273
-          }
274
-          break;
275
-        case enums.GROUP_MEMBER_BANNED:
276
-          {
277
-            const member = this.getMember(options.user);
278
-            this.logError(member);
279
-            if (member) {
280
-              this.setAvatar(member);
281
-              this.banMembers([member]);
282
-              this.removeParticipants(member, true);
283
-            }
284
-          }
285
-          break;
286
-        case enums.GROUP_MEMBER_UNBANNED:
287
-          {
288
-            const member = options.user;
289
-            this.unbanMembers([member], message, isActionFromHere);
290
-          }
291
-          break;
292
-        case enums.GROUP_MEMBER_SCOPE_CHANGED:
293
-          {
294
-            const member = options.user;
295
-            const updatedMember = Object.assign({}, member, {
296
-              scope: options["scope"],
297
-            });
298
-            this.updateParticipants(updatedMember, message);
299
-          }
300
-          break;
301
-        default:
302
-          break;
303
-      }
304
-    },
305
-    /**
306
-     * Handles emitted action events
307
-     */
308
-    membersActionHandler({ action, member, members }) {
309
-      switch (action) {
310
-        case "banGroupMembers":
311
-          this.banMembers(members);
312
-          break;
313
-        case "unbanGroupMembers":
314
-          this.unbanMembers(members);
315
-          break;
316
-        case "addGroupParticipants":
317
-          this.addParticipants(members);
318
-          break;
319
-        case "removeGroupParticipants":
320
-          this.removeParticipants(member);
321
-          break;
322
-        case "updateGroupParticipants":
323
-          this.updateParticipants(member);
324
-          break;
325
-        case "fetchGroupMembers":
326
-          this.getGroupMembers();
327
-          break;
328
-        case "fetchBannedMembers":
329
-          this.getBannedGroupMembers();
330
-          break;
331
-        default:
332
-          break;
333
-      }
334
-    },
335
-    /**
336
-     * Gets a given member
337
-     */
338
-    getMember(member) {
339
-      return this.membersList.find((m) => m.uid === member.uid);
340
-    },
341
-    /**
342
-     * Updates group members
343
-     */
344
-    groupMemberUpdated(member) {
345
-      try {
346
-        let memberlist = [...this.membersList];
347
-        let memberKey = memberlist.findIndex((m) => m.uid === member.uid);
348
-        if (memberKey > -1) {
349
-          let memberObj = memberlist[memberKey];
350
-          let newMemberObj = Object.assign({}, memberObj, member);
351
-          memberlist.splice(memberKey, 1, newMemberObj);
352
-
353
-          this.membersList = memberlist;
354
-        }
355
-
356
-        let bannedmemberlist = [...this.bannedMembersList];
357
-        let bannedMemberKey = bannedmemberlist.findIndex(
358
-          (m) => m.uid === member.uid
359
-        );
360
-        if (bannedMemberKey > -1) {
361
-          let bannedMemberObj = bannedmemberlist[bannedMemberKey];
362
-          let newBannedMemberObj = Object.assign({}, bannedMemberObj, member);
363
-          bannedmemberlist.splice(bannedMemberKey, 1, newBannedMemberObj);
364
-
365
-          this.bannedMembersList = bannedmemberlist;
366
-        }
367
-      } catch (error) {
368
-        this.logError("Error updating group member", error);
369
-      }
370
-    },
371
-    /**
372
-     * Adds new members to banned list
373
-     */
374
-    banMembers(members = []) {
375
-      this.bannedMembersList = [...this.bannedMembersList, ...members];
376
-    },
377
-    /**
378
-     * Removes members from banned list
379
-     */
380
-    unbanMembers(members, message, triggerUpdate = true) {
381
-      try {
382
-        const bannedMembers = [...this.bannedMembersList];
383
-        const unbannedMembers = [];
384
-
385
-        const filteredBannedMembers = bannedMembers.filter((bannedmember) => {
386
-          const found = members.find(
387
-            (member) => bannedmember.uid === member.uid
388
-          );
389
-          if (found) {
390
-            unbannedMembers.push(found);
391
-            return false;
392
-          }
393
-          return true;
394
-        });
395
-
396
-        if (triggerUpdate) {
397
-          this.emitAction("memberUnbanned", {
398
-            members: unbannedMembers,
399
-            message,
400
-          });
401
-        }
402
-
403
-        this.bannedMembersList = filteredBannedMembers;
404
-      } catch (error) {
405
-        this.logError("Error unbanning group members", error);
406
-      }
407
-    },
408
-    /**
409
-     * Adds new participants to group
410
-     */
411
-    addParticipants(members, message, isActionFromHere = true) {
412
-      try {
413
-        const memberlist = [...this.membersList, ...members];
414
-
415
-        this.membersList = memberlist;
416
-
417
-        if (isActionFromHere) {
418
-          this.emitAction("membersAdded", { members, message });
419
-        }
420
-
421
-        this.emitAction("membersUpdated", {
422
-          item: this.item,
423
-          count: memberlist.length,
424
-        });
425
-      } catch (error) {
426
-        this.logError("Error adding participants to group", error);
427
-      }
428
-    },
429
-    /**
430
-     * Removes participants from group
431
-     */
432
-    removeParticipants(member, triggerUpdate = true) {
433
-      try {
434
-        const groupmembers = [...this.membersList];
435
-        const filteredMembers = groupmembers.filter((groupmember) => {
436
-          if (groupmember && groupmember.uid === member.uid) {
437
-            return false;
438
-          }
439
-          return true;
440
-        });
441
-
442
-        this.membersList = filteredMembers;
443
-
444
-        if (triggerUpdate) {
445
-          this.emitAction("membersUpdated", {
446
-            item: this.item,
447
-            count: filteredMembers.length,
448
-          });
449
-        }
450
-      } catch (error) {
451
-        this.logError("Error removing participants from group", error);
452
-      }
453
-    },
454
-    /**
455
-     * Update participants of group
456
-     */
457
-    updateParticipants(updatedMember, message) {
458
-      try {
459
-        const memberlist = [...this.membersList];
460
-
461
-        const memberKey = memberlist.findIndex(
462
-          (member) => member.uid === updatedMember.uid
463
-        );
464
-        if (memberKey > -1) {
465
-          const memberObj = memberlist[memberKey];
466
-          const newMemberObj = Object.assign({}, memberObj, updatedMember, {
467
-            scope: updatedMember["scope"],
468
-          });
469
-
470
-          memberlist.splice(memberKey, 1, newMemberObj);
471
-
472
-          this.emitAction("memberScopeChanged", {
473
-            members: [newMemberObj],
474
-            message,
475
-          });
476
-
477
-          this.membersList = memberlist;
478
-        }
479
-      } catch (error) {
480
-        this.logError("Error updating participants of group", error);
481
-      }
482
-    },
483
-    /**
484
-     * Deletes the current selected group
485
-     */
486
-    async deleteGroup() {
487
-      try {
488
-        const guid = this.item.guid;
489
-
490
-        await CometChat.deleteGroup(guid);
491
-
492
-        this.emitAction("groupDeleted", { group: this.item });
493
-      } catch (error) {
494
-        this.logError("Group delete failed with exception:", error);
495
-      }
496
-    },
497
-    /**
498
-     * Leaves the current selected group
499
-     */
500
-    async leaveGroup() {
501
-      try {
502
-        const guid = this.item.guid;
503
-
504
-        await CometChat.leaveGroup(guid);
505
-
506
-        this.emitAction("leftGroup", { group: this.item });
507
-      } catch (error) {
508
-        this.logError("Group leaving failed with exception:", error);
509
-      }
510
-    },
511
-    /**
512
-     * Gets group member list
513
-     */
514
-    async getGroupMembers() {
515
-      try {
516
-        const administratorslist = [];
517
-        const moderatorslist = [];
518
-
519
-        this.doubleCheckManager();
520
-
521
-        const groupMembers = await groupDetailManager.fetchNextGroupMembers();
522
-
523
-        groupMembers.forEach((member) => {
524
-          this.setAvatar(member);
525
-
526
-          if (member.scope === CometChat.GROUP_MEMBER_SCOPE.ADMIN) {
527
-            administratorslist.push(member);
528
-          }
529
-
530
-          if (member.scope === CometChat.GROUP_MEMBER_SCOPE.MODERATOR) {
531
-            moderatorslist.push(member);
532
-          }
533
-        });
534
-
535
-        this.membersList = [...this.membersList, ...groupMembers];
536
-        this.administratorsList = [
537
-          ...this.administratorsList,
538
-          ...administratorslist,
539
-        ];
540
-        this.moderatorsList = [...this.moderatorsList, ...moderatorslist];
541
-      } catch (error) {
542
-        console.error(
543
-          "[CometChatGroupDetails] getGroupMembers fetchNextGroupMembers error",
544
-          error
545
-        );
546
-      }
547
-    },
548
-    /**
549
-     * Get banned members list
550
-     */
551
-    async getBannedGroupMembers() {
552
-      if (this.item.scope === CometChat.GROUP_MEMBER_SCOPE.PARTICIPANT) {
553
-        return false;
554
-      }
555
-
556
-      try {
557
-        this.doubleCheckManager();
558
-
559
-        const bannedMembers = await groupDetailManager.fetchNextBannedGroupMembers();
560
-
561
-        bannedMembers.forEach((member) => this.setAvatar(member));
562
-
563
-        this.bannedMembersList = [...this.bannedMembersList, ...bannedMembers];
564
-      } catch (error) {
565
-        console.error(
566
-          "[CometChatGroupDetails] getGroupMembers fetchNextGroupMembers error",
567
-          error
568
-        );
569
-      }
570
-    },
571
-    setAvatar(member) {
572
-      if (!member.avatar) {
573
-        const uid = member.uid;
574
-        const char = member.name.charAt(0).toUpperCase();
575
-
576
-        member.avatar = SvgAvatar.getAvatar(uid, char);
577
-      }
578
-    },
579
-    doubleCheckManager() {
580
-      if (!groupDetailManager) {
581
-        this.createManager();
582
-        this.attachListeners();
583
-      }
584
-    },
585
-    createManager() {
586
-      groupDetailManager = new GroupDetailManager(this.item.guid);
587
-    },
588
-    attachListeners() {
589
-      if (groupDetailManager) {
590
-        groupDetailManager.attachListeners(this.groupUpdateHandler);
591
-      }
592
-    },
593
-    removeManager() {
594
-      if (groupDetailManager) {
595
-        groupDetailManager.removeListeners();
596
-        groupDetailManager = null;
597
-      }
598
-    },
599
-  },
600
-  beforeMount() {
601
-    this.membersList = [];
602
-    this.moderatorsList = [];
603
-    this.bannedMembersList = [];
604
-    this.administratorsList = [];
605
-
606
-    groupDetailManager = new GroupDetailManager(this.item.guid);
607
-
608
-    this.getGroupMembers();
609
-    this.getBannedGroupMembers();
610
-    groupDetailManager.attachListeners(this.groupUpdateHandler);
611
-
612
-    (async () => {
613
-      try {
614
-        this.loggedInUser = await new CometChatManager().getLoggedInUser();
615
-      } catch (error) {
616
-        this.logError("[CometChatGroupDetails] getLoggedInUser error", error);
617
-      }
618
-    })();
619
-  },
620
-  beforeDestroy() {
621
-    this.removeManager();
622
-  },
623
-  beforeUnmount() {
624
-    this.removeManager();
625
-  },
626
-};
627
-</script>
628
-<style scoped>
629
-.cometchat__detailpane__section__content:not(:last-of-type) {
630
-  margin-bottom: 16px !important;
631
-}
632
-.cometchat__detailpane__content__item:first-of-type {
633
-  padding-top: 0px !important;
634
-}
635
-.cometchat__detailpane__content__item:last-of-type {
636
-  padding-bottom: 0px !important;
637
-}
638
-@media (min-width: 320px) and (max-width: 767px) {
639
-  .cometchat__header__close {
640
-    display: block !important;
641
-  }
642
-}
643
-</style>

+ 0
- 130
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupDetails/controller.js 파일 보기

@@ -1,130 +0,0 @@
1
-import { CometChat } from "@cometchat-pro/chat";
2
-
3
-import * as enums from "../../../util/enums.js";
4
-
5
-/**
6
- * GroupDetailManager class encapsulates the following functionality:
7
- * - fetching the group list
8
- * - attaching User listener
9
- * - attaching Group listener
10
- */
11
-export class GroupDetailManager {
12
-  guid = null;
13
-  groupMemberRequest = null;
14
-  bannedGroupMemberRequest = null;
15
-
16
-  userListenerId = "group_detail_user_" + new Date().getTime();
17
-  groupListenerId = "group_detail_group_" + new Date().getTime();
18
-
19
-  constructor(guid) {
20
-    this.guid = guid;
21
-    this.groupMemberRequest = new CometChat.GroupMembersRequestBuilder(guid)
22
-      .setLimit(10)
23
-      .build();
24
-    this.bannedGroupMemberRequest = new CometChat.BannedMembersRequestBuilder(
25
-      guid
26
-    )
27
-      .setLimit(10)
28
-      .build();
29
-  }
30
-
31
-  fetchNextGroupMembers() {
32
-    return this.groupMemberRequest.fetchNext();
33
-  }
34
-
35
-  fetchNextBannedGroupMembers() {
36
-    return this.bannedGroupMemberRequest.fetchNext();
37
-  }
38
-
39
-  attachListeners(callback) {
40
-    CometChat.addGroupListener(
41
-      this.groupListenerId,
42
-      new CometChat.GroupListener({
43
-        onGroupMemberScopeChanged: (
44
-          message,
45
-          changedUser,
46
-          newScope,
47
-          oldScope,
48
-          changedGroup
49
-        ) => {
50
-          callback(enums.GROUP_MEMBER_SCOPE_CHANGED, message, changedGroup, {
51
-            user: changedUser,
52
-            scope: newScope,
53
-          });
54
-        },
55
-        onGroupMemberKicked: (message, kickedUser, kickedBy, kickedFrom) => {
56
-          callback(enums.GROUP_MEMBER_KICKED, message, kickedFrom, {
57
-            user: kickedUser,
58
-            hasJoined: false,
59
-          });
60
-        },
61
-        onGroupMemberBanned: (message, bannedUser, bannedBy, bannedFrom) => {
62
-          callback(enums.GROUP_MEMBER_BANNED, message, bannedFrom, {
63
-            user: bannedUser,
64
-          });
65
-        },
66
-        onGroupMemberUnbanned: (
67
-          message,
68
-          unbannedUser,
69
-          unbannedBy,
70
-          unbannedFrom
71
-        ) => {
72
-          callback(enums.GROUP_MEMBER_UNBANNED, message, unbannedFrom, {
73
-            user: unbannedUser,
74
-            hasJoined: false,
75
-          });
76
-        },
77
-        onMemberAddedToGroup: (
78
-          message,
79
-          userAdded,
80
-          userAddedBy,
81
-          userAddedIn
82
-        ) => {
83
-          callback(enums.GROUP_MEMBER_ADDED, message, userAddedIn, {
84
-            user: userAdded,
85
-            hasJoined: true,
86
-          });
87
-        },
88
-        onGroupMemberLeft: (message, leavingUser, group) => {
89
-          callback(enums.GROUP_MEMBER_LEFT, message, group, {
90
-            user: leavingUser,
91
-          });
92
-        },
93
-        onGroupMemberJoined: (message, joinedUser, joinedGroup) => {
94
-          callback(enums.GROUP_MEMBER_JOINED, message, joinedGroup, {
95
-            user: joinedUser,
96
-          });
97
-        },
98
-      })
99
-    );
100
-
101
-    CometChat.addUserListener(
102
-      this.userListenerId,
103
-      new CometChat.UserListener({
104
-        onUserOnline: (onlineUser) => {
105
-          /* when someuser/friend comes online, user will be received here */
106
-          callback(
107
-            enums.USER_ONLINE,
108
-            null,
109
-            { guid: this.guid },
110
-            { user: onlineUser }
111
-          );
112
-        },
113
-        onUserOffline: (offlineUser) => {
114
-          /* when someuser/friend went offline, user will be received here */
115
-          callback(
116
-            enums.USER_OFFLINE,
117
-            null,
118
-            { guid: this.guid },
119
-            { user: offlineUser }
120
-          );
121
-        },
122
-      })
123
-    );
124
-  }
125
-
126
-  removeListeners() {
127
-    CometChat.removeUserListener(this.userListenerId);
128
-    CometChat.removeGroupListener(this.groupListenerId);
129
-  }
130
-}

BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupDetails/resources/navigate.png 파일 보기


+ 0
- 102
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupDetails/style.js 파일 보기

@@ -1,102 +0,0 @@
1
-export const detailStyle = (theme) => {
2
-  return {
3
-    height: "100%",
4
-    boxSizing: "border-box",
5
-    fontFamily: `${theme.fontFamily}`,
6
-    "--detailpane-font-family": `${theme.fontFamily}`,
7
-  };
8
-};
9
-
10
-export const headerStyle = (theme) => {
11
-  return {
12
-    padding: "19px 16px",
13
-    position: "relative",
14
-    borderBottom: `1px solid ${theme.borderColor.primary}`,
15
-    display: "flex",
16
-    justifyContent: "flex-start",
17
-    alignItems: "center",
18
-  };
19
-};
20
-
21
-export const headerCloseStyle = (img) => {
22
-  return {
23
-    cursor: "pointer",
24
-    display: "none",
25
-    background: `url(${img}) center center no-repeat`,
26
-    width: "24px",
27
-    height: "24px",
28
-    marginRight: "12px",
29
-  };
30
-};
31
-
32
-export const headerTitleStyle = () => {
33
-  return {
34
-    margin: "0",
35
-    fontWeight: "700",
36
-    fontSize: "20px",
37
-  };
38
-};
39
-
40
-export const detailPaneStyle = () => {
41
-  return {
42
-    margin: "0",
43
-    padding: "16px",
44
-    display: "flex",
45
-    flexDirection: "column",
46
-    alignItems: "flex-start",
47
-    justifyContent: "flex-start",
48
-    height: "calc(100% - 70px)",
49
-  };
50
-};
51
-
52
-export const sectionStyle = () => {
53
-  return {
54
-    width: "100%",
55
-  };
56
-};
57
-
58
-export const sectionHeaderStyle = (theme) => {
59
-  return {
60
-    margin: "0",
61
-    width: "100%",
62
-    fontSize: "12px",
63
-    fontWeight: "600",
64
-    lineHeight: "20px",
65
-    color: `${theme.color.secondary}`,
66
-    textTransform: "uppercase",
67
-  };
68
-};
69
-
70
-export const sectionContentStyle = () => {
71
-  return {
72
-    width: "100%",
73
-    margin: "6px 0",
74
-  };
75
-};
76
-
77
-export const contentItemStyle = () => {
78
-  return {
79
-    position: "relative",
80
-    display: "flex",
81
-    clear: "both",
82
-    width: "100%",
83
-    padding: " 6px 0",
84
-  };
85
-};
86
-
87
-export const itemLinkStyle = (theme, deleteLink) => {
88
-  const deleteCss = deleteLink
89
-    ? {
90
-        color: `${theme.color.red}`,
91
-      }
92
-    : {};
93
-
94
-  return {
95
-    fontSize: "15px",
96
-    lineHeight: "20px",
97
-    display: "inline-block",
98
-    cursor: "pointer",
99
-    fontWeight: "600",
100
-    ...deleteCss,
101
-  };
102
-};

+ 0
- 689
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupList/CometChatGroupList.vue 파일 보기

@@ -1,689 +0,0 @@
1
-<template>
2
-  <div :style="styles.wrapper" class="groups__wrapper">
3
-    <div :style="styles.header">
4
-      <div
5
-        class="header__close"
6
-        v-if="enableCloseMenu"
7
-        :style="styles.headerClose"
8
-        @click="emitAction('closeMenuClicked')"
9
-      />
10
-      <h4 :style="styles.headerTitle">{{ STRINGS.GROUPS }}</h4>
11
-      <div
12
-        :style="styles.add"
13
-        v-if="canCreateGroup"
14
-        :title="STRINGS.CREATE_GROUP"
15
-        @click="createGroupOpen = true"
16
-      ></div>
17
-    </div>
18
-    <div :style="styles.search">
19
-      <input
20
-        type="text"
21
-        autoComplete="off"
22
-        :style="styles.searchInput"
23
-        :placeholder="STRINGS.SEARCH"
24
-        @input="groupSearchHandler"
25
-      />
26
-    </div>
27
-    <div v-if="groupList.length === 0" :style="styles.msg">
28
-      <p :style="styles.msgText">
29
-        {{ decoratorMessage }}
30
-      </p>
31
-    </div>
32
-    <div
33
-      ref="groupListRef"
34
-      :style="styles.list"
35
-      v-else-if="groupList.length !== 0"
36
-      @scroll="groupScrollHandler($event)"
37
-    >
38
-      <div v-for="(group, i) in groupList" :key="i">
39
-        <comet-chat-group-list-item
40
-          :group="group"
41
-          :theme="themeValue"
42
-          :selectedGroup="selectedGroup"
43
-          @click="groupClickHandler"
44
-        />
45
-      </div>
46
-    </div>
47
-    <comet-chat-create-group
48
-      :theme="themeValue"
49
-      :open="createGroupOpen"
50
-      @close="createGroupOpen = false"
51
-      @action="createGroupActionHandler"
52
-    />
53
-  </div>
54
-</template>
55
-
56
-<!--eslint-disable-->
57
-<script>
58
-import { CometChat } from "@cometchat-pro/chat";
59
-
60
-import { CometChatManager } from "../../../util/controller";
61
-import { SvgAvatar } from "../../../util/svgavatar";
62
-
63
-import {
64
-  COMETCHAT_CONSTANTS,
65
-  DEFAULT_OBJECT_PROP,
66
-  DEFAULT_BOOLEAN_PROP,
67
-} from "../../../resources/constants";
68
-import * as enums from "../../../util/enums.js";
69
-
70
-import { GroupListManager } from "./controller";
71
-
72
-import CometChatCreateGroup from "../CometChatCreateGroup/CometChatCreateGroup";
73
-import CometChatGroupListItem from "../CometChatGroupListItem/CometChatGroupListItem";
74
-
75
-import { propertyCheck, cometChatCommon } from "../../../mixins/";
76
-
77
-import { theme } from "../../../resources/theme";
78
-
79
-import addIcon from "./resources/creategroup.png";
80
-import navigateIcon from "./resources/navigate.png";
81
-import searchIcon from "./resources/search-grey-icon.png";
82
-
83
-import * as style from "./style";
84
-
85
-let timeout;
86
-let groupListManager;
87
-let cometChatManager;
88
-
89
-/**
90
- * Displays list of groups.
91
- *
92
- * @displayName CometChatGroupList
93
- */
94
-export default {
95
-  name: "CometChatGroupList",
96
-  mixins: [propertyCheck, cometChatCommon],
97
-  components: {
98
-    CometChatGroupListItem,
99
-    CometChatCreateGroup,
100
-  },
101
-  props: {
102
-    /**
103
-     * The selected chat item object.
104
-     */
105
-    item: { ...DEFAULT_OBJECT_PROP },
106
-    /**
107
-     * Theme of the UI.
108
-     */
109
-    theme: { ...DEFAULT_OBJECT_PROP },
110
-    /**
111
-     * @ignore
112
-     */
113
-    config: { ...DEFAULT_OBJECT_PROP },
114
-    /**
115
-     * The group selected to leave.
116
-     */
117
-    groupToLeave: { ...DEFAULT_OBJECT_PROP },
118
-    /**
119
-     * The group selected to update.
120
-     */
121
-    groupToUpdate: { ...DEFAULT_OBJECT_PROP },
122
-    /**
123
-     * The group selected to delete.
124
-     */
125
-    groupToDelete: { ...DEFAULT_OBJECT_PROP },
126
-    /**
127
-     * Shows/hides the close menu button.
128
-     */
129
-    enableCloseMenu: { ...DEFAULT_BOOLEAN_PROP },
130
-  },
131
-  data() {
132
-    return {
133
-      searchKey: "",
134
-      groupList: [],
135
-      loggedInUser: {},
136
-      selectedGroup: null,
137
-      createGroupOpen: false,
138
-      decoratorMessage: COMETCHAT_CONSTANTS.LOADING_MESSSAGE,
139
-    };
140
-  },
141
-  computed: {
142
-    /**
143
-     * Theme computed using default theme and theme coming from prop.
144
-     */
145
-    themeValue() {
146
-      return Object.assign({}, theme, this.theme || {});
147
-    },
148
-    /**
149
-     * Computed styles for the component.
150
-     */
151
-    styles() {
152
-      return {
153
-        msg: style.groupMsgStyle(),
154
-        list: style.groupListStyle(),
155
-        search: style.groupSearchStyle(),
156
-        add: style.groupAddStyle(addIcon),
157
-        wrapper: style.groupWrapperStyle(),
158
-        header: style.groupHeaderStyle(this.themeValue),
159
-        msgText: style.groupMsgTxtStyle(this.themeValue),
160
-        headerClose: style.groupHeaderCloseStyle(navigateIcon),
161
-        headerTitle: style.groupHeaderTitleStyle(this.enableCloseMenu),
162
-        searchInput: style.groupSearchInputStyle(this.themeValue, searchIcon),
163
-      };
164
-    },
165
-    /**
166
-     * Returns if user can create group.
167
-     */
168
-    canCreateGroup() {
169
-      if (
170
-        this.config &&
171
-        this.hasProperty(this.config, "group-create") &&
172
-        this.config["group-create"] === false
173
-      ) {
174
-        return false;
175
-      }
176
-
177
-      return true;
178
-    },
179
-    /**
180
-     * Computed object, made of props, for watcher.
181
-     */
182
-    propsForWatcher() {
183
-      return {
184
-        item: this.item,
185
-        groupToLeave: this.groupToLeave,
186
-        groupToUpdate: this.groupToUpdate,
187
-        groupToDelete: this.groupToDelete,
188
-      };
189
-    },
190
-    /**
191
-     * Local string constants.
192
-     */
193
-    STRINGS() {
194
-      return COMETCHAT_CONSTANTS;
195
-    },
196
-  },
197
-  watch: {
198
-    /**
199
-     * One true watcher that updates state on props update.
200
-     */
201
-    propsForWatcher: {
202
-      handler(_, prevProps) {
203
-        const previousItem = JSON.stringify(prevProps.item);
204
-        const currentItem = JSON.stringify(this.item);
205
-
206
-        if (previousItem !== currentItem) {
207
-          if (Object.keys(this.item).length === 0) {
208
-            if (this.$refs && this.$refs.groupListRef) {
209
-              this.$refs.groupListRef.scrollTop = 0;
210
-            }
211
-            this.selectedGroup = {};
212
-          } else {
213
-            let grouplist = [...this.groupList];
214
-
215
-            //search for user
216
-            let groupKey = grouplist.findIndex(
217
-              (g) => g.guid === this.item.guid
218
-            );
219
-            if (groupKey > -1) {
220
-              let groupObj = { ...grouplist[groupKey] };
221
-              this.selectedGroup = groupObj;
222
-            }
223
-          }
224
-        }
225
-
226
-        if (
227
-          prevProps.groupToLeave &&
228
-          prevProps.groupToLeave.guid !== this.groupToLeave.guid
229
-        ) {
230
-          const groups = [...this.groupList];
231
-          const groupKey = groups.findIndex(
232
-            (member) => member.guid === this.groupToLeave.guid
233
-          );
234
-
235
-          if (groupKey > -1) {
236
-            const groupToLeave = this.groupToLeave;
237
-            const groupObj = { ...groups[groupKey] };
238
-            const membersCount = parseInt(groupToLeave["membersCount"]) - 1;
239
-
240
-            let newgroupObj = Object.assign({}, groupObj, {
241
-              membersCount: membersCount,
242
-              hasJoined: false,
243
-            });
244
-
245
-            groups.splice(groupKey, 1, newgroupObj);
246
-            this.groupList = groups;
247
-          }
248
-        }
249
-
250
-        if (
251
-          prevProps.groupToDelete &&
252
-          prevProps.groupToDelete.guid !== this.groupToDelete.guid
253
-        ) {
254
-          const groups = [...this.groupList];
255
-          const groupKey = groups.findIndex(
256
-            (member) => member.guid === this.groupToDelete.guid
257
-          );
258
-          if (groupKey > -1) {
259
-            groups.splice(groupKey, 1);
260
-            this.groupList = groups;
261
-            if (groups.length === 0) {
262
-              this.decoratorMessage = "No groups found";
263
-            }
264
-          }
265
-        }
266
-
267
-        if (
268
-          prevProps.groupToUpdate &&
269
-          (prevProps.groupToUpdate.guid !== this.groupToUpdate.guid ||
270
-            (prevProps.groupToUpdate.guid === this.groupToUpdate.guid &&
271
-              (prevProps.groupToUpdate.membersCount !==
272
-                this.groupToUpdate.membersCount ||
273
-                prevProps.groupToUpdate.scope !== this.groupToUpdate.scope)))
274
-        ) {
275
-          const groups = [...this.groupList];
276
-          const groupToUpdate = this.groupToUpdate;
277
-
278
-          const groupKey = groups.findIndex(
279
-            (group) => group.guid === groupToUpdate.guid
280
-          );
281
-          if (groupKey > -1) {
282
-            const groupObj = groups[groupKey];
283
-            const newGroupObj = Object.assign({}, groupObj, groupToUpdate, {
284
-              scope: groupToUpdate["scope"],
285
-              membersCount: groupToUpdate["membersCount"],
286
-            });
287
-
288
-            groups.splice(groupKey, 1, newGroupObj);
289
-            this.groupList = groups;
290
-          }
291
-        }
292
-      },
293
-      deep: true,
294
-    },
295
-  },
296
-  methods: {
297
-    /**
298
-     * Handles searching in group
299
-     */
300
-    groupSearchHandler(e) {
301
-      try {
302
-        if (timeout) {
303
-          clearTimeout(timeout);
304
-        }
305
-
306
-        let val = e.target.value;
307
-        this.searchKey = val;
308
-
309
-        timeout = setTimeout(() => {
310
-          groupListManager = new GroupListManager(val);
311
-          this.getGroups(true);
312
-        }, 500);
313
-      } catch (error) {
314
-        this.logError("Error in searching groups", error);
315
-      }
316
-    },
317
-    /**
318
-     * Handles group creation
319
-     */
320
-    createGroupActionHandler({ action, group }) {
321
-      try {
322
-        if (action === "groupCreated") {
323
-          this.setAvatar(group);
324
-          const groups = [group, ...this.groupList];
325
-
326
-          this.groupClickHandler(group);
327
-
328
-          this.groupList = groups;
329
-          this.createGroupOpen = false;
330
-        }
331
-      } catch (error) {
332
-        this.logError("Error in creating group", error);
333
-      }
334
-    },
335
-    /**
336
-     * Handles group item click
337
-     */
338
-    async groupClickHandler(group) {
339
-      try {
340
-        if (group.hasJoined === false) {
341
-          let password = "";
342
-          if (group.type === CometChat.GROUP_TYPE.PASSWORD) {
343
-            password = prompt("Enter your password");
344
-          }
345
-          const guid = group.guid;
346
-          const groupType = group.type;
347
-
348
-          try {
349
-            const response = await CometChat.joinGroup(
350
-              guid,
351
-              groupType,
352
-              password
353
-            );
354
-            this.logError(
355
-              "Group joining success with response",
356
-              response,
357
-              "group",
358
-              group
359
-            );
360
-
361
-            const groups = [...this.groupList];
362
-            let groupKey = groups.findIndex((g) => g.guid === guid);
363
-
364
-            if (groupKey > -1) {
365
-              const groupObj = groups[groupKey];
366
-              const newGroupObj = Object.assign({}, groupObj, response, {
367
-                scope: CometChat.GROUP_MEMBER_SCOPE.PARTICIPANT,
368
-              });
369
-
370
-              groups.splice(groupKey, 1, newGroupObj);
371
-
372
-              this.groupList = groups;
373
-              this.selectedGroup = newGroupObj;
374
-
375
-              this.emitAction("item-click", {
376
-                item: newGroupObj,
377
-                type: "group",
378
-              });
379
-            }
380
-          } catch (error) {
381
-            this.logError("Group joining failed with exception:", error);
382
-          }
383
-        } else {
384
-          this.selectedGroup = group;
385
-          this.emitAction("item-click", { item: group, type: "group" });
386
-        }
387
-      } catch (error) {
388
-        this.logError("Error in group item click", error);
389
-      }
390
-    },
391
-    /**
392
-     * Handles group list scroll
393
-     */
394
-    groupScrollHandler(elem) {
395
-      try {
396
-        if (
397
-          elem.target.offsetHeight + elem.target.scrollTop >=
398
-          elem.target.scrollHeight - 20
399
-        ) {
400
-          this.getGroups();
401
-        }
402
-      } catch (error) {
403
-        this.logError("Error in group scroll", error);
404
-      }
405
-    },
406
-    /**
407
-     * Gets list of group
408
-     */
409
-    async getGroups(clear = false) {
410
-      cometChatManager = new CometChatManager();
411
-      try {
412
-        const user = await cometChatManager.getLoggedInUser();
413
-        this.loggedInUser = user;
414
-
415
-        if (!groupListManager) {
416
-          groupListManager = new GroupListManager(this.searchKey || "");
417
-        }
418
-
419
-        const groups = await groupListManager.fetchNextGroups();
420
-
421
-        if (groups.length === 0) {
422
-          this.decoratorMessage = "No groups found";
423
-        }
424
-
425
-        groups.forEach((group) => (group = this.setAvatar(group)));
426
-
427
-        if (clear) {
428
-          this.groupList = groups;
429
-        } else {
430
-          this.groupList = [...this.groupList, ...groups];
431
-        }
432
-      } catch (error) {
433
-        this.decoratorMessage = COMETCHAT_CONSTANTS.ERROR_LOADING_USERS;
434
-        console.error("[CometChatGroupList] getGroups error", error);
435
-      }
436
-    },
437
-    /**
438
-     * Set SVG avatar
439
-     */
440
-    setAvatar(group) {
441
-      if (!this.hasProperty(group, "icon")) {
442
-        const guid = group.guid;
443
-        const char = group.name.charAt(0).toUpperCase();
444
-        group.icon = SvgAvatar.getAvatar(guid, char);
445
-      }
446
-      return group;
447
-    },
448
-    /**
449
-     * Updates changed members
450
-     */
451
-    updateMemberChanged(group, options) {
452
-      try {
453
-        let groups = [...this.groupList];
454
-
455
-        let groupKey = groups.findIndex((g) => g.guid === group.guid);
456
-
457
-        if (groupKey > -1) {
458
-          let groupObj = { ...groups[groupKey] };
459
-          if (options && this.loggedInUser.uid === options.user.uid) {
460
-            let newgroupObj = Object.assign({}, groupObj, {
461
-              scope: options.scope,
462
-            });
463
-
464
-            groups.splice(groupKey, 1, newgroupObj);
465
-            this.groupList = groups;
466
-          }
467
-        }
468
-      } catch (error) {
469
-        this.logError("Error in member change update", error);
470
-      }
471
-    },
472
-    /**
473
-     * Updates removed members
474
-     */
475
-    updateMemberRemoved(group, options) {
476
-      try {
477
-        let groups = [...this.groupList];
478
-
479
-        let groupKey = groups.findIndex((g) => g.guid === group.guid);
480
-
481
-        if (groupKey > -1) {
482
-          if (options && this.loggedInUser.uid === options.user.uid) {
483
-            let groupObj = { ...groups[groupKey] };
484
-            let membersCount = parseInt(group.membersCount);
485
-
486
-            let newgroupObj = Object.assign({}, groupObj, {
487
-              membersCount: membersCount,
488
-              hasJoined: false,
489
-            });
490
-
491
-            groups.splice(groupKey, 1, newgroupObj);
492
-          } else {
493
-            let groupObj = { ...groups[groupKey] };
494
-            let membersCount = parseInt(group.membersCount);
495
-
496
-            let newgroupObj = Object.assign({}, groupObj, {
497
-              membersCount: membersCount,
498
-            });
499
-
500
-            groups.splice(groupKey, 1, newgroupObj);
501
-          }
502
-          this.groupList = groups;
503
-        }
504
-      } catch (error) {
505
-        this.logError("Error in member change update", error);
506
-      }
507
-    },
508
-    /**
509
-     * Updates added members
510
-     */
511
-    updateMemberAdded(group, options) {
512
-      try {
513
-        let groups = [...this.groupList];
514
-
515
-        let groupKey = groups.findIndex((g) => g.guid === group.guid);
516
-
517
-        if (groupKey > -1) {
518
-          let groupObj = { ...groups[groupKey] };
519
-
520
-          let membersCount = parseInt(group.membersCount);
521
-
522
-          let scope = this.hasProperty(group, "scope") ? group.scope : "";
523
-          let hasJoined = this.hasProperty(group, "hasJoined")
524
-            ? group.hasJoined
525
-            : false;
526
-
527
-          if (options && this.loggedInUser.uid === options.user.uid) {
528
-            scope = CometChat.GROUP_MEMBER_SCOPE.PARTICIPANT;
529
-            hasJoined = true;
530
-          }
531
-
532
-          let newgroupObj = Object.assign({}, groupObj, {
533
-            membersCount: membersCount,
534
-            hasJoined: hasJoined,
535
-            scope: scope,
536
-          });
537
-
538
-          groups.splice(groupKey, 1, newgroupObj);
539
-          this.groupList = groups;
540
-        } else {
541
-          let groupObj = { ...group };
542
-
543
-          let scope = this.hasProperty(groupObj, "scope") ? groupObj.scope : {};
544
-          let hasJoined = this.hasProperty(groupObj, "hasJoined")
545
-            ? groupObj.hasJoined
546
-            : false;
547
-          let membersCount = parseInt(groupObj.membersCount);
548
-          this.setAvatar(groupObj);
549
-
550
-          if (options && this.loggedInUser.uid === options.user.uid) {
551
-            scope = CometChat.GROUP_MEMBER_SCOPE.PARTICIPANT;
552
-            hasJoined = true;
553
-          }
554
-
555
-          let newgroupObj = Object.assign({}, groupObj, {
556
-            membersCount: membersCount,
557
-            hasJoined: hasJoined,
558
-            scope: scope,
559
-          });
560
-
561
-          this.groupList = [newgroupObj, ...groups];
562
-        }
563
-      } catch (error) {
564
-        this.logError("Error in member add update", error);
565
-      }
566
-    },
567
-    /**
568
-     * Updates joined members
569
-     */
570
-    updateMemberJoined(group, options) {
571
-      try {
572
-        let groups = [...this.groupList];
573
-
574
-        let groupKey = groups.findIndex((g) => g.guid === group.guid);
575
-
576
-        if (groupKey > -1) {
577
-          let groupObj = { ...groups[groupKey] };
578
-
579
-          let scope = groupObj.scope;
580
-          let membersCount = parseInt(group.membersCount);
581
-
582
-          if (options && this.loggedInUser.uid === options.user.uid) {
583
-            scope = CometChat.GROUP_MEMBER_SCOPE.PARTICIPANT;
584
-          }
585
-
586
-          let newgroupObj = Object.assign({}, groupObj, {
587
-            membersCount: membersCount,
588
-            scope: scope,
589
-          });
590
-
591
-          groups.splice(groupKey, 1, newgroupObj);
592
-          this.groupList = groups;
593
-        }
594
-      } catch (error) {
595
-        this.logError("Error in member join update", error);
596
-      }
597
-    },
598
-    /**
599
-     * Handler for group change listeners
600
-     */
601
-    groupsUpdateHandler(key, message, group, options) {
602
-      this.logInfo("CometChatGroupList: groupUpdateHandler", {
603
-        key,
604
-        message,
605
-        group,
606
-        options,
607
-      });
608
-      switch (key) {
609
-        case enums.GROUP_MEMBER_SCOPE_CHANGED:
610
-          this.updateMemberChanged(group, options);
611
-          break;
612
-        case enums.GROUP_MEMBER_KICKED:
613
-        case enums.GROUP_MEMBER_BANNED:
614
-        case enums.GROUP_MEMBER_LEFT:
615
-          this.updateMemberRemoved(group, options);
616
-          break;
617
-        case enums.GROUP_MEMBER_ADDED:
618
-          this.updateMemberAdded(group, options);
619
-          break;
620
-        case enums.GROUP_MEMBER_JOINED:
621
-          this.updateMemberJoined(group, options);
622
-          break;
623
-        default:
624
-          break;
625
-      }
626
-    },
627
-    /**
628
-     * Handles changes in group search input
629
-     */
630
-    onSearchChange(event) {
631
-      try {
632
-        this.groupList = [];
633
-        if (this.searchStarted) {
634
-          clearTimeout(this.searchStarted);
635
-        }
636
-        if (event.target.value.trim() !== COMETCHAT_CONSTANTS.EMPTY_STRING) {
637
-          this.searchStarted = setTimeout(() => {
638
-            this.decoratorMessage = COMETCHAT_CONSTANTS.SEARCH_LOADING;
639
-            this.getGroupList(event.target.value);
640
-          }, 400);
641
-        } else if (
642
-          event.target.value.trim() === COMETCHAT_CONSTANTS.EMPTY_STRING &&
643
-          event.data === null
644
-        ) {
645
-          event.target.value = COMETCHAT_CONSTANTS.EMPTY_STRING;
646
-          this.searchStarted = setTimeout(() => {
647
-            this.getGroupList();
648
-          }, 400);
649
-        } else if (
650
-          event.target.value.trim() === COMETCHAT_CONSTANTS.EMPTY_STRING &&
651
-          event.data === COMETCHAT_CONSTANTS.SINGLE_SPACE
652
-        ) {
653
-          event.target.value = COMETCHAT_CONSTANTS.EMPTY_STRING;
654
-        }
655
-      } catch (error) {
656
-        this.logError("Error in group search change", error);
657
-      }
658
-    },
659
-  },
660
-  beforeMount() {
661
-    groupListManager = new GroupListManager();
662
-
663
-    this.getGroups();
664
-    groupListManager.attachListeners(this.groupsUpdateHandler);
665
-  },
666
-  beforeDestroy() {
667
-    if (groupListManager) {
668
-      groupListManager.removeListeners();
669
-      groupListManager = null;
670
-    }
671
-  },
672
-  beforeUnmount() {
673
-    if (groupListManager) {
674
-      groupListManager.removeListeners();
675
-      groupListManager = null;
676
-    }
677
-  },
678
-};
679
-</script>
680
-<style scoped>
681
-.groups__wrapper * {
682
-  box-sizing: border-box;
683
-}
684
-@media (min-width: 320px) and (max-width: 767px) {
685
-  .header__close {
686
-    display: block !important;
687
-  }
688
-}
689
-</style>

+ 0
- 98
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupList/controller.js 파일 보기

@@ -1,98 +0,0 @@
1
-import { CometChat } from "@cometchat-pro/chat";
2
-
3
-import * as enums from "../../../util/enums.js";
4
-
5
-/**
6
- * GroupListManager class encapsulates the following functionality:
7
- * - fetching the group list
8
- * - attaching Group listener
9
- */
10
-export class GroupListManager {
11
-  groupRequest = null;
12
-  groupListenerId = "grouplist_" + new Date().getTime();
13
-
14
-  constructor(searchKey) {
15
-    if (searchKey) {
16
-      this.groupRequest = new CometChat.GroupsRequestBuilder()
17
-        .setLimit(30)
18
-        .setSearchKeyword(searchKey)
19
-        .build();
20
-    } else {
21
-      this.groupRequest = new CometChat.GroupsRequestBuilder()
22
-        .setLimit(30)
23
-        .build();
24
-    }
25
-  }
26
-
27
-  fetchNextGroups() {
28
-    return this.groupRequest.fetchNext();
29
-  }
30
-
31
-  attachListeners(callback) {
32
-    CometChat.addGroupListener(
33
-      this.groupListenerId,
34
-      new CometChat.GroupListener({
35
-        onGroupMemberScopeChanged: (
36
-          message,
37
-          changedUser,
38
-          newScope,
39
-          oldScope,
40
-          changedGroup
41
-        ) => {
42
-          callback(enums.GROUP_MEMBER_SCOPE_CHANGED, message, changedGroup, {
43
-            user: changedUser,
44
-            scope: newScope,
45
-          });
46
-        },
47
-        onGroupMemberKicked: (message, kickedUser, kickedBy, kickedFrom) => {
48
-          callback(enums.GROUP_MEMBER_KICKED, message, kickedFrom, {
49
-            user: kickedUser,
50
-            hasJoined: false,
51
-          });
52
-        },
53
-        onGroupMemberBanned: (message, bannedUser, bannedBy, bannedFrom) => {
54
-          callback(enums.GROUP_MEMBER_BANNED, message, bannedFrom, {
55
-            user: bannedUser,
56
-            hasJoined: false,
57
-          });
58
-        },
59
-        onGroupMemberUnbanned: (
60
-          message,
61
-          unbannedUser,
62
-          unbannedBy,
63
-          unbannedFrom
64
-        ) => {
65
-          callback(enums.GROUP_MEMBER_UNBANNED, message, unbannedFrom, {
66
-            user: unbannedUser,
67
-            hasJoined: false,
68
-          });
69
-        },
70
-        onMemberAddedToGroup: (
71
-          message,
72
-          userAdded,
73
-          userAddedBy,
74
-          userAddedIn
75
-        ) => {
76
-          callback(enums.GROUP_MEMBER_ADDED, message, userAddedIn, {
77
-            user: userAdded,
78
-            hasJoined: true,
79
-          });
80
-        },
81
-        onGroupMemberLeft: (message, leavingUser, group) => {
82
-          callback(enums.GROUP_MEMBER_LEFT, message, group, {
83
-            user: leavingUser,
84
-          });
85
-        },
86
-        onGroupMemberJoined: (message, joinedUser, joinedGroup) => {
87
-          callback(enums.GROUP_MEMBER_JOINED, message, joinedGroup, {
88
-            user: joinedUser,
89
-          });
90
-        },
91
-      })
92
-    );
93
-  }
94
-
95
-  removeListeners() {
96
-    CometChat.removeGroupListener(this.groupListenerId);
97
-  }
98
-}

BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupList/resources/creategroup.png 파일 보기


BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupList/resources/navigate.png 파일 보기


BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupList/resources/search-grey-icon.png 파일 보기


+ 0
- 112
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupList/style.js 파일 보기

@@ -1,112 +0,0 @@
1
-export const groupWrapperStyle = () => {
2
-  return {
3
-    display: "flex",
4
-    flexDirection: "column",
5
-    height: "100%",
6
-    boxSizing: "border-box",
7
-  };
8
-};
9
-
10
-export const groupHeaderStyle = (theme) => {
11
-  return {
12
-    padding: "19px 16px",
13
-    position: "relative",
14
-    display: "flex",
15
-    alignItems: "center",
16
-    borderBottom: `1px solid ${theme.borderColor.primary}`,
17
-  };
18
-};
19
-
20
-export const groupHeaderCloseStyle = (img) => {
21
-  return {
22
-    cursor: "pointer",
23
-    display: "none",
24
-    background: `url(${img}) left center no-repeat`,
25
-    height: "24px",
26
-    width: "33%",
27
-  };
28
-};
29
-
30
-export const groupHeaderTitleStyle = (enableCloseMenu) => {
31
-  const alignment =
32
-    enableCloseMenu.length > 0
33
-      ? {
34
-          width: "33%",
35
-          textAlign: "center",
36
-        }
37
-      : {};
38
-
39
-  return {
40
-    margin: "0",
41
-    fontWeight: "700",
42
-    display: "inline-block",
43
-    width: "66%",
44
-    textAlign: "left",
45
-    fontSize: "20px",
46
-    ...alignment,
47
-  };
48
-};
49
-
50
-export const groupAddStyle = (img) => {
51
-  return {
52
-    display: "block",
53
-    height: "20px",
54
-    background: `url(${img}) right center / 20px no-repeat`,
55
-    cursor: "pointer",
56
-    width: "35%",
57
-  };
58
-};
59
-
60
-export const groupSearchStyle = () => {
61
-  return {
62
-    padding: "16px 16px",
63
-    position: "relative",
64
-  };
65
-};
66
-
67
-export const groupSearchInputStyle = (theme, img) => {
68
-  return {
69
-    display: "block",
70
-    width: "100%",
71
-    border: "0",
72
-    boxShadow: "rgba(20, 20, 20, 0.04) 0 0 0 1px inset",
73
-    borderRadius: "8px",
74
-    lineHeight: "20px",
75
-    padding: "6px 8px 6px 35px",
76
-    fontSize: "15px",
77
-    outline: "none",
78
-    color: `${theme.color.primary}`,
79
-    background: `url(${img}) 10px center / 16px no-repeat ${theme.backgroundColor.grey}`,
80
-  };
81
-};
82
-
83
-export const groupMsgStyle = () => {
84
-  return {
85
-    overflow: "hidden",
86
-    width: "100%",
87
-    display: "flex",
88
-    justifyContent: "center",
89
-    alignItems: "center",
90
-    position: "absolute",
91
-    top: "50%",
92
-  };
93
-};
94
-
95
-export const groupMsgTxtStyle = (theme) => {
96
-  return {
97
-    margin: "0",
98
-    height: "30px",
99
-    color: `${theme.color.secondary}`,
100
-    fontSize: "24px!important",
101
-    fontWeight: "600",
102
-  };
103
-};
104
-
105
-export const groupListStyle = () => {
106
-  return {
107
-    height: "calc(100% - 125px)",
108
-    overflowY: "auto",
109
-    margin: "0",
110
-    padding: "0",
111
-  };
112
-};

+ 0
- 121
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupListItem/CometChatGroupListItem.vue 파일 보기

@@ -1,121 +0,0 @@
1
-<template>
2
-  <div
3
-    :style="styles.list"
4
-    class="group__item--hover"
5
-    @click="emitEvent('click', group)"
6
-  >
7
-    <div :style="styles.thumbnail">
8
-      <comet-chat-avatar
9
-        border-width="1px"
10
-        corner-radius="18px"
11
-        :image="group.icon"
12
-        :border-color="theme.borderColor.primary"
13
-      />
14
-    </div>
15
-    <div :style="styles.detail">
16
-      <div
17
-        :style="styles.nameWrapper"
18
-        @mouseenter="toggleTooltip($event, true)"
19
-        @mouseleave="toggleTooltip($event, false)"
20
-      >
21
-        <div :style="styles.name">
22
-          {{ group.name }}
23
-        </div>
24
-        <img
25
-          :alt="STRINGS.SHIELD"
26
-          :style="styles.icon"
27
-          v-if="group.type === 'private'"
28
-          :src="groupTypeIcons.shieldIcon"
29
-        />
30
-        <img
31
-          :alt="STRINGS.LOCK"
32
-          :style="styles.icon"
33
-          :src="groupTypeIcons.lockIcon"
34
-          v-else-if="group.type === 'password'"
35
-        />
36
-      </div>
37
-      <div :style="styles.description">{{ groupDescription }}</div>
38
-    </div>
39
-  </div>
40
-</template>
41
-<script>
42
-import {
43
-  COMETCHAT_CONSTANTS,
44
-  DEFAULT_OBJECT_PROP,
45
-} from "../../../resources/constants";
46
-
47
-import { tooltip, cometChatCommon } from "../../../mixins";
48
-
49
-import { CometChatAvatar } from "../../Shared";
50
-
51
-import shieldIcon from "./resources/shield.png";
52
-import lockIcon from "./resources/lock.png";
53
-
54
-import * as style from "./style";
55
-
56
-/**
57
- * List item for group list.
58
- *
59
- * @displayName CometChatGroupListItem
60
- */
61
-export default {
62
-  name: "CometChatGroupListItem",
63
-  mixins: [tooltip, cometChatCommon],
64
-  components: {
65
-    CometChatAvatar,
66
-  },
67
-  props: {
68
-    /**
69
-     * Group item.
70
-     */
71
-    group: { ...DEFAULT_OBJECT_PROP },
72
-    /**
73
-     * Theme of the UI.
74
-     */
75
-    theme: { ...DEFAULT_OBJECT_PROP },
76
-    /**
77
-     * Selected group item.
78
-     */
79
-    selectedGroup: { ...DEFAULT_OBJECT_PROP },
80
-  },
81
-  computed: {
82
-    /**
83
-     * Computed styles for the component.
84
-     */
85
-    styles() {
86
-      return {
87
-        name: style.itemNameStyle(),
88
-        detail: style.itemDetailStyle(),
89
-        icon: style.listItemIconStyle(),
90
-        thumbnail: style.itemThumbnailStyle(),
91
-        nameWrapper: style.itemNameWrapperStyle(),
92
-        description: style.itemDescriptionStyle(this.theme),
93
-        list: style.listItemStyle(this.theme, this.group, this.selectedGroup),
94
-      };
95
-    },
96
-    /**
97
-     * Icon for group types.
98
-     */
99
-    groupTypeIcons() {
100
-      return { shieldIcon, lockIcon };
101
-    },
102
-    /**
103
-     * Description of group.
104
-     */
105
-    groupDescription() {
106
-      return `${this.group.membersCount} members`;
107
-    },
108
-    /**
109
-     * Local string constants.
110
-     */
111
-    STRINGS() {
112
-      return COMETCHAT_CONSTANTS;
113
-    },
114
-  },
115
-};
116
-</script>
117
-<style scoped>
118
-.group__item--hover:hover {
119
-  background-color: var(--group-item-bg-color-hover);
120
-}
121
-</style>

BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupListItem/resources/lock.png 파일 보기


BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupListItem/resources/shield.png 파일 보기


+ 0
- 76
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupListItem/style.js 파일 보기

@@ -1,76 +0,0 @@
1
-export const listItemStyle = (theme, group, selectedGroup) => {
2
-  const selectedState =
3
-    selectedGroup && selectedGroup.guid === group.guid
4
-      ? {
5
-          backgroundColor: `${theme.backgroundColor.primary}`,
6
-        }
7
-      : {};
8
-
9
-  return {
10
-    display: "flex",
11
-    flexDirection: "row",
12
-    justifyContent: "left",
13
-    alignItems: "center",
14
-    cursor: "pointer",
15
-    width: "100%",
16
-    padding: "10px 20px",
17
-    ...selectedState,
18
-    "--group-item-bg-color-hover": `${theme.backgroundColor.primary}`,
19
-  };
20
-};
21
-
22
-export const listItemIconStyle = () => {
23
-  return {
24
-    width: "auto",
25
-    height: "13px",
26
-    margin: "0 6px",
27
-    marginTop: "-1px",
28
-  };
29
-};
30
-
31
-export const itemThumbnailStyle = () => {
32
-  return {
33
-    display: "inline-block",
34
-    width: "36px",
35
-    height: "36px",
36
-    flexShrink: "0",
37
-  };
38
-};
39
-
40
-export const itemDetailStyle = () => {
41
-  return {
42
-    width: "calc(100% - 70px)",
43
-    flexGrow: "1",
44
-    paddingLeft: "15px",
45
-  };
46
-};
47
-
48
-export const itemNameStyle = () => {
49
-  return {
50
-    maxWidth: "calc(100% - 30px)",
51
-    overflow: "hidden",
52
-    textOverflow: "ellipsis",
53
-    whiteSpace: "nowrap",
54
-    margin: "0",
55
-  };
56
-};
57
-
58
-export const itemNameWrapperStyle = () => {
59
-  return {
60
-    fontSize: "15px",
61
-    fontWeight: "600",
62
-    display: "flex",
63
-    alignItems: "center",
64
-    width: "100%",
65
-    margin: "0",
66
-  };
67
-};
68
-
69
-export const itemDescriptionStyle = (theme) => {
70
-  return {
71
-    borderBottom: `1px solid ${theme.borderColor.primary}`,
72
-    color: `${theme.color.helpText}`,
73
-    padding: "0 0 5px 0",
74
-    fontSize: "12px",
75
-  };
76
-};

+ 0
- 391
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupListWithMessages/CometChatGroupListWithMessages.vue 파일 보기

@@ -1,391 +0,0 @@
1
-<template>
2
-  <div :style="styles.root" class="cometchat__groups">
3
-    <div :style="styles.sidebar" class="groups__sidebar">
4
-      <comet-chat-group-list
5
-        :item="item"
6
-        :type="type"
7
-        :theme="themeValue"
8
-        :group-to-leave="groupToLeave"
9
-        :group-to-delete="groupToDelete"
10
-        :group-to-update="groupToUpdate"
11
-        :enable-close-menu="isItemPresent"
12
-        @action="actionHandler"
13
-      />
14
-    </div>
15
-    <div v-if="isItemPresent" class="groups__main" :style="styles.main">
16
-      <comet-chat-messages
17
-        :tab="tab"
18
-        :item="item"
19
-        :type="type"
20
-        :theme="themeValue"
21
-        :call-message="callMessage"
22
-        :logged-in-user="loggedInUser"
23
-        :group-messages="groupMessages"
24
-        :action-from-listener="actionFromListener"
25
-        :composed-thread-message="composedThreadMessage"
26
-        @action="actionHandler"
27
-      />
28
-    </div>
29
-    <div
30
-      v-if="viewDetailScreen"
31
-      :style="styles.secondary"
32
-      class="groups__secondary-view"
33
-    >
34
-      <comet-chat-group-details
35
-        :item="item"
36
-        :type="type"
37
-        :theme="themeValue"
38
-        @action="actionHandler"
39
-      />
40
-    </div>
41
-    <div
42
-      v-if="viewThreadMessage"
43
-      :style="styles.secondary"
44
-      class="groups__secondary-view"
45
-    >
46
-      <comet-chat-message-thread
47
-        :tab="tab"
48
-        :theme="themeValue"
49
-        :item="threadMessageItem"
50
-        :type="threadMessageType"
51
-        :logged-in-user="loggedInUser"
52
-        :parent-message="threadMessageParent"
53
-        @action="actionHandler"
54
-      />
55
-    </div>
56
-    <comet-chat-incoming-call :theme="themeValue" @action="actionHandler" />
57
-    <comet-chat-outgoing-call
58
-      :item="item"
59
-      :type="type"
60
-      :theme="themeValue"
61
-      :incoming-call="incomingCall"
62
-      :outgoing-call="outgoingCall"
63
-      :logged-in-user="loggedInUser"
64
-      @action="actionHandler"
65
-    />
66
-    <comet-chat-image-viewer
67
-      :open="true"
68
-      v-if="imageView"
69
-      :message="imageView"
70
-      @action="actionHandler"
71
-    />
72
-  </div>
73
-</template>
74
-
75
-<script>
76
-import { DEFAULT_OBJECT_PROP } from "../../../resources/constants";
77
-
78
-import { propertyCheck, cometChatScreens } from "../../../mixins/";
79
-import { CometChatManager } from "../../../util/controller";
80
-import * as enums from "../../../util/enums.js";
81
-
82
-import {
83
-  CometChatMessages,
84
-  CometChatImageViewer,
85
-  CometChatMessageThread,
86
-} from "../../Messages/";
87
-
88
-import { CometChatOutgoingCall, CometChatIncomingCall } from "../../Calls";
89
-
90
-import CometChatGroupDetails from "../CometChatGroupDetails/CometChatGroupDetails";
91
-import CometChatGroupList from "../CometChatGroupList/CometChatGroupList";
92
-
93
-import { theme } from "../../../resources/theme";
94
-
95
-import * as style from "./style";
96
-
97
-/**
98
- * Displays list of group with messages.
99
- *
100
- * @displayName CometChatGroupListWithMessages
101
- */
102
-export default {
103
-  name: "CometChatGroupListWithMessages",
104
-  mixins: [propertyCheck, cometChatScreens],
105
-  components: {
106
-    CometChatImageViewer,
107
-    CometChatIncomingCall,
108
-    CometChatGroupList,
109
-    CometChatOutgoingCall,
110
-    CometChatGroupDetails,
111
-    CometChatMessageThread,
112
-    CometChatMessages,
113
-  },
114
-  props: {
115
-    /**
116
-     * Theme of the UI.
117
-     */
118
-    theme: { ...DEFAULT_OBJECT_PROP },
119
-  },
120
-  data() {
121
-    return {
122
-      item: {},
123
-      type: "group",
124
-      tab: "groups",
125
-      imageView: null,
126
-      callMessage: {},
127
-      groupMessages: [],
128
-      groupToLeave: {},
129
-      groupToDelete: {},
130
-      groupToUpdate: {},
131
-      darkTheme: false,
132
-      incomingCall: null,
133
-      outgoingCall: null,
134
-      viewSidebar: false,
135
-      loggedInUser: null,
136
-      threadMessageItem: {},
137
-      actionFromListener: {},
138
-      threadMessageParent: {},
139
-      threadMessageYype: null,
140
-      viewDetailScreen: false,
141
-      viewThreadMessage: false,
142
-      composedThreadMessage: {},
143
-    };
144
-  },
145
-  computed: {
146
-    /**
147
-     * Theme computed using default theme and theme coming from prop.
148
-     */
149
-    themeValue() {
150
-      return Object.assign({}, theme, this.theme);
151
-    },
152
-    /**
153
-     * Computed styles for the component.
154
-     */
155
-    styles() {
156
-      return {
157
-        root: style.groupScreenStyle(this.themeValue),
158
-        sidebar: style.groupScreenSidebarStyle(
159
-          this.themeValue,
160
-          this.viewSidebar
161
-        ),
162
-        main: style.groupScreenMainStyle(
163
-          this.viewThreadMessage,
164
-          this.viewDetailScreen
165
-        ),
166
-        secondary: style.groupScreenSecondaryStyle(
167
-          this.themeValue,
168
-          this.viewThreadMessage
169
-        ),
170
-      };
171
-    },
172
-  },
173
-  methods: {
174
-    /**
175
-     * Handler for emitted action events
176
-     */
177
-    actionHandler({
178
-      action,
179
-      key,
180
-      type,
181
-      call,
182
-      item,
183
-      count,
184
-      group,
185
-      message,
186
-      members,
187
-      options,
188
-      messages,
189
-      incomingCall,
190
-      rejectedCall,
191
-    }) {
192
-      switch (action) {
193
-        case "item-click":
194
-          this.itemClicked(item, type);
195
-          break;
196
-        case "blockUser":
197
-          this.blockUser();
198
-          break;
199
-        case "unblockUser":
200
-          this.unblockUser();
201
-          break;
202
-        case "audioCall":
203
-          this.audioCall();
204
-          break;
205
-        case "videoCall":
206
-          this.videoCall();
207
-          break;
208
-        case "menuClicked":
209
-          this.toggleSideBar();
210
-          this.item = {};
211
-          break;
212
-        case "closeMenuClicked":
213
-          this.toggleSideBar();
214
-          break;
215
-        case "viewDetail":
216
-        case "closeDetailClicked":
217
-          this.toggleDetailView();
218
-          break;
219
-        case "groupUpdated":
220
-          this.groupUpdated(key, options);
221
-          break;
222
-        case "groupDeleted":
223
-          this.deleteGroup(group);
224
-          break;
225
-        case "leftGroup":
226
-          this.leaveGroup(group);
227
-          break;
228
-        case "membersUpdated":
229
-          this.updateMembersCount(count);
230
-          break;
231
-        case "viewMessageThread":
232
-          this.viewMessageThread(message);
233
-          break;
234
-        case "closeThreadClicked":
235
-          this.closeThreadMessages();
236
-          break;
237
-        case "threadMessageComposed":
238
-          this.onThreadMessageComposed(messages);
239
-          break;
240
-        case "acceptIncomingCall":
241
-          this.acceptIncomingCall(incomingCall);
242
-          break;
243
-        case "acceptedIncomingCall":
244
-          this.appendCallMessage(call);
245
-          break;
246
-        case "rejectedIncomingCall":
247
-          this.rejectedIncomingCall(incomingCall, rejectedCall);
248
-          break;
249
-        case "outgoingCallRejected":
250
-        case "outgoingCallCancelled":
251
-        case "callEnded":
252
-          this.outgoingCallEnded(call);
253
-          break;
254
-        case "userJoinedCall":
255
-        case "userLeftCall":
256
-          this.appendCallMessage(call);
257
-          break;
258
-        case "viewActualImage":
259
-          this.setImageView(message);
260
-          break;
261
-        case "closeActualImage":
262
-          this.setImageView(null);
263
-          break;
264
-        case "membersAdded":
265
-          this.membersAdded(members);
266
-          break;
267
-        case "memberUnbanned":
268
-          this.memberUnbanned(members);
269
-          break;
270
-        case "memberScopeChanged":
271
-          this.memberScopeChanged(members);
272
-          break;
273
-        case "messageDeleted":
274
-          this.closeThreadMessages();
275
-          break;
276
-        case "messageEdited":
277
-          this.updateThreadMessage(message);
278
-          break;
279
-        case "listenerData":
280
-          this.actionFromListener = { action: action, messages: [...messages] };
281
-          break;
282
-        default:
283
-          break;
284
-      }
285
-    },
286
-    /**
287
-     * Updates group
288
-     */
289
-    groupUpdated(key, options) {
290
-      this.groupMessages = [];
291
-
292
-      switch (key) {
293
-        case enums.GROUP_MEMBER_BANNED:
294
-        case enums.GROUP_MEMBER_KICKED: {
295
-          if (options.user.uid === this.loggedInUser.uid) {
296
-            this.item = {};
297
-            this.type = "group";
298
-            this.viewDetailScreen = false;
299
-          }
300
-          break;
301
-        }
302
-        case enums.GROUP_MEMBER_SCOPE_CHANGED: {
303
-          if (options.user.uid === this.loggedInUser.uid) {
304
-            const newObj = Object.assign({}, this.item, {
305
-              scope: options["scope"],
306
-            });
307
-
308
-            this.item = newObj;
309
-            this.type = "group";
310
-            this.viewDetailScreen = false;
311
-          }
312
-          break;
313
-        }
314
-        default:
315
-          break;
316
-      }
317
-    },
318
-    /**
319
-     * Deletes group
320
-     */
321
-    deleteGroup(group) {
322
-      this.groupToDelete = group;
323
-
324
-      this.resetGroup();
325
-    },
326
-    /**
327
-     * Leaves group
328
-     */
329
-    leaveGroup(group) {
330
-      this.groupToLeave = group;
331
-
332
-      this.resetGroup();
333
-    },
334
-    /**
335
-     * Reset group
336
-     */
337
-    resetGroup() {
338
-      this.item = {};
339
-      this.type = "group";
340
-      this.viewDetailScreen = false;
341
-    },
342
-  },
343
-  beforeMount() {
344
-    if (!Object.keys(this.item).length) {
345
-      this.toggleSideBar();
346
-    }
347
-
348
-    (async () => {
349
-      try {
350
-        this.loggedInUser = await new CometChatManager().getLoggedInUser();
351
-      } catch (error) {
352
-        this.logError(
353
-          "[CometChatUserListWithMessages] getLoggedInUser error",
354
-          error
355
-        );
356
-      }
357
-    })();
358
-  },
359
-};
360
-</script>
361
-<style scoped>
362
-.cometchat__groups * {
363
-  box-sizing: border-box;
364
-  font-family: var(--cometchat-font-family) !important;
365
-}
366
-@media (min-width: 320px) and (max-width: 767px) {
367
-  .groups__sidebar {
368
-    top: 0;
369
-    bottom: 0;
370
-    z-index: 2;
371
-    width: 100% !important;
372
-    transition: all 0.3s ease-out;
373
-    position: absolute !important;
374
-    left: var(--cometchat-groups-sidebar-left);
375
-    background-color: var(--cometchat-groups-sidebar-bg);
376
-    box-shadow: var(--cometchat-groups-sidebar-box-shadow);
377
-  }
378
-  .groups__main {
379
-    width: 100% !important;
380
-  }
381
-  .groups__secondary-view {
382
-    top: 0;
383
-    bottom: 0;
384
-    z-index: 2;
385
-    right: 0 !important;
386
-    width: 100% !important;
387
-    position: absolute !important;
388
-    background-color: var(--groups-secondary-bg-color) !important;
389
-  }
390
-}
391
-</style>

+ 0
- 64
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatGroupListWithMessages/style.js 파일 보기

@@ -1,64 +0,0 @@
1
-export const groupScreenStyle = (theme) => {
2
-  return {
3
-    display: "flex",
4
-    height: "100%",
5
-    width: "100%",
6
-    boxSizing: "border-box",
7
-    fontFamily: `${theme.fontFamily}`,
8
-    "--cometchat-font-family": `${theme.fontFamily}`,
9
-  };
10
-};
11
-
12
-export const groupScreenSidebarStyle = (theme, sidebarView) => {
13
-  const sidebar = sidebarView
14
-    ? {
15
-        "--cometchat-groups-sidebar-left": "0",
16
-        "--cometchat-groups-sidebar-box-shadow":
17
-          "rgba(0, 0, 0, .4) -30px 0 30px 30px",
18
-      }
19
-    : {};
20
-
21
-  return {
22
-    width: "280px",
23
-    borderRight: `1px solid ${theme.borderColor.primary}`,
24
-    height: "100%",
25
-    position: "relative",
26
-    display: "flex",
27
-    flexDirection: "column",
28
-    "--cometchat-groups-sidebar-left": "-100%",
29
-    "--cometchat-groups-sidebar-bg": `${theme.backgroundColor.white}`,
30
-    ...sidebar,
31
-  };
32
-};
33
-
34
-export const groupScreenMainStyle = (threadMessageView, detailView) => {
35
-  const secondaryView = threadMessageView
36
-    ? {
37
-        width: "calc(100% - 680px)",
38
-      }
39
-    : detailView
40
-    ? {
41
-        width: "calc(100% - 580px)",
42
-      }
43
-    : {};
44
-
45
-  return {
46
-    width: "calc(100% - 280px)",
47
-    height: "100%",
48
-    order: "2",
49
-    ...secondaryView,
50
-  };
51
-};
52
-
53
-export const groupScreenSecondaryStyle = (theme, threadMessageView) => {
54
-  return {
55
-    float: "right",
56
-    borderLeft: `1px solid ${theme.borderColor.primary}`,
57
-    height: "100%",
58
-    width: threadMessageView ? "400px" : "300px",
59
-    display: "flex",
60
-    flexDirection: "column",
61
-    order: "3",
62
-    "--groups-secondary-bg-color": `${theme.backgroundColor.white}`,
63
-  };
64
-};

+ 0
- 260
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatViewGroupMemberList/CometChatViewGroupMemberList.vue 파일 보기

@@ -1,260 +0,0 @@
1
-<template>
2
-  <div>
3
-    <comet-chat-backdrop :show="open" @click="closeModal" />
4
-    <div :style="styles.modalWrapper" class="modal__viewmembers">
5
-      <span title="Close" :style="styles.modalClose" @click="closeModal"></span>
6
-      <div :style="styles.modalBody">
7
-        <table :style="styles.modalTable">
8
-          <caption :style="styles.tableCaption">
9
-            {{
10
-              STRINGS.GROUP_MEMBERS
11
-            }}
12
-          </caption>
13
-          <thead>
14
-            <tr :style="styles.modalTable.tr">
15
-              <th :style="styles.modalTable.tr.th">{{ STRINGS.NAME }}</th>
16
-              <th :style="styles.modalTable.tr.th" class="viemembers__scope">
17
-                {{ STRINGS.SCOPE }}
18
-              </th>
19
-              <template v-if="canEdit">
20
-                <th
21
-                  :style="{
22
-                    ...styles.modalTable.tr.th,
23
-                    ...styles.actionColumn,
24
-                  }"
25
-                  class="viemembers__actions"
26
-                >
27
-                  {{ STRINGS.BAN }}
28
-                </th>
29
-                <th
30
-                  :style="{
31
-                    ...styles.modalTable.tr.th,
32
-                    ...styles.actionColumn,
33
-                  }"
34
-                  class="viemembers__actions"
35
-                >
36
-                  {{ STRINGS.KICK }}
37
-                </th>
38
-              </template>
39
-            </tr>
40
-          </thead>
41
-          <tbody :style="styles.tableBody" @scroll="scrollHandler">
42
-            <!--eslint-disable-->
43
-            <template 
44
-              v-for="(member, i) in membersList"
45
-            >
46
-              <comet-chat-view-group-member-list-item
47
-                :item="item"
48
-                :theme="theme"
49
-                :member="member"
50
-                :logged-in-user="loggedInUser"
51
-                @action="updateMembersHandler"
52
-              />
53
-            </template>
54
-          </tbody>
55
-        </table>
56
-      </div>
57
-    </div>
58
-  </div>
59
-</template>
60
-<script>
61
-import { CometChat } from "@cometchat-pro/chat";
62
-
63
-import {
64
-  COMETCHAT_CONSTANTS,
65
-  DEFAULT_ARRAY_PROP,
66
-  DEFAULT_OBJECT_PROP,
67
-  DEFAULT_BOOLEAN_PROP,
68
-} from "../../../resources/constants";
69
-
70
-import { cometChatCommon, propertyCheck } from "../../../mixins/";
71
-
72
-import { CometChatBackdrop } from "../../Shared/";
73
-import CometChatViewGroupMemberListItem from "../CometChatViewGroupMemberListItem/CometChatViewGroupMemberListItem";
74
-
75
-import clearIcon from "./resources/close.png";
76
-
77
-import * as style from "./style";
78
-
79
-/**
80
- * Displays list of group members.
81
- *
82
- * @displayName CometChatViewGroupMemberList
83
- */
84
-export default {
85
-  name: "CometChatViewGroupMemberList",
86
-  mixins: [cometChatCommon, propertyCheck],
87
-  components: {
88
-    CometChatBackdrop,
89
-    CometChatViewGroupMemberListItem,
90
-  },
91
-  props: {
92
-    /**
93
-     * The selected chat item object.
94
-     */
95
-    item: { ...DEFAULT_OBJECT_PROP },
96
-    /**
97
-     * Opens the modal.
98
-     */
99
-    open: { ...DEFAULT_BOOLEAN_PROP },
100
-    /**
101
-     * Theme of the UI.
102
-     */
103
-    theme: { ...DEFAULT_OBJECT_PROP },
104
-    /**
105
-     * List of all members.
106
-     */
107
-    membersList: { ...DEFAULT_ARRAY_PROP },
108
-    /**
109
-     * Current logged in user.
110
-     */
111
-    loggedInUser: { ...DEFAULT_OBJECT_PROP },
112
-  },
113
-  computed: {
114
-    /**
115
-     * Computed styles for the component.
116
-     */
117
-    styles() {
118
-      return {
119
-        modalBody: style.modalBodyCtyle(),
120
-        tableBody: style.tableBodyStyle(),
121
-        tableCaption: style.tableCaptionStyle(),
122
-        actionColumn: style.actionColumnStyle(),
123
-        modalClose: style.modalCloseStyle(clearIcon),
124
-        modalTable: style.modalTableStyle(this.theme),
125
-        modalWrapper: style.modalWrapperStyle(this.theme, this.open),
126
-      };
127
-    },
128
-    /**
129
-     * Returns if user can edit scope(ban/kick) members.
130
-     */
131
-    canEdit() {
132
-      let flag = false;
133
-
134
-      if (this.item.scope !== CometChat.GROUP_MEMBER_SCOPE.PARTICIPANT) {
135
-        flag = true;
136
-      }
137
-
138
-      return flag;
139
-    },
140
-    /**
141
-     * Local string constants.
142
-     */
143
-    STRINGS() {
144
-      return COMETCHAT_CONSTANTS;
145
-    },
146
-  },
147
-  methods: {
148
-    /**
149
-     * Closes modal
150
-     */
151
-    closeModal() {
152
-      this.emitEvent("close");
153
-    },
154
-    /**
155
-     * Handler for group member list scroll
156
-     */
157
-    scrollHandler(e) {
158
-      try {
159
-        const bottom =
160
-          Math.round(
161
-            e.currentTarget.scrollHeight - e.currentTarget.scrollTop
162
-          ) === Math.round(e.currentTarget.clientHeight);
163
-
164
-        if (bottom) {
165
-          this.emitAction("fetchGroupMembers");
166
-        }
167
-      } catch (error) {
168
-        this.logError("Error in group member scroll ", error);
169
-      }
170
-    },
171
-    /**
172
-     * Handler for emitted action events
173
-     */
174
-    updateMembersHandler({ action, member, scope }) {
175
-      switch (action) {
176
-        case "ban":
177
-          this.banMember(member);
178
-          break;
179
-        case "kick":
180
-          this.kickMember(member);
181
-          break;
182
-        case "changeScope":
183
-          this.changeScope(member, scope);
184
-          break;
185
-        default:
186
-          break;
187
-      }
188
-    },
189
-    /**
190
-     * Bans a member
191
-     */
192
-    async banMember(memberToBan) {
193
-      try {
194
-        const guid = this.item.guid;
195
-
196
-        const response = await CometChat.banGroupMember(guid, memberToBan.uid);
197
-
198
-        if (response) {
199
-          this.emitAction("removeGroupParticipants", { member: memberToBan });
200
-        }
201
-      } catch (error) {
202
-        this.logError("banGroupMember failed with error: ", error);
203
-      }
204
-    },
205
-    /**
206
-     * Kicks a member
207
-     */
208
-    async kickMember(memberToKick) {
209
-      try {
210
-        const guid = this.item.guid;
211
-        const response = await CometChat.kickGroupMember(
212
-          guid,
213
-          memberToKick.uid
214
-        );
215
-
216
-        if (response) {
217
-          this.emitAction("removeGroupParticipants", { member: memberToKick });
218
-        }
219
-      } catch (error) {
220
-        this.logError("kickGroupMember failed with error: ", error);
221
-      }
222
-    },
223
-    /**
224
-     * Changes scope of a member
225
-     */
226
-    async changeScope(member, scope = "participant") {
227
-      try {
228
-        const guid = this.item.guid;
229
-
230
-        const response = await CometChat.updateGroupMemberScope(
231
-          guid,
232
-          member.uid,
233
-          scope
234
-        );
235
-
236
-        if (response) {
237
-          const updatedMember = Object.assign({}, member, { scope: scope });
238
-          this.emitAction("updateGroupParticipants", { member: updatedMember });
239
-        }
240
-      } catch (error) {
241
-        this.logError("updateGroupMemberScope failed with error: ", error);
242
-      }
243
-    },
244
-  },
245
-};
246
-</script>
247
-<style scoped>
248
-@media (min-width: 320px) and (max-width: 767px) {
249
-  .modal__viewmembers {
250
-    width: 100% !important;
251
-    height: 100% !important;
252
-  }
253
-  .viemembers__scope {
254
-    width: 170px;
255
-  }
256
-  .viemembers__actions {
257
-    width: 55px !important;
258
-  }
259
-}
260
-</style>

BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatViewGroupMemberList/resources/close.png 파일 보기


+ 0
- 92
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatViewGroupMemberList/style.js 파일 보기

@@ -1,92 +0,0 @@
1
-export const modalWrapperStyle = (theme, open) => {
2
-  const show = open
3
-    ? {
4
-        display: "block",
5
-      }
6
-    : {};
7
-
8
-  return {
9
-    minWidth: "350px",
10
-    minHeight: "450px",
11
-    width: "50%",
12
-    height: "40%",
13
-    overflow: "hidden",
14
-    backgroundColor: `${theme.backgroundColor.white}`,
15
-    position: "fixed",
16
-    left: "50%",
17
-    top: "50%",
18
-    transform: "translate(-50%, -50%)",
19
-    zIndex: "1002",
20
-    margin: "0 auto",
21
-    boxShadow:
22
-      "rgba(20, 20, 20, 0.2) 0 16px 32px, rgba(20, 20, 20, 0.04) 0 0 0 1px",
23
-    borderRadius: "12px",
24
-    display: "none",
25
-    ...show,
26
-  };
27
-};
28
-
29
-export const modalCloseStyle = (img) => {
30
-  return {
31
-    position: "absolute",
32
-    width: "32px",
33
-    height: "32px",
34
-    borderRadius: "50%",
35
-    top: "20px",
36
-    right: "16px",
37
-    background: `url(${img}) center center / 18px no-repeat`,
38
-    cursor: "pointer",
39
-  };
40
-};
41
-
42
-export const modalBodyCtyle = () => {
43
-  return {
44
-    padding: "25px",
45
-    height: "100%",
46
-    width: "100%",
47
-  };
48
-};
49
-
50
-export const modalTableStyle = (theme) => {
51
-  return {
52
-    borderCollapse: "collapse",
53
-    margin: "0",
54
-    padding: "0",
55
-    width: "100%",
56
-    height: "90%",
57
-    tr: {
58
-      border: `1px solid ${theme.borderColor.primary}`,
59
-      display: "table",
60
-      width: "100%",
61
-      tableLayout: "fixed",
62
-      th: {
63
-        padding: "8px",
64
-        fontSize: "12px",
65
-        textAlign: "left",
66
-      },
67
-    },
68
-  };
69
-};
70
-
71
-export const tableCaptionStyle = () => {
72
-  return {
73
-    fontSize: "20px",
74
-    marginBottom: "15px",
75
-    fontWeight: "bold",
76
-    textAlign: "left",
77
-  };
78
-};
79
-
80
-export const tableBodyStyle = () => {
81
-  return {
82
-    height: "325px",
83
-    overflowY: "auto",
84
-    display: "block",
85
-  };
86
-};
87
-
88
-export const actionColumnStyle = () => {
89
-  return {
90
-    width: "70px",
91
-  };
92
-};

+ 0
- 345
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatViewGroupMemberListItem/CometChatViewGroupMemberListItem.vue 파일 보기

@@ -1,345 +0,0 @@
1
-<template>
2
-  <tr :style="styles.tableRow">
3
-    <td
4
-      :style="styles.tableColumn"
5
-      @mouseenter="toggleTooltip($event, true)"
6
-      @mouseleave="toggleTooltip($event, false)"
7
-    >
8
-      <div :style="styles.avatar" class="member__list__avatar">
9
-        <comet-chat-avatar
10
-          border-width="1px"
11
-          corner-radius="18px"
12
-          :image="member.avatar"
13
-          :border-color="theme.borderColor.primary"
14
-        />
15
-
16
-        <comet-chat-user-presence
17
-          border-width="1px"
18
-          corner-radius="50%"
19
-          :status="member.status"
20
-          :border-color="theme.borderColor.primary"
21
-        />
22
-      </div>
23
-      <div :style="styles.name" class="member__list__name">
24
-        {{ displayName }}
25
-      </div>
26
-    </td>
27
-    <td class="member__list__scope__column">
28
-      <div :style="styles.scopeWrapper">
29
-        <template v-if="showChangeScope && canChangeScope">
30
-          <select
31
-            :default-value="member.scope"
32
-            :style="styles.scopeSelection"
33
-            @change="scopeChangeHandler"
34
-          >
35
-            <option :value="COMET_CHAT.GROUP_MEMBER_SCOPE.PARTICIPANT">
36
-              {{ roles[COMET_CHAT.GROUP_MEMBER_SCOPE.PARTICIPANT] }}
37
-            </option>
38
-            <option :value="COMET_CHAT.GROUP_MEMBER_SCOPE.MODERATOR">
39
-              {{ roles[COMET_CHAT.GROUP_MEMBER_SCOPE.MODERATOR] }}
40
-            </option>
41
-            <option
42
-              v-if="!isNotAdmin"
43
-              :value="COMET_CHAT.GROUP_MEMBER_SCOPE.ADMIN"
44
-            >
45
-              {{ roles[COMET_CHAT.GROUP_MEMBER_SCOPE.ADMIN] }}
46
-            </option>
47
-          </select>
48
-          <div>
49
-            <img
50
-              :src="icons.done"
51
-              :alt="STRINGS.CHANGE_SCOPE"
52
-              :style="styles.scopeWrapper.img"
53
-              @click="updateMemberScope"
54
-            />
55
-            <img
56
-              :src="icons.clear"
57
-              :alt="STRINGS.CHANGE_SCOPE"
58
-              :style="{
59
-                ...styles.scopeWrapper.img,
60
-                ...styles.scopeWrapper.clear,
61
-              }"
62
-              @click="changeScopeView(false)"
63
-            />
64
-          </div>
65
-        </template>
66
-        <template v-else>
67
-          <span :style="styles.role">
68
-            {{ scopeName }}
69
-          </span>
70
-
71
-          <img
72
-            :src="icons.scope"
73
-            v-if="canChangeScope"
74
-            :style="styles.scopeImage"
75
-            :alt="STRINGS.CHANGE_SCOPE"
76
-            @click="changeScopeView(true)"
77
-          />
78
-        </template>
79
-      </div>
80
-    </td>
81
-    <template v-if="canEdit">
82
-      <td :style="styles.actionColumn" class="member__list__action__column">
83
-        <span>
84
-          <img
85
-            :src="icons.ban"
86
-            :alt="STRINGS.BAN"
87
-            v-if="canViewAction"
88
-            :style="styles.actionColumn.img"
89
-            @click="emitAction('ban', { member })"
90
-        /></span>
91
-      </td>
92
-      <td :style="styles.actionColumn" class="member__list__action__column">
93
-        <span>
94
-          <img
95
-            :src="icons.kick"
96
-            :alt="STRINGS.KICK"
97
-            v-if="canViewAction"
98
-            :style="{ ...styles.actionColumn.img, ...styles.actionColumn.kick }"
99
-            @click="emitAction('kick', { member })"
100
-        /></span>
101
-      </td>
102
-    </template>
103
-  </tr>
104
-</template>
105
-<script>
106
-import { CometChat } from "@cometchat-pro/chat";
107
-
108
-import {
109
-  COMETCHAT_CONSTANTS,
110
-  DEFAULT_OBJECT_PROP,
111
-} from "../../../resources/constants";
112
-
113
-import { tooltip, propertyCheck, cometChatCommon } from "../../../mixins/";
114
-
115
-import { CometChatAvatar, CometChatUserPresence } from "../../Shared";
116
-
117
-import * as style from "./style";
118
-
119
-import clearIcon from "./resources/close.png";
120
-import kickIcon from "./resources/delete.png";
121
-import scopeIcon from "./resources/edit.png";
122
-import doneIcon from "./resources/done.png";
123
-import banIcon from "./resources/block.png";
124
-
125
-/**
126
- * List item for group member list.
127
- *
128
- * @displayName CometChatViewGroupMemberListItem
129
- */
130
-
131
-export default {
132
-  name: "CometChatViewGroupMemberListItem",
133
-  mixins: [tooltip, propertyCheck, cometChatCommon],
134
-  components: {
135
-    CometChatAvatar,
136
-    CometChatUserPresence,
137
-  },
138
-  props: {
139
-    /**
140
-     * The selected chat item object.
141
-     */
142
-    item: { ...DEFAULT_OBJECT_PROP },
143
-    /**
144
-     * Theme of the UI.
145
-     */
146
-    theme: { ...DEFAULT_OBJECT_PROP },
147
-    /**
148
-     * Member item.
149
-     */
150
-    member: { ...DEFAULT_OBJECT_PROP },
151
-    /**
152
-     * Current logged in user.
153
-     */
154
-    loggedInUser: { ...DEFAULT_OBJECT_PROP },
155
-  },
156
-  data() {
157
-    return {
158
-      roles: {},
159
-      scope: "participant",
160
-      showChangeScope: false,
161
-    };
162
-  },
163
-  computed: {
164
-    /**
165
-     * Computed styles for the component.
166
-     */
167
-    styles() {
168
-      return {
169
-        role: style.roleStyle(),
170
-        scopeImage: style.scopeImageStyle(),
171
-        tableColumn: style.tableColumnStyle(),
172
-        actionColumn: style.actionColumnStyle(),
173
-        scopeWrapper: style.scopeWrapperStyle(),
174
-        tableRow: style.tableRowStyle(this.theme),
175
-        name: style.nameStyle(this.isParticipant),
176
-        scopeSelection: style.scopeSelectionStyle(),
177
-        avatar: style.avatarStyle(this.isParticipant),
178
-      };
179
-    },
180
-    /**
181
-     * Computed scope name.
182
-     */
183
-    scopeName() {
184
-      return this.isOwner
185
-        ? COMETCHAT_CONSTANTS.OWNER
186
-        : this.roles[this.member.scope];
187
-    },
188
-    /**
189
-     * Computed display name.
190
-     */
191
-    displayName() {
192
-      return this.isCurrentUser ? COMETCHAT_CONSTANTS.YOU : this.member.name;
193
-    },
194
-    /**
195
-     * Returns if current member is owner.
196
-     */
197
-    isOwner() {
198
-      return this.item.owner === this.member.uid;
199
-    },
200
-    /**
201
-     * Returns if current member is current user.
202
-     */
203
-    isCurrentUser() {
204
-      return this.loggedInUser.uid === this.member.uid;
205
-    },
206
-    /**
207
-     * Returns if current member is moderator.
208
-     */
209
-    isModerator() {
210
-      return (
211
-        this.item.scope === CometChat.GROUP_MEMBER_SCOPE.MODERATOR &&
212
-        (this.member.scope === CometChat.GROUP_MEMBER_SCOPE.ADMIN ||
213
-          this.member.scope === CometChat.GROUP_MEMBER_SCOPE.MODERATOR)
214
-      );
215
-    },
216
-    /**
217
-     * Returns if current member is admin but not owner.
218
-     */
219
-    isAdminButNotOwner() {
220
-      return (
221
-        this.item.owner !== this.loggedInUser.uid &&
222
-        this.item.scope === CometChat.GROUP_MEMBER_SCOPE.ADMIN &&
223
-        this.member.scope === CometChat.GROUP_MEMBER_SCOPE.ADMIN
224
-      );
225
-    },
226
-    /**
227
-     * Returns if current member is not admin.
228
-     */
229
-    isNotAdmin() {
230
-      return (
231
-        this.item.scope === CometChat.GROUP_MEMBER_SCOPE.MODERATOR &&
232
-        this.member.scope === CometChat.GROUP_MEMBER_SCOPE.PARTICIPANT
233
-      );
234
-    },
235
-    /**
236
-     * Returns if current member is participant.
237
-     */
238
-    isParticipant() {
239
-      return this.item.scope === CometChat.GROUP_MEMBER_SCOPE.PARTICIPANT;
240
-    },
241
-    /**
242
-     * Returns if current member can view actions.
243
-     */
244
-    canViewAction() {
245
-      return !(
246
-        this.isOwner ||
247
-        this.isCurrentUser ||
248
-        this.isModerator ||
249
-        this.isAdminButNotOwner
250
-      );
251
-    },
252
-    /**
253
-     * Returns if current member can change scope.
254
-     */
255
-    canChangeScope() {
256
-      return !(
257
-        this.isOwner ||
258
-        this.isCurrentUser ||
259
-        this.isModerator ||
260
-        this.isAdminButNotOwner ||
261
-        this.isParticipant
262
-      );
263
-    },
264
-
265
-    /**
266
-     * Returns if current member can edit(ban/kick).
267
-     */
268
-    canEdit() {
269
-      return this.isParticipant ? false : true;
270
-    },
271
-    /**
272
-     * Icon images.
273
-     */
274
-    icons() {
275
-      return {
276
-        ban: banIcon,
277
-        kick: kickIcon,
278
-        done: doneIcon,
279
-        scope: scopeIcon,
280
-        clear: clearIcon,
281
-      };
282
-    },
283
-    /**
284
-     * Instance of "CometChat" to use in Vue html template.
285
-     */
286
-    COMET_CHAT() {
287
-      return CometChat;
288
-    },
289
-    /**
290
-     * Local string constants.
291
-     */
292
-    STRINGS() {
293
-      return COMETCHAT_CONSTANTS;
294
-    },
295
-  },
296
-  methods: {
297
-    /**
298
-     * Updates scope
299
-     */
300
-    scopeChangeHandler(event) {
301
-      this.scope = event.target.value;
302
-    },
303
-    /**
304
-     * Emits changeScope event
305
-     */
306
-    updateMemberScope() {
307
-      this.emitAction("changeScope", {
308
-        member: this.member,
309
-        scope: this.scope,
310
-      });
311
-      this.changeScopeView(false);
312
-    },
313
-    /**
314
-     * Toggles scope icon view
315
-     */
316
-    changeScopeView(value) {
317
-      this.showChangeScope = value;
318
-    },
319
-  },
320
-  beforeMount() {
321
-    this.roles[CometChat.GROUP_MEMBER_SCOPE.ADMIN] =
322
-      COMETCHAT_CONSTANTS.ADMINISTRATOR;
323
-    this.roles[CometChat.GROUP_MEMBER_SCOPE.MODERATOR] =
324
-      COMETCHAT_CONSTANTS.MODERATOR;
325
-    this.roles[CometChat.GROUP_MEMBER_SCOPE.PARTICIPANT] =
326
-      COMETCHAT_CONSTANTS.PARTICIPANT;
327
-  },
328
-};
329
-</script>
330
-<style scoped>
331
-@media (min-width: 320px) and (max-width: 767px) {
332
-  .member__list__avatar {
333
-    display: var(--members-avatar-display) !important;
334
-  }
335
-  .member__list__name {
336
-    width: var(--members-name-width) !important;
337
-  }
338
-  .member__list__scope__column {
339
-    width: 180px !important;
340
-  }
341
-  .member__list__action__column {
342
-    width: 54px !important;
343
-  }
344
-}
345
-</style>

BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatViewGroupMemberListItem/resources/block.png 파일 보기


BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatViewGroupMemberListItem/resources/close.png 파일 보기


BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatViewGroupMemberListItem/resources/delete.png 파일 보기


BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatViewGroupMemberListItem/resources/done.png 파일 보기


BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatViewGroupMemberListItem/resources/edit.png 파일 보기


+ 0
- 116
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/CometChatViewGroupMemberListItem/style.js 파일 보기

@@ -1,116 +0,0 @@
1
-export const tableRowStyle = (theme) => {
2
-  return {
3
-    border: `1px solid ${theme.borderColor.primary}`,
4
-    borderTop: "none",
5
-    display: "table",
6
-    width: "100%",
7
-    tableLayout: "fixed",
8
-    fontSize: "14px",
9
-  };
10
-};
11
-
12
-export const tableColumnStyle = () => {
13
-  return {
14
-    padding: "8px",
15
-  };
16
-};
17
-
18
-export const avatarStyle = (participantView) => {
19
-  const displayProp = participantView
20
-    ? {
21
-        "--members-avatar-display": "none",
22
-      }
23
-    : {};
24
-
25
-  return {
26
-    display: "inline-block",
27
-    float: "left",
28
-    width: "36px",
29
-    height: "36px",
30
-    ...displayProp,
31
-  };
32
-};
33
-
34
-export const nameStyle = (participantView) => {
35
-  const widthProp = participantView
36
-    ? {
37
-        "--members-name-width": "100%",
38
-      }
39
-    : {};
40
-
41
-  return {
42
-    margin: "10px 0",
43
-    paddingLeft: "8px",
44
-    width: "calc(100% - 50px)",
45
-    overflow: "hidden",
46
-    textOverflow: "ellipsis",
47
-    whiteSpace: "nowrap",
48
-    ...widthProp,
49
-  };
50
-};
51
-
52
-export const roleStyle = () => {
53
-  return {
54
-    padding: "5px",
55
-    float: "left",
56
-    fontSize: "12px",
57
-  };
58
-};
59
-
60
-export const scopeImageStyle = () => {
61
-  return {
62
-    width: "16px",
63
-    height: "16px",
64
-    cursor: "pointer",
65
-    margin: "4px",
66
-  };
67
-};
68
-
69
-export const actionColumnStyle = () => {
70
-  return {
71
-    width: "70px",
72
-    padding: "8px",
73
-    img: {
74
-      width: "20px",
75
-      height: "20px",
76
-      cursor: "pointer",
77
-    },
78
-    kick: {
79
-      width: "16px",
80
-      height: "17px",
81
-    },
82
-  };
83
-};
84
-
85
-export const scopeWrapperStyle = () => {
86
-  return {
87
-    float: "left",
88
-    width: "100%",
89
-    transition: "opacity .1s linear",
90
-    img: {
91
-      width: "20px",
92
-      height: "20px",
93
-      margin: "4px",
94
-      cursor: "pointer",
95
-      float: "left",
96
-    },
97
-    clear: {
98
-      width: "16px",
99
-      height: "16px",
100
-      margin: "6px 4px",
101
-    },
102
-  };
103
-};
104
-
105
-export const scopeSelectionStyle = () => {
106
-  return {
107
-    width: "65%",
108
-    border: "0",
109
-    boxShadow: "rgba(20, 20, 20, 0.04) 0 0 0 1px inset",
110
-    borderRadius: "8px",
111
-    backgroundColor: `rgba(20, 20, 20, 0.04)`,
112
-    padding: "6px",
113
-    color: `rgba(20, 20, 20, 0.6)`,
114
-    float: "left",
115
-  };
116
-};

+ 0
- 11
frontend/src/cometchat-pro-vue-ui-kit/src/components/Groups/index.js 파일 보기

@@ -1,11 +0,0 @@
1
-export { default as CometChatAddGroupMemberList } from "./CometChatAddGroupMemberList/CometChatAddGroupMemberList";
2
-export { default as CometChatAddGroupMemberListItem } from "./CometChatAddGroupMemberListItem/CometChatAddGroupMemberListItem";
3
-export { default as CometChatBanGroupMemberList } from "./CometChatBanGroupMemberList/CometChatBanGroupMemberList";
4
-export { default as CometChatBanGroupMemberListItem } from "./CometChatBanGroupMemberListItem/CometChatBanGroupMemberListItem";
5
-export { default as CometChatCreateGroup } from "./CometChatCreateGroup/CometChatCreateGroup";
6
-export { default as CometChatGroupDetails } from "./CometChatGroupDetails/CometChatGroupDetails";
7
-export { default as CometChatGroupList } from "./CometChatGroupList/CometChatGroupList";
8
-export { default as CometChatGroupListItem } from "./CometChatGroupListItem/CometChatGroupListItem";
9
-export { default as CometChatGroupListWithMessages } from "./CometChatGroupListWithMessages/CometChatGroupListWithMessages";
10
-export { default as CometChatViewGroupMemberList } from "./CometChatViewGroupMemberList/CometChatViewGroupMemberList";
11
-export { default as CometChatViewGroupMemberListItem } from "./CometChatViewGroupMemberListItem/CometChatViewGroupMemberListItem";

+ 0
- 161
frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatActionMessageBubble/CometChatActionMessageBubble.vue 파일 보기

@@ -1,161 +0,0 @@
1
-<template>
2
-  <div :style="styles.message">
3
-    <p :style="styles.messageTxt">{{ messageText }}</p>
4
-  </div>
5
-</template>
6
-<script>
7
-import { CometChat } from "@cometchat-pro/chat";
8
-
9
-import {
10
-  COMETCHAT_CONSTANTS,
11
-  DEFAULT_OBJECT_PROP,
12
-} from "../../../resources/constants";
13
-
14
-import * as style from "./style";
15
-
16
-/**
17
- * Message bubble for action messages.
18
- *
19
- * @displayName CometChatActionMessageBubble
20
- */
21
-export default {
22
-  name: "CometChatActionMessageBubble",
23
-  props: {
24
-    /**
25
-     * The message object.
26
-     */
27
-    message: { ...DEFAULT_OBJECT_PROP },
28
-    /**
29
-     * Current logged in user.
30
-     */
31
-    loggedInUser: { ...DEFAULT_OBJECT_PROP },
32
-  },
33
-  computed: {
34
-    /**
35
-     * Computed styles for the bubble.
36
-     */
37
-    styles() {
38
-      return {
39
-        message: style.callMessageStyle(),
40
-        messageTxt: style.callMessageTxtStyle(),
41
-      };
42
-    },
43
-    /**
44
-     * The computed message text to display.
45
-     */
46
-    messageText() {
47
-      const call = this.message;
48
-      const loggedInUser = this.loggedInUser;
49
-
50
-      let message = null;
51
-      switch (call.status) {
52
-        case CometChat.CALL_STATUS.INITIATED: {
53
-          message = COMETCHAT_CONSTANTS.CALL_INITIATED;
54
-          if (call.type === CometChat.CALL_TYPE.AUDIO) {
55
-            if (call.receiverType === CometChat.RECEIVER_TYPE.USER) {
56
-              message =
57
-                call.callInitiator.uid === loggedInUser.uid
58
-                  ? COMETCHAT_CONSTANTS.OUTGOING_AUDIO_CALL
59
-                  : COMETCHAT_CONSTANTS.INCOMING_AUDIO_CALL;
60
-            } else if (call.receiverType === CometChat.RECEIVER_TYPE.GROUP) {
61
-              if (call.action === CometChat.CALL_STATUS.INITIATED) {
62
-                message =
63
-                  call.callInitiator.uid === loggedInUser.uid
64
-                    ? COMETCHAT_CONSTANTS.OUTGOING_AUDIO_CALL
65
-                    : COMETCHAT_CONSTANTS.INCOMING_AUDIO_CALL;
66
-              } else if (call.action === CometChat.CALL_STATUS.REJECTED) {
67
-                message =
68
-                  call.sender.uid === loggedInUser.uid
69
-                    ? COMETCHAT_CONSTANTS.CALL_REJECTED
70
-                    : `${call.sender.name} ${COMETCHAT_CONSTANTS.REJECTED_CALL}`;
71
-              }
72
-            }
73
-          } else if (call.type === CometChat.CALL_TYPE.VIDEO) {
74
-            if (call.receiverType === CometChat.RECEIVER_TYPE.USER) {
75
-              message =
76
-                call.callInitiator.uid === loggedInUser.uid
77
-                  ? COMETCHAT_CONSTANTS.OUTGOING_VIDEO_CALL
78
-                  : COMETCHAT_CONSTANTS.INCOMING_VIDEO_CALL;
79
-            } else if (call.receiverType === CometChat.RECEIVER_TYPE.GROUP) {
80
-              if (call.action === CometChat.CALL_STATUS.INITIATED) {
81
-                message =
82
-                  call.callInitiator.uid === loggedInUser.uid
83
-                    ? COMETCHAT_CONSTANTS.OUTGOING_VIDEO_CALL
84
-                    : COMETCHAT_CONSTANTS.INCOMING_VIDEO_CALL;
85
-              } else if (call.action === CometChat.CALL_STATUS.REJECTED) {
86
-                message =
87
-                  call.sender.uid === loggedInUser.uid
88
-                    ? COMETCHAT_CONSTANTS.CALL_REJECTED
89
-                    : `${call.sender.name} ${COMETCHAT_CONSTANTS.REJECTED_CALL}`;
90
-              }
91
-            }
92
-          }
93
-          break;
94
-        }
95
-        case CometChat.CALL_STATUS.ONGOING: {
96
-          if (call.receiverType === CometChat.RECEIVER_TYPE.USER) {
97
-            message = COMETCHAT_CONSTANTS.CALL_ACCEPTED;
98
-          } else if (call.receiverType === CometChat.RECEIVER_TYPE.GROUP) {
99
-            if (call.action === CometChat.CALL_STATUS.ONGOING) {
100
-              message =
101
-                call.sender.uid === loggedInUser.uid
102
-                  ? COMETCHAT_CONSTANTS.CALL_ACCEPTED
103
-                  : `${call.sender.name} ${COMETCHAT_CONSTANTS.JOINED}`;
104
-            } else if (call.action === CometChat.CALL_STATUS.REJECTED) {
105
-              message =
106
-                call.sender.uid === loggedInUser.uid
107
-                  ? COMETCHAT_CONSTANTS.CALL_REJECTED
108
-                  : `${call.sender.name} ${COMETCHAT_CONSTANTS.REJECTED_CALL}`;
109
-            } else if (call.action === "left") {
110
-              message =
111
-                call.sender.uid === loggedInUser.uid
112
-                  ? `${COMETCHAT_CONSTANTS.YOU} ${COMETCHAT_CONSTANTS.LEFT_THE_CALL}`
113
-                  : `${call.sender.name} ${COMETCHAT_CONSTANTS.LEFT_THE_CALL}`;
114
-            }
115
-          }
116
-
117
-          break;
118
-        }
119
-        case CometChat.CALL_STATUS.UNANSWERED: {
120
-          message = COMETCHAT_CONSTANTS.CALL_UNANSWERED;
121
-          if (
122
-            call.type === CometChat.CALL_TYPE.AUDIO &&
123
-            (call.receiverType === CometChat.RECEIVER_TYPE.USER ||
124
-              call.receiverType === CometChat.RECEIVER_TYPE.GROUP)
125
-          ) {
126
-            message =
127
-              call.callInitiator.uid === loggedInUser.uid
128
-                ? COMETCHAT_CONSTANTS.UNANSWERED_AUDIO_CALL
129
-                : COMETCHAT_CONSTANTS.MISSED_AUDIO_CALL;
130
-          } else if (
131
-            call.type === CometChat.CALL_TYPE.VIDEO &&
132
-            (call.receiverType === CometChat.RECEIVER_TYPE.USER ||
133
-              call.receiverType === CometChat.RECEIVER_TYPE.GROUP)
134
-          ) {
135
-            message =
136
-              call.callInitiator.uid === loggedInUser.uid
137
-                ? COMETCHAT_CONSTANTS.UNANSWERED_VIDEO_CALL
138
-                : COMETCHAT_CONSTANTS.MISSED_VIDEO_CALL;
139
-          }
140
-          break;
141
-        }
142
-        case CometChat.CALL_STATUS.REJECTED:
143
-          message = COMETCHAT_CONSTANTS.CALL_REJECTED;
144
-          break;
145
-        case CometChat.CALL_STATUS.CANCELLED:
146
-          message = COMETCHAT_CONSTANTS.CALL_CANCELLED;
147
-          break;
148
-        case CometChat.CALL_STATUS.ENDED:
149
-          message = COMETCHAT_CONSTANTS.CALL_ENDED;
150
-          break;
151
-        case CometChat.CALL_STATUS.BUSY:
152
-          message = COMETCHAT_CONSTANTS.CALL_BUSY;
153
-          break;
154
-        default:
155
-          break;
156
-      }
157
-      return message;
158
-    },
159
-  },
160
-};
161
-</script>

+ 0
- 15
frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatActionMessageBubble/style.js 파일 보기

@@ -1,15 +0,0 @@
1
-export const callMessageStyle = () => {
2
-  return {
3
-    padding: "8px 12px",
4
-    marginBottom: "16px",
5
-    textAlign: "center",
6
-  };
7
-};
8
-
9
-export const callMessageTxtStyle = () => {
10
-  return {
11
-    fontSize: "13px",
12
-    fontWeight: "500",
13
-    margin: "0",
14
-  };
15
-};

+ 0
- 107
frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatDeleteMessageBubble/CometChatDeleteMessageBubble.vue 파일 보기

@@ -1,107 +0,0 @@
1
-<template>
2
-  <div :style="styles.messageContainer">
3
-    <div :style="styles.messageWrapper">
4
-      <template v-if="messageFrom === 'sender'">
5
-        <div :style="styles.messageTextWrapper">
6
-          <p :style="styles.messageText">
7
-            {{ STRINGS.SENDER_DELETED_MESSAGE }}
8
-          </p>
9
-        </div>
10
-        <div :style="styles.messageInfoWrapper">
11
-          <span :style="styles.messageTimeStamp">{{ messageTime }}</span>
12
-        </div>
13
-      </template>
14
-      <template v-else-if="messageFrom === 'receiver'">
15
-        <div :style="styles.messageThumbnail" v-if="isGroup">
16
-          <comet-chat-avatar
17
-            border-width="1px"
18
-            corner-radius="50%"
19
-            :image="message.sender.avatar"
20
-            :border-color="theme.borderColor.primary"
21
-          />
22
-        </div>
23
-        <div :style="styles.messageDetail">
24
-          <div :style="styles.nameWrapper" v-if="isGroup">
25
-            <span :style="styles.name">{{ message.sender.name }}</span>
26
-          </div>
27
-          <div :style="styles.messageTextWrapper">
28
-            <p :style="styles.messageText">
29
-              {{ STRINGS.RECEIVER_DELETED_MESSAGE }}
30
-            </p>
31
-          </div>
32
-          <div :style="styles.messageInfoWrapper">
33
-            <span :style="styles.messageTimeStamp">
34
-              {{ messageTime }}
35
-            </span>
36
-          </div>
37
-        </div>
38
-      </template>
39
-    </div>
40
-  </div>
41
-</template>
42
-<script>
43
-import {
44
-  DEFAULT_OBJECT_PROP,
45
-  DEFAULT_STRING_PROP,
46
-} from "../../../resources/constants";
47
-
48
-import { cometChatBubbles } from "../../../mixins/";
49
-
50
-import { CometChatAvatar } from "../../Shared";
51
-
52
-import * as style from "./style";
53
-
54
-/**
55
- * Message bubble for deleted messages.
56
- *
57
- * @displayName CometChatDeleteMessageBubble
58
- */
59
-export default {
60
-  name: "CometChatDeleteMessageBubble",
61
-  mixins: [cometChatBubbles],
62
-  components: {
63
-    CometChatAvatar,
64
-  },
65
-  props: {
66
-    /**
67
-     * The selected chat item object.
68
-     */
69
-    item: { ...DEFAULT_OBJECT_PROP },
70
-    /**
71
-     * Type of chat item.
72
-     */
73
-    type: { ...DEFAULT_STRING_PROP },
74
-    /**
75
-     * Theme of the UI.
76
-     */
77
-    theme: { ...DEFAULT_OBJECT_PROP },
78
-    /**
79
-     *
80
-     */
81
-    message: { ...DEFAULT_OBJECT_PROP },
82
-    messageFrom: { ...DEFAULT_STRING_PROP },
83
-  },
84
-  computed: {
85
-    /**
86
-     * Computed styles for the bubble.
87
-     */
88
-    styles() {
89
-      return {
90
-        messageTextWrapper: style.messageTextWrapperStyle(
91
-          this.theme,
92
-          this.messageFrom
93
-        ),
94
-        name: style.nameStyle(this.theme),
95
-        messageText: style.messageTextStyle(this.theme),
96
-        messageThumbnail: style.messageThumbnailStyle(),
97
-        messageTimeStamp: style.messageTimeStampStyle(this.theme),
98
-        messageWrapper: style.messageWrapperStyle(this.messageFrom),
99
-        messageContainer: style.messageContainerStyle(this.messageFrom),
100
-        nameWrapper: style.nameWrapperStyle(this.message, this.messageFrom),
101
-        messageInfoWrapper: style.messageInfoWrapperStyle(this.messageFrom),
102
-        messageDetail: style.messageDetailStyle(this.message, this.messageFrom),
103
-      };
104
-    },
105
-  },
106
-};
107
-</script>

+ 0
- 147
frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatDeleteMessageBubble/style.js 파일 보기

@@ -1,147 +0,0 @@
1
-import { CometChat } from "@cometchat-pro/chat";
2
-
3
-export const messageContainerStyle = (messageOf) => {
4
-  const alignment =
5
-    messageOf === "sender"
6
-      ? {
7
-          alignSelf: "flex-end",
8
-        }
9
-      : {
10
-          alignSelf: "flex-start",
11
-        };
12
-
13
-  return {
14
-    marginBottom: "16px",
15
-    paddingLeft: "16px",
16
-    paddingRight: "16px",
17
-    maxWidth: "65%",
18
-    clear: "both",
19
-    flexShrink: "0",
20
-    ...alignment,
21
-  };
22
-};
23
-
24
-export const messageWrapperStyle = (messageOf) => {
25
-  const alignment =
26
-    messageOf === "sender"
27
-      ? {
28
-          display: "flex",
29
-          flexDirection: "column",
30
-        }
31
-      : {};
32
-
33
-  return {
34
-    flex: "1 1",
35
-    position: "relative",
36
-    width: "100%",
37
-    ...alignment,
38
-  };
39
-};
40
-
41
-export const messageTextWrapperStyle = (theme, messageOf) => {
42
-  const alignment =
43
-    messageOf === "sender"
44
-      ? {
45
-          alignSelf: "flex-end",
46
-        }
47
-      : {
48
-          alignSelf: "flex-start",
49
-        };
50
-
51
-  return {
52
-    display: "inline-block",
53
-    borderRadius: "12px",
54
-    padding: "8px 12px",
55
-    alignSelf: "flex-end",
56
-    Width: "100%",
57
-    backgroundColor: `${theme.backgroundColor.secondary}`,
58
-    fontStyle: "italic",
59
-    ...alignment,
60
-  };
61
-};
62
-
63
-export const messageTextStyle = (theme) => {
64
-  return {
65
-    fontSize: "14px!important",
66
-    margin: "0",
67
-    lineHeight: "20px!important",
68
-    color: `${theme.color.helpText}`,
69
-  };
70
-};
71
-
72
-export const messageInfoWrapperStyle = (messageOf) => {
73
-  const alignment =
74
-    messageOf === "sender"
75
-      ? {
76
-          alignSelf: "flex-end",
77
-        }
78
-      : {
79
-          alignSelf: "flex-start",
80
-        };
81
-
82
-  return alignment;
83
-};
84
-
85
-export const messageTimeStampStyle = (theme) => {
86
-  return {
87
-    display: "inline-block",
88
-    fontSize: "11px",
89
-    fontWeight: 500,
90
-    lineHeight: "12px",
91
-    textTransform: "uppercase",
92
-    color: `${theme.color.helpText}`,
93
-  };
94
-};
95
-
96
-export const messageThumbnailStyle = () => {
97
-  return {
98
-    width: "36px",
99
-    height: "36px",
100
-    margin: "12px 0",
101
-    float: "left",
102
-  };
103
-};
104
-
105
-export const messageDetailStyle = (message, messageOf) => {
106
-  let paddingSpace = {};
107
-  if (
108
-    messageOf === "receiver" &&
109
-    message.receiverType === CometChat.RECEIVER_TYPE.GROUP
110
-  ) {
111
-    paddingSpace = {
112
-      paddingLeft: "5px",
113
-    };
114
-  }
115
-
116
-  return {
117
-    flex: "1 1",
118
-    display: "flex",
119
-    flexDirection: "column",
120
-    position: "relative",
121
-    ...paddingSpace,
122
-  };
123
-};
124
-
125
-export const nameWrapperStyle = (message, messageOf) => {
126
-  let paddingSpace = {};
127
-  if (
128
-    messageOf === "receiver" &&
129
-    message.receiverType === CometChat.RECEIVER_TYPE.GROUP
130
-  ) {
131
-    paddingSpace = {
132
-      padding: "3px 5px",
133
-    };
134
-  }
135
-
136
-  return {
137
-    alignSelf: "flex-start",
138
-    ...paddingSpace,
139
-  };
140
-};
141
-
142
-export const nameStyle = (theme) => {
143
-  return {
144
-    fontSize: "10px",
145
-    color: `${theme.color.helpText}`,
146
-  };
147
-};

+ 0
- 78
frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatImageViewer/CometChatImageViewer.vue 파일 보기

@@ -1,78 +0,0 @@
1
-<template>
2
-  <div>
3
-    <comet-chat-backdrop :show="open" @click="emitAction('closeActualImage')" />
4
-    <div :style="styles.imageWrapper" @click="emitAction('closeActualImage')">
5
-      <img
6
-        :src="computedImage"
7
-        :style="styles.image"
8
-        :alt="STRINGS.FULL_SCREEN_VIEW"
9
-        @error="() => (error = true)"
10
-      />
11
-    </div>
12
-  </div>
13
-</template>
14
-<script>
15
-import {
16
-  COMETCHAT_CONSTANTS,
17
-  DEFAULT_OBJECT_PROP,
18
-  DEFAULT_BOOLEAN_PROP,
19
-} from "../../../resources/constants";
20
-
21
-import { cometChatCommon } from "../../../mixins/";
22
-
23
-import { CometChatBackdrop } from "../../Shared";
24
-
25
-import closeIcon from "./resources/close.png";
26
-import srcIcon from "./resources/1px.png";
27
-
28
-import * as style from "./style";
29
-
30
-/**
31
- * Displays fullscreen image.
32
- *
33
- * @displayName CometChatImageViewer
34
- */
35
-export default {
36
-  name: "CometChatImageViewer",
37
-  mixins: [cometChatCommon],
38
-  components: { CometChatBackdrop },
39
-  props: {
40
-    /**
41
-     * Opens image viewer.
42
-     */
43
-    open: { ...DEFAULT_BOOLEAN_PROP },
44
-    /**
45
-     * The message object.
46
-     */
47
-    message: { ...DEFAULT_OBJECT_PROP },
48
-  },
49
-  data() {
50
-    return {
51
-      error: false,
52
-    };
53
-  },
54
-  computed: {
55
-    /**
56
-     * Computed styles for the component.
57
-     */
58
-    styles() {
59
-      return {
60
-        image: style.imageStyle(),
61
-        imageWrapper: style.imageWrapperStyle(closeIcon),
62
-      };
63
-    },
64
-    /**
65
-     * Computed image based on error state.
66
-     */
67
-    computedImage() {
68
-      return this.error ? srcIcon : this.message.data.url;
69
-    },
70
-    /**
71
-     * Local string constants.
72
-     */
73
-    STRINGS() {
74
-      return COMETCHAT_CONSTANTS;
75
-    },
76
-  },
77
-};
78
-</script>

BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatImageViewer/resources/1px.png 파일 보기


BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatImageViewer/resources/close.png 파일 보기


+ 0
- 21
frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatImageViewer/style.js 파일 보기

@@ -1,21 +0,0 @@
1
-export const imageWrapperStyle = (img) => {
2
-  return {
3
-    position: "absolute",
4
-    top: "0",
5
-    left: "0",
6
-    width: "100%",
7
-    height: "100%",
8
-    padding: "2%",
9
-    zIndex: "9999",
10
-    display: "flex",
11
-    justifyContent: "center",
12
-    background: `url(${img}) calc(100% - 4px) 4px no-repeat #fff`,
13
-    cursor: "pointer",
14
-  };
15
-};
16
-
17
-export const imageStyle = () => {
18
-  return {
19
-    objectFit: "contain",
20
-  };
21
-};

+ 0
- 179
frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatLiveReactions/CometChatLiveReactions.vue 파일 보기

@@ -1,179 +0,0 @@
1
-<template>
2
-  <div ref="parentElement" :style="styles.reactionContainer">
3
-    <span
4
-      :key="i"
5
-      :style="styles.reactionEmoji"
6
-      class="live__reaction__emoji"
7
-      v-for="(_, i) in Array(6).fill(0)"
8
-    >
9
-      <img :src="reactionIconSrc" :alt="reaction" />
10
-    </span>
11
-  </div>
12
-</template>
13
-
14
-<!--eslint-disable-->
15
-<script>
16
-import {
17
-  DEFAULT_OBJECT_PROP,
18
-  DEFAULT_STRING_PROP,
19
-} from "../../../resources/constants";
20
-
21
-import * as enums from "../../../util/enums.js";
22
-
23
-import heart from "./resources/heart.png";
24
-
25
-import * as style from "./style";
26
-
27
-/**
28
- * Displays live reaction animation.
29
- *
30
- * @displayName CometChatLiveReactions
31
- */
32
-export default {
33
-  name: "CometChatLiveReactions",
34
-  props: {
35
-    /**
36
-     * Theme of the UI.
37
-     */
38
-    theme: { ...DEFAULT_OBJECT_PROP },
39
-    /**
40
-     * The reaction to animate.
41
-     */
42
-    reaction: { ...DEFAULT_STRING_PROP },
43
-  },
44
-  data() {
45
-    return {
46
-      items: [],
47
-      counter: 0,
48
-      timer: null,
49
-      verticalSpeed: 5,
50
-      horizontalSpeed: 2,
51
-      before: Date.now(),
52
-    };
53
-  },
54
-  computed: {
55
-    /**
56
-     * Computed styles for the bubble.
57
-     */
58
-    styles() {
59
-      return {
60
-        reactionEmoji: style.reactionEmojiStyle(),
61
-        reactionContainer: style.reactionContainerStyle(),
62
-      };
63
-    },
64
-    /**
65
-     * Computed reaction icon source.
66
-     */
67
-    reactionIconSrc() {
68
-      return this.reaction
69
-        ? this.icons[enums.LIVE_REACTIONS[this.reaction]]
70
-        : this.icons[enums.LIVE_REACTIONS["heart"]];
71
-    },
72
-    /**
73
-     * Icons computed from file images.
74
-     */
75
-    icons() {
76
-      return {
77
-        heart,
78
-      };
79
-    },
80
-  },
81
-  methods: {
82
-    /**
83
-     * Sets the items before animating
84
-     */
85
-    setItems() {
86
-      this.$nextTick(() => {
87
-        const width = this.$refs.parentElement.offsetWidth;
88
-        const height = this.$refs.parentElement.offsetHeight;
89
-
90
-        const elements = this.$refs.parentElement.querySelectorAll(
91
-          ".live__reaction__emoji"
92
-        );
93
-
94
-        for (let i = 0; i < elements.length; i++) {
95
-          const element = elements[i],
96
-            elementWidth = element.offsetWidth,
97
-            elementHeight = element.offsetHeight;
98
-
99
-          const item = {
100
-            faded: false,
101
-            element: element,
102
-            elementWidth: elementWidth,
103
-            elementHeight: elementHeight,
104
-            ySpeed: -this.verticalSpeed,
105
-            random: (Math.random() / 2 + 0.5) * i * 10000,
106
-            omega: (2 * Math.PI * this.horizontalSpeed) / (width * 60),
107
-            x: function (time) {
108
-              return (
109
-                ((Math.sin(this.omega * (time + this.random)) + 1) / 2) *
110
-                (width - elementWidth)
111
-              );
112
-            },
113
-            y: height + (Math.random() + 1) * i * elementHeight,
114
-          };
115
-
116
-          this.items.push(item);
117
-        }
118
-      });
119
-    },
120
-    /**
121
-     * Animates the reaction
122
-     */
123
-    animate() {
124
-      this.$nextTick(() => {
125
-        if (!this.$refs.parentElement) {
126
-          return false;
127
-        }
128
-
129
-        const height = this.$refs.parentElement.offsetHeight;
130
-        const time = +new Date();
131
-
132
-        for (let i = 0; i < this.items.length; i++) {
133
-          const item = this.items[i];
134
-
135
-          const transformString =
136
-            "translate3d(" + item.x(time) + "px, " + item.y + "px, 0px)";
137
-          item.element.style.transform = transformString;
138
-
139
-          item.element.style.visibility = "visible";
140
-
141
-          if (item.y <= height) {
142
-            item.element.classList.add("live__reaction__emoji--fade");
143
-            item.faded = true;
144
-          }
145
-
146
-          item.y += item.ySpeed;
147
-        }
148
-
149
-        if (this.counter < 500) {
150
-          this.requestAnimation();
151
-        }
152
-
153
-        this.counter++;
154
-      });
155
-    },
156
-    /**
157
-     * Looper function that controls the animation
158
-     */
159
-    requestAnimation() {
160
-      this.timer = setTimeout(this.animate, 1000 / 60);
161
-    },
162
-  },
163
-  mounted() {
164
-    this.setItems();
165
-    this.requestAnimation();
166
-  },
167
-  beforeDestroy() {
168
-    this.timer = null;
169
-  },
170
-  beforeUnmount() {
171
-    this.timer = null;
172
-  },
173
-};
174
-</script>
175
-<style>
176
-.live__reaction__emoji--fade {
177
-  opacity: 0 !important;
178
-}
179
-</style>

BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatLiveReactions/resources/heart.png 파일 보기


+ 0
- 22
frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatLiveReactions/style.js 파일 보기

@@ -1,22 +0,0 @@
1
-export const reactionContainerStyle = () => {
2
-  return {
3
-    width: "100px",
4
-    height: "calc(100% - 120px)",
5
-    overflow: "hidden",
6
-    position: "absolute",
7
-    top: "70px",
8
-    right: "0",
9
-  };
10
-};
11
-
12
-export const reactionEmojiStyle = () => {
13
-  return {
14
-    position: "absolute",
15
-    color: "#DD4144",
16
-    visibility: "hidden",
17
-    width: "20px",
18
-    height: "20px",
19
-    opacity: "1",
20
-    transition: "opacity 3s",
21
-  };
22
-};

+ 0
- 167
frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatMessageActions/CometChatMessageActions.vue 파일 보기

@@ -1,167 +0,0 @@
1
-<template>
2
-  <ul
3
-    v-if="canShowTooltip"
4
-    class="message__actions"
5
-    :style="styles.messageAction"
6
-  >
7
-    <li :style="styles.actionGroup">
8
-      <button
9
-        type="button"
10
-        :style="styles.groupButtonReact"
11
-        :data-title="STRINGS.ADD_REACTION"
12
-        @mouseenter="toggleTooltip($event, true)"
13
-        @mouseleave="toggleTooltip($event, false)"
14
-        @click="emitAction('reactToMessage', { message })"
15
-      />
16
-    </li>
17
-    <li :style="styles.actionGroup">
18
-      <button
19
-        type="button"
20
-        v-if="canShowThread"
21
-        :style="styles.groupButtonReply"
22
-        :data-title="
23
-          message.replyCount ? STRINGS.REPLY_TO_THREAD : STRINGS.REPLY_IN_THREAD
24
-        "
25
-        @mouseenter="toggleTooltip($event, true)"
26
-        @mouseleave="toggleTooltip($event, false)"
27
-        @click="emitAction('viewMessageThread', { message })"
28
-      />
29
-    </li>
30
-    <li :style="styles.actionGroup">
31
-      <button
32
-        type="button"
33
-        v-if="canShowEdit"
34
-        :style="styles.groupButtonEdit"
35
-        :data-title="STRINGS.EDIT_MESSAGE"
36
-        @mouseenter="toggleTooltip($event, true)"
37
-        @mouseleave="toggleTooltip($event, false)"
38
-        @click="emitAction('editMessage', { message })"
39
-      />
40
-    </li>
41
-    <li :style="styles.actionGroup">
42
-      <button
43
-        type="button"
44
-        v-if="canShowDelete"
45
-        :style="styles.groupButtonDelete"
46
-        :data-title="STRINGS.DELETE_MESSAGE"
47
-        @mouseenter="toggleTooltip($event, true)"
48
-        @mouseleave="toggleTooltip($event, false)"
49
-        @click="emitAction('deleteMessage', { message })"
50
-      />
51
-    </li>
52
-  </ul>
53
-</template>
54
-<script>
55
-import { CometChat } from "@cometchat-pro/chat";
56
-
57
-import {
58
-  COMETCHAT_CONSTANTS,
59
-  DEFAULT_OBJECT_PROP,
60
-  DEFAULT_BOOLEAN_PROP,
61
-} from "../../../resources/constants";
62
-
63
-import { cometChatCommon, propertyCheck, tooltip } from "../../../mixins/";
64
-
65
-import deleteIcon from "./resources/deletemessage.png";
66
-import reactIcon from "./resources/add-reaction.svg";
67
-import replyIcon from "./resources/startThread.png";
68
-import editIcon from "./resources/edit.png";
69
-
70
-import * as style from "./style";
71
-
72
-/**
73
- * A tooltip that displays all actions for a given message.
74
- *
75
- * @displayName CometChatMessageActions
76
- */
77
-export default {
78
-  name: "CometChatMessageActions",
79
-  mixins: [propertyCheck, cometChatCommon, tooltip],
80
-  props: {
81
-    /**
82
-     * Theme of the UI.
83
-     */
84
-    theme: { ...DEFAULT_OBJECT_PROP },
85
-    /**
86
-     * The message object.
87
-     */
88
-    message: { ...DEFAULT_OBJECT_PROP },
89
-    /**
90
-     * Whether the message is from group.
91
-     */
92
-    isGroup: { ...DEFAULT_BOOLEAN_PROP },
93
-  },
94
-  computed: {
95
-    /**
96
-     * Computed styles for the bubble.
97
-     */
98
-    styles() {
99
-      return {
100
-        actionGroup: style.actionGroupStyle(),
101
-        groupButtonEdit: style.groupButtonStyle(editIcon, "edit"),
102
-        groupButtonReply: style.groupButtonStyle(replyIcon, "reply"),
103
-        groupButtonReact: style.groupButtonStyle(reactIcon, "react"),
104
-        groupButtonDelete: style.groupButtonStyle(deleteIcon, "delete"),
105
-        messageAction: style.messageActionStyle(
106
-          this.message,
107
-          this.theme,
108
-          this.isGroup
109
-        ),
110
-      };
111
-    },
112
-    /**
113
-     * Local string constants.
114
-     */
115
-    STRINGS() {
116
-      return COMETCHAT_CONSTANTS;
117
-    },
118
-    /**
119
-     * Returns if it can show threaded message icon.
120
-     */
121
-    canShowThread() {
122
-      let flag = true;
123
-
124
-      if (this.message.parentMessageId) {
125
-        flag = false;
126
-      }
127
-
128
-      return flag;
129
-    },
130
-    /**
131
-     * Returns if it can show edit message icon.
132
-     */
133
-    canShowEdit() {
134
-      let flag = true;
135
-
136
-      if (
137
-        this.message.messageFrom === "receiver" ||
138
-        this.message.type !== CometChat.MESSAGE_TYPE.TEXT
139
-      ) {
140
-        flag = false;
141
-      }
142
-
143
-      return flag;
144
-    },
145
-    /**
146
-     * Returns if it can show delete message icon.
147
-     */
148
-    canShowDelete() {
149
-      let flag = true;
150
-
151
-      if (this.message.messageFrom === "receiver") {
152
-        flag = false;
153
-      }
154
-
155
-      return flag;
156
-    },
157
-    /**
158
-     * Returns if it can show the message actions/tooltip.
159
-     */
160
-    canShowTooltip() {
161
-      return !this.canShowThread && !this.canShowEdit && !this.canShowDelete
162
-        ? false
163
-        : true;
164
-    },
165
-  },
166
-};
167
-</script>

+ 0
- 32
frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatMessageActions/resources/add-reaction.svg 파일 보기

@@ -1,32 +0,0 @@
1
-<?xml version="1.0" standalone="no"?>
2
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN" "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
3
-<svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="253.000000pt" height="245.000000pt"
4
-    viewBox="0 0 253.000000 245.000000" preserveAspectRatio="xMidYMid meet">
5
-    <metadata>
6
-        Created by potrace 1.16, written by Peter Selinger 2001-2019
7
-    </metadata>
8
-    <g transform="translate(0.000000,245.000000) scale(0.100000,-0.100000)" fill="#929292" stroke="none">
9
-        <path d="M1910 2195 l0 -184 -60 6 c-33 3 -116 2 -185 -2 l-125 -7 4 -47 c3
10
--25 5 -52 5 -58 1 -10 44 -13 179 -13 l178 0 0 -180 c-1 -112 3 -181 9 -183 6
11
--1 33 -3 60 -2 l50 0 3 182 2 183 182 2 181 3 1 55 0 55 -80 7 c-43 4 -125 4
12
--181 1 l-103 -6 0 187 0 186 -60 0 -60 0 0 -185z" />
13
-        <path d="M1088 2015 c-2 -1 -32 -5 -68 -8 -197 -18 -414 -128 -561 -283 -71
14
--76 -111 -134 -159 -236 -54 -114 -80 -220 -87 -358 -12 -254 76 -479 260
15
--668 195 -200 453 -296 730 -271 444 41 800 413 824 862 l6 107 -62 0 -61 0 0
16
--58 c0 -175 -76 -380 -193 -517 -152 -179 -352 -275 -582 -278 -184 -2 -322
17
-39 -469 140 -58 40 -183 167 -192 195 -3 10 -10 18 -15 18 -5 0 -9 5 -9 10 0
18
-6 -11 27 -24 48 -28 45 -71 166 -85 242 -12 65 -7 243 8 318 38 187 172 379
19
-339 486 130 83 255 120 432 128 l55 3 3 49 c2 27 -1 53 -6 58 -9 9 -77 19 -84
20
-13z" />
21
-        <path d="M814 1512 c-149 -59 -161 -257 -20 -327 63 -32 99 -31 163 1 42 20
22
-57 35 77 77 31 60 32 97 7 152 -23 52 -71 93 -119 100 -20 3 -44 7 -53 9 -8 2
23
--33 -4 -55 -12z" />
24
-        <path d="M1295 1510 c-144 -65 -150 -262 -11 -330 52 -25 99 -25 151 -1 55 25
25
-85 61 101 121 11 42 11 57 -1 90 -21 61 -53 97 -106 119 -57 25 -81 25 -134 1z" />
26
-        <path d="M680 980 c0 -6 -3 -9 -7 -9 -19 4 -73 -24 -73 -37 0 -8 15 -45 33
27
--82 83 -172 290 -301 483 -302 196 0 394 120 487 296 20 40 37 79 37 87 0 13
28
--17 22 -97 54 -11 4 -41 -50 -47 -84 -3 -17 -53 -79 -96 -121 -73 -69 -179
29
--112 -277 -112 -97 0 -223 49 -290 112 -34 33 -103 129 -107 150 -6 26 -18 47
30
--32 52 -8 3 -14 1 -14 -4z" />
31
-    </g>
32
-</svg>

BIN
frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatMessageActions/resources/deletemessage.png 파일 보기


+ 0
- 0
frontend/src/cometchat-pro-vue-ui-kit/src/components/Messages/CometChatMessageActions/resources/edit.png 파일 보기


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.

Loading…
취소
저장