@thoughtspot/visual-embed-sdk 1.44.2 → 1.44.4-HE-beta.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 (213) hide show
  1. package/README.md +1 -1
  2. package/cjs/package.json +1 -1
  3. package/cjs/src/embed/app.d.ts +44 -32
  4. package/cjs/src/embed/app.d.ts.map +1 -1
  5. package/cjs/src/embed/app.js.map +1 -1
  6. package/cjs/src/embed/base.d.ts +1 -1
  7. package/cjs/src/embed/base.d.ts.map +1 -1
  8. package/cjs/src/embed/base.js +4 -0
  9. package/cjs/src/embed/base.js.map +1 -1
  10. package/cjs/src/embed/base.spec.js +60 -0
  11. package/cjs/src/embed/base.spec.js.map +1 -1
  12. package/cjs/src/embed/conversation.d.ts +7 -0
  13. package/cjs/src/embed/conversation.d.ts.map +1 -1
  14. package/cjs/src/embed/conversation.js +9 -0
  15. package/cjs/src/embed/conversation.js.map +1 -1
  16. package/cjs/src/embed/hostEventClient/contracts.d.ts +20 -3
  17. package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  18. package/cjs/src/embed/hostEventClient/contracts.js +6 -1
  19. package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
  20. package/cjs/src/embed/hostEventClient/host-event-client.d.ts +8 -8
  21. package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  22. package/cjs/src/embed/hostEventClient/host-event-client.js +18 -18
  23. package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
  24. package/cjs/src/embed/hostEventClient/host-event-client.spec.js +7 -7
  25. package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  26. package/cjs/src/embed/liveboard.d.ts +10 -4
  27. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  28. package/cjs/src/embed/liveboard.js +12 -2
  29. package/cjs/src/embed/liveboard.js.map +1 -1
  30. package/cjs/src/embed/liveboard.spec.js +1 -1
  31. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  32. package/cjs/src/embed/sage.d.ts +7 -0
  33. package/cjs/src/embed/sage.d.ts.map +1 -1
  34. package/cjs/src/embed/sage.js +9 -0
  35. package/cjs/src/embed/sage.js.map +1 -1
  36. package/cjs/src/embed/search-bar.d.ts +7 -0
  37. package/cjs/src/embed/search-bar.d.ts.map +1 -1
  38. package/cjs/src/embed/search-bar.js +9 -0
  39. package/cjs/src/embed/search-bar.js.map +1 -1
  40. package/cjs/src/embed/search.d.ts +7 -0
  41. package/cjs/src/embed/search.d.ts.map +1 -1
  42. package/cjs/src/embed/search.js +9 -0
  43. package/cjs/src/embed/search.js.map +1 -1
  44. package/cjs/src/embed/ts-embed.d.ts +9 -3
  45. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  46. package/cjs/src/embed/ts-embed.js +41 -8
  47. package/cjs/src/embed/ts-embed.js.map +1 -1
  48. package/cjs/src/embed/ts-embed.spec.js +156 -24
  49. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  50. package/cjs/src/errors.d.ts +2 -0
  51. package/cjs/src/errors.d.ts.map +1 -1
  52. package/cjs/src/errors.js +2 -0
  53. package/cjs/src/errors.js.map +1 -1
  54. package/cjs/src/index.d.ts +2 -2
  55. package/cjs/src/index.d.ts.map +1 -1
  56. package/cjs/src/index.js +5 -1
  57. package/cjs/src/index.js.map +1 -1
  58. package/cjs/src/types.d.ts +142 -45
  59. package/cjs/src/types.d.ts.map +1 -1
  60. package/cjs/src/types.js +91 -16
  61. package/cjs/src/types.js.map +1 -1
  62. package/cjs/src/utils/logger.spec.d.ts +20 -5
  63. package/cjs/src/utils/logger.spec.d.ts.map +1 -1
  64. package/cjs/src/utils/processTrigger.d.ts +3 -2
  65. package/cjs/src/utils/processTrigger.d.ts.map +1 -1
  66. package/cjs/src/utils/processTrigger.js +4 -2
  67. package/cjs/src/utils/processTrigger.js.map +1 -1
  68. package/cjs/src/utils.d.ts +15 -4
  69. package/cjs/src/utils.d.ts.map +1 -1
  70. package/cjs/src/utils.js +38 -6
  71. package/cjs/src/utils.js.map +1 -1
  72. package/cjs/src/utils.spec.js +53 -0
  73. package/cjs/src/utils.spec.js.map +1 -1
  74. package/dist/index-BFdRRz03.js +7371 -0
  75. package/dist/index-BUfrYJ3w.js +7371 -0
  76. package/dist/index-CI6s4VMY.js +7371 -0
  77. package/dist/{index-CSFjfTVk.js → index-CWQnMX2L.js} +1 -1
  78. package/dist/index-CaW-1mu5.js +7371 -0
  79. package/dist/index-CcSgNJVi.js +7371 -0
  80. package/dist/index-Djtv-y7A.js +7371 -0
  81. package/dist/index-UY-4yjBN.js +7371 -0
  82. package/dist/src/embed/app.d.ts +44 -32
  83. package/dist/src/embed/app.d.ts.map +1 -1
  84. package/dist/src/embed/base.d.ts +1 -1
  85. package/dist/src/embed/base.d.ts.map +1 -1
  86. package/dist/src/embed/conversation.d.ts +7 -0
  87. package/dist/src/embed/conversation.d.ts.map +1 -1
  88. package/dist/src/embed/hostEventClient/contracts.d.ts +20 -3
  89. package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  90. package/dist/src/embed/hostEventClient/host-event-client.d.ts +8 -8
  91. package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  92. package/dist/src/embed/liveboard.d.ts +10 -4
  93. package/dist/src/embed/liveboard.d.ts.map +1 -1
  94. package/dist/src/embed/sage.d.ts +7 -0
  95. package/dist/src/embed/sage.d.ts.map +1 -1
  96. package/dist/src/embed/search-bar.d.ts +7 -0
  97. package/dist/src/embed/search-bar.d.ts.map +1 -1
  98. package/dist/src/embed/search.d.ts +7 -0
  99. package/dist/src/embed/search.d.ts.map +1 -1
  100. package/dist/src/embed/ts-embed.d.ts +9 -3
  101. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  102. package/dist/src/errors.d.ts +2 -0
  103. package/dist/src/errors.d.ts.map +1 -1
  104. package/dist/src/index.d.ts +2 -2
  105. package/dist/src/index.d.ts.map +1 -1
  106. package/dist/src/types.d.ts +142 -45
  107. package/dist/src/types.d.ts.map +1 -1
  108. package/dist/src/utils/logger.spec.d.ts +20 -5
  109. package/dist/src/utils/logger.spec.d.ts.map +1 -1
  110. package/dist/src/utils/processTrigger.d.ts +3 -2
  111. package/dist/src/utils/processTrigger.d.ts.map +1 -1
  112. package/dist/src/utils.d.ts +15 -4
  113. package/dist/src/utils.d.ts.map +1 -1
  114. package/dist/tsembed-react.es.js +288 -95
  115. package/dist/tsembed-react.js +287 -94
  116. package/dist/tsembed.es.js +289 -96
  117. package/dist/tsembed.js +314 -121
  118. package/dist/visual-embed-sdk-react-full.d.ts +246 -83
  119. package/dist/visual-embed-sdk-react.d.ts +251 -90
  120. package/dist/visual-embed-sdk.d.ts +299 -93
  121. package/lib/package.json +1 -1
  122. package/lib/src/embed/app.d.ts +44 -32
  123. package/lib/src/embed/app.d.ts.map +1 -1
  124. package/lib/src/embed/app.js.map +1 -1
  125. package/lib/src/embed/base.d.ts +1 -1
  126. package/lib/src/embed/base.d.ts.map +1 -1
  127. package/lib/src/embed/base.js +5 -1
  128. package/lib/src/embed/base.js.map +1 -1
  129. package/lib/src/embed/base.spec.js +61 -1
  130. package/lib/src/embed/base.spec.js.map +1 -1
  131. package/lib/src/embed/conversation.d.ts +7 -0
  132. package/lib/src/embed/conversation.d.ts.map +1 -1
  133. package/lib/src/embed/conversation.js +9 -0
  134. package/lib/src/embed/conversation.js.map +1 -1
  135. package/lib/src/embed/hostEventClient/contracts.d.ts +20 -3
  136. package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  137. package/lib/src/embed/hostEventClient/contracts.js +5 -0
  138. package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
  139. package/lib/src/embed/hostEventClient/host-event-client.d.ts +8 -8
  140. package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  141. package/lib/src/embed/hostEventClient/host-event-client.js +18 -18
  142. package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
  143. package/lib/src/embed/hostEventClient/host-event-client.spec.js +7 -7
  144. package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  145. package/lib/src/embed/liveboard.d.ts +10 -4
  146. package/lib/src/embed/liveboard.d.ts.map +1 -1
  147. package/lib/src/embed/liveboard.js +12 -2
  148. package/lib/src/embed/liveboard.js.map +1 -1
  149. package/lib/src/embed/liveboard.spec.js +1 -1
  150. package/lib/src/embed/liveboard.spec.js.map +1 -1
  151. package/lib/src/embed/sage.d.ts +7 -0
  152. package/lib/src/embed/sage.d.ts.map +1 -1
  153. package/lib/src/embed/sage.js +9 -0
  154. package/lib/src/embed/sage.js.map +1 -1
  155. package/lib/src/embed/search-bar.d.ts +7 -0
  156. package/lib/src/embed/search-bar.d.ts.map +1 -1
  157. package/lib/src/embed/search-bar.js +9 -0
  158. package/lib/src/embed/search-bar.js.map +1 -1
  159. package/lib/src/embed/search.d.ts +7 -0
  160. package/lib/src/embed/search.d.ts.map +1 -1
  161. package/lib/src/embed/search.js +9 -0
  162. package/lib/src/embed/search.js.map +1 -1
  163. package/lib/src/embed/ts-embed.d.ts +9 -3
  164. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  165. package/lib/src/embed/ts-embed.js +41 -8
  166. package/lib/src/embed/ts-embed.js.map +1 -1
  167. package/lib/src/embed/ts-embed.spec.js +156 -24
  168. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  169. package/lib/src/errors.d.ts +2 -0
  170. package/lib/src/errors.d.ts.map +1 -1
  171. package/lib/src/errors.js +2 -0
  172. package/lib/src/errors.js.map +1 -1
  173. package/lib/src/index.d.ts +2 -2
  174. package/lib/src/index.d.ts.map +1 -1
  175. package/lib/src/index.js +2 -2
  176. package/lib/src/index.js.map +1 -1
  177. package/lib/src/types.d.ts +142 -45
  178. package/lib/src/types.d.ts.map +1 -1
  179. package/lib/src/types.js +90 -15
  180. package/lib/src/types.js.map +1 -1
  181. package/lib/src/utils/logger.spec.d.ts +20 -5
  182. package/lib/src/utils/logger.spec.d.ts.map +1 -1
  183. package/lib/src/utils/processTrigger.d.ts +3 -2
  184. package/lib/src/utils/processTrigger.d.ts.map +1 -1
  185. package/lib/src/utils/processTrigger.js +4 -2
  186. package/lib/src/utils/processTrigger.js.map +1 -1
  187. package/lib/src/utils.d.ts +15 -4
  188. package/lib/src/utils.d.ts.map +1 -1
  189. package/lib/src/utils.js +35 -5
  190. package/lib/src/utils.js.map +1 -1
  191. package/lib/src/utils.spec.js +54 -1
  192. package/lib/src/utils.spec.js.map +1 -1
  193. package/package.json +1 -1
  194. package/src/embed/app.ts +45 -32
  195. package/src/embed/base.spec.ts +79 -1
  196. package/src/embed/base.ts +5 -2
  197. package/src/embed/conversation.ts +11 -0
  198. package/src/embed/hostEventClient/contracts.ts +23 -4
  199. package/src/embed/hostEventClient/host-event-client.spec.ts +7 -1
  200. package/src/embed/hostEventClient/host-event-client.ts +22 -11
  201. package/src/embed/liveboard.spec.ts +1 -1
  202. package/src/embed/liveboard.ts +18 -5
  203. package/src/embed/sage.ts +11 -0
  204. package/src/embed/search-bar.tsx +11 -0
  205. package/src/embed/search.ts +11 -0
  206. package/src/embed/ts-embed.spec.ts +205 -18
  207. package/src/embed/ts-embed.ts +45 -9
  208. package/src/errors.ts +2 -0
  209. package/src/index.ts +6 -0
  210. package/src/types.ts +146 -43
  211. package/src/utils/processTrigger.ts +6 -3
  212. package/src/utils.spec.ts +78 -0
  213. package/src/utils.ts +35 -8
