@thoughtspot/visual-embed-sdk 1.51.2 → 1.52.1

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 (316) hide show
  1. package/cjs/package.json +9 -1
  2. package/cjs/src/api-intercept.d.ts.map +1 -1
  3. package/cjs/src/api-intercept.js +1 -0
  4. package/cjs/src/api-intercept.js.map +1 -1
  5. package/cjs/src/contracts/contracts.spec.d.ts +2 -0
  6. package/cjs/src/contracts/contracts.spec.d.ts.map +1 -0
  7. package/cjs/src/contracts/contracts.spec.js +345 -0
  8. package/cjs/src/contracts/contracts.spec.js.map +1 -0
  9. package/cjs/src/contracts/embed-event-payloads.d.ts +73 -0
  10. package/cjs/src/contracts/embed-event-payloads.d.ts.map +1 -0
  11. package/cjs/src/contracts/embed-event-payloads.js +3 -0
  12. package/cjs/src/contracts/embed-event-payloads.js.map +1 -0
  13. package/cjs/src/contracts/host-event-contracts.d.ts +378 -0
  14. package/cjs/src/contracts/host-event-contracts.d.ts.map +1 -0
  15. package/cjs/src/contracts/host-event-contracts.js +3 -0
  16. package/cjs/src/contracts/host-event-contracts.js.map +1 -0
  17. package/cjs/src/contracts/index.d.ts +22 -0
  18. package/cjs/src/contracts/index.d.ts.map +1 -0
  19. package/cjs/src/contracts/index.js +33 -0
  20. package/cjs/src/contracts/index.js.map +1 -0
  21. package/cjs/src/contracts/ui-passthrough-contracts.d.ts +277 -0
  22. package/cjs/src/contracts/ui-passthrough-contracts.d.ts.map +1 -0
  23. package/cjs/src/{embed/hostEventClient/contracts.js → contracts/ui-passthrough-contracts.js} +6 -2
  24. package/cjs/src/contracts/ui-passthrough-contracts.js.map +1 -0
  25. package/cjs/src/css-variables.d.ts +1 -1
  26. package/cjs/src/embed/app.d.ts +17 -140
  27. package/cjs/src/embed/app.d.ts.map +1 -1
  28. package/cjs/src/embed/app.js +20 -120
  29. package/cjs/src/embed/app.js.map +1 -1
  30. package/cjs/src/embed/app.spec.js +70 -26
  31. package/cjs/src/embed/app.spec.js.map +1 -1
  32. package/cjs/src/embed/conversation.d.ts +5 -5
  33. package/cjs/src/embed/events.spec.js +12 -2
  34. package/cjs/src/embed/events.spec.js.map +1 -1
  35. package/cjs/src/embed/hostEventClient/host-event-client.d.ts +3 -2
  36. package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  37. package/cjs/src/embed/hostEventClient/host-event-client.js +23 -18
  38. package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
  39. package/cjs/src/embed/hostEventClient/host-event-client.spec.js +36 -36
  40. package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  41. package/cjs/src/embed/hostEventClient/utils.d.ts +1 -1
  42. package/cjs/src/embed/hostEventClient/utils.d.ts.map +1 -1
  43. package/cjs/src/embed/hostEventClient/utils.js +3 -3
  44. package/cjs/src/embed/hostEventClient/utils.js.map +1 -1
  45. package/cjs/src/embed/liveboard.d.ts +9 -161
  46. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  47. package/cjs/src/embed/liveboard.js +68 -135
  48. package/cjs/src/embed/liveboard.js.map +1 -1
  49. package/cjs/src/embed/liveboard.spec.js +215 -32
  50. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  51. package/cjs/src/embed/search.d.ts +14 -0
  52. package/cjs/src/embed/search.d.ts.map +1 -1
  53. package/cjs/src/embed/search.js +4 -1
  54. package/cjs/src/embed/search.js.map +1 -1
  55. package/cjs/src/embed/search.spec.js +65 -0
  56. package/cjs/src/embed/search.spec.js.map +1 -1
  57. package/cjs/src/embed/ts-embed.d.ts +21 -25
  58. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  59. package/cjs/src/embed/ts-embed.js +105 -72
  60. package/cjs/src/embed/ts-embed.js.map +1 -1
  61. package/cjs/src/embed/ts-embed.spec.d.ts.map +1 -1
  62. package/cjs/src/embed/ts-embed.spec.js +380 -33
  63. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  64. package/cjs/src/full-height.d.ts +137 -0
  65. package/cjs/src/full-height.d.ts.map +1 -0
  66. package/cjs/src/full-height.js +272 -0
  67. package/cjs/src/full-height.js.map +1 -0
  68. package/cjs/src/full-height.spec.d.ts +2 -0
  69. package/cjs/src/full-height.spec.d.ts.map +1 -0
  70. package/cjs/src/full-height.spec.js +835 -0
  71. package/cjs/src/full-height.spec.js.map +1 -0
  72. package/cjs/src/index.d.ts +4 -3
  73. package/cjs/src/index.d.ts.map +1 -1
  74. package/cjs/src/index.js +5 -4
  75. package/cjs/src/index.js.map +1 -1
  76. package/cjs/src/react/all-types-export.d.ts +1 -1
  77. package/cjs/src/react/all-types-export.d.ts.map +1 -1
  78. package/cjs/src/react/all-types-export.js +2 -1
  79. package/cjs/src/react/all-types-export.js.map +1 -1
  80. package/cjs/src/react/all-types-export.parity.spec.js +55 -3
  81. package/cjs/src/react/all-types-export.parity.spec.js.map +1 -1
  82. package/cjs/src/react/index.d.ts +8 -8
  83. package/cjs/src/react/index.d.ts.map +1 -1
  84. package/cjs/src/react/index.js +1 -1
  85. package/cjs/src/react/index.js.map +1 -1
  86. package/cjs/src/react/index.spec.js +7 -7
  87. package/cjs/src/react/index.spec.js.map +1 -1
  88. package/cjs/src/types.d.ts +664 -39
  89. package/cjs/src/types.d.ts.map +1 -1
  90. package/cjs/src/types.js +406 -13
  91. package/cjs/src/types.js.map +1 -1
  92. package/cjs/src/utils/processTrigger.d.ts +3 -1
  93. package/cjs/src/utils/processTrigger.d.ts.map +1 -1
  94. package/cjs/src/utils/processTrigger.js +19 -51
  95. package/cjs/src/utils/processTrigger.js.map +1 -1
  96. package/cjs/src/utils/transport/iframe-transport.d.ts +55 -0
  97. package/cjs/src/utils/transport/iframe-transport.d.ts.map +1 -0
  98. package/cjs/src/utils/transport/iframe-transport.js +108 -0
  99. package/cjs/src/utils/transport/iframe-transport.js.map +1 -0
  100. package/cjs/src/utils/transport/iframe-transport.spec.d.ts +2 -0
  101. package/cjs/src/utils/transport/iframe-transport.spec.d.ts.map +1 -0
  102. package/cjs/src/utils/transport/iframe-transport.spec.js +140 -0
  103. package/cjs/src/utils/transport/iframe-transport.spec.js.map +1 -0
  104. package/cjs/src/utils.d.ts +18 -0
  105. package/cjs/src/utils.d.ts.map +1 -1
  106. package/cjs/src/utils.js +39 -1
  107. package/cjs/src/utils.js.map +1 -1
  108. package/cjs/src/utils.spec.js +62 -0
  109. package/cjs/src/utils.spec.js.map +1 -1
  110. package/dist/{index-D8_Zs-Nr.js → index-C1pmYb5H.js} +1 -1
  111. package/dist/src/api-intercept.d.ts.map +1 -1
  112. package/dist/src/contracts/contracts.spec.d.ts +2 -0
  113. package/dist/src/contracts/contracts.spec.d.ts.map +1 -0
  114. package/dist/src/contracts/embed-event-payloads.d.ts +73 -0
  115. package/dist/src/contracts/embed-event-payloads.d.ts.map +1 -0
  116. package/dist/src/contracts/host-event-contracts.d.ts +378 -0
  117. package/dist/src/contracts/host-event-contracts.d.ts.map +1 -0
  118. package/dist/src/contracts/index.d.ts +22 -0
  119. package/dist/src/contracts/index.d.ts.map +1 -0
  120. package/dist/src/contracts/ui-passthrough-contracts.d.ts +277 -0
  121. package/dist/src/contracts/ui-passthrough-contracts.d.ts.map +1 -0
  122. package/dist/src/css-variables.d.ts +1 -1
  123. package/dist/src/embed/app.d.ts +17 -140
  124. package/dist/src/embed/app.d.ts.map +1 -1
  125. package/dist/src/embed/conversation.d.ts +5 -5
  126. package/dist/src/embed/hostEventClient/host-event-client.d.ts +3 -2
  127. package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  128. package/dist/src/embed/hostEventClient/utils.d.ts +1 -1
  129. package/dist/src/embed/hostEventClient/utils.d.ts.map +1 -1
  130. package/dist/src/embed/liveboard.d.ts +9 -161
  131. package/dist/src/embed/liveboard.d.ts.map +1 -1
  132. package/dist/src/embed/search.d.ts +14 -0
  133. package/dist/src/embed/search.d.ts.map +1 -1
  134. package/dist/src/embed/ts-embed.d.ts +21 -25
  135. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  136. package/dist/src/embed/ts-embed.spec.d.ts.map +1 -1
  137. package/dist/src/full-height.d.ts +137 -0
  138. package/dist/src/full-height.d.ts.map +1 -0
  139. package/dist/src/full-height.spec.d.ts +2 -0
  140. package/dist/src/full-height.spec.d.ts.map +1 -0
  141. package/dist/src/index.d.ts +4 -3
  142. package/dist/src/index.d.ts.map +1 -1
  143. package/dist/src/react/all-types-export.d.ts +1 -1
  144. package/dist/src/react/all-types-export.d.ts.map +1 -1
  145. package/dist/src/react/index.d.ts +8 -8
  146. package/dist/src/react/index.d.ts.map +1 -1
  147. package/dist/src/types.d.ts +664 -39
  148. package/dist/src/types.d.ts.map +1 -1
  149. package/dist/src/utils/processTrigger.d.ts +3 -1
  150. package/dist/src/utils/processTrigger.d.ts.map +1 -1
  151. package/dist/src/utils/transport/iframe-transport.d.ts +55 -0
  152. package/dist/src/utils/transport/iframe-transport.d.ts.map +1 -0
  153. package/dist/src/utils/transport/iframe-transport.spec.d.ts +2 -0
  154. package/dist/src/utils/transport/iframe-transport.spec.d.ts.map +1 -0
  155. package/dist/src/utils.d.ts +18 -0
  156. package/dist/src/utils.d.ts.map +1 -1
  157. package/dist/tsembed-react.es.js +1031 -392
  158. package/dist/tsembed-react.js +1030 -391
  159. package/dist/tsembed.es.js +1031 -392
  160. package/dist/tsembed.js +1029 -390
  161. package/dist/visual-embed-sdk-react-full.d.ts +1483 -693
  162. package/dist/visual-embed-sdk-react.d.ts +1364 -647
  163. package/dist/visual-embed-sdk.d.ts +1426 -659
  164. package/lib/package.json +9 -1
  165. package/lib/src/api-intercept.d.ts.map +1 -1
  166. package/lib/src/api-intercept.js +2 -1
  167. package/lib/src/api-intercept.js.map +1 -1
  168. package/lib/src/contracts/contracts.spec.d.ts +2 -0
  169. package/lib/src/contracts/contracts.spec.d.ts.map +1 -0
  170. package/lib/src/contracts/contracts.spec.js +342 -0
  171. package/lib/src/contracts/contracts.spec.js.map +1 -0
  172. package/lib/src/contracts/embed-event-payloads.d.ts +73 -0
  173. package/lib/src/contracts/embed-event-payloads.d.ts.map +1 -0
  174. package/lib/src/contracts/embed-event-payloads.js +2 -0
  175. package/lib/src/contracts/embed-event-payloads.js.map +1 -0
  176. package/lib/src/contracts/host-event-contracts.d.ts +378 -0
  177. package/lib/src/contracts/host-event-contracts.d.ts.map +1 -0
  178. package/lib/src/contracts/host-event-contracts.js +2 -0
  179. package/lib/src/contracts/host-event-contracts.js.map +1 -0
  180. package/lib/src/contracts/index.d.ts +22 -0
  181. package/lib/src/contracts/index.d.ts.map +1 -0
  182. package/lib/src/contracts/index.js +22 -0
  183. package/lib/src/contracts/index.js.map +1 -0
  184. package/lib/src/contracts/ui-passthrough-contracts.d.ts +277 -0
  185. package/lib/src/contracts/ui-passthrough-contracts.d.ts.map +1 -0
  186. package/lib/src/{embed/hostEventClient/contracts.js → contracts/ui-passthrough-contracts.js} +6 -2
  187. package/lib/src/contracts/ui-passthrough-contracts.js.map +1 -0
  188. package/lib/src/css-variables.d.ts +1 -1
  189. package/lib/src/embed/app.d.ts +17 -140
  190. package/lib/src/embed/app.d.ts.map +1 -1
  191. package/lib/src/embed/app.js +22 -122
  192. package/lib/src/embed/app.js.map +1 -1
  193. package/lib/src/embed/app.spec.js +70 -26
  194. package/lib/src/embed/app.spec.js.map +1 -1
  195. package/lib/src/embed/conversation.d.ts +5 -5
  196. package/lib/src/embed/events.spec.js +12 -2
  197. package/lib/src/embed/events.spec.js.map +1 -1
  198. package/lib/src/embed/hostEventClient/host-event-client.d.ts +3 -2
  199. package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  200. package/lib/src/embed/hostEventClient/host-event-client.js +6 -1
  201. package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
  202. package/lib/src/embed/hostEventClient/host-event-client.spec.js +1 -1
  203. package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  204. package/lib/src/embed/hostEventClient/utils.d.ts +1 -1
  205. package/lib/src/embed/hostEventClient/utils.d.ts.map +1 -1
  206. package/lib/src/embed/hostEventClient/utils.js +1 -1
  207. package/lib/src/embed/hostEventClient/utils.js.map +1 -1
  208. package/lib/src/embed/liveboard.d.ts +9 -161
  209. package/lib/src/embed/liveboard.d.ts.map +1 -1
  210. package/lib/src/embed/liveboard.js +70 -137
  211. package/lib/src/embed/liveboard.js.map +1 -1
  212. package/lib/src/embed/liveboard.spec.js +215 -32
  213. package/lib/src/embed/liveboard.spec.js.map +1 -1
  214. package/lib/src/embed/search.d.ts +14 -0
  215. package/lib/src/embed/search.d.ts.map +1 -1
  216. package/lib/src/embed/search.js +4 -1
  217. package/lib/src/embed/search.js.map +1 -1
  218. package/lib/src/embed/search.spec.js +65 -0
  219. package/lib/src/embed/search.spec.js.map +1 -1
  220. package/lib/src/embed/ts-embed.d.ts +21 -25
  221. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  222. package/lib/src/embed/ts-embed.js +106 -73
  223. package/lib/src/embed/ts-embed.js.map +1 -1
  224. package/lib/src/embed/ts-embed.spec.d.ts.map +1 -1
  225. package/lib/src/embed/ts-embed.spec.js +378 -31
  226. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  227. package/lib/src/full-height.d.ts +137 -0
  228. package/lib/src/full-height.d.ts.map +1 -0
  229. package/lib/src/full-height.js +268 -0
  230. package/lib/src/full-height.js.map +1 -0
  231. package/lib/src/full-height.spec.d.ts +2 -0
  232. package/lib/src/full-height.spec.d.ts.map +1 -0
  233. package/lib/src/full-height.spec.js +833 -0
  234. package/lib/src/full-height.spec.js.map +1 -0
  235. package/lib/src/index.d.ts +4 -3
  236. package/lib/src/index.d.ts.map +1 -1
  237. package/lib/src/index.js +3 -3
  238. package/lib/src/index.js.map +1 -1
  239. package/lib/src/react/all-types-export.d.ts +1 -1
  240. package/lib/src/react/all-types-export.d.ts.map +1 -1
  241. package/lib/src/react/all-types-export.js +1 -1
  242. package/lib/src/react/all-types-export.js.map +1 -1
  243. package/lib/src/react/all-types-export.parity.spec.js +55 -3
  244. package/lib/src/react/all-types-export.parity.spec.js.map +1 -1
  245. package/lib/src/react/index.d.ts +8 -8
  246. package/lib/src/react/index.d.ts.map +1 -1
  247. package/lib/src/react/index.js +1 -1
  248. package/lib/src/react/index.js.map +1 -1
  249. package/lib/src/react/index.spec.js +7 -7
  250. package/lib/src/react/index.spec.js.map +1 -1
  251. package/lib/src/types.d.ts +664 -39
  252. package/lib/src/types.d.ts.map +1 -1
  253. package/lib/src/types.js +405 -12
  254. package/lib/src/types.js.map +1 -1
  255. package/lib/src/utils/processTrigger.d.ts +3 -1
  256. package/lib/src/utils/processTrigger.d.ts.map +1 -1
  257. package/lib/src/utils/processTrigger.js +19 -51
  258. package/lib/src/utils/processTrigger.js.map +1 -1
  259. package/lib/src/utils/transport/iframe-transport.d.ts +55 -0
  260. package/lib/src/utils/transport/iframe-transport.d.ts.map +1 -0
  261. package/lib/src/utils/transport/iframe-transport.js +101 -0
  262. package/lib/src/utils/transport/iframe-transport.js.map +1 -0
  263. package/lib/src/utils/transport/iframe-transport.spec.d.ts +2 -0
  264. package/lib/src/utils/transport/iframe-transport.spec.d.ts.map +1 -0
  265. package/lib/src/utils/transport/iframe-transport.spec.js +138 -0
  266. package/lib/src/utils/transport/iframe-transport.spec.js.map +1 -0
  267. package/lib/src/utils.d.ts +18 -0
  268. package/lib/src/utils.d.ts.map +1 -1
  269. package/lib/src/utils.js +37 -0
  270. package/lib/src/utils.js.map +1 -1
  271. package/lib/src/utils.spec.js +63 -1
  272. package/lib/src/utils.spec.js.map +1 -1
  273. package/lib/src/visual-embed-sdk.d.ts +1426 -659
  274. package/package.json +9 -1
  275. package/src/api-intercept.ts +2 -1
  276. package/src/contracts/contracts.spec.ts +392 -0
  277. package/src/contracts/embed-event-payloads.ts +83 -0
  278. package/src/contracts/host-event-contracts.ts +456 -0
  279. package/src/contracts/index.ts +53 -0
  280. package/src/contracts/ui-passthrough-contracts.ts +301 -0
  281. package/src/css-variables.ts +1 -1
  282. package/src/embed/app.spec.ts +86 -34
  283. package/src/embed/app.ts +37 -264
  284. package/src/embed/conversation.ts +5 -5
  285. package/src/embed/events.spec.ts +14 -2
  286. package/src/embed/hostEventClient/host-event-client.spec.ts +2 -2
  287. package/src/embed/hostEventClient/host-event-client.ts +18 -5
  288. package/src/embed/hostEventClient/utils.ts +2 -1
  289. package/src/embed/liveboard.spec.ts +261 -42
  290. package/src/embed/liveboard.ts +78 -297
  291. package/src/embed/search.spec.ts +80 -0
  292. package/src/embed/search.ts +20 -0
  293. package/src/embed/ts-embed.spec.ts +518 -31
  294. package/src/embed/ts-embed.ts +133 -82
  295. package/src/full-height.spec.ts +1008 -0
  296. package/src/full-height.ts +361 -0
  297. package/src/index.ts +95 -5
  298. package/src/react/all-types-export.parity.spec.ts +63 -3
  299. package/src/react/all-types-export.ts +46 -0
  300. package/src/react/index.spec.tsx +7 -7
  301. package/src/react/index.tsx +9 -9
  302. package/src/types.ts +665 -37
  303. package/src/utils/processTrigger.ts +28 -58
  304. package/src/utils/transport/iframe-transport.spec.ts +177 -0
  305. package/src/utils/transport/iframe-transport.ts +122 -0
  306. package/src/utils.spec.ts +71 -0
  307. package/src/utils.ts +38 -0
  308. package/cjs/src/embed/hostEventClient/contracts.d.ts +0 -231
  309. package/cjs/src/embed/hostEventClient/contracts.d.ts.map +0 -1
  310. package/cjs/src/embed/hostEventClient/contracts.js.map +0 -1
  311. package/dist/src/embed/hostEventClient/contracts.d.ts +0 -231
  312. package/dist/src/embed/hostEventClient/contracts.d.ts.map +0 -1
  313. package/lib/src/embed/hostEventClient/contracts.d.ts +0 -231
  314. package/lib/src/embed/hostEventClient/contracts.d.ts.map +0 -1
  315. package/lib/src/embed/hostEventClient/contracts.js.map +0 -1
  316. package/src/embed/hostEventClient/contracts.ts +0 -262
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.51.2 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.52.1 */
2
2
  'use client';
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
@@ -1065,6 +1065,9 @@
1065
1065
  EmbedEvent["Download"] = "download";
