yx-web-sdk 0.0.18 → 0.0.20

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 (59) 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/components/img-info-wrapper/index.d.ts +0 -0
  9. package/dist/{chat-page → components/img-info-wrapper}/index.vue.d.ts +2 -2
  10. package/dist/img-info-wrapper/index.js +1 -0
  11. package/dist/index/style2.css +30 -162
  12. package/dist/index/style4.css +177 -120
  13. package/dist/index/style6.css +513 -25
  14. package/dist/index/style7.css +143 -466
  15. package/dist/{index-0o2Mn1Jl.mjs → index-BPnLB3av.mjs} +1 -1
  16. package/dist/{index-C14AY1pk.mjs → index-DME8_VYv.mjs} +7 -6
  17. package/dist/{index-sJcDnl5D.mjs → index-Dwglj7_M.mjs} +1 -1
  18. package/dist/index-entry/index.js +5 -5
  19. package/dist/index-entry/style.css +19 -19
  20. package/dist/{index.vue_vue_type_script_setup_true_lang-0YeDxfed.mjs → index.vue_vue_type_script_setup_true_lang-C18d9C8W.mjs} +9 -3
  21. package/dist/{index.vue_vue_type_style_index_0_lang-UfvEW_0n.mjs → index.vue_vue_type_style_index_0_lang-BaKNB-4q.mjs} +137 -57
  22. package/dist/index.vue_vue_type_style_index_0_lang-CBpDXwwP.mjs +589 -0
  23. package/dist/{index.vue_vue_type_style_index_0_lang-BxxUcry3.mjs → index.vue_vue_type_style_index_0_lang-E3PcX8MA.mjs} +3 -3
  24. package/dist/{index.vue_vue_type_style_index_0_lang-BdIDeEyF.mjs → index.vue_vue_type_style_index_0_lang-QCNj8WyS.mjs} +171 -40
  25. package/dist/members-sidebar/index.js +1 -1
  26. package/dist/notice-box/index.js +1 -1
  27. package/dist/server-channel-sidebar/index.js +1 -1
  28. package/dist/stores/channel.d.ts +50 -14
  29. package/dist/stores/qchat.d.ts +3 -3
  30. package/dist/stores/sdk.d.ts +0 -8
  31. package/dist/stores/server.d.ts +26 -26
  32. package/dist/style.css +180 -90
  33. package/dist/types/qchat-server.d.ts +1 -1
  34. package/dist/utils/index.d.ts +10 -2
  35. package/dist/yx-web-sdk.es.js +644 -296
  36. package/dist/yx-web-sdk.umd.js +643 -295
  37. package/package.json +1 -1
  38. package/dist/ait-person-popover/index.d.ts +0 -3
  39. package/dist/ait-person-popover/index.vue.d.ts +0 -39
  40. package/dist/chat-card/index.d.ts +0 -3
  41. package/dist/chat-card/index.vue.d.ts +0 -25
  42. package/dist/chat-content/index.d.ts +0 -3
  43. package/dist/chat-content/index.vue.d.ts +0 -51
  44. package/dist/chat-page/index.d.ts +0 -3
  45. package/dist/chat-room/index.d.ts +0 -3
  46. package/dist/chat-room/index.vue.d.ts +0 -9
  47. package/dist/common-avatar/index.d.ts +0 -3
  48. package/dist/common-avatar/index.vue.d.ts +0 -17
  49. package/dist/icon-font/index.d.ts +0 -48
  50. package/dist/index-entry/index.d.ts +0 -2
  51. package/dist/index-entry/index.vue.d.ts +0 -24
  52. package/dist/index.vue_vue_type_style_index_0_lang-oO4NDv0U.mjs +0 -456
  53. package/dist/members-sidebar/index.d.ts +0 -3
  54. package/dist/members-sidebar/index.vue.d.ts +0 -4
  55. package/dist/notice-box/index.d.ts +0 -3
  56. package/dist/notice-box/index.vue.d.ts +0 -13
  57. package/dist/server-channel-sidebar/index.d.ts +0 -3
  58. package/dist/server-channel-sidebar/index.vue.d.ts +0 -21
  59. /package/dist/{index.vue_vue_type_style_index_0_lang-B2YRkoln.mjs → index.vue_vue_type_style_index_0_lang-BxXBf_VA.mjs} +0 -0
