@voicenter-team/voicenter-ui-plus 3.4.7 → 3.4.8

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 (64) hide show
  1. package/README.md +558 -558
  2. package/library/assets/assets/sass/main.css +1 -1
  3. package/library/assets/components/VcChatComposer/VcChatComposer.css +1 -1
  4. package/library/assets/components/VcFileUploader/VcFileUploaderSimple.css +1 -1
  5. package/library/assets/components/VcMessage/VcMessage.css +1 -1
  6. package/library/assets/components/VcMessage/VcMessageMeta.css +1 -0
  7. package/library/assets/components/VcMessage/content/VcMessageVideoBlock.css +1 -0
  8. package/library/assets/components/VcMessagesWrapper/VcMessagesWrapper.css +1 -1
  9. package/library/components/VcChatComposer/VcChatComposer.vue.mjs +38 -27
  10. package/library/components/VcChatComposer/richText.mjs +8 -0
  11. package/library/components/VcCheckbox/VcCheckbox.vue.mjs +1 -1
  12. package/library/components/VcCheckbox/VcCheckboxButton.vue.mjs +1 -1
  13. package/library/components/VcDatePicker/VcDatePicker.vue.mjs +1 -1
  14. package/library/components/VcDropdown/VcDropdownItem.vue.mjs +1 -1
  15. package/library/components/VcExcelUploader/VcExcelFileUploader.vue.mjs +1 -0
  16. package/library/components/VcExcelUploader/VcFileImportResultBindData.vue.mjs +1 -1
  17. package/library/components/VcFileUploader/VcFileUploaderSimple.vue.mjs +1 -1
  18. package/library/components/VcForm/VcForm.vue.mjs +1 -1
  19. package/library/components/VcForm/VcFormItem.vue.mjs +1 -1
  20. package/library/components/VcHtmlEditor/VcHtmlEditorToolbar.vue.mjs +1 -1
  21. package/library/components/VcInput/VcInput.vue.mjs +1 -1
  22. package/library/components/VcMdEditor/VcMdEditor.vue.mjs +1 -1
  23. package/library/components/VcMdEditor/VcMdEditorToolbar.vue.mjs +1 -1
  24. package/library/components/VcMessage/VcMessage.vue.mjs +65 -40
  25. package/library/components/VcMessage/VcMessageMeta.vue.mjs +49 -0
  26. package/library/components/VcMessage/VcMessageMeta.vue3.mjs +5 -0
  27. package/library/components/VcMessage/content/VcMessageAudioBlock.vue.mjs +3 -9
  28. package/library/components/VcMessage/content/VcMessageImageBlock.vue.mjs +1 -1
  29. package/library/components/VcMessage/content/VcMessageVideoBlock.vue.mjs +60 -0
  30. package/library/components/VcMessage/content/VcMessageVideoBlock.vue3.mjs +5 -0
  31. package/library/components/VcMessage/content/formatDuration.mjs +10 -0
  32. package/library/components/VcMessage/content/messageContentComponents.mjs +8 -5
  33. package/library/components/VcMessage/reactions/VcMessageReactionBar.vue.mjs +1 -1
  34. package/library/components/VcMessagesWrapper/VcMessagesWrapper.vue.mjs +167 -63
  35. package/library/components/VcMessagesWrapper/VcMessagesWrapperRow.vue.mjs +83 -0
  36. package/library/components/VcMessagesWrapper/VcMessagesWrapperRow.vue2.mjs +4 -0
  37. package/library/components/VcRadio/VcRadio.vue.mjs +1 -1
  38. package/library/components/VcSelect/VcSelect.vue.mjs +1 -1
  39. package/library/components/VcSlider/VcSlider.vue.mjs +1 -1
  40. package/library/index.mjs.gz +0 -0
  41. package/library/localization/index.mjs.gz +0 -0
  42. package/library/localization/locales/en.json.mjs +8 -1
  43. package/library/plugin.mjs.gz +0 -0
  44. package/library/style.css +9 -5
  45. package/library/style.css.br +0 -0
  46. package/library/style.css.gz +0 -0
  47. package/library/theme/index.mjs.gz +0 -0
  48. package/library/types/components/VcChatComposer/VcChatComposer.vue.d.ts +29 -2
  49. package/library/types/components/VcExcelUploader/VcExcelFileUploader.vue.d.ts +1 -2
  50. package/library/types/components/VcMessage/VcMessage.vue.d.ts +20 -2
  51. package/library/types/components/VcMessage/VcMessageMeta.vue.d.ts +24 -0
  52. package/library/types/components/VcMessage/content/VcMessageVideoBlock.vue.d.ts +24 -0
  53. package/library/types/components/VcMessage/content/formatDuration.d.ts +4 -0
  54. package/library/types/components/VcMessagesWrapper/VcMessagesWrapper.vue.d.ts +20 -2
  55. package/library/types/components/VcMessagesWrapper/VcMessagesWrapperRow.vue.d.ts +49 -0
  56. package/library/types/components/VcModal/VcConfirmModal.vue.d.ts +1 -1
  57. package/library/types/localization/locales/en.json.d.ts +194 -187
  58. package/library/types/types/VcChatComposer.types.d.ts +3 -2
  59. package/library/types/types/VcMessage.types.d.ts +48 -3
  60. package/library/types/types/VcMessagesWrapper.types.d.ts +30 -1
  61. package/library/utils/jsonSchema/index.mjs.gz +0 -0
  62. package/package.json +215 -215
  63. package/tailwind.config.js +192 -192
  64. /package/library/assets/node_modules/element-plus/theme-chalk/src/{date-picker.css → tooltip.css} +0 -0
