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.
- package/dist/ait-person-popover/index.js +1 -1
- package/dist/chat-card/index.js +1 -1
- package/dist/chat-content/index.js +1 -1
- package/dist/chat-page/index.js +1 -1
- package/dist/chat-room/index.js +1 -1
- package/dist/common-avatar/index.js +1 -1
- package/dist/components/chat-card/index.vue.d.ts +2 -0
- package/dist/components/img-info-wrapper/index.d.ts +0 -0
- package/dist/{chat-page → components/img-info-wrapper}/index.vue.d.ts +2 -2
- package/dist/img-info-wrapper/index.js +1 -0
- package/dist/index/style2.css +30 -162
- package/dist/index/style4.css +177 -120
- package/dist/index/style6.css +513 -25
- package/dist/index/style7.css +143 -466
- package/dist/{index-0o2Mn1Jl.mjs → index-BPnLB3av.mjs} +1 -1
- package/dist/{index-C14AY1pk.mjs → index-DME8_VYv.mjs} +7 -6
- package/dist/{index-sJcDnl5D.mjs → index-Dwglj7_M.mjs} +1 -1
- package/dist/index-entry/index.js +5 -5
- package/dist/index-entry/style.css +19 -19
- package/dist/{index.vue_vue_type_script_setup_true_lang-0YeDxfed.mjs → index.vue_vue_type_script_setup_true_lang-C18d9C8W.mjs} +9 -3
- 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
- package/dist/index.vue_vue_type_style_index_0_lang-CBpDXwwP.mjs +589 -0
- package/dist/{index.vue_vue_type_style_index_0_lang-BxxUcry3.mjs → index.vue_vue_type_style_index_0_lang-E3PcX8MA.mjs} +3 -3
- package/dist/{index.vue_vue_type_style_index_0_lang-BdIDeEyF.mjs → index.vue_vue_type_style_index_0_lang-QCNj8WyS.mjs} +171 -40
- package/dist/members-sidebar/index.js +1 -1
- package/dist/notice-box/index.js +1 -1
- package/dist/server-channel-sidebar/index.js +1 -1
- package/dist/stores/channel.d.ts +50 -14
- package/dist/stores/qchat.d.ts +3 -3
- package/dist/stores/sdk.d.ts +0 -8
- package/dist/stores/server.d.ts +26 -26
- package/dist/style.css +180 -90
- package/dist/types/qchat-server.d.ts +1 -1
- package/dist/utils/index.d.ts +10 -2
- package/dist/yx-web-sdk.es.js +644 -296
- package/dist/yx-web-sdk.umd.js +643 -295
- package/package.json +1 -1
- package/dist/ait-person-popover/index.d.ts +0 -3
- package/dist/ait-person-popover/index.vue.d.ts +0 -39
- package/dist/chat-card/index.d.ts +0 -3
- package/dist/chat-card/index.vue.d.ts +0 -25
- package/dist/chat-content/index.d.ts +0 -3
- package/dist/chat-content/index.vue.d.ts +0 -51
- package/dist/chat-page/index.d.ts +0 -3
- package/dist/chat-room/index.d.ts +0 -3
- package/dist/chat-room/index.vue.d.ts +0 -9
- package/dist/common-avatar/index.d.ts +0 -3
- package/dist/common-avatar/index.vue.d.ts +0 -17
- package/dist/icon-font/index.d.ts +0 -48
- package/dist/index-entry/index.d.ts +0 -2
- package/dist/index-entry/index.vue.d.ts +0 -24
- package/dist/index.vue_vue_type_style_index_0_lang-oO4NDv0U.mjs +0 -456
- package/dist/members-sidebar/index.d.ts +0 -3
- package/dist/members-sidebar/index.vue.d.ts +0 -4
- package/dist/notice-box/index.d.ts +0 -3
- package/dist/notice-box/index.vue.d.ts +0 -13
- package/dist/server-channel-sidebar/index.d.ts +0 -3
- package/dist/server-channel-sidebar/index.vue.d.ts +0 -21
- /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
|
@@ -1,12 +1,45 @@
|
|
|
1
|
-
import { ref, computed, watch, nextTick, defineComponent, openBlock, createElementBlock, createElementVNode, normalizeStyle, unref, normalizeClass, createBlock, createCommentVNode,
|
|
1
|
+
import { createVNode, ref, computed, watch, nextTick, defineComponent, openBlock, createElementBlock, createElementVNode, normalizeStyle, unref, normalizeClass, createBlock, createCommentVNode, 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-
|
|
5
|
-
import { L as LoadingOutlined, _ as _sfc_main$2 } from "./index.vue_vue_type_style_index_0_lang-
|
|
6
|
-
import { _ as _sfc_main$1 } from "./index.vue_vue_type_style_index_0_lang-
|
|
7
|
-
import { a as useServerStore, g as getServerMembersByAccids,
|
|
4
|
+
import { A as AitPersonPopover } from "./index-Dwglj7_M.mjs";
|
|
5
|
+
import { L as LoadingOutlined, _ as _sfc_main$2, a as _sfc_main$3 } from "./index.vue_vue_type_style_index_0_lang-CBpDXwwP.mjs";
|
|
6
|
+
import { _ as _sfc_main$1 } from "./index.vue_vue_type_style_index_0_lang-BxXBf_VA.mjs";
|
|
7
|
+
import { a as useServerStore, g as getServerMembersByAccids, u as useChannelStore, e as getImageMsgDisplaySize, f as filterStr, i as isLt } from "./index.vue_vue_type_style_index_0_lang-BaKNB-4q.mjs";
|
|
8
8
|
import { useEventListener, useDebounceFn } from "@vueuse/core";
|
|
9
9
|
import { C as CloseOutlined } from "./CloseOutlined-BEcmJaCc.mjs";
|
|
10
|
+
import { I as Icon } from "./AntdIcon-DdvEPKFJ.mjs";
|
|
11
|
+
var DeleteOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z" } }] }, "name": "delete", "theme": "outlined" };
|
|
12
|
+
function _objectSpread(target) {
|
|
13
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
14
|
+
var source = arguments[i] != null ? Object(arguments[i]) : {};
|
|
15
|
+
var ownKeys = Object.keys(source);
|
|
16
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
17
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
18
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
19
|
+
}));
|
|
20
|
+
}
|
|
21
|
+
ownKeys.forEach(function(key) {
|
|
22
|
+
_defineProperty(target, key, source[key]);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return target;
|
|
26
|
+
}
|
|
27
|
+
function _defineProperty(obj, key, value) {
|
|
28
|
+
if (key in obj) {
|
|
29
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
30
|
+
} else {
|
|
31
|
+
obj[key] = value;
|
|
32
|
+
}
|
|
33
|
+
return obj;
|
|
34
|
+
}
|
|
35
|
+
var DeleteOutlined = function DeleteOutlined2(props, context) {
|
|
36
|
+
var p = _objectSpread({}, props, context.attrs);
|
|
37
|
+
return createVNode(Icon, _objectSpread({}, p, {
|
|
38
|
+
"icon": DeleteOutlined$1
|
|
39
|
+
}), null);
|
|
40
|
+
};
|
|
41
|
+
DeleteOutlined.displayName = "DeleteOutlined";
|
|
42
|
+
DeleteOutlined.inheritAttrs = false;
|
|
10
43
|
const MENTION_TAG_REG = /@[^@]+\s/g;
|
|
11
44
|
function getMentionSpans(text) {
|
|
12
45
|
const spans = [];
|
|
@@ -419,19 +452,29 @@ const _hoisted_8 = {
|
|
|
419
452
|
key: 0,
|
|
420
453
|
class: "chatroomInputQuoteWrapper"
|
|
421
454
|
};
|
|
422
|
-
const _hoisted_9 = { class: "
|
|
423
|
-
const _hoisted_10 = { class: "
|
|
424
|
-
const _hoisted_11 =
|
|
425
|
-
const _hoisted_12 =
|
|
455
|
+
const _hoisted_9 = { class: "chatroomInputQuoteAttachBox" };
|
|
456
|
+
const _hoisted_10 = { class: "chatroomInputQuoteText" };
|
|
457
|
+
const _hoisted_11 = { class: "chatroomInputQuoteTextName" };
|
|
458
|
+
const _hoisted_12 = ["innerHTML"];
|
|
459
|
+
const _hoisted_13 = {
|
|
426
460
|
key: 0,
|
|
427
461
|
class: "chatroomInputQuoteWrapperImg"
|
|
428
462
|
};
|
|
429
|
-
const
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
const
|
|
434
|
-
|
|
463
|
+
const _hoisted_14 = {
|
|
464
|
+
key: 1,
|
|
465
|
+
class: "chatroomInputAttachmentWrapper"
|
|
466
|
+
};
|
|
467
|
+
const _hoisted_15 = {
|
|
468
|
+
key: 0,
|
|
469
|
+
class: "chatroomInputAttachmentWrapperImg"
|
|
470
|
+
};
|
|
471
|
+
const _hoisted_16 = { class: "chatroomInputAttachmentWrapperImgMask" };
|
|
472
|
+
const _hoisted_17 = { class: "chatroomInputWrapper" };
|
|
473
|
+
const _hoisted_18 = { class: "chatroomInputLeft" };
|
|
474
|
+
const _hoisted_19 = { style: { "width": "400px" } };
|
|
475
|
+
const _hoisted_20 = ["onClick"];
|
|
476
|
+
const _hoisted_21 = { class: "chatroomController" };
|
|
477
|
+
const MAX_IMG_SIZE = 10;
|
|
435
478
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
436
479
|
...{
|
|
437
480
|
name: "ChatContent"
|
|
@@ -457,8 +500,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
457
500
|
const props = __props;
|
|
458
501
|
const emit = __emit;
|
|
459
502
|
const quoteMsg = ref();
|
|
503
|
+
const attachment = ref();
|
|
460
504
|
const curText = ref("");
|
|
461
505
|
const cursorIndex = ref(0);
|
|
506
|
+
const attachmentUploading = ref(false);
|
|
462
507
|
const contentRef = ref();
|
|
463
508
|
const contentScrollLocked = ref(false);
|
|
464
509
|
const loadingMore = ref(false);
|
|
@@ -546,9 +591,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
546
591
|
}
|
|
547
592
|
});
|
|
548
593
|
};
|
|
594
|
+
const handleRevokeMessage = (msg) => {
|
|
595
|
+
channelStore.revokeMessage({
|
|
596
|
+
ps: "撤回了一条消息",
|
|
597
|
+
message: msg
|
|
598
|
+
});
|
|
599
|
+
};
|
|
549
600
|
const handleDeleteQuoteMsg = () => {
|
|
550
601
|
quoteMsg.value = void 0;
|
|
551
602
|
};
|
|
603
|
+
const handleDeleteAttachment = () => {
|
|
604
|
+
attachment.value = void 0;
|
|
605
|
+
};
|
|
552
606
|
watch(
|
|
553
607
|
() => props.msgs,
|
|
554
608
|
(value, oldValue) => {
|
|
@@ -580,11 +634,27 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
580
634
|
}
|
|
581
635
|
}
|
|
582
636
|
);
|
|
637
|
+
const inputMap = /* @__PURE__ */ new Map();
|
|
583
638
|
watch(
|
|
584
639
|
() => channelStore.currentChannel,
|
|
585
|
-
() => {
|
|
586
|
-
|
|
587
|
-
|
|
640
|
+
(value, oldValue) => {
|
|
641
|
+
if (oldValue == null ? void 0 : oldValue.channelId) {
|
|
642
|
+
inputMap.set(oldValue == null ? void 0 : oldValue.channelId, {
|
|
643
|
+
input: curText.value,
|
|
644
|
+
quoteMsg: quoteMsg.value,
|
|
645
|
+
attachment: attachment.value
|
|
646
|
+
});
|
|
647
|
+
}
|
|
648
|
+
if ((value == null ? void 0 : value.channelId) && inputMap.has((value == null ? void 0 : value.channelId) || "")) {
|
|
649
|
+
const mapValue = inputMap.get((value == null ? void 0 : value.channelId) || "");
|
|
650
|
+
curText.value = (mapValue == null ? void 0 : mapValue.input) || "";
|
|
651
|
+
quoteMsg.value = mapValue == null ? void 0 : mapValue.quoteMsg;
|
|
652
|
+
attachment.value = mapValue == null ? void 0 : mapValue.attachment;
|
|
653
|
+
} else {
|
|
654
|
+
curText.value = "";
|
|
655
|
+
quoteMsg.value = void 0;
|
|
656
|
+
attachment.value = void 0;
|
|
657
|
+
}
|
|
588
658
|
}
|
|
589
659
|
);
|
|
590
660
|
const inputPlaceholder = computed(
|
|
@@ -620,10 +690,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
620
690
|
ext: {
|
|
621
691
|
quoteMsg: quoteMsg.value
|
|
622
692
|
},
|
|
623
|
-
mentionAccids: mentionAccids.value
|
|
693
|
+
mentionAccids: mentionAccids.value,
|
|
694
|
+
attach: attachment.value
|
|
695
|
+
// 传递附件
|
|
624
696
|
});
|
|
625
697
|
curText.value = "";
|
|
626
698
|
quoteMsg.value = void 0;
|
|
699
|
+
attachment.value = void 0;
|
|
627
700
|
scrollToBottomAfterSend();
|
|
628
701
|
}
|
|
629
702
|
}
|
|
@@ -635,10 +708,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
635
708
|
ext: {
|
|
636
709
|
quoteMsg: quoteMsg.value
|
|
637
710
|
},
|
|
638
|
-
mentionAccids: mentionAccids.value
|
|
711
|
+
mentionAccids: mentionAccids.value,
|
|
712
|
+
attach: attachment.value
|
|
713
|
+
// 传递附件
|
|
639
714
|
});
|
|
640
715
|
curText.value = "";
|
|
641
716
|
quoteMsg.value = void 0;
|
|
717
|
+
attachment.value = void 0;
|
|
642
718
|
scrollToBottomAfterSend();
|
|
643
719
|
}
|
|
644
720
|
};
|
|
@@ -660,8 +736,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
660
736
|
});
|
|
661
737
|
}
|
|
662
738
|
};
|
|
663
|
-
const handlePaste = (e) => {
|
|
664
|
-
if (props.sendDisabled) return;
|
|
739
|
+
const handlePaste = async (e) => {
|
|
740
|
+
if (props.sendDisabled || attachmentUploading.value) return;
|
|
665
741
|
const clipboardData = e.clipboardData;
|
|
666
742
|
if (!clipboardData) return;
|
|
667
743
|
const items = clipboardData.items;
|
|
@@ -675,20 +751,51 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
675
751
|
message.error("图片大小最大支持20M");
|
|
676
752
|
return;
|
|
677
753
|
}
|
|
678
|
-
|
|
679
|
-
|
|
754
|
+
attachmentUploading.value = true;
|
|
755
|
+
try {
|
|
756
|
+
const uploadResult = await channelStore.uploadImage({
|
|
757
|
+
file,
|
|
758
|
+
onUploadStart: () => {
|
|
759
|
+
attachmentUploading.value = true;
|
|
760
|
+
},
|
|
761
|
+
onUploadDone: () => {
|
|
762
|
+
attachmentUploading.value = false;
|
|
763
|
+
}
|
|
764
|
+
});
|
|
765
|
+
attachment.value = uploadResult;
|
|
766
|
+
} catch (error) {
|
|
767
|
+
console.error("上传图片失败:", error);
|
|
768
|
+
message.error("上传图片失败");
|
|
769
|
+
attachmentUploading.value = false;
|
|
770
|
+
}
|
|
680
771
|
}
|
|
681
772
|
return;
|
|
682
773
|
}
|
|
683
774
|
}
|
|
684
775
|
};
|
|
685
|
-
const uploadImgHandler = (file) => {
|
|
776
|
+
const uploadImgHandler = async (file) => {
|
|
686
777
|
if (!isLt(file.size, MAX_IMG_SIZE)) {
|
|
687
778
|
message.error(`图片大小最大支持${MAX_IMG_SIZE}M`);
|
|
688
|
-
return;
|
|
779
|
+
return false;
|
|
689
780
|
}
|
|
690
|
-
|
|
691
|
-
|
|
781
|
+
attachmentUploading.value = true;
|
|
782
|
+
try {
|
|
783
|
+
const uploadResult = await channelStore.uploadImage({
|
|
784
|
+
file,
|
|
785
|
+
onUploadStart: () => {
|
|
786
|
+
attachmentUploading.value = true;
|
|
787
|
+
},
|
|
788
|
+
onUploadDone: () => {
|
|
789
|
+
attachmentUploading.value = false;
|
|
790
|
+
}
|
|
791
|
+
});
|
|
792
|
+
attachment.value = uploadResult;
|
|
793
|
+
} catch (error) {
|
|
794
|
+
console.error("上传图片失败:", error);
|
|
795
|
+
message.error("上传图片失败");
|
|
796
|
+
attachmentUploading.value = false;
|
|
797
|
+
}
|
|
798
|
+
return false;
|
|
692
799
|
};
|
|
693
800
|
const emjjData = [
|
|
694
801
|
"😀",
|
|
@@ -882,7 +989,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
882
989
|
onResendFile: handleResendFile,
|
|
883
990
|
onContextMenuSwitch,
|
|
884
991
|
onQuote: handleQuote,
|
|
885
|
-
onQuoteMsgClick: handleQuoteMsgClick
|
|
992
|
+
onQuoteMsgClick: handleQuoteMsgClick,
|
|
993
|
+
onRevokeMessage: handleRevokeMessage
|
|
886
994
|
}, null, 8, ["msg", "my-avatar", "my-accid"]);
|
|
887
995
|
}), 128))
|
|
888
996
|
])) : (openBlock(), createElementBlock("div", {
|
|
@@ -903,14 +1011,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
903
1011
|
onClick: handleDeleteQuoteMsg
|
|
904
1012
|
}),
|
|
905
1013
|
createElementVNode("div", _hoisted_9, [
|
|
906
|
-
|
|
1014
|
+
createVNode(_sfc_main$3, {
|
|
1015
|
+
attach: quoteMsg.value.attach
|
|
1016
|
+
}, null, 8, ["attach"])
|
|
1017
|
+
]),
|
|
1018
|
+
createElementVNode("div", _hoisted_10, [
|
|
1019
|
+
createElementVNode("div", _hoisted_11, toDisplayString(quoteMsg.value.fromNick) + ":", 1),
|
|
907
1020
|
((_d = quoteMsg.value) == null ? void 0 : _d.body) ? (openBlock(), createElementBlock("div", {
|
|
908
1021
|
key: 0,
|
|
909
1022
|
class: "chatroomInputQuoteTextBody",
|
|
910
1023
|
innerHTML: (_e = quoteMsg.value) == null ? void 0 : _e.body
|
|
911
|
-
}, null, 8,
|
|
1024
|
+
}, null, 8, _hoisted_12)) : createCommentVNode("", true)
|
|
912
1025
|
]),
|
|
913
|
-
quoteMsg.value.type === "image" ? (openBlock(), createElementBlock("div",
|
|
1026
|
+
quoteMsg.value.type === "image" ? (openBlock(), createElementBlock("div", _hoisted_13, [
|
|
914
1027
|
createVNode(unref(Image), {
|
|
915
1028
|
preview: false,
|
|
916
1029
|
class: "imgMsg quoteImg",
|
|
@@ -920,17 +1033,34 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
920
1033
|
}, null, 8, ["src", "width", "height"])
|
|
921
1034
|
])) : createCommentVNode("", true)
|
|
922
1035
|
])) : createCommentVNode("", true),
|
|
923
|
-
|
|
924
|
-
|
|
1036
|
+
attachment.value ? (openBlock(), createElementBlock("div", _hoisted_14, [
|
|
1037
|
+
["jpg", "jpeg", "png", "gif"].includes(attachment.value.ext || "") && attachment.value.url ? (openBlock(), createElementBlock("div", _hoisted_15, [
|
|
1038
|
+
createElementVNode("div", _hoisted_16, [
|
|
1039
|
+
createVNode(unref(DeleteOutlined), {
|
|
1040
|
+
class: "chatroomInputAttachmentDeleteBtn",
|
|
1041
|
+
onClick: handleDeleteAttachment
|
|
1042
|
+
})
|
|
1043
|
+
]),
|
|
1044
|
+
createVNode(unref(Image), {
|
|
1045
|
+
preview: false,
|
|
1046
|
+
class: "imgMsg quoteImg",
|
|
1047
|
+
src: attachment.value.url,
|
|
1048
|
+
width: 60,
|
|
1049
|
+
height: 60
|
|
1050
|
+
}, null, 8, ["src"])
|
|
1051
|
+
])) : createCommentVNode("", true)
|
|
1052
|
+
])) : createCommentVNode("", true),
|
|
1053
|
+
createElementVNode("div", _hoisted_17, [
|
|
1054
|
+
createElementVNode("div", _hoisted_18, [
|
|
925
1055
|
createVNode(unref(Popover), { placement: "topLeft" }, {
|
|
926
1056
|
content: withCtx(() => [
|
|
927
|
-
createElementVNode("div",
|
|
1057
|
+
createElementVNode("div", _hoisted_19, [
|
|
928
1058
|
(openBlock(), createElementBlock(Fragment, null, renderList(emjjData, (value, i) => {
|
|
929
1059
|
return createElementVNode("span", {
|
|
930
1060
|
key: i,
|
|
931
1061
|
style: { "font-size": "16px", "cursor": "pointer" },
|
|
932
1062
|
onClick: ($event) => insertEmj(i)
|
|
933
|
-
}, toDisplayString(value), 9,
|
|
1063
|
+
}, toDisplayString(value), 9, _hoisted_20);
|
|
934
1064
|
}), 64))
|
|
935
1065
|
])
|
|
936
1066
|
]),
|
|
@@ -975,19 +1105,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
975
1105
|
onBlur: handleInputBlur,
|
|
976
1106
|
onPaste: handlePaste
|
|
977
1107
|
}, null, 8, ["value", "placeholder", "disabled", "onKeydown", "onClick"]),
|
|
978
|
-
createElementVNode("div",
|
|
1108
|
+
createElementVNode("div", _hoisted_21, [
|
|
979
1109
|
createVNode(unref(Upload), {
|
|
980
1110
|
"before-upload": uploadImgHandler,
|
|
981
1111
|
"show-upload-list": false,
|
|
982
1112
|
accept: ".jpg,.png,.jpeg",
|
|
983
|
-
disabled: __props.sendDisabled
|
|
1113
|
+
disabled: __props.sendDisabled || attachmentUploading.value,
|
|
1114
|
+
class: "chatroomInputUpload"
|
|
984
1115
|
}, {
|
|
985
1116
|
default: withCtx(() => [
|
|
986
1117
|
createVNode(unref(Button), {
|
|
987
1118
|
class: "chatroomButton",
|
|
988
1119
|
type: "text",
|
|
989
|
-
loading:
|
|
990
|
-
disabled: __props.sendDisabled
|
|
1120
|
+
loading: attachmentUploading.value,
|
|
1121
|
+
disabled: __props.sendDisabled || attachmentUploading.value
|
|
991
1122
|
}, {
|
|
992
1123
|
icon: withCtx(() => [..._cache[4] || (_cache[4] = [
|
|
993
1124
|
createElementVNode("svg", {
|
package/dist/notice-box/index.js
CHANGED
package/dist/stores/channel.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { IUploadFileOptions } from "nim-web-sdk-ng/dist/v1/QCHAT_BROWSER_SDK/CloudStorageServiceInterface";
|
|
2
|
-
import { ChannelInfo, CreateChannelOptions, GetChannelsByPageOptions, GetChannelsByPageResult, GetWhiteBlackMembersPageOptions, UpdateChannelOptions, UpdateWhiteBlackMembersOptions } from "nim-web-sdk-ng/dist/v1/QCHAT_BROWSER_SDK/QChatChannelServiceInterface";
|
|
3
|
-
import { QChatMessage, QChatMessageRefer } from "nim-web-sdk-ng/dist/v1/QCHAT_BROWSER_SDK/QChatMsgServiceInterface";
|
|
1
|
+
import { IUploadFileOptions, UploadFileResult } from "nim-web-sdk-ng/dist/v1/QCHAT_BROWSER_SDK/CloudStorageServiceInterface";
|
|
2
|
+
import { ChannelInfo, CreateChannelOptions, GetChannelsByPageOptions, GetChannelsByPageResult, GetWhiteBlackMembersPageOptions, UpdateChannelOptions, UpdateWhiteBlackMembersOptions, QChatChannelUnreadInfo } from "nim-web-sdk-ng/dist/v1/QCHAT_BROWSER_SDK/QChatChannelServiceInterface";
|
|
3
|
+
import { QChatMessage, QChatMessageRefer, RovokeMessageOptions } from "nim-web-sdk-ng/dist/v1/QCHAT_BROWSER_SDK/QChatMsgServiceInterface";
|
|
4
4
|
import { AddMemberRoleOptions, QChatChannelRole, GetMemberRolesOptions } from "nim-web-sdk-ng/dist/v1/QCHAT_BROWSER_SDK/QChatRoleServiceInterface";
|
|
5
5
|
import type { QChatUnreadInfo } from "../types/missing";
|
|
6
6
|
import { GetChannelRolesOptions, UpdateChannelRoleOptions, UpdateMemberRoleOptions, GetExistingAccidsOfMemberRolesOptions } from "nim-web-sdk-ng/dist/v1/QCHAT_BROWSER_SDK/QChatRoleServiceInterface";
|
|
@@ -11,6 +11,8 @@ interface ServerUnReadCountAgg {
|
|
|
11
11
|
unreadCount: number;
|
|
12
12
|
}
|
|
13
13
|
export interface SendMsgOption {
|
|
14
|
+
/** 附件信息(如上传的图片信息),如果有则塞到attach字段 */
|
|
15
|
+
attach?: UploadFileResult;
|
|
14
16
|
ext?: {
|
|
15
17
|
/** 引用消息 */
|
|
16
18
|
quoteMsg?: QChatMessage;
|
|
@@ -60,8 +62,26 @@ type TState = {
|
|
|
60
62
|
serverUnReadCountList: ServerUnReadCountAgg[];
|
|
61
63
|
};
|
|
62
64
|
export declare const useChannelStore: import("pinia").StoreDefinition<"channel", TState, {}, {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
+
/**
|
|
66
|
+
* 设置频道列表并获取未读数
|
|
67
|
+
* @param payload 频道列表数据
|
|
68
|
+
*/
|
|
69
|
+
setChannelList(payload: GetChannelsByPageResult): Promise<void>;
|
|
70
|
+
/**
|
|
71
|
+
* 订阅频道并获取未读数
|
|
72
|
+
* @description 先使用 getChannelUnreadInfos 主动查询未读数(获取登录前积累的未读),再订阅频道接收实时更新
|
|
73
|
+
*/
|
|
74
|
+
subscribleChannels(): Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* 将未读信息应用到频道列表
|
|
77
|
+
* @param unreadInfos 未读信息列表
|
|
78
|
+
*/
|
|
79
|
+
applyUnreadInfosToChannels(unreadInfos: QChatChannelUnreadInfo[]): void;
|
|
80
|
+
/**
|
|
81
|
+
* 设置 channel 的未读消息数
|
|
82
|
+
* @param payload 未读信息
|
|
83
|
+
* @description 如果是当前频道的未读更新,会忽略(因为用户正在查看该频道)
|
|
84
|
+
*/
|
|
65
85
|
setUnReadNum(payload: QChatUnreadInfo): void;
|
|
66
86
|
setCurChannel(payload: ChannelInfo): void;
|
|
67
87
|
setChannelMembers(payload: GetMembersByPageResult): void;
|
|
@@ -79,16 +99,31 @@ export declare const useChannelStore: import("pinia").StoreDefinition<"channel",
|
|
|
79
99
|
isUnShift: boolean;
|
|
80
100
|
}): void;
|
|
81
101
|
removeCurChannelMsgs(payload: QChatMessage[]): void;
|
|
102
|
+
updateCurChannelMsgs(msg: QChatMessage): void;
|
|
82
103
|
setCurChannelMsgs(payload: QChatMessage[]): void;
|
|
83
104
|
clearCurChannelMsgs(): void;
|
|
84
|
-
getChannelsByPage: (this: any, options: GetChannelsByPageOptions) => Promise<
|
|
85
|
-
createChannel(options: CreateChannelOptions): Promise<
|
|
105
|
+
getChannelsByPage: (this: any, options: GetChannelsByPageOptions) => Promise<void>;
|
|
106
|
+
createChannel(options: CreateChannelOptions): Promise<ChannelInfo>;
|
|
86
107
|
updateChannel(options: UpdateChannelOptions): Promise<void>;
|
|
87
108
|
deleteChannel(): Promise<void>;
|
|
88
109
|
getChannelHistoryMsgs(options: {
|
|
89
110
|
limit: number;
|
|
90
|
-
}): Promise<
|
|
91
|
-
loadMoreHistoryMsgs(options: LoadMoreHistoryMsgsOptions): Promise<
|
|
111
|
+
}): Promise<QChatMessage[]>;
|
|
112
|
+
loadMoreHistoryMsgs(options: LoadMoreHistoryMsgsOptions): Promise<QChatMessage[]>;
|
|
113
|
+
/**
|
|
114
|
+
* 上传图片
|
|
115
|
+
* @param options - 上传选项,包含图片文件和回调函数
|
|
116
|
+
* @returns Promise<UploadFileResult> 返回上传结果,包含图片URL、宽高等信息
|
|
117
|
+
*/
|
|
118
|
+
uploadImage(options: {
|
|
119
|
+
file: IUploadFileOptions["file"];
|
|
120
|
+
onUploadStart?: IUploadFileOptions["onUploadStart"];
|
|
121
|
+
onUploadDone?: IUploadFileOptions["onUploadDone"];
|
|
122
|
+
}): Promise<UploadFileResult>;
|
|
123
|
+
/**
|
|
124
|
+
* 发送文本消息
|
|
125
|
+
* @param options - 发送选项,包含消息内容和可选附件
|
|
126
|
+
*/
|
|
92
127
|
sendTextMsg(options: {
|
|
93
128
|
body: string;
|
|
94
129
|
} & SendMsgOption): Promise<void>;
|
|
@@ -110,12 +145,13 @@ export declare const useChannelStore: import("pinia").StoreDefinition<"channel",
|
|
|
110
145
|
resendTextMsg(options: QChatMessage): Promise<void>;
|
|
111
146
|
resendFileMsg(options: QChatMessage): Promise<void>;
|
|
112
147
|
resendImageMsg(options: QChatMessage): Promise<void>;
|
|
113
|
-
|
|
148
|
+
revokeMessage(options: RovokeMessageOptions): Promise<void>;
|
|
149
|
+
getWhiteBlackMembersPage(options: GetWhiteBlackMembersPageOptions): Promise<import("nim-web-sdk-ng/dist/v1/QCHAT_BROWSER_SDK/QChatChannelServiceInterface").GetWhiteBlackMembersPageResult>;
|
|
114
150
|
updateWhiteBlackMembers(options: UpdateWhiteBlackMembersOptions): Promise<void>;
|
|
115
151
|
updateChannelRole(options: UpdateChannelRoleOptions): Promise<void>;
|
|
116
|
-
updateMemberRole(options: UpdateMemberRoleOptions): Promise<
|
|
152
|
+
updateMemberRole(options: UpdateMemberRoleOptions): Promise<import("nim-web-sdk-ng/dist/v1/QCHAT_BROWSER_SDK/QChatRoleServiceInterface").QChatMemberRole>;
|
|
117
153
|
addMemberRole(options: AddMemberRoleOptions): Promise<void>;
|
|
118
|
-
getChannelRoles(options: GetChannelRolesOptions): Promise<
|
|
154
|
+
getChannelRoles(options: GetChannelRolesOptions): Promise<QChatChannelRole[]>;
|
|
119
155
|
/**
|
|
120
156
|
* 查询频道下成员列表(首次加载)
|
|
121
157
|
* @param options - 分页查询参数
|
|
@@ -128,7 +164,7 @@ export declare const useChannelStore: import("pinia").StoreDefinition<"channel",
|
|
|
128
164
|
* @returns 成员列表分页结果
|
|
129
165
|
*/
|
|
130
166
|
appendChannelMembers(options: GetMembersByPageQuery): Promise<GetMembersByPageResult>;
|
|
131
|
-
getMemberRoles(options: GetMemberRolesOptions): Promise<
|
|
132
|
-
getExistingAccidsOfMemberRoles(options: GetExistingAccidsOfMemberRolesOptions): Promise<
|
|
167
|
+
getMemberRoles(options: GetMemberRolesOptions): Promise<import("nim-web-sdk-ng/dist/v1/QCHAT_BROWSER_SDK/QChatRoleServiceInterface").QChatMemberRole[]>;
|
|
168
|
+
getExistingAccidsOfMemberRoles(options: GetExistingAccidsOfMemberRolesOptions): Promise<string[]>;
|
|
133
169
|
}>;
|
|
134
170
|
export {};
|
package/dist/stores/qchat.d.ts
CHANGED
|
@@ -178,7 +178,7 @@ export declare const useQChatStore: import("pinia").StoreDefinition<"qchatStore"
|
|
|
178
178
|
};
|
|
179
179
|
}) => Promise<any>;
|
|
180
180
|
fetchMembers: (serverId: string, timetag?: number) => Promise<void>;
|
|
181
|
-
joinServer: (serverId: string) => Promise<
|
|
181
|
+
joinServer: (serverId: string) => Promise<import("nim-web-sdk-ng/dist/v1/QCHAT_BROWSER_SDK/QChatServerServiceInterface").QChatServerApplyRecordInfo | undefined>;
|
|
182
182
|
leaveServer: (serverId: string) => Promise<void>;
|
|
183
183
|
}, "loading" | "servers" | "currentServerId" | "channelMap" | "categoryMap" | "currentChannelId" | "messageMap" | "memberMap" | "messageLoading" | "hasMoreMessage" | "unreadMap">, Pick<{
|
|
184
184
|
servers: import("vue").Ref<{
|
|
@@ -285,7 +285,7 @@ export declare const useQChatStore: import("pinia").StoreDefinition<"qchatStore"
|
|
|
285
285
|
};
|
|
286
286
|
}) => Promise<any>;
|
|
287
287
|
fetchMembers: (serverId: string, timetag?: number) => Promise<void>;
|
|
288
|
-
joinServer: (serverId: string) => Promise<
|
|
288
|
+
joinServer: (serverId: string) => Promise<import("nim-web-sdk-ng/dist/v1/QCHAT_BROWSER_SDK/QChatServerServiceInterface").QChatServerApplyRecordInfo | undefined>;
|
|
289
289
|
leaveServer: (serverId: string) => Promise<void>;
|
|
290
290
|
}, "currentChannel" | "currentServer" | "currentMessages" | "currentChannels" | "currentCategories" | "currentMembers">, Pick<{
|
|
291
291
|
servers: import("vue").Ref<{
|
|
@@ -392,6 +392,6 @@ export declare const useQChatStore: import("pinia").StoreDefinition<"qchatStore"
|
|
|
392
392
|
};
|
|
393
393
|
}) => Promise<any>;
|
|
394
394
|
fetchMembers: (serverId: string, timetag?: number) => Promise<void>;
|
|
395
|
-
joinServer: (serverId: string) => Promise<
|
|
395
|
+
joinServer: (serverId: string) => Promise<import("nim-web-sdk-ng/dist/v1/QCHAT_BROWSER_SDK/QChatServerServiceInterface").QChatServerApplyRecordInfo | undefined>;
|
|
396
396
|
leaveServer: (serverId: string) => Promise<void>;
|
|
397
397
|
}, "createServer" | "leaveServer" | "createChannel" | "reset" | "selectServer" | "selectChannel" | "setServers" | "addServer" | "removeServer" | "setChannels" | "addChannel" | "setCategories" | "setMessages" | "addMessage" | "prependMessages" | "updateMessageStatus" | "setMembers" | "addMember" | "removeMember" | "fetchServers" | "fetchChannels" | "fetchMessages" | "sendMessage" | "fetchMembers" | "joinServer">>;
|
package/dist/stores/sdk.d.ts
CHANGED
package/dist/stores/server.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export declare const useServerStore: import("pinia").StoreDefinition<"server", T
|
|
|
27
27
|
setServerUnReadCount(payload: any): void;
|
|
28
28
|
getSeverList(options: GetServersByPageOptions): Promise<void>;
|
|
29
29
|
appendServerList(options: GetServersByPageOptions): Promise<void>;
|
|
30
|
-
getSeverMembers(options: GetServerMembersByPageOptions): Promise<
|
|
30
|
+
getSeverMembers(options: GetServerMembersByPageOptions): Promise<GetServerMembersByPageResult | undefined>;
|
|
31
31
|
/**
|
|
32
32
|
* 通过 accid 批量获取服务器成员信息
|
|
33
33
|
* @param options - 包含 serverId 和 accids 的查询参数
|
|
@@ -37,34 +37,34 @@ export declare const useServerStore: import("pinia").StoreDefinition<"server", T
|
|
|
37
37
|
serverId: string;
|
|
38
38
|
accids: string[];
|
|
39
39
|
}): Promise<import("../api/im/type").ServerMemberInfo[]>;
|
|
40
|
-
appendSeverMembers(options: GetServerMembersByPageOptions): Promise<
|
|
40
|
+
appendSeverMembers(options: GetServerMembersByPageOptions): Promise<GetServerMembersByPageResult | undefined>;
|
|
41
41
|
appendSeverMembersByKeyword(options: {
|
|
42
42
|
keyword: string;
|
|
43
43
|
}): Promise<QChatServerMember[]>;
|
|
44
|
-
getCurMemberRoles(options: GetServerRolesByAccidOptions): Promise<
|
|
45
|
-
getServers(options: GetServersOptions): Promise<
|
|
46
|
-
deleteServers(options: DeleteServerOptions): Promise<
|
|
47
|
-
applySeverJoin(options: ApplyServerJoinOptions): Promise<
|
|
48
|
-
createServer(options: CreateServerOptions): Promise<
|
|
49
|
-
updateServer(options: UpdateServerOptions): Promise<
|
|
44
|
+
getCurMemberRoles(options: GetServerRolesByAccidOptions): Promise<Omit<QChatServerRole, "auths">[] | undefined>;
|
|
45
|
+
getServers(options: GetServersOptions): Promise<ServerInfo[] | undefined>;
|
|
46
|
+
deleteServers(options: DeleteServerOptions): Promise<void>;
|
|
47
|
+
applySeverJoin(options: ApplyServerJoinOptions): Promise<import("nim-web-sdk-ng/dist/v1/QCHAT_BROWSER_SDK/QChatServerServiceInterface").QChatServerApplyRecordInfo | undefined>;
|
|
48
|
+
createServer(options: CreateServerOptions): Promise<ServerInfo | undefined>;
|
|
49
|
+
updateServer(options: UpdateServerOptions): Promise<ServerInfo | undefined>;
|
|
50
50
|
deleteServerTip(options: SendSystemNotificationOptions): Promise<void>;
|
|
51
|
-
getServerRoles(options: GetServerRolesOptions): Promise<
|
|
52
|
-
addChannelRole(options: AddChannelRoleOptions): Promise<
|
|
53
|
-
createServerRole(options: CreateServerRoleOptions): Promise<
|
|
54
|
-
updateServerRolePriorities(options: UpdateServerRolePrioritiesOptions): Promise<
|
|
55
|
-
subscribeServer(options: SubscribeServerOptions): Promise<
|
|
56
|
-
deleteServerRole(options: DeleteServerRoleOptions): Promise<
|
|
57
|
-
updateServerRole(options: UpdateServerRoleOptions): Promise<
|
|
58
|
-
getMembersFromServerRole(options: GetMembersFromServerRoleOptions): Promise<
|
|
59
|
-
addMembersToServerRole(options: AddMembersToServerRoleOptions): Promise<
|
|
60
|
-
removeMembersFromServerRole(options: RemoveMembersFromServerRoleOptions): Promise<
|
|
61
|
-
getServerRolesByAccid(options: GetServerRolesByAccidOptions): Promise<
|
|
62
|
-
updateMemberRole(options: UpdateMemberRoleOptions): Promise<
|
|
63
|
-
removeMemberRole(options: RemoveMemberRoleOptions): Promise<
|
|
64
|
-
updateMyMemberInfo(options: UpdateMyMemberInfoOptions): Promise<
|
|
65
|
-
checkPermissionMessage(options: CheckPermissionOptions): Promise<
|
|
66
|
-
removeMembersFromServer(options: KickServerMembersOptions): Promise<
|
|
67
|
-
getMemberRoles(options: GetMemberRolesOptions): Promise<
|
|
68
|
-
leaveServer(options: LeaveServerOptions): Promise<
|
|
51
|
+
getServerRoles(options: GetServerRolesOptions): Promise<import("nim-web-sdk-ng/dist/v1/QCHAT_BROWSER_SDK/QChatRoleServiceInterface").GetServerRolesResult | undefined>;
|
|
52
|
+
addChannelRole(options: AddChannelRoleOptions): Promise<import("nim-web-sdk-ng/dist/v1/QCHAT_BROWSER_SDK/QChatRoleServiceInterface").QChatChannelRole | undefined>;
|
|
53
|
+
createServerRole(options: CreateServerRoleOptions): Promise<QChatServerRole | undefined>;
|
|
54
|
+
updateServerRolePriorities(options: UpdateServerRolePrioritiesOptions): Promise<QChatServerRole[] | undefined>;
|
|
55
|
+
subscribeServer(options: SubscribeServerOptions): Promise<void | import("nim-web-sdk-ng/dist/v1/QCHAT_BROWSER_SDK/QChatServerServiceInterface").SubscribeServerResult>;
|
|
56
|
+
deleteServerRole(options: DeleteServerRoleOptions): Promise<void>;
|
|
57
|
+
updateServerRole(options: UpdateServerRoleOptions): Promise<QChatServerRole | undefined>;
|
|
58
|
+
getMembersFromServerRole(options: GetMembersFromServerRoleOptions): Promise<import("nim-web-sdk-ng/dist/v1/QCHAT_BROWSER_SDK/QChatRoleServiceInterface").QChatServerRoleMember[] | undefined>;
|
|
59
|
+
addMembersToServerRole(options: AddMembersToServerRoleOptions): Promise<import("nim-web-sdk-ng/dist/v1/QCHAT_BROWSER_SDK/QChatRoleServiceInterface").AddMembersToServerRoleResult | undefined>;
|
|
60
|
+
removeMembersFromServerRole(options: RemoveMembersFromServerRoleOptions): Promise<import("nim-web-sdk-ng/dist/v1/QCHAT_BROWSER_SDK/QChatRoleServiceInterface").RemoveMembersFromServerRoleResult | undefined>;
|
|
61
|
+
getServerRolesByAccid(options: GetServerRolesByAccidOptions): Promise<Omit<QChatServerRole, "auths">[] | undefined>;
|
|
62
|
+
updateMemberRole(options: UpdateMemberRoleOptions): Promise<import("nim-web-sdk-ng/dist/v1/QCHAT_BROWSER_SDK/QChatRoleServiceInterface").QChatMemberRole | undefined>;
|
|
63
|
+
removeMemberRole(options: RemoveMemberRoleOptions): Promise<void>;
|
|
64
|
+
updateMyMemberInfo(options: UpdateMyMemberInfoOptions): Promise<MemberInfo | undefined>;
|
|
65
|
+
checkPermissionMessage(options: CheckPermissionOptions): Promise<boolean | undefined>;
|
|
66
|
+
removeMembersFromServer(options: KickServerMembersOptions): Promise<void>;
|
|
67
|
+
getMemberRoles(options: GetMemberRolesOptions): Promise<import("nim-web-sdk-ng/dist/v1/QCHAT_BROWSER_SDK/QChatRoleServiceInterface").QChatMemberRole[] | undefined>;
|
|
68
|
+
leaveServer(options: LeaveServerOptions): Promise<void>;
|
|
69
69
|
}>;
|
|
70
70
|
export {};
|