systemrobotassistant 3.0.8

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.

Potentially problematic release.


This version of systemrobotassistant might be problematic. Click here for more details.

Files changed (369) hide show
  1. package/.eslintignore +6 -0
  2. package/.eslintrc +45 -0
  3. package/.gitlab-ci.yml +52 -0
  4. package/.lecprc.ts +76 -0
  5. package/.yarnrc +1 -0
  6. package/CHANGELOG.md +114 -0
  7. package/README.md +14 -0
  8. package/custom-amd-plugin.ts +46 -0
  9. package/es/component/answer-itme/index.d.ts +20 -0
  10. package/es/component/answer-itme/index.d.ts.map +1 -0
  11. package/es/component/answer-itme/index.js +41 -0
  12. package/es/component/answer-itme/style.css +35 -0
  13. package/es/component/data-container/index.d.ts +19 -0
  14. package/es/component/data-container/index.d.ts.map +1 -0
  15. package/es/component/data-container/index.js +37 -0
  16. package/es/component/data-container/style.css +26 -0
  17. package/es/component/days-tab/index.d.ts +6 -0
  18. package/es/component/days-tab/index.d.ts.map +1 -0
  19. package/es/component/days-tab/index.js +119 -0
  20. package/es/component/days-tab/style.css +43 -0
  21. package/es/component/days-tab/utils.d.ts +32 -0
  22. package/es/component/days-tab/utils.d.ts.map +1 -0
  23. package/es/component/days-tab/utils.js +98 -0
  24. package/es/component/error-boundary/index.d.ts +2 -0
  25. package/es/component/error-boundary/index.d.ts.map +1 -0
  26. package/es/component/error-boundary/index.js +33 -0
  27. package/es/component/it-notice-modal/columns.d.ts +11 -0
  28. package/es/component/it-notice-modal/columns.d.ts.map +1 -0
  29. package/es/component/it-notice-modal/columns.js +108 -0
  30. package/es/component/it-notice-modal/double-tab.d.ts +6 -0
  31. package/es/component/it-notice-modal/double-tab.d.ts.map +1 -0
  32. package/es/component/it-notice-modal/double-tab.js +94 -0
  33. package/es/component/it-notice-modal/index.d.ts +6 -0
  34. package/es/component/it-notice-modal/index.d.ts.map +1 -0
  35. package/es/component/it-notice-modal/index.js +488 -0
  36. package/es/component/it-notice-modal/server.d.ts +8 -0
  37. package/es/component/it-notice-modal/server.d.ts.map +1 -0
  38. package/es/component/it-notice-modal/server.js +43 -0
  39. package/es/component/it-notice-modal/single-tab.d.ts +6 -0
  40. package/es/component/it-notice-modal/single-tab.d.ts.map +1 -0
  41. package/es/component/it-notice-modal/single-tab.js +82 -0
  42. package/es/component/it-notice-modal/style.css +301 -0
  43. package/es/component/it-notice-modal/utils.d.ts +2 -0
  44. package/es/component/it-notice-modal/utils.d.ts.map +1 -0
  45. package/es/component/it-notice-modal/utils.js +8 -0
  46. package/es/component/it-notice-tab/index.d.ts +6 -0
  47. package/es/component/it-notice-tab/index.d.ts.map +1 -0
  48. package/es/component/it-notice-tab/index.js +206 -0
  49. package/es/component/it-notice-tab/server.d.ts +3 -0
  50. package/es/component/it-notice-tab/server.d.ts.map +1 -0
  51. package/es/component/it-notice-tab/server.js +13 -0
  52. package/es/component/it-notice-tab/style.css +103 -0
  53. package/es/component/mail-list-modal/index.d.ts +2 -0
  54. package/es/component/mail-list-modal/index.d.ts.map +1 -0
  55. package/es/component/mail-list-modal/index.js +306 -0
  56. package/es/component/mail-list-modal/server.d.ts +7 -0
  57. package/es/component/mail-list-modal/server.d.ts.map +1 -0
  58. package/es/component/mail-list-modal/server.js +38 -0
  59. package/es/component/mail-list-modal/style.css +132 -0
  60. package/es/component/myself-chat-card/index.d.ts +15 -0
  61. package/es/component/myself-chat-card/index.d.ts.map +1 -0
  62. package/es/component/myself-chat-card/index.js +25 -0
  63. package/es/component/myself-chat-card/style.css +22 -0
  64. package/es/component/need-answer/index.d.ts +15 -0
  65. package/es/component/need-answer/index.d.ts.map +1 -0
  66. package/es/component/need-answer/index.js +60 -0
  67. package/es/component/need-answer/style.css +19 -0
  68. package/es/component/opppsition-chat-card/index.d.ts +11 -0
  69. package/es/component/opppsition-chat-card/index.d.ts.map +1 -0
  70. package/es/component/opppsition-chat-card/index.js +25 -0
  71. package/es/component/opppsition-chat-card/style.css +23 -0
  72. package/es/component/question-library/index.d.ts +10 -0
  73. package/es/component/question-library/index.d.ts.map +1 -0
  74. package/es/component/question-library/index.js +291 -0
  75. package/es/component/question-library/server.d.ts +4 -0
  76. package/es/component/question-library/server.d.ts.map +1 -0
  77. package/es/component/question-library/server.js +19 -0
  78. package/es/component/question-library/style.css +75 -0
  79. package/es/component/question-tag/index.d.ts +11 -0
  80. package/es/component/question-tag/index.d.ts.map +1 -0
  81. package/es/component/question-tag/index.js +23 -0
  82. package/es/component/question-tag/style.css +12 -0
  83. package/es/component/recommend-questions-card/index.d.ts +10 -0
  84. package/es/component/recommend-questions-card/index.d.ts.map +1 -0
  85. package/es/component/recommend-questions-card/index.js +104 -0
  86. package/es/component/recommend-questions-card/style.css +54 -0
  87. package/es/component/scroll-view/index.d.ts +3 -0
  88. package/es/component/scroll-view/index.d.ts.map +1 -0
  89. package/es/component/scroll-view/index.js +2 -0
  90. package/es/component/scroll-view/scroll-view.d.ts +18 -0
  91. package/es/component/scroll-view/scroll-view.d.ts.map +1 -0
  92. package/es/component/scroll-view/scroll-view.js +66 -0
  93. package/es/component/scroll-view/style.css +34 -0
  94. package/es/component/tab/index.d.ts +2 -0
  95. package/es/component/tab/index.d.ts.map +1 -0
  96. package/es/component/tab/index.js +18 -0
  97. package/es/component/tab/style.css +26 -0
  98. package/es/component/tips-answer/index.d.ts +15 -0
  99. package/es/component/tips-answer/index.d.ts.map +1 -0
  100. package/es/component/tips-answer/index.js +28 -0
  101. package/es/component/tips-answer/style.css +10 -0
  102. package/es/images/expire-robot.svg +16 -0
  103. package/es/images/pc-invalid.svg +11 -0
  104. package/es/images/screenshot-5.png +0 -0
  105. package/es/index.d.ts +92 -0
  106. package/es/index.d.ts.map +1 -0
  107. package/es/index.js +506 -0
  108. package/es/js/const.d.ts +41 -0
  109. package/es/js/const.d.ts.map +1 -0
  110. package/es/js/const.js +46 -0
  111. package/es/js/gen-render-promise.d.ts +9 -0
  112. package/es/js/gen-render-promise.d.ts.map +1 -0
  113. package/es/js/gen-render-promise.js +30 -0
  114. package/es/js/get-time.d.ts +15 -0
  115. package/es/js/get-time.d.ts.map +1 -0
  116. package/es/js/get-time.js +35 -0
  117. package/es/js/hfc-space.d.ts +16 -0
  118. package/es/js/hfc-space.d.ts.map +1 -0
  119. package/es/js/hfc-space.js +71 -0
  120. package/es/js/render-special.d.ts +16 -0
  121. package/es/js/render-special.d.ts.map +1 -0
  122. package/es/js/render-special.js +53 -0
  123. package/es/js/request/fetch.d.ts +10 -0
  124. package/es/js/request/fetch.d.ts.map +1 -0
  125. package/es/js/request/fetch.js +81 -0
  126. package/es/js/request/request.d.ts +3 -0
  127. package/es/js/request/request.d.ts.map +1 -0
  128. package/es/js/request/request.js +63 -0
  129. package/es/js/showMessage.d.ts +15 -0
  130. package/es/js/showMessage.d.ts.map +1 -0
  131. package/es/js/showMessage.js +75 -0
  132. package/es/js/state-immer.d.ts +3 -0
  133. package/es/js/state-immer.d.ts.map +1 -0
  134. package/es/js/state-immer.js +19 -0
  135. package/es/js/timer-executor.d.ts +3 -0
  136. package/es/js/timer-executor.d.ts.map +1 -0
  137. package/es/js/timer-executor.js +83 -0
  138. package/es/js/to-hfc.d.ts +2 -0
  139. package/es/js/to-hfc.d.ts.map +1 -0
  140. package/es/js/to-hfc.js +8 -0
  141. package/es/js/utils.d.ts +3 -0
  142. package/es/js/utils.d.ts.map +1 -0
  143. package/es/js/utils.js +11 -0
  144. package/es/jsx/chat-modal.d.ts +16 -0
  145. package/es/jsx/chat-modal.d.ts.map +1 -0
  146. package/es/jsx/chat-modal.js +268 -0
  147. package/es/server.d.ts +8 -0
  148. package/es/server.d.ts.map +1 -0
  149. package/es/server.js +44 -0
  150. package/es/style.css +174 -0
  151. package/lib/component/answer-itme/index.d.ts +20 -0
  152. package/lib/component/answer-itme/index.d.ts.map +1 -0
  153. package/lib/component/answer-itme/index.js +51 -0
  154. package/lib/component/answer-itme/style.css +35 -0
  155. package/lib/component/data-container/index.d.ts +19 -0
  156. package/lib/component/data-container/index.d.ts.map +1 -0
  157. package/lib/component/data-container/index.js +45 -0
  158. package/lib/component/data-container/style.css +26 -0
  159. package/lib/component/days-tab/index.d.ts +6 -0
  160. package/lib/component/days-tab/index.d.ts.map +1 -0
  161. package/lib/component/days-tab/index.js +129 -0
  162. package/lib/component/days-tab/style.css +43 -0
  163. package/lib/component/days-tab/utils.d.ts +32 -0
  164. package/lib/component/days-tab/utils.d.ts.map +1 -0
  165. package/lib/component/days-tab/utils.js +110 -0
  166. package/lib/component/error-boundary/index.d.ts +2 -0
  167. package/lib/component/error-boundary/index.d.ts.map +1 -0
  168. package/lib/component/error-boundary/index.js +40 -0
  169. package/lib/component/it-notice-modal/columns.d.ts +11 -0
  170. package/lib/component/it-notice-modal/columns.d.ts.map +1 -0
  171. package/lib/component/it-notice-modal/columns.js +116 -0
  172. package/lib/component/it-notice-modal/double-tab.d.ts +6 -0
  173. package/lib/component/it-notice-modal/double-tab.d.ts.map +1 -0
  174. package/lib/component/it-notice-modal/double-tab.js +104 -0
  175. package/lib/component/it-notice-modal/index.d.ts +6 -0
  176. package/lib/component/it-notice-modal/index.d.ts.map +1 -0
  177. package/lib/component/it-notice-modal/index.js +499 -0
  178. package/lib/component/it-notice-modal/server.d.ts +8 -0
  179. package/lib/component/it-notice-modal/server.d.ts.map +1 -0
  180. package/lib/component/it-notice-modal/server.js +55 -0
  181. package/lib/component/it-notice-modal/single-tab.d.ts +6 -0
  182. package/lib/component/it-notice-modal/single-tab.d.ts.map +1 -0
  183. package/lib/component/it-notice-modal/single-tab.js +92 -0
  184. package/lib/component/it-notice-modal/style.css +301 -0
  185. package/lib/component/it-notice-modal/utils.d.ts +2 -0
  186. package/lib/component/it-notice-modal/utils.d.ts.map +1 -0
  187. package/lib/component/it-notice-modal/utils.js +15 -0
  188. package/lib/component/it-notice-tab/index.d.ts +6 -0
  189. package/lib/component/it-notice-tab/index.d.ts.map +1 -0
  190. package/lib/component/it-notice-tab/index.js +216 -0
  191. package/lib/component/it-notice-tab/server.d.ts +3 -0
  192. package/lib/component/it-notice-tab/server.d.ts.map +1 -0
  193. package/lib/component/it-notice-tab/server.js +20 -0
  194. package/lib/component/it-notice-tab/style.css +103 -0
  195. package/lib/component/mail-list-modal/index.d.ts +2 -0
  196. package/lib/component/mail-list-modal/index.d.ts.map +1 -0
  197. package/lib/component/mail-list-modal/index.js +316 -0
  198. package/lib/component/mail-list-modal/server.d.ts +7 -0
  199. package/lib/component/mail-list-modal/server.d.ts.map +1 -0
  200. package/lib/component/mail-list-modal/server.js +50 -0
  201. package/lib/component/mail-list-modal/style.css +132 -0
  202. package/lib/component/myself-chat-card/index.d.ts +15 -0
  203. package/lib/component/myself-chat-card/index.d.ts.map +1 -0
  204. package/lib/component/myself-chat-card/index.js +35 -0
  205. package/lib/component/myself-chat-card/style.css +22 -0
  206. package/lib/component/need-answer/index.d.ts +15 -0
  207. package/lib/component/need-answer/index.d.ts.map +1 -0
  208. package/lib/component/need-answer/index.js +70 -0
  209. package/lib/component/need-answer/style.css +19 -0
  210. package/lib/component/opppsition-chat-card/index.d.ts +11 -0
  211. package/lib/component/opppsition-chat-card/index.d.ts.map +1 -0
  212. package/lib/component/opppsition-chat-card/index.js +35 -0
  213. package/lib/component/opppsition-chat-card/style.css +23 -0
  214. package/lib/component/question-library/index.d.ts +10 -0
  215. package/lib/component/question-library/index.d.ts.map +1 -0
  216. package/lib/component/question-library/index.js +301 -0
  217. package/lib/component/question-library/server.d.ts +4 -0
  218. package/lib/component/question-library/server.d.ts.map +1 -0
  219. package/lib/component/question-library/server.js +27 -0
  220. package/lib/component/question-library/style.css +75 -0
  221. package/lib/component/question-tag/index.d.ts +11 -0
  222. package/lib/component/question-tag/index.d.ts.map +1 -0
  223. package/lib/component/question-tag/index.js +33 -0
  224. package/lib/component/question-tag/style.css +12 -0
  225. package/lib/component/recommend-questions-card/index.d.ts +10 -0
  226. package/lib/component/recommend-questions-card/index.d.ts.map +1 -0
  227. package/lib/component/recommend-questions-card/index.js +114 -0
  228. package/lib/component/recommend-questions-card/style.css +54 -0
  229. package/lib/component/scroll-view/index.d.ts +3 -0
  230. package/lib/component/scroll-view/index.d.ts.map +1 -0
  231. package/lib/component/scroll-view/index.js +10 -0
  232. package/lib/component/scroll-view/scroll-view.d.ts +18 -0
  233. package/lib/component/scroll-view/scroll-view.d.ts.map +1 -0
  234. package/lib/component/scroll-view/scroll-view.js +76 -0
  235. package/lib/component/scroll-view/style.css +34 -0
  236. package/lib/component/tab/index.d.ts +2 -0
  237. package/lib/component/tab/index.d.ts.map +1 -0
  238. package/lib/component/tab/index.js +28 -0
  239. package/lib/component/tab/style.css +26 -0
  240. package/lib/component/tips-answer/index.d.ts +15 -0
  241. package/lib/component/tips-answer/index.d.ts.map +1 -0
  242. package/lib/component/tips-answer/index.js +38 -0
  243. package/lib/component/tips-answer/style.css +10 -0
  244. package/lib/images/expire-robot.svg +16 -0
  245. package/lib/images/pc-invalid.svg +11 -0
  246. package/lib/images/screenshot-5.png +0 -0
  247. package/lib/index.d.ts +92 -0
  248. package/lib/index.d.ts.map +1 -0
  249. package/lib/index.js +516 -0
  250. package/lib/js/const.d.ts +41 -0
  251. package/lib/js/const.d.ts.map +1 -0
  252. package/lib/js/const.js +55 -0
  253. package/lib/js/gen-render-promise.d.ts +9 -0
  254. package/lib/js/gen-render-promise.d.ts.map +1 -0
  255. package/lib/js/gen-render-promise.js +37 -0
  256. package/lib/js/get-time.d.ts +15 -0
  257. package/lib/js/get-time.d.ts.map +1 -0
  258. package/lib/js/get-time.js +43 -0
  259. package/lib/js/hfc-space.d.ts +16 -0
  260. package/lib/js/hfc-space.d.ts.map +1 -0
  261. package/lib/js/hfc-space.js +91 -0
  262. package/lib/js/render-special.d.ts +16 -0
  263. package/lib/js/render-special.d.ts.map +1 -0
  264. package/lib/js/render-special.js +61 -0
  265. package/lib/js/request/fetch.d.ts +10 -0
  266. package/lib/js/request/fetch.d.ts.map +1 -0
  267. package/lib/js/request/fetch.js +88 -0
  268. package/lib/js/request/request.d.ts +3 -0
  269. package/lib/js/request/request.d.ts.map +1 -0
  270. package/lib/js/request/request.js +71 -0
  271. package/lib/js/showMessage.d.ts +15 -0
  272. package/lib/js/showMessage.d.ts.map +1 -0
  273. package/lib/js/showMessage.js +83 -0
  274. package/lib/js/state-immer.d.ts +3 -0
  275. package/lib/js/state-immer.d.ts.map +1 -0
  276. package/lib/js/state-immer.js +27 -0
  277. package/lib/js/timer-executor.d.ts +3 -0
  278. package/lib/js/timer-executor.d.ts.map +1 -0
  279. package/lib/js/timer-executor.js +91 -0
  280. package/lib/js/to-hfc.d.ts +2 -0
  281. package/lib/js/to-hfc.d.ts.map +1 -0
  282. package/lib/js/to-hfc.js +14 -0
  283. package/lib/js/utils.d.ts +3 -0
  284. package/lib/js/utils.d.ts.map +1 -0
  285. package/lib/js/utils.js +19 -0
  286. package/lib/jsx/chat-modal.d.ts +16 -0
  287. package/lib/jsx/chat-modal.d.ts.map +1 -0
  288. package/lib/jsx/chat-modal.js +278 -0
  289. package/lib/server.d.ts +8 -0
  290. package/lib/server.d.ts.map +1 -0
  291. package/lib/server.js +58 -0
  292. package/lib/style.css +174 -0
  293. package/package.json +57 -0
  294. package/rct.config.js +8 -0
  295. package/src/component/answer-itme/index.jsx +64 -0
  296. package/src/component/answer-itme/style.less +37 -0
  297. package/src/component/data-container/index.jsx +45 -0
  298. package/src/component/data-container/style.less +27 -0
  299. package/src/component/days-tab/index.jsx +114 -0
  300. package/src/component/days-tab/style.less +55 -0
  301. package/src/component/days-tab/utils.js +87 -0
  302. package/src/component/error-boundary/index.jsx +39 -0
  303. package/src/component/it-notice-modal/columns.js +102 -0
  304. package/src/component/it-notice-modal/double-tab.jsx +83 -0
  305. package/src/component/it-notice-modal/index.jsx +404 -0
  306. package/src/component/it-notice-modal/server.js +43 -0
  307. package/src/component/it-notice-modal/single-tab.jsx +70 -0
  308. package/src/component/it-notice-modal/style.less +367 -0
  309. package/src/component/it-notice-modal/utils.js +8 -0
  310. package/src/component/it-notice-tab/index.jsx +196 -0
  311. package/src/component/it-notice-tab/server.js +14 -0
  312. package/src/component/it-notice-tab/style.less +120 -0
  313. package/src/component/mail-list-modal/index.jsx +270 -0
  314. package/src/component/mail-list-modal/server.js +38 -0
  315. package/src/component/mail-list-modal/style.less +154 -0
  316. package/src/component/myself-chat-card/index.jsx +27 -0
  317. package/src/component/myself-chat-card/style.less +30 -0
  318. package/src/component/need-answer/index.jsx +56 -0
  319. package/src/component/need-answer/style.less +21 -0
  320. package/src/component/opppsition-chat-card/index.jsx +25 -0
  321. package/src/component/opppsition-chat-card/style.less +33 -0
  322. package/src/component/question-library/index.jsx +316 -0
  323. package/src/component/question-library/server.js +19 -0
  324. package/src/component/question-library/style.less +102 -0
  325. package/src/component/question-tag/index.jsx +27 -0
  326. package/src/component/question-tag/style.less +15 -0
  327. package/src/component/recommend-questions-card/index.jsx +111 -0
  328. package/src/component/recommend-questions-card/style.less +66 -0
  329. package/src/component/scroll-view/index.js +3 -0
  330. package/src/component/scroll-view/scroll-view.jsx +74 -0
  331. package/src/component/scroll-view/style.less +37 -0
  332. package/src/component/tab/index.jsx +17 -0
  333. package/src/component/tab/style.less +26 -0
  334. package/src/component/tips-answer/index.jsx +38 -0
  335. package/src/component/tips-answer/style.less +11 -0
  336. package/src/images/expire-robot.svg +16 -0
  337. package/src/images/pc-invalid.svg +11 -0
  338. package/src/images/screenshot-5.png +0 -0
  339. package/src/index.jsx +554 -0
  340. package/src/js/const.js +48 -0
  341. package/src/js/gen-render-promise.js +32 -0
  342. package/src/js/get-time.js +35 -0
  343. package/src/js/hfc-space.js +91 -0
  344. package/src/js/render-special.js +64 -0
  345. package/src/js/request/fetch.js +87 -0
  346. package/src/js/request/request.js +74 -0
  347. package/src/js/showMessage.js +81 -0
  348. package/src/js/state-immer.js +12 -0
  349. package/src/js/timer-executor.js +37 -0
  350. package/src/js/to-hfc.js +9 -0
  351. package/src/js/utils.js +13 -0
  352. package/src/jsx/chat-modal.jsx +254 -0
  353. package/src/main.js +1 -0
  354. package/src/server.js +45 -0
  355. package/src/style.less +229 -0
  356. package/test/cases/case-01.assert.js +6 -0
  357. package/test/cases/case-01.source.jsx +17 -0
  358. package/test/cases/case-02.assert.js +6 -0
  359. package/test/cases/case-02.source.jsx +25 -0
  360. package/test/cases/case-02.style.less +15 -0
  361. package/test/cases/case-03.source.jsx +69 -0
  362. package/test/cases/case-03.style.less +3 -0
  363. package/tsconfig.json +48 -0
  364. package/typings.d.ts +5 -0
  365. package/umd/b415d90208c277ba3703.png +0 -0
  366. package/umd/index.css +1753 -0
  367. package/umd/index.js +36258 -0
  368. package/umd/index.min.css +1 -0
  369. package/umd/index.min.js +657 -0