1066
1066
  /**
1067
1067
  * Emitted when the download action is triggered on an Answer.
1068
+ * Payload varies by context: {@link VizScopedRequest} (Search, Answer,
1069
+ * Liveboard), {@link RequiredVizRequest} (Spotter, vizId required). trigger()
1070
+ * accepts the union now; per-context enforced next release.
1068
1071
  * Use start:true to subscribe to when download is initiated, or end:true to
1069
1072
  * subscribe to when download is completed. Default is end:true.
1070
1073
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.0.sw
@@ -1081,6 +1084,9 @@
1081
1084
  EmbedEvent["DownloadAsPng"] = "downloadAsPng";
1082
1085
  /**
1083
1086
  * Emitted when the Download as PDF action is triggered on an Answer
1087
+ * Payload varies by context: {@link VizScopedRequest} (Search, Answer; plus
1088
+ * liveboardId on Liveboard), {@link RequiredVizRequest} (Spotter). trigger()
1089
+ * accepts the union now; per-context enforced next release.
1084
1090
  * Use start:true to subscribe to when download as PDF is initiated, or end:true to
1085
1091
  * subscribe to when download as PDF is completed. Default is end:true.
1086
1092
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
@@ -1097,6 +1103,9 @@
1097
1103
  EmbedEvent["DownloadAsPdf"] = "downloadAsPdf";
1098
1104
  /**
1099
1105
  * Emitted when the Download as CSV action is triggered on an Answer.
1106
+ * Payload varies by context: {@link VizScopedRequest} (Search, Answer,
1107
+ * Liveboard), {@link RequiredVizRequest} (Spotter, vizId required). trigger()
1108
+ * accepts the union now; per-context enforced next release.
1100
1109
  * Use start:true to subscribe to when download as CSV is initiated, or end:true to
1101
1110
  * subscribe to when download as CSV is completed. Default is end:true.
1102
1111
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
@@ -1113,6 +1122,9 @@
1113
1122
  EmbedEvent["DownloadAsCsv"] = "downloadAsCsv";
1114
1123
  /**
1115
1124
  * Emitted when the Download as XLSX action is triggered on an Answer.
1125
+ * Payload varies by context: {@link VizScopedRequest} (Search, Answer,
1126
+ * Liveboard), {@link RequiredVizRequest} (Spotter, vizId required). trigger()
1127
+ * accepts the union now; per-context enforced next release.
1116
1128
  * Use start:true to subscribe to when download as XLSX is initiated, or end:true to
1117
1129
  * subscribe to when download as XLSX is completed. Default is end:true.
1118
1130
  * @version SDK: 1.11.0 | ThoughtSpot: 8.3.0.cl, 8.4.1.sw
@@ -1391,6 +1403,9 @@
1391
1403
  EmbedEvent["Schedule"] = "subscription";
1392
1404
  /**
1393
1405
  * Emitted when a user clicks **Edit** on a Liveboard or visualization
1406
+ * Payload varies by context: {@link VizScopedRequest} (Liveboard),
1407
+ * {@link RequiredVizRequest} (Spotter, vizId required). trigger() accepts the
1408
+ * union now; per-context enforced next release.
1394
1409
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1395
1410
  * @example
1396
1411
  * ```js
@@ -1932,7 +1947,32 @@
1932
1947
  */
1933
1948
  EmbedEvent["OrgSwitched"] = "orgSwitched";
