tuikit-atomicx-vue3 4.4.0-beta.1 → 4.4.0

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 (113) hide show
  1. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-D1G-LitO.js → MessageInput.vue_vue_type_script_setup_true_lang-D9jiYNFu.js} +31 -31
  2. package/dist/chat/index.d.ts +35 -35
  3. package/dist/chat/server.js +15 -15
  4. package/dist/components/ContactList/ContactInfo/BlacklistInfo/BlacklistInfo.js +6 -6
  5. package/dist/components/ContactList/ContactInfo/ContactInfo.js +1 -1
  6. package/dist/components/ContactList/ContactInfo/FriendApplicationInfo/FriendApplicationInfo.js +1 -1
  7. package/dist/components/ContactList/ContactInfo/FriendInfo/FriendInfo.js +9 -9
  8. package/dist/components/ContactList/ContactInfo/GroupApplicationInfo/GroupApplicationInfo.js +1 -1
  9. package/dist/components/ContactList/ContactInfo/GroupInfo/GroupInfo.js +4 -4
  10. package/dist/components/ContactList/ContactInfo/SearchGroupInfo/SearchGroupInfo.js +8 -8
  11. package/dist/components/ContactList/ContactInfo/SearchUserInfo/SearchUserInfo.js +7 -7
  12. package/dist/components/ContactList/ContactList.js +7 -7
  13. package/dist/components/ContactList/ContactListItem/BlacklistItem/BlacklistItem.js +8 -8
  14. package/dist/components/ContactList/ContactListItem/FriendApplicationItem/FriendApplicationItem.js +5 -5
  15. package/dist/components/ContactList/ContactListItem/FriendItem/FriendItem.js +5 -5
  16. package/dist/components/ContactList/ContactListItem/GroupApplicationItem/GroupApplicationItem.js +1 -1
  17. package/dist/components/ContactList/ContactListItem/GroupItem/GroupItem.js +1 -1
  18. package/dist/components/ContactList/ContactSearch/ContactSearch.js +6 -6
  19. package/dist/components/ConversationList/ConversationCreate/ConversationCreate.js +9 -9
  20. package/dist/components/ConversationList/ConversationList.js +4 -4
  21. package/dist/components/ConversationList/ConversationList.vue.d.ts +10 -10
  22. package/dist/components/ConversationList/ConversationPreview/ConversationPreview.vue.d.ts +10 -10
  23. package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUI.js +20 -20
  24. package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUI.vue.d.ts +2 -2
  25. package/dist/components/ConversationList/ConversationPreview/index.js +1 -1
  26. package/dist/components/ConversationList/index.d.ts +30 -30
  27. package/dist/components/MessageInput/EmojiPicker/EmojiPicker.js +88 -84
  28. package/dist/components/MessageInput/MessageInput.js +1 -1
  29. package/dist/components/MessageInput/MessageInput.vue.d.ts +2 -2
  30. package/dist/components/MessageInput/TextEditor/EditorCore.d.ts +2 -1
  31. package/dist/components/MessageInput/TextEditor/EditorCore.js +23 -21
  32. package/dist/components/MessageInput/TextEditor/TextEditor.vue.d.ts +2 -2
  33. package/dist/components/MessageInput/TextEditor/index.js +32 -31
  34. package/dist/components/MessageInput/index.d.ts +6 -6
  35. package/dist/components/MessageInput/index.js +1 -1
  36. package/dist/components/MessageList/Message/AudioMessage/WaveForm.js +24 -34
  37. package/dist/components/MessageList/Message/CustomMessage/CallMessage/CallMessage.js +29 -28
  38. package/dist/components/MessageList/Message/Message.vue.d.ts +1 -1
  39. package/dist/components/MessageList/MessageList.js +8 -6
  40. package/dist/components/MessageList/index.d.ts +2 -2
  41. package/dist/hooks/useAudioControl.d.ts +3 -3
  42. package/dist/hooks/useAudioControl.js +32 -30
  43. package/dist/rtc/server.js +45 -40
  44. package/dist/states/LoginState.d.ts +23 -0
  45. package/dist/states/LoginState.js +34 -39
  46. package/dist/states/MessageInputState/MessageInputState.d.ts +41 -7
  47. package/dist/states/MessageInputState/MessageInputState.js +60 -59
  48. package/dist/states/MessageInputState/utils.d.ts +8 -1
  49. package/dist/states/MessageInputState/utils.js +30 -10
  50. package/dist/styles/index.css +1 -1
  51. package/dist/utils/call.js +1 -1
  52. package/package.json +2 -2
  53. package/src/chat/server.ts +0 -1
  54. package/src/components/ContactList/ContactInfo/BlacklistInfo/BlacklistInfo.vue +1 -1
  55. package/src/components/ContactList/ContactInfo/ContactInfo.vue +1 -1
  56. package/src/components/ContactList/ContactInfo/FriendApplicationInfo/FriendApplicationInfo.vue +1 -1
  57. package/src/components/ContactList/ContactInfo/FriendInfo/FriendInfo.vue +1 -1
  58. package/src/components/ContactList/ContactInfo/GroupApplicationInfo/GroupApplicationInfo.vue +1 -1
  59. package/src/components/ContactList/ContactInfo/GroupInfo/GroupInfo.vue +1 -1
  60. package/src/components/ContactList/ContactInfo/SearchGroupInfo/SearchGroupInfo.vue +1 -1
  61. package/src/components/ContactList/ContactInfo/SearchUserInfo/SearchUserInfo.vue +1 -1
  62. package/src/components/ContactList/ContactList.vue +1 -1
  63. package/src/components/ContactList/ContactListItem/BlacklistItem/BlacklistItem.vue +1 -1
  64. package/src/components/ContactList/ContactListItem/FriendApplicationItem/FriendApplicationItem.vue +1 -1
  65. package/src/components/ContactList/ContactListItem/FriendItem/FriendItem.vue +1 -1
  66. package/src/components/ContactList/ContactListItem/GroupApplicationItem/GroupApplicationItem.vue +1 -1
  67. package/src/components/ContactList/ContactListItem/GroupItem/GroupItem.vue +1 -1
  68. package/src/components/ContactList/ContactSearch/ContactSearch.vue +1 -1
  69. package/src/components/ConversationList/ConversationActions/ConversationActions.vue +1 -1
  70. package/src/components/ConversationList/ConversationCreate/ConversationCreate.vue +2 -2
  71. package/src/components/ConversationList/ConversationCreate/ConversationCreateButton/ConversationCreateButton.vue +1 -1
  72. package/src/components/ConversationList/ConversationCreate/ConversationCreateGroupDetail/ConversationCreateGroupDetail.vue +1 -1
  73. package/src/components/ConversationList/ConversationCreate/ConversationCreateUserSelectList/ConversationCreateUserSelectList.vue +1 -1
  74. package/src/components/ConversationList/ConversationCreate/ConversationGroupTypeInfo/ConversationGroupTypeInfo.vue +1 -1
  75. package/src/components/ConversationList/ConversationList.vue +2 -2
  76. package/src/components/ConversationList/ConversationListContent/ConversationListContent.vue +1 -1
  77. package/src/components/ConversationList/ConversationListHeader/ConversationListHeader.vue +1 -1
  78. package/src/components/ConversationList/ConversationPlaceHolder/ConversationPlaceHolder.vue +1 -1
  79. package/src/components/ConversationList/ConversationPreview/ConversationPreview.vue +1 -1
  80. package/src/components/ConversationList/ConversationPreview/ConversationPreviewAbstract.vue +1 -1
  81. package/src/components/ConversationList/ConversationPreview/ConversationPreviewTimestamp.vue +1 -1
  82. package/src/components/ConversationList/ConversationPreview/ConversationPreviewTitle.vue +1 -1
  83. package/src/components/ConversationList/ConversationPreview/ConversationPreviewUI.vue +3 -3
  84. package/src/components/ConversationList/ConversationPreview/ConversationPreviewUnread.vue +1 -1
  85. package/src/components/ConversationList/ConversationSearch/ConversationSearch.vue +1 -1
  86. package/src/components/MessageInput/EmojiPicker/EmojiPicker.vue +7 -3
  87. package/src/components/MessageInput/MessageInput.module.scss +1 -0
  88. package/src/components/MessageInput/MessageInput.vue +1 -1
  89. package/src/components/MessageInput/TextEditor/EditorCore.ts +4 -2
  90. package/src/components/MessageInput/TextEditor/TextEditor.vue +3 -4
  91. package/src/components/MessageList/Message/AudioMessage/WaveForm.vue +20 -37
  92. package/src/components/MessageList/Message/CustomMessage/CallMessage/CallMessage.vue +1 -1
  93. package/src/components/MessageList/Message/Message.vue +1 -1
  94. package/src/components/MessageList/MessageList.vue +2 -0
  95. package/src/components/Search/Search.vue +1 -1
  96. package/src/components/Search/SearchAdvanced/DateRangePicker/DateRangePicker.vue +1 -1
  97. package/src/components/Search/SearchAdvanced/MessageAdvanced/MessageAdvanced.vue +1 -1
  98. package/src/components/Search/SearchAdvanced/SearchAdvanced.vue +1 -1
  99. package/src/components/Search/SearchAdvanced/SearchTab/SearchTab.vue +1 -1
  100. package/src/components/Search/SearchAdvanced/Slider/Slider.vue +1 -1
  101. package/src/components/Search/SearchAdvanced/UserAdvanced/UserAdvanced.vue +1 -1
  102. package/src/components/Search/SearchBar/SearchBar.vue +1 -1
  103. package/src/components/Search/SearchResults/EmptyResult/EmptyResult.vue +1 -1
  104. package/src/components/Search/SearchResults/Loading/Loading.vue +1 -1
  105. package/src/components/Search/SearchResults/SearchResults.vue +1 -1
  106. package/src/components/Search/SearchResults/SearchResultsItem/Conversation/Conversation.vue +1 -1
  107. package/src/components/Search/SearchResults/SearchResultsItem/Group/Group.vue +1 -1
  108. package/src/components/Search/SearchResults/SearchResultsItem/Message/Message.vue +1 -1
  109. package/src/components/Search/SearchResults/SearchResultsItem/SearchResultsItem.vue +1 -1
  110. package/src/components/Search/SearchResults/SearchResultsItem/User/User.vue +1 -1
  111. package/src/hooks/useAudioControl.ts +17 -4
  112. package/src/rtc/server.ts +4 -0
  113. package/src/utils/call.ts +2 -2
