@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,133 +0,0 @@
1
- <script setup lang="ts">
2
- import { CloseIcon } from "@cometchat/chat-uikit-vue";
3
- import {
4
- CometChatMessageEvents,
5
- CometChatTheme,
6
- MessageStatus,
7
- } from "@cometchat/uikit-resources";
8
- import {
9
- getCurrentInstance,
10
- inject,
11
- onBeforeUnmount,
12
- onMounted,
13
- ref,
14
- Ref,
15
- } from "vue";
16
- import { ChatInstance } from "../chat/types";
17
- import BccAttachmentPreview from "./BccAttachmentPreview.vue";
18
-
19
- const props = defineProps({
20
- captionedAttachment: { type: Object },
21
- closeButtonIconURL: { type: String, default: CloseIcon },
22
- previewStyle: { type: Object, default: {} },
23
- });
24
-
25
- const chatInstance = inject<Ref<ChatInstance>>("chatInstance");
26
- const vueInstance: any = getCurrentInstance();
27
- const msgComposerData =
28
- vueInstance?.parent?.type?.name === "CometChatMessageComposer" &&
29
- vueInstance?.parent?.setupState;
30
-
31
- const { theme } = inject("theme", { theme: ref(new CometChatTheme({})) });
32
-
33
- function closePreview(_event?: MouseEvent) {
34
- if (chatInstance) {
35
- chatInstance.value.captionedAttachment = null;
36
- }
37
- }
38
-
39
- const onMessageEditStart = CometChatMessageEvents.ccMessageEdited.subscribe(
40
- ({ status }) => {
41
- if (status === MessageStatus.inprogress) {
42
- if (chatInstance) chatInstance.value.replyToMessage = null;
43
- closePreview();
44
- }
45
- }
46
- );
47
-
48
- const onMessageSend = CometChatMessageEvents.ccMessageSent.subscribe(
49
- ({ status }) => {
50
- if (status === MessageStatus.inprogress) {
51
- closePreview();
52
- }
53
- }
54
- );
55
-
56
- onMounted(() => {
57
- if (msgComposerData) {
58
- msgComposerData.inputRef.querySelector(".messageinput-input").focus();
59
- if (msgComposerData.messageToBeEdited) {
60
- msgComposerData.showPreview = false; // This is only used for edit message preview
61
- msgComposerData.messageToBeEdited = null;
62
- msgComposerData.messageText = "";
63
- msgComposerData.textRef = "";
64
- msgComposerData.inputRef?.emptyInputField();
65
- }
66
- }
67
- });
68
-
69
- onBeforeUnmount(() => {
70
- onMessageEditStart.unsubscribe();
71
- onMessageSend.unsubscribe();
72
- });
73
-
74
- const closeBtnIconStyle = () => {
75
- return {
76
- buttonIconTint: theme.value.palette.getAccent500(),
77
- height: "14px",
78
- width: "14px",
79
- border: "none",
80
- borderRadius: "0",
81
- background: "transparent",
82
- display: "flex",
83
- justifyContent: "center",
84
- alignItems: "center",
85
- };
86
- };
87
-
88
- const wrapperStyle = () => {
89
- return {
90
- background: theme.value.palette.getBackground(),
91
- border: `1px solid ${theme.value.palette.getAccent200()}`,
92
- height: "100%",
93
- width: "100%",
94
- borderRadius: "12px",
95
- };
96
- };
97
- </script>
98
-
99
- <template>
100
- <div class="bcc__attachment_box" :style="wrapperStyle()">
101
- <BccAttachmentPreview
102
- :captionedAttachment="props.captionedAttachment"
103
- :previewStyle="previewStyle"
104
- />
105
- <div class="bcc__attachment_preview__close" @click="closePreview">
106
- <cometchat-button
107
- :buttonStyle="closeBtnIconStyle()"
108
- :iconURL="props.closeButtonIconURL"
109
- ></cometchat-button>
110
- </div>
111
- </div>
112
- </template>
113
-
114
- <style>
115
- .cc-messagecomposer-wrapper__headerview {
116
- position: static !important;
117
- }
118
- </style>
119
- <style scoped>
120
- .bcc__attachment_box {
121
- padding: 8px;
122
- display: flex;
123
- flex-direction: row;
124
- justify-content: space-between;
125
- margin: 0;
126
- min-height: 30px;
127
- }
128
- .bcc__attachment_preview__close {
129
- width: 14px;
130
- height: 14px;
131
- display: inline-block;
132
- }
133
- </style>
@@ -1,57 +0,0 @@
1
- <script setup lang="ts">
2
- import { PlaceholderImage } from '@cometchat/chat-uikit-vue';
3
- import { computed } from 'vue';
4
-
5
- const props = defineProps({
6
- captionedAttachment: { type: Object, default: {} },
7
- previewStyle: { type: Object, default: {} },
8
- });
9
-
10
- const previewUrl = computed(() => {
11
- if (!props.captionedAttachment?.fileObject)
12
- return PlaceholderImage;
13
-
14
- const blob = new Blob([props.captionedAttachment.fileObject]);
15
- return URL.createObjectURL(blob);
16
- });
17
-
18
- function imgLoaded(event: Event) {
19
- if (props.captionedAttachment) {
20
- props.captionedAttachment.dimensions = {
21
- width: (event.target as HTMLImageElement)?.naturalWidth,
22
- height: (event.target as HTMLImageElement)?.naturalHeight
23
- };
24
- }
25
- }
26
- </script>
27
-
28
- <template>
29
- <div class="bcc__attachment_preview__content_wrapper">
30
- <div class="bcc__attachment_preview__content">
31
- <img :src="previewUrl" @load="imgLoaded" />
32
- </div>
33
- </div>
34
- </template>
35
-
36
- <style scoped>
37
- .bcc__attachment_preview__content_wrapper {
38
- padding: 0 5px 0 20px;
39
- position: relative;
40
- width: 100%;
41
- }
42
-
43
- .bcc__attachment_preview__content {
44
- width: 100%;
45
- max-height: 350px;
46
- height: 100%;
47
- display: flex;
48
- justify-content: center;
49
- align-items: center;
50
- }
51
-
52
- .bcc__attachment_preview__content>img {
53
- width: 100%;
54
- height: 100%;
55
- object-fit: contain;
56
- }
57
- </style>
@@ -1,219 +0,0 @@
1
- <script setup lang="ts">
2
- import { BaseMessage, CometChat, MediaMessage, User } from '@cometchat/chat-sdk-javascript';
3
- import { CometChatTheme, fontHelper } from '@cometchat/uikit-resources';
4
- import { inject, ref } from 'vue';
5
- import chat from "../chat";
6
- import { offlineStore } from '../offline';
7
- import BccImageBubble from './BccImageBubble.vue';
8
- import BccReplyPreview from "./BccReplyPreview.vue";
9
-
10
- const props = defineProps({
11
- id: {
12
- type: String,
13
- required: false,
14
- default: ""
15
- },
16
- text: {
17
- type: String,
18
- required: true
19
- },
20
- metadata: {
21
- type: Object
22
- },
23
- guid: {
24
- type: String,
25
- default: ""
26
- },
27
- mentionedUsers: {
28
- type: Array<User>
29
- },
30
- message: {
31
- type: MediaMessage,
32
- default: null
33
- },
34
- placeholderImage: {
35
- type: String,
36
- default: null
37
- },
38
- src: {
39
- type: String,
40
- default: null
41
- }
42
- })
43
-
44
- let parentMsgRef = ref<BaseMessage>();
45
- if (props.metadata?.replyToMessageId) {
46
- let guidString = props.guid?.toString()
47
- let group = offlineStore.getGroup(guidString)
48
-
49
- //for read only replies
50
- if (group != null && group?.hasJoined == undefined) {
51
- let message = offlineStore.getMessage(props.metadata.replyToMessageId).data
52
-
53
- if (message !== undefined) {
54
- if (message.type == CometChat.MESSAGE_TYPE.TEXT) {
55
- let text = new CometChat.TextMessage(message.receiver, message.data.text, message.receiverType)
56
- text.setData(message.data)
57
- parentMsgRef.value = text
58
- } else {
59
- let media = new CometChat.MediaMessage(message.receiver, {}, message.type, message.receiverType)
60
- media.setData(message.data)
61
- parentMsgRef.value = media
62
- }
63
- } else {
64
- parentMsgRef.value = new CometChat.TextMessage("","Cannot load message","")
65
- }
66
- } else {
67
- CometChat.getMessageDetails(props.metadata.replyToMessageId).then((msg: BaseMessage) => parentMsgRef.value = msg).catch(() => parentMsgRef.value = new CometChat.TextMessage("","Unknown message",""));
68
- }
69
- };
70
-
71
- const { theme } = inject("theme", { theme: ref(new CometChatTheme({})) });
72
- const replyPreviewStyle = {
73
- previewWrapperPadding: "6px 12px 6px 9px",
74
- barLeftPosition: "0px",
75
- titleColor: theme.value.palette.getAccent800(),
76
- subtitleColor: theme.value.palette.getAccent800(),
77
- titleFont: fontHelper(theme.value.typography.title2),
78
- };
79
- </script>
80
-
81
- <template>
82
- <div class="bcc-message-wrapper" :class="{'has-text': text, 'has-image': src != null}" >
83
- <div v-if="metadata?.replyToMessageId" class="bcc-chat-msg-bubble">
84
- <div class="bcc-chat-msg-bubble--reply">
85
- <BccReplyPreview
86
- :replyToMessage="parentMsgRef"
87
- :previewStyle="replyPreviewStyle"
88
- />
89
- </div>
90
- </div>
91
- <div v-if="src != null" class="bcc-chat-img-msg-bubble">
92
- <BccImageBubble
93
- :message="message"
94
- :placeholderImage="placeholderImage"
95
- :src="src"
96
- />
97
- </div>
98
- <div v-if="text && metadata && metadata.translated_message" v-html="chat.toMarkdownHtml(metadata.translated_message, mentionedUsers)"
99
- class="bcc-chat-msg-bubble bcc-chat-msg-bubble--translation" />
100
- <div v-if="text" v-html="chat.toMarkdownHtml(text, mentionedUsers)" class="bcc-chat-msg-bubble" :id="id"
101
- :class="{ 'bcc-chat-msg-bubble--translated': metadata && !!metadata.translated_message }" />
102
- </div>
103
- </template>
104
-
105
- <style lang="scss">
106
- .bcc-chat-img-msg-bubble {
107
- display: block;
108
- width: max-content;
109
- max-width: 100%;
110
- margin: 0 auto;
111
- border-radius: 8px;
112
- padding-bottom: 8px;
113
- position: relative;
114
-
115
- &:last-child {
116
- padding-bottom: 0;
117
- }
118
- }
119
- .bcc-chat-msg-bubble {
120
- padding: 0 12px 8px;
121
- width: auto;
122
- max-width: 500px;
123
- line-height: 1.2;
124
- font: 400 14px Archivo, sans-serif, Inter;
125
- color: var(--cc__text-color);
126
-
127
- &:first-child {
128
- padding-top: 8px;
129
- }
130
-
131
- p {
132
- color: var(--cc__text-color);
133
- line-height: 1.2;
134
- word-break: break-word;
135
- text-align: left;
136
- white-space: normal;
137
- margin: 8px 0;
138
- }
139
-
140
- p:first-child {
141
- margin-top: 0;
142
- }
143
-
144
- p:last-child {
145
- margin-bottom: 0;
146
- }
147
-
148
- h1 {
149
- font-size: 1.6em;
150
- font-weight: 800;
151
- }
152
-
153
- h2 {
154
- font-size: 1.4em;
155
- font-weight: 700;
156
- }
157
-
158
- h3 {
159
- font-size: 1.2em;
160
- font-weight: 600;
161
- }
162
-
163
- h4 {
164
- font-size: 1em;
165
- font-weight: 500;
166
- }
167
-
168
- a {
169
- color: var(--cc__link-color);
170
- text-decoration: underline;
171
- font-weight: 500;
172
- }
173
-
174
- ul {
175
- padding-left: 16px;
176
- list-style: disc;
177
- margin: 8px 0;
178
- }
179
-
180
- ol {
181
- padding-left: 16px;
182
- list-style: decimal;
183
- margin: 8px 0;
184
- }
185
-
186
- &--translated {
187
- border-top: 1px solid;
188
- opacity: 0.8;
189
-
190
- &:before {
191
- content: 'original: ';
192
- opacity: 0.8;
193
- margin-bottom: 8px;
194
- font-size: 12px;
195
- display: block;
196
- }
197
- }
198
-
199
- &--reply {
200
- position: relative;
201
- z-index: 0;
202
- margin-top: 3px;
203
- border-radius: 6px;
204
- overflow: hidden;
205
- }
206
-
207
- &--reply::before {
208
- content: "";
209
- position: absolute;
210
- top: 0;
211
- left: 0;
212
- width: 100%;
213
- height: 100%;
214
- opacity: .5;
215
- z-index: -1;
216
- background-color: var(--cc__background);
217
- }
218
- }
219
- </style>