@@ -1,14 +1,17 @@
1
- import _sfc_main$3 from "./VcMessageTextBlock.vue.mjs";
2
- import '../../../assets/components/VcMessage/content/VcMessageFileBlock.css';import '../../../assets/components/VcMessage/content/VcMessageAudioBlock.css';import '../../../assets/components/VcMessage/content/VcMessageImageBlock.css';import '../../../assets/components/VcMessage/content/VcMessageTextBlock.css';/* empty css */
3
- import _sfc_main$2 from "./VcMessageImageBlock.vue.mjs";
1
+ import _sfc_main$4 from "./VcMessageTextBlock.vue.mjs";
2
+ import '../../../assets/components/VcMessage/content/VcMessageFileBlock.css';import '../../../assets/components/VcMessage/content/VcMessageAudioBlock.css';import '../../../assets/components/VcMessage/content/VcMessageVideoBlock.css';import '../../../assets/components/VcMessage/content/VcMessageImageBlock.css';import '../../../assets/components/VcMessage/content/VcMessageTextBlock.css';/* empty css */
3
+ import _sfc_main$3 from "./VcMessageImageBlock.vue.mjs";
4
+ /* empty css */
5
+ import _sfc_main$2 from "./VcMessageVideoBlock.vue.mjs";
4
6
  /* empty css */
5
7
  import _sfc_main$1 from "./VcMessageAudioBlock.vue.mjs";
6
8
  /* empty css */
7
9
  import _sfc_main from "./VcMessageFileBlock.vue.mjs";
8
10
  /* empty css */
9
11
  const messageContentComponents = {
10
- text: _sfc_main$3,
11
- image: _sfc_main$2,
12
+ text: _sfc_main$4,
13
+ image: _sfc_main$3,
14
+ video: _sfc_main$2,
12
15
  audio: _sfc_main$1,
13
16
  file: _sfc_main
14
17
  };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, computed, openBlock, createElementBlock, Fragment, renderList, createBlock, unref, withCtx, createElementVNode, normalizeClass, toDisplayString, createVNode } from "vue";
2
2
  import { ElTooltip } from "element-plus";
3
- import '../../../assets/components/VcMessage/reactions/VcMessageEmojiPicker.css';import '../../../assets/components/VcIcon/VcIcon.css';import '../../../assets/node_modules/element-plus/theme-chalk/src/date-picker.css';import '../../../assets/node_modules/element-plus/theme-chalk/src/popper.css';import '../../../assets/node_modules/element-plus/theme-chalk/src/base.css';
3
+ import '../../../assets/components/VcMessage/reactions/VcMessageEmojiPicker.css';import '../../../assets/components/VcIcon/VcIcon.css';import '../../../assets/node_modules/element-plus/theme-chalk/src/tooltip.css';import '../../../assets/node_modules/element-plus/theme-chalk/src/popper.css';import '../../../assets/node_modules/element-plus/theme-chalk/src/base.css';
4
4
  import '../../../assets/components/VcMessage/reactions/VcMessageReactionBar.css';/* empty css */
5
5
  /* empty css */
6
6
  /* empty css */
@@ -1,21 +1,20 @@
1
1
  import '../../assets/components/VcMessagesWrapper/VcMessagesWrapper.css';
2
- import { defineComponent, ref, computed, watch, nextTick, onMounted, onBeforeUnmount, openBlock, createElementBlock, createElementVNode, renderSlot, createCommentVNode, Fragment, renderList, toDisplayString, normalizeClass, createVNode } from "vue";
2
+ import { defineComponent, ref, computed, watch, nextTick, onMounted, onBeforeUnmount, openBlock, createElementBlock, createElementVNode, renderSlot, createCommentVNode, Fragment, renderList, toDisplayString, createBlock } from "vue";
3
3
  import dayjs from "dayjs";
4
- import _sfc_main$1 from "../VcMessage/VcMessage.vue.mjs";
5
- import '../../assets/components/VcMessage/VcMessage.css';/* empty css */
4
+ import _sfc_main$1 from "./VcMessagesWrapperRow.vue.mjs";
6
5
  import { tVU } from "../../localization/index.mjs";
7
6
  const _hoisted_1 = {
8
7
  key: 0,
9
8
  class: "vc-messages-wrapper__date"
10
9
  };
11
10
  const _hoisted_2 = { class: "vc-messages-wrapper__date-label" };