package/dist/tsembed.js CHANGED
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.44.2 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.44.4-HE-beta.1 */
2
2
  'use client';
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
@@ -188,57 +188,71 @@
188
188
  })(exports.AuthType || (exports.AuthType = {}));
189
189
  /**
190
190
  *
191
- * This option does not apply to the classic homepage experience.
192
- * To access the updated modular homepage,
193
- * set `modularHomeExperience` to `true`
194
- * (available as Early Access feature in 9.12.5.cl).
191
+ * **Note**: This attribute is not supported in the classic (V1) homepage experience.
195
192
  *
196
193
  */
197
194
  exports.HomeLeftNavItem = void 0;
198
195
  (function (HomeLeftNavItem) {
199
196
  /**
197
+ * The *Search data* option in
198
+ * the *Insights* left navigation panel.
200
199
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
201
200
  */
202
201
  HomeLeftNavItem["SearchData"] = "search-data";
203
202
  /**
203
+ * The *Home* menu option in
204
+ * the *Insights* left navigation panel.
204
205
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
205
206
  */
206
207
  HomeLeftNavItem["Home"] = "insights-home";
207
208
  /**
209
+ * The *Liveboards* menu option in
210
+ * the *Insights* left navigation panel.
208
211
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
209
212
  */
210
213
  HomeLeftNavItem["Liveboards"] = "liveboards";
211
214
  /**
215
+ * The *Answers* menu option in
216
+ * the *Insights* left navigation panel.
212
217
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
213
218
  */
214
219
  HomeLeftNavItem["Answers"] = "answers";
215
220
  /**
221
+ * The *Monitor subscriptions* menu option in
222
+ * the *Insights* left navigation panel.
216
223
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
217
224
  */
218
225
  HomeLeftNavItem["MonitorSubscription"] = "monitor-alerts";
219
226
  /**
227
+ * The *SpotIQ analysis* menu option in
228
+ * the *Insights* left navigation panel.
220
229
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
221
230
  */
222
231
  HomeLeftNavItem["SpotIQAnalysis"] = "spotiq-analysis";
223
232
  /**
233
+ * The *Liveboard schedules* menu option in
234
+ * the *Insights* left navigation panel.
224
235
  * @version SDK: 1.34.0| ThoughtSpot: 10.3.0.cl
225
236
  */
226
237
  HomeLeftNavItem["LiveboardSchedules"] = "liveboard-schedules";
227
238
  /**
228
- * Create new options in the insights left navigation,
229
- * available when new navigation V3 is enabled.
239
+ * The create option in the *Insights*
240
+ * left navigation panel.
241
+ * Available in the V3 navigation experience.
230
242
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
231
243
  */
232
244
  HomeLeftNavItem["Create"] = "create";
233
245
  /**
234
- * Spotter option in the insights left navigation,
235
- * available when new navigation V3 is enabled.
246
+ * The *Spotter* menu option in the *Insights*
247
+ * left navigation panel.
248
+ * Available in the V3 navigation experience.
236
249
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
237
250
  */
238
251
  HomeLeftNavItem["Spotter"] = "spotter";
239
252
  /**
240
- * Favorites option in the insights left navigation,
241
- * available when new navigation V3 is enabled.
253
+ * The *Favorites* section in the *Insights*
254
+ * left navigation panel.
255
+ * Available in the V3 navigation experience.
242
256
  * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
243
257
  */
244
258
  HomeLeftNavItem["Favorites"] = "favorites";
@@ -310,10 +324,11 @@
310
324
  RuntimeFilterOp["NOT_IN"] = "NOT_IN";
311
325
  })(exports.RuntimeFilterOp || (exports.RuntimeFilterOp = {}));
