@memori.ai/memori-react 8.45.2 → 8.45.4

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 (543) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/components/Chat/Chat.js +4 -1
  3. package/dist/components/Chat/Chat.js.map +1 -1
  4. package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.d.ts +39 -0
  5. package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.js +66 -0
  6. package/dist/components/ChatHistoryDrawer/ChatResumeDrawer.js.map +1 -0
  7. package/dist/components/DrawerFooter/DrawerFooter.d.ts +12 -0
  8. package/dist/components/DrawerFooter/DrawerFooter.js +10 -0
  9. package/dist/components/DrawerFooter/DrawerFooter.js.map +1 -0
  10. package/dist/components/IconButton/IconButton.d.ts +9 -0
  11. package/dist/components/IconButton/IconButton.js +36 -0
  12. package/dist/components/IconButton/IconButton.js.map +1 -0
  13. package/dist/components/MemoriWidget/MemoriWidget.d.ts +1 -1
  14. package/dist/components/MemoriWidget/MemoriWidget.js +2 -1
  15. package/dist/components/MemoriWidget/MemoriWidget.js.map +1 -1
  16. package/dist/components/MobileSessionPanel/MobileSessionPanel.d.ts +65 -0
  17. package/dist/components/MobileSessionPanel/MobileSessionPanel.js +294 -0
  18. package/dist/components/MobileSessionPanel/MobileSessionPanel.js.map +1 -0
  19. package/dist/components/PositionPopover/PositionPopover.d.ts +22 -0
  20. package/dist/components/PositionPopover/PositionPopover.js +208 -0
  21. package/dist/components/PositionPopover/PositionPopover.js.map +1 -0
  22. package/dist/components/layouts/WebsiteAssistant/WebsiteAssistant.d.ts +4 -0
  23. package/dist/components/layouts/WebsiteAssistant/WebsiteAssistant.js +64 -0
  24. package/dist/components/layouts/WebsiteAssistant/WebsiteAssistant.js.map +1 -0
  25. package/dist/components/layouts/chat.css +27 -4
  26. package/dist/context/widgetSurfaceContext.d.ts +3 -0
  27. package/dist/context/widgetSurfaceContext.js +11 -0
  28. package/dist/context/widgetSurfaceContext.js.map +1 -0
  29. package/dist/helpers/positionPopover.d.ts +2 -0
  30. package/dist/helpers/positionPopover.js +16 -0
  31. package/dist/helpers/positionPopover.js.map +1 -0
  32. package/dist/helpers/tts/muteSpeaker.d.ts +13 -0
  33. package/dist/helpers/tts/muteSpeaker.js +27 -0
  34. package/dist/helpers/tts/muteSpeaker.js.map +1 -0
  35. package/dist/helpers/usePressTooltip.d.ts +13 -0
  36. package/dist/helpers/usePressTooltip.js +24 -0
  37. package/dist/helpers/usePressTooltip.js.map +1 -0
  38. package/dist/icons/FacebookIcon.d.ts +3 -0
  39. package/dist/icons/FacebookIcon.js +6 -0
  40. package/dist/icons/FacebookIcon.js.map +1 -0
  41. package/dist/icons/LinkedinIcon.d.ts +3 -0
  42. package/dist/icons/LinkedinIcon.js +6 -0
  43. package/dist/icons/LinkedinIcon.js.map +1 -0
  44. package/dist/icons/MemoriIcon.d.ts +3 -0
  45. package/dist/icons/MemoriIcon.js +8 -0
  46. package/dist/icons/MemoriIcon.js.map +1 -0
  47. package/dist/icons/TelegramIcon.d.ts +3 -0
  48. package/dist/icons/TelegramIcon.js +6 -0
  49. package/dist/icons/TelegramIcon.js.map +1 -0
  50. package/dist/icons/TwitterIcon.d.ts +3 -0
  51. package/dist/icons/TwitterIcon.js +6 -0
  52. package/dist/icons/TwitterIcon.js.map +1 -0
  53. package/dist/icons/WhatsappIcon.d.ts +3 -0
  54. package/dist/icons/WhatsappIcon.js +6 -0
  55. package/dist/icons/WhatsappIcon.js.map +1 -0
  56. package/dist/icons/artifacts/DocumentIcon.d.ts +3 -0
  57. package/dist/icons/artifacts/DocumentIcon.js +6 -0
  58. package/dist/icons/artifacts/DocumentIcon.js.map +1 -0
  59. package/dist/icons/artifacts/HtmlIcon.d.ts +3 -0
  60. package/dist/icons/artifacts/HtmlIcon.js +6 -0
  61. package/dist/icons/artifacts/HtmlIcon.js.map +1 -0
  62. package/dist/icons/artifacts/JavascriptIcon.d.ts +3 -0
  63. package/dist/icons/artifacts/JavascriptIcon.js +6 -0
  64. package/dist/icons/artifacts/JavascriptIcon.js.map +1 -0
  65. package/dist/icons/artifacts/MarkdownIcon.d.ts +3 -0
  66. package/dist/icons/artifacts/MarkdownIcon.js +6 -0
  67. package/dist/icons/artifacts/MarkdownIcon.js.map +1 -0
  68. package/dist/icons/artifacts/PythonIcon.d.ts +3 -0
  69. package/dist/icons/artifacts/PythonIcon.js +6 -0
  70. package/dist/icons/artifacts/PythonIcon.js.map +1 -0
  71. package/dist/icons/artifacts/SvgIcon.d.ts +3 -0
  72. package/dist/icons/artifacts/SvgIcon.js +6 -0
  73. package/dist/icons/artifacts/SvgIcon.js.map +1 -0
  74. package/dist/icons/artifacts/XmlIcon.d.ts +3 -0
  75. package/dist/icons/artifacts/XmlIcon.js +6 -0
  76. package/dist/icons/artifacts/XmlIcon.js.map +1 -0
  77. package/dist/icons/artifacts/cssIcon.d.ts +3 -0
  78. package/dist/icons/artifacts/cssIcon.js +6 -0
  79. package/dist/icons/artifacts/cssIcon.js.map +1 -0
  80. package/dist/styles.css +1 -2
  81. package/dist/version.d.ts +1 -1
  82. package/dist/version.js +1 -1
  83. package/esm/components/Chat/Chat.js +4 -1
  84. package/esm/components/Chat/Chat.js.map +1 -1
  85. package/esm/components/MemoriWidget/MemoriWidget.d.ts +1 -1
  86. package/esm/components/MemoriWidget/MemoriWidget.js +2 -1
  87. package/esm/components/MemoriWidget/MemoriWidget.js.map +1 -1
  88. package/esm/components/layouts/chat.css +27 -4
  89. package/esm/styles.css +1 -2
  90. package/esm/version.d.ts +1 -1
  91. package/esm/version.js +1 -1
  92. package/package.json +6 -7
  93. package/dist/components/MemoriArtifactSystem/components/ArtifactActions/test/CopyButtonTest.d.ts +0 -3
  94. package/dist/components/MemoriArtifactSystem/components/ArtifactActions/test/CopyButtonTest.js +0 -64
  95. package/dist/components/MemoriArtifactSystem/components/ArtifactActions/test/CopyButtonTest.js.map +0 -1
  96. package/esm/components/MemoriArtifactSystem/components/ArtifactActions/test/CopyButtonTest.d.ts +0 -3
  97. package/esm/components/MemoriArtifactSystem/components/ArtifactActions/test/CopyButtonTest.js +0 -62
  98. package/esm/components/MemoriArtifactSystem/components/ArtifactActions/test/CopyButtonTest.js.map +0 -1
  99. package/src/I18nWrapper.tsx +0 -13
  100. package/src/__snapshots__/index.test.tsx.snap +0 -96
  101. package/src/components/AgeVerificationModal/AgeVerificationModal.css +0 -95
  102. package/src/components/AgeVerificationModal/AgeVerificationModal.stories.tsx +0 -46
  103. package/src/components/AgeVerificationModal/AgeVerificationModal.test.tsx +0 -33
  104. package/src/components/AgeVerificationModal/AgeVerificationModal.tsx +0 -99
  105. package/src/components/AgeVerificationModal/__snapshots__/AgeVerificationModal.test.tsx.snap +0 -19
  106. package/src/components/Auth/Auth.css +0 -57
  107. package/src/components/Auth/Auth.stories.tsx +0 -90
  108. package/src/components/Auth/Auth.test.tsx +0 -63
  109. package/src/components/Auth/Auth.tsx +0 -201
  110. package/src/components/Auth/__snapshots__/Auth.test.tsx.snap +0 -143
  111. package/src/components/Avatar/Avatar.css +0 -151
  112. package/src/components/Avatar/Avatar.stories.tsx +0 -160
  113. package/src/components/Avatar/Avatar.test.tsx +0 -158
  114. package/src/components/Avatar/Avatar.tsx +0 -245
  115. package/src/components/Avatar/AvatarView/AvatarComponent/Shadow/DynamicShadow.tsx +0 -103
  116. package/src/components/Avatar/AvatarView/AvatarComponent/avatarComponent.tsx +0 -105
  117. package/src/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/fullbodyAvatar.tsx +0 -338
  118. package/src/components/Avatar/AvatarView/AvatarComponent/components/FullbodyAvatar/types.ts +0 -44
  119. package/src/components/Avatar/AvatarView/AvatarComponent/components/controllers/AvatarAnimator.ts +0 -1091
  120. package/src/components/Avatar/AvatarView/AvatarComponent/components/controllers/AvatarPositionController.ts +0 -83
  121. package/src/components/Avatar/AvatarView/AvatarComponent/components/controllers/MorphTargetController.ts +0 -301
  122. package/src/components/Avatar/AvatarView/AvatarComponent/components/controls.tsx +0 -100
  123. package/src/components/Avatar/AvatarView/AvatarComponent/components/halfbodyAvatar.tsx +0 -152
  124. package/src/components/Avatar/AvatarView/AvatarComponent/components/loader.tsx +0 -31
  125. package/src/components/Avatar/AvatarView/AvatarComponent/constants.ts +0 -141
  126. package/src/components/Avatar/AvatarView/AvatarComponent/lights/Lights.tsx +0 -145
  127. package/src/components/Avatar/AvatarView/AvatarComponent/positionControls/positionControls.css +0 -111
  128. package/src/components/Avatar/AvatarView/AvatarComponent/positionControls/positionControls.tsx +0 -201
  129. package/src/components/Avatar/AvatarView/AvatarView.stories.tsx +0 -254
  130. package/src/components/Avatar/AvatarView/index.tsx +0 -194
  131. package/src/components/Avatar/AvatarView/utils/hideHands.ts +0 -11
  132. package/src/components/Avatar/AvatarView/utils/useEyeBlink.ts +0 -100
  133. package/src/components/Avatar/AvatarView/utils/useHeadMovement.ts +0 -72
  134. package/src/components/Avatar/AvatarView/utils/useLoadingMorphAnim.ts +0 -38
  135. package/src/components/Avatar/AvatarView/utils/useMouthAnimation.ts +0 -93
  136. package/src/components/Avatar/AvatarView/utils/useSmile.ts +0 -39
  137. package/src/components/Avatar/AvatarView/utils/utils.ts +0 -55
  138. package/src/components/Avatar/__snapshots__/Avatar.test.tsx.snap +0 -246
  139. package/src/components/Blob/Blob.css +0 -286
  140. package/src/components/Blob/Blob.stories.tsx +0 -53
  141. package/src/components/Blob/Blob.test.tsx +0 -18
  142. package/src/components/Blob/Blob.tsx +0 -26
  143. package/src/components/Blob/__snapshots__/Blob.test.tsx.snap +0 -80
  144. package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.css +0 -40
  145. package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.stories.tsx +0 -58
  146. package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.test.tsx +0 -53
  147. package/src/components/BlockedMemoriBadge/BlockedMemoriBadge.tsx +0 -74
  148. package/src/components/BlockedMemoriBadge/__snapshots__/BlockedMemoriBadge.test.tsx.snap +0 -181
  149. package/src/components/ChangeMode/ChangeMode.css +0 -22
  150. package/src/components/ChangeMode/ChangeMode.stories.tsx +0 -50
  151. package/src/components/ChangeMode/ChangeMode.test.tsx +0 -24
  152. package/src/components/ChangeMode/ChangeMode.tsx +0 -51
  153. package/src/components/ChangeMode/__snapshots__/ChangeMode.test.tsx.snap +0 -107
  154. package/src/components/Chat/Chat.css +0 -285
  155. package/src/components/Chat/Chat.stories.tsx +0 -1684
  156. package/src/components/Chat/Chat.test.tsx +0 -372
  157. package/src/components/Chat/Chat.tsx +0 -778
  158. package/src/components/Chat/__snapshots__/Chat.test.tsx.snap +0 -6816
  159. package/src/components/ChatBubble/ChatBubble.css +0 -430
  160. package/src/components/ChatBubble/ChatBubble.stories.tsx +0 -1192
  161. package/src/components/ChatBubble/ChatBubble.test.tsx +0 -481
  162. package/src/components/ChatBubble/ChatBubble.tsx +0 -776
  163. package/src/components/ChatBubble/__snapshots__/ChatBubble.test.tsx.snap +0 -8734
  164. package/src/components/ChatHistoryDrawer/ChatHistory.css +0 -587
  165. package/src/components/ChatHistoryDrawer/ChatHistory.stories.tsx +0 -410
  166. package/src/components/ChatHistoryDrawer/ChatHistory.test.tsx +0 -107
  167. package/src/components/ChatHistoryDrawer/ChatHistory.tsx +0 -1298
  168. package/src/components/ChatHistoryDrawer/__snapshots__/ChatHistory.test.tsx.snap +0 -27
  169. package/src/components/ChatInputs/ChatInputs.css +0 -340
  170. package/src/components/ChatInputs/ChatInputs.stories.tsx +0 -251
  171. package/src/components/ChatInputs/ChatInputs.tsx +0 -487
  172. package/src/components/ChatTextArea/ChatTextArea.css +0 -185
  173. package/src/components/ChatTextArea/ChatTextArea.stories.tsx +0 -55
  174. package/src/components/ChatTextArea/ChatTextArea.test.tsx +0 -28
  175. package/src/components/ChatTextArea/ChatTextArea.tsx +0 -171
  176. package/src/components/ChatTextArea/__snapshots__/ChatTextArea.test.tsx.snap +0 -68
  177. package/src/components/CompletionProviderStatus/CompletionProviderStatus.css +0 -36
  178. package/src/components/CompletionProviderStatus/CompletionProviderStatus.stories.tsx +0 -296
  179. package/src/components/CompletionProviderStatus/CompletionProviderStatus.test.tsx +0 -31
  180. package/src/components/CompletionProviderStatus/CompletionProviderStatus.tsx +0 -232
  181. package/src/components/CompletionProviderStatus/__snapshots__/CompletionProviderStatus.test.tsx.snap +0 -96
  182. package/src/components/ContentPreviewModal/ContentPreviewModal.css +0 -128
  183. package/src/components/ContentPreviewModal/ContentPreviewModal.tsx +0 -67
  184. package/src/components/ContentPreviewModal/index.ts +0 -2
  185. package/src/components/CustomGLBModelViewer/ModelViewer.css +0 -11
  186. package/src/components/CustomGLBModelViewer/ModelViewer.stories.tsx +0 -58
  187. package/src/components/CustomGLBModelViewer/ModelViewer.test.tsx +0 -13
  188. package/src/components/CustomGLBModelViewer/ModelViewer.tsx +0 -37
  189. package/src/components/CustomGLBModelViewer/__snapshots__/ModelViewer.test.tsx.snap +0 -20
  190. package/src/components/DateSelector/DateSelector.css +0 -158
  191. package/src/components/DateSelector/DateSelector.stories.tsx +0 -47
  192. package/src/components/DateSelector/DateSelector.test.tsx +0 -149
  193. package/src/components/DateSelector/DateSelector.tsx +0 -251
  194. package/src/components/DateSelector/__snapshots__/DateSelector.test.tsx.snap +0 -1954
  195. package/src/components/ErrorBoundary/ErrorBoundary.tsx +0 -54
  196. package/src/components/ExpertsDrawer/ExpertsDrawer.css +0 -67
  197. package/src/components/ExpertsDrawer/ExpertsDrawer.stories.tsx +0 -54
  198. package/src/components/ExpertsDrawer/ExpertsDrawer.test.tsx +0 -53
  199. package/src/components/ExpertsDrawer/ExpertsDrawer.tsx +0 -69
  200. package/src/components/ExpertsDrawer/__snapshots__/ExpertsDrawer.test.tsx.snap +0 -11
  201. package/src/components/ExportHistoryButton/ExportHistoryButton.css +0 -22
  202. package/src/components/FeedbackButtons/FeedbackButtons.css +0 -107
  203. package/src/components/FeedbackButtons/FeedbackButtons.stories.tsx +0 -52
  204. package/src/components/FeedbackButtons/FeedbackButtons.test.tsx +0 -11
  205. package/src/components/FeedbackButtons/FeedbackButtons.tsx +0 -152
  206. package/src/components/FeedbackButtons/__snapshots__/FeedbackButtons.test.tsx.snap +0 -42
  207. package/src/components/FilePreview/FilePreview.css +0 -358
  208. package/src/components/FilePreview/FilePreview.stories.tsx +0 -63
  209. package/src/components/FilePreview/FilePreview.test.tsx +0 -26
  210. package/src/components/FilePreview/FilePreview.tsx +0 -277
  211. package/src/components/FilePreview/__snapshots__/FilePreview.test.tsx.snap +0 -185
  212. package/src/components/Header/ChatConsumptionDropdown.test.tsx +0 -117
  213. package/src/components/Header/ChatConsumptionDropdown.tsx +0 -275
  214. package/src/components/Header/Header.css +0 -282
  215. package/src/components/Header/Header.stories.tsx +0 -338
  216. package/src/components/Header/Header.test.tsx +0 -371
  217. package/src/components/Header/Header.tsx +0 -442
  218. package/src/components/Header/__snapshots__/Header.test.tsx.snap +0 -964
  219. package/src/components/KnownFacts/KnownFacts.css +0 -19
  220. package/src/components/KnownFacts/KnownFacts.stories.tsx +0 -80
  221. package/src/components/KnownFacts/KnownFacts.test.tsx +0 -57
  222. package/src/components/KnownFacts/KnownFacts.tsx +0 -376
  223. package/src/components/KnownFacts/__snapshots__/KnownFacts.test.tsx.snap +0 -19
  224. package/src/components/LoginDrawer/LoginDrawer.css +0 -1616
  225. package/src/components/LoginDrawer/LoginDrawer.stories.tsx +0 -102
  226. package/src/components/LoginDrawer/LoginDrawer.test.tsx +0 -199
  227. package/src/components/LoginDrawer/LoginDrawer.tsx +0 -600
  228. package/src/components/LoginDrawer/__snapshots__/LoginDrawer.test.tsx.snap +0 -91
  229. package/src/components/MediaWidget/DocumentCard.test.tsx +0 -45
  230. package/src/components/MediaWidget/DocumentCard.tsx +0 -19
  231. package/src/components/MediaWidget/MediaItemWidget.css +0 -1398
  232. package/src/components/MediaWidget/MediaItemWidget.stories.tsx +0 -423
  233. package/src/components/MediaWidget/MediaItemWidget.test.tsx +0 -248
  234. package/src/components/MediaWidget/MediaItemWidget.tsx +0 -997
  235. package/src/components/MediaWidget/MediaItemWidget.types.ts +0 -65
  236. package/src/components/MediaWidget/MediaItemWidget.utils.test.ts +0 -367
  237. package/src/components/MediaWidget/MediaItemWidget.utils.ts +0 -227
  238. package/src/components/MediaWidget/MediaPreviewModal.test.tsx +0 -271
  239. package/src/components/MediaWidget/MediaPreviewModal.tsx +0 -425
  240. package/src/components/MediaWidget/MediaWidget.css +0 -131
  241. package/src/components/MediaWidget/MediaWidget.stories.tsx +0 -319
  242. package/src/components/MediaWidget/MediaWidget.test.tsx +0 -41
  243. package/src/components/MediaWidget/MediaWidget.tsx +0 -107
  244. package/src/components/MediaWidget/__snapshots__/DocumentCard.test.tsx.snap +0 -24
  245. package/src/components/MediaWidget/__snapshots__/MediaItemWidget.test.tsx.snap +0 -791
  246. package/src/components/MediaWidget/__snapshots__/MediaWidget.test.tsx.snap +0 -154
  247. package/src/components/MemoriArtifactSystem/ArtifactDrawer.stories.tsx +0 -2299
  248. package/src/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.css +0 -163
  249. package/src/components/MemoriArtifactSystem/components/ArtifactActions/ArtifactActions.tsx +0 -250
  250. package/src/components/MemoriArtifactSystem/components/ArtifactActions/CopyButton.stories.tsx +0 -30
  251. package/src/components/MemoriArtifactSystem/components/ArtifactActions/components/CopyButtonWithDropdown.tsx +0 -467
  252. package/src/components/MemoriArtifactSystem/components/ArtifactActions/components/CopyMenuItem.tsx +0 -89
  253. package/src/components/MemoriArtifactSystem/components/ArtifactActions/hooks/useCopyArtifact.ts +0 -619
  254. package/src/components/MemoriArtifactSystem/components/ArtifactActions/index.ts +0 -9
  255. package/src/components/MemoriArtifactSystem/components/ArtifactActions/styles.css +0 -489
  256. package/src/components/MemoriArtifactSystem/components/ArtifactActions/test/CopyButtonTest.tsx +0 -90
  257. package/src/components/MemoriArtifactSystem/components/ArtifactActions/types.ts +0 -73
  258. package/src/components/MemoriArtifactSystem/components/ArtifactActions/utils/PDFExporter.ts +0 -454
  259. package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.css +0 -1059
  260. package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/ArtifactDrawer.tsx +0 -431
  261. package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/components/TabSwitch.css +0 -150
  262. package/src/components/MemoriArtifactSystem/components/ArtifactDrawer/components/TabSwitch.tsx +0 -79
  263. package/src/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.css +0 -253
  264. package/src/components/MemoriArtifactSystem/components/ArtifactHandler/ArtifactHandler.tsx +0 -561
  265. package/src/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.css +0 -355
  266. package/src/components/MemoriArtifactSystem/components/ArtifactPreview/ArtifactPreview.tsx +0 -160
  267. package/src/components/MemoriArtifactSystem/context/ArtifactContext.tsx +0 -167
  268. package/src/components/MemoriArtifactSystem/types/artifact.types.ts +0 -35
  269. package/src/components/MemoriArtifactSystem/utils/ArtifactAPI.test.tsx +0 -308
  270. package/src/components/MemoriArtifactSystem/utils/ArtifactAPI.tsx +0 -379
  271. package/src/components/MemoriArtifactSystem/utils/applyEdits.test.ts +0 -85
  272. package/src/components/MemoriArtifactSystem/utils/applyEdits.ts +0 -173
  273. package/src/components/MemoriWidget/MemoriWidget.css +0 -220
  274. package/src/components/MemoriWidget/MemoriWidget.stories.tsx +0 -274
  275. package/src/components/MemoriWidget/MemoriWidget.tsx +0 -3930
  276. package/src/components/MicrophoneButton/MicrophoneButton.css +0 -142
  277. package/src/components/MicrophoneButton/MicrophoneButton.stories.tsx +0 -52
  278. package/src/components/MicrophoneButton/MicrophoneButton.tsx +0 -128
  279. package/src/components/PositionDrawer/PositionDrawer.stories.tsx +0 -51
  280. package/src/components/PositionDrawer/PositionDrawer.test.tsx +0 -39
  281. package/src/components/PositionDrawer/PositionDrawer.tsx +0 -50
  282. package/src/components/PositionDrawer/__snapshots__/PositionDrawer.test.tsx.snap +0 -17
  283. package/src/components/PoweredBy/PoweredBy.css +0 -47
  284. package/src/components/PoweredBy/PoweredBy.stories.tsx +0 -75
  285. package/src/components/PoweredBy/PoweredBy.test.tsx +0 -15
  286. package/src/components/PoweredBy/PoweredBy.tsx +0 -44
  287. package/src/components/PoweredBy/__snapshots__/PoweredBy.test.tsx.snap +0 -55
  288. package/src/components/SendOnEnterMenu/SendOnEnterMenu.css +0 -47
  289. package/src/components/SendOnEnterMenu/SendOnEnterMenu.stories.tsx +0 -58
  290. package/src/components/SendOnEnterMenu/SendOnEnterMenu.test.tsx +0 -17
  291. package/src/components/SendOnEnterMenu/SendOnEnterMenu.tsx +0 -82
  292. package/src/components/SendOnEnterMenu/__snapshots__/SendOnEnterMenu.test.tsx.snap +0 -57
  293. package/src/components/SettingsDrawer/SettingsDrawer.css +0 -24
  294. package/src/components/SettingsDrawer/SettingsDrawer.stories.tsx +0 -94
  295. package/src/components/SettingsDrawer/SettingsDrawer.test.tsx +0 -202
  296. package/src/components/SettingsDrawer/SettingsDrawer.tsx +0 -255
  297. package/src/components/SettingsDrawer/__snapshots__/SettingsDrawer.test.tsx.snap +0 -59
  298. package/src/components/ShareButton/ShareButton.css +0 -73
  299. package/src/components/ShareButton/ShareButton.stories.tsx +0 -98
  300. package/src/components/ShareButton/ShareButton.test.tsx +0 -53
  301. package/src/components/ShareButton/ShareButton.tsx +0 -395
  302. package/src/components/ShareButton/__snapshots__/ShareButton.test.tsx.snap +0 -316
  303. package/src/components/Snippet/Snippet.css +0 -142
  304. package/src/components/Snippet/Snippet.stories.tsx +0 -286
  305. package/src/components/Snippet/Snippet.test.tsx +0 -176
  306. package/src/components/Snippet/Snippet.tsx +0 -148
  307. package/src/components/Snippet/__snapshots__/Snippet.test.tsx.snap +0 -603
  308. package/src/components/StartPanel/StartPanel.css +0 -273
  309. package/src/components/StartPanel/StartPanel.stories.tsx +0 -404
  310. package/src/components/StartPanel/StartPanel.test.tsx +0 -360
  311. package/src/components/StartPanel/StartPanel.tsx +0 -426
  312. package/src/components/StartPanel/__snapshots__/StartPanel.test.tsx.snap +0 -1986
  313. package/src/components/Typing/Typing.stories.tsx +0 -130
  314. package/src/components/Typing/Typing.test.tsx +0 -62
  315. package/src/components/Typing/Typing.tsx +0 -154
  316. package/src/components/Typing/__snapshots__/Typing.test.tsx.snap +0 -133
  317. package/src/components/UploadButton/UploadButton.css +0 -542
  318. package/src/components/UploadButton/UploadButton.stories.tsx +0 -376
  319. package/src/components/UploadButton/UploadButton.test.tsx +0 -11
  320. package/src/components/UploadButton/UploadButton.tsx +0 -688
  321. package/src/components/UploadButton/UploadDocuments/UploadDocuments.tsx +0 -421
  322. package/src/components/UploadButton/UploadImages/UploadImages.tsx +0 -538
  323. package/src/components/UploadButton/__snapshots__/UploadButton.test.tsx.snap +0 -165
  324. package/src/components/VenueWidget/VenueWidget.css +0 -163
  325. package/src/components/VenueWidget/VenueWidget.stories.tsx +0 -66
  326. package/src/components/VenueWidget/VenueWidget.test.tsx +0 -49
  327. package/src/components/VenueWidget/VenueWidget.tsx +0 -458
  328. package/src/components/VenueWidget/__snapshots__/VenueWidget.test.tsx.snap +0 -370
  329. package/src/components/WhyThisAnswer/WhyThisAnswer.css +0 -171
  330. package/src/components/WhyThisAnswer/WhyThisAnswer.stories.tsx +0 -285
  331. package/src/components/WhyThisAnswer/WhyThisAnswer.test.tsx +0 -245
  332. package/src/components/WhyThisAnswer/WhyThisAnswer.tsx +0 -233
  333. package/src/components/WhyThisAnswer/__snapshots__/WhyThisAnswer.test.tsx.snap +0 -27
  334. package/src/components/icons/AI.tsx +0 -34
  335. package/src/components/icons/Alert.tsx +0 -31
  336. package/src/components/icons/ArrowUp.tsx +0 -28
  337. package/src/components/icons/Bug.tsx +0 -81
  338. package/src/components/icons/Chat.tsx +0 -30
  339. package/src/components/icons/ChevronDown.tsx +0 -26
  340. package/src/components/icons/ChevronLeft.tsx +0 -28
  341. package/src/components/icons/ChevronRight.tsx +0 -28
  342. package/src/components/icons/ChevronUp.tsx +0 -24
  343. package/src/components/icons/Clear.tsx +0 -23
  344. package/src/components/icons/Close.tsx +0 -30
  345. package/src/components/icons/Code.tsx +0 -24
  346. package/src/components/icons/Copy.tsx +0 -23
  347. package/src/components/icons/DeepThought.tsx +0 -38
  348. package/src/components/icons/Delete.tsx +0 -23
  349. package/src/components/icons/Document.tsx +0 -50
  350. package/src/components/icons/Download.tsx +0 -23
  351. package/src/components/icons/Edit.tsx +0 -17
  352. package/src/components/icons/Expand.tsx +0 -23
  353. package/src/components/icons/Eye.tsx +0 -17
  354. package/src/components/icons/EyeInvisible.tsx +0 -24
  355. package/src/components/icons/Facebook.tsx +0 -23
  356. package/src/components/icons/Feedback.tsx +0 -24
  357. package/src/components/icons/File.tsx +0 -17
  358. package/src/components/icons/FileExcel.tsx +0 -23
  359. package/src/components/icons/FilePdf.tsx +0 -23
  360. package/src/components/icons/FileWord.tsx +0 -23
  361. package/src/components/icons/Fullscreen.tsx +0 -23
  362. package/src/components/icons/FullscreenExit.tsx +0 -23
  363. package/src/components/icons/GasStation.tsx +0 -36
  364. package/src/components/icons/Group.tsx +0 -30
  365. package/src/components/icons/History.tsx +0 -33
  366. package/src/components/icons/Image.tsx +0 -37
  367. package/src/components/icons/Info.tsx +0 -31
  368. package/src/components/icons/Link.tsx +0 -17
  369. package/src/components/icons/Linkedin.tsx +0 -23
  370. package/src/components/icons/Loading.tsx +0 -28
  371. package/src/components/icons/Logout.tsx +0 -27
  372. package/src/components/icons/Mail.tsx +0 -17
  373. package/src/components/icons/MapMarker.tsx +0 -26
  374. package/src/components/icons/MenuHorizontal.tsx +0 -29
  375. package/src/components/icons/MenuVertical.tsx +0 -29
  376. package/src/components/icons/Message.tsx +0 -23
  377. package/src/components/icons/Microphone.tsx +0 -23
  378. package/src/components/icons/Minus.tsx +0 -23
  379. package/src/components/icons/MinusCircle.tsx +0 -24
  380. package/src/components/icons/PaperClip.tsx +0 -23
  381. package/src/components/icons/Picture.tsx +0 -23
  382. package/src/components/icons/Plus.tsx +0 -18
  383. package/src/components/icons/Preview.tsx +0 -29
  384. package/src/components/icons/Print.tsx +0 -38
  385. package/src/components/icons/QuestionHelp.tsx +0 -30
  386. package/src/components/icons/Refresh.tsx +0 -30
  387. package/src/components/icons/SelectIcon.tsx +0 -28
  388. package/src/components/icons/Send.tsx +0 -17
  389. package/src/components/icons/Setting.tsx +0 -23
  390. package/src/components/icons/Share.tsx +0 -23
  391. package/src/components/icons/Sound.tsx +0 -23
  392. package/src/components/icons/SoundDeactivated.tsx +0 -27
  393. package/src/components/icons/Telegram.tsx +0 -26
  394. package/src/components/icons/ThumbDown.tsx +0 -29
  395. package/src/components/icons/ThumbUp.tsx +0 -29
  396. package/src/components/icons/Translation.tsx +0 -24
  397. package/src/components/icons/Twitter.tsx +0 -23
  398. package/src/components/icons/Upload.tsx +0 -34
  399. package/src/components/icons/User.tsx +0 -17
  400. package/src/components/icons/Warning.tsx +0 -24
  401. package/src/components/icons/WhatsApp.tsx +0 -24
  402. package/src/components/icons/icons.stories.css +0 -5
  403. package/src/components/icons/icons.stories.tsx +0 -81
  404. package/src/components/icons/loading.css +0 -14
  405. package/src/components/layouts/Chat.test.tsx +0 -40
  406. package/src/components/layouts/Chat.tsx +0 -69
  407. package/src/components/layouts/FullBody/FullBody.stories.tsx +0 -110
  408. package/src/components/layouts/FullPage.test.tsx +0 -65
  409. package/src/components/layouts/FullPage.tsx +0 -80
  410. package/src/components/layouts/HiddenChat.test.tsx +0 -40
  411. package/src/components/layouts/HiddenChat.tsx +0 -233
  412. package/src/components/layouts/Totem/Totem.stories.tsx +0 -131
  413. package/src/components/layouts/Totem.test.tsx +0 -40
  414. package/src/components/layouts/Totem.tsx +0 -49
  415. package/src/components/layouts/WebsiteAssistant.test.tsx +0 -40
  416. package/src/components/layouts/WebsiteAssistant.tsx +0 -132
  417. package/src/components/layouts/ZoomedFullBody/ZoomedFullBody.stories.tsx +0 -131
  418. package/src/components/layouts/ZoomedFullBody.test.tsx +0 -40
  419. package/src/components/layouts/ZoomedFullBody.tsx +0 -81
  420. package/src/components/layouts/__snapshots__/Chat.test.tsx.snap +0 -457
  421. package/src/components/layouts/__snapshots__/FullPage.test.tsx.snap +0 -1045
  422. package/src/components/layouts/__snapshots__/HiddenChat.test.tsx.snap +0 -460
  423. package/src/components/layouts/__snapshots__/Totem.test.tsx.snap +0 -566
  424. package/src/components/layouts/__snapshots__/WebsiteAssistant.test.tsx.snap +0 -59
  425. package/src/components/layouts/__snapshots__/ZoomedFullBody.test.tsx.snap +0 -523
  426. package/src/components/layouts/chat.css +0 -451
  427. package/src/components/layouts/hidden-chat.css +0 -276
  428. package/src/components/layouts/layouts.stories.tsx +0 -231
  429. package/src/components/layouts/totem.css +0 -221
  430. package/src/components/layouts/website-assistant.css +0 -677
  431. package/src/components/layouts/zoomed-full-body.css +0 -18
  432. package/src/components/ui/Alert.css +0 -93
  433. package/src/components/ui/Alert.stories.tsx +0 -137
  434. package/src/components/ui/Alert.test.tsx +0 -129
  435. package/src/components/ui/Alert.tsx +0 -123
  436. package/src/components/ui/Button.css +0 -167
  437. package/src/components/ui/Button.stories.tsx +0 -156
  438. package/src/components/ui/Button.test.tsx +0 -74
  439. package/src/components/ui/Button.tsx +0 -107
  440. package/src/components/ui/Card.css +0 -65
  441. package/src/components/ui/Card.stories.tsx +0 -95
  442. package/src/components/ui/Card.test.tsx +0 -47
  443. package/src/components/ui/Card.tsx +0 -48
  444. package/src/components/ui/Checkbox.css +0 -116
  445. package/src/components/ui/Checkbox.stories.tsx +0 -74
  446. package/src/components/ui/Checkbox.test.tsx +0 -28
  447. package/src/components/ui/Checkbox.tsx +0 -58
  448. package/src/components/ui/ConfirmDialog.css +0 -42
  449. package/src/components/ui/ConfirmDialog.stories.tsx +0 -216
  450. package/src/components/ui/ConfirmDialog.test.tsx +0 -124
  451. package/src/components/ui/ConfirmDialog.tsx +0 -58
  452. package/src/components/ui/Details.css +0 -66
  453. package/src/components/ui/Drawer.css +0 -270
  454. package/src/components/ui/Drawer.stories.tsx +0 -267
  455. package/src/components/ui/Drawer.test.tsx +0 -130
  456. package/src/components/ui/Drawer.tsx +0 -293
  457. package/src/components/ui/Dropdown.css +0 -173
  458. package/src/components/ui/Dropdown.tsx +0 -63
  459. package/src/components/ui/Expandable.css +0 -15
  460. package/src/components/ui/Expandable.stories.tsx +0 -180
  461. package/src/components/ui/Expandable.test.tsx +0 -107
  462. package/src/components/ui/Expandable.tsx +0 -121
  463. package/src/components/ui/Modal.css +0 -98
  464. package/src/components/ui/Modal.stories.tsx +0 -171
  465. package/src/components/ui/Modal.test.tsx +0 -111
  466. package/src/components/ui/Modal.tsx +0 -117
  467. package/src/components/ui/Select.css +0 -138
  468. package/src/components/ui/Select.stories.tsx +0 -79
  469. package/src/components/ui/Select.test.tsx +0 -84
  470. package/src/components/ui/Select.tsx +0 -79
  471. package/src/components/ui/Slider.css +0 -192
  472. package/src/components/ui/Slider.stories.tsx +0 -63
  473. package/src/components/ui/Slider.tsx +0 -142
  474. package/src/components/ui/Spin.css +0 -31
  475. package/src/components/ui/Spin.stories.tsx +0 -64
  476. package/src/components/ui/Spin.test.tsx +0 -41
  477. package/src/components/ui/Spin.tsx +0 -31
  478. package/src/components/ui/Table.css +0 -132
  479. package/src/components/ui/Tooltip.css +0 -171
  480. package/src/components/ui/Tooltip.stories.tsx +0 -109
  481. package/src/components/ui/Tooltip.test.tsx +0 -102
  482. package/src/components/ui/Tooltip.tsx +0 -163
  483. package/src/components/ui/__snapshots__/Alert.test.tsx.snap +0 -59
  484. package/src/components/ui/__snapshots__/Button.test.tsx.snap +0 -204
  485. package/src/components/ui/__snapshots__/Card.test.tsx.snap +0 -321
  486. package/src/components/ui/__snapshots__/Checkbox.test.tsx.snap +0 -131
  487. package/src/components/ui/__snapshots__/ConfirmDialog.test.tsx.snap +0 -35
  488. package/src/components/ui/__snapshots__/Drawer.test.tsx.snap +0 -67
  489. package/src/components/ui/__snapshots__/Expandable.test.tsx.snap +0 -159
  490. package/src/components/ui/__snapshots__/Modal.test.tsx.snap +0 -59
  491. package/src/components/ui/__snapshots__/Select.test.tsx.snap +0 -254
  492. package/src/components/ui/__snapshots__/Spin.test.tsx.snap +0 -193
  493. package/src/components/ui/__snapshots__/Tooltip.test.tsx.snap +0 -113
  494. package/src/components/ui/definitions.stories.tsx +0 -139
  495. package/src/context/visemeContext.tsx +0 -384
  496. package/src/helpers/chatPdfExport.ts +0 -544
  497. package/src/helpers/configuration.ts +0 -42
  498. package/src/helpers/constants.ts +0 -268
  499. package/src/helpers/convertDocument.test.ts +0 -67
  500. package/src/helpers/convertDocument.ts +0 -35
  501. package/src/helpers/credits.ts +0 -54
  502. package/src/helpers/error.test.ts +0 -29
  503. package/src/helpers/error.ts +0 -278
  504. package/src/helpers/imageCompression.ts +0 -230
  505. package/src/helpers/llmUsage.ts +0 -328
  506. package/src/helpers/markedExtendedTables.js +0 -217
  507. package/src/helpers/media.test.ts +0 -169
  508. package/src/helpers/media.ts +0 -81
  509. package/src/helpers/message.test.ts +0 -126
  510. package/src/helpers/message.ts +0 -219
  511. package/src/helpers/nats/getNatsConfig.ts +0 -148
  512. package/src/helpers/nats/isSessionExpiredError.test.ts +0 -38
  513. package/src/helpers/nats/isSessionExpiredError.ts +0 -51
  514. package/src/helpers/nats/useNats.test.tsx +0 -81
  515. package/src/helpers/nats/useNats.ts +0 -204
  516. package/src/helpers/nats/useNatsSession.test.ts +0 -16
  517. package/src/helpers/nats/useNatsSession.ts +0 -460
  518. package/src/helpers/piiDetection.test.ts +0 -186
  519. package/src/helpers/piiDetection.ts +0 -91
  520. package/src/helpers/sanitizer.ts +0 -17
  521. package/src/helpers/statistics.ts +0 -58
  522. package/src/helpers/stt/useSTT.ts +0 -515
  523. package/src/helpers/translations.ts +0 -39
  524. package/src/helpers/tts/ttsVoiceUtility.ts +0 -275
  525. package/src/helpers/tts/useTTS.ts +0 -621
  526. package/src/helpers/utils.test.ts +0 -331
  527. package/src/helpers/utils.ts +0 -591
  528. package/src/helpers/venue.ts +0 -36
  529. package/src/i18n.ts +0 -39
  530. package/src/index.stories.tsx +0 -220
  531. package/src/index.test.tsx +0 -156
  532. package/src/index.tsx +0 -592
  533. package/src/locales/de.json +0 -680
  534. package/src/locales/en.json +0 -754
  535. package/src/locales/es.json +0 -682
  536. package/src/locales/fr.json +0 -682
  537. package/src/locales/it.json +0 -750
  538. package/src/mocks/data.ts +0 -790
  539. package/src/styles.css +0 -126
  540. package/src/types/integration.test.ts +0 -32
  541. package/src/types/integration.ts +0 -31
  542. package/src/types/layout.ts +0 -50
  543. package/src/version.ts +0 -2
