@bcc-code/vue-bcc-chat-ui 1.2.9 → 1.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@bcc-code/vue-bcc-chat-ui",
3
3
  "author": "bcc-code",
4
4
  "license": "Apache-2.0",
5
- "version": "1.2.9",
5
+ "version": "1.2.11",
6
6
  "type": "module",
7
7
  "private": false,
8
8
  "files": [
@@ -10,8 +10,9 @@ import {
10
10
  } from "@cometchat/chat-uikit-vue";
11
11
  import { MessageListConfiguration, MessageComposerConfiguration } from "@cometchat/uikit-shared";
12
12
  import { CometChatTheme } from '@cometchat/uikit-resources'
13
- import { Group } from '@cometchat/chat-sdk-javascript';
14
- import { watch } from 'vue';
13
+ import { BaseMessage, Group, User } from '@cometchat/chat-sdk-javascript';
14
+ import { watch, Ref } from 'vue';
15
+
15
16
  //import { ThreadedMessagesStyle } from '@cometchat/uikit-shared';
16
17
 
17
18
  const props = defineProps({
@@ -72,6 +73,10 @@ const messageListConfiguration = getMessageListConfiguration()
72
73
 
73
74
  function getMessageListConfiguration(): MessageListConfiguration {
74
75
  let templates = CometChatUIKit.getDataSource().getAllMessageTemplates().map((template: CometChatMessageTemplate) => {
76
+ // Override options
77
+ template.options = (loggedInUser: User, message: BaseMessage, theme: CometChatTheme, group: Group|undefined) => { return getOptionsView(loggedInUser, message, theme, group); };
78
+
79
+ // Override image styling
75
80
  if (template.category === "message" && template.type === "image") {
76
81
  template.contentView = getImageMessageContentView
77
82
  }
@@ -101,6 +106,13 @@ function getMessageListConfiguration(): MessageListConfiguration {
101
106
  };
102
107
  };
103
108
 
109
+ const getOptionsView = (loggedInUser: User, message: BaseMessage, theme: any, group: Group|undefined) => {
110
+ const optionsData = CometChatUIKit.getDataSource().getMessageOptions(loggedInUser, message, theme, group);
111
+ const customOptionsView = optionsData.filter(ele => ele.id !== "sendMessagePrivately");
112
+ return customOptionsView;
113
+ }
114
+
115
+
104
116
  return new MessageListConfiguration({
105
117
  scrollToBottomOnNewMessages: true,
106
118
  templates: templates