312
326
  /**
313
- * Home page module that can be hidden.
314
- * **Note**: This option does not apply to the classic homepage.
315
- * To access the updated modular homepage, set
316
- * `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
327
+ * Home page modules that can be hidden
328
+ * via `hiddenHomepageModules` and reordered via
329
+ * `reorderedHomepageModules`.
330
+ *
331
+ * **Note**: This option is not supported in the classic (v1) experience.
317
332
  * @version SDK: 1.28.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw
318
333
  */
319
334
  exports.HomepageModule = void 0;
@@ -327,7 +342,7 @@
327
342
  */
328
343
  HomepageModule["Watchlist"] = "WATCHLIST";
329
344
  /**
330
- * favorite objects
345
+ * Favorite module
331
346
  */
332
347
  HomepageModule["Favorite"] = "FAVORITE";
333
348
  /**
@@ -1483,6 +1498,28 @@
1483
1498
  * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1484
1499
  */
1485
1500
  EmbedEvent["PreviewSpotterData"] = "PreviewSpotterData";
1501
+ /**
1502
+ * Emitted when user opens up the Add to Coaching modal on any visualization in Spotter Embed.
1503
+ * @example
1504
+ * ```js
1505
+ * spotterEmbed.on(EmbedEvent.AddToCoaching, (payload) => {
1506
+ * console.log('payload', payload);
1507
+ * })
1508
+ *```
1509
+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
1510
+ */
1511
+ EmbedEvent["AddToCoaching"] = "addToCoaching";
1512
+ /**
1513
+ * Emitted when user opens up the data model instructions modal in Spotter embed.
1514
+ * @example
1515
+ * ```js
1516
+ * spotterEmbed.on(EmbedEvent.DataModelInstructions, (payload) => {
1517
+ * console.log('payload', payload);
1518
+ * })
1519
+ * ```
1520
+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
1521
+ */
1522
+ EmbedEvent["DataModelInstructions"] = "DataModelInstructions";
1486
1523
  /**
1487
1524
  * Emitted when the Spotter query is triggered in Spotter embed.
1488
1525
  * @example
@@ -2907,6 +2944,26 @@
2907
2944
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
2908
2945
  */
2909
2946
  HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
2947
+ /**
2948
+ * Opens the Add to Coaching modal from a visualization in Spotter Embed.
2949
+ * @param - `vizId ` refers to the Visualization ID in Spotter embed and is required.
2950
+ * @example
2951
+ * ```js
2952
+ * spotterEmbed.trigger(HostEvent.AddToCoaching, { vizId: '730496d6-6903-4601-937e-2c691821af3c' });
2953
+ *
2954
+ *```
2955
+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
2956
+ */
2957
+ HostEvent["AddToCoaching"] = "addToCoaching";
2958
+ /**
2959
+ * Opens the data model instructions modal in Spotter Embed.
2960
+ * @example
2961
+ * ```js
2962
+ * spotterEmbed.trigger(HostEvent.DataModelInstructions);
2963
+ * ```
2964
+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
2965
+ */
2966
+ HostEvent["DataModelInstructions"] = "DataModelInstructions";
2910
2967
  /**
2911
2968
  * Resets the Spotter Embed Conversation.
2912
2969
  * @example
@@ -3009,6 +3066,15 @@
3009
3066
  * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
3010
3067
  */
3011
3068
  HostEvent["StartNewSpotterConversation"] = "StartNewSpotterConversation";
3069
+ /**
3070
+ * Get the current context of the embedded page.
3071
+ * @example
3072
+ * ```js
3073
+ * const context = await liveboardEmbed.trigger(HostEvent.GetPageContext);
3074
+ * ```
3075
+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
3076
+ */
3077
+ HostEvent["GetPageContext"] = "GetPageContext";
3012
3078
  })(exports.HostEvent || (exports.HostEvent = {}));
3013
3079
  /**
3014
3080
  * The different visual modes that the data sources panel within
@@ -4652,7 +4718,7 @@
4652
4718
  * @version SDK: 1.44.2 | ThoughtSpot: 26.2.0.cl
4653
4719
  * @group Error Handling
4654
4720
  */
4655
- var ErrorDetailsTypes;
4721
+ exports.ErrorDetailsTypes = void 0;
4656
4722
  (function (ErrorDetailsTypes) {
4657
4723
  /** API call failure */
4658
4724
  ErrorDetailsTypes["API"] = "API";
@@ -4660,7 +4726,7 @@
4660
4726
  ErrorDetailsTypes["VALIDATION_ERROR"] = "VALIDATION_ERROR";
4661
4727
  /** Network connectivity or request error */
4662
4728
  ErrorDetailsTypes["NETWORK"] = "NETWORK";
4663
- })(ErrorDetailsTypes || (ErrorDetailsTypes = {}));
4729
+ })(exports.ErrorDetailsTypes || (exports.ErrorDetailsTypes = {}));
4664
4730
  /**
4665
4731
  * Specific error codes for embedded component errors.
4666
4732
  *
@@ -4694,7 +4760,7 @@
4694
4760
  * }
4695
4761
  * });
4696
4762
  * */
4697
- var EmbedErrorCodes;
4763
+ exports.EmbedErrorCodes = void 0;
4698
4764
  (function (EmbedErrorCodes) {
4699
4765
  /** Worksheet ID not found or does not exist */
4700
4766
  EmbedErrorCodes["WORKSHEET_ID_NOT_FOUND"] = "WORKSHEET_ID_NOT_FOUND";
@@ -4718,7 +4784,16 @@
4718
4784
  EmbedErrorCodes["HOST_EVENT_TYPE_UNDEFINED"] = "HOST_EVENT_TYPE_UNDEFINED";
4719
4785
  /** Error parsing api intercept body */
4720
4786
  EmbedErrorCodes["PARSING_API_INTERCEPT_BODY_ERROR"] = "PARSING_API_INTERCEPT_BODY_ERROR";
4721
- })(EmbedErrorCodes || (EmbedErrorCodes = {}));
4787
+ /** Failed to update embed parameters during pre-render */
4788
+ EmbedErrorCodes["UPDATE_PARAMS_FAILED"] = "UPDATE_PARAMS_FAILED";
4789
+ })(exports.EmbedErrorCodes || (exports.EmbedErrorCodes = {}));
4790
+ exports.ContextType = void 0;
4791
+ (function (ContextType) {
4792
+ ContextType["Search"] = "search-answer";
4793
+ ContextType["Liveboard"] = "liveboard";
4794
+ ContextType["Answer"] = "answer";
4795
+ ContextType["Spotter"] = "spotter";
4796
+ })(exports.ContextType || (exports.ContextType = {}));
4722
4797
  /**
4723
4798
  * Enum for the type of API intercepted
4724
4799
  */
@@ -4861,6 +4936,49 @@
4861
4936
  return result;
4862
4937
  };
4863
4938
 