12
- const _hoisted_3 = ["data-message-id"];
13
- const _hoisted_4 = {
14
- key: 0,
15
- class: "vc-messages-wrapper__header"
11
+ const _hoisted_3 = {
12
+ key: 1,
13
+ class: "vc-messages-wrapper__unread"
16
14
  };
17
- const _hoisted_5 = { class: "vc-messages-wrapper__sender" };
18
- const _hoisted_6 = { class: "vc-messages-wrapper__time" };
15
+ const _hoisted_4 = { class: "vc-messages-wrapper__unread-label" };
16
+ const UNREAD_KEY = "unread-divider";
17
+ const SEEN_TOLERANCE = 2;
19
18
  const _sfc_main = /* @__PURE__ */ defineComponent({
20
19
  __name: "VcMessagesWrapper",
21
20
  props: {
@@ -23,23 +22,30 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
23
22
  options: { type: Function, default: void 0 },
24
23
  additionalOptions: { type: Function, default: void 0 },
25
24
  reactionEmojis: { default: void 0 },
25
+ unreadFromId: { default: void 0 },
26
26
  scrollThreshold: { default: 50 },
27
27
  dateFormat: { default: "dddd, MMM D" },
28
28
  timeFormat: { default: "HH:mm" }
29
29
  },
30
- emits: ["reached-top", "reached-bottom", "option-click", "reply-click", "content-click", "reaction-toggle"],
30
+ emits: ["reached-top", "reached-bottom", "option-click", "reply-click", "content-click", "reaction-toggle", "seen"],
31
31
  setup(__props, { expose: __expose, emit: __emit }) {
32
32
  const props = __props;
33
33
  const emit = __emit;
34
34
  const containerRef = ref();
35
35
  const listRef = ref();
36
+ const unreadLabel = computed(() => tVU.t("voicenterUi.messagesWrapper.newMessages"));
37
+ function isSameId(a, b) {
38
+ return String(a) === String(b);
39
+ }
36
40
  const renderItems = computed(() => {
37
41
  const items = [];
42
+ const { unreadFromId } = props;
38
43
  let previous;
39
44
  for (const message of props.messages) {
40
45
  const createdAt = dayjs(message.createdAt);
41
46
  const previousCreatedAt = previous ? dayjs(previous.createdAt) : void 0;
42
47
  const isNewDay = !previousCreatedAt || !createdAt.isSame(previousCreatedAt, "day");
48
+ const isUnreadStart = unreadFromId !== void 0 && unreadFromId !== null && isSameId(message.id, unreadFromId);
43
49
  if (isNewDay) {
44
50
  items.push({
45
51
  kind: "date",
@@ -48,7 +54,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
48
54
  label: formatDateLabel(createdAt)
49
55
  });
50
56
  }
51
- const isGroupStart = isNewDay || (previous == null ? void 0 : previous.sender.id) !== message.sender.id;
57
+ if (isUnreadStart) {
58
+ items.push({
59
+ kind: "unread",
60
+ key: UNREAD_KEY
61
+ });
62
+ }
63
+ const isGroupStart = isNewDay || isUnreadStart || (previous == null ? void 0 : previous.sender.id) !== message.sender.id;
52
64
  const isNewMinute = !previousCreatedAt || !createdAt.isSame(previousCreatedAt, "minute");
53
65
  items.push({
54
66
  kind: "message",
@@ -72,8 +84,26 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
72
84
  }
73
85
  return date.format(props.dateFormat);
74
86
  }
75
- let isAtTop = false;
76
- let isAtBottom = false;
87
+ function onOptionClick(event, message, option) {
88
+ emit("option-click", event, message, option);
89
+ }
90
+ function onReplyClick(message) {
91
+ var _a;
92
+ if (((_a = message.replyTo) == null ? void 0 : _a.id) !== void 0) {
93
+ scrollToMessage(message.replyTo.id);
94
+ }
95
+ emit("reply-click", message);
96
+ }
97
+ function onContentClick(message) {
98
+ emit("content-click", message);
99
+ }
100
+ function onReactionToggle(emoji, message) {
101
+ emit("reaction-toggle", emoji, message);
102
+ }
103
+ const lastEdges = {
104
+ top: false,
105
+ bottom: false
106
+ };
77
107
  function getEdges() {
78
108
  const el = containerRef.value;
79
109
  if (!el) {
@@ -88,20 +118,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
88
118
  };
89
119
  }
90
120
  function syncEdges() {
91
- const edges = getEdges();
92
- isAtTop = edges.top;
93
- isAtBottom = edges.bottom;
121
+ Object.assign(lastEdges, getEdges());
94
122
  }
95
123
  function onScroll() {
96
124
  const edges = getEdges();
97
- if (edges.top && !isAtTop) {
125
+ if (edges.top && !lastEdges.top) {
98
126
  emit("reached-top");
99
127
  }
100
- if (edges.bottom && !isAtBottom) {
128
+ if (edges.bottom && !lastEdges.bottom) {
101
129
  emit("reached-bottom");
102
130
  }
103
- isAtTop = edges.top;
104
- isAtBottom = edges.bottom;
131
+ Object.assign(lastEdges, edges);
132
+ scheduleSeenUpdate();
105
133
  }
106
134
  function scrollToBottom(behavior = "auto") {
107
135
  const el = containerRef.value;
@@ -114,24 +142,100 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
114
142
  });
115
143
  syncEdges();
116
144
  }
117
- function scrollToMessage(id, behavior = "smooth") {
145
+ function scrollToElement(target, { behavior = "auto", block = "start", offset = 0 } = {}) {
146
+ const el = containerRef.value;
147
+ if (!el) {
148
+ return;
149
+ }
150
+ const containerTop = el.getBoundingClientRect().top + el.clientTop;
151
+ const { top, height } = target.getBoundingClientRect();
152
+ const elementTop = top - containerTop + el.scrollTop;
153
+ const positions = {
154
+ start: elementTop - offset,
155
+ center: elementTop - (el.clientHeight - height) / 2,
156
+ end: elementTop + height - el.clientHeight + offset
157
+ };
158
+ el.scrollTo({
159
+ top: positions[block],
160
+ behavior
161
+ });
162
+ if (behavior !== "smooth") {
163
+ syncEdges();
164
+ }
165
+ }
166
+ function findRow(id) {
118
167
  var _a;
119
- const target = (_a = containerRef.value) == null ? void 0 : _a.querySelector(`[data-message-id="${CSS.escape(String(id))}"]`);
168
+ return Array.from(((_a = listRef.value) == null ? void 0 : _a.children) ?? []).find((child) => child instanceof HTMLElement && child.dataset.messageId !== void 0 && isSameId(child.dataset.messageId, id));
169
+ }
170
+ function scrollToMessage(id, options = {}) {
171
+ const target = findRow(id);
120
172
  if (!target) {
121
173
  return false;
122
174
  }
123
- target.scrollIntoView({
175
+ scrollToElement(target, {
124
176
  block: "center",
125
- behavior
177
+ behavior: "smooth",
178
+ ...options
126
179
  });
127
180
  return true;
128
181
  }
129
- function onReplyClick(message) {
182
+ function scrollToUnread(options = {}) {
130
183
  var _a;
131
- if (((_a = message.replyTo) == null ? void 0 : _a.id) !== void 0) {
132
- scrollToMessage(message.replyTo.id);
184
+ const target = (_a = listRef.value) == null ? void 0 : _a.querySelector(":scope > .vc-messages-wrapper__unread");
185
+ if (!target) {
186
+ return false;
133
187
  }
134
- emit("reply-click", message);
188
+ scrollToElement(target, options);
189
+ return true;
190
+ }
191
+ function isAtBottom() {
192
+ return getEdges().bottom;
193
+ }
194
+ let lastSeenId;
195
+ let isSeenScheduled = false;
196
+ let seenFrame = 0;
197
+ function getMessageRows() {
198
+ var _a;
199
+ return Array.from(((_a = listRef.value) == null ? void 0 : _a.children) ?? []).filter((child) => child instanceof HTMLElement && child.dataset.messageId !== void 0);
200
+ }
201
+ function updateSeen() {
202
+ const el = containerRef.value;
203
+ if (!el || !el.clientHeight || document.visibilityState !== "visible") {
204
+ return;
205
+ }
206
+ const rows = getMessageRows();
207
+ const visibleBottom = el.getBoundingClientRect().bottom + SEEN_TOLERANCE;
208
+ let low = 0;
209
+ let high = rows.length - 1;
210
+ let seenRow;
211
+ while (low <= high) {
212
+ const middle = Math.floor((low + high) / 2);
213
+ if (rows[middle].getBoundingClientRect().bottom <= visibleBottom) {
214
+ seenRow = rows[middle];
215
+ low = middle + 1;
216
+ } else {
217
+ high = middle - 1;
218
+ }
219
+ }
220
+ const seenId = seenRow == null ? void 0 : seenRow.dataset.messageId;
221
+ const seenIndex = seenId === void 0 ? -1 : props.messages.findIndex((message) => isSameId(message.id, seenId));
222
+ const previousId = lastSeenId;
223
+ const previousIndex = previousId === void 0 ? -1 : props.messages.findIndex((message) => isSameId(message.id, previousId));
224
+ if (seenIndex <= previousIndex) {
225
+ return;
226
+ }
227
+ lastSeenId = props.messages[seenIndex].id;
228
+ emit("seen", props.messages[seenIndex]);
229
+ }
230
+ function scheduleSeenUpdate() {
231
+ if (isSeenScheduled) {
232
+ return;
233
+ }
234
+ isSeenScheduled = true;
235
+ seenFrame = requestAnimationFrame(() => {
236
+ isSeenScheduled = false;
237
+ updateSeen();
238
+ });
135
239
  }
136
240
  watch(
137
241
  () => {
@@ -154,26 +258,39 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
154
258
  } else if (wasAtBottom) {
155
259
  scrollToBottom();
156
260
  }
261
+ scheduleSeenUpdate();
157
262
  }
158
263
  );
159
264
  let resizeObserver;
160
265
  onMounted(() => {
161
- scrollToBottom();
266
+ if (!scrollToUnread()) {
267
+ scrollToBottom();
268
+ }
162
269
  resizeObserver = new ResizeObserver(() => {
163
- if (isAtBottom) {
270
+ if (lastEdges.bottom) {
164
271
  scrollToBottom();
165
272
  }
273
+ scheduleSeenUpdate();
166
274
  });
167
275
  if (listRef.value) {
168
276
  resizeObserver.observe(listRef.value);
169
277
  }
278
+ if (containerRef.value) {
279
+ resizeObserver.observe(containerRef.value);
280
+ }
281
+ document.addEventListener("visibilitychange", scheduleSeenUpdate);
282
+ scheduleSeenUpdate();
170
283
  });
171
284
  onBeforeUnmount(() => {
172
285
  resizeObserver == null ? void 0 : resizeObserver.disconnect();
286
+ document.removeEventListener("visibilitychange", scheduleSeenUpdate);
287
+ cancelAnimationFrame(seenFrame);
173
288
  });
174
289
  __expose({
175
290
  scrollToBottom,
176
- scrollToMessage
291
+ scrollToMessage,
292
+ scrollToUnread,
293
+ isAtBottom
177
294
  });
178
295
  return (_ctx, _cache) => {
179
296
  return openBlock(), createElementBlock("div", {
@@ -189,7 +306,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
189
306
  }, [
190
307
  !__props.messages.length ? renderSlot(_ctx.$slots, "empty", { key: 0 }) : createCommentVNode("", true),
191
308
  (openBlock(true), createElementBlock(Fragment, null, renderList(renderItems.value, (item) => {
192
- var _a, _b;
193
309
  return openBlock(), createElementBlock(Fragment, {
194
310
  key: item.key
195
311
  }, [
@@ -200,37 +316,25 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
200
316
  }, () => [
201
317
  createElementVNode("span", _hoisted_2, toDisplayString(item.label), 1)
202
318
  ])
203
- ])) : (openBlock(), createElementBlock("div", {
204
- key: 1,
205
- "data-message-id": item.message.id,
206
- class: normalizeClass([{
207
- "is--own": item.message.isOwn,
208
- "is--group-start": item.isGroupStart
209
- }, "vc-messages-wrapper__row"])
210
- }, [
211
- item.showTime ? (openBlock(), createElementBlock("div", _hoisted_4, [
212
- item.isGroupStart ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
213
- createElementVNode("span", _hoisted_5, toDisplayString(item.message.sender.name), 1),
214
- _cache[0] || (_cache[0] = createElementVNode("span", { class: "vc-messages-wrapper__dot" }, "·", -1))
215
- ], 64)) : createCommentVNode("", true),
216
- createElementVNode("span", _hoisted_6, toDisplayString(item.time), 1)
217
- ])) : createCommentVNode("", true),
218
- createVNode(_sfc_main$1, {
219
- content: item.message.content,
220
- align: item.message.isOwn ? "end" : "start",
221
- reply: item.message.replyTo,
222
- reactions: item.message.reactions,
223
- "reaction-emojis": __props.reactionEmojis,
224
- edited: item.message.isEdited,
225
- deleted: item.message.isDeleted,
226
- options: ((_a = __props.options) == null ? void 0 : _a.call(__props, item.message)) ?? [],
227
- "additional-options": ((_b = __props.additionalOptions) == null ? void 0 : _b.call(__props, item.message)) ?? [],
228
- onOptionClick: (event, option) => emit("option-click", event, item.message, option),
229
- onReplyClick: ($event) => onReplyClick(item.message),
230
- onContentClick: ($event) => emit("content-click", item.message),
231
- onReactionToggle: ($event) => emit("reaction-toggle", $event, item.message)
232
- }, null, 8, ["content", "align", "reply", "reactions", "reaction-emojis", "edited", "deleted", "options", "additional-options", "onOptionClick", "onReplyClick", "onContentClick", "onReactionToggle"])
233
- ], 10, _hoisted_3))
319
+ ])) : item.kind === "unread" ? (openBlock(), createElementBlock("div", _hoisted_3, [
320
+ renderSlot(_ctx.$slots, "unread-divider", { label: unreadLabel.value }, () => [
321
+ createElementVNode("span", _hoisted_4, toDisplayString(unreadLabel.value), 1)
322
+ ])
323
+ ])) : (openBlock(), createBlock(_sfc_main$1, {
324
+ key: 2,
325
+ message: item.message,
326
+ "is-group-start": item.isGroupStart,
327
+ "show-time": item.showTime,
328
+ time: item.time,
329
+ options: __props.options,
330
+ "additional-options": __props.additionalOptions,
331
+ "reaction-emojis": __props.reactionEmojis,
332
+ "header-slot": _ctx.$slots["message-header"],
333
+ onOptionClick,
334
+ onReplyClick,
335
+ onContentClick,
336
+ onReactionToggle
337
+ }, null, 8, ["message", "is-group-start", "show-time", "time", "options", "additional-options", "reaction-emojis", "header-slot"]))
234
338
  ], 64);
235
339
  }), 128))
236
340
  ], 512)
@@ -0,0 +1,83 @@
1
+ import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, Fragment, createElementVNode, toDisplayString, createCommentVNode, createVNode, createSlots, withCtx } from "vue";
2
+ import _sfc_main$1 from "../VcMessage/VcMessage.vue.mjs";
3
+ import '../../assets/components/VcMessage/VcMessage.css';/* empty css */
4
+ const _hoisted_1 = ["data-message-id"];
5
+ const _hoisted_2 = {
6
+ key: 0,
7
+ class: "vc-messages-wrapper__header"
8
+ };
9
+ const _hoisted_3 = { class: "vc-messages-wrapper__sender" };
10
+ const _hoisted_4 = { class: "vc-messages-wrapper__time" };
11
+ const _sfc_main = /* @__PURE__ */ defineComponent({
12
+ __name: "VcMessagesWrapperRow",
13
+ props: {
14
+ message: {},
15
+ isGroupStart: { type: Boolean },
16
+ showTime: { type: Boolean },
17
+ time: {},
18
+ options: { type: Function },
19
+ additionalOptions: { type: Function },
20
+ reactionEmojis: {},
21
+ headerSlot: { type: Function }
22
+ },
23
+ emits: ["option-click", "reply-click", "content-click", "reaction-toggle"],
24
+ setup(__props, { emit: __emit }) {
25
+ const EMPTY_OPTIONS = [];
26
+ const EMPTY_ADDITIONAL_OPTIONS = [];
27
+ const props = __props;
28
+ const emit = __emit;
29
+ const SlotOutlet = (outlet) => outlet.render(outlet.scope);
30
+ const messageOptions = computed(() => {
31
+ var _a;
32
+ return ((_a = props.options) == null ? void 0 : _a.call(props, props.message)) ?? EMPTY_OPTIONS;
33
+ });
34
+ const messageAdditionalOptions = computed(() => {
35
+ var _a;
36
+ return ((_a = props.additionalOptions) == null ? void 0 : _a.call(props, props.message)) ?? EMPTY_ADDITIONAL_OPTIONS;
37
+ });
38
+ return (_ctx, _cache) => {
39
+ return openBlock(), createElementBlock("div", {
40
+ "data-message-id": __props.message.id,
41
+ class: normalizeClass([[__props.message.class, { "is--own": __props.message.isOwn, "is--group-start": __props.isGroupStart }], "vc-messages-wrapper__row"])
42
+ }, [
43
+ __props.showTime ? (openBlock(), createElementBlock("div", _hoisted_2, [
44
+ __props.isGroupStart ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
45
+ createElementVNode("span", _hoisted_3, toDisplayString(__props.message.sender.name), 1),
46
+ _cache[4] || (_cache[4] = createElementVNode("span", { class: "vc-messages-wrapper__dot" }, "·", -1))
47
+ ], 64)) : createCommentVNode("", true),
48
+ createElementVNode("span", _hoisted_4, toDisplayString(__props.time), 1)
49
+ ])) : createCommentVNode("", true),
50
+ createVNode(_sfc_main$1, {
51
+ content: __props.message.content,
52
+ align: __props.message.isOwn ? "end" : "start",
53
+ reply: __props.message.replyTo,
54
+ reactions: __props.message.reactions,
55
+ "reaction-emojis": __props.reactionEmojis,
56
+ edited: __props.message.isEdited,
57
+ deleted: __props.message.isDeleted,
58
+ status: __props.message.status,
59
+ options: messageOptions.value,
60
+ "additional-options": messageAdditionalOptions.value,
61
+ onOptionClick: _cache[0] || (_cache[0] = (event, option) => emit("option-click", event, __props.message, option)),
62
+ onReplyClick: _cache[1] || (_cache[1] = ($event) => emit("reply-click", __props.message)),
63
+ onContentClick: _cache[2] || (_cache[2] = ($event) => emit("content-click", __props.message)),
64
+ onReactionToggle: _cache[3] || (_cache[3] = ($event) => emit("reaction-toggle", $event, __props.message))
65
+ }, createSlots({ _: 2 }, [
66
+ __props.headerSlot ? {
67
+ name: "header",
68
+ fn: withCtx(() => [
69
+ createVNode(SlotOutlet, {
70
+ render: __props.headerSlot,
71
+ scope: { message: __props.message }
72
+ }, null, 8, ["render", "scope"])
73
+ ]),
74
+ key: "0"
75
+ } : void 0
76
+ ]), 1032, ["content", "align", "reply", "reactions", "reaction-emojis", "edited", "deleted", "status", "options", "additional-options"])
77
+ ], 10, _hoisted_1);
78
+ };
79
+ }
80
+ });
81
+ export {
82
+ _sfc_main as default
83
+ };
@@ -0,0 +1,4 @@
1
+ import _sfc_main from "./VcMessagesWrapperRow.vue.mjs";
2
+ export {
3
+ _sfc_main as default
4
+ };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, computed, openBlock, createBlock, unref, normalizeClass, withCtx, renderSlot, createTextVNode, toDisplayString } from "vue";
2
2
  import { ElRadio } from "element-plus";
