yx-web-sdk 0.0.18 → 0.0.19

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 (51) hide show
  1. package/dist/ait-person-popover/index.js +1 -1
  2. package/dist/chat-card/index.js +1 -1
  3. package/dist/chat-content/index.js +1 -1
  4. package/dist/chat-page/index.js +1 -1
  5. package/dist/chat-room/index.js +1 -1
  6. package/dist/common-avatar/index.js +1 -1
  7. package/dist/components/chat-card/index.vue.d.ts +2 -0
  8. package/dist/index/style4.css +7 -1
  9. package/dist/index/style7.css +68 -68
  10. package/dist/{index-C14AY1pk.mjs → index-BjIqS2ZC.mjs} +7 -6
  11. package/dist/{index-sJcDnl5D.mjs → index-D5gp5t2F.mjs} +1 -1
  12. package/dist/{index-0o2Mn1Jl.mjs → index-DHnPD8u9.mjs} +1 -1
  13. package/dist/index-entry/index.js +5 -5
  14. package/dist/index-entry/style.css +19 -19
  15. package/dist/{index.vue_vue_type_script_setup_true_lang-0YeDxfed.mjs → index.vue_vue_type_script_setup_true_lang-CkWszgC3.mjs} +2 -2
  16. package/dist/{index.vue_vue_type_style_index_0_lang-BdIDeEyF.mjs → index.vue_vue_type_style_index_0_lang-5DeqmRdw.mjs} +24 -7
  17. package/dist/{index.vue_vue_type_style_index_0_lang-BxxUcry3.mjs → index.vue_vue_type_style_index_0_lang-C-imP01W.mjs} +3 -3
  18. package/dist/{index.vue_vue_type_style_index_0_lang-oO4NDv0U.mjs → index.vue_vue_type_style_index_0_lang-CA27kCm1.mjs} +218 -166
  19. package/dist/{index.vue_vue_type_style_index_0_lang-UfvEW_0n.mjs → index.vue_vue_type_style_index_0_lang-CAZ44kgX.mjs} +104 -50
  20. package/dist/members-sidebar/index.js +1 -1
  21. package/dist/server-channel-sidebar/index.js +1 -1
  22. package/dist/stores/channel.d.ts +32 -12
  23. package/dist/stores/qchat.d.ts +3 -3
  24. package/dist/stores/sdk.d.ts +0 -8
  25. package/dist/stores/server.d.ts +26 -26
  26. package/dist/style.css +94 -88
  27. package/dist/types/qchat-server.d.ts +1 -1
  28. package/dist/yx-web-sdk.es.js +349 -225
  29. package/dist/yx-web-sdk.umd.js +348 -224
  30. package/package.json +1 -1
  31. package/dist/ait-person-popover/index.d.ts +0 -3
  32. package/dist/ait-person-popover/index.vue.d.ts +0 -39
  33. package/dist/chat-card/index.d.ts +0 -3
  34. package/dist/chat-card/index.vue.d.ts +0 -25
  35. package/dist/chat-content/index.d.ts +0 -3
  36. package/dist/chat-content/index.vue.d.ts +0 -51
  37. package/dist/chat-page/index.d.ts +0 -3
  38. package/dist/chat-page/index.vue.d.ts +0 -6
  39. package/dist/chat-room/index.d.ts +0 -3
  40. package/dist/chat-room/index.vue.d.ts +0 -9
  41. package/dist/common-avatar/index.d.ts +0 -3
  42. package/dist/common-avatar/index.vue.d.ts +0 -17
  43. package/dist/icon-font/index.d.ts +0 -48
  44. package/dist/index-entry/index.d.ts +0 -2
  45. package/dist/index-entry/index.vue.d.ts +0 -24
  46. package/dist/members-sidebar/index.d.ts +0 -3
  47. package/dist/members-sidebar/index.vue.d.ts +0 -4
  48. package/dist/notice-box/index.d.ts +0 -3
  49. package/dist/notice-box/index.vue.d.ts +0 -13
  50. package/dist/server-channel-sidebar/index.d.ts +0 -3
  51. package/dist/server-channel-sidebar/index.vue.d.ts +0 -21
