@koushuang/im 0.1.1-preview.3

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 (200) hide show
  1. package/dist/_virtual/_plugin-vue_export-helper.cjs +2 -0
  2. package/dist/_virtual/_plugin-vue_export-helper.cjs.map +1 -0
  3. package/dist/_virtual/_plugin-vue_export-helper.mjs +10 -0
  4. package/dist/_virtual/_plugin-vue_export-helper.mjs.map +1 -0
  5. package/dist/api/auth.cjs +2 -0
  6. package/dist/api/auth.cjs.map +1 -0
  7. package/dist/api/auth.d.ts +48 -0
  8. package/dist/api/auth.mjs +30 -0
  9. package/dist/api/auth.mjs.map +1 -0
  10. package/dist/core/client.cjs +2 -0
  11. package/dist/core/client.cjs.map +1 -0
  12. package/dist/core/client.d.ts +38 -0
  13. package/dist/core/client.mjs +117 -0
  14. package/dist/core/client.mjs.map +1 -0
  15. package/dist/core/createClient.cjs +2 -0
  16. package/dist/core/createClient.cjs.map +1 -0
  17. package/dist/core/createClient.d.ts +6 -0
  18. package/dist/core/createClient.mjs +9 -0
  19. package/dist/core/createClient.mjs.map +1 -0
  20. package/dist/core/events.d.ts +36 -0
  21. package/dist/core/index.d.ts +4 -0
  22. package/dist/core/types.d.ts +127 -0
  23. package/dist/http/createHttp.cjs +2 -0
  24. package/dist/http/createHttp.cjs.map +1 -0
  25. package/dist/http/createHttp.d.ts +5 -0
  26. package/dist/http/createHttp.mjs +29 -0
  27. package/dist/http/createHttp.mjs.map +1 -0
  28. package/dist/http/types.cjs +2 -0
  29. package/dist/http/types.cjs.map +1 -0
  30. package/dist/http/types.d.ts +14 -0
  31. package/dist/http/types.mjs +9 -0
  32. package/dist/http/types.mjs.map +1 -0
  33. package/dist/index.cjs +2 -0
  34. package/dist/index.cjs.map +1 -0
  35. package/dist/index.d.ts +6 -0
  36. package/dist/index.mjs +38 -0
  37. package/dist/index.mjs.map +1 -0
  38. package/dist/mock.cjs +2 -0
  39. package/dist/mock.cjs.map +1 -0
  40. package/dist/mock.d.ts +2 -0
  41. package/dist/mock.mjs +7 -0
  42. package/dist/mock.mjs.map +1 -0
  43. package/dist/node_modules/.pnpm/mitt@3.0.1/node_modules/mitt/dist/mitt.cjs +2 -0
  44. package/dist/node_modules/.pnpm/mitt@3.0.1/node_modules/mitt/dist/mitt.cjs.map +1 -0
  45. package/dist/node_modules/.pnpm/mitt@3.0.1/node_modules/mitt/dist/mitt.mjs +20 -0
  46. package/dist/node_modules/.pnpm/mitt@3.0.1/node_modules/mitt/dist/mitt.mjs.map +1 -0
  47. package/dist/protocol/envelope.cjs +2 -0
  48. package/dist/protocol/envelope.cjs.map +1 -0
  49. package/dist/protocol/envelope.d.ts +3 -0
  50. package/dist/protocol/envelope.mjs +19 -0
  51. package/dist/protocol/envelope.mjs.map +1 -0
  52. package/dist/protocol/guards.cjs +2 -0
  53. package/dist/protocol/guards.cjs.map +1 -0
  54. package/dist/protocol/guards.d.ts +2 -0
  55. package/dist/protocol/guards.mjs +7 -0
  56. package/dist/protocol/guards.mjs.map +1 -0
  57. package/dist/protocol/index.d.ts +2 -0
  58. package/dist/shared/index.d.ts +1 -0
  59. package/dist/shared/visibility.cjs +2 -0
  60. package/dist/shared/visibility.cjs.map +1 -0
  61. package/dist/shared/visibility.d.ts +2 -0
  62. package/dist/shared/visibility.mjs +10 -0
  63. package/dist/shared/visibility.mjs.map +1 -0
  64. package/dist/style.cjs +2 -0
  65. package/dist/style.cjs.map +1 -0
  66. package/dist/style.css +12 -0
  67. package/dist/style.d.ts +1 -0
  68. package/dist/style.mjs +2 -0
  69. package/dist/style.mjs.map +1 -0
  70. package/dist/tui/mapper.cjs +2 -0
  71. package/dist/tui/mapper.cjs.map +1 -0
  72. package/dist/tui/mapper.d.ts +3 -0
  73. package/dist/tui/mapper.mjs +25 -0
  74. package/dist/tui/mapper.mjs.map +1 -0
  75. package/dist/tui/store.cjs +2 -0
  76. package/dist/tui/store.cjs.map +1 -0
  77. package/dist/tui/store.d.ts +2 -0
  78. package/dist/tui/store.mjs +19 -0
  79. package/dist/tui/store.mjs.map +1 -0
  80. package/dist/tui/tim.cjs +2 -0
  81. package/dist/tui/tim.cjs.map +1 -0
  82. package/dist/tui/tim.d.ts +2 -0
  83. package/dist/tui/tim.mjs +116 -0
  84. package/dist/tui/tim.mjs.map +1 -0
  85. package/dist/ui/components/FontSizeControl.vue.cjs +2 -0
  86. package/dist/ui/components/FontSizeControl.vue.cjs.map +1 -0
  87. package/dist/ui/components/FontSizeControl.vue.d.ts +13 -0
  88. package/dist/ui/components/FontSizeControl.vue.mjs +8 -0
  89. package/dist/ui/components/FontSizeControl.vue.mjs.map +1 -0
  90. package/dist/ui/components/FontSizeControl.vue2.cjs +2 -0
  91. package/dist/ui/components/FontSizeControl.vue2.cjs.map +1 -0
  92. package/dist/ui/components/FontSizeControl.vue2.mjs +45 -0
  93. package/dist/ui/components/FontSizeControl.vue2.mjs.map +1 -0
  94. package/dist/ui/components/ImChatRoom.vue.cjs +2 -0
  95. package/dist/ui/components/ImChatRoom.vue.cjs.map +1 -0
  96. package/dist/ui/components/ImChatRoom.vue.d.ts +38 -0
  97. package/dist/ui/components/ImChatRoom.vue.mjs +55 -0
  98. package/dist/ui/components/ImChatRoom.vue.mjs.map +1 -0
  99. package/dist/ui/components/ImChatRoom.vue2.cjs +2 -0
  100. package/dist/ui/components/ImChatRoom.vue2.cjs.map +1 -0
  101. package/dist/ui/components/ImChatRoom.vue2.mjs +5 -0
  102. package/dist/ui/components/ImChatRoom.vue2.mjs.map +1 -0
  103. package/dist/ui/components/ImKit.vue.cjs +2 -0
  104. package/dist/ui/components/ImKit.vue.cjs.map +1 -0
  105. package/dist/ui/components/ImKit.vue.d.ts +17 -0
  106. package/dist/ui/components/ImKit.vue.mjs +17 -0
  107. package/dist/ui/components/ImKit.vue.mjs.map +1 -0
  108. package/dist/ui/components/ImKit.vue2.cjs +2 -0
  109. package/dist/ui/components/ImKit.vue2.cjs.map +1 -0
  110. package/dist/ui/components/ImKit.vue2.mjs +5 -0
  111. package/dist/ui/components/ImKit.vue2.mjs.map +1 -0
  112. package/dist/ui/components/ImMessageInput.vue.cjs +2 -0
  113. package/dist/ui/components/ImMessageInput.vue.cjs.map +1 -0
  114. package/dist/ui/components/ImMessageInput.vue.d.ts +22 -0
  115. package/dist/ui/components/ImMessageInput.vue.mjs +5 -0
  116. package/dist/ui/components/ImMessageInput.vue.mjs.map +1 -0
  117. package/dist/ui/components/ImMessageInput.vue2.cjs +2 -0
  118. package/dist/ui/components/ImMessageInput.vue2.cjs.map +1 -0
  119. package/dist/ui/components/ImMessageInput.vue2.mjs +33 -0
  120. package/dist/ui/components/ImMessageInput.vue2.mjs.map +1 -0
  121. package/dist/ui/components/PcConversationListSplit.vue.cjs +2 -0
  122. package/dist/ui/components/PcConversationListSplit.vue.cjs.map +1 -0
  123. package/dist/ui/components/PcConversationListSplit.vue.d.ts +8 -0
  124. package/dist/ui/components/PcConversationListSplit.vue.mjs +8 -0
  125. package/dist/ui/components/PcConversationListSplit.vue.mjs.map +1 -0
  126. package/dist/ui/components/PcConversationListSplit.vue2.cjs +2 -0
  127. package/dist/ui/components/PcConversationListSplit.vue2.cjs.map +1 -0
  128. package/dist/ui/components/PcConversationListSplit.vue2.mjs +90 -0
  129. package/dist/ui/components/PcConversationListSplit.vue2.mjs.map +1 -0
  130. package/dist/ui/components/SysMessage.vue.cjs +2 -0
  131. package/dist/ui/components/SysMessage.vue.cjs.map +1 -0
  132. package/dist/ui/components/SysMessage.vue.d.ts +19 -0
  133. package/dist/ui/components/SysMessage.vue.mjs +8 -0
  134. package/dist/ui/components/SysMessage.vue.mjs.map +1 -0
  135. package/dist/ui/components/SysMessage.vue2.cjs +2 -0
  136. package/dist/ui/components/SysMessage.vue2.cjs.map +1 -0
  137. package/dist/ui/components/SysMessage.vue2.mjs +42 -0
  138. package/dist/ui/components/SysMessage.vue2.mjs.map +1 -0
  139. package/dist/ui/index.d.ts +8 -0
  140. package/dist/ui/layouts/ChatLayoutH5.vue.cjs +2 -0
  141. package/dist/ui/layouts/ChatLayoutH5.vue.cjs.map +1 -0
  142. package/dist/ui/layouts/ChatLayoutH5.vue.d.ts +22 -0
  143. package/dist/ui/layouts/ChatLayoutH5.vue.mjs +8 -0
  144. package/dist/ui/layouts/ChatLayoutH5.vue.mjs.map +1 -0
  145. package/dist/ui/layouts/ChatLayoutH5.vue2.cjs +2 -0
  146. package/dist/ui/layouts/ChatLayoutH5.vue2.cjs.map +1 -0
  147. package/dist/ui/layouts/ChatLayoutH5.vue2.mjs +49 -0
  148. package/dist/ui/layouts/ChatLayoutH5.vue2.mjs.map +1 -0
  149. package/dist/ui/layouts/ChatLayoutPc.vue.cjs +2 -0
  150. package/dist/ui/layouts/ChatLayoutPc.vue.cjs.map +1 -0
  151. package/dist/ui/layouts/ChatLayoutPc.vue.d.ts +39 -0
  152. package/dist/ui/layouts/ChatLayoutPc.vue.mjs +8 -0
  153. package/dist/ui/layouts/ChatLayoutPc.vue.mjs.map +1 -0
  154. package/dist/ui/layouts/ChatLayoutPc.vue2.cjs +2 -0
  155. package/dist/ui/layouts/ChatLayoutPc.vue2.cjs.map +1 -0
  156. package/dist/ui/layouts/ChatLayoutPc.vue2.mjs +66 -0
  157. package/dist/ui/layouts/ChatLayoutPc.vue2.mjs.map +1 -0
  158. package/dist/ui/mock/consultMeta.cjs +2 -0
  159. package/dist/ui/mock/consultMeta.cjs.map +1 -0
  160. package/dist/ui/mock/consultMeta.d.ts +9 -0
  161. package/dist/ui/mock/consultMeta.mjs +29 -0
  162. package/dist/ui/mock/consultMeta.mjs.map +1 -0
  163. package/dist/ui/mock/mock-driver.cjs +2 -0
  164. package/dist/ui/mock/mock-driver.cjs.map +1 -0
  165. package/dist/ui/mock/mock-driver.d.ts +2 -0
  166. package/dist/ui/mock/mock-driver.mjs +51 -0
  167. package/dist/ui/mock/mock-driver.mjs.map +1 -0
  168. package/dist/ui/mock/mock.d.ts +2 -0
  169. package/dist/ui/renderers/MessageProxy.cjs +2 -0
  170. package/dist/ui/renderers/MessageProxy.cjs.map +1 -0
  171. package/dist/ui/renderers/MessageProxy.d.ts +24 -0
  172. package/dist/ui/renderers/MessageProxy.mjs +36 -0
  173. package/dist/ui/renderers/MessageProxy.mjs.map +1 -0
  174. package/dist/ui/renderers/createMessageComponent.cjs +2 -0
  175. package/dist/ui/renderers/createMessageComponent.cjs.map +1 -0
  176. package/dist/ui/renderers/createMessageComponent.d.ts +4 -0
  177. package/dist/ui/renderers/createMessageComponent.mjs +15 -0
  178. package/dist/ui/renderers/createMessageComponent.mjs.map +1 -0
  179. package/dist/ui/renderers/historyFilter.cjs +2 -0
  180. package/dist/ui/renderers/historyFilter.cjs.map +1 -0
  181. package/dist/ui/renderers/historyFilter.d.ts +10 -0
  182. package/dist/ui/renderers/historyFilter.mjs +41 -0
  183. package/dist/ui/renderers/historyFilter.mjs.map +1 -0
  184. package/dist/ui/renderers/registry.cjs +2 -0
  185. package/dist/ui/renderers/registry.cjs.map +1 -0
  186. package/dist/ui/renderers/registry.d.ts +3 -0
  187. package/dist/ui/renderers/registry.mjs +17 -0
  188. package/dist/ui/renderers/registry.mjs.map +1 -0
  189. package/dist/ui/renderers/resolve.cjs +2 -0
  190. package/dist/ui/renderers/resolve.cjs.map +1 -0
  191. package/dist/ui/renderers/resolve.d.ts +2 -0
  192. package/dist/ui/renderers/resolve.mjs +8 -0
  193. package/dist/ui/renderers/resolve.mjs.map +1 -0
  194. package/dist/ui/styles/style.d.ts +0 -0
  195. package/dist/utils/log.cjs +2 -0
  196. package/dist/utils/log.cjs.map +1 -0
  197. package/dist/utils/log.d.ts +1 -0
  198. package/dist/utils/log.mjs +7 -0
  199. package/dist/utils/log.mjs.map +1 -0
  200. package/package.json +65 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SysMessage.vue2.cjs","sources":["../../../src/ui/components/SysMessage.vue"],"sourcesContent":["<template>\n <div class=\"hl-sys-msg\" :class=\"severityClass\">\n <div v-if=\"payload.title\" class=\"hl-sys-msg__title\">{{ payload.title }}</div>\n <div class=\"hl-sys-msg__text\">{{ payload.text }}</div>\n\n <div v-if=\"payload.actions?.length\" class=\"hl-sys-msg__actions\">\n <button\n v-for=\"a in payload.actions\"\n :key=\"a.id\"\n class=\"hl-sys-msg__btn\"\n :class=\"btnClass(a.style)\"\n type=\"button\"\n @click=\"onAction(a)\"\n >\n {{ a.text }}\n </button>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { logTag } from '../../utils/log'\nimport type { Envelope } from '../../core/types' // 你定义的 SysPayload\nimport { computed } from 'vue'\n\nconst props = defineProps<{\n envelope: Envelope<any>\n rawMessage?: any\n}>()\n\nconst emit = defineEmits<{\n (e: 'action', p: { action: any['actions'][number]; envelope: Envelope<SysPayload>; rawMessage?: any }): void\n}>()\n\nconst payload = computed(() => {\n // logTag('payload', props)\n return props.envelope || {}\n})\n\nconst severityClass = computed(() => {\n if (props.envelope.type === 'sys.alert') return 'is-alert'\n if (props.envelope.type === 'sys.progress') return 'is-progress'\n return 'is-notice'\n})\n\nfunction btnClass(style?: 'primary' | 'default' | 'danger') {\n if (style === 'primary') return 'is-primary'\n if (style === 'danger') return 'is-danger'\n return 'is-default'\n}\n\nfunction onAction(action: any) {\n // 不在组件里直接耦合 router / api, 只向外抛事件,由 ImChatRoom / 业务统一处理\n emit('action', { action, envelope: props.envelope, rawMessage: props.rawMessage })\n}\n</script>\n\n<style scoped lang=\"scss\">\n.hl-sys-msg {\n margin: 8px auto;\n max-width: 520px;\n padding: 10px 12px;\n border-radius: 10px;\n font-size: 13px;\n line-height: 1.45;\n background: #f6f6f6;\n color: #333;\n\n &.is-alert {\n background: #fff5f5;\n color: #8a1f1f;\n }\n &.is-progress {\n background: #f0fff4;\n color: #1f6f3a;\n }\n &.is-notice {\n background: #f6f6f6;\n color: #333;\n }\n\n &__title {\n font-weight: 600;\n margin-bottom: 4px;\n }\n &__text {\n white-space: pre-wrap;\n word-break: break-word;\n }\n &__actions {\n display: flex;\n gap: 8px;\n margin-top: 8px;\n flex-wrap: wrap;\n }\n &__btn {\n border: 0;\n border-radius: 8px;\n padding: 6px 10px;\n cursor: pointer;\n font-size: 12px;\n\n &.is-default {\n background: #fff;\n color: #333;\n }\n &.is-primary {\n background: #2f80ed;\n color: #fff;\n }\n &.is-danger {\n background: #eb5757;\n color: #fff;\n }\n }\n}\n</style>\n"],"names":["props","__props","emit","__emit","payload","computed","severityClass","btnClass","style","onAction","action","_createElementBlock","_normalizeClass","_openBlock","_hoisted_1","_toDisplayString","_createElementVNode","_hoisted_2","_hoisted_3","_Fragment","_renderList","a","$event","_hoisted_4"],"mappings":"uQAyBA,MAAMA,EAAQC,EAKRC,EAAOC,EAIPC,EAAUC,EAAAA,SAAS,IAEhBL,EAAM,UAAY,CAAA,CAC1B,EAEKM,EAAgBD,EAAAA,SAAS,IACzBL,EAAM,SAAS,OAAS,YAAoB,WAC5CA,EAAM,SAAS,OAAS,eAAuB,cAC5C,WACR,EAED,SAASO,EAASC,EAA0C,CAC1D,OAAIA,IAAU,UAAkB,aAC5BA,IAAU,SAAiB,YACxB,YACT,CAEA,SAASC,EAASC,EAAa,CAE7BR,EAAK,SAAU,CAAE,OAAAQ,EAAQ,SAAUV,EAAM,SAAU,WAAYA,EAAM,WAAY,CACnF,6BArDEW,EAAAA,mBAgBM,MAAA,CAhBD,MAAKC,EAAAA,eAAA,CAAC,aAAqBN,EAAA,KAAa,CAAA,CAAA,GAChCF,EAAA,MAAQ,OAAnBS,EAAAA,UAAA,EAAAF,EAAAA,mBAA6E,MAA7EG,EAA6EC,EAAAA,gBAAtBX,EAAA,MAAQ,KAAK,EAAA,CAAA,+BACpEY,qBAAsD,MAAtDC,EAAsDF,EAAAA,gBAArBX,EAAA,MAAQ,IAAI,EAAA,CAAA,EAElCA,EAAA,MAAQ,SAAS,QAA5BS,EAAAA,YAAAF,EAAAA,mBAWM,MAXNO,EAWM,EAVJL,EAAAA,UAAA,EAAA,EAAAF,EAAAA,mBASSQ,WAAA,KAAAC,EAAAA,WARKhB,EAAA,MAAQ,QAAbiB,kBADTV,EAAAA,mBASS,SAAA,CAPN,IAAKU,EAAE,GACR,wBAAM,kBACEd,EAASc,EAAE,KAAK,CAAA,CAAA,EACxB,KAAK,SACJ,QAAKC,GAAEb,EAASY,CAAC,CAAA,EAEfN,EAAAA,gBAAAM,EAAE,IAAI,EAAA,GAAAE,CAAA"}
