@uzum-tech/ui 1.11.2 → 1.12.0

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 (279) hide show
  1. package/dist/index.js +10829 -6652
  2. package/dist/index.prod.js +4 -4
  3. package/es/_internal/icons/BurgerMenuIcon.d.ts +2 -0
  4. package/es/_internal/icons/BurgerMenuIcon.js +4 -0
  5. package/es/_internal/icons/Logout.d.ts +2 -0
  6. package/es/_internal/icons/Logout.js +4 -0
  7. package/es/_internal/icons/OzbekFlag.d.ts +2 -0
  8. package/es/_internal/icons/OzbekFlag.js +15 -0
  9. package/es/_internal/icons/RussiaFlag.d.ts +2 -0
  10. package/es/_internal/icons/RussiaFlag.js +11 -0
  11. package/es/_internal/icons/SendFilled.d.ts +2 -0
  12. package/es/_internal/icons/SendFilled.js +9 -0
  13. package/es/_internal/icons/index.d.ts +5 -0
  14. package/es/_internal/icons/index.js +5 -0
  15. package/es/_styles/common/dark.js +1 -1
  16. package/es/_styles/common/light.d.ts +1 -0
  17. package/es/_styles/common/light.js +1 -1
  18. package/es/chat/src/Chat.d.ts +464 -83
  19. package/es/chat/src/Chat.js +17 -2
  20. package/es/chat/src/ChatListItems.d.ts +497 -94
  21. package/es/chat/src/ChatListItems.js +1 -1
  22. package/es/chat/src/ChatMessages.d.ts +501 -94
  23. package/es/chat/src/ChatMessages.js +115 -22
  24. package/es/chat/src/ChatParts/MainArea.d.ts +7 -3
  25. package/es/chat/src/ChatParts/MainArea.js +110 -14
  26. package/es/chat/src/ChatParts/Sidebar.d.ts +64 -11
  27. package/es/chat/src/interface.d.ts +18 -0
  28. package/es/chat/src/interface.js +6 -0
  29. package/es/chat/src/styles/index.cssr.js +22 -1
  30. package/es/chat/styles/dark.d.ts +41 -8
  31. package/es/chat/styles/dark.js +6 -2
  32. package/es/chat/styles/light.d.ts +42 -8
  33. package/es/chat/styles/light.js +7 -2
  34. package/es/components.d.ts +3 -0
  35. package/es/components.js +3 -0
  36. package/es/config-provider/src/internal-interface.d.ts +17 -0
  37. package/es/dialog/src/DialogProvider.d.ts +2 -0
  38. package/es/form/src/FormItemCol.d.ts +2 -2
  39. package/es/form/src/FormItemGridItem.d.ts +2 -2
  40. package/es/form/src/FormItemRow.d.ts +1 -1
  41. package/es/grid/src/Grid.d.ts +1 -1
  42. package/es/grid/src/GridItem.d.ts +2 -2
  43. package/es/header/demos/mock.d.ts +2 -0
  44. package/es/header/demos/mock.js +235 -0
  45. package/es/header/index.d.ts +12 -0
  46. package/es/header/index.js +10 -0
  47. package/es/header/src/Header.d.ts +604 -0
  48. package/es/header/src/Header.js +320 -0
  49. package/es/header/src/HeaderActions.d.ts +120 -0
  50. package/es/header/src/HeaderActions.js +166 -0
  51. package/es/header/src/HeaderDesktopLayout.d.ts +25 -0
  52. package/es/header/src/HeaderDesktopLayout.js +24 -0
  53. package/es/header/src/HeaderMobileLayout.d.ts +25 -0
  54. package/es/header/src/HeaderMobileLayout.js +21 -0
  55. package/es/header/src/HeaderNavigation.d.ts +128 -0
  56. package/es/header/src/HeaderNavigation.js +172 -0
  57. package/es/header/src/HeaderSearchDesktop.d.ts +79 -0
  58. package/es/header/src/HeaderSearchDesktop.js +77 -0
  59. package/es/header/src/HeaderSearchMobile.d.ts +73 -0
  60. package/es/header/src/HeaderSearchMobile.js +126 -0
  61. package/es/header/src/HeaderSearchResults.d.ts +81 -0
  62. package/es/header/src/HeaderSearchResults.js +74 -0
  63. package/es/header/src/constants.d.ts +1 -0
  64. package/es/header/src/constants.js +1 -0
  65. package/es/header/src/interface.d.ts +58 -0
  66. package/es/header/src/interface.js +1 -0
  67. package/es/header/src/mobile/HeaderMobile.d.ts +218 -0
  68. package/es/header/src/mobile/HeaderMobile.js +241 -0
  69. package/es/header/src/styles/index.cssr.d.ts +6 -0
  70. package/es/header/src/styles/index.cssr.js +519 -0
  71. package/es/header/src/utils.d.ts +12 -0
  72. package/es/header/src/utils.js +47 -0
  73. package/es/header/styles/dark.d.ts +36 -0
  74. package/es/header/styles/dark.js +9 -0
  75. package/es/header/styles/index.d.ts +3 -0
  76. package/es/header/styles/index.js +2 -0
  77. package/es/header/styles/light.d.ts +72 -0
  78. package/es/header/styles/light.js +45 -0
  79. package/es/icon/src/Icon.d.ts +3 -0
  80. package/es/icon/src/Icon.js +3 -2
  81. package/es/icon-bar/index.d.ts +4 -0
  82. package/es/icon-bar/index.js +2 -0
  83. package/es/icon-bar/src/IconBar.d.ts +175 -0
  84. package/es/icon-bar/src/IconBar.js +57 -0
  85. package/es/icon-bar/src/IconBarItem.d.ts +163 -0
  86. package/es/icon-bar/src/IconBarItem.js +50 -0
  87. package/es/icon-bar/src/styles/index.cssr.d.ts +2 -0
  88. package/es/icon-bar/src/styles/index.cssr.js +62 -0
  89. package/es/icon-bar/styles/dark.d.ts +3 -0
  90. package/es/icon-bar/styles/dark.js +8 -0
  91. package/es/icon-bar/styles/index.d.ts +3 -0
  92. package/es/icon-bar/styles/index.js +2 -0
  93. package/es/icon-bar/styles/light.d.ts +19 -0
  94. package/es/icon-bar/styles/light.js +23 -0
  95. package/es/locales/common/arDZ.js +11 -1
  96. package/es/locales/common/deDE.js +11 -1
  97. package/es/locales/common/enGB.js +11 -1
  98. package/es/locales/common/enUS.d.ts +10 -0
  99. package/es/locales/common/enUS.js +11 -1
  100. package/es/locales/common/eo.js +11 -1
  101. package/es/locales/common/esAR.js +11 -1
  102. package/es/locales/common/faIR.js +11 -1
  103. package/es/locales/common/frFR.js +11 -1
  104. package/es/locales/common/idID.js +11 -1
  105. package/es/locales/common/itIT.js +11 -1
  106. package/es/locales/common/jaJP.js +11 -1
  107. package/es/locales/common/koKR.js +11 -1
  108. package/es/locales/common/nbNO.js +11 -1
  109. package/es/locales/common/nlNL.js +11 -1
  110. package/es/locales/common/plPL.js +11 -1
  111. package/es/locales/common/ptBR.js +11 -1
  112. package/es/locales/common/ruRU.js +11 -1
  113. package/es/locales/common/skSK.js +11 -1
  114. package/es/locales/common/svSE.js +11 -1
  115. package/es/locales/common/thTH.js +11 -1
  116. package/es/locales/common/trTR.js +11 -1
  117. package/es/locales/common/ukUA.js +11 -1
  118. package/es/locales/common/viVN.js +11 -1
  119. package/es/locales/common/zhCN.js +11 -1
  120. package/es/locales/common/zhTW.js +11 -1
  121. package/es/qr-code/index.d.ts +2 -0
  122. package/es/qr-code/index.js +1 -0
  123. package/es/qr-code/src/QrCode.d.ts +171 -0
  124. package/es/qr-code/src/QrCode.js +229 -0
  125. package/es/qr-code/src/qrcodegen.d.ts +95 -0
  126. package/es/qr-code/src/qrcodegen.js +949 -0
  127. package/es/qr-code/src/styles/index.cssr.d.ts +2 -0
  128. package/es/qr-code/src/styles/index.cssr.js +8 -0
  129. package/es/qr-code/styles/dark.d.ts +3 -0
  130. package/es/qr-code/styles/dark.js +11 -0
  131. package/es/qr-code/styles/index.d.ts +3 -0
  132. package/es/qr-code/styles/index.js +2 -0
  133. package/es/qr-code/styles/light.d.ts +9 -0
  134. package/es/qr-code/styles/light.js +12 -0
  135. package/es/theme-editor/src/ThemeEditor.d.ts +1 -0
  136. package/es/themes/dark.js +7 -1
  137. package/es/themes/light.js +7 -1
  138. package/es/version.d.ts +1 -1
  139. package/es/version.js +1 -1
  140. package/lib/_internal/icons/BurgerMenuIcon.d.ts +2 -0
  141. package/lib/_internal/icons/BurgerMenuIcon.js +6 -0
  142. package/lib/_internal/icons/Logout.d.ts +2 -0
  143. package/lib/_internal/icons/Logout.js +6 -0
  144. package/lib/_internal/icons/OzbekFlag.d.ts +2 -0
  145. package/lib/_internal/icons/OzbekFlag.js +17 -0
  146. package/lib/_internal/icons/RussiaFlag.d.ts +2 -0
  147. package/lib/_internal/icons/RussiaFlag.js +13 -0
  148. package/lib/_internal/icons/SendFilled.d.ts +2 -0
  149. package/lib/_internal/icons/SendFilled.js +11 -0
  150. package/lib/_internal/icons/index.d.ts +5 -0
  151. package/lib/_internal/icons/index.js +11 -1
  152. package/lib/_styles/common/dark.js +1 -1
  153. package/lib/_styles/common/light.d.ts +1 -0
  154. package/lib/_styles/common/light.js +1 -1
  155. package/lib/chat/src/Chat.d.ts +464 -83
  156. package/lib/chat/src/Chat.js +17 -2
  157. package/lib/chat/src/ChatListItems.d.ts +497 -94
  158. package/lib/chat/src/ChatListItems.js +1 -1
  159. package/lib/chat/src/ChatMessages.d.ts +501 -94
  160. package/lib/chat/src/ChatMessages.js +113 -20
  161. package/lib/chat/src/ChatParts/MainArea.d.ts +7 -3
  162. package/lib/chat/src/ChatParts/MainArea.js +108 -12
  163. package/lib/chat/src/ChatParts/Sidebar.d.ts +64 -11
  164. package/lib/chat/src/interface.d.ts +18 -0
  165. package/lib/chat/src/interface.js +7 -1
  166. package/lib/chat/src/styles/index.cssr.js +22 -1
  167. package/lib/chat/styles/dark.d.ts +41 -8
  168. package/lib/chat/styles/dark.js +6 -2
  169. package/lib/chat/styles/light.d.ts +42 -8
  170. package/lib/chat/styles/light.js +7 -2
  171. package/lib/components.d.ts +3 -0
  172. package/lib/components.js +3 -0
  173. package/lib/config-provider/src/internal-interface.d.ts +17 -0
  174. package/lib/dialog/src/DialogProvider.d.ts +2 -0
  175. package/lib/form/src/FormItemCol.d.ts +2 -2
  176. package/lib/form/src/FormItemGridItem.d.ts +2 -2
  177. package/lib/form/src/FormItemRow.d.ts +1 -1
  178. package/lib/grid/src/Grid.d.ts +1 -1
  179. package/lib/grid/src/GridItem.d.ts +2 -2
  180. package/lib/header/demos/mock.d.ts +2 -0
  181. package/lib/header/demos/mock.js +238 -0
  182. package/lib/header/index.d.ts +12 -0
  183. package/lib/header/index.js +48 -0
  184. package/lib/header/src/Header.d.ts +604 -0
  185. package/lib/header/src/Header.js +349 -0
  186. package/lib/header/src/HeaderActions.d.ts +120 -0
  187. package/lib/header/src/HeaderActions.js +172 -0
  188. package/lib/header/src/HeaderDesktopLayout.d.ts +25 -0
  189. package/lib/header/src/HeaderDesktopLayout.js +27 -0
  190. package/lib/header/src/HeaderMobileLayout.d.ts +25 -0
  191. package/lib/header/src/HeaderMobileLayout.js +24 -0
  192. package/lib/header/src/HeaderNavigation.d.ts +128 -0
  193. package/lib/header/src/HeaderNavigation.js +175 -0
  194. package/lib/header/src/HeaderSearchDesktop.d.ts +79 -0
  195. package/lib/header/src/HeaderSearchDesktop.js +83 -0
  196. package/lib/header/src/HeaderSearchMobile.d.ts +73 -0
  197. package/lib/header/src/HeaderSearchMobile.js +132 -0
  198. package/lib/header/src/HeaderSearchResults.d.ts +81 -0
  199. package/lib/header/src/HeaderSearchResults.js +77 -0
  200. package/lib/header/src/constants.d.ts +1 -0
  201. package/lib/header/src/constants.js +4 -0
  202. package/lib/header/src/interface.d.ts +58 -0
  203. package/lib/header/src/interface.js +2 -0
  204. package/lib/header/src/mobile/HeaderMobile.d.ts +218 -0
  205. package/lib/header/src/mobile/HeaderMobile.js +244 -0
  206. package/lib/header/src/styles/index.cssr.d.ts +6 -0
  207. package/lib/header/src/styles/index.cssr.js +525 -0
  208. package/lib/header/src/utils.d.ts +12 -0
  209. package/lib/header/src/utils.js +58 -0
  210. package/lib/header/styles/dark.d.ts +36 -0
  211. package/lib/header/styles/dark.js +11 -0
  212. package/lib/header/styles/index.d.ts +3 -0
  213. package/lib/header/styles/index.js +10 -0
  214. package/lib/header/styles/light.d.ts +72 -0
  215. package/lib/header/styles/light.js +49 -0
  216. package/lib/icon/src/Icon.d.ts +3 -0
  217. package/lib/icon/src/Icon.js +3 -2
  218. package/lib/icon-bar/index.d.ts +4 -0
  219. package/lib/icon-bar/index.js +12 -0
  220. package/lib/icon-bar/src/IconBar.d.ts +175 -0
  221. package/lib/icon-bar/src/IconBar.js +63 -0
  222. package/lib/icon-bar/src/IconBarItem.d.ts +163 -0
  223. package/lib/icon-bar/src/IconBarItem.js +56 -0
  224. package/lib/icon-bar/src/styles/index.cssr.d.ts +2 -0
  225. package/lib/icon-bar/src/styles/index.cssr.js +67 -0
  226. package/lib/icon-bar/styles/dark.d.ts +3 -0
  227. package/lib/icon-bar/styles/dark.js +10 -0
  228. package/lib/icon-bar/styles/index.d.ts +3 -0
  229. package/lib/icon-bar/styles/index.js +10 -0
  230. package/lib/icon-bar/styles/light.d.ts +19 -0
  231. package/lib/icon-bar/styles/light.js +27 -0
  232. package/lib/locales/common/arDZ.js +11 -1
  233. package/lib/locales/common/deDE.js +11 -1
  234. package/lib/locales/common/enGB.js +11 -1
  235. package/lib/locales/common/enUS.d.ts +10 -0
  236. package/lib/locales/common/enUS.js +11 -1
  237. package/lib/locales/common/eo.js +11 -1
  238. package/lib/locales/common/esAR.js +11 -1
  239. package/lib/locales/common/faIR.js +11 -1
  240. package/lib/locales/common/frFR.js +11 -1
  241. package/lib/locales/common/idID.js +11 -1
  242. package/lib/locales/common/itIT.js +11 -1
  243. package/lib/locales/common/jaJP.js +11 -1
  244. package/lib/locales/common/koKR.js +11 -1
  245. package/lib/locales/common/nbNO.js +11 -1
  246. package/lib/locales/common/nlNL.js +11 -1
  247. package/lib/locales/common/plPL.js +11 -1
  248. package/lib/locales/common/ptBR.js +11 -1
  249. package/lib/locales/common/ruRU.js +11 -1
  250. package/lib/locales/common/skSK.js +11 -1
  251. package/lib/locales/common/svSE.js +11 -1
  252. package/lib/locales/common/thTH.js +11 -1
  253. package/lib/locales/common/trTR.js +11 -1
  254. package/lib/locales/common/ukUA.js +11 -1
  255. package/lib/locales/common/viVN.js +11 -1
  256. package/lib/locales/common/zhCN.js +11 -1
  257. package/lib/locales/common/zhTW.js +11 -1
  258. package/lib/qr-code/index.d.ts +2 -0
  259. package/lib/qr-code/index.js +9 -0
  260. package/lib/qr-code/src/QrCode.d.ts +171 -0
  261. package/lib/qr-code/src/QrCode.js +235 -0
  262. package/lib/qr-code/src/qrcodegen.d.ts +95 -0
  263. package/lib/qr-code/src/qrcodegen.js +950 -0
  264. package/lib/qr-code/src/styles/index.cssr.d.ts +2 -0
  265. package/lib/qr-code/src/styles/index.cssr.js +13 -0
  266. package/lib/qr-code/styles/dark.d.ts +3 -0
  267. package/lib/qr-code/styles/dark.js +13 -0
  268. package/lib/qr-code/styles/index.d.ts +3 -0
  269. package/lib/qr-code/styles/index.js +10 -0
  270. package/lib/qr-code/styles/light.d.ts +9 -0
  271. package/lib/qr-code/styles/light.js +14 -0
  272. package/lib/theme-editor/src/ThemeEditor.d.ts +1 -0
  273. package/lib/themes/dark.js +7 -1
  274. package/lib/themes/light.js +7 -1
  275. package/lib/version.d.ts +1 -1
  276. package/lib/version.js +1 -1
  277. package/package.json +1 -1
  278. package/volar.d.ts +166 -153
  279. package/web-types.json +854 -2