3
- import '../../assets/node_modules/element-plus/theme-chalk/src/popover.css';import '../../assets/node_modules/element-plus/theme-chalk/src/transfer.css';import '../../assets/node_modules/element-plus/theme-chalk/src/tree.css';import '../../assets/node_modules/element-plus/theme-chalk/src/text.css';import '../../assets/node_modules/element-plus/theme-chalk/src/slider.css';import '../../assets/node_modules/element-plus/theme-chalk/src/color-picker.css';import '../../assets/node_modules/element-plus/theme-chalk/src/color-picker-panel.css';import '../../assets/node_modules/element-plus/theme-chalk/src/date-picker.css';import '../../assets/node_modules/element-plus/theme-chalk/src/date-picker-panel.css';import '../../assets/node_modules/element-plus/theme-chalk/src/button.css';import '../../assets/node_modules/element-plus/theme-chalk/src/checkbox-button.css';import '../../assets/node_modules/element-plus/theme-chalk/src/checkbox-group.css';import '../../assets/node_modules/element-plus/theme-chalk/src/checkbox.css';import '../../assets/node_modules/element-plus/theme-chalk/src/radio-button.css';import '../../assets/node_modules/element-plus/theme-chalk/src/radio-group.css';import '../../assets/node_modules/element-plus/theme-chalk/src/radio.css';import '../../assets/node_modules/element-plus/theme-chalk/src/select.css';import '../../assets/node_modules/element-plus/theme-chalk/src/option-group.css';import '../../assets/node_modules/element-plus/theme-chalk/src/option.css';import '../../assets/node_modules/element-plus/theme-chalk/src/tag.css';import '../../assets/node_modules/element-plus/theme-chalk/src/autocomplete.css';import '../../assets/node_modules/element-plus/theme-chalk/src/popper.css';import '../../assets/node_modules/element-plus/theme-chalk/src/scrollbar.css';import '../../assets/node_modules/element-plus/theme-chalk/src/input-number.css';import '../../assets/node_modules/element-plus/theme-chalk/src/input.css';import '../../assets/node_modules/element-plus/theme-chalk/src/form-item.css';import '../../assets/node_modules/element-plus/theme-chalk/src/form.css';import '../../assets/node_modules/element-plus/theme-chalk/src/base.css';
3
+ import '../../assets/node_modules/element-plus/theme-chalk/src/popover.css';import '../../assets/node_modules/element-plus/theme-chalk/src/transfer.css';import '../../assets/node_modules/element-plus/theme-chalk/src/tree.css';import '../../assets/node_modules/element-plus/theme-chalk/src/text.css';import '../../assets/node_modules/element-plus/theme-chalk/src/slider.css';import '../../assets/node_modules/element-plus/theme-chalk/src/color-picker.css';import '../../assets/node_modules/element-plus/theme-chalk/src/color-picker-panel.css';import '../../assets/node_modules/element-plus/theme-chalk/src/tooltip.css';import '../../assets/node_modules/element-plus/theme-chalk/src/date-picker-panel.css';import '../../assets/node_modules/element-plus/theme-chalk/src/button.css';import '../../assets/node_modules/element-plus/theme-chalk/src/checkbox-button.css';import '../../assets/node_modules/element-plus/theme-chalk/src/checkbox-group.css';import '../../assets/node_modules/element-plus/theme-chalk/src/checkbox.css';import '../../assets/node_modules/element-plus/theme-chalk/src/radio-button.css';import '../../assets/node_modules/element-plus/theme-chalk/src/radio-group.css';import '../../assets/node_modules/element-plus/theme-chalk/src/radio.css';import '../../assets/node_modules/element-plus/theme-chalk/src/select.css';import '../../assets/node_modules/element-plus/theme-chalk/src/option-group.css';import '../../assets/node_modules/element-plus/theme-chalk/src/option.css';import '../../assets/node_modules/element-plus/theme-chalk/src/tag.css';import '../../assets/node_modules/element-plus/theme-chalk/src/autocomplete.css';import '../../assets/node_modules/element-plus/theme-chalk/src/popper.css';import '../../assets/node_modules/element-plus/theme-chalk/src/scrollbar.css';import '../../assets/node_modules/element-plus/theme-chalk/src/input-number.css';import '../../assets/node_modules/element-plus/theme-chalk/src/input.css';import '../../assets/node_modules/element-plus/theme-chalk/src/form-item.css';import '../../assets/node_modules/element-plus/theme-chalk/src/form.css';import '../../assets/node_modules/element-plus/theme-chalk/src/base.css';
4
4
  import '../../assets/components/VcRadio/VcRadio.css';/* empty css */
