tuikit-atomicx-vue3 4.5.0 → 4.5.2

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 (182) hide show
  1. package/dist/{MessageInput.vue_vue_type_script_setup_true_lang-jPzZ5INK.js → MessageInput.vue_vue_type_script_setup_true_lang-3RVYOdkv.js} +38 -38
  2. package/dist/{PopoverTrigger-L8abAry7.js → PopoverPortal-DV6zFXcf.js} +91 -136
  3. package/dist/PopoverTrigger-DIjW4PKa.js +54 -0
  4. package/dist/{PopperContent-XdhqL8Y2.js → PopperContent-D__dbwpA.js} +6 -6
  5. package/dist/{Teleport-CSEuZbpM.js → Teleport-98QrIYDI.js} +280 -270
  6. package/dist/baseComp/Modal/Modal.js +3 -3
  7. package/dist/components/AudioSettingPanel/index.js +14 -14
  8. package/dist/components/BarrageInput/EmojiPicker/EmojiPicker.js +10 -9
  9. package/dist/components/BarrageInput/TextEditor/CharacterCountExtension.js +1 -1
  10. package/dist/components/BarrageInput/TextEditor/EditorCore.js +16 -15
  11. package/dist/components/ConversationList/ConversationActions/ConversationActions.js +53 -50
  12. package/dist/components/ConversationList/ConversationActions/ConversationActions.vue.d.ts +2 -0
  13. package/dist/components/ConversationList/ConversationCreate/ConversationCreate.js +25 -25
  14. package/dist/components/ConversationList/ConversationList.vue.d.ts +16 -0
  15. package/dist/components/ConversationList/ConversationPreview/ConversationPreview.vue.d.ts +16 -0
  16. package/dist/components/ConversationList/ConversationPreview/ConversationPreviewAbstract.js +62 -40
  17. package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTimestamp.js +28 -26
  18. package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTitle.js +27 -23
  19. package/dist/components/ConversationList/ConversationPreview/ConversationPreviewTitle.vue.d.ts +1 -1
  20. package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUI.js +81 -70
  21. package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUI.vue.d.ts +4 -0
  22. package/dist/components/ConversationList/ConversationPreview/ConversationPreviewUnread.js +33 -31
  23. package/dist/components/ConversationList/ConversationPreview/utils.d.ts +2 -2
  24. package/dist/components/ConversationList/ConversationPreview/utils.js +81 -35
  25. package/dist/components/ConversationList/i18n/en-US.d.ts +11 -1
  26. package/dist/components/ConversationList/i18n/en-US.js +12 -2
  27. package/dist/components/ConversationList/i18n/zh-CN.d.ts +11 -1
  28. package/dist/components/ConversationList/i18n/zh-CN.js +12 -2
  29. package/dist/components/ConversationList/index.d.ts +48 -0
  30. package/dist/components/MessageInput/AttachmentPicker/index.js +10 -9
  31. package/dist/components/MessageInput/EmojiPicker/EmojiPicker.js +17 -16
  32. package/dist/components/MessageInput/MessageInput.js +1 -1
  33. package/dist/components/MessageInput/QuotedMessagePreview/index.js +35 -35
  34. package/dist/components/MessageInput/TextEditor/EditorCore.d.ts +13 -12
  35. package/dist/components/MessageInput/TextEditor/EditorCore.js +54 -89
  36. package/dist/components/MessageInput/TextEditor/extensions/MentionSuggestion.js +229 -0
  37. package/dist/components/MessageInput/TextEditor/extensions/MentionSuggestion.vue.d.ts +15 -0
  38. package/dist/components/MessageInput/TextEditor/extensions/characterCountExtension.js +1 -1
  39. package/dist/components/MessageInput/TextEditor/extensions/emojiExtension.d.ts +1 -0
  40. package/dist/components/MessageInput/TextEditor/extensions/emojiExtension.js +22 -0
  41. package/dist/components/MessageInput/TextEditor/extensions/enterKeyExtension.d.ts +3 -0
  42. package/dist/components/MessageInput/TextEditor/extensions/enterKeyExtension.js +15 -0
  43. package/dist/components/MessageInput/TextEditor/extensions/imageExtension.js +2 -2
  44. package/dist/components/MessageInput/TextEditor/extensions/index.d.ts +8 -0
  45. package/dist/components/MessageInput/TextEditor/extensions/index.js +12 -0
  46. package/dist/components/MessageInput/TextEditor/extensions/mentionExtension.d.ts +5 -0
  47. package/dist/components/MessageInput/TextEditor/extensions/mentionExtension.js +330 -0
  48. package/dist/components/MessageInput/TextEditor/index.js +62 -62
  49. package/dist/components/MessageInput/i18n/en-US.d.ts +3 -0
  50. package/dist/components/MessageInput/i18n/en-US.js +4 -1
  51. package/dist/components/MessageInput/i18n/index.d.ts +6 -0
  52. package/dist/components/MessageInput/i18n/zh-CN.d.ts +3 -0
  53. package/dist/components/MessageInput/i18n/zh-CN.js +4 -1
  54. package/dist/components/MessageInput/index.js +1 -1
  55. package/dist/components/MessageList/Message/ImageMessage/ImageMessage.js +119 -89
  56. package/dist/components/MessageList/Message/ImageMessage/ImagePreview.js +142 -0
  57. package/dist/components/MessageList/Message/ImageMessage/ImagePreview.vue.d.ts +20 -0
  58. package/dist/components/MessageList/Message/Message.vue.d.ts +8 -0
  59. package/dist/components/MessageList/Message/MessageLayout/MessageActionDropdown/MessageActionDropdown.js +3 -3
  60. package/dist/components/MessageList/Message/MessageLayout/MessageLayout.js +69 -58
  61. package/dist/components/MessageList/Message/MessageLayout/MessageLayout.vue.d.ts +8 -0
  62. package/dist/components/MessageList/Message/MessageLayout/MessageMeta/MessageMeta.js +37 -28
  63. package/dist/components/MessageList/Message/index.js +8 -4
  64. package/dist/components/MessageList/MessageList.js +109 -91
  65. package/dist/components/MessageList/MessageList.vue.d.ts +1 -1
  66. package/dist/components/MessageList/index.d.ts +21 -3
  67. package/dist/components/ScheduleRoomPanel/RoomDetail.js +22 -22
  68. package/dist/components/ScheduleRoomPanel/RoomEdit.js +1 -1
  69. package/dist/components/ScheduleRoomPanel/RoomShare.js +4 -4
  70. package/dist/components/ScheduleRoomPanel/ScheduleRoomPanel.js +1 -1
  71. package/dist/components/ScheduleRoomPanel/ScheduledRoomList.js +1 -1
  72. package/dist/components/Search/SearchResults/SearchResultsItem/Message/Message.js +6 -6
  73. package/dist/components/Search/SearchResults/SearchResultsItem/Message/Message.vue.d.ts +1 -1
  74. package/dist/components/UIKitModal/chatErrorModal/chatErrorModal.d.ts +72 -0
  75. package/dist/components/UIKitModal/chatErrorModal/chatErrorModal.js +95 -0
  76. package/dist/components/UIKitModal/chatErrorModal/i18n/en-US/index.d.ts +40 -0
  77. package/dist/components/UIKitModal/chatErrorModal/i18n/en-US/index.js +51 -0
  78. package/dist/components/UIKitModal/chatErrorModal/i18n/index.d.ts +4 -0
  79. package/dist/components/UIKitModal/chatErrorModal/i18n/index.js +6 -0
  80. package/dist/components/UIKitModal/chatErrorModal/i18n/zh-CN/index.d.ts +40 -0
  81. package/dist/components/UIKitModal/chatErrorModal/i18n/zh-CN/index.js +51 -0
  82. package/dist/components/UIKitModal/chatErrorModal/index.d.ts +3 -0
  83. package/dist/components/UIKitModal/chatErrorModal/index.js +11 -0
  84. package/dist/components/VideoSettingPanel/index.js +1 -1
  85. package/dist/hooks/useReadReceipt/useReadReceipt.js +44 -41
  86. package/dist/index-CTthrJb2.js +1461 -0
  87. package/dist/index-DXC5bPY4.js +2174 -0
  88. package/dist/{index-Do-2CngU.js → index-DuAffztD.js} +115 -142
  89. package/dist/{index-7vNB_Vx8.js → index-hHVD-MG2.js} +1 -1
  90. package/dist/index.d.ts +1 -1
  91. package/dist/index.js +150 -149
  92. package/dist/states/GroupSettingState/GroupSettingState.js +109 -102
  93. package/dist/states/LoginState.js +43 -43
  94. package/dist/states/MessageActionState/MessageActionState.js +83 -223
  95. package/dist/states/MessageInputState/MessageInputState.js +111 -82
  96. package/dist/states/MessageInputState/type.d.ts +36 -10
  97. package/dist/states/MessageInputState/utils.d.ts +1 -5
  98. package/dist/states/MessageListState/MessageListState.d.ts +1 -1
  99. package/dist/states/MessageListState/MessageListState.js +26 -23
  100. package/dist/states/RoomParticipantState/index.js +83 -24
  101. package/dist/states/RoomParticipantState/participantEventManager.d.ts +2 -2
  102. package/dist/states/RoomParticipantState/participantEventManager.js +217 -205
  103. package/dist/states/RoomParticipantState/participantManager.d.ts +4 -0
  104. package/dist/states/RoomParticipantState/participantManager.js +159 -127
  105. package/dist/states/RoomState/callManager.d.ts +3 -3
  106. package/dist/states/RoomState/callManager.js +20 -20
  107. package/dist/states/RoomState/common.d.ts +3 -2
  108. package/dist/states/RoomState/common.js +34 -24
  109. package/dist/states/RoomState/roomManager.d.ts +0 -1
  110. package/dist/states/RoomState/roomManager.js +21 -27
  111. package/dist/states/RoomState/scheduleManager.js +2 -2
  112. package/dist/styles/index.css +1 -1
  113. package/dist/{chat/index.d.ts → subEntry/chat/chat.d.ts} +2160 -2087
  114. package/dist/subEntry/chat/chat.js +89 -0
  115. package/dist/subEntry/chat/index.d.ts +11 -0
  116. package/dist/subEntry/chat/index.js +81 -0
  117. package/dist/{chat → subEntry/chat}/server.js +4 -4
  118. package/dist/subEntry/live/index.js +46 -45
  119. package/dist/subEntry/room/index.js +39 -38
  120. package/dist/types/beauty.d.ts +20 -0
  121. package/dist/types/index.js +37 -36
  122. package/dist/types/participant.d.ts +2 -0
  123. package/dist/types/room.d.ts +45 -1
  124. package/dist/types/room.js +4 -3
  125. package/dist/{useId-CtirfF0W.js → useId-B1VwPJLm.js} +1 -1
  126. package/dist/utils/call.js +77 -71
  127. package/dist/{utils-DaB7eSu5.js → utils-BU8IkP_V.js} +1 -1
  128. package/package.json +8 -7
  129. package/src/components/AudioSettingPanel/index.vue +4 -5
  130. package/src/components/ConversationList/ConversationActions/ConversationActions.vue +7 -1
  131. package/src/components/ConversationList/ConversationCreate/ConversationCreate.vue +5 -1
  132. package/src/components/ConversationList/ConversationList.vue +0 -1
  133. package/src/components/ConversationList/ConversationPreview/ConversationPreview.scss +10 -2
  134. package/src/components/ConversationList/ConversationPreview/ConversationPreviewAbstract.vue +32 -1
  135. package/src/components/ConversationList/ConversationPreview/ConversationPreviewTitle.vue +3 -2
  136. package/src/components/ConversationList/ConversationPreview/ConversationPreviewUI.vue +15 -0
  137. package/src/components/ConversationList/ConversationPreview/utils.ts +98 -28
  138. package/src/components/ConversationList/i18n/en-US.ts +11 -1
  139. package/src/components/ConversationList/i18n/zh-CN.ts +11 -1
  140. package/src/components/MessageInput/MessageInput.module.scss +1 -0
  141. package/src/components/MessageInput/QuotedMessagePreview/QuotedMessagePreview.vue +19 -22
  142. package/src/components/MessageInput/TextEditor/Editor.scss +25 -0
  143. package/src/components/MessageInput/TextEditor/EditorCore.ts +79 -99
  144. package/src/components/MessageInput/TextEditor/TextEditor.vue +64 -68
  145. package/src/components/MessageInput/TextEditor/extensions/MentionSuggestion.vue +449 -0
  146. package/src/components/MessageInput/TextEditor/extensions/emojiExtension.ts +22 -0
  147. package/src/components/MessageInput/TextEditor/extensions/enterKeyExtension.ts +22 -0
  148. package/src/components/MessageInput/TextEditor/extensions/index.ts +8 -0
  149. package/src/components/MessageInput/TextEditor/extensions/mentionExtension.ts +87 -0
  150. package/src/components/MessageInput/i18n/en-US.ts +3 -0
  151. package/src/components/MessageInput/i18n/zh-CN.ts +3 -0
  152. package/src/components/MessageList/Message/ImageMessage/ImageMessage.vue +49 -0
  153. package/src/components/MessageList/Message/ImageMessage/ImagePreview.vue +344 -0
  154. package/src/components/MessageList/Message/Message.vue +6 -0
  155. package/src/components/MessageList/Message/MessageLayout/MessageLayout.vue +8 -1
  156. package/src/components/MessageList/Message/MessageLayout/MessageMeta/MessageMeta.vue +12 -3
  157. package/src/components/MessageList/MessageList.vue +50 -14
  158. package/src/components/ScheduleRoomPanel/RoomDetail.vue +1 -0
  159. package/src/components/ScheduleRoomPanel/RoomEdit.vue +2 -1
  160. package/src/components/ScheduleRoomPanel/RoomShare.vue +1 -0
  161. package/src/components/ScheduleRoomPanel/ScheduleRoomPanel.vue +1 -0
  162. package/src/components/ScheduleRoomPanel/ScheduledRoomList.vue +1 -0
  163. package/src/components/Search/SearchResults/SearchResultsItem/Message/Message.vue +30 -31
  164. package/src/components/UIKitModal/chatErrorModal/chatErrorModal.ts +205 -0
  165. package/src/components/UIKitModal/chatErrorModal/i18n/en-US/index.ts +56 -0
  166. package/src/components/UIKitModal/chatErrorModal/i18n/index.ts +4 -0
  167. package/src/components/UIKitModal/chatErrorModal/i18n/zh-CN/index.ts +56 -0
  168. package/src/components/UIKitModal/chatErrorModal/index.ts +16 -0
  169. package/src/components/VideoSettingPanel/index.vue +1 -0
  170. package/src/hooks/useReadReceipt/useReadReceipt.ts +5 -4
  171. package/src/index.ts +1 -1
  172. package/src/{chat/index.ts → subEntry/chat/chat.ts} +25 -18
  173. package/src/subEntry/chat/index.ts +13 -0
  174. package/src/{chat → subEntry/chat}/server.ts +3 -3
  175. package/src/types/beauty.ts +20 -0
  176. package/src/types/participant.ts +3 -0
  177. package/src/types/room.ts +49 -1
  178. package/src/utils/call.ts +8 -0
  179. package/dist/chat/index.js +0 -59
  180. package/dist/index-ZILx4LYk.js +0 -4826
  181. package/dist/states/SearchState.d.ts +0 -314
  182. /package/dist/{chat → subEntry/chat}/server.d.ts +0 -0
