yx-web-sdk 0.0.21 → 0.0.23

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 (26) 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-content/index.vue.d.ts +2 -2
  8. package/dist/index/style4.css +5 -2
  9. package/dist/index/style6.css +69 -69
  10. package/dist/index/style7.css +2 -2
  11. package/dist/{index-DME8_VYv.mjs → index-C4E0XZdw.mjs} +2 -2
  12. package/dist/{index-Dwglj7_M.mjs → index-CwFsDdl5.mjs} +1 -1
  13. package/dist/{index-BPnLB3av.mjs → index-DDCNub37.mjs} +1 -1
  14. package/dist/index-entry/index.js +4 -4
  15. package/dist/{index.vue_vue_type_script_setup_true_lang-CD6o8jT4.mjs → index.vue_vue_type_script_setup_true_lang-B4HvNhJp.mjs} +5 -4
  16. package/dist/{index.vue_vue_type_style_index_0_lang-iBkYSdDj.mjs → index.vue_vue_type_style_index_0_lang-BN-dkKAR.mjs} +29 -12
  17. package/dist/{index.vue_vue_type_style_index_0_lang-BJGCxPce.mjs → index.vue_vue_type_style_index_0_lang-CtXuRziq.mjs} +3 -3
  18. package/dist/{index.vue_vue_type_style_index_0_lang-CsNgkPt9.mjs → index.vue_vue_type_style_index_0_lang-DOnNj1Mm.mjs} +3 -2
  19. package/dist/{index.vue_vue_type_style_index_0_lang-BaKNB-4q.mjs → index.vue_vue_type_style_index_0_lang-Dx16RQv1.mjs} +1 -0
  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 +1 -0
  23. package/dist/style.css +76 -73
  24. package/dist/yx-web-sdk.es.js +33 -13
  25. package/dist/yx-web-sdk.umd.js +33 -13
  26. package/package.json +1 -1
@@ -38436,6 +38436,7 @@ const useChannelStore = defineStore("channel", {
38436
38436
  channelId: this.currentChannel.channelId,
38437
38437
  type: "image",
38438
38438
  file: options.file,
38439
+ ext: (options == null ? void 0 : options.ext) ? JSON.stringify(options == null ? void 0 : options.ext) : void 0,
38439
38440
  onUploadStart: options.onUploadStart,
38440
38441
  onUploadDone: options.onUploadDone,
38441
38442
  onSendBefore: (msg2) => {
@@ -38880,6 +38881,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
38880
38881
  emits: ["resendText", "resendImg", "resendFile", "quote", "contextMenuSwitch", "quoteMsgClick", "revokeMessage"],
38881
38882
  setup(__props, { emit: __emit }) {
38882
38883
  const serverStore = useServerStore();
38884
+ const IMG_EXT = ["png", "jpg", "jpeg"];
38883
38885
  const props = __props;
38884
38886
  const nowTime = ref(Date.now());
38885
38887
  let timer = null;
@@ -39176,7 +39178,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
39176
39178
  }, [..._cache[1] || (_cache[1] = [
39177
39179
  createElementVNode("div", { class: "textMsg" }, toDisplayString("暂不支持该消息"), -1)
39178
39180
  ])], 2)),
39179
- __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$3, [
39181
+ __props.msg.type === "text" && IMG_EXT.includes(((_j = (_i = __props.msg) == null ? void 0 : _i.attach) == null ? void 0 : _j.ext) || "") ? (openBlock(), createElementBlock("div", _hoisted_14$3, [
39180
39182
  ((_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), {
39181
39183
  key: 0,
39182
39184
  class: "imgMsg",
@@ -39974,6 +39976,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
39974
39976
  setup(__props, { emit: __emit }) {
39975
39977
  const router = useRouter();
39976
39978
  const channelStore = useChannelStore();
39979
+ const IMG_EXT = ["png", "jpg", "jpeg"];
39977
39980
  const Textarea = Input.TextArea;
39978
39981
  const props = __props;
39979
39982
  const emit = __emit;
@@ -40181,21 +40184,36 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
40181
40184
  }
40182
40185
  };
40183
40186
  const handleSendText = () => {
40187
+ var _a;
40184
40188
  const text = filterStr(curText.value.trim());
40185
40189
  if (text) {
40186
- emit("sendText", text, {
40187
- ext: {
40188
- quoteMsg: quoteMsg.value
40189
- },
40190
+ if (attachment.value) {
40191
+ delete attachment.value.__file;
40192
+ }
40193
+ const sendOption = {
40190
40194
  mentionAccids: mentionAccids.value,
40191
40195
  attach: attachment.value
40192
40196
  // 传递附件
40193
- });
40197
+ };
40198
+ if (quoteMsg.value) {
40199
+ sendOption.ext = { quoteMsg: quoteMsg.value };
40200
+ }
40201
+ emit("sendText", text, sendOption);
40194
40202
  curText.value = "";
40195
40203
  quoteMsg.value = void 0;
40196
40204
  attachment.value = void 0;
40197
40205
  scrollToBottomAfterSend();
40198
40206
  }
40207
+ if (attachment.value && IMG_EXT.includes(attachment.value.ext) && ((_a = attachment.value) == null ? void 0 : _a.__file)) {
40208
+ let sendOption;
40209
+ if (quoteMsg.value) {
40210
+ sendOption = { ext: { quoteMsg: quoteMsg.value } };
40211
+ }
40212
+ emit("sendImg", attachment.value.__file, sendOption);
40213
+ quoteMsg.value = void 0;
40214
+ attachment.value = void 0;
40215
+ scrollToBottomAfterSend();
40216
+ }
40199
40217
  };
40200
40218
  const scrollHandler = async (e) => {
40201
40219
  var _a;
@@ -40254,7 +40272,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
40254
40272
  };
40255
40273
  const uploadImgHandler = async (file) => {
40256
40274
  if (!isLt(file.size, MAX_IMG_SIZE)) {
40257
- message.error(`图片大小最大支持${MAX_IMG_SIZE}M`);
40275
+ message.error(`图片大小最大支持${MAX_IMG_SIZE}MB`);
40258
40276
  return false;
40259
40277
  }
40260
40278
  attachmentUploading.value = true;
@@ -40268,6 +40286,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
40268
40286
  attachmentUploading.value = false;
40269
40287
  }
40270
40288
  });
40289
+ uploadResult.__file = file;
40271
40290
  attachment.value = uploadResult;
40272
40291
  } catch (error) {
40273
40292
  console.error("上传图片失败:", error);
@@ -40513,7 +40532,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
40513
40532
  ])) : createCommentVNode("", true)
40514
40533
  ])) : createCommentVNode("", true),