4939
+ const ERROR_MESSAGE = {
4940
+ INVALID_THOUGHTSPOT_HOST: 'Error parsing ThoughtSpot host. Please provide a valid URL.',
4941
+ SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND: 'Please select a Model to get started',
4942
+ LIVEBOARD_VIZ_ID_VALIDATION: 'Please select a Liveboard to embed.',
4943
+ TRIGGER_TIMED_OUT: 'Trigger timed-out in getting a response',
4944
+ SEARCHEMBED_BETA_WRANING_MESSAGE: 'SearchEmbed is in Beta in this release.',
4945
+ SAGE_EMBED_BETA_WARNING_MESSAGE: 'SageEmbed is in Beta in this release.',
4946
+ THIRD_PARTY_COOKIE_BLOCKED_ALERT: 'Third-party cookie access is blocked on this browser. Please allow third-party cookies for this to work properly. \nYou can use `suppressNoCookieAccessAlert` to suppress this message.',
4947
+ DUPLICATE_TOKEN_ERR: 'Duplicate token. Please issue a new token every time getAuthToken callback is called. See https://developers.thoughtspot.com/docs/?pageid=embed-auth#trusted-auth-embed for more details.',
4948
+ SDK_NOT_INITIALIZED: 'SDK not initialized',
4949
+ SESSION_INFO_FAILED: 'Failed to get session information',
4950
+ INVALID_TOKEN_ERROR: 'Received invalid token from getAuthToken callback or authToken endpoint.',
4951
+ INVALID_TOKEN_TYPE_ERROR: 'Expected getAuthToken to return a string, but received a {invalidType}.',
4952
+ MIXPANEL_TOKEN_NOT_FOUND: 'Mixpanel token not found in session info',
4953
+ PRERENDER_ID_MISSING: 'PreRender ID is required for preRender',
4954
+ SYNC_STYLE_CALLED_BEFORE_RENDER: 'PreRender should be called before using syncPreRenderStyle',
4955
+ CSP_VIOLATION_ALERT: 'CSP violation detected. Please check the console errors for more details.',
4956
+ CSP_FRAME_HOST_VIOLATION_LOG_MESSAGE: 'Please set up CSP correctly for the application to start working. For more information, see https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts. \n If the issue persists, refer to https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts',
4957
+ MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
4958
+ RENDER_CALLED_BEFORE_INIT: 'Looks like render was called before calling init, the render won\'t start until init is called.\nFor more info check\n1. https://developers.thoughtspot.com/docs/Function_init#_init\n2.https://developers.thoughtspot.com/docs/getting-started#initSdk',
4959
+ SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
4960
+ OFFLINE_WARNING: 'Network not Detected. Embed is offline. Please reconnect and refresh',
4961
+ INIT_SDK_REQUIRED: 'You need to init the ThoughtSpot SDK module first',
4962
+ CONFLICTING_ACTIONS_CONFIG: 'You cannot have both hidden actions and visible actions',
4963
+ CONFLICTING_TABS_CONFIG: 'You cannot have both hidden Tabs and visible Tabs',
4964
+ RENDER_BEFORE_EVENTS_REQUIRED: 'Please call render before triggering events',
4965
+ HOST_EVENT_TYPE_UNDEFINED: 'Host event type is undefined',
4966
+ LOGIN_FAILED: 'Login failed',
4967
+ ERROR_PARSING_API_INTERCEPT_BODY: 'Error parsing api intercept body',
4968
+ SSR_ENVIRONMENT_ERROR: 'SSR environment detected. This function cannot be called in SSR environment.',
4969
+ UPDATE_PARAMS_FAILED: 'Failed to update embed parameters',
4970
+ };
4971
+ const CUSTOM_ACTIONS_ERROR_MESSAGE = {
4972
+ INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
4973
+ MISSING_REQUIRED_FIELDS: (id, missingFields) => `Custom Action Validation Error for '${id}': Missing required fields: ${missingFields.join(', ')}`,
4974
+ UNSUPPORTED_TARGET: (id, targetType) => `Custom Action Validation Error for '${id}': Target type '${targetType}' is not supported`,
4975
+ INVALID_POSITION: (position, targetType, supportedPositions) => `Position '${position}' is not supported for ${targetType.toLowerCase()}-level custom actions. Supported positions: ${supportedPositions}`,
4976
+ INVALID_METADATA_IDS: (targetType, invalidIds, supportedIds) => `Invalid metadata IDs for ${targetType.toLowerCase()}-level custom actions: ${invalidIds.join(', ')}. Supported metadata IDs: ${supportedIds}`,
4977
+ INVALID_DATA_MODEL_IDS: (targetType, invalidIds, supportedIds) => `Invalid data model IDs for ${targetType.toLowerCase()}-level custom actions: ${invalidIds.join(', ')}. Supported data model IDs: ${supportedIds}`,
4978
+ INVALID_FIELDS: (targetType, invalidFields, supportedFields) => `Invalid fields for ${targetType.toLowerCase()}-level custom actions: ${invalidFields.join(', ')}. Supported fields: ${supportedFields}`,
4979
+ DUPLICATE_IDS: (id, duplicateNames, keptName) => `Duplicate custom action ID '${id}' found. Actions with names '${duplicateNames.join("', '")}' will be ignored. Keeping '${keptName}'.`,
4980
+ };
4981
+
4864
4982
  /**
4865
4983
  * Copyright (c) 2023
4866
4984
  *
@@ -4974,7 +5092,8 @@
4974
5092
  logger$3.error('Please provide a valid lazyLoadingMargin value (e.g., "10px")');
4975
5093
  return false;
4976
5094
  }
4977
- // This pattern allows for an optional negative sign, and numbers that can be integers or decimals (including leading dot).
5095
+ // This pattern allows for an optional negative sign, and numbers
5096
+ // that can be integers or decimals (including leading dot).
4978
5097
  const cssUnitPattern = /^-?(\d+(\.\d*)?|\.\d+)(px|em|rem|%|vh|vw)$/i;
4979
5098
  const parts = value.trim().split(/\s+/);
4980
5099
  if (parts.length > 4) {
@@ -5181,6 +5300,8 @@
5181
5300
  * @version SDK: 1.36.2 | ThoughtSpot: *
5182
5301
  */
5183
5302
  function storeValueInWindow(key, value, options = {}) {
5303
+ if (isWindowUndefined())
5304
+ return value;
5184
5305
  if (!window[sdkWindowKey]) {
5185
5306
  window[sdkWindowKey] = {};
5186
5307
  }
@@ -5191,11 +5312,16 @@
5191
5312
  return value;
5192
5313
  }
5193
5314
  /**
5194
- * Retrieves a stored value from the global `window` object under the `_tsEmbedSDK` namespace.
5195
- * @param key - The key whose value needs to be retrieved.
5196
- * @returns The stored value or `undefined` if the key is not found.
5315
+ * Retrieves a stored value from the global
5316
+ * `window` object under the `_tsEmbedSDK` namespace.
5317
+ * Returns undefined in SSR environment.
5197
5318
  */
5198
- const getValueFromWindow = (key) => { var _a; return (_a = window === null || window === void 0 ? void 0 : window[sdkWindowKey]) === null || _a === void 0 ? void 0 : _a[key]; };
5319
+ const getValueFromWindow = (key) => {
5320
+ var _a;
5321
+ if (isWindowUndefined())
5322
+ return undefined;
5323
+ return (_a = window === null || window === void 0 ? void 0 : window[sdkWindowKey]) === null || _a === void 0 ? void 0 : _a[key];
5324
+ };
5199
5325
  /**
5200
5326
  * Check if an array includes a string value
5201
5327
  * @param arr - The array to check
@@ -5306,6 +5432,25 @@
5306
5432
  return template.replace(/\{(\w+)\}/g, (match, key) => {
5307
5433
  return values[key] !== undefined ? String(values[key]) : match;
5308
5434
  });
5435
+ };
5436
+ const getHostEventsConfig = (viewConfig) => {
5437
+ return {
5438
+ shouldBypassPayloadValidation: viewConfig.shouldBypassPayloadValidation,
5439
+ useHostEventsV2: viewConfig.useHostEventsV2,
5440
+ };
5441
+ };
5442
+ /**
5443
+ * Check if the window is undefined
5444
+ * If the window is undefined, it means the code is running in a SSR environment.
5445
+ * @returns true if the window is undefined, false otherwise
5446
+ *
5447
+ */
5448
+ const isWindowUndefined = () => {
5449
+ if (typeof window === 'undefined') {
5450
+ logger$3.error(ERROR_MESSAGE.SSR_ENVIRONMENT_ERROR);
5451
+ return true;
5452
+ }
5453
+ return false;
5309
5454
  };