1934
1949
  /**
1935
- * Emitted when the user intercepts a URL.
1950
+ * Emitted before the embedded ThoughtSpot app sends a network request whose
1951
+ * fully resolved URL matches one of the `interceptUrls` in the view config.
1952
+ * The request is held until you call `responder`, which decides whether the
1953
+ * real request goes out or a response you supply is used in its place.
1954
+ *
1955
+ * Setting `interceptUrls` is what enables this; there is no separate enable
1956
+ * flag. If `responder` is not called within `interceptTimeout` (30000 ms by
1957
+ * default) the request fails and `EmbedEvent.Error` is emitted.
1958
+ *
1959
+ * The payload is `{ input, init, urlType }`, where `input` is the request
1960
+ * URL and `init` is the `fetch` init object, with `init.body` parsed into an
1961
+ * object when it is valid JSON. `urlType` is the matching
1962
+ * `InterceptedApiType`; it is `InterceptedApiType.ALL` for any URL outside
1963
+ * the recognized API groups.
1964
+ *
1965
+ * Interception wraps the outermost layer of `fetch`, so `init` holds the
1966
+ * request as the application composed it, before ThoughtSpot attaches its
1967
+ * authentication headers. Those headers, and any token refresh and retry,
1968
+ * are applied afterwards and only when you pass `execute: true`. Only
1969
+ * requests made through `fetch` are intercepted.
1970
+ *
1971
+ * Pass `execute: true` to let the original request proceed untouched, in
1972
+ * which case any `response` you supply alongside it is ignored. With
1973
+ * `execute: false` the request is never sent, and your `response.body` is
1974
+ * returned to the app as JSON, defaulting to status 200 and a
1975
+ * `Content-Type: application/json` header.
1936
1976
  *
1937
1977
  * Supported on all embed types.
1938
1978
  *
@@ -2445,6 +2485,7 @@
2445
2485
  * the search query string.
2446
2486
  * Supported in `AppEmbed` and `SearchEmbed` deployments.
2447
2487
  * Includes the following properties:
2488
+ * Payload: {@link SearchRequest}.
2448
2489
  * @param - Includes the following keys:
2449
2490
  * - `searchQuery`: Query string with search tokens.
2450
2491
  * - `dataSources`: Data source GUID to search on.
@@ -2472,6 +2513,9 @@
2472
2513
  HostEvent["Search"] = "search";
2473
2514
  /**
2474
2515
  * Triggers a drill on certain points of the specified column
2516
+ * Payload: {@link DrillDownRequest}; in Liveboard context vizId is required
2517
+ * ({@link RequiredVizRequest}). trigger() accepts the union now; per-context
2518
+ * enforced next release.
2475
2519
  * Includes the following properties:
2476
2520
  * @param - Includes the following keys:
2477
2521
  * - `points`: An object containing `selectedPoints` and/or `clickedPoint`
@@ -2551,6 +2595,8 @@
2551
2595
  HostEvent["Reload"] = "reload";
2552
2596
  /**
2553
2597
  * Get iframe URL for the current embed view.
2598
+ * Payload: none.
2599
+ * Response: {@link GetIframeUrlResponse}.
2554
2600
  * @example
2555
2601
  * ```js
2556
2602
  * const url = embed.trigger(HostEvent.GetIframeUrl);
@@ -2569,6 +2615,7 @@
2569
2615
  HostEvent["GetIframeUrl"] = "GetIframeUrl";
2570
2616
  /**
2571
2617
  * Display specific visualizations on a Liveboard.
2618
+ * Payload: `string[]`.
2572
2619
  * @param - An array of GUIDs of the visualization to show. The visualization IDs not passed
2573
2620
  * in this parameter will be hidden.
2574
2621
  * @example
@@ -2591,6 +2638,7 @@
2591
2638
  HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
2592
2639
  /**
2593
2640
  * Set a Liveboard tab as an active tab.
2641
+ * Payload: {@link SetActiveTabRequest}.
2594
2642
  * @param - tabId - string of id of Tab to show
2595
2643
  * @example
2596
2644
  * ```js
@@ -2618,6 +2666,7 @@
2618
2666
  * and `AppEmbed` only. In full application embedding, this event updates
2619
2667
  * the runtime filters applied on the Liveboard and saved Answer objects.
2620
2668
  *
2669
+ * Payload: {@link RuntimeFilter}[].
2621
2670
  * @param - Array of {@link RuntimeFilter} objects. Each item includes:
2622
2671
  * - `columnName`: Name of the column to filter on.
2623
2672
  * - `operator`: {@link RuntimeFilterOp} to apply. For more information, see
@@ -2659,6 +2708,7 @@
2659
2708
  * Accepts either a plain value or an object with `path`
2660
2709
  * and an optional `replace` flag.
2661
2710
  *
2711
+ * Payload: `string` | `number` | {@link NavigateRequest}.
2662
2712
  * @param data - A string path, a numeric history delta, or an object
2663
2713
  * `{ path: string | number, replace?: boolean }`.
2664
2714
  * - `path` — the route to navigate to, or a history delta such as `1`
@@ -2686,6 +2736,9 @@
2686
2736
  /**
2687
2737
  * Open the filter panel for a particular column.
2688
2738
  * Works with Search and Liveboard embed.
2739
+ * Payload: {@link OpenFilterRequest} (the cross-context superset). The
2740
+ * accepted fields vary by context: {@link OpenFilterLiveboardRequest},
2741
+ * {@link OpenFilterSpotterRequest}, {@link OpenFilterSearchRequest}.
2689
2742
  * @param - { columnId: string,
2690
2743
  * name: string,
2691
2744
  * type: ATTRIBUTE/MEASURE,
@@ -2742,7 +2795,7 @@
2742
2795
  *
2743
2796
  * Unlike {@link HostEvent.OpenFilter}, which opens the panel of an
2744
2797
  * existing filter, this event starts the creation of a new filter.
2745
- * @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
2798
+ * @version SDK: 1.51.1 | ThoughtSpot Cloud: 26.8.0.cl
2746
2799
  * @example
2747
2800
  * ```js
2748
2801
  * liveboardEmbed.trigger(HostEvent.OpenAddFilterModal);
@@ -2758,7 +2811,7 @@
2758
2811
  * Hiding the *Add parameter* button with `hiddenActions:
2759
2812
  * [Action.AddParameter]` does not block this event, but disabling it
2760
2813
  * with `disabledActions` does.
2761
- * @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
2814
+ * @version SDK: 1.51.1 | ThoughtSpot Cloud: 26.8.0.cl
2762
2815
  * @example
2763
2816
  * ```js
2764
2817
  * liveboardEmbed.trigger(HostEvent.OpenAddParameterModal);
@@ -2768,6 +2821,7 @@
2768
2821
  /**
2769
2822
  * Open the parameter panel for a particular parameter on a Liveboard.
2770
2823
  * Mirrors {@link HostEvent.OpenFilter} for parameters.
2824
+ * Payload: {@link OpenParameterRequest}.
2771
2825
  * @param - Includes the following keys:
2772
2826
  * - `parameter`: An object identifying the parameter to open, for
2773
2827
  * example, `{ parameterId: '<parameter-GUID>' }`.
@@ -2799,6 +2853,7 @@
2799
2853
  HostEvent["OpenParameter"] = "openParameter";
2800
2854
  /**
2801
2855
  * Add columns to the current search query.
2856
+ * Payload: `{ columnIds: string[] }`.
2802
2857
  * @param - { columnIds: string[] }
2803
2858
  * @example
2804
2859
  * ```js
@@ -2817,6 +2872,7 @@
2817
2872
  HostEvent["AddColumns"] = "addColumns";
2818
2873
  /**
2819
2874
  * Remove a column from the current search query.
2875
+ * Payload: `{ columnId: string }`.
2820
2876
  * @param - { columnId: string }
2821
2877
  * @example
2822
2878
  * ```js
@@ -2841,6 +2897,8 @@
2841
2897
  * sorting, toggling of legends, and data drill down.
2842
2898
  * For more information, see
2843
2899
  * link:https://developers.thoughtspot.com/docs/fetch-data-and-report-apis#transient-lb-content[Liveboard data with unsaved changes].
2900
+ * Payload: none.
2901
+ * Response: {@link GetExportRequestForCurrentPinboardResponse}.
2844
2902
  * @example
2845
2903
  * ```js
2846
2904
  * liveboardEmbed.trigger(HostEvent.getExportRequestForCurrentPinboard).then(
@@ -2862,6 +2920,8 @@
2862
2920
  * requiring additional user input via the *Pin to Liveboard* modal, define
2863
2921
  * the following parameters:
2864
2922
  *
2923
+ * Payload: {@link PinAnswerToLiveboardRequest}.
2924
+ * Response: {@link PinAnswerToLiveboardResponse}.
2865
2925
  * @param - Includes the following keys:
2866
2926
  * - `vizId`: GUID of the saved Answer or Spotter visualization ID to pin to a
2867
2927
  * Liveboard.
@@ -2976,6 +3036,7 @@
2976
3036
  HostEvent["LiveboardInfo"] = "pinboardInfo";
2977
3037
  /**
2978
3038
  * Trigger the **Schedule** action on an embedded Liveboard.
3039
+ * Payload: {@link VizScopedRequest}.
2979
3040
  * @example
2980
3041
  * ```js
2981
3042
  * liveboardEmbed.trigger(HostEvent.Schedule)
@@ -2991,6 +3052,7 @@
2991
3052
  HostEvent["Schedule"] = "subscription";
2992
3053
  /**
2993
3054
  * Trigger the **Manage schedule** action on an embedded Liveboard
3055
+ * Payload: {@link VizScopedRequest}.
2994
3056
  * @example
2995
3057
  * ```js
2996
3058
  * liveboardEmbed.trigger(HostEvent.SchedulesList)
@@ -3007,6 +3069,7 @@
3007
3069
  /**
3008
3070
  * Trigger the **Export TML** action on an embedded Liveboard or
3009
3071
  * Answer.
3072
+ * Payload: {@link VizScopedRequest}.
3010
3073
  * @example
3011
3074
  * ```js
3012
3075
  * liveboardEmbed.trigger(HostEvent.ExportTML)
@@ -3029,6 +3092,7 @@
3029
3092
  /**
3030
3093
  * Trigger the **Edit TML** action on an embedded Liveboard or
3031
3094
  * saved Answers in the full application embedding.
3095
+ * Payload: {@link VizScopedRequest}.
3032
3096
  * @example
3033
3097
  * ```js
3034
3098
  * liveboardEmbed.trigger(HostEvent.EditTML)
@@ -3050,6 +3114,7 @@
3050
3114
  HostEvent["EditTML"] = "editTSL";
3051
3115
  /**
3052
3116
  * Trigger the **Update TML** action on an embedded Liveboard.
3117
+ * Payload: {@link VizScopedRequest}.
3053
3118
  * @example
3054
3119
  * ```js
3055
3120
  * liveboardEmbed.trigger(HostEvent.UpdateTML)
@@ -3067,6 +3132,7 @@
3067
3132
  * Trigger the **Download PDF** action on an embedded Liveboard,
3068
3133
  * visualization or Answer.
3069
3134
  *
3135
+ * Payload: {@link VizScopedRequest} plus optional `liveboardId`.
3070
3136
  * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
3071
3137
  *
3072
3138
  * **NOTE**: The **Download** > **PDF** action is available on
@@ -3117,6 +3183,7 @@
3117
3183
  /**
3118
3184
  * Trigger the **AI Highlights** action on an embedded Liveboard
3119
3185
  *
3186
+ * Payload: none.
3120
3187
  * @example
3121
3188
  * ```js
3122
3189
  * liveboardEmbed.trigger(HostEvent.AIHighlights)
@@ -3171,6 +3238,9 @@
3171
3238
  HostEvent["MakeACopy"] = "makeACopy";
3172
3239
  /**
3173
3240
  * Trigger the **Delete** action for a Liveboard.
3241
+ * Payload varies by context: {@link RequiredVizRequest} (Liveboard, vizId
3242
+ * required), {@link VizScopedRequest} (Search). trigger() accepts the union
3243
+ * now; per-context enforced next release.
3174
3244
  * @example
3175
3245
  * ```js
3176
3246
  * appEmbed.trigger(HostEvent.Remove)
@@ -3185,6 +3255,7 @@
3185
3255
  HostEvent["Remove"] = "delete";
3186
3256
  /**
3187
3257
  * Trigger the **Explore** action on a visualization.
3258
+ * Payload: {@link RequiredVizRequest}.
3188
3259
  * @param - an object with `vizId` as a key
3189
3260
  * @example
3190
3261
  * ```js
@@ -3204,6 +3275,7 @@
3204
3275
  /**
3205
3276
  * Trigger the **Create alert** action on a KPI chart
3206
3277
  * in a Liveboard or saved Answer.
3278
+ * Payload: {@link VizScopedRequest}.
3207
3279
  * @param - an object with `vizId` as a key
3208
3280
  * @example
3209
3281
  * ```js
@@ -3235,6 +3307,7 @@
3235
3307
  /**
3236
3308
  * Trigger the **Manage alerts** action on a KPI chart
3237
3309
  * in a visualization or saved Answer.
3310
+ * Payload: {@link VizScopedRequest}.
3238
3311
  * @param - an object with `vizId` as a key
3239
3312
  * @example
3240
3313
  * ```js
@@ -3272,6 +3345,7 @@
3272
3345
  * on a Liveboard.
3273
3346
  *
3274
3347
  * This event is not supported in visualization embed and search embed.
3348
+ * Payload: {@link VizScopedRequest}.
3275
3349
  * @param - Object parameter. Includes the following keys:
3276
3350
  * - `vizId`: To trigger the action for a specific visualization in Liveboard embed,
3277
3351
  * pass in `vizId` as a key. In Spotter embed, `vizId` refers to the Answer ID and
@@ -3314,6 +3388,7 @@
3314
3388
  HostEvent["Edit"] = "edit";
3315
3389
  /**
3316
3390
  * Trigger the **Copy link** action on a Liveboard or visualization
3391
+ * Payload: {@link VizScopedRequest}.
3317
3392
  * @param - object - to trigger the action for a
3318
3393
  * specific visualization in Liveboard embed, pass in `vizId` as a key
3319
3394
  * @example
@@ -3359,6 +3434,7 @@
3359
3434
  HostEvent["CopyLink"] = "embedDocument";
3360
3435
  /**
3361
3436
  * Trigger the **Present** action on a Liveboard or visualization
3437
+ * Payload: {@link VizScopedRequest}.
3362
3438
  * @param - object - to trigger the action for a specific visualization
3363
3439
  * in Liveboard embed, pass in `vizId` as a key
3364
3440
  * @example
@@ -3404,6 +3480,8 @@
3404
3480
  HostEvent["Present"] = "present";
3405
3481
  /**
3406
3482
  * Get TML for the current search.
3483
+ * Payload: {@link GetTMLRequest}.
3484
+ * Response: `Record<string, any>`.
3407
3485
  * @example
3408
3486
  * ```js
3409
3487
  * searchEmbed.trigger(HostEvent.GetTML).then((tml) => {
@@ -3453,6 +3531,7 @@
3453
3531
  * Trigger the **Show underlying data** action on a
3454
3532
  * chart or table.
3455
3533
  *
3534
+ * Payload: {@link VizScopedRequest}.
3456
3535
  * @param - an object with vizId as a key
3457
3536
  * @example
3458
3537
  * ```js
@@ -3486,6 +3565,7 @@
3486
3565
  * Trigger the **Delete** action for a visualization
3487
3566
  * in an embedded Liveboard, or a chart or table
3488
3567
  * generated from Search.
3568
+ * Payload: {@link VizScopedRequest}.
3489
3569
  * @param - Liveboard embed takes an object with `vizId` as a key.
3490
3570
  * Can be left empty if embedding Search or visualization.
3491
3571
  * @example
@@ -3514,6 +3594,7 @@
3514
3594
  /**
3515
3595
  * Trigger the **SpotIQ analyze** action on a
3516
3596
  * chart or table.
3597
+ * Payload: {@link VizScopedRequest}.
3517
3598
  * @param - Liveboard embed takes `vizId` as a
3518
3599
  * key. Can be left undefined when embedding Search or
3519
3600
  * visualization.
@@ -3576,6 +3657,7 @@
3576
3657
  /**
3577
3658
  * Trigger the **Download** > **PNG** action on
3578
3659
  * charts in the embedded view.
3660
+ * Payload: {@link VizScopedRequest}.
3579
3661
  * @example
3580
3662
  * ```js
3581
3663
  * liveboardEmbed.trigger(HostEvent.DownloadAsPng,
@@ -3607,6 +3689,7 @@
3607
3689
  /**
3608
3690
  * Trigger the **Download** > **CSV** action on tables in
3609
3691
  * the embedded view.
3692
+ * Payload: {@link VizScopedRequest}.
3610
3693
  * @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
3611
3694
  * @example
3612
3695
  * ```js
@@ -3646,6 +3729,7 @@
3646
3729
  /**
3647
3730
  * Trigger the **Download** > **XLSX** action on tables
3648
3731
  * in the embedded view.
3732
+ * Payload: {@link VizScopedRequest}.
3649
3733
  * @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
3650
3734
  * @example
3651
3735
  * ```js
@@ -3685,6 +3769,7 @@
3685
3769
  /**
3686
3770
  * Trigger the **Share** action on an embedded
3687
3771
  * Liveboard or Answer.
3772
+ * Payload: {@link VizScopedRequest}.
3688
3773
  * @example
3689
3774
  * ```js
3690
3775
  * liveboardEmbed.trigger(HostEvent.Share)
@@ -3711,6 +3796,7 @@
3711
3796
  * Trigger the **Save** action on a Liveboard, Answer, or Spotter.
3712
3797
  * Saves the changes.
3713
3798
  *
3799
+ * Payload: {@link VizScopedRequest}.
3714
3800
  * @param - `vizId` refers to the Spotter Visualization Id used in Spotter embed.
3715
3801
  * It is required and can be retrieved from the data embed event.
3716
3802
  *
@@ -3762,6 +3848,7 @@
3762
3848
  /**
3763
3849
  * Trigger the **Sync to Sheets** action on an embedded visualization or Answer
3764
3850
  * Sends data from an Answer or Liveboard visualization to a Google sheet.
3851
+ * Payload: {@link VizScopedRequest}.
3765
3852
  * @param - an object with `vizId` as a key
3766
3853
  * @example
3767
3854
  * ```js
@@ -3792,6 +3879,7 @@
3792
3879
  * Trigger the **Sync to Other Apps** action on an embedded visualization or Answer
3793
3880
  * Sends data from an Answer or Liveboard visualization to third-party apps such
3794
3881
  * as Slack, Salesforce, Microsoft Teams, ServiceNow and so on.
3882
+ * Payload: {@link VizScopedRequest}.
3795
3883
  * @param - an object with vizId as a key
3796
3884
  * @example
3797
3885
  * ```js
@@ -3822,6 +3910,7 @@
3822
3910
  * Trigger the **Manage pipelines** action on an embedded
3823
3911
  * visualization or Answer.
3824
3912
  * Allows users to manage ThoughtSpot Sync pipelines.
3913
+ * Payload: {@link VizScopedRequest}.
3825
3914
  * @param - an object with `vizId` as a key
3826
3915
  * @example
3827
3916
  * ```js
@@ -3850,6 +3939,7 @@
3850
3939
  HostEvent["ManagePipelines"] = "manage-pipeline";
3851
3940
  /**
3852
3941
  * Reset search operation on the Search or Answer page.
3942
+ * Payload: none.
3853
3943
  * @example
3854
3944
  * ```js
3855
3945
  * searchEmbed.trigger(HostEvent.ResetSearch)
@@ -3877,6 +3967,8 @@
3877
3967
  * whole Liveboard.
3878
3968
  * The `applicability` attribute is available from SDK: 1.53.0 |
3879
3969
  * ThoughtSpot: 26.10.0.cl.
3970
+ * Payload: {@link GetFiltersRequest}.
3971
+ * Response: {@link GetFiltersResponse}.
3880
3972
  * @example
3881
3973
  * ```js
3882
3974
  * const data = await liveboardEmbed.trigger(HostEvent.GetFilters);
@@ -3896,6 +3988,7 @@
3896
3988
  HostEvent["GetFilters"] = "getFilters";
3897
3989
  /**
3898
3990
  * Update one or several filters applied on a Liveboard.
3991
+ * Payload: {@link UpdateFiltersRequest}.
3899
3992
  * @param - Includes the following keys:
3900
3993
  * - `filter`: A single filter object containing column name, filter operator, and
3901
3994
  * values.
@@ -4024,6 +4117,8 @@
4024
4117
  HostEvent["UpdateFilters"] = "updateFilters";
4025
4118
  /**
4026
4119
  * Get tab details for the current Liveboard.
4120
+ * Payload: none.
4121
+ * Response: {@link GetTabsResponse}.
4027
4122
  * @example
4028
4123
  * ```js
4029
4124
  * liveboardEmbed.trigger(HostEvent.GetTabs).then((tabDetails) => {
@@ -4049,6 +4144,8 @@
4049
4144
  /**
4050
4145
  * Get group details for the current Liveboard.
4051
4146
  * Mirrors {@link HostEvent.GetTabs} for filter/parameter groups.
4147
+ * Payload: none.
4148
+ * Response: {@link GetGroupsResponse}.
4052
4149
  * @example
4053
4150
  * ```js
4054
4151
  * liveboardEmbed.trigger(HostEvent.GetGroups).then((groupDetails) => {
@@ -4073,6 +4170,7 @@
4073
4170
  HostEvent["GetGroups"] = "getGroups";
4074
4171
  /**
4075
4172
  * Set the visible tabs on a Liveboard.
4173
+ * Payload: `string[]`.
4076
4174
  * @param - an array of ids of tabs to show, the IDs not passed
4077
4175
  * will be hidden.
4078
4176
  * @example
@@ -4095,6 +4193,7 @@
4095
4193
  HostEvent["SetVisibleTabs"] = "SetPinboardVisibleTabs";
4096
4194
  /**
4097
4195
  * Set the hidden tabs on a Liveboard.
4196
+ * Payload: `string[]`.
4098
4197
  * @param - an array of the IDs of the tabs to hide.
4099
4198
  * The IDs not passed will be shown.
4100
4199
  * @example
@@ -4123,6 +4222,8 @@
4123
4222
  * `getAnswerService()` method on the embed instance to get an AnswerService
4124
4223
  * object that provides a more convenient interface for working with answers.
4125
4224
  *
4225
+ * Payload: {@link GetAnswerSessionRequest}.
4226
+ * Response: {@link GetAnswerSessionResponse}.
4126
4227
  * @example
4127
4228
  * ```js
4128
4229
  * // Preferred way to get an AnswerService
@@ -4150,6 +4251,7 @@
4150
4251
  HostEvent["GetAnswerSession"] = "getAnswerSession";
4151
4252
  /**
4152
4253
  * Trigger the *Ask Sage* action for visualizations
4254
+ * Payload: {@link RequiredVizRequest}.
4153
4255
  * @example
4154
4256
  * ```js
4155
4257
  * liveboardEmbed.trigger(HostEvent.AskSage,
@@ -4161,6 +4263,7 @@
4161
4263
  /**
4162
4264
  * Trigger cross filter update action on a Liveboard.
4163
4265
  *
4266
+ * Payload: {@link UpdateCrossFilterRequest}.
4164
4267
  * @example
4165
4268
  * ```js
4166
4269
  * liveboardEmbed.trigger(HostEvent.UpdateCrossFilter, {
@@ -4176,7 +4279,9 @@
4176
4279
  HostEvent["UpdateCrossFilter"] = "UpdateCrossFilter";
4177
4280
  /**
4178
4281
  * Trigger reset action for a personalized Liveboard view.
4179
- * This event is deprecated. Use {@link HostEvent.ResetLiveboardPersonalizedView} instead.
4282
+ * This event is deprecated.
4283
+ * Use {@link HostEvent.ResetLiveboardPersonalizedView} instead.
4284
+ * Payload: none.
4180
4285
  * @example
4181
4286
  * ```js
4182
4287
  * liveboardEmbed.trigger(HostEvent.ResetLiveboardPersonalisedView);
@@ -4197,6 +4302,7 @@
4197
4302
  /**
4198
4303
  * Triggers an action to update Parameter values on embedded
4199
4304
  * Answers, Liveboard, and Spotter answer in Edit mode.
4305
+ * Payload: {@link RuntimeParameter}[].
4200
4306
  * @param - Includes the following keys for each item:
4201
4307
  * - `name`: Name of the parameter.
4202
4308
  * - `value`: The value to set for the parameter.
@@ -4254,6 +4360,8 @@
4254
4360
  * whole Liveboard.
4255
4361
  * The `applicability` attribute is available from SDK: 1.53.0 |
4256
4362
  * ThoughtSpot: 26.10.0.cl.
4363
+ * Payload: none.
4364
+ * Response: {@link GetParametersResponse}.
4257
4365
  * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
4258
4366
  * ```js
4259
4367
  * liveboardEmbed.trigger(HostEvent.GetParameters).then((parameter) => {
@@ -4291,6 +4399,7 @@
4291
4399
  * ```js
4292
4400
  * liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {viewId: '1234'})
4293
4401
  * ```
4402
+ * Payload: {@link PersonalisedViewRequest} (`viewId` only).
4294
4403
  * @example
4295
4404
  * ```js
4296
4405
  * // Update personalized view from liveboard context
@@ -4323,6 +4432,7 @@
4323
4432
  * If neither is provided, the Liveboard resets to the original/default view.
4324
4433
  * When a `viewName` is provided and multiple views share
4325
4434
  * the same name, the first match is selected.
4435
+ * Payload: {@link PersonalisedViewRequest}.
4326
4436
  * @example
4327
4437
  * ```js
4328
4438
  * liveboardEmbed.trigger(
@@ -4366,6 +4476,8 @@
4366
4476
  * If no parameters are specified, the save action is
4367
4477
  * triggered with a modal to prompt users to
4368
4478
  * add a name and description for the Answer.
4479
+ * Payload: {@link SaveAnswerRequest}.
4480
+ * Response: {@link SaveAnswerResponse}.
4369
4481
  * @param - Includes the following keys:
4370
4482
  * - `vizId`: Refers to the Answer ID in Spotter embed and is **required** in Spotter
4371
4483
  * embed.
@@ -4451,6 +4563,7 @@
4451
4563
  /**
4452
4564
  * Triggers a search operation with the search tokens specified in
4453
4565
  * the search query string in spotter embed.
4566
+ * Payload: {@link SpotterSearchRequest}.
4454
4567
  * @param - Includes the following keys:
4455
4568
  * - `query`: Text string in Natural Language format.
4456
4569
  * - `executeSearch`: Boolean to execute search and update search query.
@@ -4475,6 +4588,7 @@
4475
4588
  HostEvent["SpotterSearch"] = "SpotterSearch";
4476
4589
  /**
4477
4590
  * Edits the last prompt in spotter embed.
4591
+ * Payload: `string`.
4478
4592
  * @param - `query`: Text string
4479
4593
  * @example
4480
4594
  * ```js
@@ -4491,6 +4605,7 @@
4491
4605
  HostEvent["EditLastPrompt"] = "EditLastPrompt";
4492
4606
  /**
4493
4607
  * Opens the data source preview modal in Spotter Embed.
4608
+ * Payload: none.
4494
4609
  * @example
4495
4610
  * ```js
4496
4611
  * spotterEmbed.trigger(HostEvent.PreviewSpotterData);
@@ -4526,6 +4641,7 @@
4526
4641
  HostEvent["DataModelInstructions"] = "DataModelInstructions";
4527
4642
  /**
4528
4643
  * Resets the Spotter Embed Conversation.
4644
+ * Payload: none.
4529
4645
  * @example
4530
4646
  * ```js
4531
4647
  * spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
@@ -4538,6 +4654,7 @@
4538
4654
  * `conversationId` is **mandatory** — you must pass the id of the
4539
4655
  * conversation to share. Also no-op when sharing is disabled
4540
4656
  * (enableShareConversation off) or when already in the read-only shared view.
4657
+ * Payload: {@link ConversationScopedRequest}.
4541
4658
  * @example
4542
4659
  * ```js
4543
4660
  * spotterEmbed.trigger(HostEvent.ShareSpotterConversation, { conversationId: 'abc' });
@@ -4547,6 +4664,7 @@
4547
4664
  HostEvent["ShareSpotterConversation"] = "ShareSpotterConversation";
4548
4665
  /**
4549
4666
  * Closes the Spotter share-conversation modal. No-op if none is open.
4667
+ * Payload: none.
4550
4668
  * @example
4551
4669
  * ```js
4552
4670
  * spotterEmbed.trigger(HostEvent.CloseSpotterShareConversation);
@@ -4556,6 +4674,7 @@
4556
4674
  HostEvent["CloseSpotterShareConversation"] = "CloseSpotterShareConversation";
4557
4675
  /**
4558
4676
  * Exits the read-only shared-conversation view.
4677
+ * Payload: none.
4559
4678
  * @example
4560
4679
  * ```js
4561
4680
  * spotterEmbed.trigger(HostEvent.ExitSpotterSharedConversation);
@@ -4565,6 +4684,7 @@
4565
4684
  HostEvent["ExitSpotterSharedConversation"] = "ExitSpotterSharedConversation";
4566
4685
  /**
4567
4686
  * Deletes the last prompt in spotter embed.
4687
+ * Payload: none.
4568
4688
  * @example
4569
4689
  * ```js
4570
4690
  * spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
@@ -4574,6 +4694,7 @@
4574
4694
  HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
4575
4695
  /**
4576
4696
  * Toggle the visualization to chart or table view.
4697
+ * Payload: {@link RequiredVizRequest}.
4577
4698
  * @param - `vizId ` refers to the Visualization ID in Spotter embed and is required.
4578
4699
  * @example
4579
4700
  * ```js
@@ -4612,6 +4733,7 @@
4612
4733
  HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
4613
4734
  /**
4614
4735
  * Trigger the *Spotter* action for visualizations present on the liveboard's vizzes.
4736
+ * Payload: {@link RequiredVizRequest}.
4615
4737
  * @param - `vizId` refers to the Visualization ID in Spotter embed and is required.
4616
4738
  * @example
4617
4739
  * ```js
@@ -4636,7 +4758,13 @@
4636
4758
  */
