@voicenter-team/voicenter-ui-plus 3.4.4 → 3.4.6

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 (151) hide show
  1. package/README.md +502 -502
  2. package/library/assets/assets/sass/main.css +1 -1
  3. package/library/assets/components/VcAvatar/VcAvatar.css +1 -0
  4. package/library/assets/components/VcBadgeTag/VcBadgeTag.css +1 -0
  5. package/library/assets/components/VcChatComposer/VcChatComposer.css +1 -0
  6. package/library/assets/components/VcEmojiPicker/VcEmojiPicker.css +1 -0
  7. package/library/assets/components/VcFileUploader/VcFileItem.css +1 -0
  8. package/library/assets/components/VcFileUploader/VcFileUploaderArea.css +1 -1
  9. package/library/assets/components/VcFileUploader/VcFileUploaderSimple.css +1 -1
  10. package/library/assets/components/VcJsonSchema/Components/JsonSchemaEditor.css +1 -1
  11. package/library/assets/components/VcLoading/Loaders/Circles.css +1 -1
  12. package/library/assets/components/VcLoading/Loaders/DotSpinner.css +1 -1
  13. package/library/assets/components/VcLoading/Loaders/LdsSpinner.css +1 -1
  14. package/library/assets/components/VcLoading/Loaders/LoadIcon.css +1 -1
  15. package/library/assets/components/VcLoading/Loaders/Stretch.css +1 -1
  16. package/library/assets/components/VcLoading/VcLoading.css +1 -1
  17. package/library/assets/components/VcMdEditor/ParameterNode.css +1 -1
  18. package/library/assets/components/VcMessage/VcMessage.css +1 -0
  19. package/library/assets/components/VcMessage/content/VcMessageAudioBlock.css +1 -0
  20. package/library/assets/components/VcMessage/content/VcMessageFileBlock.css +1 -0
  21. package/library/assets/components/VcMessage/content/VcMessageImageBlock.css +1 -0
  22. package/library/assets/components/VcMessage/content/VcMessageTextBlock.css +1 -0
  23. package/library/assets/components/VcMessage/reactions/VcMessageEmojiPicker.css +1 -0
  24. package/library/assets/components/VcMessage/reactions/VcMessageReactionBar.css +1 -0
  25. package/library/assets/components/VcMessagesWrapper/VcMessagesWrapper.css +1 -0
  26. package/library/assets/components/VcSkeletonLoader/Loaders/Card.css +1 -1
  27. package/library/assets/components/VcSkeletonLoader/Loaders/Circle.css +1 -1
  28. package/library/assets/components/VcSkeletonLoader/Loaders/Row.css +1 -1
  29. package/library/assets/components/VcSkeletonLoader/Loaders/Square.css +1 -1
  30. package/library/assets/components/VcSkeletonLoader/Loaders/Text.css +1 -1
  31. package/library/components/VcAvatar/VcAvatar.vue.mjs +62 -0
  32. package/library/components/VcAvatar/VcAvatar.vue3.mjs +5 -0
  33. package/library/components/VcBadgeTag/VcBadgeTag.vue.mjs +31 -0
  34. package/library/components/VcBadgeTag/VcBadgeTag.vue3.mjs +5 -0
  35. package/library/components/VcChatComposer/VcChatComposer.vue.mjs +554 -0
  36. package/library/components/VcChatComposer/VcChatComposer.vue3.mjs +5 -0
  37. package/library/components/VcChatComposer/richText.mjs +320 -0
  38. package/library/components/VcEmojiPicker/VcEmojiPicker.vue.mjs +387 -0
  39. package/library/components/VcEmojiPicker/VcEmojiPicker.vue3.mjs +5 -0
  40. package/library/components/VcEmojiPicker/emojiData.mjs +26 -0
  41. package/library/components/VcFileUploader/VcFileItem.vue.mjs +146 -0
  42. package/library/components/VcFileUploader/VcFileItem.vue3.mjs +5 -0
  43. package/library/components/VcFileUploader/VcFileUploaderArea.vue.mjs +24 -147
  44. package/library/components/VcFileUploader/VcFileUploaderSimple.vue.mjs +1 -1
  45. package/library/components/VcJsonSchema/Components/JsonSchemaEditor.vue.mjs +1 -1
  46. package/library/components/VcLoading/Loaders/Circles.vue.mjs +1 -1
  47. package/library/components/VcLoading/Loaders/DotSpinner.vue.mjs +1 -1
  48. package/library/components/VcLoading/Loaders/DotSpinner.vue2.mjs +2 -2
  49. package/library/components/VcLoading/Loaders/LdsSpinner.vue.mjs +1 -1
  50. package/library/components/VcLoading/Loaders/LoadIcon.vue.mjs +1 -1
  51. package/library/components/VcLoading/Loaders/Stretch.vue.mjs +1 -1
  52. package/library/components/VcLoading/Loaders/Stretch.vue2.mjs +1 -1
  53. package/library/components/VcLoading/VcLoading.vue.mjs +1 -1
  54. package/library/components/VcMdEditor/ParameterNode.vue.mjs +1 -1
  55. package/library/components/VcMessage/VcMessage.vue.mjs +212 -0
  56. package/library/components/VcMessage/VcMessage.vue3.mjs +5 -0
  57. package/library/components/VcMessage/content/VcMessageAudioBlock.vue.mjs +53 -0
  58. package/library/components/VcMessage/content/VcMessageAudioBlock.vue3.mjs +5 -0
  59. package/library/components/VcMessage/content/VcMessageFileBlock.vue.mjs +80 -0
  60. package/library/components/VcMessage/content/VcMessageFileBlock.vue3.mjs +5 -0
  61. package/library/components/VcMessage/content/VcMessageImageBlock.vue.mjs +57 -0
  62. package/library/components/VcMessage/content/VcMessageImageBlock.vue3.mjs +5 -0
  63. package/library/components/VcMessage/content/VcMessageTextBlock.vue.mjs +19 -0
  64. package/library/components/VcMessage/content/VcMessageTextBlock.vue3.mjs +5 -0
  65. package/library/components/VcMessage/content/messageContentComponents.mjs +17 -0
  66. package/library/components/VcMessage/reactions/VcMessageEmojiPicker.vue.mjs +167 -0
  67. package/library/components/VcMessage/reactions/VcMessageEmojiPicker.vue3.mjs +5 -0
  68. package/library/components/VcMessage/reactions/VcMessageReactionBar.vue.mjs +82 -0
  69. package/library/components/VcMessage/reactions/VcMessageReactionBar.vue3.mjs +5 -0
  70. package/library/components/VcMessage/reactions/emojis.mjs +4 -0
  71. package/library/components/VcMessagesWrapper/VcMessagesWrapper.vue.mjs +243 -0
  72. package/library/components/VcMessagesWrapper/VcMessagesWrapper.vue3.mjs +5 -0
  73. package/library/components/VcSkeletonLoader/Loaders/Card.vue.mjs +1 -1
  74. package/library/components/VcSkeletonLoader/Loaders/Circle.vue.mjs +1 -1
  75. package/library/components/VcSkeletonLoader/Loaders/Row.vue.mjs +1 -1
  76. package/library/components/VcSkeletonLoader/Loaders/Square.vue.mjs +1 -1
  77. package/library/components/VcSkeletonLoader/Loaders/Text.vue.mjs +1 -1
  78. package/library/components/VcSoundplayer/useSoundPlayerProvideInject.mjs +1 -1
  79. package/library/composables/useAudioRecorder.mjs +120 -0
  80. package/library/enum/fileTypes.mjs +51 -0
  81. package/library/index.mjs +237 -216
  82. package/library/index.mjs.br +0 -0
  83. package/library/index.mjs.gz +0 -0
  84. package/library/localization/index.mjs.gz +0 -0
  85. package/library/localization/locales/en.json.mjs +24 -1
  86. package/library/plugin-components.gen.mjs +171 -150
  87. package/library/plugin.mjs +235 -214
  88. package/library/plugin.mjs.br +0 -0
  89. package/library/plugin.mjs.gz +0 -0
  90. package/library/style.css +42 -16
  91. package/library/style.css.br +0 -0
  92. package/library/style.css.gz +0 -0
  93. package/library/theme/index.mjs.gz +0 -0
  94. package/library/types/components/VcAvatar/VcAvatar.vue.d.ts +47 -0
  95. package/library/types/components/VcBadgeTag/VcBadgeTag.vue.d.ts +42 -0
  96. package/library/types/components/VcChatComposer/VcChatComposer.vue.d.ts +81 -0
  97. package/library/types/components/VcChatComposer/richText.d.ts +12 -0
  98. package/library/types/components/VcCollapse/VcCollapseItem.vue.d.ts +1 -1
  99. package/library/types/components/VcEmojiPicker/VcEmojiPicker.vue.d.ts +63 -0
  100. package/library/types/components/VcEmojiPicker/emojiData.d.ts +16 -0
  101. package/library/types/components/VcExcelUploader/VcExcelFileUploadBlock.vue.d.ts +1 -1
  102. package/library/types/components/VcExtendedDatetimeRangePicker/VcExtendedDatetimeRangePicker.vue.d.ts +2 -2
  103. package/library/types/components/VcFileUploader/VcFileItem.vue.d.ts +85 -0
  104. package/library/types/components/VcFileUploader/VcFileUploader.vue.d.ts +3 -3
  105. package/library/types/components/VcFileUploader/VcFileUploaderArea.vue.d.ts +17 -18
  106. package/library/types/components/VcFileUploader/VcFileUploaderSimple.vue.d.ts +3 -3
  107. package/library/types/components/VcForm/VcForm.vue.d.ts +1 -1
  108. package/library/types/components/VcMessage/VcMessage.vue.d.ts +66 -0
  109. package/library/types/components/VcMessage/content/VcMessageAudioBlock.vue.d.ts +24 -0
  110. package/library/types/components/VcMessage/content/VcMessageFileBlock.vue.d.ts +24 -0
  111. package/library/types/components/VcMessage/content/VcMessageImageBlock.vue.d.ts +28 -0
  112. package/library/types/components/VcMessage/content/VcMessageTextBlock.vue.d.ts +24 -0
  113. package/library/types/components/VcMessage/content/messageContentComponents.d.ts +3 -0
  114. package/library/types/components/VcMessage/reactions/VcMessageEmojiPicker.vue.d.ts +68 -0
  115. package/library/types/components/VcMessage/reactions/VcMessageReactionBar.vue.d.ts +28 -0
  116. package/library/types/components/VcMessage/reactions/emojis.d.ts +1 -0
  117. package/library/types/components/VcMessagesWrapper/VcMessagesWrapper.vue.d.ts +71 -0
  118. package/library/types/components/VcProgress/VcProgress.vue.d.ts +1 -1
  119. package/library/types/components/VcRadioGroup/VcRadioGroup.vue.d.ts +3 -3
  120. package/library/types/components/VcSelect/VcInfiniteScrollSelect.vue.d.ts +6 -6
  121. package/library/types/components/VcSelect/VcSelect.vue.d.ts +6 -6
  122. package/library/types/components/VcSelect/VcSelectGrouped.vue.d.ts +6 -6
  123. package/library/types/components/VcSelect/VcSelectOption.vue.d.ts +3 -3
  124. package/library/types/components/VcTree/VcTree.vue.d.ts +6 -6
  125. package/library/types/components/VcTree/VcTreeSelect.vue.d.ts +3 -3
  126. package/library/types/components/VcWizard/VcSummaryStep.vue.d.ts +1 -1
  127. package/library/types/components/VcWizard/VcWizardSummary.vue.d.ts +1 -1
  128. package/library/types/components/exports.d.ts +15 -1
  129. package/library/types/components.gen.d.ts +7 -0
  130. package/library/types/composables/useAudioRecorder.d.ts +18 -0
  131. package/library/types/entity/components/Button/VcEntityDeleteIconButton.vue.d.ts +3 -3
  132. package/library/types/enum/fileTypes.d.ts +3 -0
  133. package/library/types/localization/locales/en.json.d.ts +187 -164
  134. package/library/types/theme/themes.json.d.ts +227 -227
  135. package/library/types/types/VcAvatar.types.d.ts +35 -0
  136. package/library/types/types/VcBadgeTag.types.d.ts +19 -0
  137. package/library/types/types/VcChatComposer.types.d.ts +112 -0
  138. package/library/types/types/VcEmojiPicker.types.d.ts +20 -0
  139. package/library/types/types/VcFileUploader.types.d.ts +4 -0
  140. package/library/types/types/VcMessage.types.d.ts +131 -0
  141. package/library/types/types/VcMessagesWrapper.types.d.ts +61 -0
  142. package/library/types/types/index.d.ts +6 -0
  143. package/library/utils/jsonSchema/index.mjs.gz +0 -0
  144. package/package.json +215 -185
  145. package/src/theme/index.ts +101 -101
  146. package/src/theme/tailwindScheme.js +37 -37
  147. package/src/theme/theme.types.ts +31 -31
  148. package/src/theme/themeMerge.ts +40 -40
  149. package/src/theme/themes.json +227 -227
  150. package/tailwind.config.d.ts +5 -5
  151. package/tailwind.config.js +192 -192
