@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
@@ -12,7 +12,6 @@ import { getPreview } from '../utils/graphql/preview-service';
12
12
  import { ERROR_MESSAGE } from '../errors';
13
13
  import {
14
14
  EmbedEvent,
15
- MessagePayload,
16
15
  Param,
17
16
  RuntimeFilter,
18
17
  DOMSelector,
@@ -20,23 +19,30 @@ import {
20
19
  SearchLiveboardCommonViewConfig as LiveboardOtherViewConfig,
21
20
  BaseViewConfig,
22
21
  LiveboardAppEmbedViewConfig,
22
+ FullHeightViewConfig,
23
23
  ErrorDetailsTypes,
24
24
  EmbedErrorCodes,
25
25
  EmbedErrorSeverity,
26
26
  ContextType,
27
27
  DefaultAppInitData,
28
28
  } from '../types';
29
- import { calculateVisibleElementData, getEffectiveClippingAncestors, getQueryParamString, getScrollableAncestors, isUndefined, isValidCssMargin, setParamIfDefined } from '../utils';
30
- import { DEFAULT_LAZY_LOADING_MARGIN } from '../config';
29
+ import { FullHeightController } from '../full-height';
30
+ import { getQueryParamString, isUndefined, setParamIfDefined } from '../utils';
31
31
  import { getAuthPromise } from './base';
32
32
  import { TsEmbed, V1Embed } from './ts-embed';
33
33
  import { addPreviewStylesIfNotPresent } from '../utils/global-styles';
34
- import { HostEventRequest, TriggerPayload, TriggerResponse } from './hostEventClient/contracts';
34
+ import { HostEventRequest, TriggerData, TriggerResponse } from '../contracts/host-event-contracts';
35
35
  import { logger } from '../utils/logger';
36
36
  import { SpotterChatViewConfig, StarterPromptsConfig } from './conversation';
37
37
  import { buildStarterPromptsAppInitData } from './spotter-utils';
38
38
  import { SpotterVizConfig, buildSpotterVizAppInitData } from './spotter-viz-utils';
39
39
 
40
+ // Home unmounts the liveboard container, which is how its state gets cleared.
41
+ // The settle window gives the container time to do it before we ask for the
42
+ // liveboard back.
43
+ const HOME_ROUTE = 'home';
44
+ const HOME_SETTLE_MS = 200;
45
+
40
46
  /**
41
47
  * APP_INIT data shape for LiveboardEmbed.
42
48
  * @internal
@@ -53,71 +59,11 @@ export interface LiveboardEmbedAppInitData extends DefaultAppInitData {
53
59
  * The configuration for the embedded Liveboard or visualization page view.
54
60
  * @group Embed components
55
61
  */
56
- export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewConfig, LiveboardAppEmbedViewConfig {
57
- /**
58
- * If set to true, the embedded object container dynamically resizes
59
- * according to the height of the Liveboard.
60
- *
61
- * **Note**: Using fullHeight loads all visualizations on the
62
- * Liveboard simultaneously, which results in multiple warehouse
63
- * queries and potentially a longer wait for the topmost
64
- * visualizations to display on the screen.
65
- * Setting `fullHeight` to `false` fetches visualizations
66
- * incrementally as users scroll the page to view the charts and tables.
67
- *
68
- * From SDK 1.52.0, enabling `fullHeight` also turns on
69
- * {@link lazyLoadingForFullHeight} and
70
- * {@link enableScrollableContainerLazyLoading}, so visualizations load as
71
- * they scroll into view. Set either flag to `false` to opt out.
72
- *
73
- *
74
- * Supported embed types: `LiveboardEmbed`
75
- * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 7.2.1
76
- * @example
77
- * ```js
78
- * const embed = new LiveboardEmbed('#embed', {
79
- * ... // other liveboard view config
80
- * fullHeight: true,
81
- * });
82
- * ```
83
- */
84
- fullHeight?: boolean;
85
- /**
86
- * This is the minimum height (in pixels) for a full-height Liveboard.
87
- * Setting this height helps resolve issues with empty Liveboards and
88
- * other screens navigable from a Liveboard.
89
- *
90
- * Supported embed types: `LiveboardEmbed`
91
- * @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
92
- * @deprecated Use `minimumHeight` instead.
93
- * @default 500
94
- * @example
95
- * ```js
96
- * const embed = new LiveboardEmbed('#embed', {
97
- * ... // other liveboard view config
98
- * fullHeight: true,
99
- * defaultHeight: 600,
100
- * });
101
- * ```
102
- */
103
- defaultHeight?: number;
104
- /**
105
- * This is the minimum height (in pixels) for a full-height Liveboard.
106
- * Setting this height helps resolve issues with empty Liveboards and
107
- * other screens navigable from a Liveboard.
108
- *
109
- * @version SDK: 1.44.2 | ThoughtSpot: 10.15.0.cl
110
- * @default 500
111
- * @example
112
- * ```js
113
- * const embed = new LiveboardEmbed('#embed', {
114
- * ... // other liveboard view config
115
- * fullHeight: true,
116
- * minimumHeight: 600,
117
- * });
118
- * ```
119
- */
120
- minimumHeight?: number;
62
+ export interface LiveboardViewConfig
63
+ extends BaseViewConfig,
64
+ FullHeightViewConfig,
65
+ LiveboardOtherViewConfig,
66
+ LiveboardAppEmbedViewConfig {
121
67
  /**
122
68
  * If set to true, the context menu in visualizations will be enabled.
123
69
  * @version SDK: 1.1.0 | ThoughtSpot: 8.1.0.sw
@@ -409,9 +355,10 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
409
355
  */
410
356
  isPNGInScheduledEmailsEnabled?: boolean;
411
357
  /**
412
- * Enables the 'what you see is what you get' PDF export for Liveboards. Each tab is rendered on a single page
413
- * following the exact UI layout, instead of splitting visualizations across multiple A4 pages.
414
- * This feature is GA from SDK version 1.51.0 and ThoughtSpot version 26.8.0.cl.
358
+ * Enables the 'what you see is what you get' PDF export for Liveboards. Each tab is
359
+ * rendered on a single page following the exact UI layout, instead of splitting
360
+ * visualizations across multiple A4 pages. This feature is GA from SDK version
361
+ * 1.51.0 and ThoughtSpot version 26.8.0.cl.
415
362
  *
416
363
  * Supported embed types: `AppEmbed`, `LiveboardEmbed`
417
364
  * @type {boolean}
@@ -463,77 +410,6 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
463
410
  * ```
464
411
  */
465
412
  isGranularXLSXCSVSchedulesEnabled?: boolean;
466
- /**
467
- * Loads visualizations only as they scroll into the viewport, instead of
468
- * loading the whole full-height Liveboard at once.
469
- *
470
- * From SDK 1.52.0 this is enabled automatically whenever `fullHeight` is
471
- * `true`. On SDK 1.51.0 and earlier it defaulted to `false` and had to be
472
- * set explicitly. Set it to `false` to load every visualization upfront.
473
- * The flag has no effect unless `fullHeight` is enabled.
474
- *
475
- * @type {boolean}
476
- * @version SDK: 1.40.0 | ThoughtSpot: 10.12.0.cl
477
- * @default true when `fullHeight` is enabled, from SDK 1.52.0
478
- * @example
479
- * ```js
480
- * const embed = new LiveboardEmbed('#embed-container', {
481
- * // ...other options
482
- * fullHeight: true,
483
- * lazyLoadingForFullHeight: true,
484
- * })
485
- * ```
486
- */
487
- lazyLoadingForFullHeight?: boolean;
488
- /**
489
- * Computes the visible region of the embed against its scrollable and
490
- * clipping ancestors, instead of treating the browser window as the only
491
- * viewport, and tracks scroll and resize on those ancestors.
492
- *
493
- * From SDK 1.52.0 this is enabled automatically whenever `fullHeight` is
494
- * `true`. On SDK 1.51.0 and earlier it defaulted to `false` and had to be
495
- * set explicitly. Set it to `false` when the page scrolls with the window
496
- * and the embed has no clipping ancestor, to skip the extra ancestor
497
- * tracking.
498
- *
499
- * @type {boolean}
500
- * @default true when `fullHeight` is enabled, from SDK 1.52.0
501
- */
502
- enableScrollableContainerLazyLoading?: boolean;
503
- /**
504
- * How far outside the viewport a visualization starts loading, when
505
- * {@link lazyLoadingForFullHeight} is enabled.
506
- *
507
- * For example, if the margin is set to '10px',
508
- * the visualization will be loaded 10px before its top edge is visible in the
509
- * viewport.
510
- *
511
- * The format is similar to CSS margin, so `'500px 0px'` extends the
512
- * prefetch 500px above and below the viewport and not sideways. Accepted
513
- * units are `px`, `em`, `rem`, `%`, `vh` and `vw`, plus bare `0` and
514
- * `auto`; an invalid value is logged and ignored.
515
- *
516
- * From SDK 1.52.0 this defaults to `'500px 0px'` — roughly one
517
- * visualization ahead of the scroll position, so a chart has usually
518
- * finished loading by the time it scrolls into view. Use a smaller margin
519
- * to cut warehouse queries further, or `'0px'` to load a visualization
520
- * only once it is actually visible.
521
- *
522
- * @type {string}
523
- * @version SDK: 1.40.0 | ThoughtSpot: 10.12.0.cl
524
- * @default '500px 0px' when `fullHeight` is enabled, from SDK 1.52.0
525
- * @example
526
- * ```js
527
- * const embed = new LiveboardEmbed('#embed-container', {
528
- * // ...other options
529
- * fullHeight: true,
530
- * lazyLoadingForFullHeight: true,
531
- * // Using 0px, the visualization will be only loaded when it's visible in the viewport.
532
- * lazyLoadingMargin: '0px',
533
- * })
534
- * ```
535
- */
536
- lazyLoadingMargin?: string;
537
413
  /**
538
414
  * showSpotterLimitations : show limitation text
539
415
  * of the spotter underneath the chat input.
@@ -689,36 +565,26 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
689
565
  export class LiveboardEmbed extends V1Embed {
690
566
  protected viewConfig: LiveboardViewConfig;
691
567
 
692
- private defaultHeight = 500;
693
-
694
- private lazyLoadScrollContainers: HTMLElement[] = [];
695
-
696
- private lazyLoadResizeObserver: ResizeObserver | undefined;
697
-
568
+ private readonly fullHeightController?: FullHeightController;
698
569
 
699
570
  constructor(domSelector: DOMSelector, viewConfig: LiveboardViewConfig) {
700
571
  viewConfig.embedComponentType = 'LiveboardEmbed';
701
572
  super(domSelector, viewConfig);
702
573
  if (this.viewConfig.fullHeight === true) {
703
574
  if (this.viewConfig.vizId) {
704
- logger.warn('Full height is currently only supported for Liveboard embeds.' +
705
- 'Using full height with vizId might lead to unexpected behavior.');
575
+ logger.warn('Full height is currently only supported for Liveboard embeds.'
576
+ + 'Using full height with vizId might lead to unexpected behavior.');
706
577
  }
707
-
708
- if (this.viewConfig.lazyLoadingForFullHeight === undefined) {
709
- this.viewConfig.lazyLoadingForFullHeight = true;
710
- }
711
- if (this.viewConfig.enableScrollableContainerLazyLoading === undefined) {
712
- this.viewConfig.enableScrollableContainerLazyLoading = true;
713
- }
714
- if (this.viewConfig.lazyLoadingMargin === undefined) {
715
- this.viewConfig.lazyLoadingMargin = DEFAULT_LAZY_LOADING_MARGIN;
716
- }
717
-
718
- this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
719
- this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
720
- this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
721
- this.on(EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
578
+ this.fullHeightController = new FullHeightController(this.viewConfig, {
579
+ getIframe: () => this.iFrame,
580
+ setFrameHeight: (height) => this.setIFrameHeight(height),
581
+ on: (eventType, callback) => {
582
+ this.on(eventType, callback);
583
+ },
584
+ trigger: (hostEvent, data) => {
585
+ this.trigger(hostEvent, data);
586
+ },
587
+ });
722
588
  }
723
589
  }
724
590
 
@@ -733,7 +599,7 @@ export class LiveboardEmbed extends V1Embed {
733
599
  * embedded Liveboard or visualization.
734
600
  */
735
601
  protected getEmbedParams() {
736
- const params = this.getEmbedParamsObject();
602
+ const params = this.getUrlQueryParamsObject();
737
603
  const queryParams = getQueryParamString(params, true);
738
604
  return queryParams;
739
605
  }
@@ -743,9 +609,6 @@ export class LiveboardEmbed extends V1Embed {
743
609
  params = this.getBaseQueryParams(params);
744
610
  const {
745
611
  enableVizTransformations,
746
- fullHeight,
747
- defaultHeight,
748
- minimumHeight,
749
612
  visibleVizs,
750
613
  liveboardV2,
751
614
  vizId,
@@ -794,16 +657,7 @@ export class LiveboardEmbed extends V1Embed {
794
657
  const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
795
658
  || this.viewConfig.preventPinboardFilterRemoval;
796
659
 
797
- if (fullHeight === true) {
798
- params[Param.fullHeight] = true;
799
- if (this.viewConfig.lazyLoadingForFullHeight) {
800
- params[Param.IsLazyLoadingForEmbedEnabled] = true;
801
- if (isValidCssMargin(this.viewConfig.lazyLoadingMargin)) {
802
- params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
803
- }
804
- }
805
- }
806
- this.defaultHeight = minimumHeight || defaultHeight || this.defaultHeight;
660
+ this.fullHeightController?.addQueryParams(params);
807
661
  if (enableVizTransformations !== undefined) {
808
662
  params[Param.EnableVizTransformations] = enableVizTransformations.toString();
809
663
  }
@@ -1018,32 +872,6 @@ export class LiveboardEmbed extends V1Embed {
1018
872
  return suffix;
1019
873
  }
1020
874
 
1021
- private sendFullHeightLazyLoadData = () => {
1022
- const data = calculateVisibleElementData(
1023
- this.iFrame,
1024
- this.viewConfig.enableScrollableContainerLazyLoading,
1025
- );
1026
- // this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
1027
- if(this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight){
1028
- this.trigger(HostEvent.VisibleEmbedCoordinates, data);
1029
- }
1030
- };
1031
-
1032
- /**
1033
- * This is a handler for the RequestVisibleEmbedCoordinates event.
1034
- * It is used to send the visible coordinates data to the host application.
1035
- * @param data The event payload
1036
- * @param responder The responder function
1037
- */
1038
- private requestVisibleEmbedCoordinatesHandler = (data: MessagePayload, responder: any) => {
1039
- logger.info('Sending RequestVisibleEmbedCoordinates', data);
1040
- const visibleCoordinatesData = calculateVisibleElementData(
1041
- this.iFrame,
1042
- this.viewConfig.enableScrollableContainerLazyLoading,
1043
- );
1044
- responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
1045
- }
1046
-
1047
875
  /**
1048
876
  * Construct the URL of the embedded ThoughtSpot Liveboard or visualization
1049
877
  * to be loaded within the iFrame.
@@ -1069,44 +897,6 @@ export class LiveboardEmbed extends V1Embed {
1069
897
  )}`;
1070
898
  }
1071
899
 
1072
- /**
1073
- * Set the iframe height as per the computed height received
1074
- * from the ThoughtSpot app.
1075
- * @param data The event payload
1076
- */
1077
- private updateIFrameHeight = (data: MessagePayload) => {
1078
- this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
1079
- this.sendFullHeightLazyLoadData();
1080
- };
1081
-
1082
- private embedIframeCenter = (data: MessagePayload, responder: any) => {
1083
- const obj = this.getIframeCenter();
1084
- responder({ type: EmbedEvent.EmbedIframeCenter, data: obj });
1085
- };
1086
-
1087
- private setIframeHeightForNonEmbedLiveboard = (data: MessagePayload) => {
1088
- const { height: frameHeight } = this.viewConfig.frameParams || {};
1089
-
1090
- const liveboardRelatedRoutes = [
1091
- '/pinboard/',
1092
- '/insights/pinboard/',
1093
- '/schedules/',
1094
- '/embed/viz/',
1095
- '/embed/insights/viz/',
1096
- '/liveboard/',
1097
- '/insights/liveboard/',
1098
- '/tsl-editor/PINBOARD_ANSWER_BOOK/',
1099
- '/import-tsl/PINBOARD_ANSWER_BOOK/',
1100
- ];
1101
-
1102
- if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
1103
- // Ignore the height reset of the frame, if the navigation is
1104
- // only within the liveboard page.
1105
- return;
1106
- }
1107
- this.setIFrameHeight(frameHeight || this.defaultHeight);
1108
- };
1109
-
1110
900
  private setActiveTab(data: { tabId: string }) {
1111
901
  if (!this.viewConfig.vizId) {
1112
902
  const prefixPath = this.iFrame.src.split('#/')[1].split('/tab')[0];
@@ -1163,26 +953,59 @@ export class LiveboardEmbed extends V1Embed {
1163
953
 
1164
954
  protected beforePrerenderVisible(): void {
1165
955
  super.beforePrerenderVisible();
1166
- const embedObj = this.getPreRenderObj<LiveboardEmbed>();
1167
956
 
1168
- this.executeAfterEmbedContainerLoaded(() => {
957
+ // Captured before showPreRender() hands the wrapper over to this
958
+ // instance. Itself means a hide/show, not a hand-over, so there is
959
+ // nothing stale to clear.
960
+ const previous = this.getPreRenderObj<LiveboardEmbed>();
961
+ const showing = previous === this ? undefined : previous?.currentLiveboardState;
962
+
963
+ this.executeAfterEmbedContainerLoaded(async () => {
964
+ // Without this the params callback suspends on its await and
965
+ // Navigate goes out first, so the container loads with the previous
966
+ // config's filters.
967
+ await this.preRenderParamsApplied;
968
+ if (this.isShowingLiveboardRoute(showing)) {
969
+ // Navigate to the route we are already on is a no-op, so the
970
+ // liveboard keeps its state. Home unmounts the container, which
971
+ // clears it.
972
+ this.trigger(HostEvent.Navigate, HOME_ROUTE)
973
+ .catch((error) => logger.warn('Could not route via home', error));
974
+ // Not awaited above: the container never acks Navigate, so
975
+ // that promise only settles on the 30s trigger timeout.
976
+ await new Promise((resolve) => {
977
+ setTimeout(resolve, HOME_SETTLE_MS);
978
+ });
979
+ }
1169
980
  this.navigateToLiveboard(
1170
981
  this.viewConfig.liveboardId,
1171
982
  this.viewConfig.vizId,
1172
983
  this.viewConfig.activeTabId,
1173
984
  this.viewConfig.personalizedViewId,
1174
985
  );
1175
- if (embedObj) {
1176
- embedObj.currentLiveboardState = {
1177
- liveboardId: this.viewConfig.liveboardId,
1178
- vizId: this.viewConfig.vizId,
1179
- activeTabId: this.viewConfig.activeTabId,
1180
- personalizedViewId: this.viewConfig.personalizedViewId,
1181
- };
1182
- }
986
+ this.currentLiveboardState = {
987
+ liveboardId: this.viewConfig.liveboardId,
988
+ vizId: this.viewConfig.vizId,
989
+ activeTabId: this.viewConfig.activeTabId,
990
+ personalizedViewId: this.viewConfig.personalizedViewId,
991
+ };
1183
992
  });
1184
993
  }
1185
994
 
995
+ // The whole route, not just the liveboard id: the path is built from the
996
+ // viz, tab and view too, so a same-liveboard show onto another tab is a
997
+ // real navigation.
998
+ private isShowingLiveboardRoute(showing?: LiveboardEmbed['currentLiveboardState']): boolean {
999
+ if (!showing?.liveboardId) return false;
1000
+ const {
1001
+ liveboardId, vizId, activeTabId, personalizedViewId,
1002
+ } = this.viewConfig;
1003
+ return showing.liveboardId === liveboardId
1004
+ && showing.vizId === vizId
1005
+ && showing.activeTabId === activeTabId
1006
+ && showing.personalizedViewId === personalizedViewId;
1007
+ }
1008
+
1186
1009
  protected async handleRenderForPrerender(): Promise<TsEmbed> {
1187
1010
  if (isUndefined(this.viewConfig.liveboardId)) {
1188
1011
  return this.prerenderGeneric();
@@ -1192,8 +1015,10 @@ export class LiveboardEmbed extends V1Embed {
1192
1015
 
1193
1016
  /**
1194
1017
  * Triggers an event to the embedded app
1018
+ * Payload typing follows {@link TsEmbed.trigger}: unknown fields fail to compile
1019
+ * from SDK 1.52.0; strict contract checks land in SDK 1.54.0.
1195
1020
  * @param {HostEvent} messageType The event type
1196
- * @param {any} data The payload to send with the message
1021
+ * @param {TriggerData} data The payload, typed against the event's contract
1197
1022
  * @returns A promise that resolves with the response from the embedded app
1198
1023
  */
1199
1024
  public trigger<
@@ -1204,7 +1029,9 @@ export class LiveboardEmbed extends V1Embed {
1204
1029
  ContextT extends ContextType = ContextType,
1205
1030
  >(
1206
1031
  messageType: HostEventT,
1207
- data: TriggerPayload<PayloadT, HostEventT> = ({} as any),
1032
+ // Mirror TsEmbed.trigger: contract shape is the contextual type and
1033
+ // unknown fields on object literals are flagged. Strict in SDK 1.54.0.
1034
+ data: TriggerData<HostEventT> = ({} as any),
1208
1035
  context?: ContextT,
1209
1036
  ): Promise<TriggerResponse<PayloadT, HostEventT, ContextT>> {
1210
1037
  const dataWithVizId: any = data;
@@ -1223,53 +1050,11 @@ export class LiveboardEmbed extends V1Embed {
1223
1050
  */
1224
1051
  public destroy() {
1225
1052
  super.destroy();
1226
- this.unregisterLazyLoadEvents();
1053
+ this.fullHeightController?.destroy();
1227
1054
  }
1228
1055
 
1229
1056
  private postRender() {
1230
- this.registerLazyLoadEvents();
1231
- }
1232
-
1233
- private registerLazyLoadEvents() {
1234
- if(!this.iFrame) {
1235
- return;
1236
- }
1237
- if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
1238
- this.unregisterLazyLoadEvents();
1239
- // TODO: Use passive: true, install modernizr to check for passive
1240
- window.addEventListener('resize', this.sendFullHeightLazyLoadData);
1241
- window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
1242
- if (!this.viewConfig.enableScrollableContainerLazyLoading) {
1243
- return;
1244
- }
1245
- this.lazyLoadScrollContainers = getScrollableAncestors(this.iFrame);
1246
- this.lazyLoadScrollContainers.forEach((scrollContainer) => {
1247
- scrollContainer.addEventListener('scroll', this.sendFullHeightLazyLoadData);
1248
- });
1249
- if (typeof ResizeObserver !== 'undefined') {
1250
- const resizeTargets = new Set([
1251
- this.iFrame.parentElement,
1252
- ...getEffectiveClippingAncestors(this.iFrame),
1253
- ].filter(Boolean) as HTMLElement[]);
1254
- this.lazyLoadResizeObserver = new ResizeObserver(this.sendFullHeightLazyLoadData);
1255
- resizeTargets.forEach((resizeTarget) => {
1256
- this.lazyLoadResizeObserver.observe(resizeTarget);
1257
- });
1258
- }
1259
- }
1260
- }
1261
-
1262
- private unregisterLazyLoadEvents() {
1263
- if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
1264
- window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
1265
- window.removeEventListener('scroll', this.sendFullHeightLazyLoadData, true);
1266
- this.lazyLoadResizeObserver?.disconnect();
1267
- this.lazyLoadResizeObserver = undefined;
1268
- this.lazyLoadScrollContainers.forEach((scrollContainer) => {
1269
- scrollContainer.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
1270
- });
1271
- this.lazyLoadScrollContainers = [];
1272
- }
1057
+ this.fullHeightController?.onRender();
1273
1058
  }
1274
1059
 
1275
1060
  /**
@@ -163,7 +163,7 @@ export class SearchBarEmbed extends TsEmbed {
163
163
  * @param dataSources A list of data source GUIDs
164
164
  */
165
165
  private getIFrameSrc() {
166
- const queryParams = this.getEmbedParamsObject();
166
+ const queryParams = this.getUrlQueryParamsObject();
167
167
  const path = 'search-bar-embed';
168
168
 
169
169
  let query = '';
@@ -438,6 +438,58 @@ describe('Search embed tests', () => {
438
438
  });
439
439
  });
440
440
 
441
+ test('should set visibility and disable state for Chart Settings V2 menu items', async () => {
442
+ expect(Action.ChartTypeSettings).toBe('CHART_TYPE');
443
+ expect(Action.LayoutSettings).toBe('LAYOUT');
444
+ expect(Action.ColumnSettings).toBe('COLUMN');
445
+ expect(Action.AxisSettings).toBe('AXIS');
446
+ expect(Action.DataLabelSettings).toBe('DATA_LABEL');
447
+ expect(Action.TooltipSettings).toBe('TOOLTIP');
448
+ expect(Action.LegendSettings).toBe('LEGEND');
449
+ expect(Action.DisplaySettings).toBe('DISPLAY');
450
+ expect(Action.QuerySettings).toBe('QUERY_DETAILS');
451
+ expect(Action.CustomSettings).toBe('CUSTOM_ACTION');
452
+ expect(Action.MuzeAiSettings).toBe('MUZE_AI');
453
+ expect(Action.RAnalysisSettings).toBe('R_ANALYSIS');
454
+
455
+ const chartSettingsActions = [
456
+ Action.ChartTypeSettings,
457
+ Action.LayoutSettings,
458
+ Action.ColumnSettings,
459
+ Action.AxisSettings,
460
+ Action.DataLabelSettings,
461
+ Action.TooltipSettings,
462
+ Action.LegendSettings,
463
+ Action.DisplaySettings,
464
+ Action.QuerySettings,
465
+ Action.CustomSettings,
466
+ Action.MuzeAiSettings,
467
+ Action.RAnalysisSettings,
468
+ ];
469
+ const searchEmbed = new SearchEmbed(getRootEl(), {
470
+ hiddenActions: chartSettingsActions,
471
+ disabledActions: chartSettingsActions,
472
+ disabledActionReason: 'Access denied',
473
+ ...defaultViewConfig,
474
+ answerId,
475
+ });
476
+ searchEmbed.render();
477
+ const hideActionUrl = fixedEncodeURI(
478
+ JSON.stringify([
479
+ Action.ReportError,
480
+ ...chartSettingsActions,
481
+ ...HiddenActionItemByDefaultForSearchEmbed,
482
+ ]),
483
+ );
484
+ const disableActionUrl = fixedEncodeURI(JSON.stringify(chartSettingsActions));
485
+ await executeAfterWait(() => {
486
+ expectUrlMatchesWithParams(
487
+ getIFrameSrc(),
488
+ `http://${thoughtSpotHost}/v2/?${defaultParams}&disableAction=${disableActionUrl}&disableHint=Access%20denied&hideAction=${hideActionUrl}&dataSourceMode=expand&useLastSelectedSources=false${prefixParams}#/embed/saved-answer/${answerId}`,
489
+ );
490
+ });
491
+ });
492
+
441
493
  test('should load saved answer', async () => {
442
494
  const searchEmbed = new SearchEmbed(getRootEl(), {
443
495
  ...defaultViewConfig,
@@ -584,6 +636,34 @@ describe('Search embed tests', () => {
584
636
  });
585
637
  });
586
638
 
639
+ test('Should add showAnswerEditPanel flag set to false to the iframe src when hideAnswerEditPanel is true', async () => {
640
+ const searchEmbed = new SearchEmbed(getRootEl(), {
641
+ ...defaultViewConfig,
642
+ hideAnswerEditPanel: true,
643
+ });
644
+ searchEmbed.render();
645
+ await executeAfterWait(() => {
646
+ expectUrlMatchesWithParams(
647
+ getIFrameSrc(),
648
+ `http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&showAnswerEditPanel=false&dataSourceMode=expand&useLastSelectedSources=false${prefixParams}#/embed/answer`,
649
+ );
650
+ });
651
+ });
652
+
653
+ test('Should add showAnswerEditPanel flag set to true to the iframe src when hideAnswerEditPanel is false', async () => {
654
+ const searchEmbed = new SearchEmbed(getRootEl(), {
655
+ ...defaultViewConfig,
656
+ hideAnswerEditPanel: false,
657
+ });
658
+ searchEmbed.render();
659
+ await executeAfterWait(() => {
660
+ expectUrlMatchesWithParams(
661
+ getIFrameSrc(),
662
+ `http://${thoughtSpotHost}/v2/?${defaultParamsWithHiddenActions}&showAnswerEditPanel=true&dataSourceMode=expand&useLastSelectedSources=false${prefixParams}#/embed/answer`,
663
+ );
664
+ });
665
+ });
666
+
587
667
  test('should set dataPanelCustomGroupsAccordionInitialState to EXPAND_FIRST when passed', async () => {
588
668
  const searchEmbed = new SearchBarEmbed(getRootEl() as any, {
589
669
  ...defaultViewConfig,
@@ -774,6 +854,29 @@ test('should pass forceTable parameter when forceTable is true', async () => {
774
854
  });
775
855
 
776
856
  describe('SearchBarEmbed tests', () => {
857
+ test('should keep view config off the URL when excludeConfigFromURL is set', async () => {
858
+ const searchBarEmbed = new SearchBarEmbed(getRootEl() as any, {
859
+ ...defaultViewConfig,
860
+ dataSources: ['source-1', 'source-2'],
861
+ additionalFlags: { excludeConfigFromURL: true },
862
+ } as any);
863
+ searchBarEmbed.render();
864
+ await executeAfterWait(() => {
865
+ const iframeSrc = getIFrameSrc();
866
+
867
+ // Bootstrap params stay: the handshake, the embed marker that
868
+ // picks the app shell, and the data sources it boots against.
869
+ expect(iframeSrc).toContain('hostAppUrl=');
870
+ expect(iframeSrc).toContain('isSearchEmbed=true');
871
+ expect(iframeSrc).toContain('dataSources');
872
+
873
+ // The rest of the view config goes over
874
+ // HostEvent.UpdateEmbedParams.
875
+ expect(iframeSrc).not.toContain('hideAction');
876
+ expect(iframeSrc).not.toContain('useLastSelectedDataSource');
877
+ });
878
+ });
879
+
777
880
  test('should pass dataSources parameter when dataSources array is provided', async () => {
778
881
  const searchBarEmbed = new SearchBarEmbed(getRootEl() as any, {
779
882
  ...defaultViewConfig,