@thoughtspot/visual-embed-sdk 1.52.0 → 1.52.2-beta

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 (385) hide show
  1. package/cjs/package.json +19 -4
  2. package/cjs/src/contracts/contracts.spec.d.ts +2 -0
  3. package/cjs/src/contracts/contracts.spec.d.ts.map +1 -0
  4. package/cjs/src/contracts/contracts.spec.js +345 -0
  5. package/cjs/src/contracts/contracts.spec.js.map +1 -0
  6. package/cjs/src/contracts/embed-event-payloads.d.ts +73 -0
  7. package/cjs/src/contracts/embed-event-payloads.d.ts.map +1 -0
  8. package/cjs/src/contracts/embed-event-payloads.js +3 -0
  9. package/cjs/src/contracts/embed-event-payloads.js.map +1 -0
  10. package/cjs/src/contracts/host-event-contracts.d.ts +416 -0
  11. package/cjs/src/contracts/host-event-contracts.d.ts.map +1 -0
  12. package/cjs/src/contracts/host-event-contracts.js +3 -0
  13. package/cjs/src/contracts/host-event-contracts.js.map +1 -0
  14. package/cjs/src/contracts/index.d.ts +22 -0
  15. package/cjs/src/contracts/index.d.ts.map +1 -0
  16. package/cjs/src/contracts/index.js +33 -0
  17. package/cjs/src/contracts/index.js.map +1 -0
  18. package/cjs/src/contracts/ui-passthrough-contracts.d.ts +277 -0
  19. package/cjs/src/contracts/ui-passthrough-contracts.d.ts.map +1 -0
  20. package/cjs/src/{embed/hostEventClient/contracts.js → contracts/ui-passthrough-contracts.js} +6 -2
  21. package/cjs/src/contracts/ui-passthrough-contracts.js.map +1 -0
  22. package/cjs/src/embed/app.d.ts +21 -143
  23. package/cjs/src/embed/app.d.ts.map +1 -1
  24. package/cjs/src/embed/app.js +21 -121
  25. package/cjs/src/embed/app.js.map +1 -1
  26. package/cjs/src/embed/app.spec.js +80 -26
  27. package/cjs/src/embed/app.spec.js.map +1 -1
  28. package/cjs/src/embed/auto-frame-renderer.js +1 -1
  29. package/cjs/src/embed/auto-frame-renderer.js.map +1 -1
  30. package/cjs/src/embed/auto-frame-renderer.spec.js +24 -13
  31. package/cjs/src/embed/auto-frame-renderer.spec.js.map +1 -1
  32. package/cjs/src/embed/bodyless-conversation.js +1 -1
  33. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  34. package/cjs/src/embed/conversation.d.ts +1 -0
  35. package/cjs/src/embed/conversation.d.ts.map +1 -1
  36. package/cjs/src/embed/conversation.js +4 -4
  37. package/cjs/src/embed/conversation.js.map +1 -1
  38. package/cjs/src/embed/conversation.spec.js +35 -24
  39. package/cjs/src/embed/conversation.spec.js.map +1 -1
  40. package/cjs/src/embed/embedConfig.spec.js +2 -1
  41. package/cjs/src/embed/embedConfig.spec.js.map +1 -1
  42. package/cjs/src/embed/events.spec.js +12 -2
  43. package/cjs/src/embed/events.spec.js.map +1 -1
  44. package/cjs/src/embed/hostEventClient/host-event-client.d.ts +5 -4
  45. package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  46. package/cjs/src/embed/hostEventClient/host-event-client.js +34 -23
  47. package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
  48. package/cjs/src/embed/hostEventClient/host-event-client.spec.js +50 -44
  49. package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  50. package/cjs/src/embed/hostEventClient/utils.d.ts +10 -1
  51. package/cjs/src/embed/hostEventClient/utils.d.ts.map +1 -1
  52. package/cjs/src/embed/hostEventClient/utils.js +52 -6
  53. package/cjs/src/embed/hostEventClient/utils.js.map +1 -1
  54. package/cjs/src/embed/hostEventClient/utils.spec.js +151 -0
  55. package/cjs/src/embed/hostEventClient/utils.spec.js.map +1 -1
  56. package/cjs/src/embed/liveboard.d.ts +13 -164
  57. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  58. package/cjs/src/embed/liveboard.js +72 -135
  59. package/cjs/src/embed/liveboard.js.map +1 -1
  60. package/cjs/src/embed/liveboard.spec.js +213 -29
  61. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  62. package/cjs/src/embed/search-bar.js +1 -1
  63. package/cjs/src/embed/search-bar.js.map +1 -1
  64. package/cjs/src/embed/search.d.ts +14 -0
  65. package/cjs/src/embed/search.d.ts.map +1 -1
  66. package/cjs/src/embed/search.js +5 -2
  67. package/cjs/src/embed/search.js.map +1 -1
  68. package/cjs/src/embed/search.spec.js +85 -0
  69. package/cjs/src/embed/search.spec.js.map +1 -1
  70. package/cjs/src/embed/spotter-utils.d.ts +8 -1
  71. package/cjs/src/embed/spotter-utils.d.ts.map +1 -1
  72. package/cjs/src/embed/spotter-utils.js +14 -1
  73. package/cjs/src/embed/spotter-utils.js.map +1 -1
  74. package/cjs/src/embed/spotter-utils.spec.js +26 -0
  75. package/cjs/src/embed/spotter-utils.spec.js.map +1 -1
  76. package/cjs/src/embed/ts-embed.d.ts +20 -22
  77. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  78. package/cjs/src/embed/ts-embed.js +171 -66
  79. package/cjs/src/embed/ts-embed.js.map +1 -1
  80. package/cjs/src/embed/ts-embed.spec.js +486 -38
  81. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  82. package/cjs/src/errors.js +1 -1
  83. package/cjs/src/errors.js.map +1 -1
  84. package/cjs/src/full-height.d.ts +137 -0
  85. package/cjs/src/full-height.d.ts.map +1 -0
  86. package/cjs/src/full-height.js +272 -0
  87. package/cjs/src/full-height.js.map +1 -0
  88. package/cjs/src/full-height.spec.d.ts +2 -0
  89. package/cjs/src/full-height.spec.d.ts.map +1 -0
  90. package/cjs/src/full-height.spec.js +835 -0
  91. package/cjs/src/full-height.spec.js.map +1 -0
  92. package/cjs/src/index.d.ts +5 -3
  93. package/cjs/src/index.d.ts.map +1 -1
  94. package/cjs/src/index.js +6 -4
  95. package/cjs/src/index.js.map +1 -1
  96. package/cjs/src/react/all-types-export.d.ts +1 -1
  97. package/cjs/src/react/all-types-export.d.ts.map +1 -1
  98. package/cjs/src/react/all-types-export.js +2 -1
  99. package/cjs/src/react/all-types-export.js.map +1 -1
  100. package/cjs/src/react/all-types-export.parity.spec.js +55 -3
  101. package/cjs/src/react/all-types-export.parity.spec.js.map +1 -1
  102. package/cjs/src/types.d.ts +584 -24
  103. package/cjs/src/types.d.ts.map +1 -1
  104. package/cjs/src/types.js +370 -22
  105. package/cjs/src/types.js.map +1 -1
  106. package/cjs/src/utils/authService/tokenizedAuthService.spec.js +2 -1
  107. package/cjs/src/utils/authService/tokenizedAuthService.spec.js.map +1 -1
  108. package/cjs/src/utils/custom-actions.spec.js +4 -2
  109. package/cjs/src/utils/custom-actions.spec.js.map +1 -1
  110. package/cjs/src/utils/filterConverter.d.ts +106 -0
  111. package/cjs/src/utils/filterConverter.d.ts.map +1 -0
  112. package/cjs/src/utils/filterConverter.js +215 -0
  113. package/cjs/src/utils/filterConverter.js.map +1 -0
  114. package/cjs/src/utils/filterConverter.spec.d.ts +2 -0
  115. package/cjs/src/utils/filterConverter.spec.d.ts.map +1 -0
  116. package/cjs/src/utils/filterConverter.spec.js +709 -0
  117. package/cjs/src/utils/filterConverter.spec.js.map +1 -0
  118. package/cjs/src/utils/processData.spec.js +2 -1
  119. package/cjs/src/utils/processData.spec.js.map +1 -1
  120. package/cjs/src/utils/processTrigger.d.ts +3 -1
  121. package/cjs/src/utils/processTrigger.d.ts.map +1 -1
  122. package/cjs/src/utils/processTrigger.js +19 -51
  123. package/cjs/src/utils/processTrigger.js.map +1 -1
  124. package/cjs/src/utils/transport/iframe-transport.d.ts +55 -0
  125. package/cjs/src/utils/transport/iframe-transport.d.ts.map +1 -0
  126. package/cjs/src/utils/transport/iframe-transport.js +108 -0
  127. package/cjs/src/utils/transport/iframe-transport.js.map +1 -0
  128. package/cjs/src/utils/transport/iframe-transport.spec.d.ts +2 -0
  129. package/cjs/src/utils/transport/iframe-transport.spec.d.ts.map +1 -0
  130. package/cjs/src/utils/transport/iframe-transport.spec.js +140 -0
  131. package/cjs/src/utils/transport/iframe-transport.spec.js.map +1 -0
  132. package/cjs/src/utils.d.ts +18 -0
  133. package/cjs/src/utils.d.ts.map +1 -1
  134. package/cjs/src/utils.js +39 -1
  135. package/cjs/src/utils.js.map +1 -1
  136. package/cjs/src/utils.spec.js +62 -0
  137. package/cjs/src/utils.spec.js.map +1 -1
  138. package/dist/{index-BMppCU63.js → index-CcBYlGo9.js} +1 -1
  139. package/dist/src/contracts/contracts.spec.d.ts +2 -0
  140. package/dist/src/contracts/contracts.spec.d.ts.map +1 -0
  141. package/dist/src/contracts/embed-event-payloads.d.ts +73 -0
  142. package/dist/src/contracts/embed-event-payloads.d.ts.map +1 -0
  143. package/dist/src/contracts/host-event-contracts.d.ts +416 -0
  144. package/dist/src/contracts/host-event-contracts.d.ts.map +1 -0
  145. package/dist/src/contracts/index.d.ts +22 -0
  146. package/dist/src/contracts/index.d.ts.map +1 -0
  147. package/dist/src/contracts/ui-passthrough-contracts.d.ts +277 -0
  148. package/dist/src/contracts/ui-passthrough-contracts.d.ts.map +1 -0
  149. package/dist/src/embed/app.d.ts +21 -143
  150. package/dist/src/embed/app.d.ts.map +1 -1
  151. package/dist/src/embed/conversation.d.ts +1 -0
  152. package/dist/src/embed/conversation.d.ts.map +1 -1
  153. package/dist/src/embed/hostEventClient/host-event-client.d.ts +5 -4
  154. package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  155. package/dist/src/embed/hostEventClient/utils.d.ts +10 -1
  156. package/dist/src/embed/hostEventClient/utils.d.ts.map +1 -1
  157. package/dist/src/embed/liveboard.d.ts +13 -164
  158. package/dist/src/embed/liveboard.d.ts.map +1 -1
  159. package/dist/src/embed/search.d.ts +14 -0
  160. package/dist/src/embed/search.d.ts.map +1 -1
  161. package/dist/src/embed/spotter-utils.d.ts +8 -1
  162. package/dist/src/embed/spotter-utils.d.ts.map +1 -1
  163. package/dist/src/embed/ts-embed.d.ts +20 -22
  164. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  165. package/dist/src/full-height.d.ts +137 -0
  166. package/dist/src/full-height.d.ts.map +1 -0
  167. package/dist/src/full-height.spec.d.ts +2 -0
  168. package/dist/src/full-height.spec.d.ts.map +1 -0
  169. package/dist/src/index.d.ts +5 -3
  170. package/dist/src/index.d.ts.map +1 -1
  171. package/dist/src/react/all-types-export.d.ts +1 -1
  172. package/dist/src/react/all-types-export.d.ts.map +1 -1
  173. package/dist/src/types.d.ts +584 -24
  174. package/dist/src/types.d.ts.map +1 -1
  175. package/dist/src/utils/filterConverter.d.ts +106 -0
  176. package/dist/src/utils/filterConverter.d.ts.map +1 -0
  177. package/dist/src/utils/filterConverter.spec.d.ts +2 -0
  178. package/dist/src/utils/filterConverter.spec.d.ts.map +1 -0
  179. package/dist/src/utils/processTrigger.d.ts +3 -1
  180. package/dist/src/utils/processTrigger.d.ts.map +1 -1
  181. package/dist/src/utils/transport/iframe-transport.d.ts +55 -0
  182. package/dist/src/utils/transport/iframe-transport.d.ts.map +1 -0
  183. package/dist/src/utils/transport/iframe-transport.spec.d.ts +2 -0
  184. package/dist/src/utils/transport/iframe-transport.spec.d.ts.map +1 -0
  185. package/dist/src/utils.d.ts +18 -0
  186. package/dist/src/utils.d.ts.map +1 -1
  187. package/dist/tsembed-react.es.js +1144 -412
  188. package/dist/tsembed-react.js +1143 -411
  189. package/dist/tsembed.es.js +1357 -418
  190. package/dist/tsembed.js +1352 -412
  191. package/dist/visual-embed-sdk-react-full.d.ts +1514 -651
  192. package/dist/visual-embed-sdk-react.d.ts +1351 -632
  193. package/dist/visual-embed-sdk.d.ts +1508 -668
  194. package/lib/package.json +19 -4
  195. package/lib/src/contracts/contracts.spec.d.ts +2 -0
  196. package/lib/src/contracts/contracts.spec.d.ts.map +1 -0
  197. package/lib/src/contracts/contracts.spec.js +342 -0
  198. package/lib/src/contracts/contracts.spec.js.map +1 -0
  199. package/lib/src/contracts/embed-event-payloads.d.ts +73 -0
  200. package/lib/src/contracts/embed-event-payloads.d.ts.map +1 -0
  201. package/lib/src/contracts/embed-event-payloads.js +2 -0
  202. package/lib/src/contracts/embed-event-payloads.js.map +1 -0
  203. package/lib/src/contracts/host-event-contracts.d.ts +416 -0
  204. package/lib/src/contracts/host-event-contracts.d.ts.map +1 -0
  205. package/lib/src/contracts/host-event-contracts.js +2 -0
  206. package/lib/src/contracts/host-event-contracts.js.map +1 -0
  207. package/lib/src/contracts/index.d.ts +22 -0
  208. package/lib/src/contracts/index.d.ts.map +1 -0
  209. package/lib/src/contracts/index.js +22 -0
  210. package/lib/src/contracts/index.js.map +1 -0
  211. package/lib/src/contracts/ui-passthrough-contracts.d.ts +277 -0
  212. package/lib/src/contracts/ui-passthrough-contracts.d.ts.map +1 -0
  213. package/lib/src/{embed/hostEventClient/contracts.js → contracts/ui-passthrough-contracts.js} +6 -2
  214. package/lib/src/contracts/ui-passthrough-contracts.js.map +1 -0
  215. package/lib/src/embed/app.d.ts +21 -143
  216. package/lib/src/embed/app.d.ts.map +1 -1
  217. package/lib/src/embed/app.js +23 -123
  218. package/lib/src/embed/app.js.map +1 -1
  219. package/lib/src/embed/app.spec.js +80 -26
  220. package/lib/src/embed/app.spec.js.map +1 -1
  221. package/lib/src/embed/auto-frame-renderer.js +1 -1
  222. package/lib/src/embed/auto-frame-renderer.js.map +1 -1
  223. package/lib/src/embed/auto-frame-renderer.spec.js +24 -13
  224. package/lib/src/embed/auto-frame-renderer.spec.js.map +1 -1
  225. package/lib/src/embed/bodyless-conversation.js +1 -1
  226. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  227. package/lib/src/embed/conversation.d.ts +1 -0
  228. package/lib/src/embed/conversation.d.ts.map +1 -1
  229. package/lib/src/embed/conversation.js +5 -5
  230. package/lib/src/embed/conversation.js.map +1 -1
  231. package/lib/src/embed/conversation.spec.js +35 -24
  232. package/lib/src/embed/conversation.spec.js.map +1 -1
  233. package/lib/src/embed/embedConfig.spec.js +2 -1
  234. package/lib/src/embed/embedConfig.spec.js.map +1 -1
  235. package/lib/src/embed/events.spec.js +12 -2
  236. package/lib/src/embed/events.spec.js.map +1 -1
  237. package/lib/src/embed/hostEventClient/host-event-client.d.ts +5 -4
  238. package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  239. package/lib/src/embed/hostEventClient/host-event-client.js +19 -8
  240. package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
  241. package/lib/src/embed/hostEventClient/host-event-client.spec.js +15 -9
  242. package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  243. package/lib/src/embed/hostEventClient/utils.d.ts +10 -1
  244. package/lib/src/embed/hostEventClient/utils.d.ts.map +1 -1
  245. package/lib/src/embed/hostEventClient/utils.js +48 -3
  246. package/lib/src/embed/hostEventClient/utils.js.map +1 -1
  247. package/lib/src/embed/hostEventClient/utils.spec.js +152 -1
  248. package/lib/src/embed/hostEventClient/utils.spec.js.map +1 -1
  249. package/lib/src/embed/liveboard.d.ts +13 -164
  250. package/lib/src/embed/liveboard.d.ts.map +1 -1
  251. package/lib/src/embed/liveboard.js +73 -136
  252. package/lib/src/embed/liveboard.js.map +1 -1
  253. package/lib/src/embed/liveboard.spec.js +213 -29
  254. package/lib/src/embed/liveboard.spec.js.map +1 -1
  255. package/lib/src/embed/search-bar.js +1 -1
  256. package/lib/src/embed/search-bar.js.map +1 -1
  257. package/lib/src/embed/search.d.ts +14 -0
  258. package/lib/src/embed/search.d.ts.map +1 -1
  259. package/lib/src/embed/search.js +5 -2
  260. package/lib/src/embed/search.js.map +1 -1
  261. package/lib/src/embed/search.spec.js +85 -0
  262. package/lib/src/embed/search.spec.js.map +1 -1
  263. package/lib/src/embed/spotter-utils.d.ts +8 -1
  264. package/lib/src/embed/spotter-utils.d.ts.map +1 -1
  265. package/lib/src/embed/spotter-utils.js +12 -0
  266. package/lib/src/embed/spotter-utils.js.map +1 -1
  267. package/lib/src/embed/spotter-utils.spec.js +27 -1
  268. package/lib/src/embed/spotter-utils.spec.js.map +1 -1
  269. package/lib/src/embed/ts-embed.d.ts +20 -22
  270. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  271. package/lib/src/embed/ts-embed.js +171 -66
  272. package/lib/src/embed/ts-embed.js.map +1 -1
  273. package/lib/src/embed/ts-embed.spec.js +484 -36
  274. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  275. package/lib/src/errors.js +1 -1
  276. package/lib/src/errors.js.map +1 -1
  277. package/lib/src/full-height.d.ts +137 -0
  278. package/lib/src/full-height.d.ts.map +1 -0
  279. package/lib/src/full-height.js +268 -0
  280. package/lib/src/full-height.js.map +1 -0
  281. package/lib/src/full-height.spec.d.ts +2 -0
  282. package/lib/src/full-height.spec.d.ts.map +1 -0
  283. package/lib/src/full-height.spec.js +833 -0
  284. package/lib/src/full-height.spec.js.map +1 -0
  285. package/lib/src/index.d.ts +5 -3
  286. package/lib/src/index.d.ts.map +1 -1
  287. package/lib/src/index.js +3 -2
  288. package/lib/src/index.js.map +1 -1
  289. package/lib/src/react/all-types-export.d.ts +1 -1
  290. package/lib/src/react/all-types-export.d.ts.map +1 -1
  291. package/lib/src/react/all-types-export.js +1 -1
  292. package/lib/src/react/all-types-export.js.map +1 -1
  293. package/lib/src/react/all-types-export.parity.spec.js +55 -3
  294. package/lib/src/react/all-types-export.parity.spec.js.map +1 -1
  295. package/lib/src/types.d.ts +584 -24
  296. package/lib/src/types.d.ts.map +1 -1
  297. package/lib/src/types.js +370 -22
  298. package/lib/src/types.js.map +1 -1
  299. package/lib/src/utils/authService/tokenizedAuthService.spec.js +2 -1
  300. package/lib/src/utils/authService/tokenizedAuthService.spec.js.map +1 -1
  301. package/lib/src/utils/custom-actions.spec.js +4 -2
  302. package/lib/src/utils/custom-actions.spec.js.map +1 -1
  303. package/lib/src/utils/filterConverter.d.ts +106 -0
  304. package/lib/src/utils/filterConverter.d.ts.map +1 -0
  305. package/lib/src/utils/filterConverter.js +210 -0
  306. package/lib/src/utils/filterConverter.js.map +1 -0
  307. package/lib/src/utils/filterConverter.spec.d.ts +2 -0
  308. package/lib/src/utils/filterConverter.spec.d.ts.map +1 -0
  309. package/lib/src/utils/filterConverter.spec.js +707 -0
  310. package/lib/src/utils/filterConverter.spec.js.map +1 -0
  311. package/lib/src/utils/processData.spec.js +2 -1
  312. package/lib/src/utils/processData.spec.js.map +1 -1
  313. package/lib/src/utils/processTrigger.d.ts +3 -1
  314. package/lib/src/utils/processTrigger.d.ts.map +1 -1
  315. package/lib/src/utils/processTrigger.js +19 -51
  316. package/lib/src/utils/processTrigger.js.map +1 -1
  317. package/lib/src/utils/transport/iframe-transport.d.ts +55 -0
  318. package/lib/src/utils/transport/iframe-transport.d.ts.map +1 -0
  319. package/lib/src/utils/transport/iframe-transport.js +101 -0
  320. package/lib/src/utils/transport/iframe-transport.js.map +1 -0
  321. package/lib/src/utils/transport/iframe-transport.spec.d.ts +2 -0
  322. package/lib/src/utils/transport/iframe-transport.spec.d.ts.map +1 -0
  323. package/lib/src/utils/transport/iframe-transport.spec.js +138 -0
  324. package/lib/src/utils/transport/iframe-transport.spec.js.map +1 -0
  325. package/lib/src/utils.d.ts +18 -0
  326. package/lib/src/utils.d.ts.map +1 -1
  327. package/lib/src/utils.js +37 -0
  328. package/lib/src/utils.js.map +1 -1
  329. package/lib/src/utils.spec.js +63 -1
  330. package/lib/src/utils.spec.js.map +1 -1
  331. package/lib/src/visual-embed-sdk.d.ts +1508 -668
  332. package/package.json +19 -4
  333. package/src/contracts/contracts.spec.ts +392 -0
  334. package/src/contracts/embed-event-payloads.ts +83 -0
  335. package/src/contracts/host-event-contracts.ts +500 -0
  336. package/src/contracts/index.ts +53 -0
  337. package/src/contracts/ui-passthrough-contracts.ts +301 -0
  338. package/src/embed/app.spec.ts +101 -34
  339. package/src/embed/app.ts +42 -268
  340. package/src/embed/auto-frame-renderer.spec.ts +24 -13
  341. package/src/embed/auto-frame-renderer.ts +1 -1
  342. package/src/embed/bodyless-conversation.ts +1 -1
  343. package/src/embed/conversation.spec.ts +38 -27
  344. package/src/embed/conversation.ts +5 -5
  345. package/src/embed/embedConfig.spec.ts +2 -1
  346. package/src/embed/events.spec.ts +14 -2
  347. package/src/embed/hostEventClient/host-event-client.spec.ts +16 -10
  348. package/src/embed/hostEventClient/host-event-client.ts +31 -10
  349. package/src/embed/hostEventClient/utils.spec.ts +176 -1
  350. package/src/embed/hostEventClient/utils.ts +53 -3
  351. package/src/embed/liveboard.spec.ts +261 -41
  352. package/src/embed/liveboard.ts +85 -300
  353. package/src/embed/search-bar.tsx +1 -1
  354. package/src/embed/search.spec.ts +103 -0
  355. package/src/embed/search.ts +21 -1
  356. package/src/embed/spotter-utils.spec.ts +29 -0
  357. package/src/embed/spotter-utils.ts +16 -0
  358. package/src/embed/ts-embed.spec.ts +650 -36
  359. package/src/embed/ts-embed.ts +205 -76
  360. package/src/errors.ts +1 -1
  361. package/src/full-height.spec.ts +1008 -0
  362. package/src/full-height.ts +361 -0
  363. package/src/index.ts +103 -5
  364. package/src/react/all-types-export.parity.spec.ts +63 -3
  365. package/src/react/all-types-export.ts +49 -0
  366. package/src/types.ts +584 -22
  367. package/src/utils/authService/tokenizedAuthService.spec.ts +2 -1
  368. package/src/utils/custom-actions.spec.ts +4 -2
  369. package/src/utils/filterConverter.spec.ts +801 -0
  370. package/src/utils/filterConverter.ts +304 -0
  371. package/src/utils/processData.spec.ts +2 -1
  372. package/src/utils/processTrigger.ts +28 -58
  373. package/src/utils/transport/iframe-transport.spec.ts +177 -0
  374. package/src/utils/transport/iframe-transport.ts +122 -0
  375. package/src/utils.spec.ts +71 -0
  376. package/src/utils.ts +38 -0
  377. package/cjs/src/embed/hostEventClient/contracts.d.ts +0 -231
  378. package/cjs/src/embed/hostEventClient/contracts.d.ts.map +0 -1
  379. package/cjs/src/embed/hostEventClient/contracts.js.map +0 -1
  380. package/dist/src/embed/hostEventClient/contracts.d.ts +0 -231
  381. package/dist/src/embed/hostEventClient/contracts.d.ts.map +0 -1
  382. package/lib/src/embed/hostEventClient/contracts.d.ts +0 -231
  383. package/lib/src/embed/hostEventClient/contracts.d.ts.map +0 -1
  384. package/lib/src/embed/hostEventClient/contracts.js.map +0 -1
  385. package/src/embed/hostEventClient/contracts.ts +0 -262