5
5
  /* empty css */
6
6
  /* empty css */
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, computed, markRaw, h, watch, openBlock, createBlock, unref, mergeProps, isRef, createSlots, withCtx, renderSlot, createElementBlock, Fragment, createVNode, createTextVNode, toDisplayString, createCommentVNode, renderList, createElementVNode, normalizeStyle, normalizeClass } from "vue";
2
2
  import { ElSelect } from "element-plus";
3
- import '../../assets/components/VcIcon/VcIcon.css';import '../../assets/components/VcForm/VcFormItem.css';import '../../assets/components/VcCheckbox/VcCheckbox.css';import '../../assets/components/VcSelect/VcSelectOption.css';import '../../assets/node_modules/element-plus/theme-chalk/src/popover.css';import '../../assets/node_modules/element-plus/theme-chalk/src/transfer.css';import '../../assets/node_modules/element-plus/theme-chalk/src/tree.css';import '../../assets/node_modules/element-plus/theme-chalk/src/text.css';import '../../assets/node_modules/element-plus/theme-chalk/src/slider.css';import '../../assets/node_modules/element-plus/theme-chalk/src/color-picker.css';import '../../assets/node_modules/element-plus/theme-chalk/src/color-picker-panel.css';import '../../assets/node_modules/element-plus/theme-chalk/src/date-picker.css';import '../../assets/node_modules/element-plus/theme-chalk/src/date-picker-panel.css';import '../../assets/node_modules/element-plus/theme-chalk/src/button.css';import '../../assets/node_modules/element-plus/theme-chalk/src/checkbox-button.css';import '../../assets/node_modules/element-plus/theme-chalk/src/checkbox-group.css';import '../../assets/node_modules/element-plus/theme-chalk/src/checkbox.css';import '../../assets/node_modules/element-plus/theme-chalk/src/radio-button.css';import '../../assets/node_modules/element-plus/theme-chalk/src/radio-group.css';import '../../assets/node_modules/element-plus/theme-chalk/src/radio.css';import '../../assets/node_modules/element-plus/theme-chalk/src/select.css';import '../../assets/node_modules/element-plus/theme-chalk/src/option-group.css';import '../../assets/node_modules/element-plus/theme-chalk/src/option.css';import '../../assets/node_modules/element-plus/theme-chalk/src/tag.css';import '../../assets/node_modules/element-plus/theme-chalk/src/autocomplete.css';import '../../assets/node_modules/element-plus/theme-chalk/src/popper.css';import '../../assets/node_modules/element-plus/theme-chalk/src/scrollbar.css';import '../../assets/node_modules/element-plus/theme-chalk/src/input-number.css';import '../../assets/node_modules/element-plus/theme-chalk/src/input.css';import '../../assets/node_modules/element-plus/theme-chalk/src/form-item.css';import '../../assets/node_modules/element-plus/theme-chalk/src/form.css';import '../../assets/node_modules/element-plus/theme-chalk/src/base.css';
3
+ import '../../assets/components/VcIcon/VcIcon.css';import '../../assets/components/VcForm/VcFormItem.css';import '../../assets/components/VcCheckbox/VcCheckbox.css';import '../../assets/components/VcSelect/VcSelectOption.css';import '../../assets/node_modules/element-plus/theme-chalk/src/popover.css';import '../../assets/node_modules/element-plus/theme-chalk/src/transfer.css';import '../../assets/node_modules/element-plus/theme-chalk/src/tree.css';import '../../assets/node_modules/element-plus/theme-chalk/src/text.css';import '../../assets/node_modules/element-plus/theme-chalk/src/slider.css';import '../../assets/node_modules/element-plus/theme-chalk/src/color-picker.css';import '../../assets/node_modules/element-plus/theme-chalk/src/color-picker-panel.css';import '../../assets/node_modules/element-plus/theme-chalk/src/tooltip.css';import '../../assets/node_modules/element-plus/theme-chalk/src/date-picker-panel.css';import '../../assets/node_modules/element-plus/theme-chalk/src/button.css';import '../../assets/node_modules/element-plus/theme-chalk/src/checkbox-button.css';import '../../assets/node_modules/element-plus/theme-chalk/src/checkbox-group.css';import '../../assets/node_modules/element-plus/theme-chalk/src/checkbox.css';import '../../assets/node_modules/element-plus/theme-chalk/src/radio-button.css';import '../../assets/node_modules/element-plus/theme-chalk/src/radio-group.css';import '../../assets/node_modules/element-plus/theme-chalk/src/radio.css';import '../../assets/node_modules/element-plus/theme-chalk/src/select.css';import '../../assets/node_modules/element-plus/theme-chalk/src/option-group.css';import '../../assets/node_modules/element-plus/theme-chalk/src/option.css';import '../../assets/node_modules/element-plus/theme-chalk/src/tag.css';import '../../assets/node_modules/element-plus/theme-chalk/src/autocomplete.css';import '../../assets/node_modules/element-plus/theme-chalk/src/popper.css';import '../../assets/node_modules/element-plus/theme-chalk/src/scrollbar.css';import '../../assets/node_modules/element-plus/theme-chalk/src/input-number.css';import '../../assets/node_modules/element-plus/theme-chalk/src/input.css';import '../../assets/node_modules/element-plus/theme-chalk/src/form-item.css';import '../../assets/node_modules/element-plus/theme-chalk/src/form.css';import '../../assets/node_modules/element-plus/theme-chalk/src/base.css';
4
4
  import '../../assets/components/VcSelect/VcSelect.css';/* empty css */