5310
5455
 
5311
5456
  /**
@@ -7591,48 +7736,12 @@
7591
7736
  UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
7592
7737
  UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
7593
7738
  UIPassthroughEvent["GetUnsavedAnswerTML"] = "getUnsavedAnswerTML";
7594
- })(exports.UIPassthroughEvent || (exports.UIPassthroughEvent = {}));
7595
-
7596
- const ERROR_MESSAGE = {
7597
- INVALID_THOUGHTSPOT_HOST: 'Error parsing ThoughtSpot host. Please provide a valid URL.',
7598
- SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND: 'Please select a Model to get started',
7599
- LIVEBOARD_VIZ_ID_VALIDATION: 'Please select a Liveboard to embed.',
7600
- TRIGGER_TIMED_OUT: 'Trigger timed-out in getting a response',
7601
- SEARCHEMBED_BETA_WRANING_MESSAGE: 'SearchEmbed is in Beta in this release.',
7602
- SAGE_EMBED_BETA_WARNING_MESSAGE: 'SageEmbed is in Beta in this release.',
7603
- THIRD_PARTY_COOKIE_BLOCKED_ALERT: 'Third-party cookie access is blocked on this browser. Please allow third-party cookies for this to work properly. \nYou can use `suppressNoCookieAccessAlert` to suppress this message.',
7604
- DUPLICATE_TOKEN_ERR: 'Duplicate token. Please issue a new token every time getAuthToken callback is called. See https://developers.thoughtspot.com/docs/?pageid=embed-auth#trusted-auth-embed for more details.',
7605
- SDK_NOT_INITIALIZED: 'SDK not initialized',
7606
- SESSION_INFO_FAILED: 'Failed to get session information',
7607
- INVALID_TOKEN_ERROR: 'Received invalid token from getAuthToken callback or authToken endpoint.',
7608
- INVALID_TOKEN_TYPE_ERROR: 'Expected getAuthToken to return a string, but received a {invalidType}.',
7609
- MIXPANEL_TOKEN_NOT_FOUND: 'Mixpanel token not found in session info',
7610
- PRERENDER_ID_MISSING: 'PreRender ID is required for preRender',
7611
- SYNC_STYLE_CALLED_BEFORE_RENDER: 'PreRender should be called before using syncPreRenderStyle',
7612
- CSP_VIOLATION_ALERT: 'CSP violation detected. Please check the console errors for more details.',
7613
- CSP_FRAME_HOST_VIOLATION_LOG_MESSAGE: 'Please set up CSP correctly for the application to start working. For more information, see https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts. \n If the issue persists, refer to https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts',
7614
- MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
7615
- RENDER_CALLED_BEFORE_INIT: 'Looks like render was called before calling init, the render won\'t start until init is called.\nFor more info check\n1. https://developers.thoughtspot.com/docs/Function_init#_init\n2.https://developers.thoughtspot.com/docs/getting-started#initSdk',
7616
- SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
7617
- OFFLINE_WARNING: 'Network not Detected. Embed is offline. Please reconnect and refresh',
7618
- INIT_SDK_REQUIRED: 'You need to init the ThoughtSpot SDK module first',
7619
- CONFLICTING_ACTIONS_CONFIG: 'You cannot have both hidden actions and visible actions',
7620
- CONFLICTING_TABS_CONFIG: 'You cannot have both hidden Tabs and visible Tabs',
7621
- RENDER_BEFORE_EVENTS_REQUIRED: 'Please call render before triggering events',
7622
- HOST_EVENT_TYPE_UNDEFINED: 'Host event type is undefined',
7623
- LOGIN_FAILED: 'Login failed',
7624
- ERROR_PARSING_API_INTERCEPT_BODY: 'Error parsing api intercept body',
7625
- };
7626
- const CUSTOM_ACTIONS_ERROR_MESSAGE = {
7627
- INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
7628
- MISSING_REQUIRED_FIELDS: (id, missingFields) => `Custom Action Validation Error for '${id}': Missing required fields: ${missingFields.join(', ')}`,
7629
- UNSUPPORTED_TARGET: (id, targetType) => `Custom Action Validation Error for '${id}': Target type '${targetType}' is not supported`,
7630
- INVALID_POSITION: (position, targetType, supportedPositions) => `Position '${position}' is not supported for ${targetType.toLowerCase()}-level custom actions. Supported positions: ${supportedPositions}`,
7631
- INVALID_METADATA_IDS: (targetType, invalidIds, supportedIds) => `Invalid metadata IDs for ${targetType.toLowerCase()}-level custom actions: ${invalidIds.join(', ')}. Supported metadata IDs: ${supportedIds}`,
7632
- INVALID_DATA_MODEL_IDS: (targetType, invalidIds, supportedIds) => `Invalid data model IDs for ${targetType.toLowerCase()}-level custom actions: ${invalidIds.join(', ')}. Supported data model IDs: ${supportedIds}`,
7633
- INVALID_FIELDS: (targetType, invalidFields, supportedFields) => `Invalid fields for ${targetType.toLowerCase()}-level custom actions: ${invalidFields.join(', ')}. Supported fields: ${supportedFields}`,
7634
- DUPLICATE_IDS: (id, duplicateNames, keptName) => `Duplicate custom action ID '${id}' found. Actions with names '${duplicateNames.join("', '")}' will be ignored. Keeping '${keptName}'.`,
7635
- };
7739
+ })(exports.UIPassthroughEvent || (exports.UIPassthroughEvent = {}));
7740
+ var PageType;
7741
+ (function (PageType) {
7742
+ PageType["PAGE"] = "page";
7743
+ PageType["DIALOG"] = "dialog";
7744
+ })(PageType || (PageType = {}));
7636
7745
 
7637
7746
  const EndPoints = {
7638
7747
  AUTH_VERIFICATION: '/callosum/v1/session/info',
@@ -17419,6 +17528,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17419
17528
  * @param message
17420
17529
  * @param message.type
17421
17530
  * @param message.data
17531
+ * @param message.context
17422
17532
  * @param thoughtSpotHost
17423
17533
  * @param channel
17424
17534
  */
@@ -17433,8 +17543,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17433
17543
  * @param messageType
17434
17544
  * @param thoughtSpotHost
17435
17545
  * @param data
17546
+ * @param context
17436
17547
  */
17437
- function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
17548
+ function processTrigger(iFrame, messageType, thoughtSpotHost, data, context) {
17438
17549
  return new Promise((res, rej) => {
17439
17550
  var _a;
17440
17551
  if (messageType === exports.HostEvent.Reload) {
@@ -17468,7 +17579,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17468
17579
  channel.port1.close();
17469
17580
  res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
17470
17581
  }, TRIGGER_TIMEOUT);
17471
- return postIframeMessage(iFrame, { type: messageType, data }, thoughtSpotHost, channel);
17582
+ return postIframeMessage(iFrame, { type: messageType, data, context }, thoughtSpotHost, channel);
17472
17583
  });
17473
17584
  }
17474
17585
 
@@ -17589,6 +17700,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17589
17700
  }
17590
17701
  const initFlagKey = 'initFlagKey';