@@ -1,7 +1,7 @@
1
- import { S as g, P as x, E as d, I as o } from "../../../index-DTi1fL-x.js";
1
+ import { S as x, P as d, E as y, I as o } from "../../../index-DTi1fL-x.js";
2
2
  import { E as M } from "../../../index-BfIEeWMg.js";
3
3
  import { MessageContentType as n } from "../../../states/MessageInputState/type.js";
4
- function y() {
4
+ function T() {
5
5
  return o.extend({
6
6
  name: n.EMOJI,
7
7
  inline: !0,
@@ -18,7 +18,7 @@ function y() {
18
18
  }
19
19
  });
20
20
  }
21
- function T() {
21
+ function b() {
22
22
  return o.extend({
23
23
  addOptions() {
24
24
  var t;
@@ -59,7 +59,7 @@ function p(t) {
59
59
  }
60
60
  function c(t) {
61
61
  return t != null && t.content ? t.content.flatMap((e) => {
62
- var a, s, r, u;
62
+ var a, s, u, r;
63
63
  switch (e.type) {
64
64
  case "text":
65
65
  return e.text ? [{
@@ -76,8 +76,8 @@ function c(t) {
76
76
  type: n.EMOJI,
77
77
  content: {
78
78
  url: (s = e.attrs) == null ? void 0 : s.src,
79
- key: (r = e.attrs) == null ? void 0 : r.alt,
80
- text: (u = e.attrs) == null ? void 0 : u.title
79
+ key: (u = e.attrs) == null ? void 0 : u.alt,
80
+ text: (r = e.attrs) == null ? void 0 : r.title
81
81
  }
82
82
  }];
83
83
  case "hardBreak":
@@ -91,38 +91,40 @@ function c(t) {
91
91
  }
92
92
  }) : [];
93
93
  }
94
- function B({
94
+ function D({
95
95
  element: t,
96
96
  placeholder: e = "",
97
97
  autoFocus: a = !1,
98
98
  disabled: s = !1,
99
+ isPlaceholderOnlyShowWhenEditable: u = !0,
99
100
  onUpdate: r,
100
- onEnter: u,
101
- onFocus: f,
102
- onBlur: E
101
+ onEnter: f,
102
+ onFocus: E,
103
+ onBlur: l
103
104
  }) {
104
105
  const m = {
105
106
  element: t,
106
107
  autofocus: a,
107
108
  editable: !s,
108
109
  extensions: ((i) => [
109
- g,
110
+ x,
110
111
  p(i ? { onEnter: i } : void 0),
111
- y(),
112
112
  T(),
113
- x.configure({
114
- placeholder: e
113
+ b(),
114
+ d.configure({
115
+ placeholder: e,
116
+ showOnlyWhenEditable: u
115
117
  })
116
- ])(u),
118
+ ])(f),
117
119
  onUpdate: ({ editor: i }) => {
118
- const l = c(i.getJSON());
119
- r == null || r(l);
120
+ const g = c(i.getJSON());
121
+ r == null || r(g);
120
122
  },
121
- onFocus: f,
122
- onBlur: E
123
+ onFocus: E,
124
+ onBlur: l
123
125
  };
124
- return new d(m);
126
+ return new y(m);
125
127
  }
126
128
  export {
127
- B as createEditor
129
+ D as createEditor
128
130
  };
@@ -10,11 +10,11 @@ declare function __VLS_template(): {
10
10
  declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<TextEditorProps>, {
11
11
  autoFocus: boolean;
12
12
  disabled: boolean;
13
- placeholder: string;
13
+ placeholder: undefined;
14
14
  }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<TextEditorProps>, {
15
15
  autoFocus: boolean;
16
16
  disabled: boolean;
17
- placeholder: string;
17
+ placeholder: undefined;
18
18
  }>>> & Readonly<{}>, {
19
19
  placeholder: string;
20
20
  disabled: boolean;
@@ -1,67 +1,68 @@
1
- import { defineComponent as F, ref as p, computed as g, onMounted as B, onUnmounted as k, watch as c, createElementBlock as f, openBlock as m, normalizeClass as d, unref as i, createElementVNode as _, renderSlot as h } from "vue";
2
- import { useUIKit as M } from "@tencentcloud/uikit-base-component-vue3";
1
+ import { defineComponent as I, ref as p, onMounted as F, onUnmounted as g, watch as c, createElementBlock as f, openBlock as m, normalizeClass as d, unref as a, createElementVNode as _, renderSlot as h } from "vue";
2
+ import { useUIKit as B } from "@tencentcloud/uikit-base-component-vue3";
3
3
  import { createEditor as S } from "./EditorCore.js";
4
- import { useMessageInputState as D } from "../../../states/MessageInputState/MessageInputState.js";
5
- import { useConversationListState as R } from "../../../states/ConversationListState/ConversationListState.js";
6
- const T = "_disabled_ihh75_11", U = "_editor_ihh75_21", o = {
4
+ import { useMessageInputState as k } from "../../../states/MessageInputState/MessageInputState.js";
5
+ import { useConversationListState as M } from "../../../states/ConversationListState/ConversationListState.js";
6
+ const D = "_disabled_ihh75_11", R = "_editor_ihh75_21", o = {
7
7
  "input-wrapper": "_input-wrapper_ihh75_1",
8
- disabled: T,
8
+ disabled: D,
9
9
  "input-prefix": "_input-prefix_ihh75_15",
10
10
  "input-suffix": "_input-suffix_ihh75_16",
11
- editor: U
12
- }, K = /* @__PURE__ */ F({
11
+ editor: R
12
+ }, $ = /* @__PURE__ */ I({
13
13
  __name: "TextEditor",
14
14
  props: {
15
15
  autoFocus: { type: Boolean, default: !0 },
16
16
  disabled: { type: Boolean, default: !1 },
17
- placeholder: { default: "" }
17
+ placeholder: { default: void 0 }
18
18
  },
19
19
  setup(b) {
20
- const t = b, { t: x } = M(), { activeConversation: E } = R(), { updateRawValue: v, sendMessage: I, setEditorInstance: l, setContent: r } = D(), u = p(null), n = p(t.autoFocus), y = g(() => t.disabled ? "" : t.placeholder || x("MessageInput.enter_a_message"));
20
+ const t = b, { t: x } = B(), { activeConversation: E } = M(), { updateRawValue: v, sendMessage: y, setEditorInstance: n, setContent: r } = k(), l = p(null), u = p(t.autoFocus);
21
21
  let s = null;
22
- return B(() => {
23
- const e = u.value;
22
+ return F(() => {
23
+ const e = l.value;
24
24
  e && (e.classList.add("message-input"), e.dataset.editorCreated || (s = S({
25
25
  element: e,
26
- placeholder: y.value,
26
+ placeholder: t.placeholder ?? x("MessageInput.enter_a_message"),
27
+ isPlaceholderOnlyShowWhenEditable: t.placeholder === void 0,
27
28
  autoFocus: t.autoFocus,
28
29
  disabled: t.disabled,
29
- onUpdate: (a) => {
30
- v(a);
30
+ onUpdate: (i) => {
31
+ v(i);
31
32
  },
32
33
  onEnter: () => {
33
- I(), r("");
34
+ y(), r("");
34
35
  },
35
36
  onFocus: () => {
36
- n.value = !0;
37
+ u.value = !0;
37
38
  },
38
39
  onBlur: () => {
39
- n.value = !1;
40
+ u.value = !1;
40
41
  }
41
- }), e.dataset.editorCreated = "true", l(s)));
42
- }), k(() => {
43
- const e = u.value;
44
- s && e && (s.destroy(), e.removeAttribute("data-editor-created"), l(null));
45
- }), c(E, (e, a) => {
46
- (e == null ? void 0 : e.conversationID) !== (a == null ? void 0 : a.conversationID) && r("");
42
+ }), e.dataset.editorCreated = "true", n(s)));
43
+ }), g(() => {
44
+ const e = l.value;
45
+ s && e && (s.destroy(), e.removeAttribute("data-editor-created"), n(null));
46
+ }), c(E, (e, i) => {
47
+ (e == null ? void 0 : e.conversationID) !== (i == null ? void 0 : i.conversationID) && r("");
47
48
  }), c(() => t.disabled, (e) => {
48
49
  s && (s.setEditable(!e), e && r(""));
49
- }), (e, a) => (m(), f("div", {
50
- class: d([i(o)["input-wrapper"], t.disabled && i(o).disabled])
50
+ }), (e, i) => (m(), f("div", {
51
+ class: d([a(o)["input-wrapper"], t.disabled && a(o).disabled])
51
52
  }, [
52
53
  _("div", {
53
- class: d(i(o)["input-prefix"])
54
+ class: d(a(o)["input-prefix"])
54
55
  }, [
55
56
  h(e.$slots, "inputPrefix")
56
57
  ], 2),
57
58
  (m(), f("div", {
58
59
  ref_key: "editorDomRef",
59
- ref: u,
60
+ ref: l,
60
61
  key: t.disabled ? "disabled" : "enabled",
61
- class: d(i(o).editor)
62
+ class: d(a(o).editor)
62
63
  }, null, 2)),
63
64
  _("div", {
64
- class: d(i(o)["input-suffix"])
65
+ class: d(a(o)["input-suffix"])
65
66
  }, [
66
67
  h(e.$slots, "inputSuffix")
67
68
  ], 2)
@@ -69,5 +70,5 @@ const T = "_disabled_ihh75_11", U = "_editor_ihh75_21", o = {
69
70
  }
70
71
  });
71
72
  export {
72
- K as TextEditor
73
+ $ as TextEditor
73
74
  };
@@ -5,7 +5,7 @@ declare const MessageInput: {
5
5
  };
6
6
  placeholder: {
7
7
  type: import('vue').PropType<string>;
8
- default: string;
8
+ default: undefined;
9
9
  };
10
10
  disabled: {
11
11
  type: import('vue').PropType<boolean>;
@@ -47,7 +47,7 @@ declare const MessageInput: {
47
47
  };
48
48
  placeholder: {
49
49
  type: import('vue').PropType<string>;
50
- default: string;
50
+ default: undefined;
51
51
  };
52
52
  disabled: {
53
53
  type: import('vue').PropType<boolean>;
@@ -86,7 +86,7 @@ declare const MessageInput: {
86
86
  };
87
87
  placeholder: {
88
88
  type: import('vue').PropType<string>;
89
- default: string;
89
+ default: undefined;
90
90
  };
91
91
  disabled: {
92
92
  type: import('vue').PropType<boolean>;
@@ -402,7 +402,7 @@ declare const TextEditor: {
402
402
  new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
403
403
  placeholder: {
404
404
  type: import('vue').PropType<string>;
405
- default: string;
405
+ default: undefined;
406
406
  };
407
407
  disabled: {
408
408
  type: import('vue').PropType<boolean>;
@@ -426,7 +426,7 @@ declare const TextEditor: {
426
426
  }, Readonly<import('vue').ExtractPropTypes<{
427
427
  placeholder: {
428
428
  type: import('vue').PropType<string>;
429
- default: string;
429
+ default: undefined;
430
430
  };
431
431
  disabled: {
432
432
  type: import('vue').PropType<boolean>;
@@ -447,7 +447,7 @@ declare const TextEditor: {
447
447
  } & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
448
448
  placeholder: {
449
449
  type: import('vue').PropType<string>;
450
- default: string;
450
+ default: undefined;
451
451
  };
452
452
  disabled: {
453
453
  type: import('vue').PropType<boolean>;
@@ -6,7 +6,7 @@ import n from "./EmojiPicker/EmojiPicker.js";
6
6
  import { TextEditor as c } from "./TextEditor/index.js";
7
7
  import s from "./AudioCallPicker/AudioCallPicker.js";
8
8
  import a from "./VideoCallPicker/VideoCallPicker.js";
9
- import { _ as p } from "../../MessageInput.vue_vue_type_script_setup_true_lang-D1G-LitO.js";
9
+ import { _ as p } from "../../MessageInput.vue_vue_type_script_setup_true_lang-D9jiYNFu.js";
10
10
  import { addI18n as o } from "../../i18n/index.js";
11
11
  import { resources as t } from "./i18n/index.js";
12
12
  o("en-US", { translation: { MessageInput: t["en-US"] } });
@@ -1,6 +1,6 @@
1
- import { defineComponent as g, computed as i, ref as b, onMounted as y, createElementBlock as a, openBlock as n, normalizeStyle as c, createElementVNode as C, Fragment as k, renderList as x, normalizeClass as B } from "vue";
2
- import { _ as E } from "../../../../_plugin-vue_export-helper-CHgC5LLL.js";
3
- const F = /* @__PURE__ */ g({
1
+ import { defineComponent as g, computed as l, createElementBlock as a, openBlock as n, normalizeStyle as i, Fragment as w, renderList as C, unref as b, normalizeClass as y } from "vue";
2
+ import { _ as k } from "../../../../_plugin-vue_export-helper-CHgC5LLL.js";
3
+ const x = /* @__PURE__ */ g({
4
4
  __name: "WaveForm",
5
5
  props: {
6
6
  progress: {},
@@ -9,41 +9,31 @@ const F = /* @__PURE__ */ g({
9
9
  },
10
10
  emits: ["seek"],
11
11
  setup(m, { emit: u }) {
12
- const t = m, d = u, f = i(() => ({
13
- width: typeof t.width == "number" ? `${t.width}px` : t.width
14
- })), l = b([]);
15
- y(() => {
16
- const e = [];
17
- for (let r = 0; r < t.barsCount; r++)
18
- e.push(Math.random() * 16 + 8);
19
- l.value = e;
20
- });
21
- const p = (e) => {
22
- const r = (e + 1) / t.barsCount;
23
- return (t.progress || 0) >= r;
24
- }, v = i(() => ({
25
- left: `${(t.progress || 0) * 100}%`
26
- })), h = (e) => {
27
- const s = e.currentTarget.getBoundingClientRect(), _ = (e.clientX - s.left) / s.width, w = Math.max(0, Math.min(1, _));
28
- d("seek", w);
12
+ const e = m, f = u, d = l(() => ({
13
+ width: typeof e.width == "number" ? `${e.width}px` : e.width
14
+ })), p = Array.from({ length: e.barsCount }, () => Math.random() * 16 + 4), v = l(() => {
15
+ const t = e.progress || 0;
16
+ return t === 0 ? Array(e.barsCount).fill(!1) : Array.from({ length: e.barsCount }, (r, s) => {
17
+ const o = s / e.barsCount;
18
+ return t >= o;
19
+ });
20
+ }), _ = (t) => {
21
+ const r = t.currentTarget.getBoundingClientRect(), o = (t.clientX - r.left) / r.width, h = Math.max(0, Math.min(1, o));
22
+ f("seek", h);
29
23
  };
30
- return (e, r) => (n(), a("div", {
24
+ return (t, c) => (n(), a("div", {
31
25
  class: "wave-form",
32
- onClick: h,
33
- style: c(f.value)
26
+ style: i(d.value),
27
+ onClick: _
34
28
  }, [
35
- (n(!0), a(k, null, x(l.value, (s, o) => (n(), a("div", {
36
- key: o,
37
- class: B(["wave-form__bar", { "wave-form__bar--active": p(o) }]),
38
- style: c({ height: `${s}px` })
39
- }, null, 6))), 128)),
40
- C("div", {
41
- class: "wave-form__cursor",
42
- style: c(v.value)
43
- }, null, 4)
29
+ (n(!0), a(w, null, C(b(p), (r, s) => (n(), a("div", {
30
+ key: s,
31
+ class: y(["wave-form__bar", { "wave-form__bar--active": v.value[s] }]),
32
+ style: i({ height: `${r}px` })
33
+ }, null, 6))), 128))
44
34
  ], 4));
45
35
  }
46
- }), S = /* @__PURE__ */ E(F, [["__scopeId", "data-v-5bc04a79"]]);
36
+ }), F = /* @__PURE__ */ k(x, [["__scopeId", "data-v-93c67ced"]]);
47
37
  export {
48
- S as default
38
+ F as default
49
39
  };
@@ -1,60 +1,61 @@
1
- import { defineComponent as v, useCssModule as y, computed as i, createBlock as c, unref as e, openBlock as t, normalizeClass as o, withCtx as m, createTextVNode as _, toDisplayString as p } from "vue";
2
- import { IconCall1Filled as k, IconVideoDefaultFilled as x } from "@tencentcloud/uikit-base-component-vue3";
3
- import { View as u } from "../../../../../baseComp/View/index.js";
4
- import { ConversationType as g } from "../../../../../types/engine.js";
5
- import { parseCallMessageText as z, parseCallMessage as M, startCall as T } from "../../../../../utils/call.js";
6
- import { useConversationListState as w } from "../../../../../states/ConversationListState/ConversationListState.js";
7
- import { _ as D } from "../../../../../_plugin-vue_export-helper-CHgC5LLL.js";
8
- const I = /* @__PURE__ */ v({
1
+ import { defineComponent as v, useCssModule as k, computed as _, createBlock as l, unref as e, openBlock as c, normalizeClass as o, withCtx as u, createTextVNode as p, toDisplayString as g } from "vue";
2
+ import { IconCall1Filled as x, IconVideoDefaultFilled as z } from "@tencentcloud/uikit-base-component-vue3";
3
+ import { View as d } from "../../../../../baseComp/View/index.js";
4
+ import { ConversationType as f } from "../../../../../types/engine.js";
5
+ import { parseCallMessageText as M, parseCallMessage as T, startCall as D } from "../../../../../utils/call.js";
6
+ import { useConversationListState as I } from "../../../../../states/ConversationListState/ConversationListState.js";
7
+ import { _ as w } from "../../../../../_plugin-vue_export-helper-CHgC5LLL.js";
8
+ const V = /* @__PURE__ */ v({
9
9
  __name: "CallMessage",
10
10
  props: {
11
11
  message: {}
12
12
  },
13
- setup(d) {
14
- const s = d, a = y(), { activeConversation: f } = w(), n = i(() => z(s.message)), l = i(() => M(s.message)), C = () => {
15
- !f.value || !l.value || s.message.conversationType === g.GROUP || T({
16
- type: l.value.data.data.call_type,
17
- userIDList: l.value.data.inviteeList
13
+ setup(C) {
14
+ const s = C, a = k(), { activeConversation: n } = I(), i = _(() => M(s.message)), t = _(() => T(s.message)), y = () => {
15
+ var r;
16
+ !n.value || !t.value || s.message.conversationType === f.GROUP || D({
17
+ type: t.value.data.data.call_type,
18
+ userIDList: [(r = n.value.userProfile) == null ? void 0 : r.userID]
18
19
  });
19
20
  };
20
- return (h, B) => s.message.conversationType === e(g).C2C ? (t(), c(e(u), {
21
+ return (r, F) => s.message.conversationType === e(f).C2C ? (c(), l(e(d), {
21
22
  key: 0,
22
23
  gap: 8,
23
24
  dir: "row",
24
25
  class: o(e(a)["call-message-c2c"]),
25
- onClick: C
26
+ onClick: y
26
27
  }, {
27
- default: m(() => {
28
- var r;
28
+ default: u(() => {
29
+ var m;
29
30
  return [
30
- ((r = l.value) == null ? void 0 : r.data.data.call_type) === 1 ? (t(), c(e(k), {
31
+ ((m = t.value) == null ? void 0 : m.data.data.call_type) === 1 ? (c(), l(e(x), {
31
32
  key: 0,
32
33
  class: o(e(a)["call-message-c2c__icon"])
33
- }, null, 8, ["class"])) : (t(), c(e(x), {
34
+ }, null, 8, ["class"])) : (c(), l(e(z), {
34
35
  key: 1,
35
36
  class: o(e(a)["call-message-c2c__icon"])
36
37
  }, null, 8, ["class"])),
37
- _(" " + p(n.value), 1)
38
+ p(" " + g(i.value), 1)
38
39
  ];
39
40
  }),
40
41
  _: 1
41
- }, 8, ["class"])) : (t(), c(e(u), {
42
+ }, 8, ["class"])) : (c(), l(e(d), {
42
43
  key: 1,
43
44
  class: o(e(a)["call-message-group"])
44
45
  }, {
45
- default: m(() => [
46
- _(p(n.value), 1)
46
+ default: u(() => [
47
+ p(g(i.value), 1)
47
48
  ]),
48
49
  _: 1
49
50
  }, 8, ["class"]));
50
51
  }
51
- }), L = {
52
+ }), h = {
52
53
  "call-message-c2c": "_call-message-c2c_u2zzk_1",
53
54
  "call-message-c2c__icon": "_call-message-c2c__icon_u2zzk_7",
54
55
  "call-message-group": "_call-message-group_u2zzk_11"
55
- }, V = {
56
- $style: L
57
- }, P = /* @__PURE__ */ D(I, [["__cssModules", V]]);
56
+ }, B = {
57
+ $style: h
58
+ }, O = /* @__PURE__ */ w(V, [["__cssModules", B]]);
58
59
  export {
59
- P as default
60
+ O as default
60
61
  };
@@ -1,5 +1,5 @@
1
1
  import { MessageAction } from '../../../hooks/useMessageActions';
2
- import { IMessageModel as MessageModel } from '@tencentcloud/chat-uikit-engine';
2
+ import { MessageModel } from '../../../types/engine';
3
3
 
4
4
  interface MessageProps {
5
5
  message: MessageModel;
@@ -51,9 +51,9 @@ const ce = { class: "message-list" }, me = { class: "message-chunk" }, y = 150,
51
51
  key: `chunk-${e.ID}`
52
52
  }) : T.messages.push(e);
53
53
  }), s;
54
- }), b = se(() => {
54
+ }), H = se(() => {
55
55
  t.value && (f.value = t.value.scrollHeight - t.value.scrollTop - t.value.clientHeight, f.value > y && (p(!0), h.value = !0), f.value < y && (p(!1), h.value = !1));
56
- }, 100), H = async () => {
56
+ }, 100), b = async () => {
57
57
  v.value = !1, p(!1), h.value = !1;
58
58
  }, X = async () => {
59
59
  var l;
@@ -73,7 +73,7 @@ const ce = { class: "message-list" }, me = { class: "message-chunk" }, y = 150,
73
73
  }
74
74
  };
75
75
  return A(U, () => {
76
- H();
76
+ b();
77
77
  }), A(g, (l, s) => {
78
78
  if (s === void 0 && l && !v.value) {
79
79
  w(() => {
@@ -85,14 +85,16 @@ const ce = { class: "message-list" }, me = { class: "message-chunk" }, y = 150,
85
85
  return;
86
86
  const o = l[l.length - 1], e = s[s.length - 1];
87
87
  (o == null ? void 0 : o.ID) !== (e == null ? void 0 : e.ID) && (o.flow === "out" || !P.value && f.value < y) && _({ behavior: "smooth" });
88
+ }, {
89
+ immediate: !0
88
90
  }), A(() => a.enableReadReceipt, (l) => {
89
91
  W(l);
90
92
  }, {
91
93
  immediate: !0
92
94
  }), K(() => {
93
- t.value && t.value.addEventListener("scroll", b), H();
95
+ t.value && t.value.addEventListener("scroll", H), b();
94
96
  }), Q(() => {
95
- t.value && t.value.removeEventListener("scroll", b);
97
+ t.value && t.value.removeEventListener("scroll", H);
96
98
  }), (l, s) => (u(), C("div", ce, [
97
99
  S("div", {
98
100
  id: "messageScrollList",
@@ -145,7 +147,7 @@ const ce = { class: "message-list" }, me = { class: "message-chunk" }, y = 150,
145
147
  }, null, 8, ["class"])) : Y("", !0)
146
148
  ]));
147
149
  }
148
- }), De = /* @__PURE__ */ ue(ge, [["__scopeId", "data-v-cb526f87"]]);
150
+ }), De = /* @__PURE__ */ ue(ge, [["__scopeId", "data-v-ac83869e"]]);
149
151
  export {
150
152
  De as default
151
153
  };
@@ -1,6 +1,6 @@
1
1
  declare const Message: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
2
2
  message: {
3
- type: import('vue').PropType<import('@tencentcloud/chat-uikit-engine').IMessageModel>;
3
+ type: import('vue').PropType<import('../..').MessageModel>;
4
4
  required: true;
5
5
  };
6
6
  isLastInChunk: {
@@ -33,7 +33,7 @@ declare const Message: import('vue').DefineComponent<import('vue').ExtractPropTy
33
33
  };
34
34
  }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
35
35
  message: {
36
- type: import('vue').PropType<import('@tencentcloud/chat-uikit-engine').IMessageModel>;
36
+ type: import('vue').PropType<import('../..').MessageModel>;
37
37
  required: true;
38
38
  };
39
39
  isLastInChunk: {
@@ -1,10 +1,10 @@
1
1
  import { ref } from 'vue';
2
2
 
3
- interface IUseAudioControlProps {
3
+ interface UseAudioControlProps {
4
4
  url: string;
5
5
  audioId?: string;
6
6
  }
7
- interface IUseAudioControlReturn {
7
+ interface UseAudioControlReturn {
8
8
  isPlaying: ReturnType<typeof ref<boolean>>;
9
9
  progress: ReturnType<typeof ref<number>>;
10
10
  duration: ReturnType<typeof ref<number | undefined>>;
@@ -22,5 +22,5 @@ interface IUseAudioControlReturn {
22
22
  * @param props Configuration parameters
23
23
  * @returns Audio control related states and methods
24
24
  */
25
- export declare function useAudioControl(props: IUseAudioControlProps): IUseAudioControlReturn;
25
+ export declare function useAudioControl(props: UseAudioControlProps): UseAudioControlReturn;
26
26
  export {};
@@ -1,47 +1,49 @@
1
- import { ref as l, onMounted as g, onUnmounted as I } from "vue";
2
- const v = /* @__PURE__ */ new Map(), E = "AUDIO_PLAY_EVENT", P = (c) => new CustomEvent(E, {
1
+ import { ref as l, onMounted as I, onUnmounted as T } from "vue";
2
+ const v = /* @__PURE__ */ new Map(), f = "AUDIO_PLAY_EVENT", g = (c) => new CustomEvent(f, {
3
3
  detail: { audioId: c }
4
4
  });
5
5
  function y(c) {
6
- const { url: m } = c, n = c.audioId || `audio-${m}`, d = l(!1), r = l(0), a = l(void 0), u = l(!0), t = l(null), h = () => {
7
- t.value && (window.dispatchEvent(P(n)), t.value.play(), d.value = !0);
8
- }, f = () => {
9
- t.value && (t.value.pause(), d.value = !1);
6
+ const { url: m } = c, a = c.audioId || `audio-${m}`, r = l(!1), u = l(0), n = l(void 0), o = l(!0), t = l(null), h = () => {
7
+ t.value && (window.dispatchEvent(g(a)), t.value.play(), r.value = !0);
8
+ }, E = () => {
9
+ t.value && (t.value.pause(), r.value = !1);
10
10
  }, w = () => {
11
- t.value && (t.value.pause(), t.value.currentTime = 0, d.value = !1, r.value = 0);
11
+ t.value && (t.value.pause(), t.value.currentTime = 0, r.value = !1, u.value = 0);
12
12
  }, A = (e) => {
13
- if (!t.value || a.value === void 0)
13
+ if (!t.value || n.value === void 0)
14
14
  return;
15
- const o = Math.max(0, Math.min(1, e));
16
- t.value.currentTime = a.value * o, r.value = o;
17
- }, s = () => {
18
- !t.value || !a.value || (r.value = t.value.currentTime / a.value);
15
+ const d = Math.max(0, Math.min(1, e));
16
+ t.value.currentTime = n.value * d, u.value = d;
19
17
  }, i = () => {
20
- d.value = !1, r.value = 0;
18
+ !t.value || !n.value || (u.value = t.value.currentTime / n.value);
19
+ }, s = () => {
20
+ r.value = !1, u.value = 0;
21
21
  }, L = (e) => {
22
- e.detail.audioId !== n && d.value && f();
22
+ e.detail.audioId !== a && r.value && E();
23
23
  };
24
- return g(() => {
25
- window.addEventListener(E, L);
26
- let e = v.get(n);
27
- const o = () => {
28
- e && (a.value = e.duration, u.value = !1);
24
+ return I(() => {
25
+ window.addEventListener(f, L);
26
+ let e = v.get(a);
27
+ const d = () => {
28
+ e && (e.duration === 1 / 0 ? (e.currentTime = 1e101, e.ontimeupdate = () => {
29
+ e && (n.value = e.duration, e.ontimeupdate = null, e.currentTime = 0);
30
+ }) : n.value = e.duration, o.value = !1);
29
31
  }, p = () => {
30
- console.error("Audio load error:", m), u.value = !1;
32
+ console.error("Audio load error:", m), o.value = !1;
31
33
  };
32
- !e || e.src !== m ? (u.value = !0, a.value = void 0, e && (e.pause(), e.src = "", e.load(), e.removeEventListener("loadedmetadata", o), e.removeEventListener("error", p), e.removeEventListener("timeupdate", s), e.removeEventListener("ended", i)), e = new Audio(m), e.addEventListener("loadedmetadata", o), e.addEventListener("error", p), e.addEventListener("timeupdate", s), e.addEventListener("ended", i), v.set(n, e), t.value = e, d.value = !1, r.value = 0) : (t.value = e, e.removeEventListener("timeupdate", s), e.removeEventListener("ended", i), e.addEventListener("timeupdate", s), e.addEventListener("ended", i), e.duration && (a.value = e.duration, u.value = !1));
33
- }), I(() => {
34
- if (window.removeEventListener(E, L), v.has(n)) {
35
- const e = v.get(n);
36
- e.removeEventListener("timeupdate", s), e.removeEventListener("ended", i), e.pause(), e.src = "", e.load(), v.delete(n);
34
+ !e || e.src !== m ? (o.value = !0, n.value = void 0, e && (e.pause(), e.src = "", e.load(), e.removeEventListener("loadedmetadata", d), e.removeEventListener("error", p), e.removeEventListener("timeupdate", i), e.removeEventListener("ended", s)), e = new Audio(m), e.addEventListener("loadedmetadata", d), e.addEventListener("error", p), e.addEventListener("timeupdate", i), e.addEventListener("ended", s), v.set(a, e), t.value = e, r.value = !1, u.value = 0) : (t.value = e, e.removeEventListener("timeupdate", i), e.removeEventListener("ended", s), e.addEventListener("timeupdate", i), e.addEventListener("ended", s), e.duration && (n.value = e.duration, o.value = !1));
35
+ }), T(() => {
36
+ if (window.removeEventListener(f, L), v.has(a)) {
37
+ const e = v.get(a);
38
+ e.removeEventListener("timeupdate", i), e.removeEventListener("ended", s), e.pause(), e.src = "", e.load(), v.delete(a);
37
39
  }
38
40
  }), {
39
- isPlaying: d,
40
- progress: r,
41
- duration: a,
42
- isLoading: u,
41
+ isPlaying: r,
42
+ progress: u,
43
+ duration: n,
44
+ isLoading: o,
43
45
  play: h,
44
- pause: f,
46
+ pause: E,
45
47
  stop: w,
46
48
  setProgress: A
47
49
  };