5
5
  /* empty css */
6
6
  /* empty css */
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, openBlock, createBlock, unref, mergeProps } from "vue";
2
2
  import { ElSlider } from "element-plus";
3
- import '../../assets/node_modules/element-plus/theme-chalk/src/slider.css';import '../../assets/node_modules/element-plus/theme-chalk/src/input-number.css';import '../../assets/node_modules/element-plus/theme-chalk/src/input.css';import '../../assets/node_modules/element-plus/theme-chalk/src/date-picker.css';import '../../assets/node_modules/element-plus/theme-chalk/src/popper.css';import '../../assets/node_modules/element-plus/theme-chalk/src/base.css';
3
+ import '../../assets/node_modules/element-plus/theme-chalk/src/slider.css';import '../../assets/node_modules/element-plus/theme-chalk/src/input-number.css';import '../../assets/node_modules/element-plus/theme-chalk/src/input.css';import '../../assets/node_modules/element-plus/theme-chalk/src/tooltip.css';import '../../assets/node_modules/element-plus/theme-chalk/src/popper.css';import '../../assets/node_modules/element-plus/theme-chalk/src/base.css';
4
4
  import '../../assets/components/VcSlider/VcSlider.css';/* empty css */
5
5
  /* empty css */
6
6
  /* empty css */