4637
4759
  HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
4638
4760
  /**
4639
- * Triggered when the embed needs to be destroyed. This is used to clean up any embed-related resources internally.
4761
+ * Notifies the embedded ThoughtSpot app that the embed is being torn down, so that
4762
+ * it can release any resources it holds before the iframe is removed from the DOM.
4763
+ *
4764
+ * This is triggered for you by `embed.destroy()`; you rarely need to trigger it
4765
+ * directly. If `waitForCleanupOnDestroy` is set in the embed config, `destroy()`
4766
+ * waits for the app to acknowledge this event (up to `cleanupTimeout`) before
4767
+ * removing the iframe.
4640
4768
  * @example
4641
4769
  * ```js
4642
4770
  * liveboardEmbed.trigger(HostEvent.DestroyEmbed);
@@ -4667,6 +4795,7 @@
4667
4795
  * instance. Contact your admin or ThoughtSpot Support to enable chat history on your
4668
4796
  * instance.
4669
4797
  *
4798
+ * Payload: {@link ConversationScopedRequest}.
4670
4799
  * @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
4671
4800
  * @example
4672
4801
  * ```js
@@ -4684,6 +4813,7 @@
4684
4813
  * instance. Contact your admin or ThoughtSpot Support to enable chat history on your
4685
4814
  * instance.
4686
4815
  *
4816
+ * Payload: {@link ConversationScopedRequest}.
4687
4817
  * @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
4688
4818
  * @example
4689
4819
  * ```js
@@ -4708,6 +4838,7 @@
4708
4838
  * Trigger the **Send Test Email** action in the Liveboard schedule modal.
4709
4839
  * Sends a test schedule email to self or all recipients.
4710
4840
  * Requires `isSendNowLiveboardSchedulingEnabled` to be enabled.
4841
+ * Payload: {@link ScheduleEmailRequest}.
4711
4842
  * @example
4712
4843
  * ```js
4713
4844
  * liveboardEmbed.trigger(HostEvent.SendTestScheduleEmail, {
@@ -4726,6 +4857,7 @@
4726
4857
  HostEvent["SendTestScheduleEmail"] = "sendTestScheduleEmail";
4727
4858
  /**
4728
4859
  * Sends a user message (prompt) to the SpotterViz panel programmatically.
4860
+ * Payload: `{ query: string }`.
4729
4861
  * @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
4730
4862
  * @param query - the prompt text to send.
4731
4863
  * @example
@@ -4738,6 +4870,7 @@
4738
4870
  HostEvent["SpotterVizSendUserMessage"] = "SpotterVizSendUserMessage";
4739
4871
  /**
4740
4872
  * Initializes a new SpotterViz conversation.
4873
+ * Payload: none.
4741
4874
  * @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
4742
4875
  * @example
4743
4876
  * ```js
@@ -4747,6 +4880,7 @@
4747
4880
  HostEvent["InitSpotterVizConversation"] = "InitSpotterVizConversation";
4748
4881
  /**
4749
4882
  * Opens the SpotterViz panel.
4883
+ * Payload: none.
4750
4884
  * @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
4751
4885
  * @example
4752
4886
  * ```js
@@ -4756,6 +4890,7 @@
4756
4890
  HostEvent["OpenSpotterVizPanel"] = "OpenSpotterVizPanel";
4757
4891
  /**
4758
4892
  * Closes the SpotterViz panel.
4893
+ * Payload: none.
4759
4894
  * @version SDK: 1.50.0 | ThoughtSpot Cloud: 26.7.0.cl
4760
4895
  * @example
4761
4896
  * ```js
@@ -4766,6 +4901,7 @@
4766
4901
  /**
4767
4902
  * Clears browser cache and fetches new data for liveboard ChartViz Containers.
4768
4903
  * Requires `enableLiveboardDataCache` to be enabled.
4904
+ * Payload: {@link ScheduleEmailRequest}.
4769
4905
  * @example
4770
4906
  * ```js
4771
4907
  * liveboardEmbed.trigger(HostEvent.RefreshLiveboardBrowserCache);
@@ -4963,6 +5099,7 @@
4963
5099
  Param["SpotterDataSources"] = "spotterDataSources";
4964
5100
  Param["AnalystId"] = "analystId";
4965
5101
  Param["OpenSpotterOnLiveboardByDefault"] = "openSpotterOnLiveboardByDefault";
5102
+ Param["ShowAnswerEditPanel"] = "showAnswerEditPanel";
4966
5103
  })(Param || (Param = {}));
4967
5104
  /**
4968
5105
  * ThoughtSpot application pages include actions and menu commands
@@ -6754,7 +6891,7 @@
6754
6891
  * ```js
6755
6892
  * hiddenActions: [Action.QuickSearchPill]
6756
6893
  * ```
6757
- * @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
6894
+ * @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
6758
6895
  */
6759
6896
  Action["QuickSearchPill"] = "quickSearchPill";
6760
6897
  /**
@@ -6769,7 +6906,7 @@
6769
6906
  * ```js
6770
6907
  * hiddenActions: [Action.DeepAnalysisPill]
6771
6908
  * ```
6772
- * @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
6909
+ * @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
6773
6910
  */
6774
6911
  Action["DeepAnalysisPill"] = "deepAnalysisPill";
6775
6912
  /**
@@ -6784,7 +6921,7 @@
6784
6921
  * ```js
6785
6922
  * hiddenActions: [Action.DataLiteracyPill]
6786
6923
  * ```
6787
- * @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
6924
+ * @version SDK: 1.53.0 | ThoughtSpot Cloud: 26.10.0.cl
6788
6925
  */
6789
6926
  Action["DataLiteracyPill"] = "dataLiteracyPill";
6790
6927
  /**
@@ -6967,6 +7104,225 @@
6967
7104
  * ```
6968
7105
  */
6969
7106
  Action["SpotterOnLiveboard"] = "spotterOnLiveboard";
7107
+ /**
7108
+ * Controls the visibility and disabled state of the "Chart Type" menu item
7109
+ * in Chart Settings V2.
7110
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7111
+ * @example
7112
+ * ```js
7113
+ * {
7114
+ * hiddenActions: [Action.ChartTypeSettings],
7115
+ * disabledActions: [Action.ChartTypeSettings],
7116
+ * }
7117
+ * ```
7118
+ */
7119
+ Action["ChartTypeSettings"] = "CHART_TYPE";
7120
+ /**
7121
+ * Controls the visibility and disabled state of the "Layout" menu item
7122
+ * in Chart Settings V2.
7123
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7124
+ * @example
7125
+ * ```js
7126
+ * {
7127
+ * hiddenActions: [Action.LayoutSettings],
7128
+ * disabledActions: [Action.LayoutSettings],
7129
+ * }
7130
+ * ```
7131
+ */
7132
+ Action["LayoutSettings"] = "LAYOUT";
7133
+ /**
7134
+ * Controls the visibility and disabled state of the "Column" menu item
7135
+ * in Chart Settings V2.
7136
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7137
+ * @example
7138
+ * ```js
7139
+ * {
7140
+ * hiddenActions: [Action.ColumnSettings],
7141
+ * disabledActions: [Action.ColumnSettings],
7142
+ * }
7143
+ * ```
7144
+ */
7145
+ Action["ColumnSettings"] = "COLUMN";
7146
+ /**
7147
+ * Controls the visibility and disabled state of the "Axis" menu item
7148
+ * in Chart Settings V2.
7149
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7150
+ * @example
7151
+ * ```js
7152
+ * {
7153
+ * hiddenActions: [Action.AxisSettings],
7154
+ * disabledActions: [Action.AxisSettings],
7155
+ * }
7156
+ * ```
7157
+ */
7158
+ Action["AxisSettings"] = "AXIS";
7159
+ /**
7160
+ * Controls the visibility and disabled state of the "Data Label" menu item
7161
+ * in Chart Settings V2.
7162
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7163
+ * @example
7164
+ * ```js
7165
+ * {
7166
+ * hiddenActions: [Action.DataLabelSettings],
7167
+ * disabledActions: [Action.DataLabelSettings],
7168
+ * }
7169
+ * ```
7170
+ */
7171
+ Action["DataLabelSettings"] = "DATA_LABEL";
7172
+ /**
7173
+ * Controls the visibility and disabled state of the "Tooltip" menu item
7174
+ * in Chart Settings V2.
7175
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7176
+ * @example
7177
+ * ```js
7178
+ * {
7179
+ * hiddenActions: [Action.TooltipSettings],
7180
+ * disabledActions: [Action.TooltipSettings],
7181
+ * }
7182
+ * ```
7183
+ */
7184
+ Action["TooltipSettings"] = "TOOLTIP";
7185
+ /**
7186
+ * Controls the visibility and disabled state of the "Legend" menu item
7187
+ * in Chart Settings V2.
7188
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7189
+ * @example
7190
+ * ```js
7191
+ * {
7192
+ * hiddenActions: [Action.LegendSettings],
7193
+ * disabledActions: [Action.LegendSettings],
7194
+ * }
7195
+ * ```
7196
+ */
7197
+ Action["LegendSettings"] = "LEGEND";
7198
+ /**
7199
+ * Controls the visibility and disabled state of the "Display" menu item
7200
+ * in Chart Settings V2.
7201
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7202
+ * @example
7203
+ * ```js
7204
+ * {
7205
+ * hiddenActions: [Action.DisplaySettings],
7206
+ * disabledActions: [Action.DisplaySettings],
7207
+ * }
7208
+ * ```
7209
+ */
7210
+ Action["DisplaySettings"] = "DISPLAY";
7211
+ /**
7212
+ * Controls the visibility and disabled state of the "Query Details" menu
7213
+ * item in Chart Settings V2.
7214
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7215
+ * @example
7216
+ * ```js
7217
+ * {
7218
+ * hiddenActions: [Action.QuerySettings],
7219
+ * disabledActions: [Action.QuerySettings],
7220
+ * }
7221
+ * ```
7222
+ */
7223
+ Action["QuerySettings"] = "QUERY_DETAILS";
7224
+ /**
7225
+ * Controls the visibility and disabled state of the "Custom Action" menu
7226
+ * item in Chart Settings V2.
7227
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7228
+ * @example
7229
+ * ```js
7230
+ * {
7231
+ * hiddenActions: [Action.CustomSettings],
7232
+ * disabledActions: [Action.CustomSettings],
7233
+ * }
7234
+ * ```
7235
+ */
7236
+ Action["CustomSettings"] = "CUSTOM_ACTION";
7237
+ /**
7238
+ * Controls the visibility and disabled state of the "Muze AI" menu item
7239
+ * in Chart Settings V2.
7240
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7241
+ * @example
7242
+ * ```js
7243
+ * {
7244
+ * hiddenActions: [Action.MuzeAiSettings],
7245
+ * disabledActions: [Action.MuzeAiSettings],
7246
+ * }
7247
+ * ```
7248
+ */
7249
+ Action["MuzeAiSettings"] = "MUZE_AI";
7250
+ /**
7251
+ * Controls the visibility and disabled state of the "R Analysis" menu item
7252
+ * in Chart Settings V2.
7253
+ * @version SDK: 1.54.0 | ThoughtSpot Cloud: 26.11.0.cl
7254
+ * @example
7255
+ * ```js
7256
+ * {
7257
+ * hiddenActions: [Action.RAnalysisSettings],
7258
+ * disabledActions: [Action.RAnalysisSettings],
7259
+ * }
7260
+ * ```
7261
+ */
7262
+ Action["RAnalysisSettings"] = "R_ANALYSIS";
7263
+ /**
7264
+ * Controls the visibility and disabled state of the "Add to Collection" menu item.
7265
+ * @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
7266
+ * @example
7267
+ * ```js
7268
+ * {
7269
+ * hiddenActions: [Action.AddToCollection],
7270
+ * disabledActions: [Action.AddToCollection],
7271
+ * }
7272
+ * ```
7273
+ */
7274
+ Action["AddToCollection"] = "addToCollection";
7275
+ /**
7276
+ * Controls the visibility and disabled state of the "Create Collection" button.
7277
+ * @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
7278
+ * @example
7279
+ * ```js
7280
+ * {
7281
+ * hiddenActions: [Action.CreateCollection],
7282
+ * disabledActions: [Action.CreateCollection],
7283
+ * }
7284
+ * ```
7285
+ */
7286
+ Action["CreateCollection"] = "createCollection";
7287
+ /**
7288
+ * Controls the visibility and disabled state of the "Move" menu item in a
7289
+ * Collection.
7290
+ * @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
7291
+ * @example
7292
+ * ```js
7293
+ * {
7294
+ * hiddenActions: [Action.MoveToCollection],
7295
+ * disabledActions: [Action.MoveToCollection],
7296
+ * }
7297
+ * ```
7298
+ */
7299
+ Action["MoveToCollection"] = "moveToCollection";
7300
+ /**
7301
+ * Controls the visibility and disabled state of the "Remove" menu item in a
7302
+ * Collection.
7303
+ * @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
7304
+ * @example
7305
+ * ```js
7306
+ * {
7307
+ * hiddenActions: [Action.RemoveFromCollection],
7308
+ * disabledActions: [Action.RemoveFromCollection],
7309
+ * }
7310
+ * ```
7311
+ */
7312
+ Action["RemoveFromCollection"] = "removeFromCollection";
7313
+ /**
7314
+ * Controls the visibility and disabled state of the "Delete" menu item for a
7315
+ * Collection.
7316
+ * @version SDK: 1.52.1 | ThoughtSpot Cloud: 26.5.0.cl
7317
+ * @example
7318
+ * ```js
7319
+ * {
7320
+ * hiddenActions: [Action.DeleteCollection],
7321
+ * disabledActions: [Action.DeleteCollection],
7322
+ * }
7323
+ * ```
7324
+ */
7325
+ Action["DeleteCollection"] = "deleteCollection";
6970
7326
  })(exports.Action || (exports.Action = {}));
6971
7327
  var PrefetchFeatures;
6972
7328
  (function (PrefetchFeatures) {
@@ -7257,6 +7613,36 @@
7257
7613
  /** UpdateParameters payload is invalid - malformed applicability */
7258
7614
  EmbedErrorCodes["UPDATEPARAMETERS_INVALID_PAYLOAD"] = "UPDATEPARAMETERS_INVALID_PAYLOAD";
7259
7615
  })(EmbedErrorCodes || (EmbedErrorCodes = {}));
7616
+ /**
7617
+ * How badly an error affects the embed, so the host can decide whether it is
7618
+ * worth surfacing to the end user.
7619
+ *
7620
+ * Mirrors the severity that ThoughtSpot itself stamps on errors raised inside
7621
+ * the embedded app, so a host can apply one rule to both sources.
7622
+ *
7623
+ * @version SDK: 1.52.0 | ThoughtSpot Cloud: 26.9.0.cl
7624
+ * @group Error Handling
7625
+ *
7626
+ * @example
7627
+ * Only surface errors that took the embed down
7628
+ *
7629
+ * ```js
7630
+ * embed.on(EmbedEvent.Error, (error) => {
7631
+ * if (error.severity === EmbedErrorSeverity.SEV1) {
7632
+ * showBanner(error.message);
7633
+ * }
7634
+ * });
7635
+ * ```
7636
+ */
7637
+ var EmbedErrorSeverity;
7638
+ (function (EmbedErrorSeverity) {
7639
+ /** The embed cannot render. Nothing usable is on screen. */
7640
+ EmbedErrorSeverity[EmbedErrorSeverity["SEV1"] = 1] = "SEV1";
7641
+ /** Something is degraded but the embed still works. */
7642
+ EmbedErrorSeverity[EmbedErrorSeverity["SEV2"] = 2] = "SEV2";
7643
+ /** Everything else, including validation of the embedder's own input. */
7644
+ EmbedErrorSeverity[EmbedErrorSeverity["SEV3"] = 3] = "SEV3";
7645
+ })(EmbedErrorSeverity || (EmbedErrorSeverity = {}));
7260
7646
  /**
7261
7647
  * Context types for specifying the page context when triggering host events.
7262
7648
  * Used as the third parameter in the `trigger` method to help ThoughtSpot
@@ -7297,20 +7683,27 @@
7297
7683
  ContextType["Other"] = "other";
7298
7684
  })(ContextType || (ContextType = {}));
7299
7685
  /**
7300
- * Enum for the type of API intercepted
7686
+ * Named groups of ThoughtSpot APIs that can be intercepted, for use in
7687
+ * `interceptUrls`. Each group expands to the underlying request URLs, so you do
7688
+ * not have to list them individually.
7301
7689
  */
7302
7690
  var InterceptedApiType;
7303
7691
  (function (InterceptedApiType) {
7304
7692
  /**
7305
- * The apis that are use to get the data for the embed
7693
+ * The APIs that fetch the data backing an Answer, including its chart,
7694
+ * table, and headline data.
7306
7695
  */
7307
7696
  InterceptedApiType["AnswerData"] = "AnswerData";
7308
7697
  /**
7309
- * This will intercept all the apis
7698
+ * Intercepts every `fetch` request the embedded application makes, not only
7699
+ * the data APIs. This includes authentication, session, and metadata calls,
7700
+ * so the handler must respond to requests it does not recognize by passing
7701
+ * `execute: true`. Listing this alongside other entries in `interceptUrls`
7702
+ * supersedes them.
7310
7703
  */
7311
7704
  InterceptedApiType["ALL"] = "ALL";
7312
7705
  /**
7313
- * The apis that are use to get the data for the liveboard
7706
+ * The APIs that fetch the data backing a Liveboard.
7314
7707
  */
7315
7708
  InterceptedApiType["LiveboardData"] = "LiveboardData";
7316
7709
  })(InterceptedApiType || (InterceptedApiType = {}));
@@ -7434,7 +7827,7 @@
7434
7827
  TableContentDensity["Compact"] = "COMPACT";
7435
7828
  })(TableContentDensity || (TableContentDensity = {}));
7436
7829
 
7437
- var version$1="1.51.2";var pkg = {version:version$1};
7830
+ var version$1="1.52.1";var pkg = {version:version$1};
7438
7831
 
7439
7832
  const { version } = pkg;
7440
7833
 
@@ -8187,6 +8580,43 @@
8187
8580
  if (value !== undefined) {
8188
8581
  queryParams[param] = asBoolean ? !!value : value;
8189
8582
  }
