cd-aichat 1.0.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 (356) hide show
  1. package/README.md +188 -0
  2. package/dist/ailogo.png +0 -0
  3. package/dist/cd-aichat.css +1 -0
  4. package/dist/cd-aichat.es.js +32223 -0
  5. package/dist/cd-aichat.umd.js +279 -0
  6. package/dist/index.css +1 -0
  7. package/package.json +61 -0
  8. package/src/ailogo.png +0 -0
  9. package/src/components/AiChat.test.js +538 -0
  10. package/src/components/AiChat.vue +2206 -0
  11. package/src/components/AiChatWidget.test.js +312 -0
  12. package/src/components/AiChatWidget.vue +963 -0
  13. package/src/components/BurnAfterReadDialog.test.js +121 -0
  14. package/src/components/BurnAfterReadDialog.vue +511 -0
  15. package/src/components/BurnAfterReadMessage.test.js +188 -0
  16. package/src/components/BurnAfterReadMessage.vue +193 -0
  17. package/src/components/BurnIndicator.test.js +101 -0
  18. package/src/components/BurnIndicator.vue +164 -0
  19. package/src/components/ChatWindow.vue +0 -0
  20. package/src/components/MentionList.vue +163 -0
  21. package/src/components/ResourceList.vue +194 -0
  22. package/src/components/RichTextEditor.vue +437 -0
  23. package/src/components/ScheduledSendDialog.vue +476 -0
  24. package/src/components/ScreenshotOverlay.vue +78 -0
  25. package/src/components/SendButtonGroup.test.js +174 -0
  26. package/src/components/SendButtonGroup.vue +166 -0
  27. package/src/components/UserDrawer.vue +0 -0
  28. package/src/components/screenshot/ScreenshotsBackground/getBoundsByPoints.ts +41 -0
  29. package/src/components/screenshot/ScreenshotsBackground/index.scss +27 -0
  30. package/src/components/screenshot/ScreenshotsBackground/index.tsx +145 -0
  31. package/src/components/screenshot/ScreenshotsButton/index.scss +29 -0
  32. package/src/components/screenshot/ScreenshotsButton/index.tsx +58 -0
  33. package/src/components/screenshot/ScreenshotsCanvas/getBoundsByPoints.ts +55 -0
  34. package/src/components/screenshot/ScreenshotsCanvas/getPoints.ts +60 -0
  35. package/src/components/screenshot/ScreenshotsCanvas/index.scss +84 -0
  36. package/src/components/screenshot/ScreenshotsCanvas/index.tsx +277 -0
  37. package/src/components/screenshot/ScreenshotsCanvas/isPointInDraw.ts +35 -0
  38. package/src/components/screenshot/ScreenshotsColor/index.scss +45 -0
  39. package/src/components/screenshot/ScreenshotsColor/index.tsx +39 -0
  40. package/src/components/screenshot/ScreenshotsContext.ts +56 -0
  41. package/src/components/screenshot/ScreenshotsMagnifier/index.scss +61 -0
  42. package/src/components/screenshot/ScreenshotsMagnifier/index.tsx +126 -0
  43. package/src/components/screenshot/ScreenshotsOperations/index.scss +25 -0
  44. package/src/components/screenshot/ScreenshotsOperations/index.tsx +118 -0
  45. package/src/components/screenshot/ScreenshotsOption/index.scss +50 -0
  46. package/src/components/screenshot/ScreenshotsOption/index.tsx +150 -0
  47. package/src/components/screenshot/ScreenshotsSize/index.scss +28 -0
  48. package/src/components/screenshot/ScreenshotsSize/index.tsx +41 -0
  49. package/src/components/screenshot/ScreenshotsSizeColor/index.scss +8 -0
  50. package/src/components/screenshot/ScreenshotsSizeColor/index.tsx +25 -0
  51. package/src/components/screenshot/ScreenshotsTextarea/calculateNodeSize.ts +117 -0
  52. package/src/components/screenshot/ScreenshotsTextarea/index.scss +19 -0
  53. package/src/components/screenshot/ScreenshotsTextarea/index.tsx +96 -0
  54. package/src/components/screenshot/composeImage.ts +57 -0
  55. package/src/components/screenshot/exports.ts +4 -0
  56. package/src/components/screenshot/hooks/useBounds.ts +35 -0
  57. package/src/components/screenshot/hooks/useCall.ts +17 -0
  58. package/src/components/screenshot/hooks/useCanvasContextRef.ts +8 -0
  59. package/src/components/screenshot/hooks/useCanvasMousedown.ts +13 -0
  60. package/src/components/screenshot/hooks/useCanvasMousemove.ts +13 -0
  61. package/src/components/screenshot/hooks/useCanvasMouseup.ts +13 -0
  62. package/src/components/screenshot/hooks/useCursor.ts +34 -0
  63. package/src/components/screenshot/hooks/useDispatcher.ts +8 -0
  64. package/src/components/screenshot/hooks/useDrawSelect.ts +16 -0
  65. package/src/components/screenshot/hooks/useEmiter.ts +61 -0
  66. package/src/components/screenshot/hooks/useHistory.ts +160 -0
  67. package/src/components/screenshot/hooks/useLang.ts +8 -0
  68. package/src/components/screenshot/hooks/useOperation.ts +37 -0
  69. package/src/components/screenshot/hooks/useReset.ts +26 -0
  70. package/src/components/screenshot/hooks/useStore.ts +8 -0
  71. package/src/components/screenshot/icons/iconfont.scss +88 -0
  72. package/src/components/screenshot/icons/iconfont.ttf +0 -0
  73. package/src/components/screenshot/icons/iconfont.woff +0 -0
  74. package/src/components/screenshot/icons/iconfont.woff2 +0 -0
  75. package/src/components/screenshot/index.tsx +169 -0
  76. package/src/components/screenshot/operations/Arrow/draw.ts +56 -0
  77. package/src/components/screenshot/operations/Arrow/index.tsx +193 -0
  78. package/src/components/screenshot/operations/Brush/draw.ts +45 -0
  79. package/src/components/screenshot/operations/Brush/index.tsx +169 -0
  80. package/src/components/screenshot/operations/Cancel/index.tsx +18 -0
  81. package/src/components/screenshot/operations/Ellipse/draw.ts +96 -0
  82. package/src/components/screenshot/operations/Ellipse/index.tsx +245 -0
  83. package/src/components/screenshot/operations/Mosaic/index.tsx +223 -0
  84. package/src/components/screenshot/operations/Ok/index.tsx +37 -0
  85. package/src/components/screenshot/operations/Pin/index.tsx +37 -0
  86. package/src/components/screenshot/operations/Rectangle/draw.ts +80 -0
  87. package/src/components/screenshot/operations/Rectangle/index.tsx +245 -0
  88. package/src/components/screenshot/operations/Redo/index.tsx +22 -0
  89. package/src/components/screenshot/operations/Save/index.tsx +37 -0
  90. package/src/components/screenshot/operations/Scan/index.tsx +46 -0
  91. package/src/components/screenshot/operations/Search/index.tsx +39 -0
  92. package/src/components/screenshot/operations/Text/index.tsx +307 -0
  93. package/src/components/screenshot/operations/Undo/index.tsx +22 -0
  94. package/src/components/screenshot/operations/index.ts +34 -0
  95. package/src/components/screenshot/operations/utils.ts +34 -0
  96. package/src/components/screenshot/screenshots.scss +13 -0
  97. package/src/components/screenshot/types.ts +53 -0
  98. package/src/components/screenshot/useGetLoadedImage.ts +29 -0
  99. package/src/components/screenshot/var.scss +107 -0
  100. package/src/components/screenshot/zh_CN.ts +37 -0
  101. package/src/emoji/100.gif +0 -0
  102. package/src/emoji/101.gif +0 -0
  103. package/src/emoji/102.gif +0 -0
  104. package/src/emoji/103.gif +0 -0
  105. package/src/emoji/104.gif +0 -0
  106. package/src/emoji/105.gif +0 -0
  107. package/src/emoji/106.gif +0 -0
  108. package/src/emoji/107.gif +0 -0
  109. package/src/emoji/108.gif +0 -0
  110. package/src/emoji/109.gif +0 -0
  111. package/src/emoji/110.gif +0 -0
  112. package/src/emoji/111.gif +0 -0
  113. package/src/emoji/112.gif +0 -0
  114. package/src/emoji/113.gif +0 -0
  115. package/src/emoji/114.gif +0 -0
  116. package/src/emoji/115.gif +0 -0
  117. package/src/emoji/116.gif +0 -0
  118. package/src/emoji/117.gif +0 -0
  119. package/src/emoji/118.gif +0 -0
  120. package/src/emoji/119.gif +0 -0
  121. package/src/emoji/120.gif +0 -0
  122. package/src/emoji/121.gif +0 -0
  123. package/src/emoji/122.gif +0 -0
  124. package/src/emoji/123.gif +0 -0
  125. package/src/emoji/124.gif +0 -0
  126. package/src/emoji/125.gif +0 -0
  127. package/src/emoji/126.gif +0 -0
  128. package/src/emoji/127.gif +0 -0
  129. package/src/emoji/128.gif +0 -0
  130. package/src/emoji/129.gif +0 -0
  131. package/src/emoji/130.gif +0 -0
  132. package/src/emoji/131.gif +0 -0
  133. package/src/emoji/132.gif +0 -0
  134. package/src/emoji/133.gif +0 -0
  135. package/src/emoji/134.gif +0 -0
  136. package/src/emoji/135.gif +0 -0
  137. package/src/emoji/136.gif +0 -0
  138. package/src/emoji/137.gif +0 -0
  139. package/src/emoji/138.gif +0 -0
  140. package/src/emoji/139.gif +0 -0
  141. package/src/emoji/140.gif +0 -0
  142. package/src/emoji/141.gif +0 -0
  143. package/src/emoji/142.gif +0 -0
  144. package/src/emoji/143.gif +0 -0
  145. package/src/emoji/144.gif +0 -0
  146. package/src/emoji/145.gif +0 -0
  147. package/src/emoji/146.gif +0 -0
  148. package/src/emoji/147.gif +0 -0
  149. package/src/emoji/148.gif +0 -0
  150. package/src/emoji/149.gif +0 -0
  151. package/src/emoji/150.gif +0 -0
  152. package/src/emoji/151.gif +0 -0
  153. package/src/emoji/152.gif +0 -0
  154. package/src/emoji/153.gif +0 -0
  155. package/src/emoji/154.gif +0 -0
  156. package/src/emoji/155.gif +0 -0
  157. package/src/emoji/156.gif +0 -0
  158. package/src/emoji/157.gif +0 -0
  159. package/src/emoji/158.gif +0 -0
  160. package/src/emoji/159.gif +0 -0
  161. package/src/emoji/160.gif +0 -0
  162. package/src/emoji/161.gif +0 -0
  163. package/src/emoji/162.gif +0 -0
  164. package/src/emoji/163.gif +0 -0
  165. package/src/emoji/164.gif +0 -0
  166. package/src/emoji/165.gif +0 -0
  167. package/src/emoji/166.gif +0 -0
  168. package/src/emoji/167.gif +0 -0
  169. package/src/emoji/168.gif +0 -0
  170. package/src/emoji/169.gif +0 -0
  171. package/src/emoji/170.gif +0 -0
  172. package/src/emoji/171.gif +0 -0
  173. package/src/emoji/172.gif +0 -0
  174. package/src/emoji/173.gif +0 -0
  175. package/src/emoji/174.gif +0 -0
  176. package/src/emoji/175.gif +0 -0
  177. package/src/emoji/176.gif +0 -0
  178. package/src/emoji/177.gif +0 -0
  179. package/src/emoji/178.gif +0 -0
  180. package/src/emoji/179.gif +0 -0
  181. package/src/emoji/180.gif +0 -0
  182. package/src/emoji/181.gif +0 -0
  183. package/src/emoji/182.gif +0 -0
  184. package/src/emoji/183.gif +0 -0
  185. package/src/emoji/184.gif +0 -0
  186. package/src/emoji/185.gif +0 -0
  187. package/src/emoji/186.gif +0 -0
  188. package/src/emoji/187.gif +0 -0
  189. package/src/emoji/188.gif +0 -0
  190. package/src/emoji/189.gif +0 -0
  191. package/src/emoji/190.gif +0 -0
  192. package/src/emoji/191.gif +0 -0
  193. package/src/emoji/192.gif +0 -0
  194. package/src/emoji/193.gif +0 -0
  195. package/src/emoji/194.gif +0 -0
  196. package/src/emoji/195.gif +0 -0
  197. package/src/emoji/196.gif +0 -0
  198. package/src/emoji/197.gif +0 -0
  199. package/src/emoji/198.gif +0 -0
  200. package/src/emoji/199.gif +0 -0
  201. package/src/emoji/200.png +0 -0
  202. package/src/emoji/201.png +0 -0
  203. package/src/emoji/202.png +0 -0
  204. package/src/emoji/203.png +0 -0
  205. package/src/emoji/204.png +0 -0
  206. package/src/emoji/205.png +0 -0
  207. package/src/emoji/206.png +0 -0
  208. package/src/emoji/207.png +0 -0
  209. package/src/emoji/208.png +0 -0
  210. package/src/emoji/209.png +0 -0
  211. package/src/emoji/210.png +0 -0
  212. package/src/emoji/211.png +0 -0
  213. package/src/emoji/212.png +0 -0
  214. package/src/emoji/213.png +0 -0
  215. package/src/emoji/214.png +0 -0
  216. package/src/emoji/215.png +0 -0
  217. package/src/emoji/216.png +0 -0
  218. package/src/emoji/217.png +0 -0
  219. package/src/emoji/218.png +0 -0
  220. package/src/emoji/219.png +0 -0
  221. package/src/emoji2/101--Streamline-The-Team.png +0 -0
  222. package/src/emoji2/128--Streamline-The-Team.png +0 -0
  223. package/src/emoji2/134--Streamline-The-Team.png +0 -0
  224. package/src/emoji2/173--Streamline-The-Team.png +0 -0
  225. package/src/emoji2/Airplane--Streamline-Emoji.svg +24 -0
  226. package/src/emoji2/Alien--Streamline-Emoji.svg +21 -0
  227. package/src/emoji2/Amazed-Face--Streamline-Emoji.svg +16 -0
  228. package/src/emoji2/Amusing-Face--Streamline-Emoji.svg +20 -0
  229. package/src/emoji2/Anguished-Face--Streamline-Emoji.svg +19 -0
  230. package/src/emoji2/Anxious-Face--Streamline-Emoji.svg +17 -0
  231. package/src/emoji2/Astonished-Face--Streamline-Emoji.svg +20 -0
  232. package/src/emoji2/Backhand-Index-Pointing-Down-1--Streamline-Emoji.svg +12 -0
  233. package/src/emoji2/Backhand-Index-Pointing-Left-1--Streamline-Emoji.svg +13 -0
  234. package/src/emoji2/Backhand-Index-Pointing-Right-1--Streamline-Emoji.svg +13 -0
  235. package/src/emoji2/Backhand-Index-Pointing-Up-1--Streamline-Emoji.svg +14 -0
  236. package/src/emoji2/Bar-Chart--Streamline-Emoji.svg +22 -0
  237. package/src/emoji2/Beaming-Face-With-Smiling-Eyes--Streamline-Emoji.svg +20 -0
  238. package/src/emoji2/Boy-1--Streamline-Emoji.svg +17 -0
  239. package/src/emoji2/Boy-2--Streamline-Emoji.svg +17 -0
  240. package/src/emoji2/Boy-3--Streamline-Emoji.svg +17 -0
  241. package/src/emoji2/Broken-Heart--Streamline-Emoji.svg +12 -0
  242. package/src/emoji2/Clapping-Hands-1--Streamline-Emoji.svg +23 -0
  243. package/src/emoji2/Clinking-Glasses-2--Streamline-Emoji.svg +43 -0
  244. package/src/emoji2/Confounded-Face--Streamline-Emoji.svg +17 -0
  245. package/src/emoji2/Confused-Face--Streamline-Emoji.svg +15 -0
  246. package/src/emoji2/Construction-Worker--Streamline-Emoji.svg +21 -0
  247. package/src/emoji2/Couple-With-Heart-Woman-Man-1--Streamline-Emoji.svg +40 -0
  248. package/src/emoji2/Couple-With-Heart-Woman-Man-2--Streamline-Emoji.svg +40 -0
  249. package/src/emoji2/Cowboy-Hat-Face--Streamline-Emoji.svg +22 -0
  250. package/src/emoji2/Crazy-Face--Streamline-Emoji.svg +25 -0
  251. package/src/emoji2/Crossed-Fingers-1--Streamline-Emoji.svg +25 -0
  252. package/src/emoji2/Crown--Streamline-Emoji.svg +35 -0
  253. package/src/emoji2/Crying-Face--Streamline-Emoji.svg +26 -0
  254. package/src/emoji2/Delivery-Truck--Streamline-Emoji.svg +31 -0
  255. package/src/emoji2/Determined-Face--Streamline-Emoji.svg +25 -0
  256. package/src/emoji2/Disappointed-Face--Streamline-Emoji.svg +15 -0
  257. package/src/emoji2/Dizzy-Face--Streamline-Emoji.svg +20 -0
  258. package/src/emoji2/Downcast-Face-With-Sweat--Streamline-Emoji.svg +18 -0
  259. package/src/emoji2/Drooling-Face-1--Streamline-Emoji.svg +19 -0
  260. package/src/emoji2/Drooling-Face-2--Streamline-Emoji.svg +18 -0
  261. package/src/emoji2/Ear--Streamline-Emoji.svg +14 -0
  262. package/src/emoji2/Exclamation-Mark--Streamline-Emoji.svg +12 -0
  263. package/src/emoji2/Exploding-Head--Streamline-Emoji.svg +24 -0
  264. package/src/emoji2/Expressionless-Face--Streamline-Emoji.svg +15 -0
  265. package/src/emoji2/Face-Blowing-A-Kiss--Streamline-Emoji.svg +18 -0
  266. package/src/emoji2/Face-Savoring-Food--Streamline-Emoji.svg +18 -0
  267. package/src/emoji2/Face-Screaming-In-Fear--Streamline-Emoji.svg +18 -0
  268. package/src/emoji2/Face-Vomiting--Streamline-Emoji.svg +28 -0
  269. package/src/emoji2/Face-With-Head-Bandage--Streamline-Emoji.svg +25 -0
  270. package/src/emoji2/Face-With-Medical-Mask--Streamline-Emoji.svg +23 -0
  271. package/src/emoji2/Face-With-Monocle--Streamline-Emoji.svg +26 -0
  272. package/src/emoji2/Face-With-Raised-Eyebrow--Streamline-Emoji.svg +17 -0
  273. package/src/emoji2/Face-With-Rolling-Eyes--Streamline-Emoji.svg +17 -0
  274. package/src/emoji2/Face-With-Steam-From-Nose--Streamline-Emoji.svg +19 -0
  275. package/src/emoji2/Face-With-Symbols-On-Mouth--Streamline-Emoji.svg +22 -0
  276. package/src/emoji2/Face-With-Tears-Of-Joy--Streamline-Emoji.svg +34 -0
  277. package/src/emoji2/Face-With-Thermometer--Streamline-Emoji.svg +31 -0
  278. package/src/emoji2/Face-With-Tongue--Streamline-Emoji.svg +18 -0
  279. package/src/emoji2/Face-Without-Mouth--Streamline-Emoji.svg +14 -0
  280. package/src/emoji2/Fearful-Face--Streamline-Emoji.svg +18 -0
  281. package/src/emoji2/Flexed-Biceps-1--Streamline-Emoji.svg +13 -0
  282. package/src/emoji2/Flushed-Face--Streamline-Emoji.svg +19 -0
  283. package/src/emoji2/Folded-Hands-1--Streamline-Emoji.svg +29 -0
  284. package/src/emoji2/Frowning-Face--Streamline-Emoji.svg +15 -0
  285. package/src/emoji2/Fuel-Pump--Streamline-Emoji.svg +30 -0
  286. package/src/emoji2/Girl-1--Streamline-Emoji.svg +23 -0
  287. package/src/emoji2/Glasses-1--Streamline-Emoji.svg +27 -0
  288. package/src/emoji2/Grimacing-Face--Streamline-Emoji.svg +19 -0
  289. package/src/emoji2/Grinning-Cat-Face--Streamline-Emoji.svg +32 -0
  290. package/src/emoji2/Grinning-Face--Streamline-Emoji.svg +16 -0
  291. package/src/emoji2/Grinning-Face-With-Sweat--Streamline-Emoji.svg +19 -0
  292. package/src/emoji2/Grinning-Squinting-Face--Streamline-Emoji.svg +16 -0
  293. package/src/emoji2/Hand-With-Fingers-Splayed-1--Streamline-Emoji.svg +14 -0
  294. package/src/emoji2/Heart-Suit--Streamline-Emoji.svg +9 -0
  295. package/src/emoji2/Hushed-Face-1--Streamline-Emoji.svg +17 -0
  296. package/src/emoji2/Hushed-Face-2--Streamline-Emoji.svg +15 -0
  297. package/src/emoji2/Index-Pointing-Up-1--Streamline-Emoji.svg +17 -0
  298. package/src/emoji2/Kissing-Face-With-Closed-Eyes--Streamline-Emoji.svg +18 -0
  299. package/src/emoji2/Loudly-Crying-Face--Streamline-Emoji.svg +16 -0
  300. package/src/emoji2/Lying-Face--Streamline-Emoji.svg +15 -0
  301. package/src/emoji2/Man-1--Streamline-Emoji.svg +17 -0
  302. package/src/emoji2/Man-Facepalming-1--Streamline-Emoji.svg +21 -0
  303. package/src/emoji2/Man-Gesturing-No-1--Streamline-Emoji.svg +34 -0
  304. package/src/emoji2/Man-Gesturing-Ok-1--Streamline-Emoji.svg +25 -0
  305. package/src/emoji2/Man-Health-Worker-1--Streamline-Emoji.svg +41 -0
  306. package/src/emoji2/Man-Raising-Hand-1--Streamline-Emoji.svg +26 -0
  307. package/src/emoji2/Man-Shrugging-1--Streamline-Emoji.svg +31 -0
  308. package/src/emoji2/Money-Mouth-Face-2--Streamline-Emoji.svg +30 -0
  309. package/src/emoji2/Mouth--Streamline-Emoji.svg +12 -0
  310. package/src/emoji2/Nauseated-Face-2--Streamline-Emoji.svg +19 -0
  311. package/src/emoji2/Neutral-Face--Streamline-Emoji.svg +15 -0
  312. package/src/emoji2/Ok-Hand-1--Streamline-Emoji.svg +14 -0
  313. package/src/emoji2/Old-Man-1--Streamline-Emoji.svg +27 -0
  314. package/src/emoji2/Old-Woman-1--Streamline-Emoji.svg +23 -0
  315. package/src/emoji2/Oncoming-Fist-1--Streamline-Emoji.svg +15 -0
  316. package/src/emoji2/Person-Wearing-Turban-2--Streamline-Emoji.svg +20 -0
  317. package/src/emoji2/Pile-Of-Poo--Streamline-Emoji.svg +15 -0
  318. package/src/emoji2/Police-Car-Light--Streamline-Emoji.svg +26 -0
  319. package/src/emoji2/Rocket--Streamline-Emoji.svg +32 -0
  320. package/src/emoji2/Sailboat--Streamline-Emoji.svg +18 -0
  321. package/src/emoji2/Shaved-Ice--Streamline-Emoji.svg +21 -0
  322. package/src/emoji2/Shortcake-2--Streamline-Emoji.svg +18 -0
  323. package/src/emoji2/Shushing-Face--Streamline-Emoji.svg +21 -0
  324. package/src/emoji2/Sign-Of-The-Horns-1--Streamline-Emoji.svg +19 -0
  325. package/src/emoji2/Sleeping-Face--Streamline-Emoji.svg +21 -0
  326. package/src/emoji2/Slightly-Smiling-Face--Streamline-Emoji.svg +15 -0
  327. package/src/emoji2/Smiling-Face-With-Halo--Streamline-Emoji.svg +20 -0
  328. package/src/emoji2/Smiling-Face-With-Heart-Eyes--Streamline-Emoji.svg +21 -0
  329. package/src/emoji2/Smirking-Face--Streamline-Emoji.svg +17 -0
  330. package/src/emoji2/Sun-With-Face--Streamline-Emoji.svg +24 -0
  331. package/src/emoji2/Thumbs-Down-1--Streamline-Emoji.svg +20 -0
  332. package/src/emoji2/Thumbs-Up-1--Streamline-Emoji.svg +19 -0
  333. package/src/emoji2/Winking-Face--Streamline-Emoji.svg +18 -0
  334. package/src/emoji2/Woman-Gesturing-No-1--Streamline-Emoji.svg +34 -0
  335. package/src/emoji2/Woman-Gesturing-Ok-2--Streamline-Emoji.svg +25 -0
  336. package/src/emoji2/Woman-Raising-Hand-1--Streamline-Emoji.svg +26 -0
  337. package/src/emoji2/Womans-Sandal--Streamline-Emoji.svg +13 -0
  338. package/src/emoji2/Worried-Face--Streamline-Emoji.svg +17 -0
  339. package/src/emoji2/Writing-Hand-1--Streamline-Emoji.svg +17 -0
  340. package/src/emoji2/Zipper-Mouth-Face--Streamline-Emoji.svg +21 -0
  341. package/src/index.js +19 -0
  342. package/src/services/burn-after-read-service.js +313 -0
  343. package/src/services/burn-after-read-service.test.js +325 -0
  344. package/src/services/dify-api.js +338 -0
  345. package/src/services/dify-api.test.js +376 -0
  346. package/src/services/scheduled-send-service.js +311 -0
  347. package/src/services/scheduled-send-service.test.js +317 -0
  348. package/src/styles/index.css +2368 -0
  349. package/src/utils/emoji.js +125 -0
  350. package/src/utils/emojiData.js +267 -0
  351. package/src/utils/eventEmitter.js +114 -0
  352. package/src/utils/state.js +224 -0
  353. package/src/utils/state.test.js +198 -0
  354. package/src/utils/storage.js +122 -0
  355. package/src/utils/storage.test.js +162 -0
  356. package/src/utils/validation.js +249 -0