@@ -1,38 +1,38 @@
1
- .qchat-container[data-v-40788bbc] {
1
+ .qchat-container[data-v-240f366f] {
2
2
  display: flex;
3
3
  height: 100%;
4
4
  width: 100%;
5
5
  color: var(--theme-text);
6
6
  font-family: "Whitney", "Helvetica Neue", Helvetica, Arial, sans-serif;
7
7
  }
8
- .loading-wrap[data-v-40788bbc],
9
- .error-wrap[data-v-40788bbc],
10
- .init-wrap[data-v-40788bbc] {
8
+ .loading-wrap[data-v-240f366f],
9
+ .error-wrap[data-v-240f366f],
10
+ .init-wrap[data-v-240f366f] {
11
11
  display: flex;
12
12
  align-items: center;
13
13
  justify-content: center;
14
14
  width: 100%;
15
15
  height: 100%;
16
16
  }
17
- .loading-wrap[data-v-40788bbc] .ant-spin-text,
18
- .error-wrap[data-v-40788bbc] .ant-spin-text,
19
- .init-wrap[data-v-40788bbc] .ant-spin-text {
17
+ .loading-wrap[data-v-240f366f] .ant-spin-text,
18
+ .error-wrap[data-v-240f366f] .ant-spin-text,
19
+ .init-wrap[data-v-240f366f] .ant-spin-text {
20
20
  color: #dcddde;
21
21
  }
22
- .loading-wrap[data-v-40788bbc] .ant-result-title,
23
- .loading-wrap[data-v-40788bbc] .ant-result-subtitle,
24
- .error-wrap[data-v-40788bbc] .ant-result-title,
25
- .error-wrap[data-v-40788bbc] .ant-result-subtitle,
26
- .init-wrap[data-v-40788bbc] .ant-result-title,
27
- .init-wrap[data-v-40788bbc] .ant-result-subtitle {
22
+ .loading-wrap[data-v-240f366f] .ant-result-title,
23
+ .loading-wrap[data-v-240f366f] .ant-result-subtitle,
24
+ .error-wrap[data-v-240f366f] .ant-result-title,
25
+ .error-wrap[data-v-240f366f] .ant-result-subtitle,
26
+ .init-wrap[data-v-240f366f] .ant-result-title,
27
+ .init-wrap[data-v-240f366f] .ant-result-subtitle {
28
28
  color: #dcddde;
29
29
  }
30
- .loading-wrap[data-v-40788bbc] .ant-empty-description,
31
- .error-wrap[data-v-40788bbc] .ant-empty-description,
32
- .init-wrap[data-v-40788bbc] .ant-empty-description {
30
+ .loading-wrap[data-v-240f366f] .ant-empty-description,
31
+ .error-wrap[data-v-240f366f] .ant-empty-description,
32
+ .init-wrap[data-v-240f366f] .ant-empty-description {
33
33
  color: #72767d;
34
34
  }
35
- .chat-main[data-v-40788bbc] {
35
+ .chat-main[data-v-240f366f] {
36
36
  flex: 1;
37
37
  display: flex;
38
38
  flex-direction: column;
@@ -40,12 +40,12 @@
40
40
  overflow: hidden;
41
41
  min-width: 300px;
42
42
  }
43
- .chat-main .no-channel[data-v-40788bbc] {
43
+ .chat-main .no-channel[data-v-240f366f] {
44
44
  display: flex;
45
45
  align-items: center;
46
46
  justify-content: center;
47
47
  height: 100%;
48
48
  }
49
- .chat-main .no-channel[data-v-40788bbc] .ant-empty-description {
49
+ .chat-main .no-channel[data-v-240f366f] .ant-empty-description {
50
50
  color: #72767d;
51
51
  }
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, ref, computed, watch, openBlock, createBlock, createElementBlock } from "vue";
2
- import { _ as _sfc_main$1 } from "./index.vue_vue_type_style_index_0_lang-BdIDeEyF.mjs";
3
- import { b as useChannelStore, a as useServerStore, c as useUserStore } from "./index.vue_vue_type_style_index_0_lang-UfvEW_0n.mjs";
2
+ import { _ as _sfc_main$1 } from "./index.vue_vue_type_style_index_0_lang-5DeqmRdw.mjs";
3
+ import { b as useChannelStore, a as useServerStore, c as useUserStore } from "./index.vue_vue_type_style_index_0_lang-CAZ44kgX.mjs";
4
4
  const _hoisted_1 = { key: 1 };
5
5
  const HISTORY_LIMIT = 100;
6
6
  const _sfc_main = /* @__PURE__ */ defineComponent({
@@ -1,10 +1,10 @@
1
1
  import { ref, computed, watch, nextTick, defineComponent, openBlock, createElementBlock, createElementVNode, normalizeStyle, unref, normalizeClass, createBlock, createCommentVNode, createVNode, Fragment, renderList, toDisplayString, withCtx } from "vue";
2
2
  import { useRouter } from "vue-router";
3
3
  import { Input, Image, Popover, Button, Upload, message } from "ant-design-vue";
4
- import { A as AitPersonPopover } from "./index-sJcDnl5D.mjs";
5
- import { L as LoadingOutlined, _ as _sfc_main$2 } from "./index.vue_vue_type_style_index_0_lang-oO4NDv0U.mjs";
4
+ import { A as AitPersonPopover } from "./index-D5gp5t2F.mjs";
5
+ import { L as LoadingOutlined, _ as _sfc_main$2 } from "./index.vue_vue_type_style_index_0_lang-CA27kCm1.mjs";
6
6
  import { _ as _sfc_main$1 } from "./index.vue_vue_type_style_index_0_lang-B2YRkoln.mjs";
7
- import { a as useServerStore, g as getServerMembersByAccids, b as useChannelStore, e as getImageMsgDisplaySize, f as filterStr, i as isLt } from "./index.vue_vue_type_style_index_0_lang-UfvEW_0n.mjs";
7
+ import { a as useServerStore, g as getServerMembersByAccids, b as useChannelStore, e as getImageMsgDisplaySize, f as filterStr, i as isLt } from "./index.vue_vue_type_style_index_0_lang-CAZ44kgX.mjs";
8
8
  import { useEventListener, useDebounceFn } from "@vueuse/core";
9
9
  import { C as CloseOutlined } from "./CloseOutlined-BEcmJaCc.mjs";
10
10
  const MENTION_TAG_REG = /@[^@]+\s/g;
@@ -546,6 +546,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
546
546
  }
547
547
  });
548
548
  };
549
+ const handleRevokeMessage = (msg) => {
550
+ channelStore.revokeMessage({
551
+ ps: "撤回了一条消息",
552
+ message: msg
553
+ });
554
+ };
549
555
  const handleDeleteQuoteMsg = () => {
550
556
  quoteMsg.value = void 0;
551
557
  };
@@ -580,11 +586,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
580
586
  }
581
587
  }
582
588
  );
589
+ const inputMap = /* @__PURE__ */ new Map();
583
590
  watch(
584
591
  () => channelStore.currentChannel,
585
- () => {
586
- curText.value = "";
587
- quoteMsg.value = void 0;
592
+ (value, oldValue) => {
593
+ if (oldValue == null ? void 0 : oldValue.channelId) {
594
+ inputMap.set(oldValue == null ? void 0 : oldValue.channelId, { input: curText.value, quoteMsg: quoteMsg.value });
595
+ }
596
+ if ((value == null ? void 0 : value.channelId) && inputMap.has((value == null ? void 0 : value.channelId) || "")) {
597
+ const mapValue = inputMap.get((value == null ? void 0 : value.channelId) || "");
598
+ curText.value = (mapValue == null ? void 0 : mapValue.input) || "";
599
+ quoteMsg.value = mapValue == null ? void 0 : mapValue.quoteMsg;
600
+ } else {
601
+ curText.value = "";
602
+ quoteMsg.value = void 0;
603
+ }
588
604
  }
589
605
  );
590
606
  const inputPlaceholder = computed(
@@ -882,7 +898,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
882
898
  onResendFile: handleResendFile,
883
899
  onContextMenuSwitch,
884
900
  onQuote: handleQuote,
885
- onQuoteMsgClick: handleQuoteMsgClick
901
+ onQuoteMsgClick: handleQuoteMsgClick,
902
+ onRevokeMessage: handleRevokeMessage
886
903
  }, null, 8, ["msg", "my-avatar", "my-accid"]);
887
904
  }), 128))
