@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.
- package/README.md +65 -9
- package/library/assets/assets/sass/main.css +1 -1
- package/library/assets/components/VcChatComposer/VcChatComposer.css +1 -1
- package/library/assets/components/VcMessage/VcMessage.css +1 -1
- package/library/assets/components/VcMessage/VcMessageMeta.css +1 -0
- package/library/assets/components/VcMessage/content/VcMessageVideoBlock.css +1 -0
- package/library/assets/components/VcMessagesWrapper/VcMessagesWrapper.css +1 -1
- package/library/components/VcChatComposer/VcChatComposer.vue.mjs +38 -27
- package/library/components/VcChatComposer/richText.mjs +8 -0
- package/library/components/VcExcelUploader/VcExcelFileUploader.vue.mjs +1 -0
- package/library/components/VcExcelUploader/VcFileImportResultBindData.vue.mjs +1 -1
- package/library/components/VcMessage/VcMessage.vue.mjs +65 -40
- package/library/components/VcMessage/VcMessageMeta.vue.mjs +49 -0
- package/library/components/VcMessage/VcMessageMeta.vue3.mjs +5 -0
- package/library/components/VcMessage/content/VcMessageAudioBlock.vue.mjs +3 -9
- package/library/components/VcMessage/content/VcMessageImageBlock.vue.mjs +1 -1
- package/library/components/VcMessage/content/VcMessageVideoBlock.vue.mjs +60 -0
- package/library/components/VcMessage/content/VcMessageVideoBlock.vue3.mjs +5 -0
- package/library/components/VcMessage/content/formatDuration.mjs +10 -0
- package/library/components/VcMessage/content/messageContentComponents.mjs +8 -5
- package/library/components/VcMessagesWrapper/VcMessagesWrapper.vue.mjs +167 -63
- package/library/components/VcMessagesWrapper/VcMessagesWrapperRow.vue.mjs +83 -0
- package/library/components/VcMessagesWrapper/VcMessagesWrapperRow.vue2.mjs +4 -0
- package/library/localization/locales/en.json.mjs +8 -1
- package/library/style.css +8 -4
- package/library/style.css.br +0 -0
- package/library/style.css.gz +0 -0
- package/library/types/components/VcChatComposer/VcChatComposer.vue.d.ts +29 -2
- package/library/types/components/VcExcelUploader/VcExcelFileUploader.vue.d.ts +1 -2
- package/library/types/components/VcMessage/VcMessage.vue.d.ts +20 -2
- package/library/types/components/VcMessage/VcMessageMeta.vue.d.ts +24 -0
- package/library/types/components/VcMessage/content/VcMessageVideoBlock.vue.d.ts +24 -0
- package/library/types/components/VcMessage/content/formatDuration.d.ts +4 -0
- package/library/types/components/VcMessagesWrapper/VcMessagesWrapper.vue.d.ts +20 -2
- package/library/types/components/VcMessagesWrapper/VcMessagesWrapperRow.vue.d.ts +49 -0
- package/library/types/components/VcModal/VcConfirmModal.vue.d.ts +1 -1
- package/library/types/localization/locales/en.json.d.ts +8 -1
- package/library/types/types/VcChatComposer.types.d.ts +3 -2
- package/library/types/types/VcMessage.types.d.ts +48 -3
- package/library/types/types/VcMessagesWrapper.types.d.ts +30 -1
- 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-
|
|
43
|
+
class: "vc-chat-composer__header"
|
|
44
44
|
};
|
|
45
45
|
const _hoisted_5 = {
|
|
46
46
|
key: 2,
|
|
47
|
-
class: "vc-chat-
|
|
47
|
+
class: "vc-chat-composer__attachments"
|
|
48
48
|
};
|
|
49
|
-
const _hoisted_6 = {
|
|
50
|
-
const _hoisted_7 = {
|
|
49
|
+
const _hoisted_6 = {
|
|
51
50
|
key: 3,
|
|
52
|
-
class: "vc-chat-
|
|
51
|
+
class: "vc-chat-composer__recording"
|
|
53
52
|
};
|
|
54
|
-
const
|
|
55
|
-
const
|
|
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
|
-
|
|
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
|
-
|
|
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",
|
|
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",
|
|
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",
|
|
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",
|
|
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,
|
|
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",
|
|
497
|
-
createElementVNode("div",
|
|
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,
|
|
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",
|
|
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",
|
|
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,
|
|
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$
|
|
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
|
+
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$
|
|
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$
|
|
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$
|
|
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-
|
|
21
|
+
class: "vc-message__header"
|
|
20
22
|
};
|
|
21
|
-
const _hoisted_2 = {
|
|
22
|
-
|
|
23
|
-
|
|
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:
|
|
28
|
-
class: "vc-
|
|
29
|
+
key: 4,
|
|
30
|
+
class: "vc-message__caption"
|
|
29
31
|
};
|
|
30
32
|
const _hoisted_5 = {
|
|
31
|
-
key:
|
|
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
|
|
39
|
-
const
|
|
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
|
-
|
|
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
|
-
|
|
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:
|
|
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",
|
|
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",
|
|
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
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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",
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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",
|
|
184
|
-
item.icon ? (openBlock(), createBlock(_sfc_main$
|
|
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",
|
|
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$
|
|
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
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import _sfc_main$
|
|
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$
|
|
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$
|
|
11
|
-
image: _sfc_main$
|
|
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
|
};
|