package/src/embed/app.ts CHANGED
@@ -9,19 +9,19 @@
9
9
  */
10
10
 
11
11
  import { logger } from '../utils/logger';
12
- import { calculateVisibleElementData, getEffectiveClippingAncestors, getQueryParamString, getScrollableAncestors, isUndefined, isValidCssMargin, setParamIfDefined } from '../utils';
13
- import { DEFAULT_LAZY_LOADING_MARGIN } from '../config';
12
+ import { getQueryParamString, isUndefined, setParamIfDefined } from '../utils';
14
13
  import {
15
14
  Param,
16
15
  DOMSelector,
17
16
  HostEvent,
18
17
  EmbedEvent,
19
- MessagePayload,
20
18
  AllEmbedViewConfig,
19
+ FullHeightViewConfig,
21
20
  DefaultAppInitData,
22
21
  VisualizationOverrides,
23
22
  SpotterFileUploadFileTypes,
24
23
  } from '../types';
24
+ import { FullHeightController } from '../full-height';
25
25
  import { V1Embed } from './ts-embed';
26
26
  import { SpotterChatViewConfig, SpotterSidebarViewConfig, SpotterQueryMode, SpotterShareConversationConfig, StarterPromptsConfig } from './conversation';
27
27
  import { buildSpotterSidebarAppInitData, buildSpotterShareConversationAppInitData, buildStarterPromptsAppInitData } from './spotter-utils';
