@voicenter-team/voicenter-ui-plus 3.4.6 → 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 (41) hide show
  1. package/README.md +65 -9
  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/VcMessage/VcMessage.css +1 -1
  5. package/library/assets/components/VcMessage/VcMessageMeta.css +1 -0
  6. package/library/assets/components/VcMessage/content/VcMessageVideoBlock.css +1 -0
  7. package/library/assets/components/VcMessagesWrapper/VcMessagesWrapper.css +1 -1
  8. package/library/components/VcChatComposer/VcChatComposer.vue.mjs +38 -27
  9. package/library/components/VcChatComposer/richText.mjs +8 -0
  10. package/library/components/VcExcelUploader/VcExcelFileUploader.vue.mjs +1 -0
  11. package/library/components/VcExcelUploader/VcFileImportResultBindData.vue.mjs +1 -1
  12. package/library/components/VcMessage/VcMessage.vue.mjs +65 -40
  13. package/library/components/VcMessage/VcMessageMeta.vue.mjs +49 -0
  14. package/library/components/VcMessage/VcMessageMeta.vue3.mjs +5 -0
  15. package/library/components/VcMessage/content/VcMessageAudioBlock.vue.mjs +3 -9
  16. package/library/components/VcMessage/content/VcMessageImageBlock.vue.mjs +1 -1
  17. package/library/components/VcMessage/content/VcMessageVideoBlock.vue.mjs +60 -0
  18. package/library/components/VcMessage/content/VcMessageVideoBlock.vue3.mjs +5 -0
  19. package/library/components/VcMessage/content/formatDuration.mjs +10 -0
  20. package/library/components/VcMessage/content/messageContentComponents.mjs +8 -5
  21. package/library/components/VcMessagesWrapper/VcMessagesWrapper.vue.mjs +167 -63
  22. package/library/components/VcMessagesWrapper/VcMessagesWrapperRow.vue.mjs +83 -0
  23. package/library/components/VcMessagesWrapper/VcMessagesWrapperRow.vue2.mjs +4 -0
  24. package/library/localization/locales/en.json.mjs +8 -1
  25. package/library/style.css +8 -4
  26. package/library/style.css.br +0 -0
  27. package/library/style.css.gz +0 -0
  28. package/library/types/components/VcChatComposer/VcChatComposer.vue.d.ts +29 -2
  29. package/library/types/components/VcExcelUploader/VcExcelFileUploader.vue.d.ts +1 -2
  30. package/library/types/components/VcMessage/VcMessage.vue.d.ts +20 -2
  31. package/library/types/components/VcMessage/VcMessageMeta.vue.d.ts +24 -0
  32. package/library/types/components/VcMessage/content/VcMessageVideoBlock.vue.d.ts +24 -0
  33. package/library/types/components/VcMessage/content/formatDuration.d.ts +4 -0
  34. package/library/types/components/VcMessagesWrapper/VcMessagesWrapper.vue.d.ts +20 -2
  35. package/library/types/components/VcMessagesWrapper/VcMessagesWrapperRow.vue.d.ts +49 -0
  36. package/library/types/components/VcModal/VcConfirmModal.vue.d.ts +1 -1
  37. package/library/types/localization/locales/en.json.d.ts +8 -1
  38. package/library/types/types/VcChatComposer.types.d.ts +3 -2
  39. package/library/types/types/VcMessage.types.d.ts +48 -3
  40. package/library/types/types/VcMessagesWrapper.types.d.ts +30 -1
  41. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import '../../assets/components/VcChatComposer/VcChatComposer.css';
2
- import { defineComponent, reactive, ref, computed, watch, onBeforeUnmount, openBlock, createElementBlock, withModifiers, normalizeClass, createVNode, unref, createElementVNode, toDisplayString, createCommentVNode, Fragment, renderList, createBlock, withDirectives, Teleport, vShow, createTextVNode, withCtx } from "vue";
2
+ import { defineComponent, reactive, ref, computed, watch, onBeforeUnmount, openBlock, createElementBlock, withModifiers, normalizeClass, createVNode, unref, createElementVNode, toDisplayString, createCommentVNode, renderSlot, Fragment, renderList, createBlock, withDirectives, Teleport, vShow, createTextVNode, withCtx } from "vue";
3
3
  import { Extension, useEditor, EditorContent } from "@tiptap/vue-3";
4
4
  import Document from "@tiptap/extension-document";
5
5
  import Paragraph from "@tiptap/extension-paragraph";
@@ -40,25 +40,29 @@ const _hoisted_3 = {
40
40
  };
41
41
  const _hoisted_4 = {
42
42
  key: 1,
43
- class: "vc-chat-composer__attachments"
43
+ class: "vc-chat-composer__header"
44
44
  };