@@ -0,0 +1,125 @@
1
+ // 表情工具函数
2
+ export const emojiMap = {
3
+ '[微笑]': '😊',
4
+ '[撇嘴]': '😒',
5
+ '[色]': '😍',
6
+ '[发呆]': '😳',
7
+ '[得意]': '😎',
8
+ '[流泪]': '😢',
9
+ '[害羞]': '😳',
10
+ '[闭嘴]': '🤐',
11
+ '[睡]': '😴',
12
+ '[大哭]': '😭',
13
+ '[尴尬]': '😅',
14
+ '[发怒]': '😠',
15
+ '[调皮]': '😜',
16
+ '[呲牙]': '😁',
17
+ '[惊讶]': '😲',
18
+ '[难过]': '😞',
19
+ '[酷]': '😎',
20
+ '[冷汗]': '😰',
21
+ '[抓狂]': '😫',
22
+ '[吐]': '🤮',
23
+ '[偷笑]': '🤭',
24
+ '[可爱]': '🥰',
25
+ '[白眼]': '🙄',
26
+ '[傲慢]': '😤',
27
+ '[饥饿]': '🤤',
28
+ '[困]': '😪',
29
+ '[惊恐]': '😱',
30
+ '[流汗]': '😓',
31
+ '[憨笑]': '😄',
32
+ '[大兵]': '🎖️',
33
+ '[奋斗]': '💪',
34
+ '[咒骂]': '🤬',
35
+ '[疑问]': '🤔',
36
+ '[嘘]': '🤫',
37
+ '[晕]': '😵',
38
+ '[折磨]': '😖',
39
+ '[衰]': '😩',
40
+ '[骷髅]': '💀',
41
+ '[敲打]': '🔨',
42
+ '[再见]': '👋',
43
+ '[擦汗]': '😅',
44
+ '[抠鼻]': '🤏',
45
+ '[鼓掌]': '👏',
46
+ '[糗大了]': '😳',
47
+ '[坏笑]': '😏',
48
+ '[左哼哼]': '😤',
49
+ '[右哼哼]': '😤',
50
+ '[哈欠]': '🥱',
51
+ '[鄙视]': '😒',
52
+ '[委屈]': '🥺',
53
+ '[快哭了]': '😢',
54
+ '[阴险]': '😈',
55
+ '[亲亲]': '😘',
56
+ '[吓]': '😨',
57
+ '[可怜]': '🥺',
58
+ '[菜刀]': '🔪',
59
+ '[西瓜]': '🍉',
60
+ '[啤酒]': '🍺',
61
+ '[篮球]': '🏀',
62
+ '[乒乓]': '🏓',
63
+ '[咖啡]': '☕',
64
+ '[饭]': '🍚',
65
+ '[猪头]': '🐷',
66
+ '[玫瑰]': '🌹',
67
+ '[凋谢]': '🥀',
68
+ '[示爱]': '💘',
69
+ '[爱心]': '❤️',
70
+ '[心碎]': '💔',
71
+ '[蛋糕]': '🎂',
72
+ '[闪电]': '⚡',
73
+ '[炸弹]': '💣',
74
+ '[刀]': '🔪',
75
+ '[足球]': '⚽',
76
+ '[瓢虫]': '🐞',
77
+ '[便便]': '💩',
78
+ '[月亮]': '🌙',
79
+ '[太阳]': '☀️',
80
+ '[礼物]': '🎁',
81
+ '[拥抱]': '🤗',
82
+ '[强]': '👍',
83
+ '[弱]': '👎',
84
+ '[握手]': '🤝',
85
+ '[胜利]': '✌️',
86
+ '[抱拳]': '🙏',
87
+ '[勾引]': '👉',
88
+ '[拳头]': '👊',
89
+ '[差劲]': '👎',
90
+ '[爱你]': '🤟',
91
+ '[NO]': '🙅',
92
+ '[OK]': '👌',
93
+ '[爱情]': '💑',
94
+ '[飞吻]': '😘',
95
+ '[跳跳]': '🦘',
96
+ '[发抖]': '🥶',
97
+ '[怄火]': '😤',
98
+ '[转圈]': '🔄',
99
+ '[磕头]': '🙇',
100
+ '[回头]': '↩️',
101
+ '[跳绳]': '🤸',
102
+ '[挥手]': '👋',
103
+ '[激动]': '🤩',
104
+ '[街舞]': '💃',
105
+ '[献吻]': '😘',
106
+ '[左太极]': '☯️',
107
+ '[右太极]': '☯️'
108
+ };
109
+
110
+ // 替换文本中的表情符号
111
+ export function replaceEmoji(text) {
112
+ if (!text) return '';
113
+ let result = text;
114
+ Object.keys(emojiMap).forEach(key => {
115
+ const regex = new RegExp(key.replace(/[[\]]/g, '\\$&'), 'g');
116
+ result = result.replace(regex, emojiMap[key]);
117
+ });
118
+ return result;
119
+ }
120
+
121
+ // 将 emoji 转换为文本
122
+ export function emojiToText(emoji) {
123
+ const entry = Object.entries(emojiMap).find(([, value]) => value === emoji);
124
+ return entry ? entry[0] : emoji;
125
+ }
@@ -0,0 +1,267 @@
1
+ // 表情数据配置 - 两个 tab 分类
2
+ export const emojiCategories = [
3
+ {
4
+ name: '经典',
5
+ icon: '😊',
6
+ key: 'classic',
7
+ folder: 'emoji',
8
+ emojis: []
9
+ },
10
+ {
11
+ name: '现代',
12
+ icon: '🎨',
13
+ key: 'modern',
14
+ folder: 'emoji2',
15
+ emojis: []
16
+ }
17
+ ];
18
+ // 动态加载经典表情 (100-199) - 使用中文名称
19
+ const classicEmojiNames = {
20
+ 100: '[微笑]',
21
+ 101: '[撇嘴]',
22
+ 102: '[色]',
23
+ 103: '[发呆]',
24
+ 104: '[得意]',
25
+ 105: '[流泪]',
26
+ 106: '[害羞]',
27
+ 107: '[闭嘴]',
28
+ 108: '[睡]',
29
+ 109: '[大哭]',
30
+ 110: '[尴尬]',
31
+ 111: '[发怒]',
32
+ 112: '[调皮]',
33
+ 113: '[呲牙]',
34
+ 114: '[惊讶]',
35
+ 115: '[难过]',
36
+ 116: '[酷]',
37
+ 117: '[冷汗]',
38
+ 118: '[抓狂]',
39
+ 119: '[吐]',
40
+ 120: '[偷笑]',
41
+ 121: '[可爱]',
42
+ 122: '[白眼]',
43
+ 123: '[傲慢]',
44
+ 124: '[饥饿]',
45
+ 125: '[困]',
46
+ 126: '[惊恐]',
47
+ 127: '[流汗]',
48
+ 128: '[憨笑]',
49
+ 129: '[大兵]',
50
+ 130: '[奋斗]',
51
+ 131: '[咒骂]',
52
+ 132: '[疑问]',
53
+ 133: '[嘘]',
54
+ 134: '[晕]',
55
+ 135: '[折磨]',
56
+ 136: '[衰]',
57
+ 137: '[骷髅]',
58
+ 138: '[敲打]',
59
+ 139: '[再见]',
60
+ 140: '[擦汗]',
61
+ 141: '[抠鼻]',
62
+ 142: '[鼓掌]',
63
+ 143: '[糗大了]',
64
+ 144: '[坏笑]',
65
+ 145: '[左哼哼]',
66
+ 146: '[右哼哼]',
67
+ 147: '[哈欠]',
68
+ 148: '[鄙视]',
69
+ 149: '[委屈]',
70
+ 150: '[快哭了]',
71
+ 151: '[阴险]',
72
+ 152: '[亲亲]',
73
+ 153: '[吓]',
74
+ 154: '[可怜]',
75
+ 155: '[菜刀]',
76
+ 156: '[西瓜]',
77
+ 157: '[啤酒]',
78
+ 158: '[篮球]',
79
+ 159: '[乒乓]',
80
+ 160: '[咖啡]',
81
+ 161: '[饭]',
82
+ 162: '[猪头]',
83
+ 163: '[玫瑰]',
84
+ 164: '[凋谢]',
85
+ 165: '[示爱]',
86
+ 166: '[爱心]',
87
+ 167: '[心碎]',
88
+ 168: '[蛋糕]',
89
+ 169: '[闪电]',
90
+ 170: '[炸弹]',
91
+ 171: '[刀]',
92
+ 172: '[足球]',
93
+ 173: '[瓢虫]',
94
+ 174: '[便便]',
95
+ 175: '[月亮]',
96
+ 176: '[太阳]',
97
+ 177: '[礼物]',
98
+ 178: '[拥抱]',
99
+ 179: '[强]',
100
+ 180: '[弱]',
101
+ 181: '[握手]',
102
+ 182: '[胜利]',
103
+ 183: '[抱拳]',
104
+ 184: '[勾引]',
105
+ 185: '[拳头]',
106
+ 186: '[差劲]',
107
+ 187: '[爱你]',
108
+ 188: '[NO]',
109
+ 189: '[OK]',
110
+ 190: '[爱情]',
111
+ 191: '[飞吻]',
112
+ 192: '[跳跳]',
113
+ 193: '[发抖]',
114
+ 194: '[怄火]',
115
+ 195: '[转圈]',
116
+ 196: '[磕头]',
117
+ 197: '[回头]',
118
+ 198: '[跳绳]',
119
+ 199: '[挥手]'
120
+ };
121
+ for (let i = 100; i <= 199; i++) {
122
+ emojiCategories[0].emojis.push({
123
+ id: i,
124
+ name: classicEmojiNames[i] || `[表情${i}]`,
125
+ url: `${i}.gif`
126
+ });
127
+ }
128
+ // 现代表情列表 - 完整的 120 个图标
129
+ const modernEmojis = [
130
+ { id: 'grinning', name: '[开心]', url: 'Grinning-Face--Streamline-Emoji.svg' },
131
+ { id: 'beaming', name: '[眯眼笑]', url: 'Beaming-Face-With-Smiling-Eyes--Streamline-Emoji.svg' },
132
+ { id: 'tears-joy', name: '[笑哭]', url: 'Face-With-Tears-Of-Joy--Streamline-Emoji.svg' },
133
+ { id: 'grinning-sweat', name: '[尬笑]', url: 'Grinning-Face-With-Sweat--Streamline-Emoji.svg' },
134
+ { id: 'squinting', name: '[眯眼]', url: 'Grinning-Squinting-Face--Streamline-Emoji.svg' },
135
+ { id: 'winking', name: '[眨眼]', url: 'Winking-Face--Streamline-Emoji.svg' },
136
+ { id: 'smiling-halo', name: '[天使]', url: 'Smiling-Face-With-Halo--Streamline-Emoji.svg' },
137
+ { id: 'heart-eyes', name: '[花痴]', url: 'Smiling-Face-With-Heart-Eyes--Streamline-Emoji.svg' },
138
+ { id: 'blowing-kiss', name: '[飞吻]', url: 'Face-Blowing-A-Kiss--Streamline-Emoji.svg' },
139
+ { id: 'kissing-closed', name: '[亲亲]', url: 'Kissing-Face-With-Closed-Eyes--Streamline-Emoji.svg' },
140
+ { id: 'savoring', name: '[美味]', url: 'Face-Savoring-Food--Streamline-Emoji.svg' },
141
+ { id: 'tongue', name: '[吐舌]', url: 'Face-With-Tongue--Streamline-Emoji.svg' },
142
+ { id: 'money-mouth', name: '[财迷]', url: 'Money-Mouth-Face-2--Streamline-Emoji.svg' },
143
+ { id: 'smirking', name: '[得意]', url: 'Smirking-Face--Streamline-Emoji.svg' },
144
+ { id: 'slightly-smiling', name: '[微笑]', url: 'Slightly-Smiling-Face--Streamline-Emoji.svg' },
145
+ { id: 'neutral', name: '[无语]', url: 'Neutral-Face--Streamline-Emoji.svg' },
146
+ { id: 'expressionless', name: '[面无表情]', url: 'Expressionless-Face--Streamline-Emoji.svg' },
147
+ { id: 'without-mouth', name: '[闭嘴]', url: 'Face-Without-Mouth--Streamline-Emoji.svg' },
148
+ { id: 'shushing', name: '[嘘]', url: 'Shushing-Face--Streamline-Emoji.svg' },
149
+ { id: 'zipper-mouth', name: '[拉链嘴]', url: 'Zipper-Mouth-Face--Streamline-Emoji.svg' },
150
+ { id: 'raised-eyebrow', name: '[挑眉]', url: 'Face-With-Raised-Eyebrow--Streamline-Emoji.svg' },
151
+ { id: 'rolling-eyes', name: '[翻白眼]', url: 'Face-With-Rolling-Eyes--Streamline-Emoji.svg' },
152
+ { id: 'grimacing', name: '[龇牙]', url: 'Grimacing-Face--Streamline-Emoji.svg' },
153
+ { id: 'lying', name: '[说谎]', url: 'Lying-Face--Streamline-Emoji.svg' },
154
+ { id: 'sleeping', name: '[睡觉]', url: 'Sleeping-Face--Streamline-Emoji.svg' },
155
+ { id: 'drooling-1', name: '[流口水]', url: 'Drooling-Face-1--Streamline-Emoji.svg' },
156
+ { id: 'drooling-2', name: '[流口水2]', url: 'Drooling-Face-2--Streamline-Emoji.svg' },
157
+ { id: 'mask', name: '[口罩]', url: 'Face-With-Medical-Mask--Streamline-Emoji.svg' },
158
+ { id: 'thermometer', name: '[发烧]', url: 'Face-With-Thermometer--Streamline-Emoji.svg' },
159
+ { id: 'bandage', name: '[受伤]', url: 'Face-With-Head-Bandage--Streamline-Emoji.svg' },
160
+ { id: 'nauseated', name: '[恶心]', url: 'Nauseated-Face-2--Streamline-Emoji.svg' },
161
+ { id: 'vomiting', name: '[呕吐]', url: 'Face-Vomiting--Streamline-Emoji.svg' },
162
+ { id: 'confused', name: '[困惑]', url: 'Confused-Face--Streamline-Emoji.svg' },
163
+ { id: 'worried', name: '[担心]', url: 'Worried-Face--Streamline-Emoji.svg' },
164
+ { id: 'frowning', name: '[皱眉]', url: 'Frowning-Face--Streamline-Emoji.svg' },
165
+ { id: 'anguished', name: '[痛苦]', url: 'Anguished-Face--Streamline-Emoji.svg' },
166
+ { id: 'crying', name: '[哭泣]', url: 'Crying-Face--Streamline-Emoji.svg' },
167
+ { id: 'loudly-crying', name: '[大哭]', url: 'Loudly-Crying-Face--Streamline-Emoji.svg' },
168
+ { id: 'disappointed', name: '[失望]', url: 'Disappointed-Face--Streamline-Emoji.svg' },
169
+ { id: 'downcast', name: '[沮丧]', url: 'Downcast-Face-With-Sweat--Streamline-Emoji.svg' },
170
+ { id: 'fearful', name: '[害怕]', url: 'Fearful-Face--Streamline-Emoji.svg' },
171
+ { id: 'anxious', name: '[焦虑]', url: 'Anxious-Face--Streamline-Emoji.svg' },
172
+ { id: 'screaming', name: '[尖叫]', url: 'Face-Screaming-In-Fear--Streamline-Emoji.svg' },
173
+ { id: 'flushed', name: '[脸红]', url: 'Flushed-Face--Streamline-Emoji.svg' },
174
+ { id: 'dizzy', name: '[晕]', url: 'Dizzy-Face--Streamline-Emoji.svg' },
175
+ { id: 'steam-nose', name: '[生气]', url: 'Face-With-Steam-From-Nose--Streamline-Emoji.svg' },
176
+ { id: 'symbols-mouth', name: '[骂人]', url: 'Face-With-Symbols-On-Mouth--Streamline-Emoji.svg' },
177
+ { id: 'exploding', name: '[爆炸头]', url: 'Exploding-Head--Streamline-Emoji.svg' },
178
+ { id: 'cowboy', name: '[牛仔]', url: 'Cowboy-Hat-Face--Streamline-Emoji.svg' },
179
+ { id: 'monocle', name: '[单片眼镜]', url: 'Face-With-Monocle--Streamline-Emoji.svg' },
180
+ { id: 'amazed', name: '[惊讶]', url: 'Amazed-Face--Streamline-Emoji.svg' },
181
+ { id: 'amusing', name: '[有趣]', url: 'Amusing-Face--Streamline-Emoji.svg' },
182
+ { id: 'astonished', name: '[震惊]', url: 'Astonished-Face--Streamline-Emoji.svg' },
183
+ { id: 'confounded', name: '[困惑]', url: 'Confounded-Face--Streamline-Emoji.svg' },
184
+ { id: 'crazy', name: '[疯狂]', url: 'Crazy-Face--Streamline-Emoji.svg' },
185
+ { id: 'determined', name: '[坚定]', url: 'Determined-Face--Streamline-Emoji.svg' },
186
+ { id: 'hushed-1', name: '[安静]', url: 'Hushed-Face-1--Streamline-Emoji.svg' },
187
+ { id: 'hushed-2', name: '[安静2]', url: 'Hushed-Face-2--Streamline-Emoji.svg' },
188
+ { id: 'grinning-cat', name: '[笑猫]', url: 'Grinning-Cat-Face--Streamline-Emoji.svg' },
189
+ { id: 'thumbs-up', name: '[赞]', url: 'Thumbs-Up-1--Streamline-Emoji.svg' },
190
+ { id: 'thumbs-down', name: '[踩]', url: 'Thumbs-Down-1--Streamline-Emoji.svg' },
191
+ { id: 'ok-hand', name: '[OK]', url: 'Ok-Hand-1--Streamline-Emoji.svg' },
192
+ { id: 'clapping', name: '[鼓掌]', url: 'Clapping-Hands-1--Streamline-Emoji.svg' },
193
+ { id: 'folded-hands', name: '[祈祷]', url: 'Folded-Hands-1--Streamline-Emoji.svg' },
194
+ { id: 'flexed-biceps', name: '[肌肉]', url: 'Flexed-Biceps-1--Streamline-Emoji.svg' },
195
+ { id: 'crossed-fingers', name: '[交叉手指]', url: 'Crossed-Fingers-1--Streamline-Emoji.svg' },
196
+ { id: 'fist', name: '[拳头]', url: 'Oncoming-Fist-1--Streamline-Emoji.svg' },
197
+ { id: 'horns', name: '[摇滚]', url: 'Sign-Of-The-Horns-1--Streamline-Emoji.svg' },
198
+ { id: 'writing', name: '[写字]', url: 'Writing-Hand-1--Streamline-Emoji.svg' },
199
+ { id: 'pointing-up', name: '[指上]', url: 'Index-Pointing-Up-1--Streamline-Emoji.svg' },
200
+ { id: 'pointing-down', name: '[指下]', url: 'Backhand-Index-Pointing-Down-1--Streamline-Emoji.svg' },
201
+ { id: 'pointing-left', name: '[指左]', url: 'Backhand-Index-Pointing-Left-1--Streamline-Emoji.svg' },
202
+ { id: 'pointing-right', name: '[指右]', url: 'Backhand-Index-Pointing-Right-1--Streamline-Emoji.svg' },
203
+ { id: 'pointing-up-back', name: '[指上2]', url: 'Backhand-Index-Pointing-Up-1--Streamline-Emoji.svg' },
204
+ { id: 'fingers-splayed', name: '[张开手]', url: 'Hand-With-Fingers-Splayed-1--Streamline-Emoji.svg' },
205
+ { id: 'heart', name: '[爱心]', url: 'Heart-Suit--Streamline-Emoji.svg' },
206
+ { id: 'broken-heart', name: '[心碎]', url: 'Broken-Heart--Streamline-Emoji.svg' },
207
+ { id: 'rocket', name: '[火箭]', url: 'Rocket--Streamline-Emoji.svg' },
208
+ { id: 'airplane', name: '[飞机]', url: 'Airplane--Streamline-Emoji.svg' },
209
+ { id: 'crown', name: '[皇冠]', url: 'Crown--Streamline-Emoji.svg' },
210
+ { id: 'poo', name: '[便便]', url: 'Pile-Of-Poo--Streamline-Emoji.svg' },
211
+ { id: 'alien', name: '[外星人]', url: 'Alien--Streamline-Emoji.svg' },
212
+ { id: 'glasses', name: '[眼镜]', url: 'Glasses-1--Streamline-Emoji.svg' },
213
+ { id: 'ear', name: '[耳朵]', url: 'Ear--Streamline-Emoji.svg' },
214
+ { id: 'mouth', name: '[嘴巴]', url: 'Mouth--Streamline-Emoji.svg' },
215
+ { id: 'exclamation', name: '[感叹号]', url: 'Exclamation-Mark--Streamline-Emoji.svg' },
216
+ { id: 'bar-chart', name: '[柱状图]', url: 'Bar-Chart--Streamline-Emoji.svg' },
217
+ { id: 'delivery-truck', name: '[货车]', url: 'Delivery-Truck--Streamline-Emoji.svg' },
218
+ { id: 'fuel-pump', name: '[加油]', url: 'Fuel-Pump--Streamline-Emoji.svg' },
219
+ { id: 'sailboat', name: '[帆船]', url: 'Sailboat--Streamline-Emoji.svg' },
220
+ { id: 'police-light', name: '[警灯]', url: 'Police-Car-Light--Streamline-Emoji.svg' },
221
+ { id: 'sun-face', name: '[太阳]', url: 'Sun-With-Face--Streamline-Emoji.svg' },
222
+ { id: 'clinking-glasses', name: '[干杯]', url: 'Clinking-Glasses-2--Streamline-Emoji.svg' },
223
+ { id: 'shaved-ice', name: '[刨冰]', url: 'Shaved-Ice--Streamline-Emoji.svg' },
224
+ { id: 'shortcake', name: '[蛋糕]', url: 'Shortcake-2--Streamline-Emoji.svg' },
225
+ { id: 'sandal', name: '[凉鞋]', url: 'Womans-Sandal--Streamline-Emoji.svg' },
226
+ { id: 'boy-1', name: '[男孩1]', url: 'Boy-1--Streamline-Emoji.svg' },
227
+ { id: 'boy-2', name: '[男孩2]', url: 'Boy-2--Streamline-Emoji.svg' },
228
+ { id: 'boy-3', name: '[男孩3]', url: 'Boy-3--Streamline-Emoji.svg' },
229
+ { id: 'girl-1', name: '[女孩]', url: 'Girl-1--Streamline-Emoji.svg' },
230
+ { id: 'man-1', name: '[男人]', url: 'Man-1--Streamline-Emoji.svg' },
231
+ { id: 'old-man', name: '[老人]', url: 'Old-Man-1--Streamline-Emoji.svg' },
232
+ { id: 'old-woman', name: '[老妇]', url: 'Old-Woman-1--Streamline-Emoji.svg' },
233
+ { id: 'construction', name: '[工人]', url: 'Construction-Worker--Streamline-Emoji.svg' },
234
+ { id: 'health-worker', name: '[医生]', url: 'Man-Health-Worker-1--Streamline-Emoji.svg' },
235
+ { id: 'turban', name: '[头巾]', url: 'Person-Wearing-Turban-2--Streamline-Emoji.svg' },
236
+ { id: 'facepalm', name: '[捂脸]', url: 'Man-Facepalming-1--Streamline-Emoji.svg' },
237
+ { id: 'shrugging', name: '[耸肩]', url: 'Man-Shrugging-1--Streamline-Emoji.svg' },
238
+ { id: 'gesturing-no', name: '[不要]', url: 'Man-Gesturing-No-1--Streamline-Emoji.svg' },
239
+ { id: 'gesturing-ok', name: '[好的]', url: 'Man-Gesturing-Ok-1--Streamline-Emoji.svg' },
240
+ { id: 'raising-hand', name: '[举手]', url: 'Man-Raising-Hand-1--Streamline-Emoji.svg' },
241
+ { id: 'woman-no', name: '[女不要]', url: 'Woman-Gesturing-No-1--Streamline-Emoji.svg' },
242
+ { id: 'woman-ok', name: '[女好的]', url: 'Woman-Gesturing-Ok-2--Streamline-Emoji.svg' },
243
+ { id: 'woman-hand', name: '[女举手]', url: 'Woman-Raising-Hand-1--Streamline-Emoji.svg' },
244
+ { id: 'couple-heart-1', name: '[情侣1]', url: 'Couple-With-Heart-Woman-Man-1--Streamline-Emoji.svg' },
245
+ { id: 'couple-heart-2', name: '[情侣2]', url: 'Couple-With-Heart-Woman-Man-2--Streamline-Emoji.svg' },
246
+ { id: 'team-101', name: '[团队1]', url: '101--Streamline-The-Team.png' },
247
+ { id: 'team-128', name: '[团队2]', url: '128--Streamline-The-Team.png' },
248
+ { id: 'team-134', name: '[团队3]', url: '134--Streamline-The-Team.png' },
249
+ { id: 'team-173', name: '[团队4]', url: '173--Streamline-The-Team.png' }
250
+ ];
251
+ emojiCategories[1].emojis = modernEmojis;
252
+ // 获取表情图片路径
253
+ export function getEmojiUrl(filename, folder = 'emoji') {
254
+ return new URL(`../${folder}/${filename}`, import.meta.url).href;
255
+ }
256
+ // 替换文本中的表情
257
+ export function replaceEmojiInText(text) {
258
+ if (!text) return '';
259
+ let result = text;
260
+ emojiCategories.forEach(category => {
261
+ category.emojis.forEach(emoji => {
262
+ const regex = new RegExp(emoji.name.replace(/[[\]]/g, '\\$&'), 'g');
263
+ result = result.replace(regex, `<img src="${getEmojiUrl(emoji.url, category.folder)}" class="emoji-img" alt="${emoji.name}" />`);
264
+ });
265
+ });
266
+ return result;
267
+ }
@@ -0,0 +1,114 @@
1
+ /**
2
+ * Event Emitter Utility
3
+ * Provides a simple event emitter for component communication
4
+ */
5
+
6
+ /**
7
+ * Create an event emitter instance
8
+ * @returns {Object} - Event emitter with on, off, emit methods
9
+ */
10
+ export const createEventEmitter = () => {
11
+ const events = {};
12
+
13
+ return {
14
+ /**
15
+ * Register an event listener
16
+ * @param {string} event - Event name
17
+ * @param {Function} callback - Callback function
18
+ */
19
+ on(event, callback) {
20
+ if (!events[event]) {
21
+ events[event] = [];
22
+ }
23
+ events[event].push(callback);
24
+
25
+ // Return unsubscribe function
26
+ return () => {
27
+ events[event] = events[event].filter(cb => cb !== callback);
28
+ };
29
+ },
30
+
31
+ /**
32
+ * Register a one-time event listener
33
+ * @param {string} event - Event name
34
+ * @param {Function} callback - Callback function
35
+ */
36
+ once(event, callback) {
37
+ const unsubscribe = this.on(event, (...args) => {
38
+ callback(...args);
39
+ unsubscribe();
40
+ });
41
+ return unsubscribe;
42
+ },
43
+
44
+ /**
45
+ * Remove an event listener
46
+ * @param {string} event - Event name
47
+ * @param {Function} callback - Callback function
48
+ */
49
+ off(event, callback) {
50
+ if (!events[event]) return;
51
+ events[event] = events[event].filter(cb => cb !== callback);
52
+ },
53
+
54
+ /**
55
+ * Emit an event
56
+ * @param {string} event - Event name
57
+ * @param {...any} args - Event arguments
58
+ */
59
+ emit(event, ...args) {
60
+ if (!events[event]) return;
61
+ events[event].forEach(callback => {
62
+ try {
63
+ callback(...args);
64
+ } catch (error) {
65
+ console.error(`Error in event listener for "${event}":`, error);
66
+ }
67
+ });
68
+ },
69
+
70
+ /**
71
+ * Remove all listeners for an event
72
+ * @param {string} event - Event name
73
+ */
74
+ removeAllListeners(event) {
75
+ if (event) {
76
+ delete events[event];
77
+ } else {
78
+ Object.keys(events).forEach(key => delete events[key]);
79
+ }
80
+ },
81
+
82
+ /**
83
+ * Get listener count for an event
84
+ * @param {string} event - Event name
85
+ * @returns {number} - Number of listeners
86
+ */
87
+ listenerCount(event) {
88
+ return events[event] ? events[event].length : 0;
89
+ },
90
+
91
+ /**
92
+ * Get all event names
93
+ * @returns {string[]} - Array of event names
94
+ */
95
+ eventNames() {
96
+ return Object.keys(events);
97
+ }
98
+ };
99
+ };
100
+
101
+ /**
102
+ * Global event bus for component communication
103
+ */
104
+ export const eventBus = createEventEmitter();
105
+
106
+ /**
107
+ * Composable for using event bus in Vue components
108
+ * @param {string} event - Event name
109
+ * @param {Function} callback - Callback function
110
+ * @returns {Function} - Unsubscribe function
111
+ */
112
+ export const useEventBus = (event, callback) => {
113
+ return eventBus.on(event, callback);
114
+ };