@@ -1,8 +1,9 @@
1
- import { h, defineComponent, computed, inject, Fragment } from 'vue';
2
- import { MessageStatus, ChatMessageType, ChatMarkType, chatInjectionKey } from './interface';
1
+ import { h, defineComponent, computed, inject, Fragment, ref, nextTick } from 'vue';
2
+ import { MessageStatus, ChatMessageType, ChatMarkType, ChatBubbleActionKey, chatInjectionKey } from './interface';
3
3
  import ChatAttachmentComponent from './ChatParts/ChatAttachment';
4
4
  import { UIcon } from '../../icon';
5
5
  import { USkeleton } from '../../skeleton';
6
+ import { UDropdown } from '../../dropdown';
6
7
  import style from './styles/index.cssr';
7
8
  import { chatLight } from '../styles';
8
9
  import { useConfig, useTheme, useThemeClass, useLocale } from '../../_mixins';
@@ -59,6 +60,8 @@ export default defineComponent({
59
60
  const { mergedClsPrefixRef } = useConfig(props);
60
61
  const themeRef = (_a = UChat === null || UChat === void 0 ? void 0 : UChat.mergedThemeRef) !== null && _a !== void 0 ? _a : useTheme('Chat', '-chat', style, chatLight, props, mergedClsPrefixRef);
61
62
  const { localeRef } = useLocale('Chat');
63
+ const contextMenuShow = ref(false);
64
+ const contextMenuMessage = ref();
62
65
  const cssVarsRef = computed(() => {
63
66
  const { common: { cubicBezierEaseInOut, brandPrimary500, staticGreen, staticRed, textPrimary, textSecondary, textTertiary }, self: { backgroundColor, borderColor, mainBackgroundColor, headerBackgroundColor, headerBorderColor, headerTitleColor, messageBubbleBackgroundColorOwn, messageBubbleBackgroundColorOther, messageBubbleTextColorOwn, messageBubbleTextColorOther, messageTimeColor, messageStatusColor, attachmentBackgroundColorOwn, attachmentBackgroundColorOther, unreadNotificationBackgroundColor, unreadNotificationTextColor, typingIndicatorColor, dateSeparatorColor, dateSeparatorBackgroundColor, borderRadius, errorColor } } = themeRef.value;
64
67
  return {
@@ -104,6 +107,50 @@ export default defineComponent({
104
107
  var _a;
105
108
  (_a = props.onMessageRetry) === null || _a === void 0 ? void 0 : _a.call(props, message);
106
109
  };
110
+ const messageContextMenuOptions = computed(() => {
111
+ var _a;
112
+ const message = contextMenuMessage.value;
113
+ if (!message)
114
+ return;
115
+ const bubbleActions = (_a = UChat === null || UChat === void 0 ? void 0 : UChat.bubbleActionsRef) === null || _a === void 0 ? void 0 : _a.value;
116
+ if (!bubbleActions || bubbleActions.length === 0) {
117
+ return [];
118
+ }
119
+ const result = [];
120
+ for (const action of bubbleActions) {
121
+ if (action.visible && !action.visible(message)) {
122
+ continue;
123
+ }
124
+ const label = typeof action.label === 'function' ? action.label() : action.label;
125
+ result.push({
126
+ label,
127
+ key: String(action.key)
128
+ });
129
+ }
130
+ return result;
131
+ });
132
+ const handleContextMenuSelect = (key) => {
133
+ var _a, _b;
134
+ const message = contextMenuMessage.value;
135
+ if (!message)
136
+ return;
137
+ if (key === ChatBubbleActionKey.EDIT) {
138
+ const startEditing = (_a = UChat === null || UChat === void 0 ? void 0 : UChat.startEditingMessage) === null || _a === void 0 ? void 0 : _a.value;
139
+ if (startEditing) {
140
+ startEditing(message);
141
+ }
142
+ contextMenuShow.value = false;
143
+ return;
144
+ }
145
+ const bubbleActions = (_b = UChat === null || UChat === void 0 ? void 0 : UChat.bubbleActionsRef) === null || _b === void 0 ? void 0 : _b.value;
146
+ if (!bubbleActions)
147
+ return;
148
+ const action = bubbleActions.find((action) => action.key === key);
149
+ if (action) {
150
+ action.handler(message);
151
+ }
152
+ contextMenuShow.value = false;
153
+ };
107
154
  const renderDateSeparator = (date) => {
108
155
  return (h("div", { class: `${mergedClsPrefixRef.value}-chat-main__date-separator` },
109
156
  h("span", null, date)));
@@ -129,35 +176,69 @@ export default defineComponent({
129
176
  ] }, message.content && h("span", null, message.content)));
130
177
  };
131
178
  const renderMessage = (message) => {
179
+ var _a, _b, _c;
132
180
  const isOwn = message.isOwn;
133
181
  const attachments = message.attachment
134
182
  ? Array.isArray(message.attachment)
135
183
  ? message.attachment
136
184
  : [message.attachment]
137
185
  : [];
138
- return (h("div", { key: message.id, class: [
186
+ const isContextMenuForThisMessage = contextMenuShow.value && ((_a = contextMenuMessage.value) === null || _a === void 0 ? void 0 : _a.id) === message.id;
187
+ const hasBubbleActionsSlot = slots.bubbleActions !== undefined;
188
+ const hasBubbleActionsConfig = ((_b = UChat === null || UChat === void 0 ? void 0 : UChat.bubbleActionsRef) === null || _b === void 0 ? void 0 : _b.value) &&
189
+ UChat.bubbleActionsRef.value.length > 0;
190
+ const messageBubbleContent = message.content || attachments.length > 1 ? (h("div", { class: [
191
+ `${mergedClsPrefixRef.value}-chat-main__message-bubble`,
192
+ isOwn
193
+ ? `${mergedClsPrefixRef.value}-chat-main__message-bubble--own`
194
+ : `${mergedClsPrefixRef.value}-chat-main__message-bubble--other`
195
+ ] },
196
+ attachments.length > 0 && (h(ChatAttachmentComponent, { message: message, attachments: attachments, uploadProps: props.uploadProps, withPadding: true }, {
197
+ default: slots.messageAttachment,
198
+ 'upload-file-title': slots.messageAttachmentTitle,
199
+ 'upload-file-subtitle': slots.messageAttachmentSubtitle
200
+ })),
201
+ message.content && (h("div", { class: `${mergedClsPrefixRef.value}-chat-main__message-text` }, message.content)))) : attachments.length === 1 ? (h(ChatAttachmentComponent, { message: message, attachments: attachments, uploadProps: props.uploadProps }, {
202
+ default: slots.messageAttachment,
203
+ 'upload-file-title': slots.messageAttachmentTitle,
204
+ 'upload-file-subtitle': slots.messageAttachmentSubtitle
205
+ })) : null;
206
+ const messageContent = (h("div", { key: message.id, class: [
139
207
  `${mergedClsPrefixRef.value}-chat-main__message`,
140
208
  isOwn
141
209
  ? `${mergedClsPrefixRef.value}-chat-main__message--own`
142
210
  : `${mergedClsPrefixRef.value}-chat-main__message--other`
143
211
  ] },
144
212
  h("div", { class: `${mergedClsPrefixRef.value}-chat-main__message-wrapper` },
145
- message.content || attachments.length > 1 ? (h("div", { class: [
146
- `${mergedClsPrefixRef.value}-chat-main__message-bubble`,
147
- isOwn
148
- ? `${mergedClsPrefixRef.value}-chat-main__message-bubble--own`
149
- : `${mergedClsPrefixRef.value}-chat-main__message-bubble--other`
150
- ] },
151
- attachments.length > 0 && (h(ChatAttachmentComponent, { message: message, attachments: attachments, uploadProps: props.uploadProps, withPadding: true }, {
152
- default: slots.messageAttachment,
153
- 'upload-file-title': slots.messageAttachmentTitle,
154
- 'upload-file-subtitle': slots.messageAttachmentSubtitle
155
- })),
156
- message.content && (h("div", { class: `${mergedClsPrefixRef.value}-chat-main__message-text` }, message.content)))) : attachments.length === 1 ? (h(ChatAttachmentComponent, { message: message, attachments: attachments, uploadProps: props.uploadProps }, {
157
- default: slots.messageAttachment,
158
- 'upload-file-title': slots.messageAttachmentTitle,
159
- 'upload-file-subtitle': slots.messageAttachmentSubtitle
160
- })) : null,
213
+ hasBubbleActionsSlot ? (h("div", { onContextmenu: (e) => {
214
+ e.preventDefault();
215
+ contextMenuShow.value = false;
216
+ void nextTick().then(() => {
217
+ contextMenuShow.value = true;
218
+ contextMenuMessage.value = message;
219
+ });
220
+ } }, (_c = slots.bubbleActions) === null || _c === void 0 ? void 0 :
221
+ _c.call(slots, message),
222
+ messageBubbleContent)) : hasBubbleActionsConfig ? (h(UDropdown, { show: isContextMenuForThisMessage, onUpdateShow: (show) => {
223
+ var _a;
224
+ if (!show && ((_a = contextMenuMessage.value) === null || _a === void 0 ? void 0 : _a.id) === message.id) {
225
+ contextMenuShow.value = false;
226
+ }
227
+ }, onClickoutside: () => {
228
+ var _a;
229
+ if (((_a = contextMenuMessage.value) === null || _a === void 0 ? void 0 : _a.id) === message.id) {
230
+ contextMenuShow.value = false;
231
+ }
232
+ }, trigger: "manual", placement: "bottom-start", options: messageContextMenuOptions.value, onSelect: handleContextMenuSelect }, {
233
+ default: () => (h("div", { onContextmenu: (event) => {
234
+ event.preventDefault();
235
+ contextMenuShow.value = false;
236
+ void nextTick().then(() => {
237
+ contextMenuShow.value = true;
238
+ contextMenuMessage.value = message;
239
+ });
240
+ } }, messageBubbleContent))
241
+ })) : (messageBubbleContent),
161
242
  h("div", { class: [
162
243
  `${mergedClsPrefixRef.value}-chat-main__message-meta`,
163
244
  isOwn
@@ -168,7 +249,7 @@ export default defineComponent({
168
249
  ] }, message.status === MessageStatus.RETRY ? (h("div", { class: `${mergedClsPrefixRef.value}-chat-main__message-retry`, onClick: () => {
169
250
  handleMessageRetry(message);
170
251
  }, style: { cursor: 'pointer' } },
171
- h(UIcon, { size: 16, component: statusIconMapper[MessageStatus.RETRY], class: `${mergedClsPrefixRef.value}-chat-main__message-retry-icon`, theme: themeRef.value.peers.Icon, themeOverrides: themeRef.value.peerOverrides.Icon }),
252
+ h(UIcon, { size: 16, component: statusIconMapper[MessageStatus.RETRY], class: `${mergedClsPrefixRef.value}-chat-main__message-retry-icon`, theme: themeRef.value.peers.StatusIcon, themeOverrides: themeRef.value.peerOverrides.StatusIcon }),
172
253
  h("span", { class: `${mergedClsPrefixRef.value}-chat-main__message-retry-text` }, mergedRetryTextRef.value))) : (h(Fragment, null,
173
254
  h("span", { class: `${mergedClsPrefixRef.value}-chat-main__message-time` }, message.timestamp),
174
255
  isOwn && message.status && (h("div", { class: `${mergedClsPrefixRef.value}-chat-main__message-status` }, slots.messageStatus
@@ -176,7 +257,8 @@ export default defineComponent({
176
257
  : statusIconMapper[message.status] && (h(UIcon, { size: 16, component: statusIconMapper[message.status], class: [
177
258
  `${mergedClsPrefixRef.value}-chat-main__message-status-icon`,
178
259
  `${mergedClsPrefixRef.value}-chat-main__message-status-icon--${String(message.status)}`
179
- ], theme: themeRef.value.peers.Icon, themeOverrides: themeRef.value.peerOverrides.Icon }))))))))));
260
+ ], theme: themeRef.value.peers.StatusIcon, themeOverrides: themeRef.value.peerOverrides.StatusIcon }))))))))));
261
+ return messageContent;
180
262
  };