@@ -0,0 +1,330 @@
1
+ import { P as V, a as K, D as F, b as G, e as z, N as j, c as J, m as q } from "../../../../index-DuAffztD.js";
2
+ import { V as Q } from "../../../../index-DXC5bPY4.js";
3
+ import { ConversationType as X } from "../../../../types/engine.js";
4
+ import Y from "./MentionSuggestion.js";
5
+ import { useGroupSettingState as Z } from "../../../../states/GroupSettingState/GroupSettingState.js";
6
+ import { GroupType as ee } from "../../../../states/GroupSettingState/types.js";
7
+ import { useConversationListState as te } from "../../../../states/ConversationListState/ConversationListState.js";
8
+ function ne(e) {
9
+ var t;
10
+ const { char: n, allowSpaces: o, allowToIncludeChar: r, allowedPrefixes: a, startOfLine: m, $position: l } = e, u = o && !r, c = z(n), S = new RegExp(`\\s${c}$`), x = m ? "^" : "", $ = r ? "" : c, B = u ? new RegExp(`${x}${c}.*?(?=\\s${$}|$)`, "gm") : new RegExp(`${x}(?:^)?${c}[^\\s${$}]*`, "gm"), h = ((t = l.nodeBefore) === null || t === void 0 ? void 0 : t.isText) && l.nodeBefore.text;
11
+ if (!h)
12
+ return null;
13
+ const i = l.pos - h.length, g = Array.from(h.matchAll(B)).pop();
14
+ if (!g || g.input === void 0 || g.index === void 0)
15
+ return null;
16
+ const d = g.input.slice(Math.max(0, g.index - 1), g.index), f = new RegExp(`^[${a == null ? void 0 : a.join("")}\0]?$`).test(d);
17
+ if (a !== null && !f)
18
+ return null;
19
+ const p = i + g.index;
20
+ let v = p + g[0].length;
21
+ return u && S.test(h.slice(v - 1, v + 1)) && (g[0] += " ", v += 1), p < l.pos && v >= l.pos ? {
22
+ range: {
23
+ from: p,
24
+ to: v
25
+ },
26
+ query: g[0].slice(n.length),
27
+ text: g[0]
28
+ } : null;
29
+ }
30
+ const oe = new K("suggestion");
31
+ function ie({ pluginKey: e = oe, editor: t, char: n = "@", allowSpaces: o = !1, allowToIncludeChar: r = !1, allowedPrefixes: a = [" "], startOfLine: m = !1, decorationTag: l = "span", decorationClass: u = "suggestion", command: c = () => null, items: S = () => [], render: x = () => ({}), allow: $ = () => !0, findSuggestionMatch: B = ne }) {
32
+ let h;
33
+ const i = x == null ? void 0 : x(), g = new V({
34
+ key: e,
35
+ view() {
36
+ return {
37
+ update: async (d, f) => {
38
+ var p, v, T, b, w, A, M;
39
+ const s = (p = this.key) === null || p === void 0 ? void 0 : p.getState(f), y = (v = this.key) === null || v === void 0 ? void 0 : v.getState(d.state), C = s.active && y.active && s.range.from !== y.range.from, R = !s.active && y.active, D = s.active && !y.active, P = !R && !D && s.query !== y.query, _ = R || C && P, E = P || C, k = D || C && P;
40
+ if (!_ && !E && !k)
41
+ return;
42
+ const L = k && !_ ? s : y, N = d.dom.querySelector(`[data-decoration-id="${L.decorationId}"]`);
43
+ h = {
44
+ editor: t,
45
+ range: L.range,
46
+ query: L.query,
47
+ text: L.text,
48
+ items: [],
49
+ command: (H) => c({
50
+ editor: t,
51
+ range: L.range,
52
+ props: H
53
+ }),
54
+ decorationNode: N,
55
+ // virtual node for popper.js or tippy.js
56
+ // this can be used for building popups without a DOM node
57
+ clientRect: N ? () => {
58
+ var H;
59
+ const { decorationId: U } = (H = this.key) === null || H === void 0 ? void 0 : H.getState(t.state), I = d.dom.querySelector(`[data-decoration-id="${U}"]`);
60
+ return (I == null ? void 0 : I.getBoundingClientRect()) || null;
61
+ } : null
62
+ }, _ && ((T = i == null ? void 0 : i.onBeforeStart) === null || T === void 0 || T.call(i, h)), E && ((b = i == null ? void 0 : i.onBeforeUpdate) === null || b === void 0 || b.call(i, h)), (E || _) && (h.items = await S({
63
+ editor: t,
64
+ query: L.query
65
+ })), k && ((w = i == null ? void 0 : i.onExit) === null || w === void 0 || w.call(i, h)), E && ((A = i == null ? void 0 : i.onUpdate) === null || A === void 0 || A.call(i, h)), _ && ((M = i == null ? void 0 : i.onStart) === null || M === void 0 || M.call(i, h));
66
+ },
67
+ destroy: () => {
68
+ var d;
69
+ h && ((d = i == null ? void 0 : i.onExit) === null || d === void 0 || d.call(i, h));
70
+ }
71
+ };
72
+ },
73
+ state: {
74
+ // Initialize the plugin's internal state.
75
+ init() {
76
+ return {
77
+ active: !1,
78
+ range: {
79
+ from: 0,
80
+ to: 0
81
+ },
82
+ query: null,
83
+ text: null,
84
+ composing: !1
85
+ };
86
+ },
87
+ // Apply changes to the plugin state from a view transaction.
88
+ apply(d, f, p, v) {
89
+ const { isEditable: T } = t, { composing: b } = t.view, { selection: w } = d, { empty: A, from: M } = w, s = { ...f };
90
+ if (s.composing = b, T && (A || t.view.composing)) {
91
+ (M < f.range.from || M > f.range.to) && !b && !f.composing && (s.active = !1);
92
+ const y = B({
93
+ char: n,
94
+ allowSpaces: o,
95
+ allowToIncludeChar: r,
96
+ allowedPrefixes: a,
97
+ startOfLine: m,
98
+ $position: w.$from
99
+ }), C = `id_${Math.floor(Math.random() * 4294967295)}`;
100
+ y && $({
101
+ editor: t,
102
+ state: v,
103
+ range: y.range,
104
+ isActive: f.active
105
+ }) ? (s.active = !0, s.decorationId = f.decorationId ? f.decorationId : C, s.range = y.range, s.query = y.query, s.text = y.text) : s.active = !1;
106
+ } else
107
+ s.active = !1;
108
+ return s.active || (s.decorationId = null, s.range = { from: 0, to: 0 }, s.query = null, s.text = null), s;
109
+ }
110
+ },
111
+ props: {
112
+ // Call the keydown hook if suggestion is active.
113
+ handleKeyDown(d, f) {
114
+ var p;
115
+ const { active: v, range: T } = g.getState(d.state);
116
+ return v && ((p = i == null ? void 0 : i.onKeyDown) === null || p === void 0 ? void 0 : p.call(i, { view: d, event: f, range: T })) || !1;
117
+ },
118
+ // Setup decorator on the currently active suggestion.
119
+ decorations(d) {
120
+ const { active: f, range: p, decorationId: v } = g.getState(d);
121
+ return f ? F.create(d.doc, [
122
+ G.inline(p.from, p.to, {
123
+ nodeName: l,
124
+ class: u,
125
+ "data-decoration-id": v
126
+ })
127
+ ]) : null;
128
+ }
129
+ }
130
+ });
131
+ return g;
132
+ }
133
+ function re({ editor: e, overrideSuggestionOptions: t, extensionName: n, char: o = "@" }) {
134
+ const r = new K();
135
+ return {
136
+ editor: e,
137
+ char: o,
138
+ pluginKey: r,
139
+ command: ({ editor: a, range: m, props: l }) => {
140
+ var u, c, S;
141
+ const x = a.view.state.selection.$to.nodeAfter;
142
+ ((u = x == null ? void 0 : x.text) === null || u === void 0 ? void 0 : u.startsWith(" ")) && (m.to += 1), a.chain().focus().insertContentAt(m, [
143
+ {
144
+ type: n,
145
+ attrs: { ...l, mentionSuggestionChar: o }
146
+ },
147
+ {
148
+ type: "text",
149
+ text: " "
150
+ }
151
+ ]).run(), (S = (c = a.view.dom.ownerDocument.defaultView) === null || c === void 0 ? void 0 : c.getSelection()) === null || S === void 0 || S.collapseToEnd();
152
+ },
153
+ allow: ({ state: a, range: m }) => {
154
+ const l = a.doc.resolve(m.from), u = a.schema.nodes[n];
155
+ return !!l.parent.type.contentMatch.matchType(u);
156
+ },
157
+ ...t
158
+ };
159
+ }
160
+ function W(e) {
161
+ return (e.options.suggestions.length ? e.options.suggestions : [e.options.suggestion]).map((t) => re({
162
+ // @ts-ignore `editor` can be `undefined` when converting the document to HTML with the HTML utility
163
+ editor: e.editor,
164
+ overrideSuggestionOptions: t,
165
+ extensionName: e.name,
166
+ char: t.char
167
+ }));
168
+ }
169
+ function O(e, t) {
170
+ const n = W(e), o = n.find((r) => r.char === t);
171
+ return o || (n.length ? n[0] : null);
172
+ }
173
+ const ae = j.create({
174
+ name: "mention",
175
+ priority: 101,
176
+ addOptions() {
177
+ return {
178
+ HTMLAttributes: {},
179
+ renderText({ node: e, suggestion: t }) {
180
+ var n, o;
181
+ return `${(n = t == null ? void 0 : t.char) !== null && n !== void 0 ? n : "@"}${(o = e.attrs.label) !== null && o !== void 0 ? o : e.attrs.id}`;
182
+ },
183
+ deleteTriggerWithBackspace: !1,
184
+ renderHTML({ options: e, node: t, suggestion: n }) {
185
+ var o, r;
186
+ return [
187
+ "span",
188
+ q(this.HTMLAttributes, e.HTMLAttributes),
189
+ `${(o = n == null ? void 0 : n.char) !== null && o !== void 0 ? o : "@"}${(r = t.attrs.label) !== null && r !== void 0 ? r : t.attrs.id}`
190
+ ];
191
+ },
192
+ suggestions: [],
193
+ suggestion: {}
194
+ };
195
+ },
196
+ group: "inline",
197
+ inline: !0,
198
+ selectable: !1,
199
+ atom: !0,
200
+ addAttributes() {
201
+ return {
202
+ id: {
203
+ default: null,
204
+ parseHTML: (e) => e.getAttribute("data-id"),
205
+ renderHTML: (e) => e.id ? {
206
+ "data-id": e.id
207
+ } : {}
208
+ },
209
+ label: {
210
+ default: null,
211
+ parseHTML: (e) => e.getAttribute("data-label"),
212
+ renderHTML: (e) => e.label ? {
213
+ "data-label": e.label
214
+ } : {}
215
+ },
216
+ // When there are multiple types of mentions, this attribute helps distinguish them
217
+ mentionSuggestionChar: {
218
+ default: "@",
219
+ parseHTML: (e) => e.getAttribute("data-mention-suggestion-char"),
220
+ renderHTML: (e) => ({
221
+ "data-mention-suggestion-char": e.mentionSuggestionChar
222
+ })
223
+ }
224
+ };
225
+ },
226
+ parseHTML() {
227
+ return [
228
+ {
229
+ tag: `span[data-type="${this.name}"]`
230
+ }
231
+ ];
232
+ },
233
+ renderHTML({ node: e, HTMLAttributes: t }) {
234
+ const n = O(this, e.attrs.mentionSuggestionChar);
235
+ if (this.options.renderLabel !== void 0)
236
+ return console.warn("renderLabel is deprecated use renderText and renderHTML instead"), [
237
+ "span",
238
+ q({ "data-type": this.name }, this.options.HTMLAttributes, t),
239
+ this.options.renderLabel({
240
+ options: this.options,
241
+ node: e,
242
+ suggestion: n
243
+ })
244
+ ];
245
+ const o = { ...this.options };
246
+ o.HTMLAttributes = q({ "data-type": this.name }, this.options.HTMLAttributes, t);
247
+ const r = this.options.renderHTML({
248
+ options: o,
249
+ node: e,
250
+ suggestion: n
251
+ });
252
+ return typeof r == "string" ? [
253
+ "span",
254
+ q({ "data-type": this.name }, this.options.HTMLAttributes, t),
255
+ r
256
+ ] : r;
257
+ },
258
+ renderText({ node: e }) {
259
+ const t = {
260
+ options: this.options,
261
+ node: e,
262
+ suggestion: O(this, e.attrs.mentionSuggestionChar)
263
+ };
264
+ return this.options.renderLabel !== void 0 ? (console.warn("renderLabel is deprecated use renderText and renderHTML instead"), this.options.renderLabel(t)) : this.options.renderText(t);
265
+ },
266
+ addKeyboardShortcuts() {
267
+ return {
268
+ Backspace: () => this.editor.commands.command(({ tr: e, state: t }) => {
269
+ let n = !1;
270
+ const { selection: o } = t, { empty: r, anchor: a } = o;
271
+ if (!r)
272
+ return !1;
273
+ t.doc.nodesBetween(a - 1, a, (u, c) => {
274
+ if (u.type.name === this.name)
275
+ return n = !0, e.insertText(this.options.deleteTriggerWithBackspace ? "" : this.options.suggestion.char || "", c, c + u.nodeSize), !1;
276
+ });
277
+ let m = new J(), l = 0;
278
+ return t.doc.nodesBetween(a - 1, a, (u, c) => {
279
+ if (u.type.name === this.name)
280
+ return n = !0, m = u, l = c, !1;
281
+ }), n && e.insertText(this.options.deleteTriggerWithBackspace ? "" : m.attrs.mentionSuggestionChar, l, l + m.nodeSize), n;
282
+ })
283
+ };
284
+ },
285
+ addProseMirrorPlugins() {
286
+ return W(this).map(ie);
287
+ }
288
+ });
289
+ function pe() {
290
+ return ae.configure({
291
+ deleteTriggerWithBackspace: !0,
292
+ HTMLAttributes: {
293
+ class: "uikit-message-input-mention-tag"
294
+ },
295
+ suggestion: {
296
+ char: "@",
297
+ // Items are now managed inside the component via GroupSettingState
298
+ items: () => [],
299
+ render: () => {
300
+ let e = null, t = null;
301
+ const n = () => {
302
+ t != null && t.parentNode && t.parentNode.removeChild(t), e == null || e.destroy(), e = null, t = null;
303
+ };
304
+ return {
305
+ onStart: (o) => {
306
+ var l;
307
+ const { activeConversation: r } = te(), { memberCount: a, groupType: m } = Z();
308
+ ((l = r.value) == null ? void 0 : l.type) === X.GROUP && a.value && a.value > 1 && m.value !== ee.AVCHATROOM && (e = new Q(Y, {
309
+ props: o,
310
+ editor: o.editor
311
+ }), e.element && (t = e.element, document.body.appendChild(t)));
312
+ },
313
+ onUpdate(o) {
314
+ e == null || e.updateProps(o);
315
+ },
316
+ onKeyDown(o) {
317
+ var r, a;
318
+ return o.event.key === "Escape" ? (n(), !0) : ((a = (r = e == null ? void 0 : e.ref) == null ? void 0 : r.onKeyDown) == null ? void 0 : a.call(r, o)) || !1;
319
+ },
320
+ onExit() {
321
+ n();
322
+ }
323
+ };
324
+ }
325
+ }
326
+ });
327
+ }
328
+ export {
329
+ pe as createMentionExtension
330
+ };
@@ -1,15 +1,16 @@
1
- import { defineComponent as F, ref as f, computed as S, onMounted as B, onUnmounted as L, watch as r, createElementBlock as m, openBlock as h, normalizeClass as d, unref as s, createElementVNode as _, renderSlot as x } from "vue";
2
- import { useUIKit as M } from "@tencentcloud/uikit-base-component-vue3";
3
- import { createEditor as k } from "./EditorCore.js";
4
- import { useMessageInputState as D } from "../../../states/MessageInputState/MessageInputState.js";
5
- import { useConversationListState as P } from "../../../states/ConversationListState/ConversationListState.js";
6
- const R = "_disabled_ihh75_11", U = "_editor_ihh75_21", i = {
1
+ import { defineComponent as b, computed as I, watch as i, onBeforeUnmount as S, createElementBlock as B, openBlock as L, normalizeClass as r, unref as n, createElementVNode as p, createVNode as M, renderSlot as c } from "vue";
2
+ import { useUIKit as y } from "@tencentcloud/uikit-base-component-vue3";
3
+ import { u as N, a as P } from "../../../index-DXC5bPY4.js";
4
+ import { createExtensions as U, convertEditorContent as V } from "./EditorCore.js";
5
+ import { useMessageInputState as k } from "../../../states/MessageInputState/MessageInputState.js";
6
+ import { useConversationListState as w } from "../../../states/ConversationListState/ConversationListState.js";
7
+ const F = "_disabled_ihh75_11", O = "_editor_ihh75_21", s = {
7
8
  "input-wrapper": "_input-wrapper_ihh75_1",
8
- disabled: R,
9
+ disabled: F,
9
10
  "input-prefix": "_input-prefix_ihh75_15",
10
11
  "input-suffix": "_input-suffix_ihh75_16",
11
- editor: U
12
- }, A = /* @__PURE__ */ F({
12
+ editor: O
13
+ }, K = /* @__PURE__ */ b({
13
14
  __name: "TextEditor",
14
15
  props: {
15
16
  autoFocus: { type: Boolean, default: !0 },
@@ -17,67 +18,66 @@ const R = "_disabled_ihh75_11", U = "_editor_ihh75_21", i = {
17
18
  placeholder: { default: void 0 },
18
19
  maxLength: { default: void 0 }
19
20
  },
20
- setup(b) {
21
- const t = b, { t: v, language: g } = M(), { activeConversation: E } = P(), { updateRawValue: y, sendMessage: I, setEditorInstance: u, setContent: l } = D(), n = f(null), p = f(t.autoFocus), c = S(() => t.placeholder ?? v("MessageInput.enter_a_message"));
22
- let a = null;
23
- return B(() => {
24
- const e = n.value;
25
- e && (e.classList.add("message-input"), e.dataset.editorCreated || (a = k({
26
- element: e,
27
- placeholder: c.value,
28
- isPlaceholderOnlyShowWhenEditable: t.placeholder === void 0,
29
- autoFocus: t.autoFocus,
30
- disabled: t.disabled,
31
- maxLength: t.maxLength,
32
- onUpdate: (o) => {
33
- y(o);
34
- },
35
- onEnter: () => {
36
- I(), l("");
37
- },
38
- onFocus: () => {
39
- p.value = !0;
40
- },
41
- onBlur: () => {
42
- p.value = !1;
43
- }
44
- }), e.dataset.editorCreated = "true", u(a)));
45
- }), L(() => {
46
- const e = n.value;
47
- a && e && (a.destroy(), e.removeAttribute("data-editor-created"), u(null));
48
- }), r(E, (e, o) => {
49
- (e == null ? void 0 : e.conversationID) !== (o == null ? void 0 : o.conversationID) && l("");
50
- }), r(g, () => {
51
- if (a && t.placeholder === void 0) {
52
- const e = a.extensionManager.extensions.find(
53
- (o) => o.name === "placeholder"
54
- );
55
- e && (e.options.placeholder = c.value, a.view.updateState(a.state));
21
+ setup(f) {
22
+ const o = f, { t: m, language: h } = y(), { activeConversation: x } = w(), { updateRawValue: _, sendMessage: E, setEditorInstance: d, setContent: l } = k(), u = I(() => o.placeholder ?? m("MessageInput.enter_a_message")), g = () => {
23
+ E(), l("");
24
+ }, a = N({
25
+ autofocus: o.autoFocus,
26
+ editable: !o.disabled,
27
+ extensions: U({
28
+ placeholder: u.value,
29
+ maxLength: o.maxLength,
30
+ showPlaceholderOnlyWhenEditable: o.placeholder === void 0,
31
+ onEnter: g
32
+ }),
33
+ onUpdate: ({ editor: e }) => {
34
+ const t = V(e.getJSON());
35
+ _(t);
56
36
  }
57
- }), r(() => t.disabled, (e) => {
58
- a && (a.setEditable(!e), e && l(""));
59
- }), (e, o) => (h(), m("div", {
60
- class: d([s(i)["input-wrapper"], t.disabled && s(i).disabled])
37
+ });
38
+ return i(a, (e) => {
39
+ d(e ?? null);
40
+ }, { immediate: !0 }), i(() => o.disabled, (e) => {
41
+ var t;
42
+ (t = a.value) == null || t.setEditable(!e), e && l("");
43
+ }), i([u, h], () => {
44
+ if (!a.value)
45
+ return;
46
+ const e = a.value.extensionManager.extensions.find(
47
+ (t) => t.name === "placeholder"
48
+ );
49
+ e && (e.options.placeholder = u.value, a.value.view.updateState(a.value.state));
50
+ }), i(() => o.maxLength, (e) => {
51
+ if (!a.value)
52
+ return;
53
+ const t = a.value.extensionManager.extensions.find(
54
+ (v) => v.name === "characterCount"
55
+ );
56
+ t && (t.options.limit = e);
57
+ }), i(x, (e, t) => {
58
+ (e == null ? void 0 : e.conversationID) !== (t == null ? void 0 : t.conversationID) && l("");
59
+ }), S(() => {
60
+ d(null);
61
+ }), (e, t) => (L(), B("div", {
62
+ class: r([n(s)["input-wrapper"], o.disabled && n(s).disabled])
61
63
  }, [
62
- _("div", {
63
- class: d(s(i)["input-prefix"])
64
+ p("div", {
65
+ class: r(n(s)["input-prefix"])
64
66
  }, [
65
- x(e.$slots, "inputPrefix")
67
+ c(e.$slots, "inputPrefix")
66
68
  ], 2),
67
- (h(), m("div", {
68
- ref_key: "editorDomRef",
69
- ref: n,
70
- key: t.disabled ? "disabled" : "enabled",
71
- class: d(s(i).editor)
72
- }, null, 2)),
73
- _("div", {
74
- class: d(s(i)["input-suffix"])
69
+ M(n(P), {
70
+ editor: n(a),
71
+ class: r([n(s).editor, "message-input"])
72
+ }, null, 8, ["editor", "class"]),
73
+ p("div", {
74
+ class: r(n(s)["input-suffix"])
75
75
  }, [
76
- x(e.$slots, "inputSuffix")
76
+ c(e.$slots, "inputSuffix")
77
77
  ], 2)
78
78
  ], 2));
79
79
  }
80
80
  });
81
81
  export {
82
- A as TextEditor
82
+ K as TextEditor
83
83
  };
@@ -12,5 +12,8 @@ declare const MessageInput: {
12
12
  cancel: string;
13
13
  confirm: string;
14
14
  initiate_call: string;
15
+ loading: string;
16
+ no_matching_members: string;
17
+ at_all_members: string;
15
18
  };
16
19
  export default MessageInput;
@@ -11,7 +11,10 @@ const e = {
11
11
  select_call_members: "Select call members",
12
12
  cancel: "Cancel",
13
13
  confirm: "Confirm",
14
- initiate_call: "Initiate call"
14
+ initiate_call: "Initiate call",
15
+ loading: "Loading...",
16
+ no_matching_members: "No matching members",
17
+ at_all_members: "All members"
15
18
  };
16
19
  export {
17
20
  e as default
@@ -13,6 +13,9 @@ export declare const resources: {
13
13
  cancel: string;
14
14
  confirm: string;
15
15
  initiate_call: string;
16
+ loading: string;
17
+ no_matching_members: string;
18
+ at_all_members: string;
16
19
  };
17
20
  'zh-CN': {
18
21
  file: string;
@@ -28,5 +31,8 @@ export declare const resources: {
28
31
  cancel: string;
29
32
  confirm: string;
30
33
  initiate_call: string;
34
+ loading: string;
35
+ no_matching_members: string;
36
+ at_all_members: string;
31
37
  };
32
38
  };
@@ -12,5 +12,8 @@ declare const MessageInput: {
12
12
  cancel: string;
13
13
  confirm: string;
14
14
  initiate_call: string;
15
+ loading: string;
16
+ no_matching_members: string;
17
+ at_all_members: string;
15
18
  };
16
19
  export default MessageInput;
@@ -11,7 +11,10 @@ const e = {
11
11
  select_call_members: "选择成员",
12
12
  cancel: "取消",
13
13
  confirm: "确认",
14
- initiate_call: "发起通话"
14
+ initiate_call: "发起通话",
15
+ loading: "加载中...",
16
+ no_matching_members: "暂无匹配成员",
17
+ at_all_members: "所有人"
15
18
  };
16
19
  export {
17
20
  e as default
@@ -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-jPzZ5INK.js";
9
+ import { _ as p } from "../../MessageInput.vue_vue_type_script_setup_true_lang-3RVYOdkv.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"] } });