Binary file
Binary file
@@ -166,9 +166,15 @@ const enLocale = {
166
166
  "voicenterUi.message.deleted": "This message was deleted",
167
167
  "voicenterUi.message.image": "Photo",
168
168
  "voicenterUi.message.audio": "Voice message",
169
+ "voicenterUi.message.video": "Video",
169
170
  "voicenterUi.message.react": "React",
170
171
  "voicenterUi.message.addReaction": "Add reaction",
171
172
  "voicenterUi.message.reactionUsersMore": "and {count} more",
173
+ "voicenterUi.message.status.pending": "Sending",
174
+ "voicenterUi.message.status.sent": "Sent",
175
+ "voicenterUi.message.status.delivered": "Delivered",
176
+ "voicenterUi.message.status.read": "Read",
177
+ "voicenterUi.message.status.failed": "Not sent",
172
178
  "voicenterUi.emojiPicker.trigger": "Emoji",
173
179
  "voicenterUi.emojiPicker.recent": "Frequently used",
174
180
  "voicenterUi.fileItem.uploadFailed": "Upload failed",
@@ -183,7 +189,8 @@ const enLocale = {
183
189
  "voicenterUi.chatComposer.dropFiles": "Drop files to attach",
184
190
  "voicenterUi.chatComposer.microphoneError": "The microphone is not available",
185
191
  "voicenterUi.messagesWrapper.today": "Today",
186
- "voicenterUi.messagesWrapper.yesterday": "Yesterday"
192
+ "voicenterUi.messagesWrapper.yesterday": "Yesterday",
193
+ "voicenterUi.messagesWrapper.newMessages": "New messages"
187
194
  };
188
195
  export {
189
196
  enLocale as default
Binary file