888
905
  ])) : (openBlock(), createElementBlock("div", {
@@ -1,10 +1,10 @@
1
1
  import { defineComponent, ref, h, watch, computed, openBlock, createElementBlock, createElementVNode, toDisplayString, createCommentVNode, createVNode } from "vue";
2
2
  import { List, Typography } from "ant-design-vue";
3
- import { _ as _sfc_main$1 } from "./index.vue_vue_type_script_setup_true_lang-0YeDxfed.mjs";
4
- import { a as useServerStore, b as useChannelStore } from "./index.vue_vue_type_style_index_0_lang-UfvEW_0n.mjs";
3
+ import { _ as _sfc_main$1 } from "./index.vue_vue_type_script_setup_true_lang-CkWszgC3.mjs";
4
+ import { a as useServerStore, b as useChannelStore } from "./index.vue_vue_type_style_index_0_lang-CAZ44kgX.mjs";
5
5
  import "./index-L_drmZir.mjs";
6
6
  import { useLocalStorage } from "@vueuse/core";
7
- import { L as LoadingOutlined } from "./index.vue_vue_type_style_index_0_lang-oO4NDv0U.mjs";
7
+ import { L as LoadingOutlined } from "./index.vue_vue_type_style_index_0_lang-CA27kCm1.mjs";
8
8
  const _hoisted_1 = { class: "yx-chat-page-container" };
9
9
  const _hoisted_2 = { class: "header-wrap" };
10
10
  const _hoisted_3 = { class: "left" };
@@ -1,7 +1,7 @@
1
- import { createVNode, defineComponent, ref, watch, nextTick, onBeforeUnmount, computed, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, withModifiers, createBlock, unref, withCtx, createCommentVNode, withDirectives, normalizeStyle, vShow } from "vue";
1
+ import { createVNode, defineComponent, ref, onBeforeUnmount, computed, watch, nextTick, openBlock, createElementBlock, normalizeClass, toDisplayString, Fragment, createElementVNode, withModifiers, createBlock, unref, withCtx, createCommentVNode, withDirectives, normalizeStyle, vShow } from "vue";
2
2
  import { useClipboard, useEventListener } from "@vueuse/core";
3
3
  import { Image, Button, message } from "ant-design-vue";
4
- import { a as useServerStore, p as parseFileSize, m as matchExt, e as getImageMsgDisplaySize, _ as _sfc_main$1 } from "./index.vue_vue_type_style_index_0_lang-UfvEW_0n.mjs";
4
+ import { a as useServerStore, p as parseFileSize, m as matchExt, e as getImageMsgDisplaySize, _ as _sfc_main$1 } from "./index.vue_vue_type_style_index_0_lang-CAZ44kgX.mjs";
5
5
  import { F as FileIconFont } from "./index-L_drmZir.mjs";
6
6
  import dayjs from "dayjs";
7
7
  import { I as Icon } from "./AntdIcon-DdvEPKFJ.mjs";
@@ -102,25 +102,30 @@ var LoadingOutlined = function LoadingOutlined2(props, context) {
102
102
  LoadingOutlined.displayName = "LoadingOutlined";
103
103
  LoadingOutlined.inheritAttrs = false;
104
104
  const _hoisted_1 = ["data-msg-id-client"];
105
- const _hoisted_2 = { class: "chatCardAvatar" };
106
- const _hoisted_3 = { class: "chatCardContent" };
107
- const _hoisted_4 = { class: "chatCardInfo" };
108
- const _hoisted_5 = { class: "chatCardInfoName" };
109
- const _hoisted_6 = { class: "chatCardInfoTime" };
110
- const _hoisted_7 = ["innerHTML"];
111
- const _hoisted_8 = ["href"];
112
- const _hoisted_9 = { class: "fileMsgContent" };
113
- const _hoisted_10 = { class: "fileMsgName" };
114
- const _hoisted_11 = { class: "fileMsgSize" };
115
- const _hoisted_12 = { class: "ant-image-mask-info" };
116
- const _hoisted_13 = {
105
+ const _hoisted_2 = {
106
+ key: 0,
107
+ class: "chat-withdraw-msg"
108
+ };
109
+ const _hoisted_3 = { class: "chatCardAvatar" };
110
+ const _hoisted_4 = { class: "chatCardContent" };
111
+ const _hoisted_5 = { class: "chatCardInfo" };
112
+ const _hoisted_6 = { class: "chatCardInfoName" };
113
+ const _hoisted_7 = { class: "chatCardInfoTime" };
114
+ const _hoisted_8 = ["innerHTML"];
115
+ const _hoisted_9 = ["href"];
116
+ const _hoisted_10 = { class: "fileMsgContent" };
117
+ const _hoisted_11 = { class: "fileMsgName" };
118
+ const _hoisted_12 = { class: "fileMsgSize" };
119
+ const _hoisted_13 = { class: "ant-image-mask-info" };
120
+ const _hoisted_14 = {
117
121
  key: 4,
118
122
  class: "chatCardMainContent"
119
123
  };
120
- const _hoisted_14 = { class: "chatCardQuoteMsgName" };
121
- const _hoisted_15 = ["innerHTML"];
122
- const _hoisted_16 = { class: "ant-image-mask-info" };
123
- const _hoisted_17 = { class: "chatCardStatus" };
124
+ const _hoisted_15 = { class: "chatCardQuoteMsgName" };
125
+ const _hoisted_16 = ["innerHTML"];
126
+ const _hoisted_17 = { class: "ant-image-mask-info" };
127
+ const _hoisted_18 = { class: "chatCardStatus" };
128
+ const REVOCATION_INTERVAL = 120 * 1e3;
124
129
  const _sfc_main = /* @__PURE__ */ defineComponent({
125
130
  ...{
126
131
  name: "ChatCard"
@@ -130,10 +135,30 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
130
135
  msg: {},
131
136
  myAccid: { default: "" }
132
137
  },
133
- emits: ["resendText", "resendImg", "resendFile", "quote", "contextMenuSwitch", "quoteMsgClick"],
138
+ emits: ["resendText", "resendImg", "resendFile", "quote", "contextMenuSwitch", "quoteMsgClick", "revokeMessage"],
134
139
  setup(__props, { emit: __emit }) {
135
140
  const serverStore = useServerStore();
136
141
  const props = __props;
142
+ const nowTime = ref(Date.now());
143
+ let timer = null;
144
+ timer = setInterval(() => {
145
+ nowTime.value = Date.now();
146
+ if (nowTime.value - props.msg.time > REVOCATION_INTERVAL) {
147
+ if (timer) {
148
+ clearInterval(timer);
149
+ timer = null;
150
+ }
151
+ }
152
+ }, 1e3);
153
+ onBeforeUnmount(() => {
154
+ if (timer) {
155
+ clearInterval(timer);
156
+ timer = null;
157
+ }
158
+ });
159
+ const isRevocation = computed(() => {
160
+ return props.msg.fromAccount === props.myAccid && nowTime.value - props.msg.time <= REVOCATION_INTERVAL;
161
+ });
137
162
  const { copy } = useClipboard();
138
163
  const emit = __emit;
139
164
  const textMsgContextMenuVisible = ref(false);
@@ -146,13 +171,25 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
146
171
  textMsgContextMenuVisible.value = true;
147
172
  }
148
173
  function onCopyClick() {
149
- copy(props.msg.body).then(() => {
150
- }).catch((err) => {
151
- console.error("copy error: ", err);
152
- message.error("复制失败");
153
- }).finally(() => {
154
- textMsgContextMenuVisible.value = false;
155
- });
174
+ var _a;
175
+ if (props.msg.type === "text") {
176
+ copy(props.msg.body).then(() => {
177
+ }).catch((err) => {
178
+ console.error("copy error: ", err);
179
+ message.error("复制失败");
180
+ }).finally(() => {
181
+ textMsgContextMenuVisible.value = false;
182
+ });
183
+ }
184
+ if (props.msg.type === "image") {
185
+ copy((_a = props.msg.attach) == null ? void 0 : _a.url).then(() => {
186
+ }).catch((err) => {
187
+ console.error("copy error: ", err);
188
+ message.error("复制失败");
189
+ }).finally(() => {
190
+ textMsgContextMenuVisible.value = false;
191
+ });
192
+ }
156
193
  }
157
194
  function onQuoteClick() {
158
195
  var _a;
@@ -171,6 +208,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
171
208
  emit("quote", msg);
172
209
  textMsgContextMenuVisible.value = false;
173
210
  }
211
+ const onRevocationClick = () => {
212
+ textMsgContextMenuVisible.value = false;
213
+ if (!isRevocation.value) {
214
+ message.error("消息已超过撤回时间");
215
+ return;
216
+ }
217
+ emit("revokeMessage", props.msg);
218
+ };
174
219
  function onQuoteMsgClick() {
175
220
  var _a;
176
221
  emit("quoteMsgClick", (_a = msgExt.value) == null ? void 0 : _a.quoteMsg);
@@ -276,159 +321,161 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
276
321
  }
277
322
  };
278
323
  return (_ctx, _cache) => {
279
- var _a, _b, _c, _d, _e, _f, _g, _h;
324
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
280
325
  return openBlock(), createElementBlock("div", {
281
326
  class: normalizeClass(["yx-chatCardWrapper", { reverse: __props.msg.fromAccount === __props.myAccid }]),
282
327
  "data-msg-id-client": __props.msg.msgIdClient
283
328
  }, [
284
- createElementVNode("div", _hoisted_2, [
285
- createVNode(_sfc_main$1, {
286
- avatar: myAvatar.value,
287
- nick: __props.msg.fromNick,
288
- accid: __props.msg.fromAccount,
289
- width: 32,
290
- border: 0,
291
- style: { "min-width": "32px" }
292
- }, null, 8, ["avatar", "nick", "accid"])
293
- ]),
294
- createElementVNode("div", _hoisted_3, [
295
- createElementVNode("div", null, [
296
- createElementVNode("div", _hoisted_4, [
297
- createElementVNode("span", _hoisted_5, toDisplayString(__props.msg.fromNick), 1),
298
- createElementVNode("span", _hoisted_6, toDisplayString(time.value), 1)
299
- ]),
300
- __props.msg.type === "text" ? (openBlock(), createElementBlock("div", {
301
- key: 0,
302
- class: normalizeClass(["chatCardMainContent", { myMsg: __props.msg.fromAccount === __props.myAccid, otherMsg: __props.msg.fromAccount !== __props.myAccid }])
303
- }, [
304
- createElementVNode("div", {
305
- class: "textMsg flash-target",
306
- onContextmenu: withModifiers(onTextMsgContextMenu, ["prevent"]),
307
- innerHTML: textMsgBody.value
308
- }, null, 40, _hoisted_7)
309
- ], 2)) : __props.msg.type === "file" ? (openBlock(), createElementBlock("div", {
310
- key: 1,
311
- class: normalizeClass(["chatCardMainContent", { myMsg: __props.msg.fromAccount === __props.myAccid, otherMsg: __props.msg.fromAccount !== __props.myAccid }])
312
- }, [
313
- createElementVNode("a", {
314
- class: "fileMsg",
315
- target: "_blank",
316
- href: (_b = (_a = __props.msg) == null ? void 0 : _a.attach) == null ? void 0 : _b.url
329
+ ((_a = __props.msg.updateOperatorInfo) == null ? void 0 : _a.ps) ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(__props.msg.fromAccount === __props.myAccid ? "你" : `“${__props.msg.fromNick}”`) + " " + toDisplayString((_b = __props.msg.updateOperatorInfo) == null ? void 0 : _b.ps), 1)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
330
+ createElementVNode("div", _hoisted_3, [
331
+ createVNode(_sfc_main$1, {
332
+ avatar: myAvatar.value,
333
+ nick: __props.msg.fromNick,
334
+ accid: __props.msg.fromAccount,
335
+ width: 32,
336
+ border: 0,
337
+ style: { "min-width": "32px" }
338
+ }, null, 8, ["avatar", "nick", "accid"])
339
+ ]),
340
+ createElementVNode("div", _hoisted_4, [
341
+ createElementVNode("div", null, [
342
+ createElementVNode("div", _hoisted_5, [
343
+ createElementVNode("span", _hoisted_6, toDisplayString(__props.msg.fromNick), 1),
344
+ createElementVNode("span", _hoisted_7, toDisplayString(time.value), 1)
345
+ ]),
346
+ __props.msg.type === "text" ? (openBlock(), createElementBlock("div", {
347
+ key: 0,
348
+ class: normalizeClass(["chatCardMainContent", { myMsg: __props.msg.fromAccount === __props.myAccid, otherMsg: __props.msg.fromAccount !== __props.myAccid }])
317
349
  }, [
318
- ext.value === "pdf" ? (openBlock(), createBlock(unref(FileIconFont), {
319
- key: 0,
320
- type: "icon-PDF",
321
- style: { "font-size": "40px" }
322
- })) : ext.value === "word" ? (openBlock(), createBlock(unref(FileIconFont), {
323
- key: 1,
324
- type: "icon-Word",
325
- style: { "font-size": "40px" }
326
- })) : ext.value === "excel" ? (openBlock(), createBlock(unref(FileIconFont), {
327
- key: 2,
328
- type: "icon-Excel",
329
- style: { "font-size": "40px" }
330
- })) : ext.value === "ppt" ? (openBlock(), createBlock(unref(FileIconFont), {
331
- key: 3,
332
- type: "icon-PPT",
333
- style: { "font-size": "40px" }
334
- })) : ext.value === "zip" ? (openBlock(), createBlock(unref(FileIconFont), {
335
- key: 4,
336
- type: "icon-RAR1",
337
- style: { "font-size": "40px" }
338
- })) : ext.value === "video" ? (openBlock(), createBlock(unref(FileIconFont), {
339
- key: 5,
340
- type: "icon-shipin",
341
- style: { "font-size": "40px" }
342
- })) : ext.value === "audio" ? (openBlock(), createBlock(unref(FileIconFont), {
343
- key: 6,
344
- type: "icon-yinle",
345
- style: { "font-size": "40px" }
346
- })) : ext.value === "img" ? (openBlock(), createBlock(unref(FileIconFont), {
347
- key: 7,
348
- type: "icon-tupian2",
349
- style: { "font-size": "40px" }
350
- })) : ext.value === "txt" ? (openBlock(), createBlock(unref(FileIconFont), {
351
- key: 8,
352
- type: "icon-qita",
353
- style: { "font-size": "40px" }
354
- })) : (openBlock(), createBlock(unref(FileIconFont), {
355
- key: 9,
356
- type: "icon-weizhiwenjian",
357
- style: { "font-size": "40px" }
358
- })),
359
- createElementVNode("div", _hoisted_9, [
360
- createElementVNode("div", _hoisted_10, toDisplayString((_d = (_c = __props.msg) == null ? void 0 : _c.attach) == null ? void 0 : _d.name), 1),
361
- createElementVNode("div", _hoisted_11, toDisplayString(size.value), 1)
362
- ])
363
- ], 8, _hoisted_8)
364
- ], 2)) : __props.msg.type === "image" ? (openBlock(), createElementBlock("div", {
365
- key: 2,
366
- class: normalizeClass(["chatCardMainContent flash-target", { myMsg: __props.msg.fromAccount === __props.myAccid, otherMsg: __props.msg.fromAccount !== __props.myAccid }]),
367
- onContextmenu: withModifiers(onTextMsgContextMenu, ["prevent"])
368
- }, [
369
- createVNode(unref(Image), {
370
- class: "imgMsg",
371
- src: (_f = (_e = __props.msg) == null ? void 0 : _e.attach) == null ? void 0 : _f.url,
372
- width: imageMsgSize.value.width,
373
- height: imageMsgSize.value.height
374
- }, {
375
- previewMask: withCtx(() => [
376
- createElementVNode("div", _hoisted_12, [
377
- createVNode(unref(EyeOutlined))
350
+ createElementVNode("div", {
351
+ class: "textMsg flash-target",
352
+ onContextmenu: withModifiers(onTextMsgContextMenu, ["prevent"]),
353
+ innerHTML: textMsgBody.value
354
+ }, null, 40, _hoisted_8)
355
+ ], 2)) : __props.msg.type === "file" ? (openBlock(), createElementBlock("div", {
356
+ key: 1,
357
+ class: normalizeClass(["chatCardMainContent", { myMsg: __props.msg.fromAccount === __props.myAccid, otherMsg: __props.msg.fromAccount !== __props.myAccid }])
358
+ }, [
359
+ createElementVNode("a", {
360
+ class: "fileMsg",
361
+ target: "_blank",
362
+ href: (_d = (_c = __props.msg) == null ? void 0 : _c.attach) == null ? void 0 : _d.url
363
+ }, [
364
+ ext.value === "pdf" ? (openBlock(), createBlock(unref(FileIconFont), {
365
+ key: 0,
366
+ type: "icon-PDF",
367
+ style: { "font-size": "40px" }
368
+ })) : ext.value === "word" ? (openBlock(), createBlock(unref(FileIconFont), {
369
+ key: 1,
370
+ type: "icon-Word",
371
+ style: { "font-size": "40px" }
372
+ })) : ext.value === "excel" ? (openBlock(), createBlock(unref(FileIconFont), {
373
+ key: 2,
374
+ type: "icon-Excel",
375
+ style: { "font-size": "40px" }
376
+ })) : ext.value === "ppt" ? (openBlock(), createBlock(unref(FileIconFont), {
377
+ key: 3,
378
+ type: "icon-PPT",
379
+ style: { "font-size": "40px" }
380
+ })) : ext.value === "zip" ? (openBlock(), createBlock(unref(FileIconFont), {
381
+ key: 4,
382
+ type: "icon-RAR1",
383
+ style: { "font-size": "40px" }
384
+ })) : ext.value === "video" ? (openBlock(), createBlock(unref(FileIconFont), {
385
+ key: 5,
386
+ type: "icon-shipin",
387
+ style: { "font-size": "40px" }
388
+ })) : ext.value === "audio" ? (openBlock(), createBlock(unref(FileIconFont), {
389
+ key: 6,
390
+ type: "icon-yinle",
391
+ style: { "font-size": "40px" }
392
+ })) : ext.value === "img" ? (openBlock(), createBlock(unref(FileIconFont), {
393
+ key: 7,
394
+ type: "icon-tupian2",
395
+ style: { "font-size": "40px" }
396
+ })) : ext.value === "txt" ? (openBlock(), createBlock(unref(FileIconFont), {
397
+ key: 8,
398
+ type: "icon-qita",
399
+ style: { "font-size": "40px" }
400
+ })) : (openBlock(), createBlock(unref(FileIconFont), {
401
+ key: 9,
402
+ type: "icon-weizhiwenjian",
403
+ style: { "font-size": "40px" }
404
+ })),
405
+ createElementVNode("div", _hoisted_10, [
406
+ createElementVNode("div", _hoisted_11, toDisplayString((_f = (_e = __props.msg) == null ? void 0 : _e.attach) == null ? void 0 : _f.name), 1),
407
+ createElementVNode("div", _hoisted_12, toDisplayString(size.value), 1)
378
408
  ])
379
- ]),
380
- _: 1
381
- }, 8, ["src", "width", "height"])
382
- ], 34)) : (openBlock(), createElementBlock("div", {
383
- key: 3,
384
- class: normalizeClass(["chatCardMainContent", { myMsg: __props.msg.fromAccount === __props.myAccid, otherMsg: __props.msg.fromAccount !== __props.myAccid }])
385
- }, [..._cache[1] || (_cache[1] = [
386
- createElementVNode("div", { class: "textMsg" }, toDisplayString("暂不支持该消息"), -1)
387
- ])], 2)),
388
- ((_g = msgExt.value) == null ? void 0 : _g.quoteMsg) ? (openBlock(), createElementBlock("div", _hoisted_13, [
389
- createElementVNode("div", {
390
- class: "chatCardQuoteMsg",
391
- onClick: onQuoteMsgClick
409
+ ], 8, _hoisted_9)
410
+ ], 2)) : __props.msg.type === "image" ? (openBlock(), createElementBlock("div", {
411
+ key: 2,
412
+ class: normalizeClass(["chatCardMainContent flash-target", { myMsg: __props.msg.fromAccount === __props.myAccid, otherMsg: __props.msg.fromAccount !== __props.myAccid }]),
413
+ onContextmenu: withModifiers(onTextMsgContextMenu, ["prevent"])
392
414
  }, [
393
- createElementVNode("div", _hoisted_14, toDisplayString(msgExt.value.quoteMsg.fromNick) + ":", 1),
394
- msgExt.value.quoteMsg.body ? (openBlock(), createElementBlock("div", {
395
- key: 0,
396
- class: "quoteMsgText",
397
- innerHTML: msgExt.value.quoteMsg.body
398
- }, null, 8, _hoisted_15)) : createCommentVNode("", true),
399
- msgExt.value.quoteMsg.type === "image" ? (openBlock(), createBlock(unref(Image), {
400
- key: 1,
401
- class: "imgMsg quoteMsgImg",
402
- src: (_h = msgExt.value.quoteMsg.attach) == null ? void 0 : _h.url,
403
- width: quoteImageMsgSize.value.width,
404
- height: quoteImageMsgSize.value.height,
405
- onClick: _cache[0] || (_cache[0] = withModifiers(() => {
406
- }, ["stop", "prevent"]))
415
+ createVNode(unref(Image), {
416
+ class: "imgMsg",
417
+ src: (_h = (_g = __props.msg) == null ? void 0 : _g.attach) == null ? void 0 : _h.url,
418
+ width: imageMsgSize.value.width,
419
+ height: imageMsgSize.value.height
407
420
  }, {
408
421
  previewMask: withCtx(() => [
409
- createElementVNode("div", _hoisted_16, [
422
+ createElementVNode("div", _hoisted_13, [
410
423
  createVNode(unref(EyeOutlined))
411
424
  ])
412
425
  ]),
413
426
  _: 1
414
- }, 8, ["src", "width", "height"])) : createCommentVNode("", true)
415
- ])
416
- ])) : createCommentVNode("", true)
417
- ]),
418
- createElementVNode("div", _hoisted_17, [
419
- __props.msg.deliveryStatus === "failed" ? (openBlock(), createBlock(unref(Button), {
420
- key: 0,
421
- type: "text",
422
- danger: "",
423
- onClick: resendHandler
424
- }, {
425
- icon: withCtx(() => [
426
- createVNode(unref(ExclamationCircleFilled))
427
- ]),
428
- _: 1
429
- })) : __props.msg.deliveryStatus === "sending" ? (openBlock(), createBlock(unref(LoadingOutlined), { key: 1 })) : createCommentVNode("", true)
427
+ }, 8, ["src", "width", "height"])
428
+ ], 34)) : (openBlock(), createElementBlock("div", {
429
+ key: 3,
430
+ class: normalizeClass(["chatCardMainContent", { myMsg: __props.msg.fromAccount === __props.myAccid, otherMsg: __props.msg.fromAccount !== __props.myAccid }])
431
+ }, [..._cache[1] || (_cache[1] = [
432
+ createElementVNode("div", { class: "textMsg" }, toDisplayString("暂不支持该消息"), -1)
433
+ ])], 2)),
434
+ ((_i = msgExt.value) == null ? void 0 : _i.quoteMsg) ? (openBlock(), createElementBlock("div", _hoisted_14, [
435
+ createElementVNode("div", {
436
+ class: "chatCardQuoteMsg",
437
+ onClick: onQuoteMsgClick
438
+ }, [
439
+ createElementVNode("div", _hoisted_15, toDisplayString(msgExt.value.quoteMsg.fromNick) + ":", 1),
440
+ msgExt.value.quoteMsg.body ? (openBlock(), createElementBlock("div", {
441
+ key: 0,
442
+ class: "quoteMsgText",
443
+ innerHTML: msgExt.value.quoteMsg.body
444
+ }, null, 8, _hoisted_16)) : createCommentVNode("", true),
445
+ msgExt.value.quoteMsg.type === "image" ? (openBlock(), createBlock(unref(Image), {
446
+ key: 1,
447
+ class: "imgMsg quoteMsgImg",
448
+ src: (_j = msgExt.value.quoteMsg.attach) == null ? void 0 : _j.url,
449
+ width: quoteImageMsgSize.value.width,
450
+ height: quoteImageMsgSize.value.height,
451
+ onClick: _cache[0] || (_cache[0] = withModifiers(() => {
452
+ }, ["stop", "prevent"]))
453
+ }, {
454
+ previewMask: withCtx(() => [
455
+ createElementVNode("div", _hoisted_17, [
456
+ createVNode(unref(EyeOutlined))
457
+ ])
458
+ ]),
459
+ _: 1
460
+ }, 8, ["src", "width", "height"])) : createCommentVNode("", true)
461
+ ])
462
+ ])) : createCommentVNode("", true)
463
+ ]),
464
+ createElementVNode("div", _hoisted_18, [
465
+ __props.msg.deliveryStatus === "failed" ? (openBlock(), createBlock(unref(Button), {
466
+ key: 0,
467
+ type: "text",
468
+ danger: "",
469
+ onClick: resendHandler
470
+ }, {
471
+ icon: withCtx(() => [
472
+ createVNode(unref(ExclamationCircleFilled))
473
+ ]),
474
+ _: 1
475
+ })) : __props.msg.deliveryStatus === "sending" ? (openBlock(), createBlock(unref(LoadingOutlined), { key: 1 })) : createCommentVNode("", true)
476
+ ])
430
477
  ])
431
- ]),
478
+ ], 64)),
432
479
  withDirectives(createElementVNode("div", {
433
480
  ref_key: "textMsgContextMenuRef",
434
481
  ref: textMsgContextMenuRef,
@@ -442,7 +489,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
442
489
  createElementVNode("div", {
443
490
  class: "yx-chatCardTextMsgContextMenu-item",
444
491
  onClick: onQuoteClick
445
- }, "引用")
492
+ }, "引用"),
493
+ isRevocation.value ? (openBlock(), createElementBlock("div", {
494
+ key: 0,
495
+ class: "yx-chatCardTextMsgContextMenu-item",
496
+ onClick: onRevocationClick
497
+ }, " 撤回 ")) : createCommentVNode("", true)
446
498
  ], 4), [
447
499
  [vShow, textMsgContextMenuVisible.value]
448
500
  ])