@@ -179,7 +179,7 @@ export interface DiscoveryExperience {
179
179
  * The view configuration for full app embedding.
180
180
  * @group Embed components
181
181
  */
182
- export interface AppViewConfig extends AllEmbedViewConfig {
182
+ export interface AppViewConfig extends AllEmbedViewConfig, FullHeightViewConfig {
183
183
  /**
184
184
  * If true, the top navigation bar within the ThoughtSpot app
185
185
  * is displayed. By default, the navigation bar is hidden.
@@ -464,34 +464,6 @@ export interface AppViewConfig extends AllEmbedViewConfig {
464
464
  * ```
465
465
  */
466
466
  enableSearchAssist?: boolean;
467
- /**
468
- * If set to true, the Liveboard container dynamically resizes
469
- * according to the height of the Liveboard.
470
- *
471
- * **Note**: Using fullHeight loads all visualizations
472
- * on the Liveboard simultaneously, which results in
473
- * multiple warehouse queries and potentially a
474
- * longer wait for the topmost visualizations to
475
- * display on the screen. Setting fullHeight to
476
- * `false` fetches visualizations incrementally as
477
- * users scroll the page to view the charts and tables.
478
- *
479
- * From SDK 1.52.0, enabling `fullHeight` also turns on
480
- * {@link lazyLoadingForFullHeight} and
481
- * {@link enableScrollableContainerLazyLoading}, so visualizations load as
482
- * they scroll into view. Set either flag to `false` to opt out.
483
- *
484
- * Supported embed types: `AppEmbed`
485
- * @version SDK: 1.21.0 | ThoughtSpot: 9.4.0.cl, 9.4.0-sw
486
- * @example
487
- * ```js
488
- * const embed = new AppEmbed('#tsEmbed', {
489
- * ... // other embed view config
490
- * fullHeight: true,
491
- * })
492
- * ```
493
- */
494
- fullHeight?: boolean;
495
467
  /**
496
468
  * Enables the V2 navigation and modular home page experience.
497
469
  * For more information,
@@ -636,9 +608,10 @@ export interface AppViewConfig extends AllEmbedViewConfig {
636
608
  isPNGInScheduledEmailsEnabled?: boolean;
637
609
 
638
610
  /**
639
- * Enables the 'what you see is what you get' PDF export for Liveboards. Each tab is rendered on a single page
640
- * following the exact UI layout, instead of splitting visualizations across multiple A4 pages.
641
- * This feature is GA from SDK version 1.51.0 and ThoughtSpot version 26.8.0.cl.
611
+ * Enables the 'what you see is what you get' PDF export for Liveboards. Each tab is
612
+ * rendered on a single page following the exact UI layout, instead of splitting
613
+ * visualizations across multiple A4 pages. This feature is GA from SDK version
614
+ * 1.51.0 and ThoughtSpot version 26.8.0.cl.
642
615
  *
643
616
  * Supported embed types: `AppEmbed`, `LiveboardEmbed`
644
617
  * @type {boolean}
@@ -693,79 +666,7 @@ export interface AppViewConfig extends AllEmbedViewConfig {
693
666
  */
694
667
  isGranularXLSXCSVSchedulesEnabled?: boolean;
695
668
 
696
- /**
697
- * Loads visualizations only as they scroll into the viewport, instead of
698
- * loading the whole full-height Liveboard at once.
699
- *
700
- * From SDK 1.52.0 this is enabled automatically whenever `fullHeight` is
701
- * `true`. On SDK 1.51.0 and earlier it defaulted to `false` and had to be
702
- * set explicitly. Set it to `false` to load every visualization upfront.
703
- * The flag has no effect unless `fullHeight` is enabled.
704
- *
705
- * @type {boolean}
706
- * @version SDK: 1.40.0 | ThoughtSpot: 10.12.0.cl
707
- * @default true when `fullHeight` is enabled, from SDK 1.52.0
708
- * @example
709
- * ```js
710
- * const embed = new AppEmbed('#embed-container', {
711
- * // ...other options
712
- * fullHeight: true,
713
- * lazyLoadingForFullHeight: true,
714
- * })
715
- * ```
716
- */
717
- lazyLoadingForFullHeight?: boolean;
718
- /**
719
- * Computes the visible region of the embed against its scrollable and
720
- * clipping ancestors, instead of treating the browser window as the only
721
- * viewport, and tracks scroll and resize on those ancestors.
722
- *
723
- * From SDK 1.52.0 this is enabled automatically whenever `fullHeight` is
724
- * `true`. On SDK 1.51.0 and earlier it defaulted to `false` and had to be
725
- * set explicitly. Set it to `false` when the page scrolls with the window
726
- * and the embed has no clipping ancestor, to skip the extra ancestor
727
- * tracking.
728
- *
729
- * @type {boolean}
730
- * @default true when `fullHeight` is enabled, from SDK 1.52.0
731
- * @hidden
732
- */
733
- enableScrollableContainerLazyLoading?: boolean;
734
669
 
735
- /**
736
- * How far outside the viewport a visualization starts loading, when
737
- * {@link lazyLoadingForFullHeight} is enabled.
738
- *
739
- * For example, if the margin is set to '10px',
740
- * the visualization will be loaded 10px before its top edge is visible in the
741
- * viewport.
742
- *
743
- * The format is similar to CSS margin, so `'500px 0px'` extends the
744
- * prefetch 500px above and below the viewport and not sideways. Accepted
745
- * units are `px`, `em`, `rem`, `%`, `vh` and `vw`, plus bare `0` and
746
- * `auto`; an invalid value is logged and ignored.
747
- *
748
- * From SDK 1.52.0 this defaults to `'500px 0px'` — roughly one
749
- * visualization ahead of the scroll position, so a chart has usually
750
- * finished loading by the time it scrolls into view. Use a smaller margin
751
- * to cut warehouse queries further, or `'0px'` to load a visualization
752
- * only once it is actually visible.
753
- *
754
- * @type {string}
755
- * @version SDK: 1.40.0 | ThoughtSpot: 10.12.0.cl
756
- * @default '500px 0px' when `fullHeight` is enabled, from SDK 1.52.0
757
- * @example
758
- * ```js
759
- * const embed = new AppEmbed('#embed-container', {
760
- * // ...other options
761
- * fullHeight: true,
762
- * lazyLoadingForFullHeight: true,
763
- * // Using 0px, the visualization will be only loaded when it's visible in the viewport.
764
- * lazyLoadingMargin: '0px',
765
- * })
766
- * ```
767
- */
768
- lazyLoadingMargin?: string;
769
670
 
770
671
  /**
771
672
  * updatedSpotterChatPrompt : Controls the updated spotter chat prompt.
@@ -954,23 +855,6 @@ export interface AppViewConfig extends AllEmbedViewConfig {
954
855
  * @default false
955
856
  */
956
857
  enableStopAnswerGenerationEmbed?: boolean;
957
- /**
958
- * This is the minimum height (in pixels) for a full-height App.
959
- * Setting this height helps resolve issues with empty Apps and
960
- * other screens navigable from an App.
961
- *
962
- * @version SDK: 1.44.2 | ThoughtSpot: 10.15.0.cl
963
- * @default 500
964
- * @example
965
- * ```js
966
- * const embed = new AppEmbed('#embed', {
967
- * ... // other app view config
968
- * fullHeight: true,
969
- * minimumHeight: 600,
970
- * });
971
- * ```
972
- */
973
- minimumHeight?: number;
974
858
  /**
975
859
  * To enable the homepage announcement banner.
976
860
  * Controls the visibility of the announcement section
@@ -1022,6 +906,21 @@ export interface AppViewConfig extends AllEmbedViewConfig {
1022
906
  * ```
1023
907
  */
1024
908
  updatedSpotterExperience?: boolean;
909
+
910
+ /**
911
+ * If set to `true`, the answer edit panel is hidden.
912
+ *
913
+ * Supported embed types: `AppEmbed`
914
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
915
+ * @example
916
+ * ```js
917
+ * const embed = new AppEmbed('#tsEmbed', {
918
+ * ... // other embed view config
919
+ * hideAnswerEditPanel: true,
920
+ * })
921
+ * ```
922
+ */
923
+ hideAnswerEditPanel?: boolean;
1025
924
  }
1026
925
 
1027
926
  /**
@@ -1044,33 +943,22 @@ export interface AppEmbedAppInitData extends DefaultAppInitData {
1044
943
  export class AppEmbed extends V1Embed {
1045
944
  protected viewConfig: AppViewConfig;
1046
945
 
1047
- private defaultHeight = 500;
1048
-
1049
- private lazyLoadScrollContainers: HTMLElement[] = [];
1050
-
1051
- private lazyLoadResizeObserver: ResizeObserver | undefined;
946
+ private readonly fullHeightController?: FullHeightController;
1052
947
 
1053
948
  constructor(domSelector: DOMSelector, viewConfig: AppViewConfig) {
1054
949
  viewConfig.embedComponentType = 'AppEmbed';
1055
950
  super(domSelector, viewConfig);
1056
951
  if (this.viewConfig.fullHeight === true) {
1057
- if (this.viewConfig.lazyLoadingForFullHeight === undefined) {
1058
- this.viewConfig.lazyLoadingForFullHeight = true;
1059
- }
1060
- if (this.viewConfig.enableScrollableContainerLazyLoading === undefined) {
1061
- this.viewConfig.enableScrollableContainerLazyLoading = true;
1062
- }
1063
- if (this.viewConfig.lazyLoadingMargin === undefined) {
1064
- this.viewConfig.lazyLoadingMargin = DEFAULT_LAZY_LOADING_MARGIN;
1065
- }
1066
-
1067
- this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
1068
- this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
1069
- this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
1070
- this.on(
1071
- EmbedEvent.RequestVisibleEmbedCoordinates,
1072
- this.requestVisibleEmbedCoordinatesHandler,
1073
- );
952
+ this.fullHeightController = new FullHeightController(this.viewConfig, {
953
+ getIframe: () => this.iFrame,
954
+ setFrameHeight: (height) => this.setIFrameHeight(height),
955
+ on: (eventType, callback) => {
956
+ this.on(eventType, callback);
957
+ },
958
+ trigger: (hostEvent, data) => {
959
+ this.trigger(hostEvent, data);
960
+ },
961
+ });
1074
962
  }
1075
963
  }
1076
964
 
@@ -1103,7 +991,7 @@ export class AppEmbed extends V1Embed {
1103
991
  * embedded Liveboard or visualization.
1104
992
  */
1105
993
  protected getEmbedParams() {
1106
- const params = this.getEmbedParamsObject();
994
+ const params = this.getUrlQueryParamsObject();
1107
995
  return getQueryParamString(params, true);
1108
996
  }
1109
997
 
@@ -1122,7 +1010,6 @@ export class AppEmbed extends V1Embed {
1122
1010
  hideOrgSwitcher,
1123
1011
  enableSearchAssist,
1124
1012
  newConnectionsExperience,
1125
- fullHeight,
1126
1013
  dataPanelV2 = true,
1127
1014
  updatedSpotterExperience,
1128
1015
  hideLiveboardHeader = false,
@@ -1165,11 +1052,11 @@ export class AppEmbed extends V1Embed {
1165
1052
  enableStopAnswerGenerationEmbed,
1166
1053
  spotterChatConfig,
1167
1054
  spotterDataSources,
1168
- minimumHeight,
1169
1055
  isThisPeriodInDateFiltersEnabled,
1170
1056
  enableHomepageAnnouncement = false,
1171
1057
  isContinuousLiveboardPDFEnabled,
1172
1058
  enableLiveboardDataCache,
1059
+ hideAnswerEditPanel,
1173
1060
  } = this.viewConfig;
1174
1061
 
1175
1062
  let params: any = {};
@@ -1207,6 +1094,9 @@ export class AppEmbed extends V1Embed {
1207
1094
  if (!isUndefined(coverAndFilterOptionInPDF)) {
1208
1095
  params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
1209
1096
  }
1097
+ if (!isUndefined(hideAnswerEditPanel)) {
1098
+ params[Param.ShowAnswerEditPanel] = !hideAnswerEditPanel;
1099
+ }
1210
1100
 
1211
1101
  params = this.getBaseQueryParams(params);
1212
1102
 
@@ -1270,15 +1160,7 @@ export class AppEmbed extends V1Embed {
1270
1160
  params[Param.HideNotification] = !!hideNotification;
1271
1161
  }
1272
1162
 
1273
- if (fullHeight === true) {
1274
- params[Param.fullHeight] = true;
1275
- if (this.viewConfig.lazyLoadingForFullHeight) {
1276
- params[Param.IsLazyLoadingForEmbedEnabled] = true;
1277
- if (isValidCssMargin(this.viewConfig.lazyLoadingMargin)) {
1278
- params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
1279
- }
1280
- }
1281
- }
1163
+ this.fullHeightController?.addQueryParams(params);
1282
1164
 
1283
1165
  if (tag) {
1284
1166
  params[Param.Tag] = tag;
@@ -1371,8 +1253,6 @@ export class AppEmbed extends V1Embed {
1371
1253
  params[Param.IsWYSIWYGLiveboardPDFEnabled] = isContinuousLiveboardPDFEnabled;
1372
1254
  }
1373
1255
 
1374
- this.defaultHeight = minimumHeight || this.defaultHeight;
1375
-
1376
1256
  if (enableLiveboardDataCache !== undefined) {
1377
1257
  params[Param.EnableLiveboardDataCache] = enableLiveboardDataCache;
1378
1258
  }
@@ -1428,32 +1308,6 @@ export class AppEmbed extends V1Embed {
1428
1308
  return params;
1429
1309
  }
1430
1310
 
1431
- private sendFullHeightLazyLoadData = () => {
1432
- const data = calculateVisibleElementData(
1433
- this.iFrame,
1434
- this.viewConfig.enableScrollableContainerLazyLoading,
1435
- );
1436
- // this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
1437
- if(this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight){
1438
- this.trigger(HostEvent.VisibleEmbedCoordinates, data);
1439
- }
1440
- }
1441
-
1442
- /**
1443
- * This is a handler for the RequestVisibleEmbedCoordinates event.
1444
- * It is used to send the visible coordinates data to the host application.
1445
- * @param data The event payload
1446
- * @param responder The responder function
1447
- */
1448
- private requestVisibleEmbedCoordinatesHandler = (data: MessagePayload, responder: any) => {
1449
- logger.info('Sending RequestVisibleEmbedCoordinates', data);
1450
- const visibleCoordinatesData = calculateVisibleElementData(
1451
- this.iFrame,
1452
- this.viewConfig.enableScrollableContainerLazyLoading,
1453
- );
1454
- responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
1455
- }
1456
-
1457
1311
  /**
1458
1312
  * Constructs the URL of the ThoughtSpot app page to be rendered.
1459
1313
  * @param pageId The ID of the page to be embedded.
@@ -1469,44 +1323,6 @@ export class AppEmbed extends V1Embed {
1469
1323
  return url;
1470
1324
  }
1471
1325
 
1472
- /**
1473
- * Set the iframe height as per the computed height received
1474
- * from the ThoughtSpot app.
1475
- * @param data The event payload
1476
- */
1477
- protected updateIFrameHeight = (data: MessagePayload) => {
1478
- this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
1479
- this.sendFullHeightLazyLoadData();
1480
- };
1481
-
1482
- private embedIframeCenter = (data: MessagePayload, responder: any) => {
1483
- const obj = this.getIframeCenter();
1484
- responder({ type: EmbedEvent.EmbedIframeCenter, data: obj });
1485
- };
1486
-
1487
- private setIframeHeightForNonEmbedLiveboard = (data: MessagePayload) => {
1488
- const { height: frameHeight } = this.viewConfig.frameParams || {};
1489
-
1490
- const liveboardRelatedRoutes = [
1491
- '/pinboard/',
1492
- '/insights/pinboard/',
1493
- '/schedules/',
1494
- '/embed/viz/',
1495
- '/embed/insights/viz/',
1496
- '/liveboard/',
1497
- '/insights/liveboard/',
1498
- '/tsl-editor/PINBOARD_ANSWER_BOOK/',
1499
- '/import-tsl/PINBOARD_ANSWER_BOOK/',
1500
- ];
1501
-
1502
- if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
1503
- // Ignore the height reset of the frame, if the navigation is
1504
- // only within the liveboard page.
1505
- return;
1506
- }
1507
- this.setIFrameHeight(frameHeight || this.defaultHeight);
1508
- };
1509
-
1510
1326
  /**
1511
1327
  * Gets the ThoughtSpot route of the page for a particular page ID.
1512
1328
  * @param pageId The identifier for a page in the ThoughtSpot app.
@@ -1596,53 +1412,11 @@ export class AppEmbed extends V1Embed {
1596
1412
  */
1597
1413
  public destroy() {
1598
1414
  super.destroy();
1599
- this.unregisterLazyLoadEvents();
1415
+ this.fullHeightController?.destroy();
1600
1416
  }
1601
1417
 
1602
1418
  private postRender() {
1603
- this.registerLazyLoadEvents();
1604
- }
1605
-
1606
- private registerLazyLoadEvents() {
1607
- if (!this.iFrame) {
1608
- return;
1609
- }
1610
- if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
1611
- this.unregisterLazyLoadEvents();
1612
- // TODO: Use passive: true, install modernizr to check for passive
1613
- window.addEventListener('resize', this.sendFullHeightLazyLoadData);
1614
- window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
1615
- if (!this.viewConfig.enableScrollableContainerLazyLoading) {
1616
- return;
1617
- }
1618
- this.lazyLoadScrollContainers = getScrollableAncestors(this.iFrame);
1619
- this.lazyLoadScrollContainers.forEach((scrollContainer) => {
1620
- scrollContainer.addEventListener('scroll', this.sendFullHeightLazyLoadData);
1621
- });
1622
- if (typeof ResizeObserver !== 'undefined') {
1623
- const resizeTargets = new Set([
1624
- this.iFrame.parentElement,
1625
- ...getEffectiveClippingAncestors(this.iFrame),
1626
- ].filter(Boolean) as HTMLElement[]);
1627
- this.lazyLoadResizeObserver = new ResizeObserver(this.sendFullHeightLazyLoadData);
1628
- resizeTargets.forEach((resizeTarget) => {
1629
- this.lazyLoadResizeObserver.observe(resizeTarget);
1630
- });
1631
- }
1632
- }
1633
- }
1634
-
1635
- private unregisterLazyLoadEvents() {
1636
- if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
1637
- window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
1638
- window.removeEventListener('scroll', this.sendFullHeightLazyLoadData, true);
1639
- this.lazyLoadResizeObserver?.disconnect();
1640
- this.lazyLoadResizeObserver = undefined;
1641
- this.lazyLoadScrollContainers.forEach((scrollContainer) => {
1642
- scrollContainer.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
1643
- });
1644
- this.lazyLoadScrollContainers = [];
1645
- }
1419
+ this.fullHeightController?.onRender();
1646
1420
  }
1647
1421
 
1648
1422
  /**
@@ -45,7 +45,8 @@ describe('startAutoMCPFrameRenderer', () => {
45
45
  getEmbedBasePathSpy.mockRestore();
46
46
  });
47
47
 
48
- // ─── helpers ──────────────────────────────────────────────────────────────
48
+ // ─── helpers
49
+ // ──────────────────────────────────────────────────────────────
49
50
 
50
51
  /** Capture the src passed to renderIFrame for the first tsmcp iframe added */
51
52
  async function captureRenderedSrc(viewConfig: AutoMCPFrameRendererViewConfig = {}): Promise<string> {
@@ -96,7 +97,8 @@ describe('startAutoMCPFrameRenderer', () => {
96
97
  return mockPort.postMessage.mock.calls[0]?.[0];
97
98
  }
98
99
 
99
- // ─── MutationObserver setup ───────────────────────────────────────────────
100
+ // ─── MutationObserver setup
101
+ // ───────────────────────────────────────────────
100
102
 
101
103
  describe('MutationObserver setup', () => {
102
104
  test('should return a MutationObserver', () => {
@@ -117,7 +119,8 @@ describe('startAutoMCPFrameRenderer', () => {
117
119
  });
118
120
  });
119
121
 
120
- // ─── iframe detection via tsmcp param ─────────────────────────────────────
122
+ // ─── iframe detection via tsmcp param
123
+ // ─────────────────────────────────────
121
124
 
122
125
  describe('iframe detection via tsmcp param', () => {
123
126
  test('should process directly-added iframes with tsmcp=true', async () => {
@@ -209,7 +212,8 @@ describe('startAutoMCPFrameRenderer', () => {
209
212
  });
210
213
  });
211
214
 
212
- // ─── handleInsertionIntoDOM override ──────────────────────────────────────
215
+ // ─── handleInsertionIntoDOM override
216
+ // ──────────────────────────────────────
213
217
 
214
218
  describe('handleInsertionIntoDOM override', () => {
215
219
  test('should replace the original iframe when renderIFrame inserts DOM', async () => {
@@ -233,7 +237,8 @@ describe('startAutoMCPFrameRenderer', () => {
233
237
  });
234
238
  });
235
239
 
236
- // ─── URL params forwarding ────────────────────────────────────────────────
240
+ // ─── URL params forwarding
241
+ // ────────────────────────────────────────────────
237
242
 
238
243
  describe('URL params forwarding', () => {
239
244
  test('should accept empty viewConfig', () => {
@@ -394,7 +399,8 @@ describe('startAutoMCPFrameRenderer', () => {
394
399
  });
395
400
  });
396
401
 
397
- // ─── frameParams forwarding ───────────────────────────────────────────────
402
+ // ─── frameParams forwarding
403
+ // ───────────────────────────────────────────────
398
404
 
399
405
  describe('frameParams forwarding', () => {
400
406
  test('frameParams.height and .width applied to the replacement iframe element', async () => {
@@ -441,7 +447,8 @@ describe('startAutoMCPFrameRenderer', () => {
441
447
  });
442
448
  });
443
449
 
444
- // ─── APP_INIT postMessage params forwarding ───────────────────────────────
450
+ // ─── APP_INIT postMessage params forwarding
451
+ // ───────────────────────────────
445
452
  //
446
453
  // These params are not in the iframe src URL — they travel via the APP_INIT
447
454
  // postMessage channel. AutoFrameRenderer inherits the TsEmbed APP_INIT
@@ -497,9 +504,10 @@ describe('startAutoMCPFrameRenderer', () => {
497
504
  });
498
505
 
499
506
  test('interceptUrls forwarded via APP_INIT', async () => {
500
- // The SDK expands InterceptedApiType enum values into resolved prism endpoint URLs.
501
- // Assert that the interceptUrls array is non-empty (i.e. the config was forwarded
502
- // and processed) rather than checking the resolved strings directly.
507
+ // The SDK expands InterceptedApiType enum values into resolved
508
+ // prism endpoint URLs. Assert that the interceptUrls array is
509
+ // non-empty (i.e. the config was forwarded and processed) rather
510
+ // than checking the resolved strings directly.
503
511
  const response = await getAppInitResponse({
504
512
  interceptUrls: [InterceptedApiType.AnswerData],
505
513
  });
@@ -513,7 +521,8 @@ describe('startAutoMCPFrameRenderer', () => {
513
521
  });
514
522
  });
515
523
 
516
- // ─── getMCPIframeSrc URL construction ─────────────────────────────────────
524
+ // ─── getMCPIframeSrc URL construction
525
+ // ─────────────────────────────────────
517
526
 
518
527
  describe('getMCPIframeSrc URL construction', () => {
519
528
  test('should strip tsmcp param and merge embed params into rendered src', async () => {
@@ -569,7 +578,8 @@ describe('startAutoMCPFrameRenderer', () => {
569
578
  document.body.appendChild(iframe);
570
579
  await new Promise((r) => setTimeout(r, 50));
571
580
 
572
- // At minimum the base embed params (hostAppUrl, sdkVersion, etc.) are always present
581
+ // At minimum the base embed params (hostAppUrl, sdkVersion, etc.)
582
+ // are always present
573
583
  expect(capturedSrc).toMatch(/\?[^#]+#/);
574
584
  observer.disconnect();
575
585
  });
@@ -594,7 +604,8 @@ describe('startAutoMCPFrameRenderer', () => {
594
604
  });
595
605
  });
596
606
 
597
- // ─── URL serialization parity with normal embeds ──────────────────────────
607
+ // ─── URL serialization parity with normal embeds
608
+ // ──────────────────────────
598
609
  //
599
610
  // These tests verify that array-typed params (hideAction, disableAction,
600
611
  // visibleAction) are serialized identically by startAutoMCPFrameRenderer
@@ -108,7 +108,7 @@ class AutoFrameRenderer extends TsEmbed {
108
108
  * @returns The constructed URL to use for the ThoughtSpot embed iframe.
109
109
  */
110
110
  private getMCPIframeSrc(sourceSrc: string) {
111
- const queryParams = this.getEmbedParamsObject();
111
+ const queryParams = this.getUrlQueryParamsObject();
112
112
  const sourceURL = new URL(sourceSrc);
113
113
  const existingQueryParams = sourceURL.searchParams;
114
114
  const existingQueryParamsObject = Object.fromEntries(existingQueryParams);
@@ -56,7 +56,7 @@ export class ConversationMessage extends TsEmbed {
56
56
  messageId,
57
57
  } = this.viewConfig;
58
58
  const path = 'conv-assist-answer';
59
- const queryParams = this.getEmbedParamsObject();
59
+ const queryParams = this.getUrlQueryParamsObject();
60
60
 
61
61
  let query = '';
62
62
  const queryParamsString = getQueryParamString(queryParams, true);
@@ -537,7 +537,7 @@ describe('ConversationEmbed', () => {
537
537
  );
538
538
  });
539
539
 
540
- it('should render the conversation embed with spotterAnalystConfig.analystId in the url', async () => {
540
+ it('should not add analystId to the url, it is sent over APP_INIT instead', async () => {
541
541
  const viewConfig: SpotterEmbedViewConfig = {
542
542
  worksheetId: 'worksheetId',
543
543
  searchOptions: {
@@ -549,37 +549,13 @@ describe('ConversationEmbed', () => {
549
549
  };
550
550
  const conversationEmbed = new SpotterEmbed(getRootEl(), viewConfig);
551
551
  await conversationEmbed.render();
552
+ expect(getIFrameSrc()).not.toContain('analystId');
552
553
  expectUrlMatchesWithParams(
553
554
  getIFrameSrc(),
554
- `http://${thoughtSpotHost}/v2/?${defaultParams}&isSpotterExperienceEnabled=true&analystId=analyst-id-1234#/embed/insights/conv-assist?worksheet=worksheetId&query=searchQuery`,
555
+ `http://${thoughtSpotHost}/v2/?${defaultParams}&isSpotterExperienceEnabled=true#/embed/insights/conv-assist?worksheet=worksheetId&query=searchQuery`,
555
556
  );
556
557
  });
557
558
 
558
- it('should not add analystId to the url when spotterAnalystConfig is not provided', async () => {
559
- const viewConfig: SpotterEmbedViewConfig = {
560
- worksheetId: 'worksheetId',
561
- searchOptions: {
562
- searchQuery: 'searchQuery',
563
- },
564
- };
565
- const conversationEmbed = new SpotterEmbed(getRootEl(), viewConfig);
566
- await conversationEmbed.render();
567
- expect(getIFrameSrc()).not.toContain('analystId');
568
- });
569
-
570
- it('should not add analystId to the url when spotterAnalystConfig is empty', async () => {
571
- const viewConfig: SpotterEmbedViewConfig = {
572
- worksheetId: 'worksheetId',
573
- searchOptions: {
574
- searchQuery: 'searchQuery',
575
- },
576
- spotterAnalystConfig: {},
577
- };
578
- const conversationEmbed = new SpotterEmbed(getRootEl(), viewConfig);
579
- await conversationEmbed.render();
580
- expect(getIFrameSrc()).not.toContain('analystId');
581
- });
582
-
583
559
  describe('spotter chat hiddenActions', () => {
584
560
  it.each([
585
561
  ['SpotterChatConnectorResources', Action.SpotterChatConnectorResources],
@@ -1057,4 +1033,39 @@ describe('SpotterEmbed APP_INIT starterPrompts', () => {
1057
1033
  quick: { questions: [{ label: 'Q1', prompt: 'P1' }] },
1058
1034
  });
1059
1035
  });
1036
+
1037
+ it('should include spotterAnalystConfig in embedParams when analystId is provided', async () => {
1038
+ const response = await getAppInitResponse({
1039
+ worksheetId: 'ws1',
1040
+ spotterAnalystConfig: { analystId: 'analyst-id-1234' },
1041
+ });
1042
+ expect(response.data.embedParams.spotterAnalystConfig).toEqual({
1043
+ analystId: 'analyst-id-1234',
1044
+ });
1045
+ });
1046
+
1047
+ it('should include spotterAnalystConfig alongside the other spotter embedParams', async () => {
1048
+ const response = await getAppInitResponse({
1049
+ worksheetId: 'ws1',
1050
+ spotterSidebarConfig: { enablePastConversationsSidebar: true },
1051
+ spotterAnalystConfig: { analystId: 'analyst-id-1234' },
1052
+ });
1053
+ expect(response.data.embedParams.spotterSidebarConfig.enablePastConversationsSidebar).toBe(true);
1054
+ expect(response.data.embedParams.spotterAnalystConfig).toEqual({
1055
+ analystId: 'analyst-id-1234',
1056
+ });
1057
+ });
1058
+
1059
+ it('should not include spotterAnalystConfig in embedParams when not configured', async () => {
1060
+ const response = await getAppInitResponse({ worksheetId: 'ws1' });
1061
+ expect(response.data.embedParams?.spotterAnalystConfig).toBeUndefined();
1062
+ });
1063
+
1064
+ it('should not include spotterAnalystConfig in embedParams when analystId is absent', async () => {
1065
+ const response = await getAppInitResponse({
1066
+ worksheetId: 'ws1',
1067
+ spotterAnalystConfig: {},
1068
+ });
1069
+ expect(response.data.embedParams?.spotterAnalystConfig).toBeUndefined();
1070
+ });
1060
1071
  });