@@ -0,0 +1,212 @@
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";
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";
7
+ /* empty css */
8
+ import _sfc_main$5 from "../VcIcon/VcIcon.vue.mjs";
9
+ /* empty css */
10
+ import { messageContentComponents } from "./content/messageContentComponents.mjs";
11
+ import _sfc_main$2 from "./reactions/VcMessageEmojiPicker.vue.mjs";
12
+ /* empty css */
13
+ import _sfc_main$1 from "./reactions/VcMessageReactionBar.vue.mjs";
14
+ /* empty css */
15
+ import { DEFAULT_REACTION_EMOJIS } from "./reactions/emojis.mjs";
16
+ import { tVU } from "../../localization/index.mjs";
17
+ const _hoisted_1 = {
18
+ key: 0,
19
+ class: "vc-message__deleted"
20
+ };
21
+ const _hoisted_2 = { class: "vc-message__reply-author" };
22
+ const _hoisted_3 = {
23
+ key: 2,
24
+ class: "vc-message__content"
25
+ };
26
+ const _hoisted_4 = {
27
+ key: 0,
28
+ class: "vc-message__edited"
29
+ };
30
+ const _hoisted_5 = {
31
+ key: 3,
32
+ class: "vc-message__edited"
33
+ };
34
+ const _hoisted_6 = {
35
+ key: 5,
36
+ class: "vc-message__toolbar"
37
+ };
38
+ const _hoisted_7 = { class: "vc-dropdown-item__content-inner vc-message__menu-item" };
39
+ const _hoisted_8 = {
40
+ key: 1,
41
+ class: "vc-message__menu-shortcut"
42
+ };
43
+ const _sfc_main = /* @__PURE__ */ defineComponent({
44
+ __name: "VcMessage",
45
+ props: {
46
+ content: { default: void 0 },
47
+ align: { default: "start" },
48
+ reply: { default: void 0 },
49
+ options: { default: () => [] },
50
+ additionalOptions: { default: () => [] },
51
+ reactions: { default: () => [] },
52
+ reactionEmojis: { default: () => DEFAULT_REACTION_EMOJIS },
53
+ edited: { type: Boolean, default: false },
54
+ deleted: { type: Boolean, default: false },
55
+ editedLabel: { default: void 0 },
56
+ deletedLabel: { default: void 0 }
57
+ },
58
+ emits: ["option-click", "reply-click", "content-click", "reaction-toggle"],
59
+ setup(__props, { emit: __emit }) {
60
+ const props = __props;
61
+ const emit = __emit;
62
+ const isMenuOpen = ref(false);
63
+ const isPickerOpen = ref(false);
64
+ const isMedia = computed(() => {
65
+ var _a;
66
+ return !props.deleted && ((_a = props.content) == null ? void 0 : _a.type) === "image";
67
+ });
68
+ const moreOptionsLabel = computed(() => tVU.t("voicenterUi.message.moreOptions"));
69
+ const editedText = computed(() => props.editedLabel || tVU.t("voicenterUi.message.edited"));
70
+ const deletedText = computed(() => props.deletedLabel || tVU.t("voicenterUi.message.deleted"));
71
+ const additionalOptionsFlat = computed(() => props.additionalOptions.flat());
72
+ const hasAdditionalOptions = computed(() => additionalOptionsFlat.value.length > 0);
73
+ const hasToolbar = computed(() => props.options.length > 0 || hasAdditionalOptions.value);
74
+ const dropdownOptions = computed(() => {
75
+ return props.additionalOptions.filter((group) => group.length > 0).flatMap((group, groupIndex) => group.map((option, index) => ({
76
+ value: option.event,
77
+ label: option.label,
78
+ icon: option.icon,
79
+ color: option.color,
80
+ disabled: option.disabled,
81
+ divided: groupIndex > 0 && index === 0,
82
+ iconClass: option.color ? `text-${option.color}-actions` : void 0,
83
+ labelClass: option.color ? `text-${option.color}-actions` : void 0
84
+ })));
85
+ });
86
+ function findAdditionalOption(event) {
87
+ return additionalOptionsFlat.value.find((option) => option.event === event);
88
+ }
89
+ function getShortcut(event) {
90
+ var _a;
91
+ return (_a = findAdditionalOption(event)) == null ? void 0 : _a.shortcut;
92
+ }
93
+ function onOptionClick(option) {
94
+ emit("option-click", option.event, option);
95
+ }
96
+ function onCommand(event) {
97
+ const option = findAdditionalOption(event);
98
+ if (option) {
99
+ onOptionClick(option);
100
+ }
101
+ }
102
+ return (_ctx, _cache) => {
103
+ return openBlock(), createElementBlock("div", {
104
+ 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
+ }, [
106
+ __props.deleted ? (openBlock(), createElementBlock("div", _hoisted_1, toDisplayString(deletedText.value), 1)) : createCommentVNode("", true),
107
+ __props.reply && !__props.deleted ? (openBlock(), createElementBlock("button", {
108
+ key: 1,
109
+ type: "button",
110
+ class: "vc-message__reply",
111
+ onClick: _cache[0] || (_cache[0] = ($event) => emit("reply-click"))
112
+ }, [
113
+ createElementVNode("span", _hoisted_2, toDisplayString(__props.reply.author), 1),
114
+ (openBlock(), createBlock(resolveDynamicComponent(unref(messageContentComponents)[__props.reply.content.type]), {
115
+ content: __props.reply.content,
116
+ preview: "",
117
+ class: "vc-message__reply-content"
118
+ }, null, 8, ["content"]))
119
+ ])) : createCommentVNode("", true),
120
+ __props.content && !__props.deleted ? (openBlock(), createElementBlock("div", _hoisted_3, [
121
+ (openBlock(), createBlock(resolveDynamicComponent(unref(messageContentComponents)[__props.content.type]), {
122
+ content: __props.content,
123
+ onContentClick: _cache[1] || (_cache[1] = ($event) => emit("content-click", __props.content))
124
+ }, 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,
130
+ reactions: __props.reactions,
131
+ emojis: __props.reactionEmojis,
132
+ class: "vc-message__reactions",
133
+ onToggle: _cache[2] || (_cache[2] = ($event) => emit("reaction-toggle", $event))
134
+ }, null, 8, ["reactions", "emojis"])) : createCommentVNode("", true),
135
+ hasToolbar.value && !__props.deleted ? (openBlock(), createElementBlock("div", _hoisted_6, [
136
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.options, (option) => {
137
+ return openBlock(), createElementBlock(Fragment, {
138
+ key: option.event
139
+ }, [
140
+ option.emojiPicker ? (openBlock(), createBlock(_sfc_main$2, {
141
+ key: 0,
142
+ emojis: __props.reactionEmojis,
143
+ disabled: option.disabled,
144
+ onSelect: _cache[3] || (_cache[3] = ($event) => emit("reaction-toggle", $event)),
145
+ onOpen: _cache[4] || (_cache[4] = ($event) => isPickerOpen.value = true),
146
+ onClose: _cache[5] || (_cache[5] = ($event) => isPickerOpen.value = false)
147
+ }, {
148
+ trigger: withCtx(({ isOpen }) => [
149
+ createVNode(_sfc_main$3, {
150
+ icon: option.icon,
151
+ color: option.color || "secondary",
152
+ disabled: option.disabled,
153
+ title: option.label,
154
+ "aria-label": option.label,
155
+ "aria-expanded": isOpen,
156
+ "aria-haspopup": "true"
157
+ }, null, 8, ["icon", "color", "disabled", "title", "aria-label", "aria-expanded"])
158
+ ]),
159
+ _: 2
160
+ }, 1032, ["emojis", "disabled"])) : (openBlock(), createBlock(_sfc_main$3, {
161
+ key: 1,
162
+ icon: option.icon,
163
+ color: option.color || "secondary",
164
+ disabled: option.disabled,
165
+ title: option.label,
166
+ "aria-label": option.label,
167
+ onClick: ($event) => onOptionClick(option)
168
+ }, null, 8, ["icon", "color", "disabled", "title", "aria-label", "onClick"]))
169
+ ], 64);
170
+ }), 128)),
171
+ hasAdditionalOptions.value ? (openBlock(), createBlock(_sfc_main$4, {
172
+ key: 0,
173
+ options: dropdownOptions.value,
174
+ placement: __props.align === "end" ? "bottom-end" : "bottom-start",
175
+ "show-arrow": false,
176
+ persistent: false,
177
+ trigger: "click",
178
+ "popper-class": "vc-message__menu",
179
+ onCommand,
180
+ onVisibleChange: _cache[6] || (_cache[6] = ($event) => isMenuOpen.value = $event)
181
+ }, {
182
+ "dropdown-item": withCtx(({ item }) => [
183
+ createElementVNode("div", _hoisted_7, [
184
+ item.icon ? (openBlock(), createBlock(_sfc_main$5, {
185
+ key: 0,
186
+ icon: item.icon,
187
+ class: normalizeClass(item.iconClass)
188
+ }, null, 8, ["icon", "class"])) : createCommentVNode("", true),
189
+ createElementVNode("span", {
190
+ class: normalizeClass([item.labelClass, "vc-message__menu-label"])
191
+ }, toDisplayString(item.label), 3),
192
+ getShortcut(item.value) ? (openBlock(), createElementBlock("span", _hoisted_8, toDisplayString(getShortcut(item.value)), 1)) : createCommentVNode("", true)
193
+ ])
194
+ ]),
195
+ default: withCtx(() => [
196
+ createVNode(_sfc_main$3, {
197
+ icon: unref(Ellipsis),
198
+ title: moreOptionsLabel.value,
199
+ "aria-label": moreOptionsLabel.value,
200
+ color: "secondary"
201
+ }, null, 8, ["icon", "title", "aria-label"])
202
+ ]),
203
+ _: 1
204
+ }, 8, ["options", "placement"])) : createCommentVNode("", true)
205
+ ])) : createCommentVNode("", true)
206
+ ], 2);
207
+ };
208
+ }
209
+ });
210
+ export {
211
+ _sfc_main as default
212
+ };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from "./VcMessage.vue.mjs";
2
+ import '../../assets/components/VcMessage/VcMessage.css';/* empty css */
3
+ export {
4
+ _sfc_main as default
5
+ };
@@ -0,0 +1,53 @@
1
+ import '../../../assets/components/VcMessage/content/VcMessageAudioBlock.css';
2
+ import { defineComponent, computed, openBlock, createElementBlock, createVNode, unref, createElementVNode, toDisplayString, createCommentVNode, createBlock } from "vue";
3
+ import { Mic } from "@lucide/vue";
4
+ import _sfc_main$1 from "../../VcIcon/VcIcon.vue.mjs";
5
+ import '../../../assets/components/VcSoundplayer/VcSoundPlayer.css';import '../../../assets/components/VcIcon/VcIcon.css';/* empty css */
6
+ import _sfc_main$2 from "../../VcSoundplayer/VcSoundPlayer.vue.mjs";
7
+ /* empty css */
8
+ import { tVU } from "../../../localization/index.mjs";
9
+ const _hoisted_1 = {
10
+ key: 0,
11
+ class: "vc-message-audio-block is--preview"
12
+ };
13
+ const _hoisted_2 = {
14
+ key: 0,
15
+ class: "vc-message-audio-block__duration"
16
+ };
17
+ const _sfc_main = /* @__PURE__ */ defineComponent({
18
+ __name: "VcMessageAudioBlock",
19
+ props: {
20
+ content: {},
21
+ preview: { type: Boolean }
22
+ },
23
+ setup(__props) {
24
+ 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
+ });
34
+ return (_ctx, _cache) => {
35
+ return __props.preview ? (openBlock(), createElementBlock("div", _hoisted_1, [
36
+ createVNode(_sfc_main$1, {
37
+ icon: unref(Mic),
38
+ class: "vc-message-audio-block__icon"
39
+ }, null, 8, ["icon"]),
40
+ createElementVNode("span", null, toDisplayString(label.value), 1),
41
+ duration.value ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(duration.value), 1)) : createCommentVNode("", true)
42
+ ])) : (openBlock(), createBlock(_sfc_main$2, {
43
+ key: 1,
44
+ src: __props.content.url,
45
+ size: "sm",
46
+ class: "vc-message-audio-block"
47
+ }, null, 8, ["src"]));
48
+ };
49
+ }
50
+ });
51
+ export {
52
+ _sfc_main as default
53
+ };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from "./VcMessageAudioBlock.vue.mjs";
2
+ import '../../../assets/components/VcMessage/content/VcMessageAudioBlock.css';/* empty css */
3
+ export {
4
+ _sfc_main as default
5
+ };
@@ -0,0 +1,80 @@
1
+ import '../../../assets/components/VcMessage/content/VcMessageFileBlock.css';
2
+ import { defineComponent, computed, openBlock, createElementBlock, createVNode, unref, createElementVNode, toDisplayString, createCommentVNode } from "vue";
3
+ import { FileText, Download } from "@lucide/vue";
4
+ import _sfc_main$1 from "../../VcIcon/VcIcon.vue.mjs";
5
+ import '../../../assets/components/VcIcon/VcIcon.css';/* empty css */
6
+ const _hoisted_1 = {
7
+ key: 0,
8
+ class: "vc-message-file-block is--preview"
9
+ };
10
+ const _hoisted_2 = { class: "vc-message-file-block__name" };
11
+ const _hoisted_3 = ["href", "download"];
12
+ const _hoisted_4 = { class: "vc-message-file-block__icon" };
13
+ const _hoisted_5 = { class: "vc-message-file-block__info" };
14
+ const _hoisted_6 = { class: "vc-message-file-block__name" };
15
+ const _hoisted_7 = {
16
+ key: 0,
17
+ class: "vc-message-file-block__meta"
18
+ };
19
+ const _sfc_main = /* @__PURE__ */ defineComponent({
20
+ __name: "VcMessageFileBlock",
21
+ props: {
22
+ content: {},
23
+ preview: { type: Boolean }
24
+ },
25
+ setup(__props) {
26
+ const props = __props;
27
+ const SIZE_UNITS = ["B", "KB", "MB", "GB"];
28
+ const extension = computed(() => {
29
+ if (props.content.extension) {
30
+ return props.content.extension;
31
+ }
32
+ const dotIndex = props.content.name.lastIndexOf(".");
33
+ return dotIndex > 0 ? props.content.name.slice(dotIndex + 1) : "";
34
+ });
35
+ const size = computed(() => {
36
+ let value = props.content.size;
37
+ if (!value) {
38
+ return "";
39
+ }
40
+ let unitIndex = 0;
41
+ while (value >= 1024 && unitIndex < SIZE_UNITS.length - 1) {
42
+ value /= 1024;
43
+ unitIndex++;
44
+ }
45
+ return `${unitIndex ? value.toFixed(1) : value} ${SIZE_UNITS[unitIndex]}`;
46
+ });
47
+ const meta = computed(() => [extension.value.toUpperCase(), size.value].filter(Boolean).join(" · "));
48
+ return (_ctx, _cache) => {
49
+ return __props.preview ? (openBlock(), createElementBlock("div", _hoisted_1, [
50
+ createVNode(_sfc_main$1, {
51
+ icon: unref(FileText),
52
+ class: "vc-message-file-block__preview-icon"
53
+ }, null, 8, ["icon"]),
54
+ createElementVNode("span", _hoisted_2, toDisplayString(__props.content.name), 1)
55
+ ])) : (openBlock(), createElementBlock("a", {
56
+ key: 1,
57
+ href: __props.content.url,
58
+ download: __props.content.name,
59
+ target: "_blank",
60
+ rel: "noopener noreferrer",
61
+ class: "vc-message-file-block"
62
+ }, [
63
+ createElementVNode("span", _hoisted_4, [
64
+ createVNode(_sfc_main$1, { icon: unref(FileText) }, null, 8, ["icon"])
65
+ ]),
66
+ createElementVNode("span", _hoisted_5, [
67
+ createElementVNode("span", _hoisted_6, toDisplayString(__props.content.name), 1),
68
+ meta.value ? (openBlock(), createElementBlock("span", _hoisted_7, toDisplayString(meta.value), 1)) : createCommentVNode("", true)
69
+ ]),
70
+ createVNode(_sfc_main$1, {
71
+ icon: unref(Download),
72
+ class: "vc-message-file-block__download"
73
+ }, null, 8, ["icon"])
74
+ ], 8, _hoisted_3));
75
+ };
76
+ }
77
+ });
78
+ export {
79
+ _sfc_main as default
80
+ };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from "./VcMessageFileBlock.vue.mjs";
2
+ import '../../../assets/components/VcMessage/content/VcMessageFileBlock.css';/* empty css */
3
+ export {
4
+ _sfc_main as default
5
+ };
@@ -0,0 +1,57 @@
1
+ import '../../../assets/components/VcMessage/content/VcMessageImageBlock.css';
2
+ import { defineComponent, computed, openBlock, createElementBlock, createElementVNode, toDisplayString, normalizeStyle } from "vue";
3
+ import { tVU } from "../../../localization/index.mjs";
4
+ const _hoisted_1 = {
5
+ key: 0,
6
+ class: "vc-message-image-block is--preview"
7
+ };
8
+ const _hoisted_2 = ["src", "alt"];
9
+ const _hoisted_3 = ["src", "alt", "width", "height"];
10
+ const MAX_WIDTH = "20rem";
11
+ const _sfc_main = /* @__PURE__ */ defineComponent({
12
+ __name: "VcMessageImageBlock",
13
+ props: {
14
+ content: {},
15
+ preview: { type: Boolean }
16
+ },
17
+ emits: ["content-click"],
18
+ setup(__props, { emit: __emit }) {
19
+ const props = __props;
20
+ const emit = __emit;
21
+ const label = computed(() => props.content.alt || tVU.t("voicenterUi.message.image"));
22
+ const sizeStyle = computed(() => {
23
+ const { width, height } = props.content;
24
+ return {
25
+ width: width ? `min(${width}px, ${MAX_WIDTH})` : MAX_WIDTH,
26
+ aspectRatio: width && height ? `${width} / ${height}` : void 0
27
+ };
28
+ });
29
+ return (_ctx, _cache) => {
30
+ return __props.preview ? (openBlock(), createElementBlock("div", _hoisted_1, [
31
+ createElementVNode("img", {
32
+ src: __props.content.url,
33
+ alt: __props.content.alt,
34
+ class: "vc-message-image-block__thumbnail"
35
+ }, null, 8, _hoisted_2),
36
+ createElementVNode("span", null, toDisplayString(label.value), 1)
37
+ ])) : (openBlock(), createElementBlock("button", {
38
+ key: 1,
39
+ type: "button",
40
+ class: "vc-message-image-block",
41
+ onClick: _cache[0] || (_cache[0] = ($event) => emit("content-click", __props.content))
42
+ }, [
43
+ createElementVNode("img", {
44
+ src: __props.content.url,
45
+ alt: __props.content.alt,
46
+ width: __props.content.width,
47
+ height: __props.content.height,
48
+ style: normalizeStyle(sizeStyle.value),
49
+ class: "vc-message-image-block__image"
50
+ }, null, 12, _hoisted_3)
51
+ ]));
52
+ };
53
+ }
54
+ });
55
+ export {
56
+ _sfc_main as default
57
+ };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from "./VcMessageImageBlock.vue.mjs";
2
+ import '../../../assets/components/VcMessage/content/VcMessageImageBlock.css';/* empty css */
3
+ export {
4
+ _sfc_main as default
5
+ };
@@ -0,0 +1,19 @@
1
+ import '../../../assets/components/VcMessage/content/VcMessageTextBlock.css';
2
+ import { defineComponent, openBlock, createElementBlock, normalizeClass, toDisplayString } from "vue";
3
+ const _sfc_main = /* @__PURE__ */ defineComponent({
4
+ __name: "VcMessageTextBlock",
5
+ props: {
6
+ content: {},
7
+ preview: { type: Boolean }
8
+ },
9
+ setup(__props) {
10
+ return (_ctx, _cache) => {
11
+ return openBlock(), createElementBlock("div", {
12
+ class: normalizeClass([{ "is--preview": __props.preview }, "vc-message-text-block"])
13
+ }, toDisplayString(__props.content.text), 3);
14
+ };
15
+ }
16
+ });
17
+ export {
18
+ _sfc_main as default
19
+ };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from "./VcMessageTextBlock.vue.mjs";
2
+ import '../../../assets/components/VcMessage/content/VcMessageTextBlock.css';/* empty css */
3
+ export {
4
+ _sfc_main as default
5
+ };
@@ -0,0 +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";
4
+ /* empty css */
5
+ import _sfc_main$1 from "./VcMessageAudioBlock.vue.mjs";
6
+ /* empty css */
7
+ import _sfc_main from "./VcMessageFileBlock.vue.mjs";
8
+ /* empty css */
9
+ const messageContentComponents = {
10
+ text: _sfc_main$3,
11
+ image: _sfc_main$2,
12
+ audio: _sfc_main$1,
13
+ file: _sfc_main
14
+ };
15
+ export {
16
+ messageContentComponents
17
+ };
@@ -0,0 +1,167 @@
1
+ import '../../../assets/components/VcMessage/reactions/VcMessageEmojiPicker.css';
2
+ import { defineComponent, ref, computed, openBlock, createBlock, withCtx, createElementVNode, createElementBlock, Fragment, renderList, toDisplayString, renderSlot, withKeys, createVNode, unref, nextTick } from "vue";
3
+ import { onClickOutside } from "@vueuse/core";
4
+ import { Smile } from "@lucide/vue";
5
+ import _sfc_main$1 from "../../VcPopover/VcPopover.vue.mjs";
6
+ import '../../../assets/components/VcButton/VcButtonIcon.css';import '../../../assets/components/VcPopover/VcPopover.css';/* empty css */
7
+ import _sfc_main$2 from "../../VcButton/VcButtonIcon.vue.mjs";
8
+ /* empty css */
9
+ import { useRTL } from "../../../composables/useRTL.mjs";
10
+ import { tVU } from "../../../localization/index.mjs";
11
+ import { DEFAULT_REACTION_EMOJIS } from "./emojis.mjs";
12
+ const _hoisted_1 = ["tabindex", "onClick", "onFocus"];
13
+ const _sfc_main = /* @__PURE__ */ defineComponent({
14
+ __name: "VcMessageEmojiPicker",
15
+ props: {
16
+ emojis: { default: () => DEFAULT_REACTION_EMOJIS },
17
+ placement: { default: "top" },
18
+ disabled: { type: Boolean, default: false },
19
+ teleported: { type: Boolean, default: true }
20
+ },
21
+ emits: ["select", "open", "close"],
22
+ setup(__props, { expose: __expose, emit: __emit }) {
23
+ const props = __props;
24
+ const emit = __emit;
25
+ const { isRTL } = useRTL();
26
+ const isOpen = ref(false);
27
+ const activeIndex = ref(0);
28
+ const triggerRef = ref();
29
+ const panelRef = ref();
30
+ const itemRefs = [];
31
+ const triggerLabel = computed(() => tVU.t("voicenterUi.message.react"));
32
+ const RTL_PLACEMENTS = {
33
+ "top-start": "top-end",
34
+ "top-end": "top-start",
35
+ "bottom-start": "bottom-end",
36
+ "bottom-end": "bottom-start"
37
+ };
38
+ const resolvedPlacement = computed(() => {
39
+ return isRTL.value ? RTL_PLACEMENTS[props.placement] ?? props.placement : props.placement;
40
+ });
41
+ function setItemRef(element, index) {
42
+ itemRefs[index] = element instanceof HTMLButtonElement ? element : void 0;
43
+ }
44
+ function focusItem(index) {
45
+ var _a;
46
+ (_a = itemRefs[index]) == null ? void 0 : _a.focus();
47
+ }
48
+ function open() {
49
+ if (props.disabled || isOpen.value) {
50
+ return;
51
+ }
52
+ activeIndex.value = 0;
53
+ isOpen.value = true;
54
+ emit("open");
55
+ nextTick(() => focusItem(activeIndex.value));
56
+ }
57
+ function close(returnFocus = false) {
58
+ var _a, _b;
59
+ if (!isOpen.value) {
60
+ return;
61
+ }
62
+ isOpen.value = false;
63
+ emit("close");
64
+ if (returnFocus) {
65
+ (_b = (_a = triggerRef.value) == null ? void 0 : _a.querySelector("button, [tabindex]")) == null ? void 0 : _b.focus();
66
+ }
67
+ }
68
+ function toggle() {
69
+ if (isOpen.value) {
70
+ close();
71
+ } else {
72
+ open();
73
+ }
74
+ }
75
+ function select(emoji) {
76
+ emit("select", emoji);
77
+ close(true);
78
+ }
79
+ function onKeydown(event) {
80
+ const last = props.emojis.length - 1;
81
+ const forward = isRTL.value ? "ArrowLeft" : "ArrowRight";
82
+ const backward = isRTL.value ? "ArrowRight" : "ArrowLeft";
83
+ const nextIndex = {
84
+ [forward]: activeIndex.value >= last ? 0 : activeIndex.value + 1,
85
+ [backward]: activeIndex.value <= 0 ? last : activeIndex.value - 1,
86
+ Home: 0,
87
+ End: last
88
+ };
89
+ if (event.key === "Escape") {
90
+ event.preventDefault();
91
+ close(true);
92
+ } else if (event.key in nextIndex) {
93
+ event.preventDefault();
94
+ activeIndex.value = nextIndex[event.key];
95
+ focusItem(activeIndex.value);
96
+ }
97
+ }
98
+ onClickOutside(panelRef, () => close(), { ignore: [triggerRef] });
99
+ __expose({
100
+ open,
101
+ close
102
+ });
103
+ return (_ctx, _cache) => {
104
+ return openBlock(), createBlock(_sfc_main$1, {
105
+ open: isOpen.value,
106
+ placement: resolvedPlacement.value,
107
+ teleported: __props.teleported,
108
+ disabled: __props.disabled,
109
+ "delay-close": 0,
110
+ offset: 6,
111
+ trigger: "manual",
112
+ "popover-width": "auto",
113
+ "popover-class": "vc-message-emoji-picker__popover"
114
+ }, {
115
+ reference: withCtx(() => [
116
+ createElementVNode("span", {
117
+ ref_key: "triggerRef",
118
+ ref: triggerRef,
119
+ class: "vc-message-emoji-picker__trigger",
120
+ onClick: toggle,
121
+ onKeydown: _cache[0] || (_cache[0] = withKeys(($event) => close(true), ["esc"]))
122
+ }, [
123
+ renderSlot(_ctx.$slots, "trigger", { isOpen: isOpen.value }, () => [
124
+ createVNode(_sfc_main$2, {
125
+ icon: unref(Smile),
126
+ disabled: __props.disabled,
127
+ title: triggerLabel.value,
128
+ "aria-label": triggerLabel.value,
129
+ "aria-expanded": isOpen.value,
130
+ "aria-haspopup": "true",
131
+ color: "secondary"
132
+ }, null, 8, ["icon", "disabled", "title", "aria-label", "aria-expanded"])
133
+ ])
134
+ ], 544)
135
+ ]),
136
+ default: withCtx(() => [
137
+ createElementVNode("div", {
138
+ ref_key: "panelRef",
139
+ ref: panelRef,
140
+ role: "menu",
141
+ class: "vc-message-emoji-picker",
142
+ onKeydown
143
+ }, [
144
+ (openBlock(true), createElementBlock(Fragment, null, renderList(__props.emojis, (emoji, index) => {
145
+ return openBlock(), createElementBlock("button", {
146
+ key: emoji,
147
+ ref_for: true,
148
+ ref: (element) => setItemRef(element, index),
149
+ tabindex: index === activeIndex.value ? 0 : -1,
150
+ type: "button",
151
+ role: "menuitem",
152
+ class: "vc-message-emoji-picker__item",
153
+ onClick: ($event) => select(emoji),
154
+ onFocus: ($event) => activeIndex.value = index
155
+ }, toDisplayString(emoji), 41, _hoisted_1);
156
+ }), 128)),
157
+ renderSlot(_ctx.$slots, "append")
158
+ ], 544)
159
+ ]),
160
+ _: 3
161
+ }, 8, ["open", "placement", "teleported", "disabled"]);
162
+ };
163
+ }
164
+ });
165
+ export {
166
+ _sfc_main as default
167
+ };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from "./VcMessageEmojiPicker.vue.mjs";
2
+ import '../../../assets/components/VcMessage/reactions/VcMessageEmojiPicker.css';/* empty css */
3
+ export {
4
+ _sfc_main as default
5
+ };