@@ -0,0 +1,589 @@
1
+ import { createVNode, defineComponent, openBlock, createElementBlock, createElementVNode, toDisplayString, unref, ref, onBeforeUnmount, computed, watch, nextTick, normalizeClass, Fragment, withModifiers, createBlock, withCtx, createCommentVNode, withDirectives, normalizeStyle, vShow } from "vue";
2
+ import { useClipboard, useEventListener } from "@vueuse/core";
3
+ import { Image, Button, message } from "ant-design-vue";
4
+ import { h as getMByteSize, a as useServerStore, p as parseFileSize, m as matchExt, e as getImageMsgDisplaySize, _ as _sfc_main$2 } from "./index.vue_vue_type_style_index_0_lang-BaKNB-4q.mjs";
5
+ import { F as FileIconFont } from "./index-L_drmZir.mjs";
6
+ import dayjs from "dayjs";
7
+ import { I as Icon } from "./AntdIcon-DdvEPKFJ.mjs";
8
+ var ExclamationCircleFilled$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-32 232c0-4.4 3.6-8 8-8h48c4.4 0 8 3.6 8 8v272c0 4.4-3.6 8-8 8h-48c-4.4 0-8-3.6-8-8V296zm32 440a48.01 48.01 0 010-96 48.01 48.01 0 010 96z" } }] }, "name": "exclamation-circle", "theme": "filled" };
9
+ function _objectSpread$2(target) {
10
+ for (var i = 1; i < arguments.length; i++) {
11
+ var source = arguments[i] != null ? Object(arguments[i]) : {};
12
+ var ownKeys = Object.keys(source);
13
+ if (typeof Object.getOwnPropertySymbols === "function") {
14
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
15
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
16
+ }));
17
+ }
18
+ ownKeys.forEach(function(key) {
19
+ _defineProperty$2(target, key, source[key]);
20
+ });
21
+ }
22
+ return target;
23
+ }
24
+ function _defineProperty$2(obj, key, value) {
25
+ if (key in obj) {
26
+ Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
27
+ } else {
28
+ obj[key] = value;
29
+ }
30
+ return obj;
31
+ }
32
+ var ExclamationCircleFilled = function ExclamationCircleFilled2(props, context) {
33
+ var p = _objectSpread$2({}, props, context.attrs);
34
+ return createVNode(Icon, _objectSpread$2({}, p, {
35
+ "icon": ExclamationCircleFilled$1
36
+ }), null);
37
+ };
38
+ ExclamationCircleFilled.displayName = "ExclamationCircleFilled";
39
+ ExclamationCircleFilled.inheritAttrs = false;
40
+ var EyeOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z" } }] }, "name": "eye", "theme": "outlined" };
41
+ function _objectSpread$1(target) {
42
+ for (var i = 1; i < arguments.length; i++) {
43
+ var source = arguments[i] != null ? Object(arguments[i]) : {};
44
+ var ownKeys = Object.keys(source);
45
+ if (typeof Object.getOwnPropertySymbols === "function") {
46
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
47
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
48
+ }));
49
+ }
50
+ ownKeys.forEach(function(key) {
51
+ _defineProperty$1(target, key, source[key]);
52
+ });
53
+ }
54
+ return target;
55
+ }
56
+ function _defineProperty$1(obj, key, value) {
57
+ if (key in obj) {
58
+ Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
59
+ } else {
60
+ obj[key] = value;
61
+ }
62
+ return obj;
63
+ }
64
+ var EyeOutlined = function EyeOutlined2(props, context) {
65
+ var p = _objectSpread$1({}, props, context.attrs);
66
+ return createVNode(Icon, _objectSpread$1({}, p, {
67
+ "icon": EyeOutlined$1
68
+ }), null);
69
+ };
70
+ EyeOutlined.displayName = "EyeOutlined";
71
+ EyeOutlined.inheritAttrs = false;
72
+ var LoadingOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z" } }] }, "name": "loading", "theme": "outlined" };
73
+ function _objectSpread(target) {
74
+ for (var i = 1; i < arguments.length; i++) {
75
+ var source = arguments[i] != null ? Object(arguments[i]) : {};
76
+ var ownKeys = Object.keys(source);
77
+ if (typeof Object.getOwnPropertySymbols === "function") {
78
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
79
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
80
+ }));
81
+ }
82
+ ownKeys.forEach(function(key) {
83
+ _defineProperty(target, key, source[key]);
84
+ });
85
+ }
86
+ return target;
87
+ }
88
+ function _defineProperty(obj, key, value) {
89
+ if (key in obj) {
90
+ Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
91
+ } else {
92
+ obj[key] = value;
93
+ }
94
+ return obj;
95
+ }
96
+ var LoadingOutlined = function LoadingOutlined2(props, context) {
97
+ var p = _objectSpread({}, props, context.attrs);
98
+ return createVNode(Icon, _objectSpread({}, p, {
99
+ "icon": LoadingOutlined$1
100
+ }), null);
101
+ };
102
+ LoadingOutlined.displayName = "LoadingOutlined";
103
+ LoadingOutlined.inheritAttrs = false;
104
+ const _hoisted_1$1 = { class: "yx-attach-box-img-info-wrapper" };
105
+ const _hoisted_2$1 = {
106
+ style: { "min-width": "21px", "min-height": "18px" },
107
+ width: "21",
108
+ height: "18",
109
+ viewBox: "0 0 21 18",
110
+ fill: "var(--theme-head-title-link, #3B3E55)",
111
+ xmlns: "http://www.w3.org/2000/svg"
112
+ };
113
+ const _hoisted_3$1 = { class: "yx-attach-box-img-info-text" };
114
+ const _hoisted_4$1 = { class: "yx-attach-box-img-info-text-name" };
115
+ const _hoisted_5$1 = ["href", "download"];
116
+ const _hoisted_6$1 = { class: "yx-attach-box-img-info-text-size" };
117
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
118
+ ...{ name: "ImgInfoWrapper" },
119
+ __name: "index",
120
+ props: {
121
+ attach: {}
122
+ },
123
+ setup(__props) {
124
+ return (_ctx, _cache) => {
125
+ var _a, _b, _c, _d;
126
+ return openBlock(), createElementBlock("div", _hoisted_1$1, [
127
+ (openBlock(), createElementBlock("svg", _hoisted_2$1, [..._cache[0] || (_cache[0] = [
128
+ createElementVNode("path", {
129
+ d: "M15.75 9C16.9926 9 18 7.99264 18 6.75C18 5.50736 16.9926 4.5 15.75 4.5C14.5074 4.5 13.5 5.50736 13.5 6.75C13.5 7.99264 14.5074 9 15.75 9Z",
130
+ fill: "#9198A1"
131
+ }, null, -1),
132
+ createElementVNode("path", {
133
+ "fill-rule": "evenodd",
134
+ "clip-rule": "evenodd",
135
+ d: "M3 0C1.34315 0 0 1.34315 0 3V15C0 16.6569 1.34315 18 3 18H18C19.6569 18 21 16.6569 21 15V3C21 1.34315 19.6569 0 18 0H3ZM18 1.5H3C2.17157 1.5 1.5 2.17157 1.5 3V8.68934L6 4.18934L18.2838 16.4732C18.9765 16.3405 19.5 15.7314 19.5 15V3C19.5 2.17157 18.8284 1.5 18 1.5ZM1.5 15V10.8107L6 6.31066L16.1893 16.5H3C2.17157 16.5 1.5 15.8284 1.5 15Z",
136
+ fill: "#9198A1"
137
+ }, null, -1)
138
+ ])])),
139
+ createElementVNode("div", _hoisted_3$1, [
140
+ createElementVNode("div", _hoisted_4$1, [
141
+ createElementVNode("a", {
142
+ class: "yx-attach-box-img-info-text-name-link",
143
+ href: (_a = __props.attach) == null ? void 0 : _a.url,
144
+ download: (_b = __props.attach) == null ? void 0 : _b.name
145
+ }, toDisplayString((_c = __props.attach) == null ? void 0 : _c.name), 9, _hoisted_5$1)
146
+ ]),
147
+ createElementVNode("div", _hoisted_6$1, toDisplayString(unref(getMByteSize)(((_d = __props.attach) == null ? void 0 : _d.size) || 0)) + "MB", 1)
148
+ ])
149
+ ]);
150
+ };
151
+ }
152
+ });
153
+ const _hoisted_1 = ["data-msg-id-client"];
154
+ const _hoisted_2 = {
155
+ key: 0,
156
+ class: "chat-withdraw-msg"
157
+ };
158
+ const _hoisted_3 = { class: "chatCardAvatar" };
159
+ const _hoisted_4 = { class: "chatCardContent" };
160
+ const _hoisted_5 = { class: "chatCardInfo" };
161
+ const _hoisted_6 = { class: "chatCardInfoName" };
162
+ const _hoisted_7 = { class: "chatCardInfoTime" };
163
+ const _hoisted_8 = ["innerHTML"];
164
+ const _hoisted_9 = ["href"];
165
+ const _hoisted_10 = { class: "fileMsgContent" };
166
+ const _hoisted_11 = { class: "fileMsgName" };
167
+ const _hoisted_12 = { class: "fileMsgSize" };
168
+ const _hoisted_13 = { class: "ant-image-mask-info" };
169
+ const _hoisted_14 = {
170
+ key: 4,
171
+ class: "chatCardMainContent attach-box"
172
+ };
173
+ const _hoisted_15 = { class: "ant-image-mask-info" };
174
+ const _hoisted_16 = {
175
+ key: 5,
176
+ class: "chatCardMainContent"
177
+ };
178
+ const _hoisted_17 = { class: "chatCardQuoteMsgAttachBox" };
179
+ const _hoisted_18 = { class: "chatCardQuoteMsgName" };
180
+ const _hoisted_19 = ["innerHTML"];
181
+ const _hoisted_20 = { class: "ant-image-mask-info" };
182
+ const _hoisted_21 = { class: "chatCardStatus" };
183
+ const MAX_IMG_PREVIEW_SIZE = 2 * 1024 * 1024;
184
+ const REVOCATION_INTERVAL = 120 * 1e3;
185
+ const _sfc_main = /* @__PURE__ */ defineComponent({
186
+ ...{
187
+ name: "ChatCard"
188
+ },
189
+ __name: "index",
190
+ props: {
191
+ msg: {},
192
+ myAccid: { default: "" }
193
+ },
194
+ emits: ["resendText", "resendImg", "resendFile", "quote", "contextMenuSwitch", "quoteMsgClick", "revokeMessage"],
195
+ setup(__props, { emit: __emit }) {
196
+ const serverStore = useServerStore();
197
+ const props = __props;
198
+ const nowTime = ref(Date.now());
199
+ let timer = null;
200
+ timer = setInterval(() => {
201
+ nowTime.value = Date.now();
202
+ if (nowTime.value - props.msg.time > REVOCATION_INTERVAL) {
203
+ if (timer) {
204
+ clearInterval(timer);
205
+ timer = null;
206
+ }
207
+ }
208
+ }, 1e3);
209
+ onBeforeUnmount(() => {
210
+ if (timer) {
211
+ clearInterval(timer);
212
+ timer = null;
213
+ }
214
+ });
215
+ const isRevocation = computed(() => {
216
+ return props.msg.fromAccount === props.myAccid && nowTime.value - props.msg.time <= REVOCATION_INTERVAL;
217
+ });
218
+ const { copy } = useClipboard();
219
+ const emit = __emit;
220
+ const textMsgContextMenuVisible = ref(false);
221
+ const textMsgContextMenuX = ref(0);
222
+ const textMsgContextMenuY = ref(0);
223
+ const textMsgContextMenuRef = ref(null);
224
+ function onTextMsgContextMenu(e) {
225
+ textMsgContextMenuX.value = e.clientX;
226
+ textMsgContextMenuY.value = e.clientY;
227
+ textMsgContextMenuVisible.value = true;
228
+ }
229
+ function onCopyClick() {
230
+ var _a;
231
+ if (props.msg.type === "text") {
232
+ copy(props.msg.body).then(() => {
233
+ }).catch((err) => {
234
+ console.error("copy error: ", err);
235
+ message.error("复制失败");
236
+ }).finally(() => {
237
+ textMsgContextMenuVisible.value = false;
238
+ });
239
+ }
240
+ if (props.msg.type === "image") {
241
+ copy((_a = props.msg.attach) == null ? void 0 : _a.url).then(() => {
242
+ }).catch((err) => {
243
+ console.error("copy error: ", err);
244
+ message.error("复制失败");
245
+ }).finally(() => {
246
+ textMsgContextMenuVisible.value = false;
247
+ });
248
+ }
249
+ }
250
+ function onQuoteClick() {
251
+ var _a;
252
+ let msg;
253
+ try {
254
+ msg = JSON.parse(JSON.stringify(props.msg));
255
+ if (msg.ext && typeof msg.ext === "string") {
256
+ msg.ext = JSON.parse(msg.ext);
257
+ }
258
+ } catch (error) {
259
+ console.error("parse ext error: ", error);
260
+ }
261
+ if ((_a = msg == null ? void 0 : msg.ext) == null ? void 0 : _a.quoteMsg) {
262
+ delete msg.ext.quoteMsg;
263
+ }
264
+ emit("quote", msg);
265
+ textMsgContextMenuVisible.value = false;
266
+ }
267
+ const onRevocationClick = () => {
268
+ textMsgContextMenuVisible.value = false;
269
+ if (!isRevocation.value) {
270
+ message.error("消息已超过撤回时间");
271
+ return;
272
+ }
273
+ emit("revokeMessage", props.msg);
274
+ };
275
+ function onQuoteMsgClick() {
276
+ var _a;
277
+ emit("quoteMsgClick", (_a = msgExt.value) == null ? void 0 : _a.quoteMsg);
278
+ }
279
+ function handleClickOutside(e) {
280
+ if (!textMsgContextMenuVisible.value) return;
281
+ const el = textMsgContextMenuRef.value;
282
+ if (!el || !el.contains(e.target)) {
283
+ textMsgContextMenuVisible.value = false;
284
+ }
285
+ }
286
+ function closeMenuOnResizeOrScroll() {
287
+ if (textMsgContextMenuVisible.value) {
288
+ textMsgContextMenuVisible.value = false;
289
+ }
290
+ }
291
+ useEventListener(window, "resize", () => textMsgContextMenuVisible.value && closeMenuOnResizeOrScroll());
292
+ useEventListener(
293
+ () => window.visualViewport ?? void 0,
294
+ "resize",
295
+ () => textMsgContextMenuVisible.value && closeMenuOnResizeOrScroll()
296
+ );
297
+ useEventListener(document, "scroll", () => textMsgContextMenuVisible.value && closeMenuOnResizeOrScroll(), {
298
+ capture: true
299
+ });
300
+ watch(textMsgContextMenuVisible, (visible) => {
301
+ if (visible) {
302
+ nextTick(() => {
303
+ document.addEventListener("click", handleClickOutside, true);
304
+ document.addEventListener("contextmenu", handleClickOutside, true);
305
+ });
306
+ emit("contextMenuSwitch", true);
307
+ } else {
308
+ document.removeEventListener("click", handleClickOutside, true);
309
+ document.removeEventListener("contextmenu", handleClickOutside, true);
310
+ emit("contextMenuSwitch", false);
311
+ }
312
+ });
313
+ onBeforeUnmount(() => {
314
+ document.removeEventListener("click", handleClickOutside, true);
315
+ document.removeEventListener("contextmenu", handleClickOutside, true);
316
+ });
317
+ const myAvatar = computed(() => {
318
+ var _a, _b, _c, _d;
319
+ if (((_a = serverStore.serverMembers) == null ? void 0 : _a.datas) && ((_b = serverStore.serverMembers) == null ? void 0 : _b.datas.length) > 0) {
320
+ return (_d = (_c = serverStore.serverMembers) == null ? void 0 : _c.datas.filter((item) => item.accid === props.msg.fromAccount)[0]) == null ? void 0 : _d.avatar;
321
+ }
322
+ return "";
323
+ });
324
+ const time = computed(() => {
325
+ const _d = dayjs(props.msg.time);
326
+ const isCurrentDay = _d.isSame(dayjs(), "day");
327
+ const isCurrentYear = _d.isSame(dayjs(), "year");
328
+ return _d.format(isCurrentDay ? "HH:mm:ss" : isCurrentYear ? "MM-DD HH:mm:ss" : "YYYY-MM-DD HH:mm:ss");
329
+ });
330
+ const size = computed(() => {
331
+ var _a;
332
+ return parseFileSize(((_a = props.msg.attach) == null ? void 0 : _a.size) || 0);
333
+ });
334
+ const ext = computed(() => {
335
+ var _a;
336
+ return matchExt(((_a = props.msg.attach) == null ? void 0 : _a.ext) || "");
337
+ });
338
+ const textMsgBody = computed(
339
+ () => {
340
+ var _a;
341
+ return ((_a = props.msg.body) == null ? void 0 : _a.replace(
342
+ /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gi,
343
+ '<a style="color:#fff;text-decoration:underline;" href="$1" target="_blank">$1</a>'
344
+ )) || "";
345
+ }
346
+ );
347
+ const msgExt = computed(() => {
348
+ if (!props.msg.ext) {
349
+ return null;
350
+ }
351
+ try {
352
+ return JSON.parse(props.msg.ext);
353
+ } catch (error) {
354
+ console.error("parse ext error: ", error);
355
+ return null;
356
+ }
357
+ });
358
+ const imageMsgSize = computed(() => {
359
+ var _a;
360
+ return getImageMsgDisplaySize((_a = props.msg) == null ? void 0 : _a.attach);
361
+ });
362
+ const quoteImageMsgSize = computed(() => {
363
+ var _a, _b;
364
+ return getImageMsgDisplaySize((_b = (_a = msgExt.value) == null ? void 0 : _a.quoteMsg) == null ? void 0 : _b.attach);
365
+ });
366
+ const resendHandler = () => {
367
+ switch (props.msg.type) {
368
+ case "text":
369
+ emit("resendText", props.msg);
370
+ break;
371
+ case "image":
372
+ emit("resendImg", props.msg);
373
+ break;
374
+ case "file":
375
+ emit("resendFile", props.msg);
376
+ break;
377
+ }
378
+ };
379
+ return (_ctx, _cache) => {
380
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
381
+ return openBlock(), createElementBlock("div", {
382
+ class: normalizeClass(["yx-chatCardWrapper", { reverse: __props.msg.fromAccount === __props.myAccid }]),
383
+ "data-msg-id-client": __props.msg.msgIdClient
384
+ }, [
385
+ ((_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 }, [
386
+ createElementVNode("div", _hoisted_3, [
387
+ createVNode(_sfc_main$2, {
388
+ avatar: myAvatar.value,
389
+ nick: __props.msg.fromNick,
390
+ accid: __props.msg.fromAccount,
391
+ width: 32,
392
+ border: 0,
393
+ style: { "min-width": "32px" }
394
+ }, null, 8, ["avatar", "nick", "accid"])
395
+ ]),
396
+ createElementVNode("div", _hoisted_4, [
397
+ createElementVNode("div", null, [
398
+ createElementVNode("div", _hoisted_5, [
399
+ createElementVNode("span", _hoisted_6, toDisplayString(__props.msg.fromNick), 1),
400
+ createElementVNode("span", _hoisted_7, toDisplayString(time.value), 1)
401
+ ]),
402
+ __props.msg.type === "text" ? (openBlock(), createElementBlock("div", {
403
+ key: 0,
404
+ class: normalizeClass(["chatCardMainContent", { myMsg: __props.msg.fromAccount === __props.myAccid, otherMsg: __props.msg.fromAccount !== __props.myAccid }])
405
+ }, [
406
+ createElementVNode("div", {
407
+ class: "textMsg flash-target",
408
+ onContextmenu: withModifiers(onTextMsgContextMenu, ["prevent"]),
409
+ innerHTML: textMsgBody.value
410
+ }, null, 40, _hoisted_8)
411
+ ], 2)) : __props.msg.type === "file" ? (openBlock(), createElementBlock("div", {
412
+ key: 1,
413
+ class: normalizeClass(["chatCardMainContent", { myMsg: __props.msg.fromAccount === __props.myAccid, otherMsg: __props.msg.fromAccount !== __props.myAccid }])
414
+ }, [
415
+ createElementVNode("a", {
416
+ class: "fileMsg",
417
+ target: "_blank",
418
+ href: (_d = (_c = __props.msg) == null ? void 0 : _c.attach) == null ? void 0 : _d.url
419
+ }, [
420
+ ext.value === "pdf" ? (openBlock(), createBlock(unref(FileIconFont), {
421
+ key: 0,
422
+ type: "icon-PDF",
423
+ style: { "font-size": "40px" }
424
+ })) : ext.value === "word" ? (openBlock(), createBlock(unref(FileIconFont), {
425
+ key: 1,
426
+ type: "icon-Word",
427
+ style: { "font-size": "40px" }
428
+ })) : ext.value === "excel" ? (openBlock(), createBlock(unref(FileIconFont), {
429
+ key: 2,
430
+ type: "icon-Excel",
431
+ style: { "font-size": "40px" }
432
+ })) : ext.value === "ppt" ? (openBlock(), createBlock(unref(FileIconFont), {
433
+ key: 3,
434
+ type: "icon-PPT",
435
+ style: { "font-size": "40px" }
436
+ })) : ext.value === "zip" ? (openBlock(), createBlock(unref(FileIconFont), {
437
+ key: 4,
438
+ type: "icon-RAR1",
439
+ style: { "font-size": "40px" }
440
+ })) : ext.value === "video" ? (openBlock(), createBlock(unref(FileIconFont), {
441
+ key: 5,
442
+ type: "icon-shipin",
443
+ style: { "font-size": "40px" }
444
+ })) : ext.value === "audio" ? (openBlock(), createBlock(unref(FileIconFont), {
445
+ key: 6,
446
+ type: "icon-yinle",
447
+ style: { "font-size": "40px" }
448
+ })) : ext.value === "img" ? (openBlock(), createBlock(unref(FileIconFont), {
449
+ key: 7,
450
+ type: "icon-tupian2",
451
+ style: { "font-size": "40px" }
452
+ })) : ext.value === "txt" ? (openBlock(), createBlock(unref(FileIconFont), {
453
+ key: 8,
454
+ type: "icon-qita",
455
+ style: { "font-size": "40px" }
456
+ })) : (openBlock(), createBlock(unref(FileIconFont), {
457
+ key: 9,
458
+ type: "icon-weizhiwenjian",
459
+ style: { "font-size": "40px" }
460
+ })),
461
+ createElementVNode("div", _hoisted_10, [
462
+ createElementVNode("div", _hoisted_11, toDisplayString((_f = (_e = __props.msg) == null ? void 0 : _e.attach) == null ? void 0 : _f.name), 1),
463
+ createElementVNode("div", _hoisted_12, toDisplayString(size.value), 1)
464
+ ])
465
+ ], 8, _hoisted_9)
466
+ ], 2)) : __props.msg.type === "image" ? (openBlock(), createElementBlock("div", {
467
+ key: 2,
468
+ class: normalizeClass(["chatCardMainContent flash-target", { myMsg: __props.msg.fromAccount === __props.myAccid, otherMsg: __props.msg.fromAccount !== __props.myAccid }]),
469
+ onContextmenu: withModifiers(onTextMsgContextMenu, ["prevent"])
470
+ }, [
471
+ createVNode(unref(Image), {
472
+ class: "imgMsg",
473
+ src: (_h = (_g = __props.msg) == null ? void 0 : _g.attach) == null ? void 0 : _h.url,
474
+ width: imageMsgSize.value.width,
475
+ height: imageMsgSize.value.height
476
+ }, {
477
+ previewMask: withCtx(() => [
478
+ createElementVNode("div", _hoisted_13, [
479
+ createVNode(unref(EyeOutlined))
480
+ ])
481
+ ]),
482
+ _: 1
483
+ }, 8, ["src", "width", "height"])
484
+ ], 34)) : (openBlock(), createElementBlock("div", {
485
+ key: 3,
486
+ class: normalizeClass(["chatCardMainContent", { myMsg: __props.msg.fromAccount === __props.myAccid, otherMsg: __props.msg.fromAccount !== __props.myAccid }])
487
+ }, [..._cache[1] || (_cache[1] = [
488
+ createElementVNode("div", { class: "textMsg" }, toDisplayString("暂不支持该消息"), -1)
489
+ ])], 2)),
490
+ __props.msg.type === "text" && ["jpg", "jpeg", "png", "gif"].includes(((_j = (_i = __props.msg) == null ? void 0 : _i.attach) == null ? void 0 : _j.ext) || "") ? (openBlock(), createElementBlock("div", _hoisted_14, [
491
+ ((_l = (_k = __props.msg) == null ? void 0 : _k.attach) == null ? void 0 : _l.size) && ((_n = (_m = __props.msg) == null ? void 0 : _m.attach) == null ? void 0 : _n.size) < MAX_IMG_PREVIEW_SIZE ? (openBlock(), createBlock(unref(Image), {
492
+ key: 0,
493
+ class: "imgMsg",
494
+ src: (_p = (_o = __props.msg) == null ? void 0 : _o.attach) == null ? void 0 : _p.url,
495
+ width: imageMsgSize.value.width,
496
+ height: imageMsgSize.value.height
497
+ }, {
498
+ previewMask: withCtx(() => [
499
+ createElementVNode("div", _hoisted_15, [
500
+ createVNode(unref(EyeOutlined))
501
+ ])
502
+ ]),
503
+ _: 1
504
+ }, 8, ["src", "width", "height"])) : (openBlock(), createBlock(_sfc_main$1, {
505
+ key: 1,
506
+ attach: (_q = __props.msg) == null ? void 0 : _q.attach
507
+ }, null, 8, ["attach"]))
508
+ ])) : createCommentVNode("", true),
509
+ ((_r = msgExt.value) == null ? void 0 : _r.quoteMsg) ? (openBlock(), createElementBlock("div", _hoisted_16, [
510
+ createElementVNode("div", {
511
+ class: "chatCardQuoteMsg",
512
+ onClick: onQuoteMsgClick
513
+ }, [
514
+ createElementVNode("div", _hoisted_17, [
515
+ createVNode(_sfc_main$1, {
516
+ attach: msgExt.value.quoteMsg.attach
517
+ }, null, 8, ["attach"])
518
+ ]),
519
+ createElementVNode("div", _hoisted_18, toDisplayString(msgExt.value.quoteMsg.fromNick) + ":", 1),
520
+ msgExt.value.quoteMsg.body ? (openBlock(), createElementBlock("div", {
521
+ key: 0,
522
+ class: "quoteMsgText",
523
+ innerHTML: msgExt.value.quoteMsg.body
524
+ }, null, 8, _hoisted_19)) : createCommentVNode("", true),
525
+ msgExt.value.quoteMsg.type === "image" ? (openBlock(), createBlock(unref(Image), {
526
+ key: 1,
527
+ class: "imgMsg quoteMsgImg",
528
+ src: (_s = msgExt.value.quoteMsg.attach) == null ? void 0 : _s.url,
529
+ width: quoteImageMsgSize.value.width,
530
+ height: quoteImageMsgSize.value.height,
531
+ onClick: _cache[0] || (_cache[0] = withModifiers(() => {
532
+ }, ["stop", "prevent"]))
533
+ }, {
534
+ previewMask: withCtx(() => [
535
+ createElementVNode("div", _hoisted_20, [
536
+ createVNode(unref(EyeOutlined))
537
+ ])
538
+ ]),
539
+ _: 1
540
+ }, 8, ["src", "width", "height"])) : createCommentVNode("", true)
541
+ ])
542
+ ])) : createCommentVNode("", true)
543
+ ]),
544
+ createElementVNode("div", _hoisted_21, [
545
+ __props.msg.deliveryStatus === "failed" ? (openBlock(), createBlock(unref(Button), {
546
+ key: 0,
547
+ type: "text",
548
+ danger: "",
549
+ onClick: resendHandler
550
+ }, {
551
+ icon: withCtx(() => [
552
+ createVNode(unref(ExclamationCircleFilled))
553
+ ]),
554
+ _: 1
555
+ })) : __props.msg.deliveryStatus === "sending" ? (openBlock(), createBlock(unref(LoadingOutlined), { key: 1 })) : createCommentVNode("", true)
556
+ ])
557
+ ])
558
+ ], 64)),
559
+ withDirectives(createElementVNode("div", {
560
+ ref_key: "textMsgContextMenuRef",
561
+ ref: textMsgContextMenuRef,
562
+ class: "yx-chatCardTextMsgContextMenu",
563
+ style: normalizeStyle({ left: textMsgContextMenuX.value + "px", top: textMsgContextMenuY.value + "px" })
564
+ }, [
565
+ createElementVNode("div", {
566
+ class: "yx-chatCardTextMsgContextMenu-item",
567
+ onClick: onCopyClick
568
+ }, "复制"),
569
+ createElementVNode("div", {
570
+ class: "yx-chatCardTextMsgContextMenu-item",
571
+ onClick: onQuoteClick
572
+ }, "引用"),
573
+ isRevocation.value ? (openBlock(), createElementBlock("div", {
574
+ key: 0,
575
+ class: "yx-chatCardTextMsgContextMenu-item",
576
+ onClick: onRevocationClick
577
+ }, " 撤回 ")) : createCommentVNode("", true)
578
+ ], 4), [
579
+ [vShow, textMsgContextMenuVisible.value]
580
+ ])
581
+ ], 10, _hoisted_1);
582
+ };
583
+ }
584
+ });
585
+ export {
586
+ LoadingOutlined as L,
587
+ _sfc_main as _,
588
+ _sfc_main$1 as a
589
+ };
@@ -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-C18d9C8W.mjs";
4
+ import { a as useServerStore, u as useChannelStore } from "./index.vue_vue_type_style_index_0_lang-BaKNB-4q.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-CBpDXwwP.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" };