17591
17702
  const createAndSetInitPromise = () => {
17703
+ if (isWindowUndefined())
17704
+ return;
17592
17705
  const { promise: initPromise, resolve: initPromiseResolve,
17593
17706
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
17594
17707
  // @ts-ignore
@@ -17628,6 +17741,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17628
17741
  */
17629
17742
  const init = (embedConfig) => {
17630
17743
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
17744
+ if (isWindowUndefined())
17745
+ return null;
17631
17746
  sanity(embedConfig);
17632
17747
  resetAllCachedServices();
17633
17748
  embedConfig = setEmbedConfig(backwardCompat({
@@ -17963,7 +18078,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17963
18078
  return eventData;
17964
18079
  }
17965
18080
 
17966
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.44.2";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^30.0.0","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^30.2.0","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^30.2.0","jest-environment-jsdom":"^29.7.0","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^29.4.6","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
18081
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.44.4-HE-beta.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^30.0.0","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^30.2.0","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^30.2.0","jest-environment-jsdom":"^29.7.0","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^29.4.6","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
17967
18082
 
17968
18083
  class HostEventClient {
17969
18084
  constructor(iFrame) {
@@ -17975,16 +18090,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17975
18090
  * @param {any} data Data to send with the host event
17976
18091
  * @returns {Promise<any>} - the response from the process trigger
17977
18092
  */
17978
- async processTrigger(message, data) {
18093
+ async processTrigger(message, data, context) {
17979
18094
  if (!this.iFrame) {
17980
18095
  throw new Error('Iframe element is not set');
17981
18096
  }
17982
18097
  const thoughtspotHost = getEmbedConfig().thoughtSpotHost;
17983
- return processTrigger(this.iFrame, message, thoughtspotHost, data);
18098
+ return processTrigger(this.iFrame, message, thoughtspotHost, data, context);
17984
18099
  }
17985
- async handleHostEventWithParam(apiName, parameters) {
18100
+ async handleHostEventWithParam(apiName, parameters, context) {
17986
18101
  var _a, _b, _c, _d;
17987
- const response = (_b = (_a = (await this.triggerUIPassthroughApi(apiName, parameters))) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.call(_a, (r) => r.error || r.value)[0];
18102
+ const response = (_b = (_a = (await this.triggerUIPassthroughApi(apiName, parameters, context))) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.call(_a, (r) => r.error || r.value)[0];
17988
18103
  if (!response) {
17989
18104
  const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
17990
18105
  // eslint-disable-next-line no-throw-literal
@@ -17999,8 +18114,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17999
18114
  }
18000
18115
  return { ...response.value };
18001
18116
  }
18002
- async hostEventFallback(hostEvent, data) {
18003
- return this.processTrigger(hostEvent, data);
18117
+ async hostEventFallback(hostEvent, data, context) {
18118
+ return this.processTrigger(hostEvent, data, context);
18004
18119
  }
18005
18120
  /**
18006
18121
  * Setter for the iframe element used for host events
@@ -18009,49 +18124,49 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
18009
18124
  setIframeElement(iFrame) {
18010
18125
  this.iFrame = iFrame;
18011
18126
  }
18012
- async triggerUIPassthroughApi(apiName, parameters) {
18127
+ async triggerUIPassthroughApi(apiName, parameters, context) {
18013
18128
  const res = await this.processTrigger(exports.HostEvent.UIPassthrough, {
18014
18129
  type: apiName,
18015
18130
  parameters,
18016
- });
18131
+ }, context);
18017
18132
  return res;
18018
18133
  }
18019
- async handlePinEvent(payload) {
18134
+ async handlePinEvent(payload, context) {
18020
18135
  var _a, _b;
18021
18136
  if (!payload || !('newVizName' in payload)) {
18022
- return this.hostEventFallback(exports.HostEvent.Pin, payload);
18137
+ return this.hostEventFallback(exports.HostEvent.Pin, payload, context);
18023
18138
  }
18024
18139
  const formattedPayload = {
18025
18140
  ...payload,
18026
18141
  pinboardId: (_a = payload.liveboardId) !== null && _a !== void 0 ? _a : payload.pinboardId,
18027
18142
  newPinboardName: (_b = payload.newLiveboardName) !== null && _b !== void 0 ? _b : payload.newPinboardName,
18028
18143
  };
18029
- const data = await this.handleHostEventWithParam(exports.UIPassthroughEvent.PinAnswerToLiveboard, formattedPayload);
18144
+ const data = await this.handleHostEventWithParam(exports.UIPassthroughEvent.PinAnswerToLiveboard, formattedPayload, context);
18030
18145
  return {
18031
18146
  ...data,
18032
18147
  liveboardId: data.pinboardId,
18033
18148
  };
18034
18149
  }
18035
- async handleSaveAnswerEvent(payload) {
18150
+ async handleSaveAnswerEvent(payload, context) {
18036
18151
  var _a, _b, _c, _d;
18037
18152
  if (!payload || !('name' in payload) || !('description' in payload)) {
18038
18153
  // Save is the fallback for SaveAnswer
18039
- return this.hostEventFallback(exports.HostEvent.Save, payload);
18154
+ return this.hostEventFallback(exports.HostEvent.Save, payload, context);
18040
18155
  }
18041
- const data = await this.handleHostEventWithParam(exports.UIPassthroughEvent.SaveAnswer, payload);
18156
+ const data = await this.handleHostEventWithParam(exports.UIPassthroughEvent.SaveAnswer, payload, context);
18042
18157
  return {
18043
18158
  ...data,
18044
18159
  answerId: (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.saveResponse) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.Answer__save) === null || _c === void 0 ? void 0 : _c.answer) === null || _d === void 0 ? void 0 : _d.id,
18045
18160
  };
18046
18161
  }
18047
- async triggerHostEvent(hostEvent, payload) {
18162
+ async triggerHostEvent(hostEvent, payload, context) {
18048
18163
  switch (hostEvent) {
18049
18164
  case exports.HostEvent.Pin:
18050
- return this.handlePinEvent(payload);
18165
+ return this.handlePinEvent(payload, context);
18051
18166
  case exports.HostEvent.SaveAnswer:
18052
- return this.handleSaveAnswerEvent(payload);
18167
+ return this.handleSaveAnswerEvent(payload, context);
18053
18168
  default:
18054
- return this.hostEventFallback(hostEvent, payload);
18169
+ return this.hostEventFallback(hostEvent, payload, context);
18055
18170
  }
18056
18171
  }
18057
18172
  }
@@ -18162,9 +18277,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
18162
18277
  const [interceptData, bodyParseError] = parseInterceptData(eventData.data);
18163
18278
  if (bodyParseError) {
18164
18279
  const errorDetails = {
18165
- errorType: ErrorDetailsTypes.API,
18280
+ errorType: exports.ErrorDetailsTypes.API,
18166
18281
  message: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
18167
- code: EmbedErrorCodes.PARSING_API_INTERCEPT_BODY_ERROR,
18282
+ code: exports.EmbedErrorCodes.PARSING_API_INTERCEPT_BODY_ERROR,
18168
18283
  error: ERROR_MESSAGE.ERROR_PARSING_API_INTERCEPT_BODY,
18169
18284
  };
18170
18285
  executeEvent(exports.EmbedEvent.Error, errorDetails);
@@ -18480,9 +18595,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
18480
18595
  */
18481
18596
  throwInitError() {
18482
18597
  this.handleError({
18483
- errorType: ErrorDetailsTypes.VALIDATION_ERROR,
18598
+ errorType: exports.ErrorDetailsTypes.VALIDATION_ERROR,
18484
18599
  message: ERROR_MESSAGE.INIT_SDK_REQUIRED,
18485
- code: EmbedErrorCodes.INIT_ERROR,
18600
+ code: exports.EmbedErrorCodes.INIT_ERROR,
18486
18601
  error: ERROR_MESSAGE.INIT_SDK_REQUIRED,
18487
18602
  });
18488
18603
  }
@@ -18575,9 +18690,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
18575
18690
  window.addEventListener('online', onlineEventListener);
18576
18691
  const offlineEventListener = (e) => {
18577
18692
  const errorDetails = {
18578
- errorType: ErrorDetailsTypes.NETWORK,
18693
+ errorType: exports.ErrorDetailsTypes.NETWORK,
18579
18694
  message: ERROR_MESSAGE.OFFLINE_WARNING,
18580
- code: EmbedErrorCodes.NETWORK_ERROR,
18695
+ code: exports.EmbedErrorCodes.NETWORK_ERROR,
18581
18696
  offlineWarning: ERROR_MESSAGE.OFFLINE_WARNING,
18582
18697
  };
18583
18698
  this.executeCallbacks(exports.EmbedEvent.Error, errorDetails);
@@ -18661,10 +18776,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
18661
18776
  ]);
18662
18777
  if (customActionsResult.errors.length > 0) {
18663
18778
  this.handleError({
18664
- errorType: ErrorDetailsTypes.VALIDATION_ERROR,
18779
+ errorType: exports.ErrorDetailsTypes.VALIDATION_ERROR,
18665
18780
  message: customActionsResult.errors,
18666
- code: EmbedErrorCodes.CUSTOM_ACTION_VALIDATION,
18667
- error: { type: EmbedErrorCodes.CUSTOM_ACTION_VALIDATION, message: customActionsResult.errors }
18781
+ code: exports.EmbedErrorCodes.CUSTOM_ACTION_VALIDATION,
18782
+ error: { type: exports.EmbedErrorCodes.CUSTOM_ACTION_VALIDATION, message: customActionsResult.errors }
18668
18783
  });
18669
18784
  }
18670
18785
  const baseInitData = {
@@ -18686,6 +18801,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
18686
18801
  hiddenListColumns: this.viewConfig.hiddenListColumns || [],
18687
18802
  customActions: customActionsResult.actions,
18688
18803
  ...getInterceptInitData(this.viewConfig),
18804
+ ...getHostEventsConfig(this.viewConfig),
18689
18805
  };
18690
18806
  return baseInitData;
18691
18807
  }
@@ -18706,9 +18822,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
18706
18822
  .join('/');
18707
18823
  return `${basePath}#`;
18708
18824
  }
18709
- getUpdateEmbedParamsObject() {
18825
+ async getUpdateEmbedParamsObject() {
18710
18826
  let queryParams = this.getEmbedParamsObject();
18711
- queryParams = { ...this.viewConfig, ...queryParams, ...this.getAppInitData() };
18827
+ const appInitData = await this.getAppInitData();
18828
+ queryParams = { ...this.viewConfig, ...queryParams, ...appInitData };
18712
18829
  return queryParams;
18713
18830
  }
18714
18831
  /**
@@ -18762,18 +18879,18 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
18762
18879
  };
18763
18880
  if (Array.isArray(visibleActions) && Array.isArray(hiddenActions)) {
18764
18881
  this.handleError({
18765
- errorType: ErrorDetailsTypes.VALIDATION_ERROR,
18882
+ errorType: exports.ErrorDetailsTypes.VALIDATION_ERROR,
18766
18883
  message: ERROR_MESSAGE.CONFLICTING_ACTIONS_CONFIG,
18767
- code: EmbedErrorCodes.CONFLICTING_ACTIONS_CONFIG,
18884
+ code: exports.EmbedErrorCodes.CONFLICTING_ACTIONS_CONFIG,
18768
18885
  error: ERROR_MESSAGE.CONFLICTING_ACTIONS_CONFIG,
18769
18886
  });
18770
18887
  return queryParams;
18771
18888
  }
18772
18889
  if (Array.isArray(visibleTabs) && Array.isArray(hiddenTabs)) {
18773
18890
  this.handleError({
18774
- errorType: ErrorDetailsTypes.VALIDATION_ERROR,
18891
+ errorType: exports.ErrorDetailsTypes.VALIDATION_ERROR,
18775
18892
  message: ERROR_MESSAGE.CONFLICTING_TABS_CONFIG,
18776
- code: EmbedErrorCodes.CONFLICTING_TABS_CONFIG,
18893
+ code: exports.EmbedErrorCodes.CONFLICTING_TABS_CONFIG,
18777
18894
  error: ERROR_MESSAGE.CONFLICTING_TABS_CONFIG,
18778
18895
  });
18779
18896
  return queryParams;
@@ -19001,9 +19118,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
19001
19118
  });
19002
19119
  this.handleInsertionIntoDOM(this.embedConfig.loginFailedMessage);
19003
19120
  this.handleError({
19004
- errorType: ErrorDetailsTypes.API,
19121
+ errorType: exports.ErrorDetailsTypes.API,
19005
19122
  message: error.message || ERROR_MESSAGE.LOGIN_FAILED,
19006
- code: EmbedErrorCodes.LOGIN_FAILED,
19123
+ code: exports.EmbedErrorCodes.LOGIN_FAILED,
19007
19124
  error: error,
19008
19125
  });
19009
19126
  });
@@ -19017,6 +19134,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
19017
19134
  preRenderWrapper.id = preRenderIds.wrapper;
19018
19135
  const initialPreRenderWrapperStyle = {
19019
19136
  position: 'absolute',
19137
+ top: '0',
19138
+ left: '0',
19020
19139
  width: '100vw',
19021
19140
  height: '100vh',
19022
19141
  };
@@ -19307,22 +19426,22 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
19307
19426
  * @param {any} data The payload to send with the message
19308
19427
  * @returns A promise that resolves with the response from the embedded app
19309
19428
  */
19310
- async trigger(messageType, data = {}) {
19429
+ async trigger(messageType, data = {}, context) {
19311
19430
  uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
19312
19431
  if (!this.isRendered) {
19313
19432
  this.handleError({
19314
- errorType: ErrorDetailsTypes.VALIDATION_ERROR,
19433
+ errorType: exports.ErrorDetailsTypes.VALIDATION_ERROR,
19315
19434
  message: ERROR_MESSAGE.RENDER_BEFORE_EVENTS_REQUIRED,
19316
- code: EmbedErrorCodes.RENDER_NOT_CALLED,
19435
+ code: exports.EmbedErrorCodes.RENDER_NOT_CALLED,
19317
19436
  error: ERROR_MESSAGE.RENDER_BEFORE_EVENTS_REQUIRED,
19318
19437
  });
19319
19438
  return null;
19320
19439
  }
19321
19440
  if (!messageType) {
19322
19441
  this.handleError({
19323
- errorType: ErrorDetailsTypes.VALIDATION_ERROR,
19442
+ errorType: exports.ErrorDetailsTypes.VALIDATION_ERROR,
19324
19443
  message: ERROR_MESSAGE.HOST_EVENT_TYPE_UNDEFINED,
19325
- code: EmbedErrorCodes.HOST_EVENT_TYPE_UNDEFINED,
19444
+ code: exports.EmbedErrorCodes.HOST_EVENT_TYPE_UNDEFINED,
19326
19445
  error: ERROR_MESSAGE.HOST_EVENT_TYPE_UNDEFINED,
19327
19446
  });
19328
19447
  return null;
@@ -19334,7 +19453,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
19334
19453
  return null;
19335
19454
  }
19336
19455
  // send an empty object, this is needed for liveboard default handlers
19337
- return this.hostEventClient.triggerHostEvent(messageType, data);
19456
+ return this.hostEventClient.triggerHostEvent(messageType, data, context);
19338
19457
  }
19339
19458
  /**
19340
19459
  * Triggers an event to the embedded app, skipping the UI flow.
@@ -19367,6 +19486,19 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
19367
19486
  handleRenderForPrerender() {
19368
19487
  return this.render();
19369
19488
  }
19489
+ /**
19490
+ * Get the current context of the embedded TS component.
19491
+ * @returns The current context object containing the page type and object ids.
19492
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
19493
+ */
19494
+ async getCurrentContext() {
19495
+ return new Promise((resolve) => {
19496
+ this.executeAfterEmbedContainerLoaded(async () => {
19497
+ const context = await this.trigger(exports.HostEvent.GetPageContext, {});
19498
+ resolve(context);
19499
+ });
19500
+ });
19501
+ }
19370
19502
  /**
19371
19503
  * Creates the preRender shell
19372
19504
  * @param showPreRenderByDefault - Show the preRender after render, hidden by default
@@ -19481,8 +19613,20 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
19481
19613
  }
19482
19614
  this.validatePreRenderViewConfig(this.viewConfig);
19483
19615
  logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
19484
- this.executeAfterEmbedContainerLoaded(() => {
19485
- this.trigger(exports.HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
19616
+ this.executeAfterEmbedContainerLoaded(async () => {
19617
+ try {
19618
+ const params = await this.getUpdateEmbedParamsObject();
19619
+ this.trigger(exports.HostEvent.UpdateEmbedParams, params);
19620
+ }
19621
+ catch (error) {
19622
+ logger$3.error(ERROR_MESSAGE.UPDATE_PARAMS_FAILED, error);
19623
+ this.handleError({
19624
+ errorType: exports.ErrorDetailsTypes.API,
19625
+ message: (error === null || error === void 0 ? void 0 : error.message) || ERROR_MESSAGE.UPDATE_PARAMS_FAILED,
19626
+ code: exports.EmbedErrorCodes.UPDATE_PARAMS_FAILED,
19627
+ error: (error === null || error === void 0 ? void 0 : error.message) || error,
19628
+ });
19629
+ }
19486
19630
  });
19487
19631
  }
19488
19632
  this.beforePrerenderVisible();
@@ -19502,7 +19646,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
19502
19646
  this.resizeObserver.observe(this.el);
19503
19647
  }
19504
19648
  }
19505
- removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
19649
+ removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events', 'overflow']);
19506
19650
  this.subscribeToEvents();
19507
19651
  // Setup fullscreen change handler for prerendered components
19508
19652
  if (this.iFrame) {
@@ -19545,7 +19689,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
19545
19689
  opacity: '0',
19546
19690
  pointerEvents: 'none',
19547
19691
  zIndex: '-1000',
19548
- position: 'absolute ',
19692
+ position: 'absolute',
19693
+ top: '0',
19694
+ left: '0',
19695
+ overflow: 'hidden',
19549
19696
  };
19550
19697
  setStyleProperties(this.preRenderWrapper, preRenderHideStyles);
19551
19698
  if (this.resizeObserver) {
@@ -20225,6 +20372,7 @@ query GetEurekaVizSnapshots(
20225
20372
  super(domSelector, viewConfig);
20226
20373
  this.defaultHeight = 500;
20227
20374
  this.sendFullHeightLazyLoadData = () => {
20375
+ console.log('sendFullHeightLazyLoadData', this.iFrame);
20228
20376
  const data = calculateVisibleElementData(this.iFrame);
20229
20377
  this.trigger(exports.HostEvent.VisibleEmbedCoordinates, data);
20230
20378
  };
@@ -20418,9 +20566,9 @@ query GetEurekaVizSnapshots(
20418
20566
  const liveboardId = (_a = this.viewConfig.liveboardId) !== null && _a !== void 0 ? _a : this.viewConfig.pinboardId;
20419
20567
  if (!liveboardId) {
20420
20568
  this.handleError({
20421
- errorType: ErrorDetailsTypes.VALIDATION_ERROR,
20569
+ errorType: exports.ErrorDetailsTypes.VALIDATION_ERROR,
20422
20570
  message: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
20423
- code: EmbedErrorCodes.LIVEBOARD_ID_MISSING,
20571
+ code: exports.EmbedErrorCodes.LIVEBOARD_ID_MISSING,
20424
20572
  error: ERROR_MESSAGE.LIVEBOARD_VIZ_ID_VALIDATION,
20425
20573
  });
20426
20574
  }
@@ -20485,7 +20633,7 @@ query GetEurekaVizSnapshots(
20485
20633
  * @param {any} data The payload to send with the message
20486
20634
  * @returns A promise that resolves with the response from the embedded app
20487
20635
  */
20488
- trigger(messageType, data = {}) {
20636
+ trigger(messageType, data = {}, context) {
20489
20637
  const dataWithVizId = data;
20490
20638
  if (messageType === exports.HostEvent.SetActiveTab) {
20491
20639
  this.setActiveTab(data);
@@ -20494,7 +20642,7 @@ query GetEurekaVizSnapshots(
20494
20642
  if (typeof dataWithVizId === 'object' && this.viewConfig.vizId) {
20495
20643
  dataWithVizId.vizId = this.viewConfig.vizId;
20496
20644
  }
20497
- return super.trigger(messageType, dataWithVizId);
20645
+ return super.trigger(messageType, dataWithVizId, context);
20498
20646
  }
20499
20647
  /**
20500
20648
  * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
@@ -20563,6 +20711,15 @@ query GetEurekaVizSnapshots(
20563
20711
  }
20564
20712
  return url;
20565
20713
  }
20714
+ /**
20715
+ * Get the current context of the embedded liveboard.
20716
+ * @returns The current context object containing the page type and object ids.
20717
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
20718
+ */
20719
+ async getCurrentContext() {
20720
+ const context = await super.getCurrentContext();
20721
+ return context;
20722
+ }
20566
20723
  }
20567
20724
  /**
20568
20725
  * @hidden
@@ -20743,6 +20900,15 @@ query GetEurekaVizSnapshots(
20743
20900
  });
20744
20901
  return this;
20745
20902
  }
20903
+ /**
20904
+ * Get the current context of the embedded search.
20905
+ * @returns The current context object containing the page type and object ids.
20906
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
20907
+ */
20908
+ async getCurrentContext() {
20909
+ const context = await super.getCurrentContext();
20910
+ return context;
20911
+ }
20746
20912
  }
20747
20913
 
20748
20914
  /**
@@ -20818,6 +20984,15 @@ query GetEurekaVizSnapshots(
20818
20984
  const defaultAppInitData = await super.getAppInitData();
20819
20985
  return { ...defaultAppInitData, ...this.getSearchInitData() };
20820
20986
  }
20987
+ /**
20988
+ * Get the current context of the embedded search bar.
20989
+ * @returns The current context object containing the page type and object ids.
20990
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
20991
+ */
20992
+ async getCurrentContext() {
20993
+ const context = await super.getCurrentContext();
20994
+ return context;
20995
+ }
20821
20996
  }
20822
20997
 
20823
20998
  const createConversation = `
@@ -21387,9 +21562,9 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
21387
21562
  const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, enablePastConversationsSidebar, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, updatedSpotterChatPrompt, } = this.viewConfig;
21388
21563
  if (!worksheetId) {
21389
21564
  this.handleError({
21390
- errorType: ErrorDetailsTypes.VALIDATION_ERROR,
21565
+ errorType: exports.ErrorDetailsTypes.VALIDATION_ERROR,
21391
21566
  message: ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND,
21392
- code: EmbedErrorCodes.WORKSHEET_ID_NOT_FOUND,
21567
+ code: exports.EmbedErrorCodes.WORKSHEET_ID_NOT_FOUND,
21393
21568
  error: ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND,
21394
21569
  });
21395
21570
  }
@@ -21447,6 +21622,15 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
21447
21622
  await this.renderIFrame(src);
21448
21623
  return this;
21449
21624
  }
21625
+ /**
21626
+ * Get the current context of the embedded SpotterEmbed.
21627
+ * @returns The current context object containing the page type and object ids.
21628
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
21629
+ */
21630
+ async getCurrentContext() {
21631
+ const context = await super.getCurrentContext();
21632
+ return context;
21633
+ }
21450
21634
  }
21451
21635
  /**
21452
21636
  * Embed ThoughtSpot AI Conversation.
@@ -21553,6 +21737,15 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
21553
21737
  await this.renderV1Embed(src);
21554
21738
  return this;
21555
21739
  }
21740
+ /**
21741
+ * Get the current context of the embedded SageEmbed.
21742
+ * @returns The current context object containing the page type and object ids.
21743
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
21744
+ */
21745
+ async getCurrentContext() {
21746
+ const context = await super.getCurrentContext();
21747
+ return context;
21748
+ }
21556
21749
  }
21557
21750
 
21558
21751
  const getAnswerSessionFromQuery = `