45
45
  const _hoisted_5 = {
46
46
  key: 2,
47
- class: "vc-chat-composer__recording"
47
+ class: "vc-chat-composer__attachments"
48
48
  };
49
- const _hoisted_6 = { class: "vc-chat-composer__recording-time" };
50
- const _hoisted_7 = {
49
+ const _hoisted_6 = {
51
50
  key: 3,
52
- class: "vc-chat-composer__voice"
51
+ class: "vc-chat-composer__recording"
53
52
  };
54
- const _hoisted_8 = { class: "vc-chat-composer__editor-wrapper" };
55
- const _hoisted_9 = ["aria-selected", "onMousedown"];
56
- const _hoisted_10 = { class: "vc-chat-composer__toolbar" };
57
- const _hoisted_11 = { class: "vc-chat-composer__actions" };
58
- const _hoisted_12 = ["accept"];
59
- const _hoisted_13 = { class: "vc-chat-composer__hint" };
60
- const _hoisted_14 = {
53
+ const _hoisted_7 = { class: "vc-chat-composer__recording-time" };
54
+ const _hoisted_8 = {
61
55
  key: 4,
56
+ class: "vc-chat-composer__voice"
57
+ };
58
+ const _hoisted_9 = { class: "vc-chat-composer__editor-wrapper" };
59
+ const _hoisted_10 = ["aria-selected", "onMousedown"];
60
+ const _hoisted_11 = { class: "vc-chat-composer__toolbar" };
61
+ const _hoisted_12 = { class: "vc-chat-composer__actions" };
62
+ const _hoisted_13 = ["accept"];
63
+ const _hoisted_14 = { class: "vc-chat-composer__hint" };
64
+ const _hoisted_15 = {
65
+ key: 5,
62
66
  class: "vc-chat-composer__error"
63
67
  };
64
68
  const MAX_MENTION_SUGGESTIONS = 8;
@@ -81,7 +85,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
81
85
  enableVoice: { type: Boolean, default: true },
82
86
  clearOnSend: { type: Boolean, default: true }
83
87
  },
84
- emits: ["update:modelValue", "update:attachments", "send", "retry", "emoji-select"],
88
+ emits: ["update:modelValue", "update:attachments", "send", "retry", "emoji-select", "focus", "blur"],
85
89
  setup(__props, { expose: __expose, emit: __emit }) {
86
90
  const FORMAT_EXTENSIONS = {
87
91
  bold: Bold,
@@ -302,7 +306,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
302
306
  Text,
303
307
  UndoRedo,
304
308
  Placeholder.configure({ placeholder: () => placeholderText.value }),
305
- ...props.formats.map((format) => FORMAT_EXTENSIONS[format]),
309
+ // Plain text cannot keep formatting: no format extensions, so typed markers stay text.
310
+ ...(props.format === "text" ? [] : props.formats).map((format) => FORMAT_EXTENSIONS[format]),
306
311
  Mention.configure({
307
312
  HTMLAttributes: { class: "vc-chat-composer__mention" },
308
313
  suggestion: {
@@ -359,6 +364,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
359
364
  }),
360
365
  SendOnEnter
361
366
  ],
367
+ onFocus: () => emit("focus"),
368
+ onBlur: () => emit("blur"),
362
369
  onUpdate: () => {
363
370
  const richText = getRichText();
364
371
  hasText.value = !!richText.text.trim();
@@ -414,7 +421,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
414
421
  createElementVNode("span", _hoisted_2, toDisplayString(dropText.value), 1),
415
422
  __props.dropHintText ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(__props.dropHintText), 1)) : createCommentVNode("", true)
416
423
  ])) : createCommentVNode("", true),
417
- __props.attachments.length ? (openBlock(), createElementBlock("div", _hoisted_4, [
424
+ _ctx.$slots.header ? (openBlock(), createElementBlock("div", _hoisted_4, [
425
+ renderSlot(_ctx.$slots, "header")
426
+ ])) : createCommentVNode("", true),
427
+ __props.attachments.length ? (openBlock(), createElementBlock("div", _hoisted_5, [
418
428
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.attachments, (item) => {
419
429
  return openBlock(), createBlock(_sfc_main$2, {
420
430
  key: item.id ?? item.name,
@@ -427,9 +437,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
427
437
  }, null, 8, ["file", "status", "progress", "disabled", "onRemove", "onRetry"]);
428
438
  }), 128))
429
439
  ])) : createCommentVNode("", true),