181
263
  const renderTypingIndicator = () => {
182
264
  return (h("div", { class: [
@@ -228,6 +310,10 @@ export default defineComponent({
228
310
  renderSkeletonMessage,
229
311
  renderDateSeparator,
230
312
  renderUnreadNotification,
313
+ contextMenuShow,
314
+ contextMenuMessage,
315
+ messageContextMenuOptions,
316
+ handleContextMenuSelect,
231
317
  cssVars: cssVarsRef,
232
318
  themeClass: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.themeClass,
233
319
  onRender: themeClassHandle === null || themeClassHandle === void 0 ? void 0 : themeClassHandle.onRender
@@ -305,7 +391,14 @@ export default defineComponent({
305
391
  padding: '0',
306
392
  background: 'transparent'
307
393
  } },
308
- h("div", { class: `${mergedClsPrefixRef}-chat-main__messages-container` },
394
+ h("div", { class: `${mergedClsPrefixRef}-chat-main__messages-container`, onContextmenu: (event) => {
395
+ const target = event.target;
396
+ const messagesContainer = event.currentTarget;
397
+ if (target === messagesContainer) {
398
+ event.preventDefault();
399
+ this.contextMenuShow = false;
400
+ }
401
+ } },
309
402
  messagesWithDates.map((item) => {
310
403
  var _a;
311
404
  if (item.type === 'date-separator') {
@@ -1,14 +1,18 @@
1
+ import { Ref } from 'vue';
2
+ import { type ChatMessageData } from '../interface';
1
3
  declare const _default: import("vue").DefineComponent<{}, {
2
4
  renderHeader: () => JSX.Element;
3
5
  renderMessages: () => JSX.Element;
6
+ renderEditingBlock: () => JSX.Element | null;
4
7
  renderFooter: () => JSX.Element;
5
- messagesBodyRef: import("vue").Ref<HTMLElement | {
8
+ messagesBodyRef: Ref<HTMLElement | {
6
9
  $el: HTMLElement;
7
10
  } | undefined>;
8
- inputRef: import("vue").Ref<HTMLInputElement | undefined>;
9
- inputValue: import("vue").Ref<string>;
11
+ inputRef: Ref<HTMLInputElement | undefined>;
12
+ inputValue: Ref<string>;
10
13
  handleSendMessage: () => Promise<void>;
11
14
  handleMessagesScroll: (e: Event) => void;
12
15
  scrollToBottom: () => void;
16
+ editingMessage: Ref<ChatMessageData | null>;
13
17
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
14
18
  export default _default;
@@ -8,7 +8,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import { h, defineComponent, inject, computed, ref, watch, nextTick, Fragment } from 'vue';
11
- import { MessageStatus, ChatMessageType, chatInjectionKey } from '../interface';
11
+ import { MessageStatus, ChatMessageType, ChatBubbleActionKey, chatInjectionKey } from '../interface';
12
12
  import { UInput } from '../../../input';
13
13
  import { UButton } from '../../../button';
14
14
  import { UIcon } from '../../../icon';
@@ -18,13 +18,16 @@ import { UUpload, UUploadTrigger } from '../../../upload';
18
18
  import { UFlex } from '../../../flex';
19
19
  import { resolveSlot } from '../../../_utils';
20
20
  import { UText } from '../../../typography';
21
+ import { UList, UListItem } from '../../../list';
22
+ import { useLocale } from '../../../_mixins';
21
23
  import UChatMessages from '../ChatMessages';
22
- import { ArrowHookUpRight, PersonNote, AttachIcon } from '../../../_internal/icons';
24
+ import { ArrowHookUpRight, PersonNote, AttachIcon, SendFilled, CloseIcon } from '../../../_internal/icons';
23
25
  const SENDING_DELAY = 100;
24
26
  export default defineComponent({
25
27
  name: 'ChatMainArea',
26
28
  setup(_, { slots }) {
27
- const { mergedClsPrefixRef, mergedThemeRef, selectedChatRef, messagesRef, typingChatIdsRef, messagesLoadingRef, messagesLoadingCountRef, headerButtonPropsRef, headerIconPropsRef, headerShareButtonPropsRef, headerProfileButtonPropsRef, headerCloseButtonPropsRef, headerShareIconPropsRef, headerProfileIconPropsRef, messageUploadPropsRef, footerInputPropsRef, footerButtonPropsRef, footerUploadPropsRef, footerIconPropsRef, inputPlaceholderRef, retryTextRef, typingTextRef, closeButtonTextRef, shareButtonTooltipRef, profileButtonTooltipRef, unreadNotificationTextRef, notificationsShownSetRef, unreadCountsBeforeReadRef, markNotificationShown, handleMessageSend, handleMessageRetry, handleFooterInputChange, onAttachmentUpload, onChatClose, onChatShare, onUserProfile, onMessagesScrollToTop, onMessagesScrollToBottom
29
+ const { localeRef } = useLocale('Chat');
30
+ const { mergedClsPrefixRef, mergedThemeRef, selectedChatRef, messagesRef, typingChatIdsRef, messagesLoadingRef, messagesLoadingCountRef, headerButtonPropsRef, headerIconPropsRef, headerShareButtonPropsRef, headerProfileButtonPropsRef, headerCloseButtonPropsRef, headerShareIconPropsRef, headerProfileIconPropsRef, messageUploadPropsRef, footerInputPropsRef, footerButtonPropsRef, footerUploadPropsRef, footerIconPropsRef, footerSuffixIconPropsRef, inputPlaceholderRef, retryTextRef, typingTextRef, closeButtonTextRef, shareButtonTooltipRef, profileButtonTooltipRef, unreadNotificationTextRef, notificationsShownSetRef, unreadCountsBeforeReadRef, markNotificationShown, handleMessageSend, handleMessageRetry, handleFooterInputChange, startEditingMessage: startEditingMessageRef, editMessageIdRef, bubbleActionsRef, onAttachmentUpload, onChatClose, onChatShare, onUserProfile, onMessagesScrollToTop, onMessagesScrollToBottom
28
31
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
29
32
  } = inject(chatInjectionKey);
30
33
  const messagesBodyRef = ref();
@@ -35,6 +38,7 @@ export default defineComponent({
35
38
  const lastScrollTop = ref(0);
36
39
  const scrollTopFired = ref(false);
37
40
  const scrollBottomFired = ref(false);
41
+ const editingMessage = ref(null);
38
42
  const unreadMessagesCount = computed(() => {
39
43
  if (!messagesRef.value)
40
44
  return 0;
@@ -58,6 +62,10 @@ export default defineComponent({
58
62
  shouldScrollOnLoad.value = true;
59
63
  attachmentFileList.value = [];
60
64
  uploadedAttachmentsMap.value.clear();
65
+ editingMessage.value = null;
66
+ if (editMessageIdRef) {
67
+ editMessageIdRef.value = null;
68
+ }
61
69
  if (unreadBeforeRead > 0 &&
62
70
  !notificationsShownSetRef.value.has(newChat.id)) {
63
71
  hasUnreadMessages.value = true;
@@ -189,8 +197,9 @@ export default defineComponent({
189
197
  buttons.push(h(UTooltip, null, {
190
198
  trigger: () => (h(UButton, Object.assign({ secondary: true, circle: true, size: "large" }, shareButtonProps, { theme: mergedThemeRef.value.peers.Button, themeOverrides: mergedThemeRef.value.peerOverrides
191
199
  .Button, onClick: () => { var _a; return (_a = onChatShare === null || onChatShare === void 0 ? void 0 : onChatShare.value) === null || _a === void 0 ? void 0 : _a.call(onChatShare); } }), {
192
- default: () => (h(UIcon, Object.assign({ size: 20 }, shareIconProps, { theme: mergedThemeRef.value.peers.Icon, themeOverrides: mergedThemeRef.value.peerOverrides
193
- .Icon }), {
200
+ default: () => (h(UIcon, Object.assign({ size: 20 }, shareIconProps, { theme: mergedThemeRef.value.peers
201
+ .HeaderShareIcon, themeOverrides: mergedThemeRef.value.peerOverrides
202
+ .HeaderShareIcon }), {
194
203
  default: () => (h(ArrowHookUpRight, null))
195
204
  }))
196
205
  })),
@@ -199,8 +208,9 @@ export default defineComponent({
199
208
  buttons.push(h(UTooltip, null, {
200
209
  trigger: () => (h(UButton, Object.assign({ secondary: true, circle: true, size: "large" }, profileButtonProps, { theme: mergedThemeRef.value.peers.Button, themeOverrides: mergedThemeRef.value.peerOverrides
201
210
  .Button, onClick: () => { var _a; return (_a = onUserProfile === null || onUserProfile === void 0 ? void 0 : onUserProfile.value) === null || _a === void 0 ? void 0 : _a.call(onUserProfile); } }), {
202
- default: () => (h(UIcon, Object.assign({ size: 20 }, profileIconProps, { theme: mergedThemeRef.value.peers.Icon, themeOverrides: mergedThemeRef.value.peerOverrides
203
- .Icon }), {
211
+ default: () => (h(UIcon, Object.assign({ size: 20 }, profileIconProps, { theme: mergedThemeRef.value.peers
212
+ .HeaderProfileIcon, themeOverrides: mergedThemeRef.value.peerOverrides
213
+ .HeaderProfileIcon }), {
204
214
  default: () => h(PersonNote, null)
205
215
  }))
206
216
  })),
@@ -221,9 +231,33 @@ export default defineComponent({
221
231
  messageAttachment: slots.messageAttachment,
222
232
  messageAttachmentTitle: slots.messageAttachmentTitle,
223
233
  messageAttachmentSubtitle: slots.messageAttachmentSubtitle,
224
- messageStatus: slots.messageStatus
234
+ messageStatus: slots.messageStatus,
235
+ bubbleActions: slots.bubbleActions
225
236
  }));
226
237
  };
238
+ const startEditingMessage = (message) => {
239
+ editingMessage.value = message;
240
+ if (editMessageIdRef) {
241
+ editMessageIdRef.value = message.id;
242
+ }
243
+ inputValue.value =
244
+ typeof message.content === 'string' ? message.content : '';
245
+ attachmentFileList.value = [];
246
+ uploadedAttachmentsMap.value.clear();
247
+ };
248
+ const cancelEditingMessage = () => {
249
+ editingMessage.value = null;
250
+ if (editMessageIdRef) {
251
+ editMessageIdRef.value = null;
252
+ }
253
+ inputValue.value = '';
254
+ if (selectedChatRef.value) {
255
+ inputValue.value = chatInputs.value[selectedChatRef.value.id] || '';
256
+ }
257
+ };
258
+ if (startEditingMessageRef) {
259
+ startEditingMessageRef.value = startEditingMessage;
260
+ }
227
261
  const isSending = ref(false);
228
262
  const handleSendMessage = () => __awaiter(this, void 0, void 0, function* () {
229
263
  if (isSending.value) {
@@ -231,6 +265,36 @@ export default defineComponent({
231
265
  }
232
266
  const hasContent = inputValue.value.trim();
233
267
  const hasAttachments = attachmentFileList.value.length > 0;
268
+ if ((editMessageIdRef === null || editMessageIdRef === void 0 ? void 0 : editMessageIdRef.value) && hasContent) {
269
+ isSending.value = true;
270
+ try {
271
+ const messageToEdit = editingMessage.value;
272
+ if (messageToEdit) {
273
+ const updatedMessage = Object.assign(Object.assign({}, messageToEdit), { content: inputValue.value.trim() });
274
+ const bubbleActions = bubbleActionsRef === null || bubbleActionsRef === void 0 ? void 0 : bubbleActionsRef.value;
275
+ if (bubbleActions) {
276
+ const editAction = bubbleActions.find((action) => action.key === ChatBubbleActionKey.EDIT);
277
+ if (editAction) {
278
+ editAction.handler(updatedMessage);
279
+ }
280
+ }
281
+ }
282
+ editingMessage.value = null;
283
+ if (editMessageIdRef) {
284
+ editMessageIdRef.value = null;
285
+ }
286
+ inputValue.value = '';
287
+ if (selectedChatRef.value) {
288
+ chatInputs.value[selectedChatRef.value.id] = '';
289
+ }
290
+ }
291
+ finally {
292
+ setTimeout(() => {
293
+ isSending.value = false;
294
+ }, SENDING_DELAY);
295
+ }
296
+ return;
297
+ }
234
298
  if ((hasContent || hasAttachments) &&
235
299
  selectedChatRef.value &&
236
300
  handleMessageSend) {
@@ -291,17 +355,37 @@ export default defineComponent({
291
355
  }))();
292
356
  }
293
357
  };
358
+ const renderEditingBlock = () => {
359
+ if (!(editMessageIdRef === null || editMessageIdRef === void 0 ? void 0 : editMessageIdRef.value) || !editingMessage.value)
360
+ return null;
361
+ return (h("div", { class: `${mergedClsPrefixRef.value}-chat-main__editing-block` },
362
+ h(UList, { bordered: true }, {
363
+ default: () => {
364
+ var _a;
365
+ return (h(UListItem, { header: { text: localeRef.value.editingTitle }, description: { text: ((_a = editingMessage.value) === null || _a === void 0 ? void 0 : _a.content) || '' } }, {
366
+ suffix: () => (h(UButton, { text: true, circle: true, size: "small", onClick: cancelEditingMessage, theme: mergedThemeRef.value.peers.Button, themeOverrides: mergedThemeRef.value.peerOverrides.Button }, {
367
+ icon: () => (h(UIcon, { size: 16 }, {
368
+ default: () => h(CloseIcon, null)
369
+ }))
370
+ }))
371
+ }));
372
+ }
373
+ })));
374
+ };
294
375
  const renderFooter = () => {
295
376
  return (h("div", { class: `${mergedClsPrefixRef.value}-chat-main__footer` },
296
377
  h(UUpload, Object.assign({ abstract: true, multiple: true, defaultUpload: false, fileList: attachmentFileList.value, onUpdateFileList: handleFileListUpdate }, footerUploadPropsRef.value), {
297
- default: () => (h(UFlex, { align: "center", size: "small", class: `${mergedClsPrefixRef.value}-chat-main__input-container` }, {
378
+ default: () => (h(UFlex, { align: "end", size: "small", wrap: false, class: `${mergedClsPrefixRef.value}-chat-main__input-container` }, {
298
379
  default: () => (h(Fragment, null,
299
380
  h(UUploadTrigger, { abstract: true }, {
300
381
  default: ({ handleClick }) => {
301
382
  var _a;
302
- return (h(UButton, Object.assign({ secondary: true, size: "large", class: `${mergedClsPrefixRef.value}-chat-main__attach-btn` }, footerButtonPropsRef.value, { disabled: (_a = footerInputPropsRef.value) === null || _a === void 0 ? void 0 : _a.disabled, theme: mergedThemeRef.value.peers.Button, themeOverrides: mergedThemeRef.value.peerOverrides.Button, onClick: handleClick }), {
303
- default: () => (h(UIcon, Object.assign({ size: 24 }, footerIconPropsRef.value, { theme: mergedThemeRef.value.peers.Icon, themeOverrides: mergedThemeRef.value.peerOverrides.Icon }), {
304
- default: () => h(AttachIcon, null)
383
+ return (h(UButton, Object.assign({ secondary: true, size: "large", class: `${mergedClsPrefixRef.value}-chat-main__attach-btn` }, footerButtonPropsRef.value, { disabled: ((_a = footerInputPropsRef.value) === null || _a === void 0 ? void 0 : _a.disabled) ||
384
+ !!(editMessageIdRef === null || editMessageIdRef === void 0 ? void 0 : editMessageIdRef.value), theme: mergedThemeRef.value.peers.Button, themeOverrides: mergedThemeRef.value.peerOverrides.Button, onClick: handleClick }), {
385
+ default: () => (h(UIcon, Object.assign({ size: 24 }, footerIconPropsRef.value, { theme: mergedThemeRef.value.peers
386
+ .FooterAttachIcon, themeOverrides: mergedThemeRef.value.peerOverrides
387
+ .FooterAttachIcon }), {
388
+ default: () => resolveSlot(slots.footerAttachIcon, () => [h(AttachIcon, null)])
305
389
  }))
306
390
  }));
307
391
  }
@@ -317,20 +401,32 @@ export default defineComponent({
317
401
  e.stopPropagation();
318
402
  void handleSendMessage();
319
403
  }
320
- } }))))
404
+ } }), {
405
+ prefix: () => renderEditingBlock(),
406
+ suffix: () => (h(UIcon, Object.assign({ size: 24, class: `${mergedClsPrefixRef.value}-chat-main__input-suffix` }, footerSuffixIconPropsRef.value, { theme: mergedThemeRef.value.peers.FooterSuffixIcon, themeOverrides: mergedThemeRef.value.peerOverrides
407
+ .FooterSuffixIcon, onClick: () => {
408
+ void handleSendMessage();
409
+ } }), {
410
+ default: () => resolveSlot(slots.footerSuffixIcon, () => [
411
+ h(SendFilled, null)
412
+ ])
413
+ }))
414
+ })))
321
415
  }))
322
416
  })));
323
417
  };
324
418
  return {
325
419
  renderHeader,
326
420
  renderMessages,
421
+ renderEditingBlock,
327
422
  renderFooter,
328
423
  messagesBodyRef,
329
424
  inputRef,
330
425
  inputValue,
331
426
  handleSendMessage,
332
427
  handleMessagesScroll,
333
- scrollToBottom
428
+ scrollToBottom,
429
+ editingMessage
334
430
  };
335
431
  },
336
432
  render() {
@@ -38,6 +38,7 @@ declare const _default: import("vue").DefineComponent<{}, {
38
38
  footerBorderColor: string;
39
39
  inputBackgroundColor: string;
40
40
  inputBorderColor: string;
41
+ inputSuffixColor: string;
41
42
  unreadNotificationBackgroundColor: string;
42
43
  unreadNotificationTextColor: string;
43
44
  typingIndicatorColor: string;
@@ -572,14 +573,6 @@ declare const _default: import("vue").DefineComponent<{}, {
572
573
  iconSizeLarge: string;
573
574
  rippleDuration: string;
574
575
  }, any>;
575
- Icon: import("../../../_mixins").Theme<"Icon", {
576
- color: string;
577
- opacity1Depth: string;
578
- opacity2Depth: string;
579
- opacity3Depth: string;
580
- opacity4Depth: string;
581
- opacity5Depth: string;
582
- }, any>;
583
576
  List: import("../../../_mixins").Theme<"List", {
584
577
  iconSize: string;
585
578
  iconSpace: string;
@@ -675,6 +668,46 @@ declare const _default: import("vue").DefineComponent<{}, {
675
668
  codeColor: string;
676
669
  codeBorder: string;
677
670
  }, any>;
671
+ StatusIcon: import("../../../_mixins").Theme<"Icon", {
672
+ color: string;
673
+ opacity1Depth: string;
674
+ opacity2Depth: string;
675
+ opacity3Depth: string;
676
+ opacity4Depth: string;
677
+ opacity5Depth: string;
678
+ }, any>;
679
+ FooterAttachIcon: import("../../../_mixins").Theme<"Icon", {
680
+ color: string;
681
+ opacity1Depth: string;
682
+ opacity2Depth: string;
683
+ opacity3Depth: string;
684
+ opacity4Depth: string;
685
+ opacity5Depth: string;
686
+ }, any>;
687
+ FooterSuffixIcon: import("../../../_mixins").Theme<"Icon", {
688
+ color: string;
689
+ opacity1Depth: string;
690
+ opacity2Depth: string;
691
+ opacity3Depth: string;
692
+ opacity4Depth: string;
693
+ opacity5Depth: string;
694
+ }, any>;
695
+ HeaderShareIcon: import("../../../_mixins").Theme<"Icon", {
696
+ color: string;
697
+ opacity1Depth: string;
698
+ opacity2Depth: string;
699
+ opacity3Depth: string;
700
+ opacity4Depth: string;
701
+ opacity5Depth: string;
702
+ }, any>;
703
+ HeaderProfileIcon: import("../../../_mixins").Theme<"Icon", {
704
+ color: string;
705
+ opacity1Depth: string;
706
+ opacity2Depth: string;
707
+ opacity3Depth: string;
708
+ opacity4Depth: string;
709
+ opacity5Depth: string;
710
+ }, any>;
678
711
  };
679
712
  peerOverrides: {
680
713
  Input?: {
@@ -894,17 +927,37 @@ declare const _default: import("vue").DefineComponent<{}, {
894
927
  [x: string]: any;
895
928
  } | undefined;
896
929
  } | undefined;
897
- Icon?: {
930
+ List?: {
898
931
  peers?: {
899
932
  [x: string]: any;
900
933
  } | undefined;
901
934
  } | undefined;
902
- List?: {
935
+ Typography?: {
903
936
  peers?: {
904
937
  [x: string]: any;
905
938
  } | undefined;
906
939
  } | undefined;
907
- Typography?: {
940
+ StatusIcon?: {
941
+ peers?: {
942
+ [x: string]: any;
943
+ } | undefined;
944
+ } | undefined;
945
+ FooterAttachIcon?: {
946
+ peers?: {
947
+ [x: string]: any;
948
+ } | undefined;
949
+ } | undefined;
950
+ FooterSuffixIcon?: {
951
+ peers?: {
952
+ [x: string]: any;
953
+ } | undefined;
954
+ } | undefined;
955
+ HeaderShareIcon?: {
956
+ peers?: {
957
+ [x: string]: any;
958
+ } | undefined;
959
+ } | undefined;
960
+ HeaderProfileIcon?: {
908
961
  peers?: {
909
962
  [x: string]: any;
910
963
  } | undefined;
@@ -25,6 +25,11 @@ export declare enum ChatMarkType {
25
25
  EVENT = "event",
26
26
  DIVIDER = "divider"
27
27
  }
28
+ export declare enum ChatBubbleActionKey {
29
+ EDIT = "edit",
30
+ COPY = "copy",
31
+ DELETE = "delete"
32
+ }
28
33
  export type ChatId = string | number | symbol;
29
34
  export interface ChatListItemData {
30
35
  id: ChatId;
@@ -150,6 +155,7 @@ export interface ChatProps {
150
155
  footerUploadProps?: Partial<UploadProps>;
151
156
  footerUploadTriggerProps?: any;
152
157
  footerIconProps?: Partial<IconProps>;
158
+ footerSuffixIconProps?: Partial<IconProps>;
153
159
  emptyProps?: Partial<EmptyProps>;
154
160
  retryText?: string;
155
161
  typingText?: string;
@@ -164,6 +170,7 @@ export interface ChatProps {
164
170
  onChatSelect?: OnChatSelect;
165
171
  onMessageSend?: OnMessageSend;
166
172
  onMessageRetry?: (message: ChatMessageData) => void;
173
+ bubbleActions?: ChatBubbleAction[];
167
174
  onAttachmentUpload?: OnAttachmentUpload;
168
175
  onAttachmentDownload?: OnAttachmentDownload;
169
176
  onFilterChange?: OnFilterChange;
@@ -190,6 +197,7 @@ export interface ChatSlots {
190
197
  messageAttachment?: (message: ChatMessageData) => VNodeChild;
191
198
  messageAttachmentTitle?: (file: any) => VNodeChild;
192
199
  messageAttachmentSubtitle?: (file: any) => VNodeChild;
200
+ bubbleActions?: (message: ChatMessageData) => VNodeChild;
193
201
  }
194
202
  export interface ChatListItemSlots {
195
203
  avatar?: () => VNodeChild;
@@ -203,6 +211,12 @@ export interface ChatMessageSlots {
203
211
  timestamp?: () => VNodeChild;
204
212
  status?: () => VNodeChild;
205
213
  }
214
+ export interface ChatBubbleAction {
215
+ key: ChatBubbleActionKey | string;
216
+ label: string | (() => VNodeChild);
217
+ handler: (message: ChatMessageData) => void;
218
+ visible?: (message: ChatMessageData) => boolean;
219
+ }
206
220
  export interface ChatListHeaderProps {
207
221
  title?: string | (() => VNodeChild);
208
222
  actions?: Array<() => VNodeChild>;
@@ -282,6 +296,7 @@ export declare const chatInjectionKey: InjectionKey<{
282
296
  footerUploadPropsRef: Ref<Partial<UploadProps> | undefined>;
283
297
  footerUploadTriggerPropsRef: Ref<Record<string, any> | undefined>;
284
298
  footerIconPropsRef: Ref<Partial<IconProps> | undefined>;
299
+ footerSuffixIconPropsRef: Ref<Partial<IconProps> | undefined>;
285
300
  inputPlaceholderRef: Ref<string>;
286
301
  retryTextRef: Ref<string>;
287
302
  typingTextRef: Ref<string>;
@@ -295,6 +310,9 @@ export declare const chatInjectionKey: InjectionKey<{
295
310
  handleChatSelect: (chatId: ChatId) => void;
296
311
  handleMessageSend: (content: string, attachments?: ChatAttachment[]) => void;
297
312
  handleMessageRetry: (message: ChatMessageData) => void;
313
+ startEditingMessage?: Ref<((message: ChatMessageData) => void) | undefined>;
314
+ editMessageIdRef?: Ref<ChatId | null>;
315
+ bubbleActionsRef?: Ref<ChatBubbleAction[] | undefined>;
298
316
  handleFooterInputChange: (value: string, chatId: ChatId) => void;
299
317
  markMessagesAsRead?: (chatId: ChatId) => void;
300
318
  handleFilterChange: (filter: {
@@ -19,4 +19,10 @@ export var ChatMarkType;
19
19
  ChatMarkType["EVENT"] = "event";
20
20
  ChatMarkType["DIVIDER"] = "divider";
21
21
  })(ChatMarkType || (ChatMarkType = {}));
22
+ export var ChatBubbleActionKey;
23
+ (function (ChatBubbleActionKey) {
24
+ ChatBubbleActionKey["EDIT"] = "edit";
25
+ ChatBubbleActionKey["COPY"] = "copy";
26
+ ChatBubbleActionKey["DELETE"] = "delete";
27
+ })(ChatBubbleActionKey || (ChatBubbleActionKey = {}));
22
28
  export const chatInjectionKey = createInjectionKey('chat');