@bcc-code/vue-bcc-chat-ui 6.5.0 → 7.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/assets/index-B_y7vs2y.js +12519 -0
  2. package/dist/assets/index-uEhSMl7W.css +1 -0
  3. package/dist/assets/primeicons-C6QP2o4f.woff2 +0 -0
  4. package/dist/assets/primeicons-DMOk5skT.eot +0 -0
  5. package/dist/assets/primeicons-Dr5RGzOO.svg +345 -0
  6. package/dist/assets/primeicons-MpK4pl85.ttf +0 -0
  7. package/dist/assets/primeicons-WjwUDZjB.woff +0 -0
  8. package/dist/assets/web-Cp3vw--c.js +1 -0
  9. package/dist/assets/web-DSc1BjG7.js +1 -0
  10. package/dist/index.html +13 -0
  11. package/package.json +42 -51
  12. package/README.md +0 -89
  13. package/dist/App.vue.d.ts +0 -2
  14. package/dist/chat/accessToken.d.ts +0 -3
  15. package/dist/chat/bccuiExtension.d.ts +0 -7
  16. package/dist/chat/cacheScope.d.ts +0 -13
  17. package/dist/chat/captionedAttachment.d.ts +0 -7
  18. package/dist/chat/captionedAttachmentExtension.d.ts +0 -7
  19. package/dist/chat/cometChatPatches.d.ts +0 -3
  20. package/dist/chat/connection.d.ts +0 -14
  21. package/dist/chat/data.d.ts +0 -24
  22. package/dist/chat/environment.d.ts +0 -3
  23. package/dist/chat/index.d.ts +0 -453
  24. package/dist/chat/logger.d.ts +0 -12
  25. package/dist/chat/login.d.ts +0 -14
  26. package/dist/chat/message.d.ts +0 -15
  27. package/dist/chat/replyExtension.d.ts +0 -26
  28. package/dist/chat/replyStyle.d.ts +0 -30
  29. package/dist/chat/rescheduleExtension.d.ts +0 -22
  30. package/dist/chat/scheduledMessage.d.ts +0 -4
  31. package/dist/chat/styleFix.d.ts +0 -14
  32. package/dist/chat/theme.d.ts +0 -408
  33. package/dist/chat/translations.d.ts +0 -3
  34. package/dist/chat/types.d.ts +0 -123
  35. package/dist/chat/uiKit.d.ts +0 -10
  36. package/dist/component-overrides/BccBubbleWrapper.vue.d.ts +0 -156
  37. package/dist/component-overrides/CometChatMessageListOverride.vue.d.ts +0 -2
  38. package/dist/components/BccAttachmentBox.vue.d.ts +0 -29
  39. package/dist/components/BccAttachmentPreview.vue.d.ts +0 -23
  40. package/dist/components/BccChatMessageBubble.vue.d.ts +0 -99
  41. package/dist/components/BccChatMessageList.vue.d.ts +0 -82
  42. package/dist/components/BccChatMessages.vue.d.ts +0 -33
  43. package/dist/components/BccChatSendButton.vue.d.ts +0 -4
  44. package/dist/components/BccCometChatFullScreenViewer.vue.d.ts +0 -24
  45. package/dist/components/BccFileBubble.vue.d.ts +0 -70
  46. package/dist/components/BccImageBubble.vue.d.ts +0 -27
  47. package/dist/components/BccReplyBox.vue.d.ts +0 -36
  48. package/dist/components/BccReplyPreview.vue.d.ts +0 -30
  49. package/dist/components/BccScheduledMessageIcon.vue.d.ts +0 -2
  50. package/dist/components/BccScheduledMessageModal.vue.d.ts +0 -31
  51. package/dist/components/BccScheduledMessages.vue.d.ts +0 -25
  52. package/dist/components/BccScheduledSendButton.vue.d.ts +0 -14
  53. package/dist/index.d.ts +0 -4
  54. package/dist/main.d.ts +0 -1
  55. package/dist/offline/cometChatAPIInterceptor.d.ts +0 -2
  56. package/dist/offline/cometChatWSInterceptor.d.ts +0 -2
  57. package/dist/offline/connectivity.d.ts +0 -5
  58. package/dist/offline/failedSendingRetry.d.ts +0 -4
  59. package/dist/offline/index.d.ts +0 -10
  60. package/dist/offline/offlineStoreLocalStorage.d.ts +0 -32
  61. package/dist/offline/types.d.ts +0 -69
  62. package/dist/vite.svg +0 -1
  63. package/dist/vue-bcc-chat-ui.css +0 -1
  64. package/dist/vue-bcc-chat-ui.js +0 -86486
  65. package/dist/vue-bcc-chat-ui.js.map +0 -1
  66. package/src/components/BccAttachmentBox.vue +0 -133
  67. package/src/components/BccAttachmentPreview.vue +0 -57
  68. package/src/components/BccChatMessageBubble.vue +0 -219
  69. package/src/components/BccChatMessageList.vue +0 -488
  70. package/src/components/BccChatMessages.vue +0 -212
  71. package/src/components/BccChatSendButton.vue +0 -91
  72. package/src/components/BccCometChatFullScreenViewer.vue +0 -118
  73. package/src/components/BccFileBubble.vue +0 -137
  74. package/src/components/BccImageBubble.vue +0 -75
  75. package/src/components/BccReplyBox.vue +0 -141
  76. package/src/components/BccReplyPreview.vue +0 -113
  77. package/src/components/BccScheduledMessageIcon.vue +0 -65
  78. package/src/components/BccScheduledMessageModal.vue +0 -70
  79. package/src/components/BccScheduledMessages.vue +0 -125
  80. package/src/components/BccScheduledSendButton.vue +0 -118