430
- unref(recorder).state.value === "recording" ? (openBlock(), createElementBlock("div", _hoisted_5, [
440
+ unref(recorder).state.value === "recording" ? (openBlock(), createElementBlock("div", _hoisted_6, [
431
441
  _cache[1] || (_cache[1] = createElementVNode("span", { class: "vc-chat-composer__recording-dot" }, null, -1)),
432
- createElementVNode("span", _hoisted_6, toDisplayString(recordingTime.value), 1),
442
+ createElementVNode("span", _hoisted_7, toDisplayString(recordingTime.value), 1),
433
443
  createVNode(_sfc_main$3, {
434
444
  icon: unref(Trash2),
435
445
  title: cancelText.value,
@@ -444,7 +454,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
444
454
  color: "primary",
445
455
  onClick: stopRecording
446
456
  }, null, 8, ["icon", "title", "aria-label"])
447
- ])) : unref(recorder).state.value === "recorded" && unref(recorder).url.value ? (openBlock(), createElementBlock("div", _hoisted_7, [
457
+ ])) : unref(recorder).state.value === "recorded" && unref(recorder).url.value ? (openBlock(), createElementBlock("div", _hoisted_8, [
448
458
  createVNode(_sfc_main$4, {
449
459
  src: unref(recorder).url.value,
450
460
  size: "sm",
@@ -458,7 +468,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
458
468
  onClick: deleteRecording
459
469
  }, null, 8, ["icon", "title", "aria-label"])
460
470
  ])) : createCommentVNode("", true),
461
- withDirectives(createElementVNode("div", _hoisted_8, [
471
+ withDirectives(createElementVNode("div", _hoisted_9, [
462
472
  (openBlock(), createBlock(Teleport, { to: "body" }, [
463
473
  mention.isOpen && mention.items.length ? (openBlock(), createElementBlock("ul", {
464
474
  key: 0,
@@ -482,7 +492,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
482
492
  size: "sm"
483
493
  }, null, 8, ["src", "initials", "alt"]),
484
494
  createElementVNode("span", null, toDisplayString(user.name), 1)
485
- ], 42, _hoisted_9);
495
+ ], 42, _hoisted_10);
486
496
  }), 128))
487
497
  ], 512)) : createCommentVNode("", true)
488
498
  ])),
@@ -493,8 +503,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
493
503
  ], 512), [
494
504
  [vShow, unref(recorder).state.value === "idle"]
495
505
  ]),
496
- createElementVNode("div", _hoisted_10, [
497
- createElementVNode("div", _hoisted_11, [
506
+ createElementVNode("div", _hoisted_11, [
507
+ createElementVNode("div", _hoisted_12, [
498
508
  createVNode(_sfc_main$3, {
499
509
  icon: unref(Paperclip),
500
510
  disabled: __props.disabled,
@@ -511,7 +521,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
511
521
  multiple: "",
512
522
  class: "vc-chat-composer__file-input",
513
523
  onChange: onFileInputChange
514
- }, null, 40, _hoisted_12),
524
+ }, null, 40, _hoisted_13),
515
525
  createVNode(_sfc_main$6, {
516
526
  "recent-emojis": __props.recentEmojis,
517
527
  disabled: __props.disabled,
@@ -525,9 +535,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
525
535
  "aria-label": recordText.value,
526
536
  color: "secondary",
527
537
  onClick: startRecording
528
- }, null, 8, ["icon", "disabled", "title", "aria-label"])) : createCommentVNode("", true)
538
+ }, null, 8, ["icon", "disabled", "title", "aria-label"])) : createCommentVNode("", true),
539
+ renderSlot(_ctx.$slots, "actions")
529
540
  ]),
530
- createElementVNode("span", _hoisted_13, [
541
+ createElementVNode("span", _hoisted_14, [
531
542
  createTextVNode(toDisplayString(pressText.value) + " ", 1),
532
543
  _cache[2] || (_cache[2] = createElementVNode("kbd", { class: "vc-chat-composer__kbd" }, "Enter", -1)),
533
544
  createTextVNode(" " + toDisplayString(toSendText.value), 1)
@@ -544,7 +555,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
544
555
  _: 1
545
556
  }, 8, ["icon", "disabled"])
546
557
  ]),
547
- errorMessage.value ? (openBlock(), createElementBlock("div", _hoisted_14, toDisplayString(errorMessage.value), 1)) : createCommentVNode("", true)
558
+ errorMessage.value ? (openBlock(), createElementBlock("div", _hoisted_15, toDisplayString(errorMessage.value), 1)) : createCommentVNode("", true)
548
559
  ], 34);
549
560
  };
550
561
  }
@@ -81,6 +81,13 @@ const entitiesFormat = {
81
81
  },
82
82
  serialize: (richText) => richText
83
83
  };
84
+ const textFormat = {
85
+ parse: (value) => ({
86
+ text: typeof value === "string" ? value : "",
87
+ entities: []
88
+ }),
89
+ serialize: (richText) => richText.text
90
+ };
84
91
  const MARKDOWN_MARKERS = {
85
92
  bold: "**",
86
93
  italic: "*",
@@ -235,6 +242,7 @@ const htmlFormat = {
235
242
  )
236
243
  };