8583
+ };
8584
+ /**
8585
+ * Calculates the element center for the currently visible viewport of the
8586
+ * element, using the scroll position of the host app, the offsetTop of the
8587
+ * element in the host app, and the viewport height of the tab.
8588
+ *
8589
+ * The returned keys are sent to the ThoughtSpot app over postMessage, so they
8590
+ * are named after the iframe and must not be renamed.
8591
+ * @param element The element to measure
8592
+ * @returns The element center within the visible viewport, the element height,
8593
+ * and the viewport height.
8594
+ */
8595
+ const calculateElementCenter = (element) => {
8596
+ const offsetTopClient = getOffsetTop(element);
8597
+ const scrollTopClient = window.scrollY;
8598
+ const viewPortHeight = window.innerHeight;
8599
+ const iframeHeight = element.offsetHeight;
8600
+ const iframeScrolled = scrollTopClient - offsetTopClient;
8601
+ let iframeVisibleViewPort;
8602
+ let iframeOffset;
8603
+ if (iframeScrolled < 0) {
8604
+ iframeVisibleViewPort = viewPortHeight - (offsetTopClient - scrollTopClient);
8605
+ iframeVisibleViewPort = Math.min(iframeHeight, iframeVisibleViewPort);
8606
+ iframeOffset = 0;
8607
+ }
8608
+ else {
8609
+ iframeVisibleViewPort = Math.min(iframeHeight - iframeScrolled, viewPortHeight);
8610
+ iframeOffset = iframeScrolled;
8611
+ }
8612
+ const iframeCenter = iframeOffset + iframeVisibleViewPort / 2;
8613
+ return {
8614
+ iframeCenter,
8615
+ iframeScrolled,
8616
+ iframeHeight,
8617
+ viewPortHeight,
8618
+ iframeVisibleViewPort,
8619
+ };
8190
8620
  };
8191
8621
 
8192
8622
  /** Used for built-in method references. */
@@ -9097,7 +9527,110 @@
9097
9527
  UIPassthroughEvent["GetTabs"] = "getTabs";
9098
9528
  UIPassthroughEvent["GetGroups"] = "getGroups";
9099
9529
  UIPassthroughEvent["GetExportRequestForCurrentPinboard"] = "getExportRequestForCurrentPinboard";
9100
- })(UIPassthroughEvent || (UIPassthroughEvent = {}));
9530
+ })(UIPassthroughEvent || (UIPassthroughEvent = {}));
9531
+ // NOTE: HostEventRequest / HostEventResponse / TriggerPayload / TriggerResponse
9532
+ // live in the sibling ./host-event-contracts, which layers the
9533
+ // HostEventRequestMap on top of the UI-passthrough mapping above.
9534
+ // The former 2-tier definitions that lived here were superseded and removed.
9535
+
9536
+ /**
9537
+ * Copyright (c) 2026
9538
+ *
9539
+ * Dedicated transport layer for SDK <-> ThoughtSpot iframe messaging.
9540
+ *
9541
+ * Owns the postMessage/MessageChannel mechanics and origin resolution so
9542
+ * that embed/business logic (ts-embed.ts, hostEventClient) never touches
9543
+ * the wire directly. The wire format is unchanged from the historical
9544
+ * implementation — this layer is a pure structural extraction.
9545
+ */
9546
+ /**
9547
+ * Default time to wait for the app to respond to a request-response
9548
+ * message before giving up and reclaiming the channel.
9549
+ */
9550
+ const MESSAGE_RESPONSE_TIMEOUT = 30000;
9551
+ /**
9552
+ * Single implementation of origin resolution for the embedded app.
9553
+ * Returns the origin (scheme://host[:port]) for a ThoughtSpot host URL,
9554
+ * or null when it cannot be parsed.
9555
+ * @param thoughtSpotHost
9556
+ */
9557
+ const resolveMessageOrigin = (thoughtSpotHost) => {
9558
+ try {
9559
+ return new URL(thoughtSpotHost).origin;
9560
+ }
9561
+ catch (e) {
9562
+ return null;
9563
+ }
9564
+ };
9565
+ /**
9566
+ * Validates that an inbound window message came from the embedded
9567
+ * ThoughtSpot app: the source window must be the embed iframe's window and,
9568
+ * when the expected origin is resolvable, the message origin must match it.
9569
+ *
9570
+ * Fails open (returns true) on the origin check when the expected origin
9571
+ * cannot be resolved, to avoid breaking unconventional-but-working setups;
9572
+ * a warning is logged on mismatch either way.
9573
+ * @param event The message event received on window.
9574
+ * @param iFrame The embed iframe the message should originate from.
9575
+ * @param thoughtSpotHost The configured ThoughtSpot host.
9576
+ */
9577
+ const isMessageFromIframe = (event, iFrame, thoughtSpotHost) => {
9578
+ if (event.source !== (iFrame === null || iFrame === void 0 ? void 0 : iFrame.contentWindow)) {
9579
+ return false;
9580
+ }
9581
+ const expectedOrigin = resolveMessageOrigin(thoughtSpotHost);
9582
+ if (expectedOrigin && event.origin && event.origin !== expectedOrigin) {
9583
+ logger$3.warn(`Dropped message from unexpected origin ${event.origin}; expected ${expectedOrigin}`);
9584
+ return false;
9585
+ }
9586
+ return true;
9587
+ };
9588
+ /**
9589
+ * Posts a one-way message to the embedded app's iframe, optionally
9590
+ * transferring a MessageChannel port for the response.
9591
+ * @param iFrame
9592
+ * @param message
9593
+ * @param thoughtSpotHost Used as the postMessage targetOrigin.
9594
+ * @param channel
9595
+ */
9596
+ const postMessageToIframe = (iFrame, message, thoughtSpotHost, channel) => {
9597
+ var _a;
9598
+ return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, channel ? [channel.port2] : []);
9599
+ };
9600
+ /**
9601
+ * Sends a request-response message to the embedded app over a dedicated
9602
+ * MessageChannel. Resolves with the response payload; rejects when the app
9603
+ * responds with an error; resolves with a timeout Error object when no
9604
+ * response arrives in time (historical behavior, preserved for backward
9605
+ * compatibility).
9606
+ * @param iFrame
9607
+ * @param message
9608
+ * @param thoughtSpotHost
9609
+ * @param timeoutMs
9610
+ */
9611
+ function sendMessageWithResponse(iFrame, message, thoughtSpotHost, timeoutMs = MESSAGE_RESPONSE_TIMEOUT) {
9612
+ return new Promise((res, rej) => {
9613
+ const channel = new MessageChannel();
9614
+ // Close the messageChannel and resolve the promise if timeout.
9615
+ const timeoutId = setTimeout(() => {
9616
+ channel.port1.close();
9617
+ res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
9618
+ }, timeoutMs);
9619
+ channel.port1.onmessage = ({ data: responseData }) => {
9620
+ var _a;
9621
+ clearTimeout(timeoutId);
9622
+ channel.port1.close();
9623
+ const error = (responseData === null || responseData === void 0 ? void 0 : responseData.error) || ((_a = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _a === void 0 ? void 0 : _a.error);
9624
+ if (error) {
9625
+ rej(error);
9626
+ }
9627
+ else {
9628
+ res(responseData);
9629
+ }
9630
+ };
9631
+ postMessageToIframe(iFrame, message, thoughtSpotHost, channel);
9632
+ });
9633
+ }
9101
9634
 
9102
9635
  const EndPoints = {
9103
9636
  AUTH_VERIFICATION: '/callosum/v1/session/info',
@@ -20307,23 +20840,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
20307
20840
  iFrame.src = src;
20308
20841
  }, 100);
20309
20842
  };
20843
+ const TRIGGER_TIMEOUT = MESSAGE_RESPONSE_TIMEOUT;
20310
20844
  /**
20311
- * Post iframe message.
20312
- * @param iFrame
20313
- * @param message
20314
- * @param message.type
20315
- * @param message.data
20316
- * @param message.context
20317
- * @param thoughtSpotHost
20318
- * @param channel
20319
- */
20320
- function postIframeMessage(iFrame, message, thoughtSpotHost, channel) {
20321
- var _a;
20322
- return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
20323
- }
20324
- const TRIGGER_TIMEOUT = 30000;
20325
- /**
20326
- *
20845
+ * Processes a host event trigger: handles SDK-local events (Reload,
20846
+ * Present) and forwards everything else to the embedded app over the
20847
+ * iframe transport.
20327
20848
  * @param iFrame
20328
20849
  * @param messageType
20329
20850
  * @param thoughtSpotHost
@@ -20331,42 +20852,22 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
20331
20852
  * @param context
20332
20853
  */
20333
20854
  function processTrigger(iFrame, messageType, thoughtSpotHost, data, context) {
20334
- return new Promise((res, rej) => {
20335
- var _a;
20336
- if (messageType === exports.HostEvent.Reload) {
20337
- reload(iFrame);
20338
- return res(null);
20339
- }
20340
- if (messageType === exports.HostEvent.Present) {
20341
- const embedConfig = getEmbedConfig();
20342
- const disableFullscreenPresentation = (_a = embedConfig === null || embedConfig === void 0 ? void 0 : embedConfig.disableFullscreenPresentation) !== null && _a !== void 0 ? _a : true;
20343
- if (!disableFullscreenPresentation) {
20344
- handlePresentEvent(iFrame);
20345
- }
20346
- else {
20347
- logger$3.warn('Fullscreen presentation mode is disabled. Set disableFullscreenPresentation: false to enable this feature.');
20348
- }
20855
+ var _a;
20856
+ if (messageType === exports.HostEvent.Reload) {
20857
+ reload(iFrame);
20858
+ return Promise.resolve(null);
20859
+ }
20860
+ if (messageType === exports.HostEvent.Present) {
20861
+ const embedConfig = getEmbedConfig();
20862
+ const disableFullscreenPresentation = (_a = embedConfig === null || embedConfig === void 0 ? void 0 : embedConfig.disableFullscreenPresentation) !== null && _a !== void 0 ? _a : true;
20863
+ if (!disableFullscreenPresentation) {
20864
+ handlePresentEvent(iFrame);
20349
20865
  }
20350
- const channel = new MessageChannel();
20351
- // Close the messageChannel and resolve the promise if timeout.
20352
- const timeoutId = setTimeout(() => {
20353
- channel.port1.close();
20354
- res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
20355
- }, TRIGGER_TIMEOUT);
20356
- channel.port1.onmessage = ({ data: responseData }) => {
20357
- var _a;
20358
- clearTimeout(timeoutId);
20359
- channel.port1.close();
20360
- const error = (responseData === null || responseData === void 0 ? void 0 : responseData.error) || ((_a = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _a === void 0 ? void 0 : _a.error);
20361
- if (error) {
20362
- rej(error);
20363
- }
20364
- else {
20365
- res(responseData);
20366
- }
20367
- };
20368
- return postIframeMessage(iFrame, { type: messageType, data, context }, thoughtSpotHost, channel);
20369
- });
20866
+ else {
20867
+ logger$3.warn('Fullscreen presentation mode is disabled. Set disableFullscreenPresentation: false to enable this feature.');
20868
+ }
20869
+ }
20870
+ return sendMessageWithResponse(iFrame, { type: messageType, data, context }, thoughtSpotHost, TRIGGER_TIMEOUT);
20370
20871
  }
20371
20872
 
20372
20873
  /**
@@ -21075,6 +21576,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
21075
21576
  if (!isValidUpdateFiltersPayload(payload)) {
21076
21577
  throwUpdateFiltersValidationError();
21077
21578
  }
21579
+ // The shared contract accepts both current (columnName/operator) and
21580
+ // legacy (column/oper) filter field names — as does the validation
21581
+ // above and the app at runtime. The UIPassthrough FilterUpdate type
21582
+ // still requires the legacy names; bridge until that contract is
21583
+ // audited.
21078
21584
  return this.handleHostEventWithParam(UIPassthroughEvent.UpdateFilters, payload, context);
21079
21585
  }
21080
21586
  handleUpdateParametersEvent(payload, context) {
@@ -21225,6 +21731,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
21225
21731
  errorType: ErrorDetailsTypes.API,
21226
21732
  message: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
21227
21733
  code: EmbedErrorCodes.PARSING_API_INTERCEPT_BODY_ERROR,
21734
+ severity: EmbedErrorSeverity.SEV3,
21228
21735
  error: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
21229
21736
  };
21230
21737
  executeEvent(exports.EmbedEvent.Error, errorDetails);
@@ -21308,6 +21815,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
21308
21815
  */
21309
21816
  const PRERENDER_CONTAINER_ORIGINAL_POSITION_KEY = 'tsEmbedOriginalPosition';
21310
21817
  const PRERENDER_WRAPPER_ID_PREFIX = 'tsEmbed-pre-render-wrapper-';
21818
+ // The container applies UpdateEmbedParams through React state, so a delivered
21819
+ // post is not the same as the params being in effect.
21820
+ const UPDATE_EMBED_PARAMS_SETTLE_MS = 200;
21821
+ // The container ignores runtimeFilterParams/runtimeParameterParams unless truthy, so
21822
+ // null or '' leaves the previous embed's values in place. '&' is truthy and parses to {}.
21823
+ const NO_RUNTIME_PARAMS = '&';
21311
21824
  /**
21312
21825
  * The event id map from v2 event names to v1 event id
21313
21826
  * v1 events are the classic embed events implemented in Blink v1
@@ -21334,6 +21847,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
21334
21847
  * The key to store the embed instance in the DOM node
21335
21848
  */
21336
21849
  this.embedNodeKey = '__tsEmbed';
21850
+ this.embedContainerLoadedKey = '__tsEmbedContainerLoaded';
21337
21851
  this.isAppInitialized = false;
21338
21852
  /**
21339
21853
  * Should we encode URL Query Params using base64 encoding which ThoughtSpot
@@ -21354,7 +21868,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
21354
21868
  const eventType = this.getEventType(event);
21355
21869
  const eventPort = this.getEventPort(event);
21356
21870
  const eventData = this.formatEventData(event, eventType);
21357
- if (event.source === this.iFrame.contentWindow) {
21871
+ if (isMessageFromIframe(event, this.iFrame, this.thoughtSpotHost)) {
21358
21872
  const processedEventData = processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.hostElement);
21359
21873
  if (eventType === exports.EmbedEvent.ApiIntercept) {
21360
21874
  this.handleApiInterceptEvent({ eventData, eventPort });
@@ -21496,7 +22010,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
21496
22010
  this.createEmbedContainerHandler = (source) => () => {
21497
22011
  const processEmbedContainerReady = () => {
21498
22012
  logger$3.debug('processEmbedContainerReady');
21499
- this.isEmbedContainerLoaded = true;
22013
+ this.markEmbedContainerLoaded();
21500
22014
  this.executeEmbedContainerReadyCallbacks();
21501
22015
  };
21502
22016
  if (source === exports.EmbedEvent.AuthInit) {
@@ -21510,6 +22024,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
21510
22024
  processEmbedContainerReady();
21511
22025
  }
21512
22026
  };
22027
+ // Subclasses that navigate the pre-render on show must await this before
22028
+ // triggering Navigate. Resolves even on failure, so navigation is never blocked.
22029
+ this.preRenderParamsApplied = Promise.resolve();
21513
22030
  this.hostElement = getDOMNode(domSelector);
21514
22031
  this.eventHandlerMap = new Map();
21515
22032
  this.isError = false;
@@ -21569,6 +22086,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
21569
22086
  errorType: ErrorDetailsTypes.VALIDATION_ERROR,
21570
22087
  message: ERROR_MESSAGE.INIT_SDK_REQUIRED,
21571
22088
  code: EmbedErrorCodes.INIT_ERROR,
22089
+ severity: EmbedErrorSeverity.SEV1,
21572
22090
  error: ERROR_MESSAGE.INIT_SDK_REQUIRED,
21573
22091
  });
21574
22092
  }
@@ -21579,7 +22097,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
21579
22097
  */
21580
22098
  handleError(errorDetails) {
21581
22099
  this.isError = true;
21582
- this.executeCallbacks(exports.EmbedEvent.Error, errorDetails);
22100
+ this.executeCallbacks(exports.EmbedEvent.Error, {
22101
+ severity: EmbedErrorSeverity.SEV3,
22102
+ ...errorDetails,
22103
+ });
21583
22104
  // Log error
21584
22105
  logger$3.error(errorDetails);
21585
22106
  }
@@ -21664,6 +22185,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
21664
22185
  errorType: ErrorDetailsTypes.NETWORK,
21665
22186
  message: ERROR_MESSAGE.OFFLINE_WARNING,
21666
22187
  code: EmbedErrorCodes.NETWORK_ERROR,
22188
+ severity: EmbedErrorSeverity.SEV2,
21667
22189
  offlineWarning: ERROR_MESSAGE.OFFLINE_WARNING,
21668
22190
  };
21669
22191
  this.executeCallbacks(exports.EmbedEvent.Error, errorDetails);
@@ -21821,6 +22343,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
21821
22343
  return `${basePath}#`;
21822
22344
  }
21823
22345
  async getUpdateEmbedParamsObject() {
22346
+ var _a, _b;
21824
22347
  const queryParams = this.getEmbedParamsObject();
21825
22348
  // Values are URL-serialized (e.g. dataSources as '["guid"]'); parse
21826
22349
  // them back so the event payload matches a URL load (SCAL-334713).
@@ -21828,7 +22351,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
21828
22351
  queryParams[key] = deserializeParam(queryParams[key]);
21829
22352
  });
21830
22353
  const appInitData = await this.getAppInitData();
21831
- return { ...this.viewConfig, ...queryParams, ...appInitData };
22354
+ return {
22355
+ ...this.viewConfig,
22356
+ ...queryParams,
22357
+ ...appInitData,
22358
+ // A show cycle has no URL to carry these, so the payload always states them
22359
+ // — including "none", which is the case that leaks the previous filters.
22360
+ runtimeFilterParams: getFilterQuery((_a = this.viewConfig.runtimeFilters) !== null && _a !== void 0 ? _a : []) || NO_RUNTIME_PARAMS,
22361
+ runtimeParameterParams: getRuntimeParameters((_b = this.viewConfig.runtimeParameters) !== null && _b !== void 0 ? _b : [])
22362
+ || NO_RUNTIME_PARAMS,
22363
+ };
21832
22364
  }
