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
@@ -1,52 +1,52 @@
1
- import { defineComponent as w, watch as i, createElementBlock as v, createCommentVNode as q, unref as e, openBlock as M, normalizeClass as o, createElementVNode as r, createVNode as S, toDisplayString as d } from "vue";
2
- import t from "@tencentcloud/chat";
3
- import { useUIKit as f, IconClose as I } from "@tencentcloud/uikit-base-component-vue3";
4
- import { useMessageActionState as E } from "../../../states/MessageActionState/MessageActionState.js";
5
- import { useMessageInputState as C } from "../../../states/MessageInputState/MessageInputState.js";
6
- import { useConversationListState as T } from "../../../states/ConversationListState/ConversationListState.js";
7
- const z = "_quoted__message__preview_1u7zw_1", P = "_quoted__message__preview__content_1u7zw_15", h = "_quoted__message__preview__close_1u7zw_44", n = {
8
- quoted__message__preview: z,
1
+ import { defineComponent as g, onUnmounted as l, watch as w, createElementBlock as v, createCommentVNode as q, unref as e, openBlock as f, normalizeClass as o, createElementVNode as r, createVNode as M, toDisplayString as i } from "vue";
2
+ import { useUIKit as I, IconClose as z } from "@tencentcloud/uikit-base-component-vue3";
3
+ import { MessageType as t } from "../../../types/engine.js";
4
+ import { useMessageActionState as C } from "../../../states/MessageActionState/MessageActionState.js";
5
+ import { useMessageInputState as h } from "../../../states/MessageInputState/MessageInputState.js";
6
+ import { transformTextWithEmojiKeyToName as E } from "../../../utils/emoji.js";
7
+ const x = "_quoted__message__preview_1u7zw_1", y = "_quoted__message__preview__content_1u7zw_15", T = "_quoted__message__preview__close_1u7zw_44", n = {
8
+ quoted__message__preview: x,
9
9
  "slide-in": "_slide-in_1u7zw_1",
10
- quoted__message__preview__content: P,
10
+ quoted__message__preview__content: y,
11
11
  "quoted__message__preview__content--header": "_quoted__message__preview__content--header_1u7zw_23",
12
12
  "quoted__message__preview__content--title": "_quoted__message__preview__content--title_1u7zw_29",
13
13
  "quoted__message__preview__content--text": "_quoted__message__preview__content--text_1u7zw_34",
14
- quoted__message__preview__close: h
15
- }, N = /* @__PURE__ */ w({
14
+ quoted__message__preview__close: T
15
+ }, V = /* @__PURE__ */ g({
16
16
  __name: "QuotedMessagePreview",
17
- setup(G) {
18
- const { t: _ } = f(), { activeConversation: p } = T(), { focusEditor: m } = C(), { quotedMessage: a, clearQuotedMessage: u } = E();
19
- i(a, (s) => {
20
- s && m();
21
- }), i(p, () => {
22
- u();
17
+ setup(k) {
18
+ const { t: _ } = I(), { focusEditor: d } = h(), { quotedMessage: a, clearQuotedMessage: c } = C();
19
+ l(() => {
20
+ c();
21
+ }), w(a, (s) => {
22
+ s && d();
23
23
  });
24
- const l = () => {
25
- u();
26
- }, g = (s) => {
27
- var c;
24
+ const m = () => {
25
+ c();
26
+ }, p = (s) => {
27
+ var u;
28
28
  if (!s)
29
29
  return "no reference";
30
30
  switch (s.type) {
31
- case t.TYPES.MSG_TEXT:
32
- return (c = s.payload) == null ? void 0 : c.text;
33
- case t.TYPES.MSG_IMAGE:
31
+ case t.TEXT:
32
+ return E(((u = s.payload) == null ? void 0 : u.text) || "");
33
+ case t.IMAGE:
34
34
  return _("MessageInput.image");
35
- case t.TYPES.MSG_AUDIO:
35
+ case t.AUDIO:
36
36
  return _("MessageInput.audio");
37
- case t.TYPES.MSG_VIDEO:
37
+ case t.VIDEO:
38
38
  return _("MessageInput.video");
39
- case t.TYPES.MSG_FILE:
39
+ case t.FILE:
40
40
  return _("MessageInput.file");
41
- case t.TYPES.MSG_LOCATION:
41
+ case t.LOCATION:
42
42
  return _("MessageInput.location");
43
- case t.TYPES.MSG_CUSTOM:
43
+ case t.CUSTOM:
44
44
  return _("MessageInput.custom_message");
45
45
  default:
46
46
  return _("MessageInput.unknown");
47
47
  }
48
48
  };
49
- return (s, c) => e(a) ? (M(), v("div", {
49
+ return (s, u) => e(a) ? (f(), v("div", {
50
50
  key: 0,
51
51
  class: o(e(n).quoted__message__preview)
52
52
  }, [
@@ -58,20 +58,20 @@ const z = "_quoted__message__preview_1u7zw_1", P = "_quoted__message__preview__c
58
58
  }, [
59
59
  r("div", {
60
60
  class: o(e(n)["quoted__message__preview__content--title"])
61
- }, d(e(a).nick || e(a).from), 3)
61
+ }, i(e(a).nick || e(a).from), 3)
62
62
  ], 2),
63
63
  r("div", {
64
64
  class: o(e(n)["quoted__message__preview__content--text"])
65
- }, d(g(e(a))), 3)
65
+ }, i(p(e(a))), 3)
66
66
  ], 2),
67
- S(e(I), {
67
+ M(e(z), {
68
68
  class: o(e(n).quoted__message__preview__close),
69
69
  size: "16",
70
- onClick: l
70
+ onClick: m
71
71
  }, null, 8, ["class"])
72
72
  ], 2)) : q("", !0);
73
73
  }
74
74
  });
75
75
  export {
76
- N as QuotedMessagePreview
76
+ V as QuotedMessagePreview
77
77
  };
@@ -1,18 +1,19 @@
1
- import { Editor } from '@tiptap/vue-3';
2
1
  import { InputContent } from '../../../states/MessageInputState';
2
+ import { JSONContent, Extensions } from '@tiptap/vue-3';
3
3
 
4
- interface EditorOptions {
5
- element: Element;
4
+ interface ExtensionOptions {
6
5
  placeholder?: string;
7
- autoFocus?: boolean;
8
- disabled?: boolean;
9
6
  maxLength?: number;
10
- isPlaceholderOnlyShowWhenEditable?: boolean;
11
- onUpdate?: (content: InputContent[]) => void;
7
+ showPlaceholderOnlyWhenEditable?: boolean;
12
8
  onEnter?: () => void;
13
- onFocus?: () => void;
14
- onBlur?: () => void;
15
9
  }
16
- declare function createEditor({ element, placeholder, autoFocus, disabled, isPlaceholderOnlyShowWhenEditable, maxLength, onUpdate, onEnter, onFocus, onBlur, }: EditorOptions): Editor;
17
- export { createEditor, };
18
- export type { Editor, };
10
+ /**
11
+ * Create all editor extensions with given options
12
+ */
13
+ declare function createExtensions(options?: ExtensionOptions): Extensions;
14
+ /**
15
+ * Convert Tiptap JSON content to business InputContent array
16
+ * Uses simple switch-case for clarity (no over-engineered registry pattern)
17
+ */
18
+ declare function convertEditorContent(node: JSONContent): InputContent[];
19
+ export { createExtensions, convertEditorContent, };
@@ -1,60 +1,58 @@
1
- import { I as x } from "../../../index-7vNB_Vx8.js";
2
- import { S as y, P as d, E as M } from "../../../index-ZILx4LYk.js";
3
- import { CharacterCount as b } from "./extensions/characterCountExtension.js";
4
- import { createImageExtension as p } from "./extensions/imageExtension.js";
5
- import { E as I } from "../../../index-Do-2CngU.js";
1
+ import { S as f, P as u } from "../../../index-CTthrJb2.js";
2
+ import { CharacterCount as l } from "./extensions/characterCountExtension.js";
3
+ import { createEnterKeyExtension as p } from "./extensions/enterKeyExtension.js";
4
+ import { createEmojiExtension as E } from "./extensions/emojiExtension.js";
5
+ import { createImageExtension as g } from "./extensions/imageExtension.js";
6
+ import { createMentionExtension as x } from "./extensions/mentionExtension.js";
6
7
  import { MessageContentType as r } from "../../../states/MessageInputState/type.js";
7
- function T() {
8
- return x.extend({
9
- name: r.EMOJI,
10
- inline: !0,
11
- group: "inline",
12
- draggable: !0,
13
- addOptions() {
14
- var t;
15
- return {
16
- ...(t = this.parent) == null ? void 0 : t.call(this),
17
- HTMLAttributes: {
18
- class: "message-emoji"
19
- }
20
- };
21
- }
22
- });
23
- }
24
- function C(t) {
25
- return I.create({
26
- addKeyboardShortcuts() {
27
- return {
28
- Enter: () => {
29
- var e;
30
- return (e = t == null ? void 0 : t.onEnter) == null || e.call(t), !0;
31
- },
32
- "Mod-Enter": ({ editor: e }) => (e.commands.setHardBreak(), !0)
33
- };
34
- }
35
- });
8
+ function h(e = {}) {
9
+ const {
10
+ placeholder: t = "",
11
+ maxLength: n,
12
+ showPlaceholderOnlyWhenEditable: o = !0,
13
+ onEnter: a
14
+ } = e;
15
+ return [
16
+ f.configure({
17
+ bold: !1,
18
+ italic: !1,
19
+ strike: !1,
20
+ code: !1
21
+ }),
22
+ l.configure({
23
+ limit: n
24
+ }),
25
+ p(a),
26
+ E(),
27
+ g(),
28
+ x(),
29
+ u.configure({
30
+ placeholder: t,
31
+ showOnlyWhenEditable: o
32
+ })
33
+ ];
36
34
  }
37
- function c(t) {
38
- return t != null && t.content ? t.content.flatMap((e) => {
39
- var n, a, s, o;
40
- switch (e.type) {
35
+ function y(e) {
36
+ return e != null && e.content ? e.content.flatMap((t) => {
37
+ var n, o, a, s, i, m, c;
38
+ switch (t.type) {
41
39
  case "text":
42
- return e.text ? [{
40
+ return t.text ? [{
43
41
  type: r.TEXT,
44
- content: e.text
42
+ content: t.text
45
43
  }] : [];
46
44
  case "image":
47
45
  return [{
48
46
  type: r.IMAGE,
49
- content: (n = e.attrs) == null ? void 0 : n.fileData
47
+ content: (n = t.attrs) == null ? void 0 : n.fileData
50
48
  }];
51
49
  case "emoji":
52
50
  return [{
53
51
  type: r.EMOJI,
54
52
  content: {
55
- url: (a = e.attrs) == null ? void 0 : a.src,
56
- key: (s = e.attrs) == null ? void 0 : s.alt,
57
- text: (o = e.attrs) == null ? void 0 : o.title
53
+ url: (o = t.attrs) == null ? void 0 : o.src,
54
+ key: (a = t.attrs) == null ? void 0 : a.alt,
55
+ text: (s = t.attrs) == null ? void 0 : s.title
58
56
  }
59
57
  }];
60
58
  case "hardBreak":
@@ -63,54 +61,21 @@ function c(t) {
63
61
  content: `
64
62
  `
65
63
  }];
64
+ case "mention":
65
+ return [{
66
+ type: r.MENTION,
67
+ content: {
68
+ id: (i = t.attrs) == null ? void 0 : i.id,
69
+ label: (m = t.attrs) == null ? void 0 : m.label,
70
+ mentionSuggestionChar: (c = t.attrs) == null ? void 0 : c.mentionSuggestionChar
71
+ }
72
+ }];
66
73
  default:
67
- return c(e);
74
+ return y(t);
68
75
  }
69
76
  }) : [];
70
77
  }
71
- function J({
72
- element: t,
73
- placeholder: e = "",
74
- autoFocus: n = !1,
75
- disabled: a = !1,
76
- isPlaceholderOnlyShowWhenEditable: s = !0,
77
- maxLength: o = void 0,
78
- onUpdate: u,
79
- onEnter: f,
80
- onFocus: m,
81
- onBlur: E
82
- }) {
83
- const l = {
84
- element: t,
85
- autofocus: n,
86
- editable: !a,
87
- extensions: ((i) => [
88
- y.configure({
89
- bold: !1,
90
- italic: !1,
91
- strike: !1,
92
- code: !1
93
- }),
94
- b.configure({
95
- limit: o
96
- }),
97
- C(i ? { onEnter: i } : void 0),
98
- T(),
99
- p(),
100
- d.configure({
101
- placeholder: e,
102
- showOnlyWhenEditable: s
103
- })
104
- ])(f),
105
- onUpdate: ({ editor: i }) => {
106
- const g = c(i.getJSON());
107
- u == null || u(g);
108
- },
109
- onFocus: m,
110
- onBlur: E
111
- };
112
- return new M(l);
113
- }
114
78
  export {
115
- J as createEditor
79
+ y as convertEditorContent,
80
+ h as createExtensions
116
81
  };
@@ -0,0 +1,229 @@
1
+ import { defineComponent as q, onBeforeMount as j, onUnmounted as W, createBlock as C, openBlock as a, unref as u, normalizeProps as Y, guardReactiveProps as H, withCtx as w, renderSlot as J, ref as m, computed as d, watch as S, onMounted as X, onBeforeUnmount as Z, createCommentVNode as k, createVNode as U, createElementVNode as M, createElementBlock as _, Fragment as ee, renderList as te, normalizeClass as ne, toDisplayString as A } from "vue";
2
+ import { i as oe, P as le, a as re, b as ae } from "../../../../PopoverPortal-DV6zFXcf.js";
3
+ import { u as se } from "../../../../Teleport-98QrIYDI.js";
4
+ import { P as ue } from "../../../../PopperContent-D__dbwpA.js";
5
+ import { throttle as ie } from "../../../../utils/lodash.js";
6
+ import { TUIChatEngine as ce } from "@tencentcloud/chat-uikit-engine";
7
+ import { useUIKit as ve } from "@tencentcloud/uikit-base-component-vue3";
8
+ import fe from "../../../Avatar/Avatar.js";
9
+ import { useGroupSettingState as me } from "../../../../states/GroupSettingState/GroupSettingState.js";
10
+ import { _ as de } from "../../../../_plugin-vue_export-helper-CHgC5LLL.js";
11
+ var pe = /* @__PURE__ */ q({
12
+ __name: "PopoverAnchor",
13
+ props: {
14
+ reference: {
15
+ type: null,
16
+ required: !1
17
+ },
18
+ asChild: {
19
+ type: Boolean,
20
+ required: !1
21
+ },
22
+ as: {
23
+ type: null,
24
+ required: !1
25
+ }
26
+ },
27
+ setup(x) {
28
+ const I = x;
29
+ se();
30
+ const r = oe();
31
+ return j(() => {
32
+ r.hasCustomAnchor.value = !0;
33
+ }), W(() => {
34
+ r.hasCustomAnchor.value = !1;
35
+ }), (p, n) => (a(), C(u(ue), Y(H(I)), {
36
+ default: w(() => [J(p.$slots, "default")]),
37
+ _: 3
38
+ }, 16));
39
+ }
40
+ }), ge = pe;
41
+ const _e = ["onClick", "onMouseenter"], he = { class: "mention-suggestion__name" }, ye = {
42
+ key: 0,
43
+ class: "mention-suggestion__loading"
44
+ }, be = {
45
+ key: 1,
46
+ class: "mention-suggestion__empty"
47
+ }, ke = /* @__PURE__ */ q({
48
+ __name: "MentionSuggestion",
49
+ props: {
50
+ editor: {},
51
+ range: {},
52
+ query: {},
53
+ text: {},
54
+ items: {},
55
+ command: { type: Function },
56
+ decorationNode: {},
57
+ clientRect: { type: [Function, null] }
58
+ },
59
+ setup(x, { expose: I }) {
60
+ const r = x, { t: p } = ve(), n = m(0), g = m(!0), i = m(null), c = m(null), f = m(!1), O = m(0), { allMembers: h, currentUserID: E, groupID: T, memberCount: y, getGroupMemberList: V } = me(), R = d(() => {
61
+ if (!h.value || !E.value || !y.value)
62
+ return [];
63
+ const e = h.value.filter((t) => t.userID !== E.value);
64
+ return y.value && y.value > 2 && e.unshift({
65
+ userID: ce.TYPES.MSG_AT_ALL,
66
+ nick: p("MessageInput.at_all_members") || "all",
67
+ avatar: "/at_all_members.png"
68
+ }), e;
69
+ }), v = d(() => {
70
+ var e;
71
+ return (((e = h.value) == null ? void 0 : e.length) || 0) < (y.value || 0);
72
+ }), l = d(() => {
73
+ const e = r.query.toLowerCase().trim();
74
+ return e ? R.value.filter(
75
+ (t) => t.nick.toLowerCase().includes(e)
76
+ ) : R.value;
77
+ }), N = d(() => l.value[n.value] || null), D = d(() => v.value || f.value || l.value.length === 0), P = async () => {
78
+ var e;
79
+ if (!(f.value || !v.value || !T.value)) {
80
+ f.value = !0;
81
+ try {
82
+ await V({
83
+ count: 100,
84
+ offset: ((e = h.value) == null ? void 0 : e.length) || 0
85
+ });
86
+ } catch (t) {
87
+ console.error("[MentionSuggestion] Failed to load more members:", t);
88
+ } finally {
89
+ f.value = !1;
90
+ }
91
+ }
92
+ };
93
+ S(
94
+ [() => r.query, l, v],
95
+ ([e, t, o]) => {
96
+ e.toLowerCase().trim() && t.length === 0 && !o ? g.value = !1 : g.value = !0, t.length < 10 && o && !f.value && P();
97
+ },
98
+ { immediate: !0 }
99
+ );
100
+ const L = d(() => {
101
+ var t;
102
+ const e = (t = r.clientRect) == null ? void 0 : t.call(r);
103
+ return e ? {
104
+ getBoundingClientRect: () => ({
105
+ width: 0,
106
+ height: e.height,
107
+ x: e.left,
108
+ y: e.top,
109
+ top: e.top,
110
+ left: e.left,
111
+ right: e.left,
112
+ bottom: e.top + e.height
113
+ })
114
+ } : null;
115
+ });
116
+ S(l, (e, t) => {
117
+ !t || e.length < t.length || e.length === 0 ? n.value = 0 : e.length > t.length && n.value >= e.length && (n.value = e.length - 1);
118
+ }, { immediate: !0 });
119
+ let s = null;
120
+ const G = () => {
121
+ s && (s.disconnect(), s = null), !(!i.value || !c.value) && (s = new IntersectionObserver(
122
+ (e) => {
123
+ e.forEach((t) => {
124
+ t.isIntersecting && P();
125
+ });
126
+ },
127
+ {
128
+ root: i.value,
129
+ rootMargin: "0px",
130
+ threshold: 0.1
131
+ }
132
+ ), s.observe(c.value));
133
+ };
134
+ S([i, c, D], () => {
135
+ D.value && i.value && c.value && setTimeout(G, 0);
136
+ }, { flush: "post" }), X(() => {
137
+ window.addEventListener("resize", ie(z, 30));
138
+ }), Z(() => {
139
+ s && (s.disconnect(), s = null), window.removeEventListener("resize", z);
140
+ });
141
+ const z = () => {
142
+ O.value += 1;
143
+ }, B = (e) => {
144
+ const t = l.value[e];
145
+ t && r.command({ id: t.userID, label: t.nick, mentionSuggestionChar: "@" });
146
+ }, F = () => {
147
+ if (!i.value)
148
+ return;
149
+ const e = i.value.children[n.value];
150
+ e && (e.scrollIntoView({ block: "nearest" }), n.value === l.value.length - 1 && v.value && c.value && c.value.scrollIntoView({ block: "nearest" }));
151
+ }, K = (e) => {
152
+ const { event: t } = e;
153
+ if (t.key === "ArrowDown") {
154
+ t.preventDefault();
155
+ const o = Math.min(n.value + 1, l.value.length - 1);
156
+ return n.value = o, F(), o === l.value.length - 1 && v.value && !f.value && P(), !0;
157
+ }
158
+ return t.key === "ArrowUp" ? (t.preventDefault(), n.value = Math.max(n.value - 1, 0), F(), !0) : t.key === "Enter" && (t.preventDefault(), N.value) ? (B(n.value), !0) : t.key === "Escape";
159
+ }, Q = (e) => {
160
+ e.preventDefault();
161
+ };
162
+ return I({
163
+ onKeyDown: K
164
+ }), (e, t) => (a(), C(u(le), {
165
+ open: g.value,
166
+ "onUpdate:open": t[0] || (t[0] = (o) => g.value = o),
167
+ modal: !1
168
+ }, {
169
+ default: w(() => [
170
+ L.value ? (a(), C(u(ge), {
171
+ key: 0,
172
+ reference: L.value
173
+ }, null, 8, ["reference"])) : k("", !0),
174
+ U(u(re), null, {
175
+ default: w(() => [
176
+ U(u(ae), {
177
+ class: "mention-suggestion__content",
178
+ side: "top",
179
+ align: "start",
180
+ "side-offset": 8,
181
+ "collision-padding": 8,
182
+ "avoid-collisions": !1,
183
+ onOpenAutoFocus: Q
184
+ }, {
185
+ default: w(() => [
186
+ M("div", {
187
+ ref_key: "listboxRef",
188
+ ref: i,
189
+ class: "mention-suggestion__listbox"
190
+ }, [
191
+ (a(!0), _(ee, null, te(l.value, (o, b) => (a(), _("div", {
192
+ key: o.userID,
193
+ class: ne(["mention-suggestion__item", { "mention-suggestion__item--selected": b === n.value }]),
194
+ onClick: ($) => B(b),
195
+ onMouseenter: ($) => n.value = b
196
+ }, [
197
+ o.avatar !== "/at_all_members.png" ? (a(), C(u(fe), {
198
+ key: 0,
199
+ class: "mention-suggestion__avatar",
200
+ src: o.avatar
201
+ }, null, 8, ["src"])) : k("", !0),
202
+ M("span", he, A(o.nick || o.userID), 1)
203
+ ], 42, _e))), 128)),
204
+ D.value ? (a(), _("div", {
205
+ key: 0,
206
+ ref_key: "sentinelRef",
207
+ ref: c,
208
+ class: "mention-suggestion__sentinel"
209
+ }, [
210
+ v.value ? (a(), _("div", ye, [
211
+ t[1] || (t[1] = M("div", { class: "mention-suggestion__spinner" }, null, -1)),
212
+ M("span", null, A(u(p)("MessageInput.loading")), 1)
213
+ ])) : l.value.length === 0 && !v.value ? (a(), _("div", be, A(u(p)("MessageInput.no_matching_members")), 1)) : k("", !0)
214
+ ], 512)) : k("", !0)
215
+ ], 512)
216
+ ]),
217
+ _: 1
218
+ })
219
+ ]),
220
+ _: 1
221
+ })
222
+ ]),
223
+ _: 1
224
+ }, 8, ["open"]));
225
+ }
226
+ }), Re = /* @__PURE__ */ de(ke, [["__scopeId", "data-v-bb944499"]]);
227
+ export {
228
+ Re as default
229
+ };
@@ -0,0 +1,15 @@
1
+ import { SuggestionProps, SuggestionKeyDownProps } from '@tiptap/suggestion';
2
+
3
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<SuggestionProps<any, any>>>, {
4
+ onKeyDown: (keyDownProps: SuggestionKeyDownProps) => boolean;
5
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<SuggestionProps<any, any>>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
6
+ export default _default;
7
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
8
+ type __VLS_TypePropsToRuntimeProps<T> = {
9
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
10
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
11
+ } : {
12
+ type: import('vue').PropType<T[K]>;
13
+ required: true;
14
+ };
15
+ };
@@ -1,4 +1,4 @@
1
- import { E as l, P as f, a as h } from "../../../../index-Do-2CngU.js";
1
+ import { E as l, P as f, a as h } from "../../../../index-DuAffztD.js";
2
2
  function g(e) {
3
3
  if (typeof Intl < "u" && "Segmenter" in Intl) {
4
4
  const r = new Intl.Segmenter("en", { granularity: "grapheme" });
@@ -0,0 +1 @@
1
+ export declare function createEmojiExtension(): import('@tiptap/core').Node<import('@tiptap/extension-image').ImageOptions, any>;
@@ -0,0 +1,22 @@
1
+ import { I as t } from "../../../../index-hHVD-MG2.js";
2
+ import { MessageContentType as n } from "../../../../states/MessageInputState/type.js";
3
+ function o() {
4
+ return t.extend({
5
+ name: n.EMOJI,
6
+ inline: !0,
7
+ group: "inline",
8
+ draggable: !0,
9
+ addOptions() {
10
+ var e;
11
+ return {
12
+ ...(e = this.parent) == null ? void 0 : e.call(this),
13
+ HTMLAttributes: {
14
+ class: "message-emoji"
15
+ }
16
+ };
17
+ }
18
+ });
19
+ }
20
+ export {
21
+ o as createEmojiExtension
22
+ };
@@ -0,0 +1,3 @@
1
+ import { Extension } from '@tiptap/vue-3';
2
+
3
+ export declare function createEnterKeyExtension(onEnter?: () => void): Extension<any, any>;
@@ -0,0 +1,15 @@
1
+ import { E as t } from "../../../../index-DuAffztD.js";
2
+ function n(e) {
3
+ return t.create({
4
+ name: "enterKey",
5
+ addKeyboardShortcuts() {
6
+ return {
7
+ Enter: () => (e == null || e(), !0),
8
+ "Mod-Enter": ({ editor: r }) => (r.commands.setHardBreak(), !0)
9
+ };
10
+ }
11
+ });
12
+ }
13
+ export {
14
+ n as createEnterKeyExtension
15
+ };
@@ -1,5 +1,5 @@
1
- import { I as g } from "../../../../index-7vNB_Vx8.js";
2
- import { P as m, a as f } from "../../../../index-Do-2CngU.js";
1
+ import { I as g } from "../../../../index-hHVD-MG2.js";
2
+ import { P as m, a as f } from "../../../../index-DuAffztD.js";
3
3
  function I() {
4
4
  return g.extend({
5
5
  addOptions() {
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Extensions Index - Centralized export for all Tiptap extensions
3
+ */
4
+ export { CharacterCount } from './characterCountExtension';
5
+ export { createEmojiExtension } from './emojiExtension';
6
+ export { createEnterKeyExtension } from './enterKeyExtension';
7
+ export { createImageExtension } from './imageExtension';
8
+ export { createMentionExtension } from './mentionExtension';
@@ -0,0 +1,12 @@
1
+ import { CharacterCount as r } from "./characterCountExtension.js";
2
+ import { createEmojiExtension as n } from "./emojiExtension.js";
3
+ import { createEnterKeyExtension as a } from "./enterKeyExtension.js";
4
+ import { createImageExtension as i } from "./imageExtension.js";
5
+ import { createMentionExtension as c } from "./mentionExtension.js";
6
+ export {
7
+ r as CharacterCount,
8
+ n as createEmojiExtension,
9
+ a as createEnterKeyExtension,
10
+ i as createImageExtension,
11
+ c as createMentionExtension
12
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Create Mention extension for @ member functionality
3
+ * @returns Configured Mention extension
4
+ */
5
+ export declare function createMentionExtension(): import('@tiptap/core').Node<import('@tiptap/extension-mention').MentionOptions<any, import('@tiptap/extension-mention').MentionNodeAttrs>, any>;