@@ -0,0 +1,42 @@
1
+ import { defineComponent as v, computed as l, createElementBlock as n, openBlock as o, normalizeClass as a, createCommentVNode as c, createElementVNode as g, toDisplayString as i, Fragment as f, renderList as h } from "vue";
2
+ const k = {
3
+ key: 0,
4
+ class: "hl-sys-msg__title"
5
+ }, C = { class: "hl-sys-msg__text" }, x = {
6
+ key: 1,
7
+ class: "hl-sys-msg__actions"
8
+ }, b = ["onClick"], E = /* @__PURE__ */ v({
9
+ __name: "SysMessage",
10
+ props: {
11
+ envelope: {},
12
+ rawMessage: {}
13
+ },
14
+ emits: ["action"],
15
+ setup(u, { emit: p }) {
16
+ const e = u, m = p, t = l(() => e.envelope || {}), _ = l(() => e.envelope.type === "sys.alert" ? "is-alert" : e.envelope.type === "sys.progress" ? "is-progress" : "is-notice");
17
+ function d(s) {
18
+ return s === "primary" ? "is-primary" : s === "danger" ? "is-danger" : "is-default";
19
+ }
20
+ function y(s) {
21
+ m("action", { action: s, envelope: e.envelope, rawMessage: e.rawMessage });
22
+ }
23
+ return (s, M) => (o(), n("div", {
24
+ class: a(["hl-sys-msg", _.value])
25
+ }, [
26
+ t.value.title ? (o(), n("div", k, i(t.value.title), 1)) : c("", !0),
27
+ g("div", C, i(t.value.text), 1),
28
+ t.value.actions?.length ? (o(), n("div", x, [
29
+ (o(!0), n(f, null, h(t.value.actions, (r) => (o(), n("button", {
30
+ key: r.id,
31
+ class: a(["hl-sys-msg__btn", d(r.style)]),
32
+ type: "button",
33
+ onClick: (w) => y(r)
34
+ }, i(r.text), 11, b))), 128))
35
+ ])) : c("", !0)
36
+ ], 2));
37
+ }
38
+ });
39
+ export {
40
+ E as default
41
+ };
42
+ //# sourceMappingURL=SysMessage.vue2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SysMessage.vue2.mjs","sources":["../../../src/ui/components/SysMessage.vue"],"sourcesContent":["<template>\n <div class=\"hl-sys-msg\" :class=\"severityClass\">\n <div v-if=\"payload.title\" class=\"hl-sys-msg__title\">{{ payload.title }}</div>\n <div class=\"hl-sys-msg__text\">{{ payload.text }}</div>\n\n <div v-if=\"payload.actions?.length\" class=\"hl-sys-msg__actions\">\n <button\n v-for=\"a in payload.actions\"\n :key=\"a.id\"\n class=\"hl-sys-msg__btn\"\n :class=\"btnClass(a.style)\"\n type=\"button\"\n @click=\"onAction(a)\"\n >\n {{ a.text }}\n </button>\n </div>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { logTag } from '../../utils/log'\nimport type { Envelope } from '../../core/types' // 你定义的 SysPayload\nimport { computed } from 'vue'\n\nconst props = defineProps<{\n envelope: Envelope<any>\n rawMessage?: any\n}>()\n\nconst emit = defineEmits<{\n (e: 'action', p: { action: any['actions'][number]; envelope: Envelope<SysPayload>; rawMessage?: any }): void\n}>()\n\nconst payload = computed(() => {\n // logTag('payload', props)\n return props.envelope || {}\n})\n\nconst severityClass = computed(() => {\n if (props.envelope.type === 'sys.alert') return 'is-alert'\n if (props.envelope.type === 'sys.progress') return 'is-progress'\n return 'is-notice'\n})\n\nfunction btnClass(style?: 'primary' | 'default' | 'danger') {\n if (style === 'primary') return 'is-primary'\n if (style === 'danger') return 'is-danger'\n return 'is-default'\n}\n\nfunction onAction(action: any) {\n // 不在组件里直接耦合 router / api, 只向外抛事件,由 ImChatRoom / 业务统一处理\n emit('action', { action, envelope: props.envelope, rawMessage: props.rawMessage })\n}\n</script>\n\n<style scoped lang=\"scss\">\n.hl-sys-msg {\n margin: 8px auto;\n max-width: 520px;\n padding: 10px 12px;\n border-radius: 10px;\n font-size: 13px;\n line-height: 1.45;\n background: #f6f6f6;\n color: #333;\n\n &.is-alert {\n background: #fff5f5;\n color: #8a1f1f;\n }\n &.is-progress {\n background: #f0fff4;\n color: #1f6f3a;\n }\n &.is-notice {\n background: #f6f6f6;\n color: #333;\n }\n\n &__title {\n font-weight: 600;\n margin-bottom: 4px;\n }\n &__text {\n white-space: pre-wrap;\n word-break: break-word;\n }\n &__actions {\n display: flex;\n gap: 8px;\n margin-top: 8px;\n flex-wrap: wrap;\n }\n &__btn {\n border: 0;\n border-radius: 8px;\n padding: 6px 10px;\n cursor: pointer;\n font-size: 12px;\n\n &.is-default {\n background: #fff;\n color: #333;\n }\n &.is-primary {\n background: #2f80ed;\n color: #fff;\n }\n &.is-danger {\n background: #eb5757;\n color: #fff;\n }\n }\n}\n</style>\n"],"names":["props","__props","emit","__emit","payload","computed","severityClass","btnClass","style","onAction","action","_createElementBlock","_normalizeClass","_openBlock","_hoisted_1","_toDisplayString","_createElementVNode","_hoisted_2","_hoisted_3","_Fragment","_renderList","a","$event","_hoisted_4"],"mappings":";;;;;;;;;;;;;;;AAyBA,UAAMA,IAAQC,GAKRC,IAAOC,GAIPC,IAAUC,EAAS,MAEhBL,EAAM,YAAY,CAAA,CAC1B,GAEKM,IAAgBD,EAAS,MACzBL,EAAM,SAAS,SAAS,cAAoB,aAC5CA,EAAM,SAAS,SAAS,iBAAuB,gBAC5C,WACR;AAED,aAASO,EAASC,GAA0C;AAC1D,aAAIA,MAAU,YAAkB,eAC5BA,MAAU,WAAiB,cACxB;AAAA,IACT;AAEA,aAASC,EAASC,GAAa;AAE7B,MAAAR,EAAK,UAAU,EAAE,QAAAQ,GAAQ,UAAUV,EAAM,UAAU,YAAYA,EAAM,YAAY;AAAA,IACnF;2BArDEW,EAgBM,OAAA;AAAA,MAhBD,OAAKC,EAAA,CAAC,cAAqBN,EAAA,KAAa,CAAA;AAAA,IAAA;MAChCF,EAAA,MAAQ,SAAnBS,EAAA,GAAAF,EAA6E,OAA7EG,GAA6EC,EAAtBX,EAAA,MAAQ,KAAK,GAAA,CAAA;MACpEY,EAAsD,OAAtDC,GAAsDF,EAArBX,EAAA,MAAQ,IAAI,GAAA,CAAA;AAAA,MAElCA,EAAA,MAAQ,SAAS,UAA5BS,KAAAF,EAWM,OAXNO,GAWM;AAAA,SAVJL,EAAA,EAAA,GAAAF,EASSQ,GAAA,MAAAC,EARKhB,EAAA,MAAQ,UAAbiB,YADTV,EASS,UAAA;AAAA,UAPN,KAAKU,EAAE;AAAA,UACR,UAAM,mBACEd,EAASc,EAAE,KAAK,CAAA,CAAA;AAAA,UACxB,MAAK;AAAA,UACJ,SAAK,CAAAC,MAAEb,EAASY,CAAC;AAAA,QAAA,GAEfN,EAAAM,EAAE,IAAI,GAAA,IAAAE,CAAA;;;;;"}
@@ -0,0 +1,8 @@
1
+ export { default as ImKit } from './components/ImKit.vue';
2
+ export { default as ImChatRoom } from './components/ImChatRoom.vue';
3
+ export * from './renderers/registry';
4
+ export * from './renderers/resolve';
5
+ export * from './renderers/createMessageComponent';
6
+ export * from './mock/mock-driver';
7
+ export * from './mock/consultMeta';
8
+ export { default as PcConversationListSplit } from './components/PcConversationListSplit.vue';
@@ -0,0 +1,2 @@
1
+ "use strict";const e=require("./ChatLayoutH5.vue2.cjs");;/* empty css */const t=require("../../_virtual/_plugin-vue_export-helper.cjs"),r=t(e,[["__scopeId","data-v-3e2db453"]]);module.exports=r;
2
+ //# sourceMappingURL=ChatLayoutH5.vue.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatLayoutH5.vue.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,22 @@
1
+ import { Component } from 'vue';
2
+ import { IMClient } from '../../core/client';
3
+ import { IMConversation, ActionItem } from '../../core/types';
4
+ import { MessageModel } from '@tencentcloud/chat-uikit-vue3';
5
+ type __VLS_Props = {
6
+ client: IMClient;
7
+ messageRenderers?: Record<string, Component>;
8
+ messageFilter?: (m: MessageModel) => boolean;
9
+ conversationList?: Component | null;
10
+ conversationClassifier?: (c: IMConversation) => 'done' | 'todo';
11
+ emptyChatPlaceholder?: Component | null;
12
+ /** 业务方追加 actions */
13
+ inputActions?: ActionItem[];
14
+ /** 是否移除默认 actions */
15
+ removeDefaultActions?: boolean;
16
+ };
17
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
18
+ "sys:action": (...args: any[]) => void;
19
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
20
+ "onSys:action"?: ((...args: any[]) => any) | undefined;
21
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
22
+ export default _default;
@@ -0,0 +1,8 @@
1
+ import o from "./ChatLayoutH5.vue2.mjs";
2
+ /* empty css */
3
+ import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-3e2db453"]]);
5
+ export {
6
+ p as default
7
+ };
8
+ //# sourceMappingURL=ChatLayoutH5.vue.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatLayoutH5.vue.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const e=require("vue"),r=require("@tencentcloud/chat-uikit-vue3"),m=require("../renderers/MessageProxy.cjs"),g=require("../components/ImMessageInput.vue2.cjs"),d={class:"hl-im-h5"},f=e.defineComponent({__name:"ChatLayoutH5",props:{client:{},messageRenderers:{},messageFilter:{type:Function},conversationList:{},conversationClassifier:{type:Function},emptyChatPlaceholder:{},inputActions:{},removeDefaultActions:{type:Boolean}},emits:["sys:action"],setup(c,{emit:u}){const l=u,t=c,p=m.createMessageProxy({tencentImAccountId:t.client.tencentImAccountId,messageRenderers:t.messageRenderers,messageFilter:t.messageFilter,onSysAction:i=>l("sys:action",i)}),s=e.ref(15),o=e.ref(15);return e.computed(()=>({"--hl-msg-font":`${s.value}px`,"--hl-input-font":`${o.value}px`})),(i,n)=>(e.openBlock(),e.createElementBlock("div",d,[e.createVNode(e.unref(r.Chat),{class:"hl-im-h5_chat"},{default:e.withCtx(()=>[e.createVNode(e.unref(r.ChatHeader)),e.createVNode(e.unref(r.MessageList),{Message:e.unref(p)},null,8,["Message"]),e.createVNode(g,{"msg-font":s.value,"input-font":o.value,actions:t.inputActions,"onUpdate:msgFont":n[0]||(n[0]=a=>s.value=a),"onUpdate:inputFont":n[1]||(n[1]=a=>o.value=a)},null,8,["msg-font","input-font","actions"])]),_:1})]))}});module.exports=f;
2
+ //# sourceMappingURL=ChatLayoutH5.vue2.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatLayoutH5.vue2.cjs","sources":["../../../src/ui/layouts/ChatLayoutH5.vue"],"sourcesContent":["<template>\n <div class=\"hl-im-h5\">\n <Chat class=\"hl-im-h5_chat\">\n <ChatHeader />\n <!-- eslint-disable-next-line vue/attribute-hyphenation -->\n <MessageList :Message=\"MessageProxy\" />\n <ImMessageInput\n :msg-font=\"msgFont\"\n :input-font=\"inputFont\"\n :actions=\"props.inputActions\"\n @update:msg-font=\"msgFont = $event\"\n @update:input-font=\"inputFont = $event\"\n />\n </Chat>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed } from 'vue'\nimport type { Component } from 'vue'\nimport type { IMClient } from '../../core/client'\nimport type { IMConversation, ActionItem } from '../../core/types'\nimport { Chat, ChatHeader, MessageList, MessageInput } from '@tencentcloud/chat-uikit-vue3'\nimport { createMessageProxy } from '../renderers/MessageProxy'\nimport ImMessageInput from '../components/ImMessageInput.vue'\nimport type { MessageModel } from '@tencentcloud/chat-uikit-vue3'\nconst emit = defineEmits(['sys:action'])\nconst props = defineProps<{\n client: IMClient\n messageRenderers?: Record<string, Component>\n messageFilter?: (m: MessageModel) => boolean\n conversationList?: Component | null\n conversationClassifier?: (c: IMConversation) => 'done' | 'todo'\n emptyChatPlaceholder?: Component | null\n /** 业务方追加 actions */\n inputActions?: ActionItem[]\n /** 是否移除默认 actions */\n removeDefaultActions?: boolean\n}>()\nconst MessageProxy = createMessageProxy({\n tencentImAccountId: props.client.tencentImAccountId,\n messageRenderers: props.messageRenderers,\n messageFilter: props.messageFilter,\n onSysAction: (p) => emit('sys:action', p),\n})\nconst msgFont = ref(15)\nconst inputFont = ref(15)\nconst cssVars = computed(() => ({\n '--hl-msg-font': `${msgFont.value}px`,\n '--hl-input-font': `${inputFont.value}px`,\n}))\n</script>\n\n<style scoped lang=\"scss\">\n.hl-im-h5 {\n height: 100%;\n .hl-im-h5_chat {\n height: 100%;\n }\n}\n</style>\n"],"names":["emit","__emit","props","__props","MessageProxy","createMessageProxy","p","msgFont","ref","inputFont","computed","_openBlock","_createElementBlock","_hoisted_1","_createVNode","_unref","Chat","ChatHeader","MessageList","ImMessageInput","_cache","$event"],"mappings":"+dA0BA,MAAMA,EAAOC,EACPC,EAAQC,EAYRC,EAAeC,EAAAA,mBAAmB,CACtC,mBAAoBH,EAAM,OAAO,mBACjC,iBAAkBA,EAAM,iBACxB,cAAeA,EAAM,cACrB,YAAcI,GAAMN,EAAK,aAAcM,CAAC,CAAA,CACzC,EACKC,EAAUC,EAAAA,IAAI,EAAE,EAChBC,EAAYD,EAAAA,IAAI,EAAE,EACRE,OAAAA,EAAAA,SAAS,KAAO,CAC9B,gBAAiB,GAAGH,EAAQ,KAAK,KACjC,kBAAmB,GAAGE,EAAU,KAAK,IAAA,EACrC,UAjDAE,YAAA,EAAAC,qBAaM,MAbNC,EAaM,CAZJC,EAAAA,YAWOC,EAAAA,MAAAC,EAAAA,IAAA,EAAA,CAXD,MAAM,iBAAe,mBACzB,IAAc,CAAdF,cAAcC,EAAAA,MAAAE,EAAAA,UAAA,CAAA,EAEdH,EAAAA,YAAuCC,EAAAA,MAAAG,aAAA,EAAA,CAAzB,QAASH,EAAAA,MAAAX,CAAA,CAAA,EAAY,KAAA,EAAA,CAAA,SAAA,CAAA,EACnCU,EAAAA,YAMEK,EAAA,CALC,WAAUZ,EAAA,MACV,aAAYE,EAAA,MACZ,QAASP,EAAM,aACf,mBAAekB,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAAEd,EAAA,MAAUc,GAC3B,qBAAiBD,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAAEZ,EAAA,MAAYY,EAAA"}
@@ -0,0 +1,49 @@
1
+ import { defineComponent as f, ref as c, computed as d, createElementBlock as g, openBlock as h, createVNode as n, unref as s, withCtx as v } from "vue";
2
+ import { Chat as y, ChatHeader as F, MessageList as _ } from "@tencentcloud/chat-uikit-vue3";
3
+ import { createMessageProxy as x } from "../renderers/MessageProxy.mjs";
4
+ import C from "../components/ImMessageInput.vue2.mjs";
5
+ const A = { class: "hl-im-h5" }, P = /* @__PURE__ */ f({
6
+ __name: "ChatLayoutH5",
7
+ props: {
8
+ client: {},
9
+ messageRenderers: {},
10
+ messageFilter: { type: Function },
11
+ conversationList: {},
12
+ conversationClassifier: { type: Function },
13
+ emptyChatPlaceholder: {},
14
+ inputActions: {},
15
+ removeDefaultActions: { type: Boolean }
16
+ },
17
+ emits: ["sys:action"],
18
+ setup(m, { emit: l }) {
19
+ const p = l, e = m, u = x({
20
+ tencentImAccountId: e.client.tencentImAccountId,
21
+ messageRenderers: e.messageRenderers,
22
+ messageFilter: e.messageFilter,
23
+ onSysAction: (r) => p("sys:action", r)
24
+ }), o = c(15), a = c(15);
25
+ return d(() => ({
26
+ "--hl-msg-font": `${o.value}px`,
27
+ "--hl-input-font": `${a.value}px`
28
+ })), (r, t) => (h(), g("div", A, [
29
+ n(s(y), { class: "hl-im-h5_chat" }, {
30
+ default: v(() => [
31
+ n(s(F)),
32
+ n(s(_), { Message: s(u) }, null, 8, ["Message"]),
33
+ n(C, {
34
+ "msg-font": o.value,
35
+ "input-font": a.value,
36
+ actions: e.inputActions,
37
+ "onUpdate:msgFont": t[0] || (t[0] = (i) => o.value = i),
38
+ "onUpdate:inputFont": t[1] || (t[1] = (i) => a.value = i)
39
+ }, null, 8, ["msg-font", "input-font", "actions"])
40
+ ]),
41
+ _: 1
42
+ })
43
+ ]));
44
+ }
45
+ });
46
+ export {
47
+ P as default
48
+ };
49
+ //# sourceMappingURL=ChatLayoutH5.vue2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatLayoutH5.vue2.mjs","sources":["../../../src/ui/layouts/ChatLayoutH5.vue"],"sourcesContent":["<template>\n <div class=\"hl-im-h5\">\n <Chat class=\"hl-im-h5_chat\">\n <ChatHeader />\n <!-- eslint-disable-next-line vue/attribute-hyphenation -->\n <MessageList :Message=\"MessageProxy\" />\n <ImMessageInput\n :msg-font=\"msgFont\"\n :input-font=\"inputFont\"\n :actions=\"props.inputActions\"\n @update:msg-font=\"msgFont = $event\"\n @update:input-font=\"inputFont = $event\"\n />\n </Chat>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed } from 'vue'\nimport type { Component } from 'vue'\nimport type { IMClient } from '../../core/client'\nimport type { IMConversation, ActionItem } from '../../core/types'\nimport { Chat, ChatHeader, MessageList, MessageInput } from '@tencentcloud/chat-uikit-vue3'\nimport { createMessageProxy } from '../renderers/MessageProxy'\nimport ImMessageInput from '../components/ImMessageInput.vue'\nimport type { MessageModel } from '@tencentcloud/chat-uikit-vue3'\nconst emit = defineEmits(['sys:action'])\nconst props = defineProps<{\n client: IMClient\n messageRenderers?: Record<string, Component>\n messageFilter?: (m: MessageModel) => boolean\n conversationList?: Component | null\n conversationClassifier?: (c: IMConversation) => 'done' | 'todo'\n emptyChatPlaceholder?: Component | null\n /** 业务方追加 actions */\n inputActions?: ActionItem[]\n /** 是否移除默认 actions */\n removeDefaultActions?: boolean\n}>()\nconst MessageProxy = createMessageProxy({\n tencentImAccountId: props.client.tencentImAccountId,\n messageRenderers: props.messageRenderers,\n messageFilter: props.messageFilter,\n onSysAction: (p) => emit('sys:action', p),\n})\nconst msgFont = ref(15)\nconst inputFont = ref(15)\nconst cssVars = computed(() => ({\n '--hl-msg-font': `${msgFont.value}px`,\n '--hl-input-font': `${inputFont.value}px`,\n}))\n</script>\n\n<style scoped lang=\"scss\">\n.hl-im-h5 {\n height: 100%;\n .hl-im-h5_chat {\n height: 100%;\n }\n}\n</style>\n"],"names":["emit","__emit","props","__props","MessageProxy","createMessageProxy","p","msgFont","ref","inputFont","computed","_openBlock","_createElementBlock","_hoisted_1","_createVNode","_unref","Chat","ChatHeader","MessageList","ImMessageInput","_cache","$event"],"mappings":";;;;;;;;;;;;;;;;;;AA0BA,UAAMA,IAAOC,GACPC,IAAQC,GAYRC,IAAeC,EAAmB;AAAA,MACtC,oBAAoBH,EAAM,OAAO;AAAA,MACjC,kBAAkBA,EAAM;AAAA,MACxB,eAAeA,EAAM;AAAA,MACrB,aAAa,CAACI,MAAMN,EAAK,cAAcM,CAAC;AAAA,IAAA,CACzC,GACKC,IAAUC,EAAI,EAAE,GAChBC,IAAYD,EAAI,EAAE;AACR,WAAAE,EAAS,OAAO;AAAA,MAC9B,iBAAiB,GAAGH,EAAQ,KAAK;AAAA,MACjC,mBAAmB,GAAGE,EAAU,KAAK;AAAA,IAAA,EACrC,cAjDAE,EAAA,GAAAC,EAaM,OAbNC,GAaM;AAAA,MAZJC,EAWOC,EAAAC,CAAA,GAAA,EAXD,OAAM,mBAAe;AAAA,mBACzB,MAAc;AAAA,UAAdF,EAAcC,EAAAE,CAAA,CAAA;AAAA,UAEdH,EAAuCC,EAAAG,CAAA,GAAA,EAAzB,SAASH,EAAAX,CAAA,EAAA,GAAY,MAAA,GAAA,CAAA,SAAA,CAAA;AAAA,UACnCU,EAMEK,GAAA;AAAA,YALC,YAAUZ,EAAA;AAAA,YACV,cAAYE,EAAA;AAAA,YACZ,SAASP,EAAM;AAAA,YACf,oBAAekB,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAAEd,EAAA,QAAUc;AAAA,YAC3B,sBAAiBD,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAAEZ,EAAA,QAAYY;AAAA,UAAA;;;;;;;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const e=require("./ChatLayoutPc.vue2.cjs");;/* empty css */const t=require("../../_virtual/_plugin-vue_export-helper.cjs"),r=t(e,[["__scopeId","data-v-8cc13c39"]]);module.exports=r;
2
+ //# sourceMappingURL=ChatLayoutPc.vue.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatLayoutPc.vue.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,39 @@
1
+ import { Component } from 'vue';
2
+ import { IMClient } from '../../core/client';
3
+ import { IMConversation, ActionItem } from '../../core/types';
4
+ import { MessageModel } from '@tencentcloud/chat-uikit-vue3';
5
+ type __VLS_Props = {
6
+ client: IMClient;
7
+ messageRenderers?: Record<string, Component>;
8
+ messageFilter?: (m: MessageModel) => boolean;
9
+ conversationList?: Component | null;
10
+ conversationClassifier?: (c: IMConversation) => 'done' | 'todo';
11
+ emptyChatPlaceholder?: Component | null;
12
+ /** 业务方追加 actions */
13
+ inputActions?: ActionItem[];
14
+ /** 是否移除默认 actions */
15
+ removeDefaultActions?: boolean;
16
+ };
17
+ declare function __VLS_template(): {
18
+ attrs: Partial<{}>;
19
+ slots: {
20
+ 'pc-conversation'?(_: {
21
+ client: IMClient;
22
+ }): any;
23
+ };
24
+ refs: {};
25
+ rootEl: HTMLDivElement;
26
+ };
27
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
28
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
29
+ "sys:action": (...args: any[]) => void;
30
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
31
+ "onSys:action"?: ((...args: any[]) => any) | undefined;
32
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
33
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
34
+ export default _default;
35
+ type __VLS_WithTemplateSlots<T, S> = T & {
36
+ new (): {
37
+ $slots: S;
38
+ };
39
+ };
@@ -0,0 +1,8 @@
1
+ import o from "./ChatLayoutPc.vue2.mjs";
2
+ /* empty css */
3
+ import t from "../../_virtual/_plugin-vue_export-helper.mjs";
4
+ const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-8cc13c39"]]);
5
+ export {
6
+ m as default
7
+ };
8
+ //# sourceMappingURL=ChatLayoutPc.vue.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatLayoutPc.vue.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const e=require("vue"),o=require("@tencentcloud/chat-uikit-vue3"),d=require("../renderers/MessageProxy.cjs"),f=require("../components/ImMessageInput.vue2.cjs"),g={class:"hl-im-pc"},v={class:"hl-im-pc__left"},y=e.defineComponent({__name:"ChatLayoutPc",props:{client:{},messageRenderers:{},messageFilter:{type:Function},conversationList:{},conversationClassifier:{type:Function},emptyChatPlaceholder:{},inputActions:{},removeDefaultActions:{type:Boolean}},emits:["sys:action"],setup(t,{emit:r}){const u=r,n=t,c=e.ref(14),i=e.ref(14),m=e.computed(()=>({"--hl-msg-font":`${c.value}px`,"--hl-input-font":`${i.value}px`})),p=d.createMessageProxy({tencentImAccountId:n.client.tencentImAccountId,messageRenderers:n.messageRenderers,messageFilter:n.messageFilter,onSysAction:a=>u("sys:action",a)});return(a,s)=>(e.openBlock(),e.createElementBlock("div",g,[e.createElementVNode("aside",v,[e.renderSlot(a.$slots,"pc-conversation",{client:t.client},()=>[t.conversationList?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.conversationList),{key:0,client:t.client,classifier:t.conversationClassifier},null,8,["client","classifier"])):(e.openBlock(),e.createBlock(e.unref(o.ConversationList),{key:1}))],!0)]),e.createElementVNode("main",{class:"hl-im-pc__right",style:e.normalizeStyle(m.value)},[e.createVNode(e.unref(o.Chat),{class:"hl-im-pc__chat",PlaceholderEmpty:t.emptyChatPlaceholder},{default:e.withCtx(()=>[e.createVNode(e.unref(o.ChatHeader)),e.createVNode(e.unref(o.MessageList),{Message:e.unref(p)},null,8,["Message"]),e.createVNode(f,{"msg-font":c.value,"input-font":i.value,actions:n.inputActions,"onUpdate:msgFont":s[0]||(s[0]=l=>c.value=l),"onUpdate:inputFont":s[1]||(s[1]=l=>i.value=l)},null,8,["msg-font","input-font","actions"])]),_:1},8,["PlaceholderEmpty"])],4)]))}});module.exports=y;
2
+ //# sourceMappingURL=ChatLayoutPc.vue2.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatLayoutPc.vue2.cjs","sources":["../../../src/ui/layouts/ChatLayoutPc.vue"],"sourcesContent":["<template>\n <div class=\"hl-im-pc\">\n <aside class=\"hl-im-pc__left\">\n <slot name=\"pc-conversation\" :client=\"client\">\n <!-- prop 组件替换 -->\n <component\n :is=\"conversationList\"\n v-if=\"conversationList\"\n :client=\"client\"\n :classifier=\"conversationClassifier\"\n />\n <ConversationList v-else />\n <!-- 默认使用 TUIKit 的 ConversationList -->\n </slot>\n </aside>\n\n <main class=\"hl-im-pc__right\" :style=\"cssVars\">\n <!-- eslint-disable-next-line vue/attribute-hyphenation -->\n <Chat class=\"hl-im-pc__chat\" :PlaceholderEmpty=\"emptyChatPlaceholder\">\n <ChatHeader />\n <!-- eslint-disable-next-line vue/attribute-hyphenation -->\n <MessageList :Message=\"MessageProxy\" />\n <!-- :conversation-id=\"activeConversationId\" -->\n <ImMessageInput\n :msg-font=\"msgFont\"\n :input-font=\"inputFont\"\n :actions=\"props.inputActions\"\n @update:msg-font=\"msgFont = $event\"\n @update:input-font=\"inputFont = $event\"\n />\n </Chat>\n </main>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed } from 'vue'\nimport type { Component } from 'vue'\nimport { ChatHeader, Chat, MessageList, ConversationList } from '@tencentcloud/chat-uikit-vue3'\nimport type { IMClient } from '../../core/client'\nimport type { IMConversation, ActionItem } from '../../core/types'\nimport { createMessageProxy } from '../renderers/MessageProxy'\nimport type { MessageModel } from '@tencentcloud/chat-uikit-vue3'\nimport ImMessageInput from '../components/ImMessageInput.vue'\nconst emit = defineEmits(['sys:action'])\nconst props = defineProps<{\n client: IMClient\n messageRenderers?: Record<string, Component>\n messageFilter?: (m: MessageModel) => boolean\n conversationList?: Component | null\n conversationClassifier?: (c: IMConversation) => 'done' | 'todo'\n emptyChatPlaceholder?: Component | null\n /** 业务方追加 actions */\n inputActions?: ActionItem[]\n /** 是否移除默认 actions */\n removeDefaultActions?: boolean\n}>()\n\nconst msgFont = ref(14)\nconst inputFont = ref(14)\n\nconst cssVars = computed(() => ({\n '--hl-msg-font': `${msgFont.value}px`,\n '--hl-input-font': `${inputFont.value}px`,\n}))\n\nconst MessageProxy = createMessageProxy({\n tencentImAccountId: props.client.tencentImAccountId,\n messageRenderers: props.messageRenderers,\n messageFilter: props.messageFilter,\n onSysAction: (p) => emit('sys:action', p),\n})\n</script>\n\n<style scoped lang=\"scss\">\n.hl-im-pc {\n display: flex;\n grid-template-columns: 320px 1fr;\n height: 100%;\n}\n.hl-im-pc__left {\n border-right: 1px solid rgba(0, 0, 0, 0.08);\n overflow: auto;\n}\n.hl-im-pc__right {\n flex: 1;\n display: flex;\n min-width: 0;\n}\n.hl-im-pc__chat {\n flex: 1;\n display: flex;\n min-width: 0;\n}\n\n.hl-im-pc {\n :deep(.message-layout__meta span),\n :deep(.message-input),\n :deep(.message-time-divider),\n :deep(.message-layout__nick),\n :deep(.text-message) {\n font-size: var(--hl-msg-font);\n }\n}\n</style>\n"],"names":["emit","__emit","props","__props","msgFont","ref","inputFont","cssVars","computed","MessageProxy","createMessageProxy","p","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_renderSlot","_ctx","_createBlock","_resolveDynamicComponent","_unref","ConversationList","_createVNode","Chat","ChatHeader","MessageList","ImMessageInput","_cache","$event"],"mappings":"0fA4CA,MAAMA,EAAOC,EACPC,EAAQC,EAaRC,EAAUC,EAAAA,IAAI,EAAE,EAChBC,EAAYD,EAAAA,IAAI,EAAE,EAElBE,EAAUC,EAAAA,SAAS,KAAO,CAC9B,gBAAiB,GAAGJ,EAAQ,KAAK,KACjC,kBAAmB,GAAGE,EAAU,KAAK,IAAA,EACrC,EAEIG,EAAeC,EAAAA,mBAAmB,CACtC,mBAAoBR,EAAM,OAAO,mBACjC,iBAAkBA,EAAM,iBACxB,cAAeA,EAAM,cACrB,YAAcS,GAAMX,EAAK,aAAcW,CAAC,CAAA,CACzC,gBAtECC,YAAA,EAAAC,qBA+BM,MA/BNC,EA+BM,CA9BJC,EAAAA,mBAYQ,QAZRC,EAYQ,CAXNC,aAUOC,EAAA,OAAA,kBAAA,CAVuB,OAAQf,EAAA,MAAA,EAAtC,IAUO,CANGA,EAAA,kBAFRS,YAAA,EAAAO,EAAAA,YAKEC,0BAJKjB,EAAA,gBAAgB,EAAA,OAEpB,OAAQA,EAAA,OACR,WAAYA,EAAA,sBAAA,kDAEfgB,EAAAA,YAA2BE,EAAAA,MAAAC,EAAAA,gBAAA,EAAA,CAAA,IAAA,EAAA,EAAA,QAK/BP,EAAAA,mBAeO,OAAA,CAfD,MAAM,kBAAmB,uBAAOR,EAAA,KAAO,CAAA,GAE3CgB,cAYOF,EAAAA,MAAAG,EAAAA,IAAA,EAAA,CAZD,MAAM,iBAAkB,iBAAkBrB,EAAA,oBAAA,qBAC9C,IAAc,CAAdoB,cAAcF,EAAAA,MAAAI,EAAAA,UAAA,CAAA,EAEdF,EAAAA,YAAuCF,EAAAA,MAAAK,aAAA,EAAA,CAAzB,QAASL,EAAAA,MAAAZ,CAAA,CAAA,EAAY,KAAA,EAAA,CAAA,SAAA,CAAA,EAEnCc,EAAAA,YAMEI,EAAA,CALC,WAAUvB,EAAA,MACV,aAAYE,EAAA,MACZ,QAASJ,EAAM,aACf,mBAAe0B,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAAEzB,EAAA,MAAUyB,GAC3B,qBAAiBD,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAAEvB,EAAA,MAAYuB,EAAA"}
@@ -0,0 +1,66 @@
1
+ import { defineComponent as h, ref as m, computed as v, createElementBlock as C, openBlock as r, createElementVNode as u, renderSlot as F, createBlock as p, resolveDynamicComponent as P, unref as t, normalizeStyle as x, createVNode as o, withCtx as A } from "vue";
2
+ import { ConversationList as L, Chat as k, ChatHeader as M, MessageList as B } from "@tencentcloud/chat-uikit-vue3";
3
+ import { createMessageProxy as E } from "../renderers/MessageProxy.mjs";
4
+ import I from "../components/ImMessageInput.vue2.mjs";
5
+ const $ = { class: "hl-im-pc" }, R = { class: "hl-im-pc__left" }, U = /* @__PURE__ */ h({
6
+ __name: "ChatLayoutPc",
7
+ props: {
8
+ client: {},
9
+ messageRenderers: {},
10
+ messageFilter: { type: Function },
11
+ conversationList: {},
12
+ conversationClassifier: { type: Function },
13
+ emptyChatPlaceholder: {},
14
+ inputActions: {},
15
+ removeDefaultActions: { type: Boolean }
16
+ },
17
+ emits: ["sys:action"],
18
+ setup(e, { emit: d }) {
19
+ const f = d, n = e, i = m(14), a = m(14), y = v(() => ({
20
+ "--hl-msg-font": `${i.value}px`,
21
+ "--hl-input-font": `${a.value}px`
22
+ })), g = E({
23
+ tencentImAccountId: n.client.tencentImAccountId,
24
+ messageRenderers: n.messageRenderers,
25
+ messageFilter: n.messageFilter,
26
+ onSysAction: (c) => f("sys:action", c)
27
+ });
28
+ return (c, s) => (r(), C("div", $, [
29
+ u("aside", R, [
30
+ F(c.$slots, "pc-conversation", { client: e.client }, () => [
31
+ e.conversationList ? (r(), p(P(e.conversationList), {
32
+ key: 0,
33
+ client: e.client,
34
+ classifier: e.conversationClassifier
35
+ }, null, 8, ["client", "classifier"])) : (r(), p(t(L), { key: 1 }))
36
+ ], !0)
37
+ ]),
38
+ u("main", {
39
+ class: "hl-im-pc__right",
40
+ style: x(y.value)
41
+ }, [
42
+ o(t(k), {
43
+ class: "hl-im-pc__chat",
44
+ PlaceholderEmpty: e.emptyChatPlaceholder
45
+ }, {
46
+ default: A(() => [
47
+ o(t(M)),
48
+ o(t(B), { Message: t(g) }, null, 8, ["Message"]),
49
+ o(I, {
50
+ "msg-font": i.value,
51
+ "input-font": a.value,
52
+ actions: n.inputActions,
53
+ "onUpdate:msgFont": s[0] || (s[0] = (l) => i.value = l),
54
+ "onUpdate:inputFont": s[1] || (s[1] = (l) => a.value = l)
55
+ }, null, 8, ["msg-font", "input-font", "actions"])
56
+ ]),
57
+ _: 1
58
+ }, 8, ["PlaceholderEmpty"])
59
+ ], 4)
60
+ ]));
61
+ }
62
+ });
63
+ export {
64
+ U as default
65
+ };
66
+ //# sourceMappingURL=ChatLayoutPc.vue2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatLayoutPc.vue2.mjs","sources":["../../../src/ui/layouts/ChatLayoutPc.vue"],"sourcesContent":["<template>\n <div class=\"hl-im-pc\">\n <aside class=\"hl-im-pc__left\">\n <slot name=\"pc-conversation\" :client=\"client\">\n <!-- prop 组件替换 -->\n <component\n :is=\"conversationList\"\n v-if=\"conversationList\"\n :client=\"client\"\n :classifier=\"conversationClassifier\"\n />\n <ConversationList v-else />\n <!-- 默认使用 TUIKit 的 ConversationList -->\n </slot>\n </aside>\n\n <main class=\"hl-im-pc__right\" :style=\"cssVars\">\n <!-- eslint-disable-next-line vue/attribute-hyphenation -->\n <Chat class=\"hl-im-pc__chat\" :PlaceholderEmpty=\"emptyChatPlaceholder\">\n <ChatHeader />\n <!-- eslint-disable-next-line vue/attribute-hyphenation -->\n <MessageList :Message=\"MessageProxy\" />\n <!-- :conversation-id=\"activeConversationId\" -->\n <ImMessageInput\n :msg-font=\"msgFont\"\n :input-font=\"inputFont\"\n :actions=\"props.inputActions\"\n @update:msg-font=\"msgFont = $event\"\n @update:input-font=\"inputFont = $event\"\n />\n </Chat>\n </main>\n </div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, computed } from 'vue'\nimport type { Component } from 'vue'\nimport { ChatHeader, Chat, MessageList, ConversationList } from '@tencentcloud/chat-uikit-vue3'\nimport type { IMClient } from '../../core/client'\nimport type { IMConversation, ActionItem } from '../../core/types'\nimport { createMessageProxy } from '../renderers/MessageProxy'\nimport type { MessageModel } from '@tencentcloud/chat-uikit-vue3'\nimport ImMessageInput from '../components/ImMessageInput.vue'\nconst emit = defineEmits(['sys:action'])\nconst props = defineProps<{\n client: IMClient\n messageRenderers?: Record<string, Component>\n messageFilter?: (m: MessageModel) => boolean\n conversationList?: Component | null\n conversationClassifier?: (c: IMConversation) => 'done' | 'todo'\n emptyChatPlaceholder?: Component | null\n /** 业务方追加 actions */\n inputActions?: ActionItem[]\n /** 是否移除默认 actions */\n removeDefaultActions?: boolean\n}>()\n\nconst msgFont = ref(14)\nconst inputFont = ref(14)\n\nconst cssVars = computed(() => ({\n '--hl-msg-font': `${msgFont.value}px`,\n '--hl-input-font': `${inputFont.value}px`,\n}))\n\nconst MessageProxy = createMessageProxy({\n tencentImAccountId: props.client.tencentImAccountId,\n messageRenderers: props.messageRenderers,\n messageFilter: props.messageFilter,\n onSysAction: (p) => emit('sys:action', p),\n})\n</script>\n\n<style scoped lang=\"scss\">\n.hl-im-pc {\n display: flex;\n grid-template-columns: 320px 1fr;\n height: 100%;\n}\n.hl-im-pc__left {\n border-right: 1px solid rgba(0, 0, 0, 0.08);\n overflow: auto;\n}\n.hl-im-pc__right {\n flex: 1;\n display: flex;\n min-width: 0;\n}\n.hl-im-pc__chat {\n flex: 1;\n display: flex;\n min-width: 0;\n}\n\n.hl-im-pc {\n :deep(.message-layout__meta span),\n :deep(.message-input),\n :deep(.message-time-divider),\n :deep(.message-layout__nick),\n :deep(.text-message) {\n font-size: var(--hl-msg-font);\n }\n}\n</style>\n"],"names":["emit","__emit","props","__props","msgFont","ref","inputFont","cssVars","computed","MessageProxy","createMessageProxy","p","_openBlock","_createElementBlock","_hoisted_1","_createElementVNode","_hoisted_2","_renderSlot","_ctx","_createBlock","_resolveDynamicComponent","_unref","ConversationList","_createVNode","Chat","ChatHeader","MessageList","ImMessageInput","_cache","$event"],"mappings":";;;;;;;;;;;;;;;;;;AA4CA,UAAMA,IAAOC,GACPC,IAAQC,GAaRC,IAAUC,EAAI,EAAE,GAChBC,IAAYD,EAAI,EAAE,GAElBE,IAAUC,EAAS,OAAO;AAAA,MAC9B,iBAAiB,GAAGJ,EAAQ,KAAK;AAAA,MACjC,mBAAmB,GAAGE,EAAU,KAAK;AAAA,IAAA,EACrC,GAEIG,IAAeC,EAAmB;AAAA,MACtC,oBAAoBR,EAAM,OAAO;AAAA,MACjC,kBAAkBA,EAAM;AAAA,MACxB,eAAeA,EAAM;AAAA,MACrB,aAAa,CAACS,MAAMX,EAAK,cAAcW,CAAC;AAAA,IAAA,CACzC;sBAtECC,EAAA,GAAAC,EA+BM,OA/BNC,GA+BM;AAAA,MA9BJC,EAYQ,SAZRC,GAYQ;AAAA,QAXNC,EAUOC,EAAA,QAAA,mBAAA,EAVuB,QAAQf,EAAA,OAAA,GAAtC,MAUO;AAAA,UANGA,EAAA,oBAFRS,EAAA,GAAAO,EAKEC,EAJKjB,EAAA,gBAAgB,GAAA;AAAA;YAEpB,QAAQA,EAAA;AAAA,YACR,YAAYA,EAAA;AAAA,UAAA,+CAEfgB,EAA2BE,EAAAC,CAAA,GAAA,EAAA,KAAA,GAAA;AAAA,QAAA;;MAK/BP,EAeO,QAAA;AAAA,QAfD,OAAM;AAAA,QAAmB,SAAOR,EAAA,KAAO;AAAA,MAAA;QAE3CgB,EAYOF,EAAAG,CAAA,GAAA;AAAA,UAZD,OAAM;AAAA,UAAkB,kBAAkBrB,EAAA;AAAA,QAAA;qBAC9C,MAAc;AAAA,YAAdoB,EAAcF,EAAAI,CAAA,CAAA;AAAA,YAEdF,EAAuCF,EAAAK,CAAA,GAAA,EAAzB,SAASL,EAAAZ,CAAA,EAAA,GAAY,MAAA,GAAA,CAAA,SAAA,CAAA;AAAA,YAEnCc,EAMEI,GAAA;AAAA,cALC,YAAUvB,EAAA;AAAA,cACV,cAAYE,EAAA;AAAA,cACZ,SAASJ,EAAM;AAAA,cACf,oBAAe0B,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAAEzB,EAAA,QAAUyB;AAAA,cAC3B,sBAAiBD,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAAEvB,EAAA,QAAYuB;AAAA,YAAA;;;;;;;;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=["心内科","骨科","皮肤科","耳鼻喉科","消化内科","神经内科","儿科","妇产科","急诊医学科"],r=["图文咨询","电话咨询","视频咨询","复诊随访","急诊咨询"];function s(t){return new Promise(n=>setTimeout(n,t))}function a(t){return t[Math.floor(Math.random()*t.length)]}const o=new Map;function u(){return{deptName:a(c),consultType:a(r),createdAt:Date.now()}}async function f(t){await s(300+Math.floor(Math.random()*800));const n={};return t.forEach(e=>{e&&(o.has(e)||o.set(e,u()),n[e]=o.get(e))}),n}exports.DEPTS=c;exports.TYPES=r;exports.fetchConsultMetaBatch=f;exports.sleep=s;
2
+ //# sourceMappingURL=consultMeta.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consultMeta.cjs","sources":["../../../src/ui/mock/consultMeta.ts"],"sourcesContent":["export const DEPTS = ['心内科', '骨科', '皮肤科', '耳鼻喉科', '消化内科', '神经内科', '儿科', '妇产科', '急诊医学科']\nexport const TYPES = ['图文咨询', '电话咨询', '视频咨询', '复诊随访', '急诊咨询']\n\nexport function sleep(ms: number | undefined) {\n return new Promise((r) => setTimeout(r, ms))\n}\n\nfunction pick(arr: string | any[]) {\n return arr[Math.floor(Math.random() * arr.length)]\n}\n\n// “后端数据库”:conversationId -> meta\nconst db = new Map()\n\nfunction gen() {\n return {\n deptName: pick(DEPTS),\n consultType: pick(TYPES),\n createdAt: Date.now(),\n }\n}\n\n/**\n * 模拟后端:批量根据 conversationIds 拉取科室/咨询类型\n * - 没有就随机生成(模拟新咨询群刚创建)\n * - sleep 随机延迟\n */\nexport async function fetchConsultMetaBatch(conversationIds: any[]) {\n await sleep(300 + Math.floor(Math.random() * 800))\n\n const patch = {}\n conversationIds.forEach((id) => {\n if (!id) return\n if (!db.has(id)) db.set(id, gen())\n ;(patch as Record<string, typeof db extends Map<any, infer V> ? V : unknown>)[id as string] = db.get(id)\n })\n return patch\n}\n"],"names":["DEPTS","TYPES","sleep","ms","r","pick","arr","db","gen","fetchConsultMetaBatch","conversationIds","patch","id"],"mappings":"gFAAO,MAAMA,EAAQ,CAAC,MAAO,KAAM,MAAO,OAAQ,OAAQ,OAAQ,KAAM,MAAO,OAAO,EACzEC,EAAQ,CAAC,OAAQ,OAAQ,OAAQ,OAAQ,MAAM,EAErD,SAASC,EAAMC,EAAwB,CAC5C,OAAO,IAAI,QAASC,GAAM,WAAWA,EAAGD,CAAE,CAAC,CAC7C,CAEA,SAASE,EAAKC,EAAqB,CACjC,OAAOA,EAAI,KAAK,MAAM,KAAK,SAAWA,EAAI,MAAM,CAAC,CACnD,CAGA,MAAMC,MAAS,IAEf,SAASC,GAAM,CACb,MAAO,CACL,SAAUH,EAAKL,CAAK,EACpB,YAAaK,EAAKJ,CAAK,EACvB,UAAW,KAAK,IAAA,CAAI,CAExB,CAOA,eAAsBQ,EAAsBC,EAAwB,CAClE,MAAMR,EAAM,IAAM,KAAK,MAAM,KAAK,OAAA,EAAW,GAAG,CAAC,EAEjD,MAAMS,EAAQ,CAAA,EACd,OAAAD,EAAgB,QAASE,GAAO,CACzBA,IACAL,EAAG,IAAIK,CAAE,GAAGL,EAAG,IAAIK,EAAIJ,GAAK,EAC/BG,EAA4EC,CAAY,EAAIL,EAAG,IAAIK,CAAE,EACzG,CAAC,EACMD,CACT"}
@@ -0,0 +1,9 @@
1
+ export declare const DEPTS: string[];
2
+ export declare const TYPES: string[];
3
+ export declare function sleep(ms: number | undefined): Promise<unknown>;
4
+ /**
5
+ * 模拟后端:批量根据 conversationIds 拉取科室/咨询类型
6
+ * - 没有就随机生成(模拟新咨询群刚创建)
7
+ * - sleep 随机延迟
8
+ */
9
+ export declare function fetchConsultMetaBatch(conversationIds: any[]): Promise<{}>;
@@ -0,0 +1,29 @@
1
+ const c = ["心内科", "骨科", "皮肤科", "耳鼻喉科", "消化内科", "神经内科", "儿科", "妇产科", "急诊医学科"], r = ["图文咨询", "电话咨询", "视频咨询", "复诊随访", "急诊咨询"];
2
+ function s(t) {
3
+ return new Promise((e) => setTimeout(e, t));
4
+ }
5
+ function a(t) {
6
+ return t[Math.floor(Math.random() * t.length)];
7
+ }
8
+ const o = /* @__PURE__ */ new Map();
9
+ function u() {
10
+ return {
11
+ deptName: a(c),
12
+ consultType: a(r),
13
+ createdAt: Date.now()
14
+ };
15
+ }
16
+ async function f(t) {
17
+ await s(300 + Math.floor(Math.random() * 800));
18
+ const e = {};
19
+ return t.forEach((n) => {
20
+ n && (o.has(n) || o.set(n, u()), e[n] = o.get(n));
21
+ }), e;
22
+ }
23
+ export {
24
+ c as DEPTS,
25
+ r as TYPES,
26
+ f as fetchConsultMetaBatch,
27
+ s as sleep
28
+ };
29
+ //# sourceMappingURL=consultMeta.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consultMeta.mjs","sources":["../../../src/ui/mock/consultMeta.ts"],"sourcesContent":["export const DEPTS = ['心内科', '骨科', '皮肤科', '耳鼻喉科', '消化内科', '神经内科', '儿科', '妇产科', '急诊医学科']\nexport const TYPES = ['图文咨询', '电话咨询', '视频咨询', '复诊随访', '急诊咨询']\n\nexport function sleep(ms: number | undefined) {\n return new Promise((r) => setTimeout(r, ms))\n}\n\nfunction pick(arr: string | any[]) {\n return arr[Math.floor(Math.random() * arr.length)]\n}\n\n// “后端数据库”:conversationId -> meta\nconst db = new Map()\n\nfunction gen() {\n return {\n deptName: pick(DEPTS),\n consultType: pick(TYPES),\n createdAt: Date.now(),\n }\n}\n\n/**\n * 模拟后端:批量根据 conversationIds 拉取科室/咨询类型\n * - 没有就随机生成(模拟新咨询群刚创建)\n * - sleep 随机延迟\n */\nexport async function fetchConsultMetaBatch(conversationIds: any[]) {\n await sleep(300 + Math.floor(Math.random() * 800))\n\n const patch = {}\n conversationIds.forEach((id) => {\n if (!id) return\n if (!db.has(id)) db.set(id, gen())\n ;(patch as Record<string, typeof db extends Map<any, infer V> ? V : unknown>)[id as string] = db.get(id)\n })\n return patch\n}\n"],"names":["DEPTS","TYPES","sleep","ms","r","pick","arr","db","gen","fetchConsultMetaBatch","conversationIds","patch","id"],"mappings":"AAAO,MAAMA,IAAQ,CAAC,OAAO,MAAM,OAAO,QAAQ,QAAQ,QAAQ,MAAM,OAAO,OAAO,GACzEC,IAAQ,CAAC,QAAQ,QAAQ,QAAQ,QAAQ,MAAM;AAErD,SAASC,EAAMC,GAAwB;AAC5C,SAAO,IAAI,QAAQ,CAACC,MAAM,WAAWA,GAAGD,CAAE,CAAC;AAC7C;AAEA,SAASE,EAAKC,GAAqB;AACjC,SAAOA,EAAI,KAAK,MAAM,KAAK,WAAWA,EAAI,MAAM,CAAC;AACnD;AAGA,MAAMC,wBAAS,IAAA;AAEf,SAASC,IAAM;AACb,SAAO;AAAA,IACL,UAAUH,EAAKL,CAAK;AAAA,IACpB,aAAaK,EAAKJ,CAAK;AAAA,IACvB,WAAW,KAAK,IAAA;AAAA,EAAI;AAExB;AAOA,eAAsBQ,EAAsBC,GAAwB;AAClE,QAAMR,EAAM,MAAM,KAAK,MAAM,KAAK,OAAA,IAAW,GAAG,CAAC;AAEjD,QAAMS,IAAQ,CAAA;AACd,SAAAD,EAAgB,QAAQ,CAACE,MAAO;AAC9B,IAAKA,MACAL,EAAG,IAAIK,CAAE,KAAGL,EAAG,IAAIK,GAAIJ,GAAK,GAC/BG,EAA4EC,CAAY,IAAIL,EAAG,IAAIK,CAAE;AAAA,EACzG,CAAC,GACMD;AACT;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function s(){let n=null,t=null,o=null,a="";return{async init(){t?.({state:"connecting"}),setTimeout(()=>{t?.({state:"connected"})},200)},async login(e){t?.({state:"connected"})},async logout(){t?.({state:"disconnected",reason:"logout"})},async switchConversation(e){a=e,o?.({conversationId:e})},getActiveConversationId(){return a},async sendText({conversationId:e,text:c}){n?.({conversationId:e,messages:[{type:"text",payload:{text:c}}]})},async sendCustom({envelope:e}){n?.({conversationId:a,messages:[{type:"custom",payload:e}]})},onMessageReceived(e){return n=e,()=>n=null},onActiveConversationChanged(e){return o=e,()=>o=null},onConnectionState(e){return t=e,()=>t=null},onError(e){return()=>{}},async createGroup(e){},async updateNick(e){},async updateMyNameCard(e,c){}}}exports.createMockDriver=s;
2
+ //# sourceMappingURL=mock-driver.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock-driver.cjs","sources":["../../../src/ui/mock/mock-driver.ts"],"sourcesContent":["// packages/im/src/ui/mock/mock-driver.ts\nimport type { IMDriver } from '../../core/types'\n\nexport function createMockDriver(): IMDriver {\n let msgCb: ((p: { conversationId: string; messages: any[] }) => void) | null = null\n let connCb: ((p: { state: any; reason?: string }) => void) | null = null\n // const convCb: ((p: { conversations: any[] }) => void) | null = null\n let activeConvCb: ((p: { conversationId: string }) => void) | null = null\n\n let activeId = ''\n\n const conversations = [\n { id: 'c2c_user_002', type: 'c2c', title: 'user_002', unreadCount: 0, lastTime: Date.now() },\n { id: 'c2c_user_003', type: 'c2c', title: 'user_003', unreadCount: 2, lastTime: Date.now() - 10000 },\n ]\n\n return {\n async init() {\n connCb?.({ state: 'connecting' })\n setTimeout(() => {\n connCb?.({ state: 'connected' })\n }, 200)\n },\n async login(_opts: { userID: string; userSig: string; SDKAppID: string }) {\n connCb?.({ state: 'connected' })\n },\n async logout() {\n connCb?.({ state: 'disconnected', reason: 'logout' })\n },\n\n async switchConversation(conversationId) {\n activeId = conversationId\n activeConvCb?.({ conversationId })\n },\n\n getActiveConversationId() {\n return activeId\n },\n\n async sendText({ conversationId, text }) {\n msgCb?.({ conversationId, messages: [{ type: 'text', payload: { text } }] })\n },\n\n async sendCustom({ envelope }) {\n msgCb?.({ conversationId: activeId, messages: [{ type: 'custom', payload: envelope }] })\n },\n\n onMessageReceived(cb) {\n msgCb = cb\n return () => (msgCb = null)\n },\n\n onActiveConversationChanged(cb) {\n activeConvCb = cb\n return () => (activeConvCb = null)\n },\n\n onConnectionState(cb) {\n connCb = cb\n return () => (connCb = null)\n },\n\n onError(_cb: (p: { code: string; message: string; detail?: any }) => void) {\n return () => {}\n },\n\n async createGroup(_groupName: string) {\n // Mock implementation\n },\n\n async updateNick(_nick: string) {\n // Mock implementation\n },\n\n async updateMyNameCard(_groupID: string, _nameCard: string) {\n // Mock implementation\n },\n }\n}\n"],"names":["createMockDriver","msgCb","connCb","activeConvCb","activeId","_opts","conversationId","text","envelope","cb","_cb","_groupName","_nick","_groupID","_nameCard"],"mappings":"gFAGO,SAASA,GAA6B,CAC3C,IAAIC,EAA2E,KAC3EC,EAAgE,KAEhEC,EAAiE,KAEjEC,EAAW,GAOf,MAAO,CACL,MAAM,MAAO,CACXF,IAAS,CAAE,MAAO,aAAc,EAChC,WAAW,IAAM,CACfA,IAAS,CAAE,MAAO,YAAa,CACjC,EAAG,GAAG,CACR,EACA,MAAM,MAAMG,EAA8D,CACxEH,IAAS,CAAE,MAAO,YAAa,CACjC,EACA,MAAM,QAAS,CACbA,IAAS,CAAE,MAAO,eAAgB,OAAQ,SAAU,CACtD,EAEA,MAAM,mBAAmBI,EAAgB,CACvCF,EAAWE,EACXH,IAAe,CAAE,eAAAG,EAAgB,CACnC,EAEA,yBAA0B,CACxB,OAAOF,CACT,EAEA,MAAM,SAAS,CAAE,eAAAE,EAAgB,KAAAC,GAAQ,CACvCN,IAAQ,CAAE,eAAAK,EAAgB,SAAU,CAAC,CAAE,KAAM,OAAQ,QAAS,CAAE,KAAAC,CAAA,CAAK,CAAG,EAAG,CAC7E,EAEA,MAAM,WAAW,CAAE,SAAAC,GAAY,CAC7BP,IAAQ,CAAE,eAAgBG,EAAU,SAAU,CAAC,CAAE,KAAM,SAAU,QAASI,CAAA,CAAU,CAAA,CAAG,CACzF,EAEA,kBAAkBC,EAAI,CACpB,OAAAR,EAAQQ,EACD,IAAOR,EAAQ,IACxB,EAEA,4BAA4BQ,EAAI,CAC9B,OAAAN,EAAeM,EACR,IAAON,EAAe,IAC/B,EAEA,kBAAkBM,EAAI,CACpB,OAAAP,EAASO,EACF,IAAOP,EAAS,IACzB,EAEA,QAAQQ,EAAmE,CACzE,MAAO,IAAM,CAAC,CAChB,EAEA,MAAM,YAAYC,EAAoB,CAEtC,EAEA,MAAM,WAAWC,EAAe,CAEhC,EAEA,MAAM,iBAAiBC,EAAkBC,EAAmB,CAE5D,CAAA,CAEJ"}
@@ -0,0 +1,2 @@
1
+ import { IMDriver } from '../../core/types';
2
+ export declare function createMockDriver(): IMDriver;
@@ -0,0 +1,51 @@
1
+ function c() {
2
+ let t = null, n = null, a = null, o = "";
3
+ return {
4
+ async init() {
5
+ n?.({ state: "connecting" }), setTimeout(() => {
6
+ n?.({ state: "connected" });
7
+ }, 200);
8
+ },
9
+ async login(e) {
10
+ n?.({ state: "connected" });
11
+ },
12
+ async logout() {
13
+ n?.({ state: "disconnected", reason: "logout" });
14
+ },
15
+ async switchConversation(e) {
16
+ o = e, a?.({ conversationId: e });
17
+ },
18
+ getActiveConversationId() {
19
+ return o;
20
+ },
21
+ async sendText({ conversationId: e, text: s }) {
22
+ t?.({ conversationId: e, messages: [{ type: "text", payload: { text: s } }] });
23
+ },
24
+ async sendCustom({ envelope: e }) {
25
+ t?.({ conversationId: o, messages: [{ type: "custom", payload: e }] });
26
+ },
27
+ onMessageReceived(e) {
28
+ return t = e, () => t = null;
29
+ },
30
+ onActiveConversationChanged(e) {
31
+ return a = e, () => a = null;
32
+ },
33
+ onConnectionState(e) {
34
+ return n = e, () => n = null;
35
+ },
36
+ onError(e) {
37
+ return () => {
38
+ };
39
+ },
40
+ async createGroup(e) {
41
+ },
42
+ async updateNick(e) {
43
+ },
44
+ async updateMyNameCard(e, s) {
45
+ }
46
+ };
47
+ }
48
+ export {
49
+ c as createMockDriver
50
+ };
51
+ //# sourceMappingURL=mock-driver.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mock-driver.mjs","sources":["../../../src/ui/mock/mock-driver.ts"],"sourcesContent":["// packages/im/src/ui/mock/mock-driver.ts\nimport type { IMDriver } from '../../core/types'\n\nexport function createMockDriver(): IMDriver {\n let msgCb: ((p: { conversationId: string; messages: any[] }) => void) | null = null\n let connCb: ((p: { state: any; reason?: string }) => void) | null = null\n // const convCb: ((p: { conversations: any[] }) => void) | null = null\n let activeConvCb: ((p: { conversationId: string }) => void) | null = null\n\n let activeId = ''\n\n const conversations = [\n { id: 'c2c_user_002', type: 'c2c', title: 'user_002', unreadCount: 0, lastTime: Date.now() },\n { id: 'c2c_user_003', type: 'c2c', title: 'user_003', unreadCount: 2, lastTime: Date.now() - 10000 },\n ]\n\n return {\n async init() {\n connCb?.({ state: 'connecting' })\n setTimeout(() => {\n connCb?.({ state: 'connected' })\n }, 200)\n },\n async login(_opts: { userID: string; userSig: string; SDKAppID: string }) {\n connCb?.({ state: 'connected' })\n },\n async logout() {\n connCb?.({ state: 'disconnected', reason: 'logout' })\n },\n\n async switchConversation(conversationId) {\n activeId = conversationId\n activeConvCb?.({ conversationId })\n },\n\n getActiveConversationId() {\n return activeId\n },\n\n async sendText({ conversationId, text }) {\n msgCb?.({ conversationId, messages: [{ type: 'text', payload: { text } }] })\n },\n\n async sendCustom({ envelope }) {\n msgCb?.({ conversationId: activeId, messages: [{ type: 'custom', payload: envelope }] })\n },\n\n onMessageReceived(cb) {\n msgCb = cb\n return () => (msgCb = null)\n },\n\n onActiveConversationChanged(cb) {\n activeConvCb = cb\n return () => (activeConvCb = null)\n },\n\n onConnectionState(cb) {\n connCb = cb\n return () => (connCb = null)\n },\n\n onError(_cb: (p: { code: string; message: string; detail?: any }) => void) {\n return () => {}\n },\n\n async createGroup(_groupName: string) {\n // Mock implementation\n },\n\n async updateNick(_nick: string) {\n // Mock implementation\n },\n\n async updateMyNameCard(_groupID: string, _nameCard: string) {\n // Mock implementation\n },\n }\n}\n"],"names":["createMockDriver","msgCb","connCb","activeConvCb","activeId","_opts","conversationId","text","envelope","cb","_cb","_groupName","_nick","_groupID","_nameCard"],"mappings":"AAGO,SAASA,IAA6B;AAC3C,MAAIC,IAA2E,MAC3EC,IAAgE,MAEhEC,IAAiE,MAEjEC,IAAW;AAOf,SAAO;AAAA,IACL,MAAM,OAAO;AACX,MAAAF,IAAS,EAAE,OAAO,cAAc,GAChC,WAAW,MAAM;AACf,QAAAA,IAAS,EAAE,OAAO,aAAa;AAAA,MACjC,GAAG,GAAG;AAAA,IACR;AAAA,IACA,MAAM,MAAMG,GAA8D;AACxE,MAAAH,IAAS,EAAE,OAAO,aAAa;AAAA,IACjC;AAAA,IACA,MAAM,SAAS;AACb,MAAAA,IAAS,EAAE,OAAO,gBAAgB,QAAQ,UAAU;AAAA,IACtD;AAAA,IAEA,MAAM,mBAAmBI,GAAgB;AACvC,MAAAF,IAAWE,GACXH,IAAe,EAAE,gBAAAG,GAAgB;AAAA,IACnC;AAAA,IAEA,0BAA0B;AACxB,aAAOF;AAAA,IACT;AAAA,IAEA,MAAM,SAAS,EAAE,gBAAAE,GAAgB,MAAAC,KAAQ;AACvC,MAAAN,IAAQ,EAAE,gBAAAK,GAAgB,UAAU,CAAC,EAAE,MAAM,QAAQ,SAAS,EAAE,MAAAC,EAAA,EAAK,CAAG,GAAG;AAAA,IAC7E;AAAA,IAEA,MAAM,WAAW,EAAE,UAAAC,KAAY;AAC7B,MAAAP,IAAQ,EAAE,gBAAgBG,GAAU,UAAU,CAAC,EAAE,MAAM,UAAU,SAASI,EAAA,CAAU,EAAA,CAAG;AAAA,IACzF;AAAA,IAEA,kBAAkBC,GAAI;AACpB,aAAAR,IAAQQ,GACD,MAAOR,IAAQ;AAAA,IACxB;AAAA,IAEA,4BAA4BQ,GAAI;AAC9B,aAAAN,IAAeM,GACR,MAAON,IAAe;AAAA,IAC/B;AAAA,IAEA,kBAAkBM,GAAI;AACpB,aAAAP,IAASO,GACF,MAAOP,IAAS;AAAA,IACzB;AAAA,IAEA,QAAQQ,GAAmE;AACzE,aAAO,MAAM;AAAA,MAAC;AAAA,IAChB;AAAA,IAEA,MAAM,YAAYC,GAAoB;AAAA,IAEtC;AAAA,IAEA,MAAM,WAAWC,GAAe;AAAA,IAEhC;AAAA,IAEA,MAAM,iBAAiBC,GAAkBC,GAAmB;AAAA,IAE5D;AAAA,EAAA;AAEJ;"}
@@ -0,0 +1,2 @@
1
+ export { createMockDriver } from './mock-driver';
2
+ export { fetchConsultMetaBatch } from './consultMeta';
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("vue"),l=require("@tencentcloud/chat-uikit-vue3"),g=require("./resolve.cjs"),a=require("./registry.cjs"),t=require("../../utils/log.cjs");function m(n){return s.defineComponent({name:"HLMessageProxy",props:{message:{type:Object,required:!0}},setup(c,{attrs:i}){return()=>{const r=c.message;if(n.messageFilter&&!n.messageFilter(r))return null;const e=g.resolveEnvelopeFromMessage(r);if(t.logTag("env",e),t.logTag("tencentImAccountId",n.tencentImAccountId),t.logTag("invisibleTo",e?.invisibleTo?.includes(n.tencentImAccountId)),t.logTag("visibleTo",e?.visibleTo?.includes(n.tencentImAccountId)),e?.invisibleTo?.includes(n.tencentImAccountId)||e?.visibleTo?.length&&e?.visibleTo?.includes(n.tencentImAccountId))return null;if(e?.type){const o=n.messageRenderers?.[e.type]??a.resolveRenderer(e.type);if(o)return s.h(o,{envelope:e,rawMessage:r,"onSys:action":u=>n.onSysAction?.(u),...i})}return s.h(l.Message,{message:r,...i})}}})}exports.createMessageProxy=m;
2
+ //# sourceMappingURL=MessageProxy.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MessageProxy.cjs","sources":["../../../src/ui/renderers/MessageProxy.ts"],"sourcesContent":["// packages/im/src/ui/renderers/MessageProxy.ts\nimport { defineComponent, h, type Component } from 'vue'\nimport { Message as DefaultMessage, MessageType } from '@tencentcloud/chat-uikit-vue3'\nimport { resolveEnvelopeFromMessage } from './resolve'\nimport { resolveRenderer } from './registry'\nimport type { Envelope, SysPayload } from '../../core/types'\nimport { logTag } from '../../utils/log'\n\nexport function createMessageProxy(opts: {\n tencentImAccountId: string\n messageRenderers?: Record<string, Component>\n messageFilter?: (rawMessage: any) => boolean\n onSysAction?: (p: { action: any; envelope: Envelope<SysPayload>; rawMessage?: any }) => void\n}) {\n return defineComponent({\n name: 'HLMessageProxy',\n props: {\n message: { type: Object as any, required: true },\n },\n setup(p, { attrs }) {\n return () => {\n const msg = p.message\n // logTag('msg', msg)\n // 1) 外部过滤\n if (opts.messageFilter && !opts.messageFilter(msg)) return null\n\n // 2) 解析 envelope(一般只对 custom 消息)\n const env = resolveEnvelopeFromMessage(msg)\n logTag('env', env)\n logTag('tencentImAccountId', opts.tencentImAccountId)\n logTag('invisibleTo', env?.invisibleTo?.includes(opts.tencentImAccountId))\n logTag('visibleTo', env?.visibleTo?.includes(opts.tencentImAccountId))\n if (env?.invisibleTo?.includes(opts.tencentImAccountId)) return null\n if (env?.visibleTo?.length && env?.visibleTo?.includes(opts.tencentImAccountId)) return null\n if (env?.type) {\n const Comp = opts.messageRenderers?.[env.type] ?? resolveRenderer(env.type)\n if (Comp) {\n return h(Comp as any, {\n envelope: env,\n rawMessage: msg,\n 'onSys:action': (p: any) => opts.onSysAction?.(p),\n ...attrs,\n })\n }\n }\n\n // 3) 回退:TUIKit 默认消息\n return h(DefaultMessage as any, { message: msg, ...attrs })\n }\n },\n })\n}\n"],"names":["createMessageProxy","opts","defineComponent","p","attrs","msg","env","resolveEnvelopeFromMessage","logTag","Comp","resolveRenderer","h","DefaultMessage"],"mappings":"0OAQO,SAASA,EAAmBC,EAKhC,CACD,OAAOC,kBAAgB,CACrB,KAAM,iBACN,MAAO,CACL,QAAS,CAAE,KAAM,OAAe,SAAU,EAAA,CAAK,EAEjD,MAAMC,EAAG,CAAE,MAAAC,GAAS,CAClB,MAAO,IAAM,CACX,MAAMC,EAAMF,EAAE,QAGd,GAAIF,EAAK,eAAiB,CAACA,EAAK,cAAcI,CAAG,EAAG,OAAO,KAG3D,MAAMC,EAAMC,EAAAA,2BAA2BF,CAAG,EAM1C,GALAG,EAAAA,OAAO,MAAOF,CAAG,EACjBE,SAAO,qBAAsBP,EAAK,kBAAkB,EACpDO,EAAAA,OAAO,cAAeF,GAAK,aAAa,SAASL,EAAK,kBAAkB,CAAC,EACzEO,EAAAA,OAAO,YAAaF,GAAK,WAAW,SAASL,EAAK,kBAAkB,CAAC,EACjEK,GAAK,aAAa,SAASL,EAAK,kBAAkB,GAClDK,GAAK,WAAW,QAAUA,GAAK,WAAW,SAASL,EAAK,kBAAkB,EAAG,OAAO,KACxF,GAAIK,GAAK,KAAM,CACb,MAAMG,EAAOR,EAAK,mBAAmBK,EAAI,IAAI,GAAKI,EAAAA,gBAAgBJ,EAAI,IAAI,EAC1E,GAAIG,EACF,OAAOE,EAAAA,EAAEF,EAAa,CACpB,SAAUH,EACV,WAAYD,EACZ,eAAiBF,GAAWF,EAAK,cAAcE,CAAC,EAChD,GAAGC,CAAA,CACJ,CAEL,CAGA,OAAOO,EAAAA,EAAEC,EAAAA,QAAuB,CAAE,QAASP,EAAK,GAAGD,EAAO,CAC5D,CACF,CAAA,CACD,CACH"}
@@ -0,0 +1,24 @@
1
+ import { Component } from 'vue';
2
+ import { Envelope, SysPayload } from '../../core/types';
3
+ export declare function createMessageProxy(opts: {
4
+ tencentImAccountId: string;
5
+ messageRenderers?: Record<string, Component>;
6
+ messageFilter?: (rawMessage: any) => boolean;
7
+ onSysAction?: (p: {
8
+ action: any;
9
+ envelope: Envelope<SysPayload>;
10
+ rawMessage?: any;
11
+ }) => void;
12
+ }): import('vue').DefineComponent<import('vue').ExtractPropTypes<{
13
+ message: {
14
+ type: any;
15
+ required: true;
16
+ };
17
+ }>, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
18
+ [key: string]: any;
19
+ }> | null, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
20
+ message: {
21
+ type: any;
22
+ required: true;
23
+ };
24
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,36 @@
1
+ import { defineComponent as l, h as s } from "vue";
2
+ import { Message as u } from "@tencentcloud/chat-uikit-vue3";
3
+ import { resolveEnvelopeFromMessage as a } from "./resolve.mjs";
4
+ import { resolveRenderer as g } from "./registry.mjs";
5
+ import { logTag as t } from "../../utils/log.mjs";
6
+ function b(n) {
7
+ return l({
8
+ name: "HLMessageProxy",
9
+ props: {
10
+ message: { type: Object, required: !0 }
11
+ },
12
+ setup(c, { attrs: i }) {
13
+ return () => {
14
+ const r = c.message;
15
+ if (n.messageFilter && !n.messageFilter(r)) return null;
16
+ const e = a(r);
17
+ if (t("env", e), t("tencentImAccountId", n.tencentImAccountId), t("invisibleTo", e?.invisibleTo?.includes(n.tencentImAccountId)), t("visibleTo", e?.visibleTo?.includes(n.tencentImAccountId)), e?.invisibleTo?.includes(n.tencentImAccountId) || e?.visibleTo?.length && e?.visibleTo?.includes(n.tencentImAccountId)) return null;
18
+ if (e?.type) {
19
+ const o = n.messageRenderers?.[e.type] ?? g(e.type);
20
+ if (o)
21
+ return s(o, {
22
+ envelope: e,
23
+ rawMessage: r,
24
+ "onSys:action": (m) => n.onSysAction?.(m),
25
+ ...i
26
+ });
27
+ }
28
+ return s(u, { message: r, ...i });
29
+ };
30
+ }
31
+ });
32
+ }
33
+ export {
34
+ b as createMessageProxy
35
+ };
36
+ //# sourceMappingURL=MessageProxy.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MessageProxy.mjs","sources":["../../../src/ui/renderers/MessageProxy.ts"],"sourcesContent":["// packages/im/src/ui/renderers/MessageProxy.ts\nimport { defineComponent, h, type Component } from 'vue'\nimport { Message as DefaultMessage, MessageType } from '@tencentcloud/chat-uikit-vue3'\nimport { resolveEnvelopeFromMessage } from './resolve'\nimport { resolveRenderer } from './registry'\nimport type { Envelope, SysPayload } from '../../core/types'\nimport { logTag } from '../../utils/log'\n\nexport function createMessageProxy(opts: {\n tencentImAccountId: string\n messageRenderers?: Record<string, Component>\n messageFilter?: (rawMessage: any) => boolean\n onSysAction?: (p: { action: any; envelope: Envelope<SysPayload>; rawMessage?: any }) => void\n}) {\n return defineComponent({\n name: 'HLMessageProxy',\n props: {\n message: { type: Object as any, required: true },\n },\n setup(p, { attrs }) {\n return () => {\n const msg = p.message\n // logTag('msg', msg)\n // 1) 外部过滤\n if (opts.messageFilter && !opts.messageFilter(msg)) return null\n\n // 2) 解析 envelope(一般只对 custom 消息)\n const env = resolveEnvelopeFromMessage(msg)\n logTag('env', env)\n logTag('tencentImAccountId', opts.tencentImAccountId)\n logTag('invisibleTo', env?.invisibleTo?.includes(opts.tencentImAccountId))\n logTag('visibleTo', env?.visibleTo?.includes(opts.tencentImAccountId))\n if (env?.invisibleTo?.includes(opts.tencentImAccountId)) return null\n if (env?.visibleTo?.length && env?.visibleTo?.includes(opts.tencentImAccountId)) return null\n if (env?.type) {\n const Comp = opts.messageRenderers?.[env.type] ?? resolveRenderer(env.type)\n if (Comp) {\n return h(Comp as any, {\n envelope: env,\n rawMessage: msg,\n 'onSys:action': (p: any) => opts.onSysAction?.(p),\n ...attrs,\n })\n }\n }\n\n // 3) 回退:TUIKit 默认消息\n return h(DefaultMessage as any, { message: msg, ...attrs })\n }\n },\n })\n}\n"],"names":["createMessageProxy","opts","defineComponent","p","attrs","msg","env","resolveEnvelopeFromMessage","logTag","Comp","resolveRenderer","h","DefaultMessage"],"mappings":";;;;;AAQO,SAASA,EAAmBC,GAKhC;AACD,SAAOC,EAAgB;AAAA,IACrB,MAAM;AAAA,IACN,OAAO;AAAA,MACL,SAAS,EAAE,MAAM,QAAe,UAAU,GAAA;AAAA,IAAK;AAAA,IAEjD,MAAMC,GAAG,EAAE,OAAAC,KAAS;AAClB,aAAO,MAAM;AACX,cAAMC,IAAMF,EAAE;AAGd,YAAIF,EAAK,iBAAiB,CAACA,EAAK,cAAcI,CAAG,EAAG,QAAO;AAG3D,cAAMC,IAAMC,EAA2BF,CAAG;AAM1C,YALAG,EAAO,OAAOF,CAAG,GACjBE,EAAO,sBAAsBP,EAAK,kBAAkB,GACpDO,EAAO,eAAeF,GAAK,aAAa,SAASL,EAAK,kBAAkB,CAAC,GACzEO,EAAO,aAAaF,GAAK,WAAW,SAASL,EAAK,kBAAkB,CAAC,GACjEK,GAAK,aAAa,SAASL,EAAK,kBAAkB,KAClDK,GAAK,WAAW,UAAUA,GAAK,WAAW,SAASL,EAAK,kBAAkB,EAAG,QAAO;AACxF,YAAIK,GAAK,MAAM;AACb,gBAAMG,IAAOR,EAAK,mBAAmBK,EAAI,IAAI,KAAKI,EAAgBJ,EAAI,IAAI;AAC1E,cAAIG;AACF,mBAAOE,EAAEF,GAAa;AAAA,cACpB,UAAUH;AAAA,cACV,YAAYD;AAAA,cACZ,gBAAgB,CAACF,MAAWF,EAAK,cAAcE,CAAC;AAAA,cAChD,GAAGC;AAAA,YAAA,CACJ;AAAA,QAEL;AAGA,eAAOO,EAAEC,GAAuB,EAAE,SAASP,GAAK,GAAGD,GAAO;AAAA,MAC5D;AAAA,IACF;AAAA,EAAA,CACD;AACH;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),t=require("./registry.cjs");function o(e){return r.defineComponent({name:"HlImCustomMessage",setup(){const n=t.resolveRenderer(e);return n?()=>r.h(n,{envelope:e.payload}):()=>r.h("pre",JSON.stringify(e.payload,null,2))}})}exports.createMessageComponent=o;
2
+ //# sourceMappingURL=createMessageComponent.cjs.map