40515
40534
  attachment.value ? (openBlock(), createElementBlock("div", _hoisted_14$2, [
40516
- ["jpg", "jpeg", "png", "gif"].includes(attachment.value.ext || "") && attachment.value.url ? (openBlock(), createElementBlock("div", _hoisted_15$2, [
40535
+ IMG_EXT.includes(attachment.value.ext || "") && attachment.value.url ? (openBlock(), createElementBlock("div", _hoisted_15$2, [
40517
40536
  createElementVNode("div", _hoisted_16$1, [
40518
40537
  createVNode(unref(DeleteOutlined), {
40519
40538
  class: "chatroomInputAttachmentDeleteBtn",
@@ -40588,7 +40607,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
40588
40607
  createVNode(unref(Upload), {
40589
40608
  "before-upload": uploadImgHandler,
40590
40609
  "show-upload-list": false,
40591
- accept: ".jpg,.png,.jpeg",
40610
+ accept: IMG_EXT.map((ext) => `.${ext}`).join(","),
40592
40611
  disabled: __props.sendDisabled || attachmentUploading.value,
40593
40612
  class: "chatroomInputUpload"
40594
40613
  }, {
@@ -40623,7 +40642,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
40623
40642
  }, 8, ["loading", "disabled"])
40624
40643
  ]),
40625
40644
  _: 1
40626
- }, 8, ["disabled"]),
40645
+ }, 8, ["accept", "disabled"]),
40627
40646
  _cache[6] || (_cache[6] = createElementVNode("span", { class: "lineSeparator" }, null, -1)),
40628
40647
  createVNode(unref(Button), {
40629
40648
  class: "chatroomButtonArrowUp",
@@ -40736,6 +40755,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
40736
40755
  imgUploading.value = true;
40737
40756
  channelStore.sendImageMsg({
40738
40757
  file,
40758
+ ext: option == null ? void 0 : option.ext,
40739
40759
  onUploadStart: () => {
40740
40760
  imgUploading.value = true;
40741
40761
  },
@@ -40781,8 +40801,8 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
40781
40801
  const handleSendText = (text, option) => {
40782
40802
  checkSendAuth("textMsg", text, option);
40783
40803
  };
40784
- const handleSendImg = (file) => {
40785
- checkSendAuth("SendImg", file);
40804
+ const handleSendImg = (file, option) => {
40805
+ checkSendAuth("SendImg", file, option);
40786
40806
  };
40787
40807
  const handleSendFile = (file) => {
40788
40808
  checkSendAuth("SendFile", file);
@@ -41674,7 +41694,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
41674
41694
  };
41675
41695
  }
41676
41696
  });
41677
- const ServerChannelSidebar = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-961f30d7"]]);
41697
+ const ServerChannelSidebar = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-83471ee8"]]);
41678
41698
  const _hoisted_1$1 = { class: "members-header" };
41679
41699
  const _hoisted_2$1 = {
41680
41700
  key: 0,
@@ -38433,6 +38433,7 @@
38433
38433
  channelId: this.currentChannel.channelId,
38434
38434
  type: "image",
38435
38435
  file: options.file,
38436
+ ext: (options == null ? void 0 : options.ext) ? JSON.stringify(options == null ? void 0 : options.ext) : void 0,
38436
38437
  onUploadStart: options.onUploadStart,
38437
38438
  onUploadDone: options.onUploadDone,
38438
38439
  onSendBefore: (msg2) => {
@@ -38877,6 +38878,7 @@
38877
38878
  emits: ["resendText", "resendImg", "resendFile", "quote", "contextMenuSwitch", "quoteMsgClick", "revokeMessage"],
38878
38879
  setup(__props, { emit: __emit }) {
38879
38880
  const serverStore = useServerStore();
38881
+ const IMG_EXT = ["png", "jpg", "jpeg"];
38880
38882
  const props = __props;
38881
38883
  const nowTime = vue.ref(Date.now());
38882
38884
  let timer = null;
@@ -39173,7 +39175,7 @@
39173
39175
  }, [..._cache[1] || (_cache[1] = [
39174
39176
  vue.createElementVNode("div", { class: "textMsg" }, vue.toDisplayString("暂不支持该消息"), -1)
39175
39177
  ])], 2)),
39176
- __props.msg.type === "text" && ["jpg", "jpeg", "png", "gif"].includes(((_j = (_i = __props.msg) == null ? void 0 : _i.attach) == null ? void 0 : _j.ext) || "") ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_14$3, [
39178
+ __props.msg.type === "text" && IMG_EXT.includes(((_j = (_i = __props.msg) == null ? void 0 : _i.attach) == null ? void 0 : _j.ext) || "") ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_14$3, [
39177
39179
  ((_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 ? (vue.openBlock(), vue.createBlock(vue.unref(antDesignVue.Image), {
39178
39180
  key: 0,
39179
39181
  class: "imgMsg",
@@ -39971,6 +39973,7 @@
39971
39973
  setup(__props, { emit: __emit }) {
39972
39974
  const router = vueRouter.useRouter();
39973
39975
  const channelStore = useChannelStore();
39976
+ const IMG_EXT = ["png", "jpg", "jpeg"];
39974
39977
  const Textarea = antDesignVue.Input.TextArea;
39975
39978
  const props = __props;
39976
39979
  const emit = __emit;
@@ -40178,21 +40181,36 @@
40178
40181
  }
40179
40182
  };
40180
40183
  const handleSendText = () => {
40184
+ var _a;
40181
40185
  const text = filterStr(curText.value.trim());
40182
40186
  if (text) {
40183
- emit("sendText", text, {
40184
- ext: {
40185
- quoteMsg: quoteMsg.value
40186
- },
40187
+ if (attachment.value) {
40188
+ delete attachment.value.__file;
40189
+ }
40190
+ const sendOption = {
40187
40191
  mentionAccids: mentionAccids.value,
40188
40192
  attach: attachment.value
40189
40193
  // 传递附件
40190
- });
40194
+ };
40195
+ if (quoteMsg.value) {
40196
+ sendOption.ext = { quoteMsg: quoteMsg.value };
40197
+ }
40198
+ emit("sendText", text, sendOption);
40191
40199
  curText.value = "";
40192
40200
  quoteMsg.value = void 0;
40193
40201
  attachment.value = void 0;
40194
40202
  scrollToBottomAfterSend();
40195
40203
  }
40204
+ if (attachment.value && IMG_EXT.includes(attachment.value.ext) && ((_a = attachment.value) == null ? void 0 : _a.__file)) {
40205
+ let sendOption;
40206
+ if (quoteMsg.value) {
40207
+ sendOption = { ext: { quoteMsg: quoteMsg.value } };
40208
+ }
40209
+ emit("sendImg", attachment.value.__file, sendOption);
40210
+ quoteMsg.value = void 0;
40211
+ attachment.value = void 0;
40212
+ scrollToBottomAfterSend();
40213
+ }
40196
40214
  };
40197
40215
  const scrollHandler = async (e) => {
40198
40216
  var _a;
@@ -40251,7 +40269,7 @@
40251
40269
  };
40252
40270
  const uploadImgHandler = async (file) => {
40253
40271
  if (!isLt(file.size, MAX_IMG_SIZE)) {
40254
- antDesignVue.message.error(`图片大小最大支持${MAX_IMG_SIZE}M`);
40272
+ antDesignVue.message.error(`图片大小最大支持${MAX_IMG_SIZE}MB`);
40255
40273
  return false;
40256
40274
  }
40257
40275
  attachmentUploading.value = true;
@@ -40265,6 +40283,7 @@
40265
40283
  attachmentUploading.value = false;
40266
40284
  }
40267
40285
  });
40286
+ uploadResult.__file = file;
40268
40287
  attachment.value = uploadResult;
40269
40288
  } catch (error) {
40270
40289
  console.error("上传图片失败:", error);
@@ -40510,7 +40529,7 @@
40510
40529
  ])) : vue.createCommentVNode("", true)
40511
40530
  ])) : vue.createCommentVNode("", true),
40512
40531
  attachment.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_14$2, [
40513
- ["jpg", "jpeg", "png", "gif"].includes(attachment.value.ext || "") && attachment.value.url ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_15$2, [
40532
+ IMG_EXT.includes(attachment.value.ext || "") && attachment.value.url ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_15$2, [
40514
40533
  vue.createElementVNode("div", _hoisted_16$1, [
40515
40534
  vue.createVNode(vue.unref(DeleteOutlined), {
40516
40535
  class: "chatroomInputAttachmentDeleteBtn",
@@ -40585,7 +40604,7 @@
40585
40604
  vue.createVNode(vue.unref(antDesignVue.Upload), {
40586
40605
  "before-upload": uploadImgHandler,
40587
40606
  "show-upload-list": false,
40588
- accept: ".jpg,.png,.jpeg",
40607
+ accept: IMG_EXT.map((ext) => `.${ext}`).join(","),
40589
40608
  disabled: __props.sendDisabled || attachmentUploading.value,
40590
40609
  class: "chatroomInputUpload"
40591
40610
  }, {
@@ -40620,7 +40639,7 @@
40620
40639
  }, 8, ["loading", "disabled"])
40621
40640
  ]),
40622
40641
  _: 1
40623
- }, 8, ["disabled"]),
40642
+ }, 8, ["accept", "disabled"]),
40624
40643
  _cache[6] || (_cache[6] = vue.createElementVNode("span", { class: "lineSeparator" }, null, -1)),
40625
40644
  vue.createVNode(vue.unref(antDesignVue.Button), {
40626
40645
  class: "chatroomButtonArrowUp",
@@ -40733,6 +40752,7 @@
40733
40752
  imgUploading.value = true;
40734
40753
  channelStore.sendImageMsg({
40735
40754
  file,
40755
+ ext: option == null ? void 0 : option.ext,
40736
40756
  onUploadStart: () => {
40737
40757
  imgUploading.value = true;
40738
40758
  },
@@ -40778,8 +40798,8 @@
40778
40798
  const handleSendText = (text, option) => {
40779
40799
  checkSendAuth("textMsg", text, option);
40780
40800
  };
40781
- const handleSendImg = (file) => {
40782
- checkSendAuth("SendImg", file);
40801
+ const handleSendImg = (file, option) => {
40802
+ checkSendAuth("SendImg", file, option);
40783
40803
  };
40784
40804
  const handleSendFile = (file) => {
40785
40805
  checkSendAuth("SendFile", file);
@@ -41671,7 +41691,7 @@
41671
41691
  };
41672
41692
  }
41673
41693
  });
41674
- const ServerChannelSidebar = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-961f30d7"]]);
41694
+ const ServerChannelSidebar = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-83471ee8"]]);
41675
41695
  const _hoisted_1$1 = { class: "members-header" };
41676
41696
  const _hoisted_2$1 = {
41677
41697
  key: 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yx-web-sdk",
3
- "version": "0.0.21",
3
+ "version": "0.0.23",
4
4
  "private": false,
5
5
  "main": "dist/yx-web-sdk.umd.js",
6
6
  "module": "dist/yx-web-sdk.es.js",