package/lib/index.js ADDED
@@ -0,0 +1,516 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _classnames = _interopRequireDefault(require("classnames"));
8
+ var _react = _interopRequireWildcard(require("react"));
9
+ var _propTypes = _interopRequireDefault(require("prop-types"));
10
+ var _shineout = require("shineout");
11
+ var _Icon = _interopRequireDefault(require("@shein-components/Icon"));
12
+ var _core = require("@shein-bbl/core");
13
+ var Server = _interopRequireWildcard(require("./server"));
14
+ var _chatModal = _interopRequireDefault(require("./jsx/chat-modal"));
15
+ require("./style.css");
16
+ var _hfcSpace = require("./js/hfc-space");
17
+ var _errorBoundary = _interopRequireDefault(require("./component/error-boundary"));
18
+ var _itNoticeModal = require("./component/it-notice-modal");
19
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
20
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
23
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
24
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
25
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
26
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
27
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
28
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
29
+ var styles = {
30
+ "renderIconWrapper": "shein-components_systemrobotassistant_renderIconWrapper",
31
+ "draggableIcon": "shein-components_systemrobotassistant_draggableIcon",
32
+ "iconWrapper": "shein-components_systemrobotassistant_iconWrapper",
33
+ "avatarWrap": "shein-components_systemrobotassistant_avatarWrap",
34
+ "avatarBorder": "shein-components_systemrobotassistant_avatarBorder",
35
+ "collapseRobotBox": "shein-components_systemrobotassistant_collapseRobotBox",
36
+ "collapseIcon": "shein-components_systemrobotassistant_collapseIcon",
37
+ "redDot": "shein-components_systemrobotassistant_redDot",
38
+ "chatModalWrapper": "shein-components_systemrobotassistant_chatModalWrapper",
39
+ "header": "shein-components_systemrobotassistant_header",
40
+ "midlleWrapper": "shein-components_systemrobotassistant_midlleWrapper",
41
+ "tabItem": "shein-components_systemrobotassistant_tabItem",
42
+ "leftTitle": "shein-components_systemrobotassistant_leftTitle",
43
+ "tabIcon": "shein-components_systemrobotassistant_tabIcon",
44
+ "title": "shein-components_systemrobotassistant_title",
45
+ "avatarClass": "shein-components_systemrobotassistant_avatarClass",
46
+ "suggestion": "shein-components_systemrobotassistant_suggestion",
47
+ "link": "shein-components_systemrobotassistant_link",
48
+ "closedIcon": "shein-components_systemrobotassistant_closedIcon",
49
+ "chatContentWrapper": "shein-components_systemrobotassistant_chatContentWrapper",
50
+ "switch": "shein-components_systemrobotassistant_switch",
51
+ "robotImg": "shein-components_systemrobotassistant_robotImg",
52
+ "robotGif": "shein-components_systemrobotassistant_robotGif",
53
+ "expireStatus": "shein-components_systemrobotassistant_expireStatus",
54
+ "none": "shein-components_systemrobotassistant_none",
55
+ "modalMask": "shein-components_systemrobotassistant_modalMask"
56
+ };
57
+ var defaultSate = {
58
+ isHover: false,
59
+ isMoving: false,
60
+ bottom: 12,
61
+ right: 32,
62
+ modalVisible: false,
63
+ // 记录按下去的时间戳
64
+ mouseDownTime: 0,
65
+ messageCount: 0,
66
+ isCollapse: false,
67
+ showExpirePopover: false
68
+ };
69
+
70
+ /**
71
+ * @cn 帮助中心机器人组件
72
+ * @desc 帮助中心机器人组件,不需要安装,不能直接使用,@shein-components/hfc-robot 内部调用,安装 @shein-components/hfc-robot 即可使用
73
+ * @author -
74
+ */
75
+ class SystemRobotAssistant extends _react.PureComponent {
76
+ constructor(props) {
77
+ super(props);
78
+ (0, _hfcSpace.setHfcSpace)(props.hfcSpace);
79
+ (0, _hfcSpace.setHfcEnv)(props.env);
80
+ this.state = defaultSate;
81
+ this.iconRef = /*#__PURE__*/(0, _react.createRef)();
82
+ this.modalRef = /*#__PURE__*/(0, _react.createRef)();
83
+ this.popoverTimerRef = /*#__PURE__*/(0, _react.createRef)();
84
+ this.handleInit = this.handleInit.bind(this);
85
+ this.setMoving = this.setMoving.bind(this);
86
+ this.onMouseDown = this.onMouseDown.bind(this);
87
+ this.onMouseUp = this.onMouseUp.bind(this);
88
+ this.handleTokenInvalid = this.handleTokenInvalid.bind(this);
89
+ this.setModalVisible = this.setModalVisible.bind(this);
90
+ this.closeVisible = this.closeVisible.bind(this);
91
+ this.adjustIconPosition = this.adjustIconPosition.bind(this);
92
+ this.addMoveListener = this.addMoveListener.bind(this);
93
+ this.mouseupListener = this.mouseupListener.bind(this);
94
+ this.getRenderIcon = this.getRenderIcon.bind(this);
95
+ this.isPopITInform = this.isPopITInform.bind(this);
96
+ }
97
+ componentDidMount() {
98
+ var _this$props = this.props,
99
+ bottom = _this$props.bottom,
100
+ right = _this$props.right,
101
+ draggable = _this$props.draggable,
102
+ isLogin = _this$props.isLogin,
103
+ t = _this$props.t,
104
+ hfcSpace = _this$props.hfcSpace,
105
+ lang = _this$props.lang;
106
+ (0, _hfcSpace.setTranslateFn)(t);
107
+ (0, _hfcSpace.setLocalStorage)({
108
+ [`${hfcSpace}-lang`]: lang || 'CN'
109
+ });
110
+ window.addEventListener('mouseup', this.mouseupListener);
111
+ // draggable 为 true 时,才处理图标位置
112
+ if (draggable) {
113
+ window.addEventListener('mousedown', this.addMoveListener);
114
+ }
115
+ if (isLogin) {
116
+ this.handleInit();
117
+ }
118
+ // 登录失效的回调
119
+ (0, _hfcSpace.setTokenInvalidCallback)(this.handleTokenInvalid);
120
+ this.setState({
121
+ bottom,
122
+ right
123
+ });
124
+ }
125
+ componentDidUpdate(prevProps, prevState) {
126
+ var _this$props2 = this.props,
127
+ draggable = _this$props2.draggable,
128
+ isLogin = _this$props2.isLogin,
129
+ t = _this$props2.t,
130
+ hfcSpace = _this$props2.hfcSpace,
131
+ lang = _this$props2.lang;
132
+ var isCollapse = this.state.isCollapse;
133
+ // draggable 为 true 时,才处理图标位置
134
+ if (draggable && !isCollapse && isCollapse !== prevState.isCollapse) {
135
+ // 如果当前 icon 在临界点时,不让图标超出外面
136
+ this.adjustIconPosition();
137
+ }
138
+ if (isLogin !== prevProps.isLogin && isLogin) {
139
+ this.handleInit();
140
+ }
141
+ if (t !== prevProps.t || hfcSpace !== prevProps.hfcSpace || lang !== prevProps.lang) {
142
+ (0, _hfcSpace.setTranslateFn)(t);
143
+ (0, _hfcSpace.setLocalStorage)({
144
+ [`${hfcSpace}-lang`]: lang || 'CN'
145
+ });
146
+ }
147
+ (0, _hfcSpace.setTokenInvalidCallback)(this.handleTokenInvalid);
148
+ }
149
+ componentWillUnmount() {
150
+ (0, _hfcSpace.clearAll)();
151
+ clearInterval(this.timer);
152
+ var draggable = this.props.draggable;
153
+ if (draggable) {
154
+ window.removeEventListener('mousedown', this.addMoveListener);
155
+ }
156
+ window.removeEventListener('mouseup', this.mouseupListener);
157
+ this.timer = null;
158
+ }
159
+ onMouseDown() {
160
+ this.setState({
161
+ isMoving: true,
162
+ mouseDownTime: new Date().getTime()
163
+ });
164
+ }
165
+ onMouseUp() {
166
+ this.setState({
167
+ isMoving: false
168
+ });
169
+ }
170
+ setMoving(e) {
171
+ var isMoving = this.state.isMoving;
172
+ if (!isMoving) return;
173
+ e.preventDefault();
174
+ var _this$state = this.state,
175
+ right = _this$state.right,
176
+ bottom = _this$state.bottom;
177
+ var movementX = e.movementX,
178
+ movementY = e.movementY;
179
+ var _this$iconRef$current = this.iconRef.current.getBoundingClientRect(),
180
+ width = _this$iconRef$current.width,
181
+ height = _this$iconRef$current.height;
182
+ var rightBound = window.innerWidth - width;
183
+ var topBound = window.innerHeight - height;
184
+ var x = 0;
185
+ if (right - movementX >= window.innerWidth) {
186
+ x = window.innerWidth;
187
+ } else {
188
+ x = right - movementX;
189
+ }
190
+ var y = 0;
191
+ if (bottom - movementY >= window.innerHeight) {
192
+ y = window.innerHeight;
193
+ } else {
194
+ y = bottom - movementY;
195
+ }
196
+ // 当前图标超出边界
197
+ if (x < 0 || x > rightBound || y < 0 || y > topBound) {
198
+ this.setState({
199
+ isCollapse: true,
200
+ modalVisible: false
201
+ });
202
+ return;
203
+ }
204
+ this.setState({
205
+ right: x,
206
+ bottom: y
207
+ });
208
+ }
209
+ setHover(bool) {
210
+ this.setState({
211
+ isHover: bool
212
+ });
213
+ }
214
+ setModalVisible() {
215
+ var _this$state2 = this.state,
216
+ modalVisible = _this$state2.modalVisible,
217
+ mouseDownTime = _this$state2.mouseDownTime;
218
+ var isLogin = this.props.isLogin;
219
+ var draggable = this.props.draggable;
220
+ if (!isLogin) return;
221
+ // 大于 170 豪秒就不要处理点击事件且 draggable 为 true 时,不处理
222
+ if (draggable && new Date().getTime() - mouseDownTime > 170) return;
223
+ this.setState({
224
+ modalVisible: !modalVisible,
225
+ messageCount: 0
226
+ });
227
+ }
228
+ getRenderIcon() {
229
+ var renderIcon = this.props.renderIcon;
230
+ var isLogin = this.props.isLogin;
231
+ if (typeof renderIcon === 'function') {
232
+ return renderIcon(isLogin);
233
+ }
234
+ return renderIcon;
235
+ }
236
+ mouseupListener(e) {
237
+ var _this$modalRef, _this$modalRef$curren, _this$iconRef, _this$iconRef$current2;
238
+ if (!(this !== null && this !== void 0 && (_this$modalRef = this.modalRef) !== null && _this$modalRef !== void 0 && (_this$modalRef$curren = _this$modalRef.current) !== null && _this$modalRef$curren !== void 0 && _this$modalRef$curren.contains(e.target)) && !(this !== null && this !== void 0 && (_this$iconRef = this.iconRef) !== null && _this$iconRef !== void 0 && (_this$iconRef$current2 = _this$iconRef.current) !== null && _this$iconRef$current2 !== void 0 && _this$iconRef$current2.contains(e.target))) {
239
+ this.setState({
240
+ modalVisible: false
241
+ });
242
+ }
243
+ var draggable = this.props.draggable;
244
+ // draggable 为 false 时,不处理
245
+ if (!draggable) return;
246
+ this.setState({
247
+ isMoving: false
248
+ });
249
+ document.body.removeEventListener('mousemove', this.setMoving);
250
+ }
251
+ addMoveListener() {
252
+ document.body.addEventListener('mousemove', this.setMoving);
253
+ }
254
+ handleTokenInvalid(argument) {
255
+ var _this$props3 = this.props,
256
+ bottom = _this$props3.bottom,
257
+ right = _this$props3.right,
258
+ expireTipUse = _this$props3.expireTipUse;
259
+ // 登录失效要关掉窗口
260
+ this.setState(_objectSpread(_objectSpread({}, defaultSate), {}, {
261
+ modalVisible: false,
262
+ bottom,
263
+ right
264
+ }), () => {
265
+ if (expireTipUse) {
266
+ this.setState({
267
+ showExpirePopover: true
268
+ });
269
+ }
270
+ });
271
+ if (expireTipUse) {
272
+ // eslint-disable-next-line no-unused-expressions
273
+ this.popoverTimerRef && clearTimeout(this.popoverTimerRef);
274
+ this.popoverTimerRef = setTimeout(() => {
275
+ this.setState({
276
+ showExpirePopover: false
277
+ });
278
+ }, 15000);
279
+ }
280
+ var tokenInvalidCallback = this.props.tokenInvalidCallback;
281
+ tokenInvalidCallback(argument);
282
+ }
283
+ closeVisible() {
284
+ this.setState({
285
+ modalVisible: false
286
+ });
287
+ }
288
+ handleInit() {
289
+ this.setState({
290
+ showExpirePopover: false
291
+ });
292
+ this.statisticsMessageCount();
293
+ this.isPopITInform();
294
+ clearInterval(this.timer);
295
+ this.timer = setInterval(() => {
296
+ this.statisticsMessageCount();
297
+ }, 1000 * 60 * 10);
298
+ }
299
+ statisticsMessageCount() {
300
+ var isLogin = this.props.isLogin;
301
+ if (!isLogin) return;
302
+ Server.statisticsMessageCount().then(res => {
303
+ if (res) {
304
+ this.setState({
305
+ messageCount: res.info && res.info.messageCount
306
+ });
307
+ }
308
+ });
309
+ }
310
+
311
+ // 校正大图标的位置
312
+ adjustIconPosition() {
313
+ var _this$iconRef$current3 = this.iconRef.current.getBoundingClientRect(),
314
+ width = _this$iconRef$current3.width,
315
+ height = _this$iconRef$current3.height,
316
+ top = _this$iconRef$current3.top,
317
+ left = _this$iconRef$current3.left,
318
+ iconRight = _this$iconRef$current3.right,
319
+ iconBottom = _this$iconRef$current3.bottom;
320
+ var _this$state3 = this.state,
321
+ bottom = _this$state3.bottom,
322
+ right = _this$state3.right;
323
+ var x = right;
324
+ var y = bottom;
325
+ if (top < 0) {
326
+ y = window.innerHeight - height;
327
+ } else if (iconBottom < 0) {
328
+ y = 0;
329
+ }
330
+ if (left < 0) {
331
+ x = window.innerWidth - width;
332
+ } else if (iconRight < 0) {
333
+ x = 0;
334
+ }
335
+ this.setState({
336
+ right: x,
337
+ bottom: y
338
+ });
339
+ }
340
+
341
+ // eslint-disable-next-line class-methods-use-this
342
+ isPopITInform() {
343
+ var _this = this;
344
+ return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
345
+ var _this$props4, zIndex, t, res;
346
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
347
+ while (1) switch (_context.prev = _context.next) {
348
+ case 0:
349
+ _this$props4 = _this.props, zIndex = _this$props4.zIndex, t = _this$props4.t;
350
+ _context.next = 3;
351
+ return Server.isPopITInform();
352
+ case 3:
353
+ res = _context.sent;
354
+ if (res !== null && res !== void 0 && res.info) {
355
+ (0, _itNoticeModal.openITNoticeModal)({
356
+ zIndex,
357
+ t
358
+ });
359
+ }
360
+ case 5:
361
+ case "end":
362
+ return _context.stop();
363
+ }
364
+ }, _callee);
365
+ }))();
366
+ }
367
+ render() {
368
+ var _this$iconRef2;
369
+ var _this$state4 = this.state,
370
+ isHover = _this$state4.isHover,
371
+ bottom = _this$state4.bottom,
372
+ right = _this$state4.right,
373
+ modalVisible = _this$state4.modalVisible,
374
+ messageCount = _this$state4.messageCount,
375
+ isCollapse = _this$state4.isCollapse,
376
+ showExpirePopover = _this$state4.showExpirePopover;
377
+ var _this$props5 = this.props,
378
+ zIndex = _this$props5.zIndex,
379
+ iconWrapperClassName = _this$props5.iconWrapperClassName,
380
+ iconClassName = _this$props5.iconClassName,
381
+ textClassName = _this$props5.textClassName,
382
+ renderIcon = _this$props5.renderIcon,
383
+ draggable = _this$props5.draggable,
384
+ nodeIdList = _this$props5.nodeIdList,
385
+ isLogin = _this$props5.isLogin,
386
+ t = _this$props5.t;
387
+ var actualRenderIcon = renderIcon ? /*#__PURE__*/_react.default.cloneElement(this.getRenderIcon(renderIcon), _objectSpread({
388
+ onClick: this.setModalVisible
389
+ }, draggable ? {
390
+ onMouseDown: this.onMouseDown,
391
+ onMouseUp: this.onMouseUp
392
+ } : {})) : null;
393
+ return /*#__PURE__*/_react.default.createElement(_errorBoundary.default, null, 'renderIcon' in this.props ? /*#__PURE__*/_react.default.createElement("div", {
394
+ className: (0, _classnames.default)(styles.renderIconWrapper, draggable && styles.draggableIcon, iconWrapperClassName),
395
+ style: {
396
+ zIndex,
397
+ bottom,
398
+ right
399
+ }
400
+ }, /*#__PURE__*/_react.default.createElement("div", {
401
+ ref: this.iconRef
402
+ }, actualRenderIcon), messageCount && isLogin ? /*#__PURE__*/_react.default.createElement("div", {
403
+ className: styles.redDot
404
+ }, messageCount) : null) : /*#__PURE__*/_react.default.createElement("div", {
405
+ className: (0, _classnames.default)(styles.iconWrapper, isCollapse && styles.collapseRobotBox, iconWrapperClassName),
406
+ style: {
407
+ bottom,
408
+ right,
409
+ zIndex
410
+ },
411
+ ref: this.iconRef,
412
+ onMouseDown: draggable ? this.onMouseDown : undefined,
413
+ onMouseUp: draggable ? this.onMouseUp : undefined,
414
+ onClick: this.setModalVisible
415
+ }, /*#__PURE__*/_react.default.createElement(_shineout.Popover, {
416
+ zIndex: zIndex,
417
+ visible: showExpirePopover
418
+ }, t('有事找 TA 登陆已失效,请刷新页面重试')), !isCollapse ? /*#__PURE__*/_react.default.createElement("div", {
419
+ className: (0, _classnames.default)(styles.avatarWrap)
420
+ }, /*#__PURE__*/_react.default.createElement("div", {
421
+ className: (0, _classnames.default)(styles.avatarBorder, isHover && styles.hover),
422
+ onMouseOver: () => {
423
+ this.setHover(true);
424
+ },
425
+ onMouseOut: () => {
426
+ this.setHover(false);
427
+ }
428
+ }, /*#__PURE__*/_react.default.createElement("div", {
429
+ className: (0, _classnames.default)(styles.robotImg, !isLogin && styles.expireStatus, iconClassName)
430
+ })), /*#__PURE__*/_react.default.createElement("span", {
431
+ className: (0, _classnames.default)(styles.switch, textClassName)
432
+ }, modalVisible ? t('戳我关闭') : t('有事找TA'))) : /*#__PURE__*/_react.default.createElement(_Icon.default, {
433
+ className: styles.collapseIcon,
434
+ name: "round-arrow-right",
435
+ onClick: e => {
436
+ e.stopPropagation();
437
+ e.preventDefault();
438
+ this.setState({
439
+ isCollapse: !isCollapse
440
+ });
441
+ }
442
+ }), messageCount && isLogin ? /*#__PURE__*/_react.default.createElement("div", {
443
+ className: styles.redDot
444
+ }, messageCount) : null), modalVisible ? /*#__PURE__*/_react.default.createElement(_chatModal.default, _extends({
445
+ modalRef: this.modalRef,
446
+ iconRef: (_this$iconRef2 = this.iconRef) === null || _this$iconRef2 === void 0 ? void 0 : _this$iconRef2.current,
447
+ onClose: this.closeVisible,
448
+ nodeIdList: nodeIdList
449
+ }, this.props)) : null);
450
+ }
451
+ }
452
+ SystemRobotAssistant.defaultProps = {
453
+ tokenInvalidCallback: () => null,
454
+ zIndex: 100,
455
+ iconWrapperClassName: '',
456
+ iconClassName: '',
457
+ textClassName: '',
458
+ spinSize: 40,
459
+ bottom: 12,
460
+ right: 32,
461
+ draggable: true,
462
+ expireTipUse: true,
463
+ chatgptUse: true,
464
+ lang: 'CN',
465
+ t: _core.format
466
+ };
467
+ SystemRobotAssistant.propTypes = {
468
+ /** 系统 code,跟后端要或者在帮助中心后台端的系统配置页面查看 */
469
+ hfcSpace: _propTypes.default.string.isRequired,
470
+ /** 开发环境 可选 'dev'|'test'|'sit'|'online' */
471
+ env: _propTypes.default.string.isRequired,
472
+ /** 菜单栏名称 */
473
+ menusTitle: _propTypes.default.string,
474
+ /** 层级,默认 100 */
475
+ zIndex: _propTypes.default.number,
476
+ /** 帮助中心登录失效回调 */
477
+ tokenInvalidCallback: _propTypes.default.func,
478
+ /** 企微唤醒前置判断 */
479
+ checkBeforeCallWechat: _propTypes.default.func,
480
+ /** 最外层样式 */
481
+ iconWrapperClassName: _propTypes.default.string,
482
+ /** icon 样式 */
483
+ iconClassName: _propTypes.default.string,
484
+ /** 文字样式 */
485
+ textClassName: _propTypes.default.string,
486
+ /** 加载中的 spin 大小 -- 2.3.0 后废弃 */
487
+ spinSize: _propTypes.default.number,
488
+ /** 位置,right */
489
+ right: _propTypes.default.number,
490
+ /** 位置,bottom */
491
+ bottom: _propTypes.default.number,
492
+ /** 自定义 icon */
493
+ renderIcon: _propTypes.default.oneOfType([_propTypes.default.element, _propTypes.default.func]),
494
+ /** 是否可移动 */
495
+ draggable: _propTypes.default.bool,
496
+ /** 是否显示过期提示 */
497
+ expireTipUse: _propTypes.default.bool,
498
+ /** 是否使用 chatgpt */
499
+ chatgptUse: _propTypes.default.bool,
500
+ /** 分组 id 列表 */
501
+ nodeIdList: _propTypes.default.arrayOf(_propTypes.default.string),
502
+ /** 是否登录 */
503
+ isLogin: _propTypes.default.bool,
504
+ /** 多语言翻译函数 */
505
+ t: _propTypes.default.func,
506
+ /** 多语言 */
507
+ lang: _propTypes.default.string
508
+ };
509
+ SystemRobotAssistant.hfcIsLogin = _hfcSpace.getHfcToken;
510
+
511
+ // 暴露到 window, HFC Bot 组件会用到
512
+ window.SystemRobotAssistant = {
513
+ default: SystemRobotAssistant
514
+ };
515
+ var _default = SystemRobotAssistant;
516
+ exports.default = _default;
@@ -0,0 +1,41 @@
1
+ export namespace contentType {
2
+ const OPPOSITION: number;
3
+ const MYSELF: number;
4
+ const TIPS: number;
5
+ const NEEDANSWER: number;
6
+ }
7
+ export namespace TIPS {
8
+ namespace globalCount {
9
+ const content: string;
10
+ const link: string;
11
+ }
12
+ namespace guideCount {
13
+ const content_1: string;
14
+ export { content_1 as content };
15
+ const link_1: string;
16
+ export { link_1 as link };
17
+ }
18
+ namespace problemCount {
19
+ const content_2: string;
20
+ export { content_2 as content };
21
+ const link_2: string;
22
+ export { link_2 as link };
23
+ }
24
+ }
25
+ export const TABS: ({
26
+ label: string;
27
+ value: number;
28
+ icon: string;
29
+ popoverContent?: undefined;
30
+ } | {
31
+ label: string;
32
+ value: number;
33
+ icon?: undefined;
34
+ popoverContent?: undefined;
35
+ } | {
36
+ label: string;
37
+ value: number;
38
+ icon: string;
39
+ popoverContent: string;
40
+ })[];
41
+ //# sourceMappingURL=const.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../../src/js/const.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA0BA;;;;;;;;;;;;;;;KAqBC"}
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.contentType = exports.TIPS = exports.TABS = void 0;
7
+ var contentType = {
8
+ OPPOSITION: 2,
9
+ // 对方的回答
10
+ MYSELF: 1,
11
+ // 自己的问题
12
+
13
+ TIPS: 3,
14
+ // 说明更新了
15
+
16
+ NEEDANSWER: 4 // 需要更新
17
+ };
18
+
19
+ // 不用包t了
20
+ exports.contentType = contentType;
21
+ var TIPS = {
22
+ globalCount: {
23
+ content: 'SHEIN标准与规范',
24
+ link: '/direction'
25
+ },
26
+ guideCount: {
27
+ content: '新手指南',
28
+ link: '/guide'
29
+ },
30
+ problemCount: {
31
+ content: '问题库',
32
+ link: '/question/list'
33
+ }
34
+ };
35
+
36
+ // 不用包t了
37
+ exports.TIPS = TIPS;
38
+ var TABS = [{
39
+ label: '问题库',
40
+ value: 1,
41
+ icon: 'problem-base'
42
+ }, {
43
+ label: '对接人',
44
+ value: 2,
45
+ icon: 'qiyeweixin'
46
+ }, {
47
+ label: '系统报障',
48
+ value: 3
49
+ }, {
50
+ label: '版本计划',
51
+ value: 4,
52
+ icon: 'pc-notice',
53
+ popoverContent: '版本计划展示产研未来两周的上线计划(含今日)'
54
+ }];
55
+ exports.TABS = TABS;
@@ -0,0 +1,9 @@
1
+ export default genRenderPromise;
2
+ /**
3
+ *
4
+ * @param {ReactNode} InnerComponent
5
+ * @param {String} name
6
+ * @returns {Promise}
7
+ */
8
+ declare function genRenderPromise(InnerComponent: ReactNode, name: string, useHistory: any): Promise<any>;
9
+ //# sourceMappingURL=gen-render-promise.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gen-render-promise.d.ts","sourceRoot":"","sources":["../../src/js/gen-render-promise.js"],"names":[],"mappings":";AAGA;;;;;GAKG;AACH,0GAoBC"}