21833
22365
  /**
21834
22366
  * Common query params set for all the embed modes.
@@ -22036,9 +22568,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
22036
22568
  return iFrame;
22037
22569
  }
22038
22570
  /**
22039
- * Returns a merged {@link PreRenderConfig} object where each shared key
22040
- * prefers `preRenderConfig.key` over the top-level `viewConfig.key` for
22041
- * backward compatibility.
22571
+ * Returns a merged {@link PreRenderConfig} object where each key prefers the
22572
+ * value from `preRenderConfig` over its deprecated top-level `viewConfig`
22573
+ * counterpart (`id`/`preRenderId`, `containerSelector`/`preRenderContainer`,
22574
+ * `doNotTrackSize`/`doNotTrackPreRenderSize`) for backward compatibility.
22042
22575
  */
22043
22576
  getPreRenderConfig() {
22044
22577
  var _a, _b, _c, _d;
@@ -22046,16 +22579,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
22046
22579
  const preRenderCfg = (_a = viewCfg.preRenderConfig) !== null && _a !== void 0 ? _a : {};
22047
22580
  return {
22048
22581
  ...preRenderCfg,
22049
- preRenderId: (_b = preRenderCfg.preRenderId) !== null && _b !== void 0 ? _b : viewCfg.preRenderId,
22050
- preRenderContainer: (_c = preRenderCfg.preRenderContainer) !== null && _c !== void 0 ? _c : viewCfg.preRenderContainer,
22051
- doNotTrackPreRenderSize: (_d = preRenderCfg.doNotTrackPreRenderSize) !== null && _d !== void 0 ? _d : viewCfg.doNotTrackPreRenderSize,
22582
+ id: (_b = preRenderCfg.id) !== null && _b !== void 0 ? _b : viewCfg.preRenderId,
22583
+ containerSelector: (_c = preRenderCfg.containerSelector) !== null && _c !== void 0 ? _c : viewCfg.preRenderContainer,
22584
+ doNotTrackSize: (_d = preRenderCfg.doNotTrackSize) !== null && _d !== void 0 ? _d : viewCfg.doNotTrackPreRenderSize,
22052
22585
  };
22053
22586
  }
22054
22587
  /**
22055
22588
  * Returns true if this embed instance is configured for pre-rendering.
22056
22589
  */
22057
22590
  isPreRenderEmbed() {
22058
- return !!this.getPreRenderConfig().preRenderId;
22591
+ return !!this.getPreRenderConfig().id;
22059
22592
  }
22060
22593
  handleInsertionIntoDOM(child) {
22061
22594
  if (this.isPreRenderEmbed()) {
@@ -22151,6 +22684,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
22151
22684
  errorType: ErrorDetailsTypes.API,
22152
22685
  message: error.message || ERROR_MESSAGE.LOGIN_FAILED,
22153
22686
  code: EmbedErrorCodes.LOGIN_FAILED,
22687
+ severity: EmbedErrorSeverity.SEV1,
22154
22688
  error: error,
22155
22689
  });
22156
22690
  });
@@ -22242,7 +22776,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
22242
22776
  */