@@ -1,331 +0,0 @@
1
- import {
2
- difference,
3
- stripEmojis,
4
- stripHTML,
5
- stripMarkdown,
6
- stripOutputTags,
7
- escapeHTML,
8
- extractAttachmentLinks,
9
- extractAttachmentLink,
10
- isAssetOnlyDocumentAttachment,
11
- isLocalTextFilename,
12
- isOfficeNativeFilename,
13
- parseDocumentAttachmentsFromMessage,
14
- } from './utils';
15
-
16
- describe('Utils/difference', () => {
17
- it('should return the difference between two objects with numeric values', () => {
18
- const obj1 = { a: 1, b: 2, c: 3 };
19
- const obj2 = { a: 1, b: 2, c: 4 };
20
- const result = difference(obj1, obj2);
21
- expect(result).toEqual({ c: 4 });
22
- });
23
-
24
- it('should return the difference between two objects with new properties and strings', () => {
25
- const obj1 = { a: 1, c: '' };
26
- const obj2 = { a: 1, b: '', c: 'ciao' };
27
- const result = difference(obj1, obj2);
28
- expect(result).toEqual({ b: '', c: 'ciao' });
29
- });
30
-
31
- it('should return the difference between two objects from null or undefined', () => {
32
- const obj1 = { a: 1, c: null };
33
- const obj2 = { a: 1, b: '', c: 'ciao' };
34
- const result = difference(obj1, obj2);
35
- expect(result).toEqual({ b: '', c: 'ciao' });
36
- });
37
-
38
- it('should return the difference between two objects with lists', () => {
39
- const obj1 = { a: [], b: 'thesame' };
40
- const obj2 = { a: ['alpha', 'beta', 'gamma'], b: 'thesame' };
41
- const result = difference(obj1, obj2);
42
- expect(result).toEqual({ a: ['alpha', 'beta', 'gamma'] });
43
- });
44
- });
45
-
46
- describe('utils/stripEmojis', () => {
47
- it('should strip emojis from a string', () => {
48
- const text = 'Hello 👋🏻';
49
- const result = stripEmojis(text);
50
- expect(result).toEqual('Hello');
51
- });
52
-
53
- it('should strip emojis from a string with multiple emojis', () => {
54
- const text = '😊 Hello 😉🤪♥️';
55
- const result = stripEmojis(text);
56
- expect(result).toEqual('Hello');
57
- });
58
- });
59
-
60
- describe('utils/stripMarkdown', () => {
61
- it('should strip markdown headings from a string', () => {
62
- const result = stripMarkdown('# Hello');
63
- expect(result).toEqual('Hello');
64
- });
65
-
66
- it('should strip markdown bold and italic from a string', () => {
67
- const result = stripMarkdown('**Hello** _world_');
68
- expect(result).toEqual('Hello world');
69
- });
70
-
71
- it('should strip markdown links from a string', () => {
72
- const result = stripMarkdown('[example.com](https://example.com)');
73
- expect(result).toEqual('example.com');
74
- });
75
-
76
- it('should strip markdown images from a string', () => {
77
- const result = stripMarkdown('![example.com](https://example.com)');
78
- expect(result).toEqual('');
79
- });
80
-
81
- it('should strip markdown blockquotes from a string', () => {
82
- const result = stripMarkdown('> Hello');
83
- expect(result).toEqual('Hello');
84
- });
85
-
86
- it('should strip markdown horizontal rules from a string', () => {
87
- const result = stripMarkdown('---');
88
- expect(result).toEqual('');
89
- });
90
-
91
- it('should strip markdown strikethrough from a string', () => {
92
- const result = stripMarkdown('~~Hello~~');
93
- expect(result).toEqual('Hello');
94
- });
95
-
96
- it('should strip markdown code blocks from a string', () => {
97
- const result = stripMarkdown('```Hello```');
98
- expect(result).toEqual('');
99
- });
100
-
101
- it('should strip markdown multiline code blocks from a string', () => {
102
- const result = stripMarkdown('```\nHello\n```');
103
- expect(result).toEqual('');
104
- });
105
-
106
- it('should strip markdown inline code from a string', () => {
107
- const result = stripMarkdown('`Hello`');
108
- expect(result).toEqual('');
109
- });
110
-
111
- it('should strip markdown lists from a string', () => {
112
- const result = stripMarkdown('- Hello');
113
- expect(result).toEqual('Hello');
114
- });
115
-
116
- it('should strip markdown tables from a string', () => {
117
- const result = stripMarkdown('| Hello |');
118
- expect(result).toEqual('');
119
- });
120
-
121
- it('should strip block mathjax from a string', () => {
122
- const result = stripMarkdown('\\[ c = \\sqrt{a^2 + b^2} \\]');
123
- expect(result).toEqual('');
124
- });
125
-
126
- it('should strip block mathjax from a string with multiple lines', () => {
127
- const result = stripMarkdown('$$\nHello\n$$');
128
- expect(result).toEqual('');
129
- });
130
-
131
- it('should strip inline mathjax from a string', () => {
132
- const result = stripMarkdown('\\( f_m \\)');
133
- expect(result).toEqual('');
134
- });
135
- });
136
-
137
- describe('utils/stripOutputTags', () => {
138
- it('should remove output tag', () => {
139
- const result = stripOutputTags('test\n<output>pippo</output>');
140
- expect(result).toEqual('test\n');
141
- });
142
-
143
- it('should remove output tag with class', () => {
144
- const result = stripOutputTags(
145
- 'test\n<output class="memori-output">pippo</output>'
146
- );
147
- expect(result).toEqual('test\n');
148
- });
149
- });
150
-
151
- describe('utils/attachment helpers', () => {
152
- it('extracts multiple attachment links in order', () => {
153
- const input = [
154
- '<document_attachment filename="a.docx" type="application/vnd.openxmlformats-officedocument.wordprocessingml.document">',
155
- '</document_attachment>',
156
- '<attachment_link>',
157
- 'https://assets.example.com/a.docx',
158
- '</attachment_link>',
159
- '<document_attachment filename="b.pdf" type="application/pdf">',
160
- 'pdf text',
161
- '</document_attachment>',
162
- '<attachment_link>https://assets.example.com/b.txt</attachment_link>',
163
- ].join('\n');
164
-
165
- expect(extractAttachmentLinks(input)).toEqual([
166
- 'https://assets.example.com/a.docx',
167
- 'https://assets.example.com/b.txt',
168
- ]);
169
- });
170
-
171
- it('extracts a single attachment link', () => {
172
- const input =
173
- '<attachment_link>\nhttps://assets.example.com/file.docx\n</attachment_link>';
174
- expect(extractAttachmentLink(input)).toBe(
175
- 'https://assets.example.com/file.docx'
176
- );
177
- });
178
-
179
- it('detects office native filenames', () => {
180
- expect(isOfficeNativeFilename('report.doc')).toBe(false);
181
- expect(isOfficeNativeFilename('report.docx')).toBe(false);
182
- expect(isOfficeNativeFilename('budget.xls')).toBe(false);
183
- expect(isOfficeNativeFilename('template.XLTX')).toBe(false);
184
- expect(isOfficeNativeFilename('slides.potx')).toBe(false);
185
- expect(isOfficeNativeFilename('notes.pdf')).toBe(false);
186
- expect(isOfficeNativeFilename('data.xlsx')).toBe(false);
187
- });
188
-
189
- it('detects filenames read locally instead of converted', () => {
190
- expect(isLocalTextFilename('notes.txt')).toBe(true);
191
- expect(isLocalTextFilename('export.CSV')).toBe(true);
192
- expect(isLocalTextFilename('readme.md')).toBe(true);
193
- expect(isLocalTextFilename('readme.markdown')).toBe(false);
194
- expect(isLocalTextFilename('report.docx')).toBe(false);
195
- expect(isLocalTextFilename('notes.pdf')).toBe(false);
196
- });
197
-
198
- it('detects asset-only document attachments', () => {
199
- expect(
200
- isAssetOnlyDocumentAttachment({
201
- title: 'report.docx',
202
- content: '',
203
- url: 'https://assets.example.com/file.docx',
204
- })
205
- ).toBe(true);
206
- expect(
207
- isAssetOnlyDocumentAttachment({
208
- title: 'report.docx',
209
- content: [
210
- '<document_attachment filename="report.docx" type="application/vnd.openxmlformats-officedocument.wordprocessingml.document">',
211
- '</document_attachment>',
212
- '<attachment_link>https://assets.example.com/file.docx</attachment_link>',
213
- ].join('\n'),
214
- url: '',
215
- })
216
- ).toBe(true);
217
- expect(
218
- isAssetOnlyDocumentAttachment({
219
- content: 'extracted text',
220
- url: 'https://assets.example.com/file.txt',
221
- })
222
- ).toBe(false);
223
- });
224
-
225
- it('pairs each document attachment with its adjacent link', () => {
226
- const input = [
227
- '<attachment_link>https://assets.example.com/orphan.txt</attachment_link>',
228
- '<document_attachment filename="a.docx" type="application/vnd.openxmlformats-officedocument.wordprocessingml.document">',
229
- '</document_attachment>',
230
- '<attachment_link>https://assets.example.com/a.docx</attachment_link>',
231
- '<document_attachment filename="b.pdf" type="application/pdf">',
232
- 'pdf text',
233
- '</document_attachment>',
234
- '<attachment_link>https://assets.example.com/b.txt</attachment_link>',
235
- ].join('\n');
236
-
237
- expect(parseDocumentAttachmentsFromMessage(input)).toEqual([
238
- {
239
- filename: 'a.docx',
240
- type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
241
- content: '',
242
- url: 'https://assets.example.com/a.docx',
243
- },
244
- {
245
- filename: 'b.pdf',
246
- type: 'application/pdf',
247
- content: 'pdf text',
248
- url: 'https://assets.example.com/b.txt',
249
- },
250
- ]);
251
- });
252
-
253
- it('returns an empty url when no adjacent attachment link exists', () => {
254
- const input =
255
- '<document_attachment filename="a.docx" type="application/vnd.openxmlformats-officedocument.wordprocessingml.document"></document_attachment>';
256
-
257
- expect(parseDocumentAttachmentsFromMessage(input)).toEqual([
258
- {
259
- filename: 'a.docx',
260
- type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
261
- content: '',
262
- url: '',
263
- },
264
- ]);
265
- });
266
- });
267
-
268
- describe('utils/stripHTML', () => {
269
- it('strips tags and returns text content', () => {
270
- expect(stripHTML('<p>Hello <strong>world</strong></p>')).toBe(
271
- 'Hello world'
272
- );
273
- });
274
-
275
- it('does not retain onerror from partner XSS payload', () => {
276
- const payload =
277
- '<img src="immagine-inesistente.jpg" onerror="alert(\'XSS Eseguito!\')">';
278
- const result = stripHTML(payload);
279
- expect(result).toBe('');
280
- expect(result).not.toMatch(/onerror/i);
281
- // Re-parse result: must not introduce an executable handler attribute
282
- const reparsed = new DOMParser().parseFromString(result, 'text/html');
283
- expect(reparsed.querySelector('[onerror]')).toBeNull();
284
- expect(reparsed.querySelector('img')).toBeNull();
285
- });
286
-
287
- it('strips svg onload payloads without leaving handlers', () => {
288
- const payload = '<svg onload="alert(1)"><text>x</text></svg>';
289
- const result = stripHTML(payload);
290
- expect(result).toBe('x');
291
- expect(result).not.toMatch(/onload/i);
292
- });
293
-
294
- it('decodes HTML entities without executing nested markup', () => {
295
- const encoded =
296
- '&lt;img src="x" onerror="alert(1)"&gt;hello&lt;/img&gt;';
297
- const result = stripHTML(encoded);
298
- expect(result).toContain('hello');
299
- // Entity-decoded text may contain the string "onerror" as text; ensure no live element
300
- const reparsed = new DOMParser().parseFromString(
301
- `<div>${result.replace(/</g, '&lt;')}</div>`,
302
- 'text/html'
303
- );
304
- expect(reparsed.querySelector('[onerror]')).toBeNull();
305
- });
306
-
307
- it('handles nested tags', () => {
308
- expect(stripHTML('<div><span>a</span><b>b</b></div>')).toBe('ab');
309
- });
310
-
311
- it('returns empty string for empty input', () => {
312
- expect(stripHTML('')).toBe('');
313
- });
314
- });
315
-
316
- describe('utils/parsing combined', () => {
317
- it('should remove output tag from real message', () => {
318
- const result = escapeHTML(
319
- stripMarkdown(
320
- stripEmojis(
321
- stripOutputTags(`Beh... grazie, davvero. Non so cosa dire, sono lusingata. Ma... mi scusi se glielo chiedo, è sicuro che non ci sia stato un errore? Di solito ricevo più critiche che complimenti per il mio lavoro. So di impegnarmi molto, faccio spesso straordinari e salto persino la pausa pranzo per finire le pratiche. Però mi rendo conto che a volte ci sono imprecisioni e ritardi nelle consegne... Forse c'è qualcosa che non sto capendo?
322
-
323
- <output class="memori-emotion">["timore"]</output>`)
324
- )
325
- )
326
- );
327
- expect(result).toEqual(
328
- `Beh... grazie, davvero. Non so cosa dire, sono lusingata. Ma... mi scusi se glielo chiedo, è sicuro che non ci sia stato un errore? Di solito ricevo più critiche che complimenti per il mio lavoro. So di impegnarmi molto, faccio spesso straordinari e salto persino la pausa pranzo per finire le pratiche. Però mi rendo conto che a volte ci sono imprecisioni e ritardi nelle consegne... Forse c'è qualcosa che non sto capendo?`
329
- );
330
- });
331
- });