@@ -1,65 +0,0 @@
1
- <script setup lang="ts">
2
- import { UpdateIcon } from '@bcc-code/icons-vue';
3
- import { CometChatUIKitLoginListener } from '@cometchat/uikit-shared';
4
- import { inject, Ref } from 'vue';
5
- import chat from '../chat';
6
- import { getAccessToken } from '../chat/accessToken';
7
- import { getCurrentEnvironment } from '../chat/environment';
8
- import { ChatInstance } from '../chat/types';
9
-
10
- const chatInstance = inject<Ref<ChatInstance>>("chatInstance");
11
-
12
- async function redirectToScheduledMessagesChat() {
13
- let schedMsgChatUid = CometChatUIKitLoginListener.getLoggedInUser()?.getUid()
14
- if (schedMsgChatUid && chatInstance) {
15
- let schedMsgChat;
16
- try {
17
- schedMsgChat = await chat.getGroup(schedMsgChatUid);
18
- } catch (error) {
19
- schedMsgChat = undefined;
20
- }
21
- if (!schedMsgChat) {
22
- const url = getCurrentEnvironment().chatApiBaseUrl + "/chats/" + schedMsgChatUid
23
- await fetch(url, {
24
- method: 'POST',
25
- headers: {
26
- 'Content-Type': 'application/json',
27
- 'Authorization': `Bearer ${getAccessToken()}`
28
- }
29
- }).then(async (res) => {
30
- if (res.ok) {
31
- schedMsgChat = await chat.getGroup(schedMsgChatUid)
32
- }
33
- })
34
-
35
- }
36
- if (schedMsgChat) {
37
- chatInstance.value.scheduledMessageChat = schedMsgChat
38
- chatInstance.value.decoyAttachment = chatInstance.value.captionedAttachment
39
- chatInstance.value.captionedAttachment = null
40
- chatInstance.value.replyToMessage = null
41
- chatInstance.value.showScheduledMessagesChat = true
42
- chatInstance.value.userInput = document.querySelector<HTMLElement>(".messageinput-input")?.innerText ?? null;
43
- }
44
- }
45
- }
46
- </script>
47
-
48
- <template>
49
- <div class="bcc-scheduled-message-icon">
50
- <UpdateIcon class="update-icon-style" @click="redirectToScheduledMessagesChat()"></UpdateIcon>
51
- </div>
52
- </template>
53
-
54
- <style lang="scss" scoped>
55
- .update-icon-style {
56
- height: 24px;
57
- width: 24px;
58
- border: none;
59
- border-radius: 0;
60
- color: var(--cc__primary150, #3F4669);
61
- background: transparent;
62
- cursor: pointer;
63
- margin-right: -10px;
64
- }
65
- </style>
@@ -1,70 +0,0 @@
1
- <script lang="ts" setup>
2
- import { BccButton, BccDialog, BccMessage } from '@bcc-code/component-library-vue';
3
- import { localize } from '@cometchat/uikit-resources';
4
- import { computed, onMounted, ref } from 'vue';
5
-
6
- const props = defineProps({
7
- isReschedule: { type: Boolean, default: false },
8
- closeOnOutsideClick: { type: Boolean, default: true }
9
- })
10
-
11
- const title = props.isReschedule ? localize("RESCHEDULE") : localize("SCHEDULE_MESSAGE")
12
- const closeOnOutsideClick = ref<boolean>(props.closeOnOutsideClick);
13
- const emit = defineEmits(['close', 'schedule', 'reschedule']);
14
-
15
- const dateInput = ref<string>();
16
- const timeInput = ref<string>();
17
- const messageSent = ref<boolean>(false);
18
-
19
- const localDateTime = computed<string>(() => {
20
- return new Date(dateInput.value + "T" + timeInput.value).toISOString()
21
- })
22
-
23
- const isDateInFuture = computed<boolean>(() => {
24
- if (dateInput.value === '' || timeInput.value === '') return false
25
- return new Date(localDateTime.value) > new Date();
26
- })
27
-
28
- onMounted(() => {
29
- const now = new Date();
30
-
31
- dateInput.value = now.toISOString().split('T')[0];
32
- now.setHours(now.getHours() + 1); // Add 1 hour
33
- const hours = String(now.getHours()).padStart(2, '0');
34
- const minutes = String(now.getMinutes()).padStart(2, '0');
35
- timeInput.value = `${hours}:${minutes}`;
36
-
37
- setTimeout(() => closeOnOutsideClick.value = true, 500);
38
- })
39
-
40
- function close() {
41
- emit('close');
42
- }
43
-
44
- function scheduleMessage() {
45
- if (isDateInFuture && !messageSent.value) {
46
- emit(props.isReschedule ? 'reschedule' : 'schedule', localDateTime.value)
47
- messageSent.value = true;
48
- }
49
- }
50
- </script>
51
-
52
- <template>
53
- <BccDialog class="modal" :header="title" :visible="true" modal @hide="close()"
54
- :dismissableMask="closeOnOutsideClick" :closable="true">
55
- <div class="flex flex-col w-full">
56
- <div class="flex w-full items-center justify-between">
57
- <input class="bcc-input text-right justify-end" type="date" v-model="dateInput" required />
58
- <p class="mx-2">{{ localize("AT") }}</p>
59
- <input class="bcc-input text-right justify-end" type="time" v-model="timeInput" required />
60
- </div>
61
- <BccMessage class="mt-2" v-if="!isDateInFuture" severity="error">
62
- {{ localize("ERROR_DATE_IN_FUTURE") }}
63
- </BccMessage>
64
- </div>
65
-
66
- <template #footer>
67
- <BccButton class="button" :label="localize('SCHEDULE_MESSAGE')" :disabled="messageSent" @click="scheduleMessage()" />
68
- </template>
69
- </BccDialog>
70
- </template>
@@ -1,125 +0,0 @@
1
- <script setup lang="ts">
2
- import chat from "../chat";
3
- import { Group } from "@cometchat/chat-sdk-javascript";
4
- import { CloseIcon } from "@bcc-code/icons-vue";
5
- import { CometChatMessages } from "../chat/cometChatPatches";
6
- import { getScheduledMessagesComposerConfiguration, getScheduledMessagesListConfiguration } from "../chat/uiKit";
7
- import { inject, nextTick, onMounted, onUnmounted, ref, Ref, watchEffect } from "vue";
8
- import { ChatInstance } from "../chat/types";
9
- import { localize } from "@cometchat/uikit-resources";
10
- import { BccMessage } from "@bcc-code/component-library-vue";
11
- import BccAttachmentBox from "./BccAttachmentBox.vue";
12
- const emit = defineEmits(['close']);
13
-
14
- const props = defineProps({
15
- chatGroup: { type: Group, required: true },
16
- originalChatUid: { type: String, required: true }
17
- })
18
- const chatGroup = ref<Group>();
19
- chatGroup.value = props.chatGroup
20
- const chatInstance = inject<Ref<ChatInstance>>("chatInstance");
21
- if (chatInstance) chatInstance.value.showAlert = false;
22
-
23
- const messageComposerConfiguration = getScheduledMessagesComposerConfiguration(props.originalChatUid, chatInstance);
24
- const messageListConfiguration = getScheduledMessagesListConfiguration(props.originalChatUid, chatInstance, chatGroup);
25
-
26
- function closeList() {
27
- if (chatInstance?.value) {
28
- chatInstance.value.userInput = document.querySelector('.messageinput-input')?.innerHTML ?? null;
29
- chatInstance.value.decoyAttachment = chatInstance.value.captionedAttachment
30
- chatInstance.value.captionedAttachment = null
31
- }
32
- emit('close');
33
- }
34
-
35
- watchEffect(() => {
36
- if (chatInstance && chatInstance?.value.captionedAttachment) {
37
- messageComposerConfiguration.value.headerView = {
38
- componentName: BccAttachmentBox,
39
- props: {
40
- captionedAttachment: chatInstance.value.captionedAttachment
41
- }
42
- }
43
- } else {
44
- messageComposerConfiguration.value.headerView = undefined;
45
- }
46
- })
47
-
48
- onMounted(async () => {
49
- await nextTick();
50
- const userInput = document.querySelector('.messageinput-input');
51
- if (userInput && chatInstance?.value.userInput) {
52
- userInput.innerHTML = chatInstance.value.userInput;
53
- }
54
-
55
- if (chatInstance?.value.decoyAttachment) {
56
- chatInstance.value.captionedAttachment = chatInstance.value.decoyAttachment
57
- chatInstance.value.decoyAttachment = null
58
- }
59
- })
60
-
61
- onUnmounted(() => {
62
- if (chatInstance) {
63
- chatInstance.value.captionedAttachment = null
64
- chatInstance.value.replyToMessage = null
65
- chatInstance.value.scheduledMessageChat = undefined
66
- chatInstance.value.showScheduledMessagesChat = false
67
- chatInstance.value.showAlert = false
68
- chatInstance.value.rescheduleInfo = null
69
- }
70
- })
71
-
72
- </script>
73
-
74
- <template>
75
- <div class="bcc-chat-message-list">
76
- <div class="title-bar">
77
- <p class="title"> {{ localize("SCHEDULED_MESSAGES") }} </p>
78
- <CloseIcon @click="closeList()" class="closeIcon" />
79
- </div>
80
- <div v-if="chatGroup" class="bcc-chat-message-list scheduled-list">
81
- <CometChatMessages :hideMessageHeader="true" :disableSoundForMessages="true"
82
- :messageComposerConfiguration="messageComposerConfiguration"
83
- :messageListConfiguration="messageListConfiguration" :hideDetails="true" :group="props.chatGroup" />
84
-
85
- <div v-if="chat.onlineStatus.value === 'offline' || !chat.connected.value"
86
- class="bcc-chat-message-composer-offline">
87
- <span v-if="chat.onlineStatus.value === 'offline'">Waiting for network...</span>
88
- <span v-else>Connecting... </span>
89
- </div>
90
- <BccMessage v-if="chatInstance!.showAlert" class="absolute top-0 w-[97%] mx-2 mt-11" icon severity="error"
91
- closable @close="chatInstance!.showAlert = false">
92
- {{ localize("ERROR_SENDING_SCHEDULED_MESSAGE") }}
93
- </BccMessage>
94
- <BccMessage v-if="chatInstance!.showRescheduleAlert" class="absolute top-0 w-[97%] mx-2 mt-11" icon severity="error"
95
- closable @close="chatInstance!.showRescheduleAlert = false">
96
- {{ localize("ERROR_RESCHEDULING_MESSAGE") }}
97
- </BccMessage>
98
- </div>
99
- </div>
100
- </template>
101
-
102
- <style scoped>
103
- .title-bar {
104
- display: flex;
105
- align-items: center;
106
- justify-content: space-between;
107
- background: var(--cc__secondary, #111827);
108
- padding: 0.4rem 0.6rem;
109
-
110
-
111
- .title {
112
- color: var(--cc__text-color);
113
- }
114
-
115
- .closeIcon {
116
- width: 1.2rem;
117
- cursor: pointer;
118
- color: var(--cc__text-color);
119
- }
120
- }
121
-
122
- .scheduled-list {
123
- height: calc(100% - 45px) !important;
124
- }
125
- </style>
@@ -1,118 +0,0 @@
1
- <script setup lang="ts">
2
- import { SendIcon } from "@cometchat/chat-uikit-vue";
3
- import { localize } from "@cometchat/uikit-resources";
4
- import { getCurrentInstance, inject, onBeforeUnmount, onMounted, Ref, ref, watchEffect } from "vue";
5
- import { rescheduleMessage, sendScheduledMessage } from '../chat/scheduledMessage';
6
- import { ChatInstance } from '../chat/types';
7
- import BccScheduledMessageModal from './BccScheduledMessageModal.vue';
8
-
9
- const props = defineProps({
10
- chatUid: { type: String, required: true }
11
- })
12
-
13
- const isReschedule = ref<boolean>(false);
14
-
15
- const chatInstance = inject<Ref<ChatInstance>>("chatInstance");
16
- const vueInstance: any = getCurrentInstance();
17
- const msgComposerData = vueInstance?.parent?.type?.name === "CometChatMessageComposer" && vueInstance?.parent?.setupState;
18
- const msgComposerProps = vueInstance?.parent?.type?.name === "CometChatMessageComposer" && vueInstance?.parent?.props;
19
- const showModal = ref(false);
20
-
21
- const sendButtonIconURL = SendIcon;
22
- const sendButtonStyle = {
23
- height: "24px",
24
- width: "24px",
25
- border: "none",
26
- borderRadius: "0",
27
- buttonIconTint: "var(--cc__primary150, #57639e)",
28
- background: "transparent"
29
- }
30
-
31
- function sendMessage() {
32
- if (msgComposerData.messageToBeEdited && msgComposerData.showPreview) {
33
- msgComposerData?.customSendMethod(msgComposerData.inputRef.innerText)
34
- } else {
35
- openModal();
36
- }
37
- }
38
-
39
- function sendMessageOnEnter(textEnteredEvent: CustomEventInit) {
40
- if (!msgComposerData) return;
41
- msgComposerData.messageText = textEnteredEvent.detail.value;
42
- sendMessage()
43
- msgComposerData.showMentionsCountWarning = false;
44
- msgComposerData.showListForMentions = false;
45
- }
46
-
47
- const originalSendMessageOnEnter = msgComposerData?.sendMessageOnEnter;
48
- onMounted(() => {
49
- if (!msgComposerData) return;
50
- msgComposerData.sendMessageOnEnter = sendMessageOnEnter;
51
- });
52
- onBeforeUnmount(() => {
53
- msgComposerData.sendMessageOnEnter = originalSendMessageOnEnter;
54
- });
55
-
56
- watchEffect(async () => {
57
- if (chatInstance && chatInstance.value.rescheduleInfo) {
58
- isReschedule.value = true;
59
- showModal.value = true;
60
- } else {
61
- isReschedule.value = false;
62
- showModal.value = false;
63
- }
64
- })
65
-
66
-
67
- function openModal() {
68
- const userInput = document.querySelector<HTMLElement>(".messageinput-input")?.innerText;
69
- if ((userInput && userInput !== "") || msgComposerProps.headerView !== undefined) {
70
- showModal.value = true;
71
- }
72
- }
73
-
74
- function closeModal() {
75
- showModal.value = false;
76
- if (chatInstance) chatInstance.value.rescheduleInfo = null;
77
- }
78
-
79
- function scheduleMessage(scheduleDate?: string) {
80
- if (scheduleDate && chatInstance) {
81
- sendScheduledMessage(scheduleDate, props.chatUid, chatInstance).then((msgSuccessful) => {
82
- if (!msgSuccessful) {
83
- showModal.value = false
84
- chatInstance.value.showAlert = true
85
- setTimeout(() => chatInstance.value.showAlert = false, 5000)
86
- } else {
87
- showModal.value = false
88
- msgComposerData.messageText = "";
89
- msgComposerData.textRef = "";
90
- msgComposerData.inputRef?.emptyInputField();
91
- }
92
- });
93
- }
94
- }
95
-
96
- function reschedule(scheduleDate?: string) {
97
- if (scheduleDate && chatInstance && chatInstance.value.rescheduleInfo) {
98
- rescheduleMessage(scheduleDate, props.chatUid, chatInstance.value.rescheduleInfo.rescheduleMuid, chatInstance.value.rescheduleInfo.messageId).then((successful) => {
99
- if (!successful) {
100
- showModal.value = false
101
- chatInstance.value.showRescheduleAlert = true
102
- setTimeout(() => chatInstance.value.showRescheduleAlert = false, 5000)
103
- } else {
104
- showModal.value = false
105
- }
106
- })
107
- }
108
- }
109
- </script>
110
-
111
- <template>
112
- <div class="cc-messagecomposer-wrapper__sendbutton" ref="sendButton">
113
- <cometchat-button :iconURL="sendButtonIconURL" :buttonStyle="sendButtonStyle"
114
- :hoverText="localize('SCHEDULE_MESSAGE')" @click="sendMessage()" />
115
- </div>
116
- <BccScheduledMessageModal v-if="showModal" @close="closeModal()" @schedule="scheduleMessage" @reschedule="reschedule" :isReschedule="isReschedule">
117
- </BccScheduledMessageModal>
118
- </template>