22243
22777
  resolvePreRenderContainerTarget() {
22244
22778
  var _a;
22245
- const containerConfig = this.getPreRenderConfig().preRenderContainer;
22779
+ const containerConfig = this.getPreRenderConfig().containerSelector;
22246
22780
  let container = null;
22247
22781
  if (typeof containerConfig === 'string') {
22248
22782
  try {
@@ -22267,7 +22801,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
22267
22801
  return;
22268
22802
  }
22269
22803
  const ownerContainer = (_a = preRenderedObject.preRenderContainerEl) !== null && _a !== void 0 ? _a : document.body;
22270
- if (this.getPreRenderConfig().preRenderContainer
22804
+ if (this.getPreRenderConfig().containerSelector
22271
22805
  && this.resolvePreRenderContainerTarget() !== ownerContainer) {
22272
22806
  logger$3.warn('preRenderContainer is applied only by the component that creates the preRender; '
22273
22807
  + 'the one passed here is ignored. Set it on the PreRender component instead.');
@@ -22457,40 +22991,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
22457
22991
  getCompatibleEventType(eventType) {
22458
22992
  return V1EventMap[eventType] || eventType;
22459
22993
  }
22460
- /**
22461
- * Calculates the iframe center for the current visible viewPort
22462
- * of iframe using Scroll position of Host App, offsetTop for iframe
22463
- * in Host app. ViewPort height of the tab.
22464
- * @returns iframe Center in visible viewport,
22465
- * Iframe height,
22466
- * View port height.
22467
- */
22468
- getIframeCenter() {
22469
- const offsetTopClient = getOffsetTop(this.iFrame);
22470
- const scrollTopClient = window.scrollY;
22471
- const viewPortHeight = window.innerHeight;
22472
- const iframeHeight = this.iFrame.offsetHeight;
22473
- const iframeScrolled = scrollTopClient - offsetTopClient;
22474
- let iframeVisibleViewPort;
22475
- let iframeOffset;
22476
- if (iframeScrolled < 0) {
22477
- iframeVisibleViewPort = viewPortHeight - (offsetTopClient - scrollTopClient);
22478
- iframeVisibleViewPort = Math.min(iframeHeight, iframeVisibleViewPort);
22479
- iframeOffset = 0;
22480
- }
22481
- else {
22482
- iframeVisibleViewPort = Math.min(iframeHeight - iframeScrolled, viewPortHeight);
22483
- iframeOffset = iframeScrolled;
22484
- }
22485
- const iframeCenter = iframeOffset + iframeVisibleViewPort / 2;
22486
- return {
22487
- iframeCenter,
22488
- iframeScrolled,
22489
- iframeHeight,
22490
- viewPortHeight,
22491
- iframeVisibleViewPort,
22492
- };
22493
- }
22494
22994
  /**
22495
22995
  * Registers an event listener to trigger an alert when the ThoughtSpot app
22496
22996
  * sends an event of a particular message type to the host application.
@@ -22574,13 +23074,32 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
22574
23074
  var _a;
22575
23075
  const embedObj = (_a = this.preRenderWrapper) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
22576
23076
  if (embedObj === this) {
22577
- logger$3.info('embedObj is same as this');
23077
+ logger$3.debug('embedObj is same as this');
22578
23078
  }
22579
23079
  return embedObj;
22580
23080
  }
23081
+ takeOverPreRender() {
23082
+ if (!this.preRenderWrapper)
23083
+ return;
23084
+ this.preRenderWrapper[this.embedNodeKey] = this;
23085
+ }
23086
+ // The flag lives on the wrapper because it describes the iframe: an instance
23087
+ // hidden when the container announced itself would otherwise report false forever.
23088
+ markEmbedContainerLoaded() {
23089
+ this.isEmbedContainerLoaded = true;
23090
+ if (this.preRenderWrapper) {
23091
+ this.preRenderWrapper[this.embedContainerLoadedKey] = true;
23092
+ }
23093
+ }
22581
23094
  checkEmbedContainerLoaded() {
23095
+ var _a;
22582
23096
  if (this.isEmbedContainerLoaded)
22583
23097
  return true;
23098
+ if ((_a = this.preRenderWrapper) === null || _a === void 0 ? void 0 : _a[this.embedContainerLoadedKey]) {
23099
+ this.isEmbedContainerLoaded = true;
23100
+ return true;
23101
+ }
23102
+ // Older builds stamped the flag on the instance, not the wrapper.
22584
23103
  const preRenderObj = this.getPreRenderObj();
22585
23104
  if (preRenderObj && preRenderObj.isEmbedContainerLoaded) {
22586
23105
  this.isEmbedContainerLoaded = true;
@@ -22609,8 +23128,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
22609
23128
  }
22610
23129
  /**
22611
23130
  * Triggers an event to the embedded app
23131
+ *
23132
+ * Payload typing: from SDK 1.52.0 (ThoughtSpot Cloud 26.9.0.cl), unknown fields
23133
+ * on a known event's payload fail to compile. From SDK 1.54.0 (26.11.0.cl) the
23134
+ * payload is checked strictly against the event contract — update call sites now.
22612
23135
  * @param {HostEvent} messageType The event type
22613
- * @param {any} data The payload to send with the message
23136
+ * @param {TriggerData} data The payload, typed against the event's contract
22614
23137
  * @param {ContextType} context Optional context type to specify the context from which the event is triggered.
22615
23138
  * Use ContextType.Search for search answer context, ContextType.Answer for answer/explore context,
22616
23139
  * ContextType.Liveboard for liveboard context, or ContextType.Spotter for spotter context.
@@ -22627,7 +23150,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
22627
23150
  * ```
22628
23151
  * @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl (for context parameter)
22629
23152
  */
22630
- async trigger(messageType, data = {}, context) {
23153
+ async trigger(messageType,
23154
+ // Contract shape is the contextual type: payload fields autocomplete
23155
+ // and unknown fields on object literals are flagged. Strict checks
23156
+ // land in SDK 1.54.0 — see TriggerData.
23157
+ data = {}, context) {
22631
23158
  uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
22632
23159
  if (!this.isRendered) {
22633
23160
  this.handleError({
@@ -22764,7 +23291,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
22764
23291
  showPreRenderByDefault,
22765
23292
  replaceExistingPreRender,
22766
23293
  });
22767
- if (!this.getPreRenderConfig().preRenderId) {
23294
+ if (!this.getPreRenderConfig().id) {
22768
23295
  logger$3.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
22769
23296
  return this;
22770
23297
  }
@@ -22915,20 +23442,27 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
22915
23442
  // have moved on to UpdateEmbedParams supported clusters
22916
23443
  // this.validatePreRenderViewConfig(this.viewConfig); removed in #517
22917
23444
  logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
22918
- this.executeAfterEmbedContainerLoaded(async () => {
22919
- try {
22920
- const params = await this.getUpdateEmbedParamsObject();
22921
- this.trigger(exports.HostEvent.UpdateEmbedParams, params);
22922
- }
22923
- catch (error) {
22924
- logger$3.error(ERROR_MESSAGE.UPDATE_PARAMS_FAILED, error);
22925
- this.handleError({
22926
- errorType: ErrorDetailsTypes.API,
22927
- message: (error === null || error === void 0 ? void 0 : error.message) || ERROR_MESSAGE.UPDATE_PARAMS_FAILED,
22928
- code: EmbedErrorCodes.UPDATE_PARAMS_FAILED,
22929
- error: (error === null || error === void 0 ? void 0 : error.message) || error,
22930
- });
22931
- }
23445
+ // Created synchronously: a queued navigation needs something to await
23446
+ // whether the container is already loaded or not.
23447
+ this.preRenderParamsApplied = new Promise((resolve) => {
23448
+ this.executeAfterEmbedContainerLoaded(async () => {
23449
+ try {
23450
+ const params = await this.getUpdateEmbedParamsObject();
23451
+ this.trigger(exports.HostEvent.UpdateEmbedParams, params);
23452
+ }
23453
+ catch (error) {
23454
+ logger$3.error(ERROR_MESSAGE.UPDATE_PARAMS_FAILED, error);
23455
+ this.handleError({
23456
+ errorType: ErrorDetailsTypes.API,
23457
+ message: (error === null || error === void 0 ? void 0 : error.message) || ERROR_MESSAGE.UPDATE_PARAMS_FAILED,
23458
+ code: EmbedErrorCodes.UPDATE_PARAMS_FAILED,
23459
+ error: (error === null || error === void 0 ? void 0 : error.message) || error,
23460
+ });
23461
+ }
23462
+ finally {
23463
+ setTimeout(resolve, UPDATE_EMBED_PARAMS_SETTLE_MS);
23464
+ }
23465
+ });
22932
23466
  });
22933
23467
  }
22934
23468
  /**
@@ -22940,12 +23474,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
22940
23474
  async showPreRender() {
22941
23475
  var _a, _b;
22942
23476
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_SHOW_PRE_RENDER, {
22943
- preRenderId: this.getPreRenderConfig().preRenderId,
23477
+ preRenderId: this.getPreRenderConfig().id,
22944
23478
  embedComponentType: this.viewConfig.embedComponentType,
22945
23479
  });
22946
23480
  if (this.shouldWaitForRenderPromise)
22947
23481
  await this.isReadyForRenderPromise;
22948
- if (!this.getPreRenderConfig().preRenderId) {
23482
+ if (!this.getPreRenderConfig().id) {
22949
23483
  logger$3.error(ERROR_MESSAGE.PRERENDER_ID_MISSING);
22950
23484
  return this;
22951
23485
  }
@@ -22981,7 +23515,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
22981
23515
  this.containerScrollListener = () => this.syncPreRenderStyle();
22982
23516
  customContainer.addEventListener('scroll', this.containerScrollListener);
22983
23517
  }
22984
- if (!this.getPreRenderConfig().doNotTrackPreRenderSize) {
23518
+ if (!this.getPreRenderConfig().doNotTrackSize) {
22985
23519
  const observeTarget = (_b = this.insertedDomEl) !== null && _b !== void 0 ? _b : this.hostElement;
22986
23520
  this.resizeObserver = new ResizeObserver((entries) => {
22987
23521
  entries.forEach((entry) => {
@@ -23004,6 +23538,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
23004
23538
  if (this.iFrame) {
23005
23539
  this.setupFullscreenChangeHandler();
23006
23540
  }
23541
+ // Last, so everything above still sees the instance being taken over from.
23542
+ this.takeOverPreRender();
23007
23543
  return this;
23008
23544
  }
23009
23545
  getPreRenderPlaceHolderElement() {
@@ -23049,7 +23585,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
23049
23585
  */
23050
23586
  hidePreRender() {
23051
23587
  uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_HIDE_PRE_RENDER, {
23052
- preRenderId: this.getPreRenderConfig().preRenderId,
23588
+ preRenderId: this.getPreRenderConfig().id,
23053
23589
  embedComponentType: this.viewConfig.embedComponentType,
23054
23590
  });
23055
23591
  logger$3.debug('HidePreRender Called');
@@ -23087,7 +23623,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
23087
23623
  * @property {string} child - The HTML element ID for the PreRender child.
23088
23624
  */
23089
23625
  getPreRenderIds() {
23090
- const preRenderId = this.getPreRenderConfig().preRenderId;
23626
+ const preRenderId = this.getPreRenderConfig().id;
23091
23627
  return {
23092
23628
  wrapper: `${PRERENDER_WRAPPER_ID_PREFIX}${preRenderId}`,
23093
23629
  child: `tsEmbed-pre-render-child-${preRenderId}`,
@@ -23206,6 +23742,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
23206
23742
  * ```
23207
23743
  */
23208
23744
  on(messageType, callback, options = { start: false }) {
23745
+ // Mirror the base TsEmbed.on generic signature so the enriched
23746
+ // EmbedEventPayload (e.g. CustomAction's answerService) flows through
23747
+ // the override too, and the class hierarchy stays assignable.
23209
23748
  const eventType = this.getCompatibleEventType(messageType);
23210
23749
  return super.on(eventType, callback, options);
23211
23750
  }
@@ -23375,7 +23914,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
23375
23914
  }
23376
23915
  getEmbedParamsObject() {
23377
23916
  var _a;
23378
- const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, isThisPeriodInDateFiltersEnabled, newChartsLibrary, } = this.viewConfig;
23917
+ const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, isThisPeriodInDateFiltersEnabled, newChartsLibrary, hideAnswerEditPanel, } = this.viewConfig;
23379
23918
  const queryParams = this.getBaseQueryParams();
23380
23919
  queryParams[Param.HideActions] = [
23381
23920
  ...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
@@ -23398,6 +23937,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
23398
23937
  if (enableSearchAssist) {
23399
23938
  queryParams[Param.EnableSearchAssist] = true;
23400
23939
  }
23940
+ if (hideAnswerEditPanel !== undefined) {
23941
+ queryParams[Param.ShowAnswerEditPanel] = !hideAnswerEditPanel;
23942
+ }
23401
23943
  if (hideResults) {
23402
23944
  queryParams[Param.HideResult] = true;
23403
23945
  }
@@ -23483,6 +24025,270 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
23483
24025
  }
23484
24026
  };
23485
24027
 
24028
+ /**
24029
+ * Copyright (c) 2025
24030
+ *
24031
+ * Full-height support for the Liveboard and app embeds.
24032
+ * @summary Full height
24033
+ */
24034
+ /**
24035
+ * The height the embed falls back to when the host app has not configured
24036
+ * `minimumHeight` or `defaultHeight`.
24037
+ */
24038
+ const DEFAULT_MINIMUM_HEIGHT = 500;
24039
+ /**
24040
+ * Routes that are part of the Liveboard experience itself. Navigating between
24041
+ * these does not reset the frame height, because the ThoughtSpot app keeps
24042
+ * reporting a height of its own for them.
24043
+ */
24044
+ const LIVEBOARD_RELATED_ROUTES = [
24045
+ '/pinboard/',
24046
+ '/insights/pinboard/',
24047
+ '/schedules/',
24048
+ '/embed/viz/',
24049
+ '/embed/insights/viz/',
24050
+ '/liveboard/',
24051
+ '/insights/liveboard/',
24052
+ '/tsl-editor/PINBOARD_ANSWER_BOOK/',
24053
+ '/import-tsl/PINBOARD_ANSWER_BOOK/',
24054
+ ];
24055
+ /**
24056
+ * Owns every piece of full-height behavior for an embed: the height
24057
+ * negotiation with the ThoughtSpot app, the query parameters that switch the
24058
+ * feature on, and the viewport listeners that drive lazy loading.
24059
+ *
24060
+ * The controller is inert unless `fullHeight` is enabled, so embeds can create
24061
+ * one unconditionally.
24062
+ */
24063
+ class FullHeightController {
24064
+ constructor(viewConfig, host) {
24065
+ this.host = host;
24066
+ this.scrollContainers = [];
24067
+ /**
24068
+ * Sets the frame height to the height reported by the ThoughtSpot app,
24069
+ * never going below the configured minimum.
24070
+ */
24071
+ this.handleEmbedHeight = (payload) => {
24072
+ const height = Number(payload === null || payload === void 0 ? void 0 : payload.data);
24073
+ if (!isNaN(height)) {
24074
+ this.host.setFrameHeight(Math.max(height, this.minimumHeight));
24075
+ }
24076
+ this.sendVisibleCoordinates();
24077
+ };
24078
+ /**
24079
+ * Answers the app's request for the center of the visible embed region.
24080
+ */
24081
+ this.handleEmbedIframeCenter = (payload, responder) => {
24082
+ const iframe = this.host.getIframe();
24083
+ if (!iframe) {
24084
+ return;
24085
+ }
24086
+ responder === null || responder === void 0 ? void 0 : responder({
24087
+ type: exports.EmbedEvent.EmbedIframeCenter,
24088
+ data: calculateElementCenter(iframe),
24089
+ });
24090
+ };
24091
+ /**
24092
+ * Answers the app's request for the currently visible embed coordinates.
24093
+ */
24094
+ this.handleRequestVisibleCoordinates = (payload, responder) => {
24095
+ logger$3.info('Sending RequestVisibleEmbedCoordinates', payload);
24096
+ responder === null || responder === void 0 ? void 0 : responder({
24097
+ type: exports.EmbedEvent.RequestVisibleEmbedCoordinates,
24098
+ data: this.getVisibleCoordinates(),
24099
+ });
24100
+ };
24101
+ /**
24102
+ * Resets the frame height when the app navigates away from a Liveboard,
24103
+ * since only Liveboard routes report a height of their own.
24104
+ */
24105
+ this.handleRouteChange = (payload) => {
24106
+ var _a, _b;
24107
+ const currentPath = (_a = payload === null || payload === void 0 ? void 0 : payload.data) === null || _a === void 0 ? void 0 : _a.currentPath;
24108
+ if (!currentPath) {
24109
+ return;
24110
+ }
24111
+ if (LIVEBOARD_RELATED_ROUTES.some((route) => currentPath.startsWith(route))) {
24112
+ return;
24113
+ }
24114
+ this.host.setFrameHeight(((_b = this.config.frameParams) === null || _b === void 0 ? void 0 : _b.height) || this.minimumHeight);
24115
+ };
24116
+ /**
24117
+ * Pushes the visible embed region to the app so it can decide which
24118
+ * visualizations to load.
24119
+ */
24120
+ this.sendVisibleCoordinates = () => {
24121
+ if (!this.isLazyLoadEnabled) {
24122
+ return;
24123
+ }
24124
+ const coordinates = this.getVisibleCoordinates();
24125
+ if (coordinates) {
24126
+ this.host.trigger(exports.HostEvent.VisibleEmbedCoordinates, coordinates);
24127
+ }
24128
+ };
24129
+ this.config = FullHeightController.withLazyLoadingDefaults(viewConfig);
24130
+ this.registerEventHandlers();
24131
+ }
24132
+ /**
24133
+ * The view config the controller runs on: the host app's own config with
24134
+ * the lazy-loading defaults filled in. Read-only, so the only way to change
24135
+ * it is through the setter, which re-resolves the defaults.
24136
+ */
24137
+ get viewConfig() {
24138
+ return this.config;
24139
+ }
24140
+ /**
24141
+ * Replaces the view config the controller runs on and re-resolves the
24142
+ * lazy-loading defaults against it. The config the caller passes is never
24143
+ * written to; the controller keeps a copy of its own.
24144
+ */
24145
+ set viewConfig(viewConfig) {
24146
+ this.config = FullHeightController.withLazyLoadingDefaults(viewConfig);
24147
+ }
24148
+ /**
24149
+ * The view config with the lazy-loading settings the embed falls back to
24150
+ * when the host app has not chosen its own.
24151
+ *
24152
+ * Pure by design: it returns a new config rather than writing to the one it
24153
+ * is given, so the host app's object is left untouched.
24154
+ * @param viewConfig The embed's view config
24155
+ * @returns A copy with the defaults filled in, host app choices preserved
24156
+ */
24157
+ static withLazyLoadingDefaults(viewConfig) {
24158
+ return {
24159
+ ...viewConfig,
24160
+ lazyLoadingForFullHeight: viewConfig.lazyLoadingForFullHeight === undefined
24161
+ ? true
24162
+ : viewConfig.lazyLoadingForFullHeight,
24163
+ enableScrollableContainerLazyLoading: viewConfig.enableScrollableContainerLazyLoading === undefined
24164
+ ? true
24165
+ : viewConfig.enableScrollableContainerLazyLoading,
24166
+ lazyLoadingMargin: viewConfig.lazyLoadingMargin === undefined
24167
+ ? DEFAULT_LAZY_LOADING_MARGIN
24168
+ : viewConfig.lazyLoadingMargin,
24169
+ };
24170
+ }
24171
+ /**
24172
+ * Whether the host app asked for a full-height embed.
24173
+ */
24174
+ get isEnabled() {
24175
+ return this.config.fullHeight === true;
24176
+ }
24177
+ /**
24178
+ * Whether visualizations should load as they scroll into view, which
24179
+ * requires the SDK to report the visible region of the embed.
24180
+ */
24181
+ get isLazyLoadEnabled() {
24182
+ return this.isEnabled && !!this.config.lazyLoadingForFullHeight;
24183
+ }
24184
+ /**
24185
+ * The floor for the frame height. `defaultHeight` is the deprecated
24186
+ * spelling of `minimumHeight` and is still honored for compatibility.
24187
+ */
24188
+ get minimumHeight() {
24189
+ const { minimumHeight, defaultHeight } = this.config;
24190
+ return minimumHeight || defaultHeight || DEFAULT_MINIMUM_HEIGHT;
24191
+ }
24192
+ /**
24193
+ * Registers the embed event handlers the feature depends on. Called from
24194
+ * the constructor, so the handlers are in place before `render`.
24195
+ */
24196
+ registerEventHandlers() {
24197
+ if (!this.isEnabled) {
24198
+ return;
24199
+ }
24200
+ this.host.on(exports.EmbedEvent.RouteChange, this.handleRouteChange);
24201
+ this.host.on(exports.EmbedEvent.EmbedHeight, this.handleEmbedHeight);
24202
+ this.host.on(exports.EmbedEvent.EmbedIframeCenter, this.handleEmbedIframeCenter);
24203
+ this.host.on(exports.EmbedEvent.RequestVisibleEmbedCoordinates, this.handleRequestVisibleCoordinates);
24204
+ }
24205
+ /**
24206
+ * Adds the full-height query parameters to the embed URL params.
24207
+ * @param params The query parameters being built by the embed
24208
+ */
24209
+ addQueryParams(params) {
24210
+ if (!this.isEnabled) {
24211
+ return;
24212
+ }
24213
+ params[Param.fullHeight] = true;
24214
+ if (!this.config.lazyLoadingForFullHeight) {
24215
+ return;
24216
+ }
24217
+ params[Param.IsLazyLoadingForEmbedEnabled] = true;
24218
+ if (isValidCssMargin(this.config.lazyLoadingMargin)) {
24219
+ params[Param.RootMarginForLazyLoad] = this.config.lazyLoadingMargin;
24220
+ }
24221
+ }
24222
+ /**
24223
+ * Attaches the viewport listeners that keep lazy loading in sync. Call this
24224
+ * once the embed has rendered and the iframe exists.
24225
+ */
24226
+ onRender() {
24227
+ this.registerLazyLoadListeners();
24228
+ }
24229
+ /**
24230
+ * Detaches every listener and observer owned by the controller.
24231
+ */
24232
+ destroy() {
24233
+ this.unregisterLazyLoadListeners();
24234
+ }
24235
+ getVisibleCoordinates() {
24236
+ const iframe = this.host.getIframe();
24237
+ if (!iframe) {
24238
+ return null;
24239
+ }
24240
+ return calculateVisibleElementData(iframe, this.config.enableScrollableContainerLazyLoading);
24241
+ }
24242
+ registerLazyLoadListeners() {
24243
+ if (!this.isLazyLoadEnabled || !this.host.getIframe()) {
24244
+ return;
24245
+ }
24246
+ // Re-registering is safe: drop whatever a previous render attached.
24247
+ this.unregisterLazyLoadListeners();
24248
+ // TODO: Use passive: true, install modernizr to check for passive
24249
+ window.addEventListener('resize', this.sendVisibleCoordinates);
24250
+ window.addEventListener('scroll', this.sendVisibleCoordinates, true);
24251
+ if (!this.config.enableScrollableContainerLazyLoading) {
24252
+ return;
24253
+ }
24254
+ this.observeScrollableContainers();
24255
+ }
24256
+ /**
24257
+ * Tracks the ancestors that can scroll or clip the embed, so the visible
24258
+ * region stays correct when the embed lives inside its own scroll
24259
+ * container rather than the page.
24260
+ */
24261
+ observeScrollableContainers() {
24262
+ const iFrame = this.host.getIframe();
24263
+ this.scrollContainers = getScrollableAncestors(iFrame);
24264
+ this.scrollContainers.forEach((scrollContainer) => {
24265
+ scrollContainer.addEventListener('scroll', this.sendVisibleCoordinates);
24266
+ });
24267
+ if (typeof ResizeObserver === 'undefined') {
24268
+ return;
24269
+ }
24270
+ const resizeTargets = new Set([iFrame.parentElement, ...getEffectiveClippingAncestors(iFrame)].filter(Boolean));
24271
+ this.resizeObserver = new ResizeObserver(this.sendVisibleCoordinates);
24272
+ resizeTargets.forEach((resizeTarget) => {
24273
+ this.resizeObserver.observe(resizeTarget);
24274
+ });
24275
+ }
24276
+ unregisterLazyLoadListeners() {
24277
+ var _a;
24278
+ if (!this.isLazyLoadEnabled) {
24279
+ return;
24280
+ }
24281
+ window.removeEventListener('resize', this.sendVisibleCoordinates);
24282
+ window.removeEventListener('scroll', this.sendVisibleCoordinates, true);
24283
+ (_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
24284
+ this.resizeObserver = undefined;
24285
+ this.scrollContainers.forEach((scrollContainer) => {
24286
+ scrollContainer.removeEventListener('scroll', this.sendVisibleCoordinates);
24287
+ });
24288
+ this.scrollContainers = [];
24289
+ }
24290
+ }
24291
+
23486
24292
  /**
23487
24293
  * Resolves enablePastConversationsSidebar with
23488
24294
  * spotterSidebarConfig taking precedence over the
@@ -23718,73 +24524,17 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
23718
24524
  constructor(domSelector, viewConfig) {
23719
24525
  viewConfig.embedComponentType = 'AppEmbed';
23720
24526
  super(domSelector, viewConfig);
23721
- this.defaultHeight = 500;
23722
- this.lazyLoadScrollContainers = [];
23723
- this.sendFullHeightLazyLoadData = () => {
23724
- const data = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
23725
- // this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
23726
- if (this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight) {
23727
- this.trigger(exports.HostEvent.VisibleEmbedCoordinates, data);
23728
- }
23729
- };
23730
- /**
23731
- * This is a handler for the RequestVisibleEmbedCoordinates event.
23732
- * It is used to send the visible coordinates data to the host application.
23733
- * @param data The event payload
23734
- * @param responder The responder function
23735
- */
23736
- this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
23737
- logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
23738
- const visibleCoordinatesData = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
23739
- responder({ type: exports.EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
23740
- };
23741
- /**
23742
- * Set the iframe height as per the computed height received
23743
- * from the ThoughtSpot app.
23744
- * @param data The event payload
23745
- */
23746
- this.updateIFrameHeight = (data) => {
23747
- this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
23748
- this.sendFullHeightLazyLoadData();
23749
- };
23750
- this.embedIframeCenter = (data, responder) => {
23751
- const obj = this.getIframeCenter();
23752
- responder({ type: exports.EmbedEvent.EmbedIframeCenter, data: obj });
23753
- };
23754
- this.setIframeHeightForNonEmbedLiveboard = (data) => {
23755
- const { height: frameHeight } = this.viewConfig.frameParams || {};
23756
- const liveboardRelatedRoutes = [
23757
- '/pinboard/',
23758
- '/insights/pinboard/',
23759
- '/schedules/',
23760
- '/embed/viz/',
23761
- '/embed/insights/viz/',
23762
- '/liveboard/',
23763
- '/insights/liveboard/',
23764
- '/tsl-editor/PINBOARD_ANSWER_BOOK/',
23765
- '/import-tsl/PINBOARD_ANSWER_BOOK/',
23766
- ];
23767
- if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
23768
- // Ignore the height reset of the frame, if the navigation is
23769
- // only within the liveboard page.
23770
- return;
23771
- }
23772
- this.setIFrameHeight(frameHeight || this.defaultHeight);
23773
- };
23774
24527
  if (this.viewConfig.fullHeight === true) {
23775
- if (this.viewConfig.lazyLoadingForFullHeight === undefined) {
23776
- this.viewConfig.lazyLoadingForFullHeight = true;
23777
- }
23778
- if (this.viewConfig.enableScrollableContainerLazyLoading === undefined) {
23779
- this.viewConfig.enableScrollableContainerLazyLoading = true;
23780
- }
23781
- if (this.viewConfig.lazyLoadingMargin === undefined) {
23782
- this.viewConfig.lazyLoadingMargin = DEFAULT_LAZY_LOADING_MARGIN;
23783
- }
23784
- this.on(exports.EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
23785
- this.on(exports.EmbedEvent.EmbedHeight, this.updateIFrameHeight);
23786
- this.on(exports.EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
23787
- this.on(exports.EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
24528
+ this.fullHeightController = new FullHeightController(this.viewConfig, {
24529
+ getIframe: () => this.iFrame,
24530
+ setFrameHeight: (height) => this.setIFrameHeight(height),
24531
+ on: (eventType, callback) => {
24532
+ this.on(eventType, callback);
24533
+ },
24534
+ trigger: (hostEvent, data) => {
24535
+ this.trigger(hostEvent, data);
24536
+ },
24537
+ });
23788
24538
  }
23789
24539
  }
23790
24540
  /**
@@ -23815,7 +24565,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
23815
24565
  return getQueryParamString(params, true);
23816
24566
  }
23817
24567
  getEmbedParamsObject() {
23818
- const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, newConnectionsExperience, fullHeight, dataPanelV2 = true, updatedSpotterExperience, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled, newChartsLibrary, hideHomepageLeftNav = false, modularHomeExperience, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, isLiveboardAlwaysOn12ColLayout, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs, isEnhancedFilterInteractivityEnabled, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF, isLiveboardStylingAndGroupingEnabled, liveboardGutter, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled, isGranularXLSXCSVSchedulesEnabled, isCentralizedLiveboardFilterUXEnabled = false, isScopedLiveboardFilteringEnabled, isLinkParametersEnabled, updatedSpotterChatPrompt, showSpotterRadiance, defaultQueryMode, enableStopAnswerGenerationEmbed, spotterChatConfig, spotterDataSources, minimumHeight, isThisPeriodInDateFiltersEnabled, enableHomepageAnnouncement = false, isContinuousLiveboardPDFEnabled, enableLiveboardDataCache, } = this.viewConfig;
24568
+ var _a;
24569
+ const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, newConnectionsExperience, dataPanelV2 = true, updatedSpotterExperience, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled, newChartsLibrary, hideHomepageLeftNav = false, modularHomeExperience, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, isLiveboardAlwaysOn12ColLayout, enableCustomColumnGroups = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs, isEnhancedFilterInteractivityEnabled, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF, isLiveboardStylingAndGroupingEnabled, liveboardGutter, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled, isGranularXLSXCSVSchedulesEnabled, isCentralizedLiveboardFilterUXEnabled = false, isScopedLiveboardFilteringEnabled, isLinkParametersEnabled, updatedSpotterChatPrompt, showSpotterRadiance, defaultQueryMode, enableStopAnswerGenerationEmbed, spotterChatConfig, spotterDataSources, isThisPeriodInDateFiltersEnabled, enableHomepageAnnouncement = false, isContinuousLiveboardPDFEnabled, enableLiveboardDataCache, hideAnswerEditPanel, } = this.viewConfig;
23819
24570
  let params = {};
23820
24571
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
23821
24572
  params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
@@ -23851,6 +24602,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
23851
24602
  if (!isUndefined$1(coverAndFilterOptionInPDF)) {
23852
24603
  params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
23853
24604
  }
24605
+ if (!isUndefined$1(hideAnswerEditPanel)) {
24606
+ params[Param.ShowAnswerEditPanel] = !hideAnswerEditPanel;
24607
+ }
23854
24608
  params = this.getBaseQueryParams(params);
23855
24609
  if (!isUndefined$1(updatedSpotterChatPrompt)) {
23856
24610
  params[Param.UpdatedSpotterChatPrompt] = !!updatedSpotterChatPrompt;
@@ -23897,15 +24651,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
23897
24651
  if (hideNotification) {
23898
24652
  params[Param.HideNotification] = !!hideNotification;
23899
24653
  }
23900
- if (fullHeight === true) {
23901
- params[Param.fullHeight] = true;
23902
- if (this.viewConfig.lazyLoadingForFullHeight) {
23903
- params[Param.IsLazyLoadingForEmbedEnabled] = true;
23904
- if (isValidCssMargin(this.viewConfig.lazyLoadingMargin)) {
23905
- params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
23906
- }
23907
- }
23908
- }
24654
+ (_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.addQueryParams(params);
23909
24655
  if (tag) {
23910
24656
  params[Param.Tag] = tag;
23911
24657
  }
@@ -23972,7 +24718,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
23972
24718
  if (isContinuousLiveboardPDFEnabled !== undefined) {
23973
24719
  params[Param.IsWYSIWYGLiveboardPDFEnabled] = isContinuousLiveboardPDFEnabled;
23974
24720
  }
23975
- this.defaultHeight = minimumHeight || this.defaultHeight;
23976
24721
  if (enableLiveboardDataCache !== undefined) {
23977
24722
  params[Param.EnableLiveboardDataCache] = enableLiveboardDataCache;
23978
24723
  }
@@ -24111,52 +24856,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
24111
24856
  * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
24112
24857
  */
24113
24858
  destroy() {
24859
+ var _a;
24114
24860
  super.destroy();
24115
- this.unregisterLazyLoadEvents();
24861
+ (_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.destroy();
24116
24862
  }
24117
24863
  postRender() {
24118
- this.registerLazyLoadEvents();
24119
- }
24120
- registerLazyLoadEvents() {
24121
- if (!this.iFrame) {
24122
- return;
24123
- }
24124
- if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
24125
- this.unregisterLazyLoadEvents();
24126
- // TODO: Use passive: true, install modernizr to check for passive
24127
- window.addEventListener('resize', this.sendFullHeightLazyLoadData);
24128
- window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
24129
- if (!this.viewConfig.enableScrollableContainerLazyLoading) {
24130
- return;
24131
- }
24132
- this.lazyLoadScrollContainers = getScrollableAncestors(this.iFrame);
24133
- this.lazyLoadScrollContainers.forEach((scrollContainer) => {
24134
- scrollContainer.addEventListener('scroll', this.sendFullHeightLazyLoadData);
24135
- });
24136
- if (typeof ResizeObserver !== 'undefined') {
24137
- const resizeTargets = new Set([
24138
- this.iFrame.parentElement,
24139
- ...getEffectiveClippingAncestors(this.iFrame),
24140
- ].filter(Boolean));
24141
- this.lazyLoadResizeObserver = new ResizeObserver(this.sendFullHeightLazyLoadData);
24142
- resizeTargets.forEach((resizeTarget) => {
24143
- this.lazyLoadResizeObserver.observe(resizeTarget);
24144
- });
24145
- }
24146
- }
24147
- }
24148
- unregisterLazyLoadEvents() {
24149
24864
  var _a;
24150
- if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
24151
- window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
24152
- window.removeEventListener('scroll', this.sendFullHeightLazyLoadData, true);
24153
- (_a = this.lazyLoadResizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
24154
- this.lazyLoadResizeObserver = undefined;
24155
- this.lazyLoadScrollContainers.forEach((scrollContainer) => {
24156
- scrollContainer.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
24157
- });
24158
- this.lazyLoadScrollContainers = [];
24159
- }
24865
+ (_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.onRender();
24160
24866
  }
24161
24867
  /**
24162
24868
  * Renders the embedded application pages in the ThoughtSpot app.
@@ -24251,6 +24957,10 @@ query GetEurekaVizSnapshots(
24251
24957
  * @summary Liveboard & visualization embed
24252
24958
  * @author Ayon Ghosh <ayon.ghosh@thoughtspot.com>
24253
24959
  */
24960
+ // Home unmounts the liveboard container, which is how its state gets cleared. The
24961
+ // settle window gives the container time to do it before we ask for the liveboard back.
24962
+ const HOME_ROUTE = 'home';
24963
+ const HOME_SETTLE_MS = 200;
24254
24964
  /**
24255
24965
  * Embed a ThoughtSpot Liveboard or visualization. When rendered it already
24256
24966
  * waits for the authentication to complete, so you need not wait for
@@ -24270,59 +24980,6 @@ query GetEurekaVizSnapshots(
24270
24980
  constructor(domSelector, viewConfig) {
24271
24981
  viewConfig.embedComponentType = 'LiveboardEmbed';
24272
24982
  super(domSelector, viewConfig);
24273
- this.defaultHeight = 500;
24274
- this.lazyLoadScrollContainers = [];
24275
- this.sendFullHeightLazyLoadData = () => {
24276
- const data = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
24277
- // this should be fired only if the lazyLoadingForFullHeight and fullHeight are true
24278
- if (this.viewConfig.lazyLoadingForFullHeight && this.viewConfig.fullHeight) {
24279
- this.trigger(exports.HostEvent.VisibleEmbedCoordinates, data);
24280
- }
24281
- };
24282
- /**
24283
- * This is a handler for the RequestVisibleEmbedCoordinates event.
24284
- * It is used to send the visible coordinates data to the host application.
24285
- * @param data The event payload
24286
- * @param responder The responder function
24287
- */
24288
- this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
24289
- logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
24290
- const visibleCoordinatesData = calculateVisibleElementData(this.iFrame, this.viewConfig.enableScrollableContainerLazyLoading);
24291
- responder({ type: exports.EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
24292
- };
24293
- /**
24294
- * Set the iframe height as per the computed height received
24295
- * from the ThoughtSpot app.
24296
- * @param data The event payload
24297
- */
24298
- this.updateIFrameHeight = (data) => {
24299
- this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
24300
- this.sendFullHeightLazyLoadData();
24301
- };
24302
- this.embedIframeCenter = (data, responder) => {
24303
- const obj = this.getIframeCenter();
24304
- responder({ type: exports.EmbedEvent.EmbedIframeCenter, data: obj });
24305
- };
24306
- this.setIframeHeightForNonEmbedLiveboard = (data) => {
24307
- const { height: frameHeight } = this.viewConfig.frameParams || {};
24308
- const liveboardRelatedRoutes = [
24309
- '/pinboard/',
24310
- '/insights/pinboard/',
24311
- '/schedules/',
24312
- '/embed/viz/',
24313
- '/embed/insights/viz/',
24314
- '/liveboard/',
24315
- '/insights/liveboard/',
24316
- '/tsl-editor/PINBOARD_ANSWER_BOOK/',
24317
- '/import-tsl/PINBOARD_ANSWER_BOOK/',
24318
- ];
24319
- if (liveboardRelatedRoutes.some((path) => data.data.currentPath.startsWith(path))) {
24320
- // Ignore the height reset of the frame, if the navigation is
24321
- // only within the liveboard page.
24322
- return;
24323
- }
24324
- this.setIFrameHeight(frameHeight || this.defaultHeight);
24325
- };
24326
24983
  /**
24327
24984
  * @hidden
24328
24985
  * Internal state to track the current liveboard id.
@@ -24336,22 +24993,19 @@ query GetEurekaVizSnapshots(
24336
24993
  };
24337
24994
  if (this.viewConfig.fullHeight === true) {
24338
24995
  if (this.viewConfig.vizId) {
24339
- logger$3.warn('Full height is currently only supported for Liveboard embeds.' +
24340
- 'Using full height with vizId might lead to unexpected behavior.');
24341
- }
24342
- if (this.viewConfig.lazyLoadingForFullHeight === undefined) {
24343
- this.viewConfig.lazyLoadingForFullHeight = true;
24344
- }
24345
- if (this.viewConfig.enableScrollableContainerLazyLoading === undefined) {
24346
- this.viewConfig.enableScrollableContainerLazyLoading = true;
24347
- }
24348
- if (this.viewConfig.lazyLoadingMargin === undefined) {
24349
- this.viewConfig.lazyLoadingMargin = DEFAULT_LAZY_LOADING_MARGIN;
24996
+ logger$3.warn('Full height is currently only supported for Liveboard embeds.'
24997
+ + 'Using full height with vizId might lead to unexpected behavior.');
24350
24998
  }
24351
- this.on(exports.EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
24352
- this.on(exports.EmbedEvent.EmbedHeight, this.updateIFrameHeight);
24353
- this.on(exports.EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
24354
- this.on(exports.EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
24999
+ this.fullHeightController = new FullHeightController(this.viewConfig, {
25000
+ getIframe: () => this.iFrame,
25001
+ setFrameHeight: (height) => this.setIFrameHeight(height),
25002
+ on: (eventType, callback) => {
25003
+ this.on(eventType, callback);
25004
+ },
25005
+ trigger: (hostEvent, data) => {
25006
+ this.trigger(hostEvent, data);
25007
+ },
25008
+ });
24355
25009
  }
24356
25010
  }
24357
25011
  async getAppInitData() {
@@ -24369,21 +25023,13 @@ query GetEurekaVizSnapshots(
24369
25023
  return queryParams;
24370
25024
  }
24371
25025
  getEmbedParamsObject() {
25026
+ var _a;
24372
25027
  let params = {};
24373
25028
  params = this.getBaseQueryParams(params);
24374
- const { enableVizTransformations, fullHeight, defaultHeight, minimumHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled, newChartsLibrary, isEnhancedFilterInteractivityEnabled, enableAskSage, enable2ColumnLayout, isLiveboardAlwaysOn12ColLayout, dataPanelV2 = true, updatedSpotterExperience, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF, isLiveboardStylingAndGroupingEnabled, liveboardGutter, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled, isGranularXLSXCSVSchedulesEnabled, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isScopedLiveboardFilteringEnabled, isLinkParametersEnabled, updatedSpotterChatPrompt, showSpotterRadiance, enableStopAnswerGenerationEmbed, spotterChatConfig, isThisPeriodInDateFiltersEnabled, isContinuousLiveboardPDFEnabled, enableLiveboardDataCache, } = this.viewConfig;
25029
+ const { enableVizTransformations, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs, showMaskedFilterChip = false, isLiveboardMasterpiecesEnabled, newChartsLibrary, isEnhancedFilterInteractivityEnabled, enableAskSage, enable2ColumnLayout, isLiveboardAlwaysOn12ColLayout, dataPanelV2 = true, updatedSpotterExperience, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF, isLiveboardStylingAndGroupingEnabled, liveboardGutter, isPNGInScheduledEmailsEnabled = false, isLiveboardXLSXCSVDownloadEnabled, isGranularXLSXCSVSchedulesEnabled, showSpotterLimitations, isCentralizedLiveboardFilterUXEnabled = false, isScopedLiveboardFilteringEnabled, isLinkParametersEnabled, updatedSpotterChatPrompt, showSpotterRadiance, enableStopAnswerGenerationEmbed, spotterChatConfig, isThisPeriodInDateFiltersEnabled, isContinuousLiveboardPDFEnabled, enableLiveboardDataCache, } = this.viewConfig;
24375
25030
  const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
24376
25031
  || this.viewConfig.preventPinboardFilterRemoval;
24377
- if (fullHeight === true) {
24378
- params[Param.fullHeight] = true;
24379
- if (this.viewConfig.lazyLoadingForFullHeight) {
24380
- params[Param.IsLazyLoadingForEmbedEnabled] = true;
24381
- if (isValidCssMargin(this.viewConfig.lazyLoadingMargin)) {
24382
- params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
24383
- }
24384
- }
24385
- }
24386
- this.defaultHeight = minimumHeight || defaultHeight || this.defaultHeight;
25032
+ (_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.addQueryParams(params);
24387
25033
  if (enableVizTransformations !== undefined) {
24388
25034
  params[Param.EnableVizTransformations] = enableVizTransformations.toString();
24389
25035
  }
@@ -24568,6 +25214,7 @@ query GetEurekaVizSnapshots(
24568
25214
  errorType: ErrorDetailsTypes.VALIDATION_ERROR,
24569
25215
  message: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
24570
25216
  code: EmbedErrorCodes.LIVEBOARD_ID_MISSING,
25217
+ severity: EmbedErrorSeverity.SEV1,
24571
25218
  error: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
24572
25219
  });
24573
25220
  }
@@ -24609,19 +25256,45 @@ query GetEurekaVizSnapshots(
24609
25256
  }
24610
25257
  beforePrerenderVisible() {
24611
25258
  super.beforePrerenderVisible();
24612
- const embedObj = this.getPreRenderObj();
24613
- this.executeAfterEmbedContainerLoaded(() => {
24614
- this.navigateToLiveboard(this.viewConfig.liveboardId, this.viewConfig.vizId, this.viewConfig.activeTabId, this.viewConfig.personalizedViewId);
24615
- if (embedObj) {
24616
- embedObj.currentLiveboardState = {
24617
- liveboardId: this.viewConfig.liveboardId,
24618
- vizId: this.viewConfig.vizId,
24619
- activeTabId: this.viewConfig.activeTabId,
24620
- personalizedViewId: this.viewConfig.personalizedViewId,
24621
- };
25259
+ // Captured before showPreRender() hands the wrapper over to this instance.
25260
+ // Itself means a hide/show, not a hand-over, so there is nothing stale to clear.
25261
+ const previous = this.getPreRenderObj();
25262
+ const showing = previous === this ? undefined : previous === null || previous === void 0 ? void 0 : previous.currentLiveboardState;
25263
+ this.executeAfterEmbedContainerLoaded(async () => {
25264
+ // Without this the params callback suspends on its await and Navigate
25265
+ // goes out first, so the container loads with the previous config's filters.
25266
+ await this.preRenderParamsApplied;
25267
+ if (this.isShowingLiveboardRoute(showing)) {
25268
+ // Navigate to the route we are already on is a no-op, so the liveboard
25269
+ // keeps its state. Home unmounts the container, which clears it.
25270
+ this.trigger(exports.HostEvent.Navigate, HOME_ROUTE)
25271
+ .catch((error) => logger$3.warn('Could not route via home', error));
25272
+ // Not awaited above: the container never acks Navigate, so that promise
25273
+ // only settles on the 30s trigger timeout.
25274
+ await new Promise((resolve) => {
25275
+ setTimeout(resolve, HOME_SETTLE_MS);
25276
+ });
24622
25277
  }
25278
+ this.navigateToLiveboard(this.viewConfig.liveboardId, this.viewConfig.vizId, this.viewConfig.activeTabId, this.viewConfig.personalizedViewId);
25279
+ this.currentLiveboardState = {
25280
+ liveboardId: this.viewConfig.liveboardId,
25281
+ vizId: this.viewConfig.vizId,
25282
+ activeTabId: this.viewConfig.activeTabId,
25283
+ personalizedViewId: this.viewConfig.personalizedViewId,
25284
+ };
24623
25285
  });
24624
25286
  }
25287
+ // The whole route, not just the liveboard id: the path is built from the viz, tab
25288
+ // and view too, so a same-liveboard show onto another tab is a real navigation.
25289
+ isShowingLiveboardRoute(showing) {
25290
+ if (!(showing === null || showing === void 0 ? void 0 : showing.liveboardId))
25291
+ return false;
25292
+ const { liveboardId, vizId, activeTabId, personalizedViewId, } = this.viewConfig;
25293
+ return showing.liveboardId === liveboardId
25294
+ && showing.vizId === vizId
25295
+ && showing.activeTabId === activeTabId
25296
+ && showing.personalizedViewId === personalizedViewId;
25297
+ }
24625
25298
  async handleRenderForPrerender() {
24626
25299
  if (isUndefined$1(this.viewConfig.liveboardId)) {
24627
25300
  return this.prerenderGeneric();
@@ -24630,11 +25303,16 @@ query GetEurekaVizSnapshots(
24630
25303
  }
24631
25304
  /**
24632
25305
  * Triggers an event to the embedded app
25306
+ * Payload typing follows {@link TsEmbed.trigger}: unknown fields fail to compile
25307
+ * from SDK 1.52.0; strict contract checks land in SDK 1.54.0.
24633
25308
  * @param {HostEvent} messageType The event type
24634
- * @param {any} data The payload to send with the message
25309
+ * @param {TriggerData} data The payload, typed against the event's contract
24635
25310
  * @returns A promise that resolves with the response from the embedded app
24636
25311
  */
24637
- trigger(messageType, data = {}, context) {
25312
+ trigger(messageType,
25313
+ // Mirror TsEmbed.trigger: contract shape is the contextual type and
25314
+ // unknown fields on object literals are flagged. Strict in SDK 1.54.0.
25315
+ data = {}, context) {
24638
25316
  const dataWithVizId = data;
24639
25317
  if (messageType === exports.HostEvent.SetActiveTab) {
24640
25318
  this.setActiveTab(data);
@@ -24650,52 +25328,13 @@ query GetEurekaVizSnapshots(
24650
25328
  * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
24651
25329
  */
24652
25330
  destroy() {
25331
+ var _a;
24653
25332
  super.destroy();
24654
- this.unregisterLazyLoadEvents();
25333
+ (_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.destroy();
24655
25334
  }
24656
25335
  postRender() {
24657
- this.registerLazyLoadEvents();
24658
- }
24659
- registerLazyLoadEvents() {
24660
- if (!this.iFrame) {
24661
- return;
24662
- }
24663
- if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
24664
- this.unregisterLazyLoadEvents();
24665
- // TODO: Use passive: true, install modernizr to check for passive
24666
- window.addEventListener('resize', this.sendFullHeightLazyLoadData);
24667
- window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
24668
- if (!this.viewConfig.enableScrollableContainerLazyLoading) {
24669
- return;
24670
- }
24671
- this.lazyLoadScrollContainers = getScrollableAncestors(this.iFrame);
24672
- this.lazyLoadScrollContainers.forEach((scrollContainer) => {
24673
- scrollContainer.addEventListener('scroll', this.sendFullHeightLazyLoadData);
24674
- });
24675
- if (typeof ResizeObserver !== 'undefined') {
24676
- const resizeTargets = new Set([
24677
- this.iFrame.parentElement,
24678
- ...getEffectiveClippingAncestors(this.iFrame),
24679
- ].filter(Boolean));
24680
- this.lazyLoadResizeObserver = new ResizeObserver(this.sendFullHeightLazyLoadData);
24681
- resizeTargets.forEach((resizeTarget) => {
24682
- this.lazyLoadResizeObserver.observe(resizeTarget);
24683
- });
24684
- }
24685
- }
24686
- }
24687
- unregisterLazyLoadEvents() {
24688
25336
  var _a;
24689
- if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
24690
- window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
24691
- window.removeEventListener('scroll', this.sendFullHeightLazyLoadData, true);
24692
- (_a = this.lazyLoadResizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
24693
- this.lazyLoadResizeObserver = undefined;
24694
- this.lazyLoadScrollContainers.forEach((scrollContainer) => {
24695
- scrollContainer.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
24696
- });
24697
- this.lazyLoadScrollContainers = [];
24698
- }
25337
+ (_a = this.fullHeightController) === null || _a === void 0 ? void 0 : _a.onRender();
24699
25338
  }
24700
25339
  /**
24701
25340
  * Render an embedded ThoughtSpot Liveboard or visualization
@@ -24719,7 +25358,7 @@ query GetEurekaVizSnapshots(
24719
25358
  if (this.isRendered) {
24720
25359
  this.trigger(exports.HostEvent.Navigate, path.substring(1));
24721
25360
  }
24722
- else if (this.getPreRenderConfig().preRenderId) {
25361
+ else if (this.getPreRenderConfig().id) {
24723
25362
  this.preRender(true);
24724
25363
  }
24725
25364
  else {
@@ -25423,7 +26062,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
25423
26062
  const ref = React.useRef(null);
25424
26063
  const { className, style, ...embedProps } = props;
25425
26064
  const { viewConfig, listeners } = getViewPropsAndListeners(embedProps);
25426
- const preRenderId = (_b = (_a = props.preRenderConfig) === null || _a === void 0 ? void 0 : _a.preRenderId) !== null && _b !== void 0 ? _b : props.preRenderId;
26065
+ const preRenderId = (_b = (_a = props.preRenderConfig) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : props.preRenderId;
25427
26066
  const handleDestroy = (tsEmbed) => {
25428
26067
  // do not destroy if it is a preRender component
25429
26068
  if (isPreRenderedComponent)