237
244
  const BUILT_IN_FORMATS = {
245
+ text: textFormat,
238
246
  entities: entitiesFormat,
239
247
  markdown: markdownFormat,
240
248
  html: htmlFormat
@@ -426,6 +426,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
426
426
  "780px": "90vw",
427
427
  "680px": "98vw"
428
428
  },
429
+ "dismissable-mask": false,
429
430
  "data-test-name": "excel-file-import-modal",
430
431
  "content-class": "wizard-modal-content h-full !max-h-full !p-0",
431
432
  onClose: onCancel
@@ -2,7 +2,7 @@ import { defineComponent, ref, computed, openBlock, createElementBlock, createEl
2
2
  import _sfc_main$1 from "./VcFileImportResultBindDataTable.vue.mjs";
3
3
  import _sfc_main$2 from "./VcFileImportErrorsCard.vue.mjs";
4
4
  import '../../assets/components/VcExcelUploader/VcFileImportErrorsCard.css';/* empty css */
5
- const _hoisted_1 = { class: "w-full flex h-full gap-3 lg:gap-0 flex-wrap self-start" };
5
+ const _hoisted_1 = { class: "w-full flex h-full gap-3 lg:gap-0 flex-wrap lg:flex-nowrap self-start" };
6
6
  const _hoisted_2 = { class: "w-full lg:w-7/12 md:px-10 h-full" };
7
7
  const _hoisted_3 = { class: "w-full lg:w-5/12 md:px-10 h-full" };
8
8
  const _sfc_main = /* @__PURE__ */ defineComponent({
@@ -1,42 +1,40 @@
1
1
  import '../../assets/components/VcMessage/VcMessage.css';
2
- import { defineComponent, ref, computed, openBlock, createElementBlock, normalizeClass, toDisplayString, createCommentVNode, createElementVNode, createBlock, resolveDynamicComponent, unref, Fragment, renderList, withCtx, createVNode } from "vue";
2
+ import { defineComponent, ref, computed, openBlock, createElementBlock, normalizeClass, renderSlot, createCommentVNode, toDisplayString, createElementVNode, createBlock, resolveDynamicComponent, unref, Fragment, renderList, withCtx, createVNode } from "vue";
3
3
  import { Ellipsis } from "@lucide/vue";
4
- import _sfc_main$3 from "../VcButton/VcButtonIcon.vue.mjs";
5
- import '../../assets/components/VcMessage/reactions/VcMessageReactionBar.css';import '../../assets/components/VcMessage/reactions/VcMessageEmojiPicker.css';import '../../assets/components/VcIcon/VcIcon.css';import '../../assets/components/VcDropdown/VcDropdown.css';import '../../assets/components/VcButton/VcButtonIcon.css';/* empty css */
6
- import _sfc_main$4 from "../VcDropdown/VcDropdown.vue.mjs";
4
+ import _sfc_main$4 from "../VcButton/VcButtonIcon.vue.mjs";
5
+ import '../../assets/components/VcMessage/reactions/VcMessageReactionBar.css';import '../../assets/components/VcMessage/reactions/VcMessageEmojiPicker.css';import '../../assets/components/VcMessage/VcMessageMeta.css';import '../../assets/components/VcIcon/VcIcon.css';import '../../assets/components/VcDropdown/VcDropdown.css';import '../../assets/components/VcButton/VcButtonIcon.css';/* empty css */
6
+ import _sfc_main$5 from "../VcDropdown/VcDropdown.vue.mjs";
7
7
  /* empty css */
8
- import _sfc_main$5 from "../VcIcon/VcIcon.vue.mjs";
8
+ import _sfc_main$6 from "../VcIcon/VcIcon.vue.mjs";
9
9
  /* empty css */
10
10
  import { messageContentComponents } from "./content/messageContentComponents.mjs";
11
- import _sfc_main$2 from "./reactions/VcMessageEmojiPicker.vue.mjs";
11
+ import _sfc_main$1 from "./VcMessageMeta.vue.mjs";
12
+ /* empty css */
13
+ import _sfc_main$3 from "./reactions/VcMessageEmojiPicker.vue.mjs";
12
14
  /* empty css */
13
- import _sfc_main$1 from "./reactions/VcMessageReactionBar.vue.mjs";
15
+ import _sfc_main$2 from "./reactions/VcMessageReactionBar.vue.mjs";
14
16
  /* empty css */
15
17
  import { DEFAULT_REACTION_EMOJIS } from "./reactions/emojis.mjs";
16
18
  import { tVU } from "../../localization/index.mjs";
17
19
  const _hoisted_1 = {
18
20
  key: 0,
19
- class: "vc-message__deleted"
21
+ class: "vc-message__header"
20
22
  };
21
- const _hoisted_2 = { class: "vc-message__reply-author" };
22
- const _hoisted_3 = {
23
- key: 2,
24
- class: "vc-message__content"
23
+ const _hoisted_2 = {
24
+ key: 1,
25
+ class: "vc-message__deleted"
25
26
  };
27
+ const _hoisted_3 = { class: "vc-message__reply-author" };
26
28
  const _hoisted_4 = {
27
- key: 0,
28
- class: "vc-message__edited"
29
+ key: 4,
30
+ class: "vc-message__caption"
29
31
  };
30
32
  const _hoisted_5 = {
31
- key: 3,
32
- class: "vc-message__edited"
33
- };
34
- const _hoisted_6 = {
35
- key: 5,
33
+ key: 7,
36
34
  class: "vc-message__toolbar"
37
35
  };
38
- const _hoisted_7 = { class: "vc-dropdown-item__content-inner vc-message__menu-item" };
39
- const _hoisted_8 = {
36
+ const _hoisted_6 = { class: "vc-dropdown-item__content-inner vc-message__menu-item" };
37
+ const _hoisted_7 = {
40
38
  key: 1,
41
39
  class: "vc-message__menu-shortcut"
42
40
  };
@@ -52,6 +50,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
52
50
  reactionEmojis: { default: () => DEFAULT_REACTION_EMOJIS },
53
51
  edited: { type: Boolean, default: false },
54
52
  deleted: { type: Boolean, default: false },
53
+ status: { default: void 0 },
55
54
  editedLabel: { default: void 0 },
56
55
  deletedLabel: { default: void 0 }
57
56
  },
@@ -62,11 +61,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
62
61
  const isMenuOpen = ref(false);
63
62
  const isPickerOpen = ref(false);
64
63
  const isMedia = computed(() => {
64
+ var _a, _b;
65
+ return !props.deleted && (((_a = props.content) == null ? void 0 : _a.type) === "image" || ((_b = props.content) == null ? void 0 : _b.type) === "video");
66
+ });
67
+ const caption = computed(() => {
65
68
  var _a;
66
- return !props.deleted && ((_a = props.content) == null ? void 0 : _a.type) === "image";
69
+ if (props.deleted || !props.content || props.content.type === "text") {
70
+ return "";
71
+ }
72
+ return ((_a = props.content.caption) == null ? void 0 : _a.trim()) ?? "";
67
73
  });
68
74
  const moreOptionsLabel = computed(() => tVU.t("voicenterUi.message.moreOptions"));
69
75
  const editedText = computed(() => props.editedLabel || tVU.t("voicenterUi.message.edited"));
76
+ const hasMeta = computed(() => !props.deleted && (props.edited || !!props.status));
77
+ const metaEditedText = computed(() => props.edited ? editedText.value : "");
70
78
  const deletedText = computed(() => props.deletedLabel || tVU.t("voicenterUi.message.deleted"));
71
79
  const additionalOptionsFlat = computed(() => props.additionalOptions.flat());
72
80
  const hasAdditionalOptions = computed(() => additionalOptionsFlat.value.length > 0);
@@ -103,41 +111,58 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
103
111
  return openBlock(), createElementBlock("div", {
104
112
  class: normalizeClass([[`vc-message--align-${__props.align}`, { "is--menu-open": isMenuOpen.value || isPickerOpen.value, "is--deleted": __props.deleted, "is--media": isMedia.value }], "vc-message"])
105
113
  }, [
106
- __props.deleted ? (openBlock(), createElementBlock("div", _hoisted_1, toDisplayString(deletedText.value), 1)) : createCommentVNode("", true),
114
+ _ctx.$slots.header ? (openBlock(), createElementBlock("div", _hoisted_1, [
115
+ renderSlot(_ctx.$slots, "header")
116
+ ])) : createCommentVNode("", true),
117
+ __props.deleted ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(deletedText.value), 1)) : createCommentVNode("", true),
107
118
  __props.reply && !__props.deleted ? (openBlock(), createElementBlock("button", {
108
- key: 1,
119
+ key: 2,
109
120
  type: "button",
110
121
  class: "vc-message__reply",
111
122
  onClick: _cache[0] || (_cache[0] = ($event) => emit("reply-click"))
112
123
  }, [
113
- createElementVNode("span", _hoisted_2, toDisplayString(__props.reply.author), 1),
124
+ createElementVNode("span", _hoisted_3, toDisplayString(__props.reply.author), 1),
114
125
  (openBlock(), createBlock(resolveDynamicComponent(unref(messageContentComponents)[__props.reply.content.type]), {
115
126
  content: __props.reply.content,
116
127
  preview: "",
117
128
  class: "vc-message__reply-content"
118
129
  }, null, 8, ["content"]))
119
130
  ])) : createCommentVNode("", true),
120
- __props.content && !__props.deleted ? (openBlock(), createElementBlock("div", _hoisted_3, [
131
+ __props.content && !__props.deleted ? (openBlock(), createElementBlock("div", {
132
+ key: 3,
133
+ class: normalizeClass([{ "is--captioned": caption.value }, "vc-message__content"])
134
+ }, [
121
135
  (openBlock(), createBlock(resolveDynamicComponent(unref(messageContentComponents)[__props.content.type]), {
122
136
  content: __props.content,
123
137
  onContentClick: _cache[1] || (_cache[1] = ($event) => emit("content-click", __props.content))
124
138
  }, null, 40, ["content"])),
125
- __props.edited && isMedia.value ? (openBlock(), createElementBlock("div", _hoisted_4, toDisplayString(editedText.value), 1)) : createCommentVNode("", true)
126
- ])) : createCommentVNode("", true),
127
- __props.edited && !__props.deleted && !isMedia.value ? (openBlock(), createElementBlock("div", _hoisted_5, toDisplayString(editedText.value), 1)) : createCommentVNode("", true),
128
- __props.reactions.length && !__props.deleted ? (openBlock(), createBlock(_sfc_main$1, {
129
- key: 4,
139
+ hasMeta.value && isMedia.value && !caption.value ? (openBlock(), createBlock(_sfc_main$1, {
140
+ key: 0,
141
+ "edited-text": metaEditedText.value,
142
+ status: __props.status,
143
+ class: "vc-message__meta"
144
+ }, null, 8, ["edited-text", "status"])) : createCommentVNode("", true)
145
+ ], 2)) : createCommentVNode("", true),
146
+ caption.value ? (openBlock(), createElementBlock("div", _hoisted_4, toDisplayString(caption.value), 1)) : createCommentVNode("", true),
147
+ hasMeta.value && (!isMedia.value || caption.value) ? (openBlock(), createBlock(_sfc_main$1, {
148
+ key: 5,
149
+ "edited-text": metaEditedText.value,
150
+ status: __props.status,
151
+ class: "vc-message__meta"
152
+ }, null, 8, ["edited-text", "status"])) : createCommentVNode("", true),
153
+ __props.reactions.length && !__props.deleted ? (openBlock(), createBlock(_sfc_main$2, {
154
+ key: 6,
130
155
  reactions: __props.reactions,
131
156
  emojis: __props.reactionEmojis,
132
157
  class: "vc-message__reactions",
133
158
  onToggle: _cache[2] || (_cache[2] = ($event) => emit("reaction-toggle", $event))
134
159
  }, null, 8, ["reactions", "emojis"])) : createCommentVNode("", true),
135
- hasToolbar.value && !__props.deleted ? (openBlock(), createElementBlock("div", _hoisted_6, [
160
+ hasToolbar.value && !__props.deleted ? (openBlock(), createElementBlock("div", _hoisted_5, [
136
161
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (option) => {
137
162
  return openBlock(), createElementBlock(Fragment, {
138
163
  key: option.event
139
164
  }, [
140
- option.emojiPicker ? (openBlock(), createBlock(_sfc_main$2, {
165
+ option.emojiPicker ? (openBlock(), createBlock(_sfc_main$3, {
141
166
  key: 0,
142
167
  emojis: __props.reactionEmojis,
143
168
  disabled: option.disabled,
@@ -146,7 +171,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
146
171
  onClose: _cache[5] || (_cache[5] = ($event) => isPickerOpen.value = false)
147
172
  }, {
148
173
  trigger: withCtx(({ isOpen }) => [
149
- createVNode(_sfc_main$3, {
174
+ createVNode(_sfc_main$4, {
150
175
  icon: option.icon,
151
176
  color: option.color || "secondary",
152
177
  disabled: option.disabled,
@@ -157,7 +182,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
157
182
  }, null, 8, ["icon", "color", "disabled", "title", "aria-label", "aria-expanded"])
158
183
  ]),
159
184
  _: 2
160
- }, 1032, ["emojis", "disabled"])) : (openBlock(), createBlock(_sfc_main$3, {
185
+ }, 1032, ["emojis", "disabled"])) : (openBlock(), createBlock(_sfc_main$4, {
161
186
  key: 1,
162
187
  icon: option.icon,
163
188
  color: option.color || "secondary",
@@ -168,7 +193,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
168
193
  }, null, 8, ["icon", "color", "disabled", "title", "aria-label", "onClick"]))
169
194
  ], 64);
170
195
  }), 128)),
171
- hasAdditionalOptions.value ? (openBlock(), createBlock(_sfc_main$4, {
196
+ hasAdditionalOptions.value ? (openBlock(), createBlock(_sfc_main$5, {
172
197
  key: 0,
173
198
  options: dropdownOptions.value,
174
199
  placement: __props.align === "end" ? "bottom-end" : "bottom-start",
@@ -180,8 +205,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
180
205
  onVisibleChange: _cache[6] || (_cache[6] = ($event) => isMenuOpen.value = $event)
181
206
  }, {
182
207
  "dropdown-item": withCtx(({ item }) => [
183
- createElementVNode("div", _hoisted_7, [
184
- item.icon ? (openBlock(), createBlock(_sfc_main$5, {
208
+ createElementVNode("div", _hoisted_6, [
209
+ item.icon ? (openBlock(), createBlock(_sfc_main$6, {
185
210
  key: 0,
186
211
  icon: item.icon,
187
212
  class: normalizeClass(item.iconClass)
@@ -189,11 +214,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
189
214
  createElementVNode("span", {
190
215
  class: normalizeClass([item.labelClass, "vc-message__menu-label"])
191
216
  }, toDisplayString(item.label), 3),
192
- getShortcut(item.value) ? (openBlock(), createElementBlock("span", _hoisted_8, toDisplayString(getShortcut(item.value)), 1)) : createCommentVNode("", true)
217
+ getShortcut(item.value) ? (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString(getShortcut(item.value)), 1)) : createCommentVNode("", true)
193
218
  ])
194
219
  ]),
195
220
  default: withCtx(() => [
196
- createVNode(_sfc_main$3, {
221
+ createVNode(_sfc_main$4, {
197
222
  icon: unref(Ellipsis),
198
223
  title: moreOptionsLabel.value,
199
224
  "aria-label": moreOptionsLabel.value,
@@ -0,0 +1,49 @@
1
+ import '../../assets/components/VcMessage/VcMessageMeta.css';
2
+ import { defineComponent, computed, openBlock, createElementBlock, toDisplayString, createCommentVNode, normalizeClass, createVNode } from "vue";
3
+ import { CircleAlert, CheckCheck, Check, Clock } from "@lucide/vue";
4
+ import _sfc_main$1 from "../VcIcon/VcIcon.vue.mjs";
5
+ import '../../assets/components/VcIcon/VcIcon.css';/* empty css */
6
+ import { tVU } from "../../localization/index.mjs";
7
+ const _hoisted_1 = { class: "vc-message-meta" };
8
+ const _hoisted_2 = {
9
+ key: 0,
10
+ class: "vc-message-meta__edited"
11
+ };
12
+ const _hoisted_3 = ["title", "aria-label"];
13
+ const _sfc_main = /* @__PURE__ */ defineComponent({
14
+ __name: "VcMessageMeta",
15
+ props: {
16
+ editedText: {},
17
+ status: {}
18
+ },
19
+ setup(__props) {
20
+ const STATUS_ICONS = {
21
+ pending: Clock,
22
+ sent: Check,
23
+ delivered: CheckCheck,
24
+ read: CheckCheck,
25
+ failed: CircleAlert
26
+ };
27
+ const props = __props;
28
+ const statusText = computed(() => props.status ? tVU.t(`voicenterUi.message.status.${props.status}`) : "");
29
+ return (_ctx, _cache) => {
30
+ return openBlock(), createElementBlock("div", _hoisted_1, [
31
+ __props.editedText ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(__props.editedText), 1)) : createCommentVNode("", true),
32
+ __props.status ? (openBlock(), createElementBlock("span", {
33
+ key: 1,
34
+ class: normalizeClass([`is--${__props.status}`, "vc-message-meta__status"]),
35
+ title: statusText.value,
36
+ "aria-label": statusText.value,
37
+ role: "img"
38
+ }, [
39
+ createVNode(_sfc_main$1, {
40
+ icon: STATUS_ICONS[__props.status]
41
+ }, null, 8, ["icon"])
42
+ ], 10, _hoisted_3)) : createCommentVNode("", true)
43
+ ]);
44
+ };
45
+ }
46
+ });
47
+ export {
48
+ _sfc_main as default
49
+ };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from "./VcMessageMeta.vue.mjs";
2
+ import '../../assets/components/VcMessage/VcMessageMeta.css';/* empty css */
3
+ export {
4
+ _sfc_main as default
5
+ };
@@ -6,6 +6,7 @@ import '../../../assets/components/VcSoundplayer/VcSoundPlayer.css';import '../.
6
6
  import _sfc_main$2 from "../../VcSoundplayer/VcSoundPlayer.vue.mjs";
7
7
  /* empty css */
8
8
  import { tVU } from "../../../localization/index.mjs";
9
+ import { formatDuration } from "./formatDuration.mjs";
9
10
  const _hoisted_1 = {
10
11
  key: 0,
11
12
  class: "vc-message-audio-block is--preview"
@@ -22,15 +23,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
22
23
  },
23
24
  setup(__props) {
24
25
  const props = __props;
25
- const label = computed(() => tVU.t("voicenterUi.message.audio"));
26
- const duration = computed(() => {
27
- const seconds = props.content.duration;
28
- if (!seconds) {
29
- return "";
30
- }
31
- const rounded = Math.round(seconds);
32
- return `${Math.floor(rounded / 60)}:${String(rounded % 60).padStart(2, "0")}`;
33
- });
26
+ const label = computed(() => props.content.caption || tVU.t("voicenterUi.message.audio"));
27
+ const duration = computed(() => formatDuration(props.content.duration));
34
28
  return (_ctx, _cache) => {
35
29
  return __props.preview ? (openBlock(), createElementBlock("div", _hoisted_1, [
36
30
  createVNode(_sfc_main$1, {
@@ -18,7 +18,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
18
18
  setup(__props, { emit: __emit }) {
19
19
  const props = __props;
20
20
  const emit = __emit;
21
- const label = computed(() => props.content.alt || tVU.t("voicenterUi.message.image"));
21
+ const label = computed(() => props.content.caption || props.content.alt || tVU.t("voicenterUi.message.image"));
22
22
  const sizeStyle = computed(() => {
23
23
  const { width, height } = props.content;
24
24
  return {
@@ -0,0 +1,60 @@
1
+ import '../../../assets/components/VcMessage/content/VcMessageVideoBlock.css';
2
+ import { defineComponent, computed, openBlock, createElementBlock, createVNode, unref, createElementVNode, toDisplayString, createCommentVNode, normalizeStyle } from "vue";
3
+ import { Video } from "@lucide/vue";
4
+ import _sfc_main$1 from "../../VcIcon/VcIcon.vue.mjs";
5
+ import '../../../assets/components/VcIcon/VcIcon.css';/* empty css */
6
+ import { tVU } from "../../../localization/index.mjs";
7
+ import { formatDuration } from "./formatDuration.mjs";
8
+ const _hoisted_1 = {
9
+ key: 0,
10
+ class: "vc-message-video-block is--preview"
11
+ };
12
+ const _hoisted_2 = {
13
+ key: 0,
14
+ class: "vc-message-video-block__duration"
15
+ };
16
+ const _hoisted_3 = ["src", "poster", "width", "height"];
17
+ const MAX_WIDTH = "20rem";
18
+ const _sfc_main = /* @__PURE__ */ defineComponent({
19
+ __name: "VcMessageVideoBlock",
20
+ props: {
21
+ content: {},
22
+ preview: { type: Boolean }
23
+ },
24
+ setup(__props) {
25
+ const props = __props;
26
+ const label = computed(() => props.content.caption || tVU.t("voicenterUi.message.video"));
27
+ const duration = computed(() => formatDuration(props.content.duration));
28
+ const sizeStyle = computed(() => {
29
+ const { width, height } = props.content;
30
+ return {
31
+ width: width ? `min(${width}px, ${MAX_WIDTH})` : MAX_WIDTH,
32
+ aspectRatio: width && height ? `${width} / ${height}` : void 0
33
+ };
34
+ });
35
+ return (_ctx, _cache) => {
36
+ return __props.preview ? (openBlock(), createElementBlock("div", _hoisted_1, [
37
+ createVNode(_sfc_main$1, {
38
+ icon: unref(Video),
39
+ class: "vc-message-video-block__icon"
40
+ }, null, 8, ["icon"]),
41
+ createElementVNode("span", null, toDisplayString(label.value), 1),
42
+ duration.value ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(duration.value), 1)) : createCommentVNode("", true)
43
+ ])) : (openBlock(), createElementBlock("video", {
44
+ key: 1,
45
+ src: __props.content.url,
46
+ poster: __props.content.poster,
47
+ width: __props.content.width,
48
+ height: __props.content.height,
49
+ style: normalizeStyle(sizeStyle.value),
50
+ controls: "",
51
+ playsinline: "",
52
+ preload: "metadata",
53
+ class: "vc-message-video-block"
54
+ }, null, 12, _hoisted_3));
55
+ };
56
+ }
57
+ });
58
+ export {
59
+ _sfc_main as default
60
+ };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from "./VcMessageVideoBlock.vue.mjs";
2
+ import '../../../assets/components/VcMessage/content/VcMessageVideoBlock.css';/* empty css */
3
+ export {
4
+ _sfc_main as default
5
+ };
@@ -0,0 +1,10 @@
1
+ function formatDuration(seconds) {
2
+ if (!seconds) {
3
+ return "";
4
+ }
5
+ const rounded = Math.round(seconds);
6
+ return `${Math.floor(rounded / 60)}:${String(rounded % 60).padStart(2, "0")}`;
7
+ }
8
+ export {
9
+ formatDuration
10
+ };
@@ -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
  };