@thoughtspot/visual-embed-sdk 1.44.3 → 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 (192) 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/conversation.d.ts +7 -0
  7. package/cjs/src/embed/conversation.d.ts.map +1 -1
  8. package/cjs/src/embed/conversation.js +9 -0
  9. package/cjs/src/embed/conversation.js.map +1 -1
  10. package/cjs/src/embed/hostEventClient/contracts.d.ts +20 -3
  11. package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  12. package/cjs/src/embed/hostEventClient/contracts.js +6 -1
  13. package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
  14. package/cjs/src/embed/hostEventClient/host-event-client.d.ts +8 -8
  15. package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  16. package/cjs/src/embed/hostEventClient/host-event-client.js +18 -18
  17. package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
  18. package/cjs/src/embed/hostEventClient/host-event-client.spec.js +7 -7
  19. package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  20. package/cjs/src/embed/liveboard.d.ts +10 -4
  21. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  22. package/cjs/src/embed/liveboard.js +12 -2
  23. package/cjs/src/embed/liveboard.js.map +1 -1
  24. package/cjs/src/embed/liveboard.spec.js +1 -1
  25. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  26. package/cjs/src/embed/sage.d.ts +7 -0
  27. package/cjs/src/embed/sage.d.ts.map +1 -1
  28. package/cjs/src/embed/sage.js +9 -0
  29. package/cjs/src/embed/sage.js.map +1 -1
  30. package/cjs/src/embed/search-bar.d.ts +7 -0
  31. package/cjs/src/embed/search-bar.d.ts.map +1 -1
  32. package/cjs/src/embed/search-bar.js +9 -0
  33. package/cjs/src/embed/search-bar.js.map +1 -1
  34. package/cjs/src/embed/search.d.ts +7 -0
  35. package/cjs/src/embed/search.d.ts.map +1 -1
  36. package/cjs/src/embed/search.js +9 -0
  37. package/cjs/src/embed/search.js.map +1 -1
  38. package/cjs/src/embed/ts-embed.d.ts +9 -3
  39. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  40. package/cjs/src/embed/ts-embed.js +41 -8
  41. package/cjs/src/embed/ts-embed.js.map +1 -1
  42. package/cjs/src/embed/ts-embed.spec.js +156 -24
  43. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  44. package/cjs/src/errors.d.ts +1 -0
  45. package/cjs/src/errors.d.ts.map +1 -1
  46. package/cjs/src/errors.js +1 -0
  47. package/cjs/src/errors.js.map +1 -1
  48. package/cjs/src/index.d.ts +2 -2
  49. package/cjs/src/index.d.ts.map +1 -1
  50. package/cjs/src/index.js +5 -1
  51. package/cjs/src/index.js.map +1 -1
  52. package/cjs/src/types.d.ts +142 -45
  53. package/cjs/src/types.d.ts.map +1 -1
  54. package/cjs/src/types.js +91 -16
  55. package/cjs/src/types.js.map +1 -1
  56. package/cjs/src/utils/logger.spec.d.ts +20 -5
  57. package/cjs/src/utils/logger.spec.d.ts.map +1 -1
  58. package/cjs/src/utils/processTrigger.d.ts +3 -2
  59. package/cjs/src/utils/processTrigger.d.ts.map +1 -1
  60. package/cjs/src/utils/processTrigger.js +4 -2
  61. package/cjs/src/utils/processTrigger.js.map +1 -1
  62. package/cjs/src/utils.d.ts +5 -1
  63. package/cjs/src/utils.d.ts.map +1 -1
  64. package/cjs/src/utils.js +10 -2
  65. package/cjs/src/utils.js.map +1 -1
  66. package/dist/index-BFdRRz03.js +7371 -0
  67. package/dist/index-BUfrYJ3w.js +7371 -0
  68. package/dist/index-CI6s4VMY.js +7371 -0
  69. package/dist/{index-D0n5LIka.js → index-CWQnMX2L.js} +1 -1
  70. package/dist/index-CaW-1mu5.js +7371 -0
  71. package/dist/index-CcSgNJVi.js +7371 -0
  72. package/dist/index-Djtv-y7A.js +7371 -0
  73. package/dist/index-UY-4yjBN.js +7371 -0
  74. package/dist/src/embed/app.d.ts +44 -32
  75. package/dist/src/embed/app.d.ts.map +1 -1
  76. package/dist/src/embed/conversation.d.ts +7 -0
  77. package/dist/src/embed/conversation.d.ts.map +1 -1
  78. package/dist/src/embed/hostEventClient/contracts.d.ts +20 -3
  79. package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  80. package/dist/src/embed/hostEventClient/host-event-client.d.ts +8 -8
  81. package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  82. package/dist/src/embed/liveboard.d.ts +10 -4
  83. package/dist/src/embed/liveboard.d.ts.map +1 -1
  84. package/dist/src/embed/sage.d.ts +7 -0
  85. package/dist/src/embed/sage.d.ts.map +1 -1
  86. package/dist/src/embed/search-bar.d.ts +7 -0
  87. package/dist/src/embed/search-bar.d.ts.map +1 -1
  88. package/dist/src/embed/search.d.ts +7 -0
  89. package/dist/src/embed/search.d.ts.map +1 -1
  90. package/dist/src/embed/ts-embed.d.ts +9 -3
  91. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  92. package/dist/src/errors.d.ts +1 -0
  93. package/dist/src/errors.d.ts.map +1 -1
  94. package/dist/src/index.d.ts +2 -2
  95. package/dist/src/index.d.ts.map +1 -1
  96. package/dist/src/types.d.ts +142 -45
  97. package/dist/src/types.d.ts.map +1 -1
  98. package/dist/src/utils/logger.spec.d.ts +20 -5
  99. package/dist/src/utils/logger.spec.d.ts.map +1 -1
  100. package/dist/src/utils/processTrigger.d.ts +3 -2
  101. package/dist/src/utils/processTrigger.d.ts.map +1 -1
  102. package/dist/src/utils.d.ts +5 -1
  103. package/dist/src/utils.d.ts.map +1 -1
  104. package/dist/tsembed-react.es.js +218 -50
  105. package/dist/tsembed-react.js +217 -49
  106. package/dist/tsembed.es.js +219 -51
  107. package/dist/tsembed.js +244 -76
  108. package/dist/visual-embed-sdk-react-full.d.ts +245 -82
  109. package/dist/visual-embed-sdk-react.d.ts +251 -90
  110. package/dist/visual-embed-sdk.d.ts +298 -92
  111. package/lib/package.json +1 -1
  112. package/lib/src/embed/app.d.ts +44 -32
  113. package/lib/src/embed/app.d.ts.map +1 -1
  114. package/lib/src/embed/app.js.map +1 -1
  115. package/lib/src/embed/conversation.d.ts +7 -0
  116. package/lib/src/embed/conversation.d.ts.map +1 -1
  117. package/lib/src/embed/conversation.js +9 -0
  118. package/lib/src/embed/conversation.js.map +1 -1
  119. package/lib/src/embed/hostEventClient/contracts.d.ts +20 -3
  120. package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  121. package/lib/src/embed/hostEventClient/contracts.js +5 -0
  122. package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
  123. package/lib/src/embed/hostEventClient/host-event-client.d.ts +8 -8
  124. package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  125. package/lib/src/embed/hostEventClient/host-event-client.js +18 -18
  126. package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
  127. package/lib/src/embed/hostEventClient/host-event-client.spec.js +7 -7
  128. package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  129. package/lib/src/embed/liveboard.d.ts +10 -4
  130. package/lib/src/embed/liveboard.d.ts.map +1 -1
  131. package/lib/src/embed/liveboard.js +12 -2
  132. package/lib/src/embed/liveboard.js.map +1 -1
  133. package/lib/src/embed/liveboard.spec.js +1 -1
  134. package/lib/src/embed/liveboard.spec.js.map +1 -1
  135. package/lib/src/embed/sage.d.ts +7 -0
  136. package/lib/src/embed/sage.d.ts.map +1 -1
  137. package/lib/src/embed/sage.js +9 -0
  138. package/lib/src/embed/sage.js.map +1 -1
  139. package/lib/src/embed/search-bar.d.ts +7 -0
  140. package/lib/src/embed/search-bar.d.ts.map +1 -1
  141. package/lib/src/embed/search-bar.js +9 -0
  142. package/lib/src/embed/search-bar.js.map +1 -1
  143. package/lib/src/embed/search.d.ts +7 -0
  144. package/lib/src/embed/search.d.ts.map +1 -1
  145. package/lib/src/embed/search.js +9 -0
  146. package/lib/src/embed/search.js.map +1 -1
  147. package/lib/src/embed/ts-embed.d.ts +9 -3
  148. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  149. package/lib/src/embed/ts-embed.js +41 -8
  150. package/lib/src/embed/ts-embed.js.map +1 -1
  151. package/lib/src/embed/ts-embed.spec.js +156 -24
  152. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  153. package/lib/src/errors.d.ts +1 -0
  154. package/lib/src/errors.d.ts.map +1 -1
  155. package/lib/src/errors.js +1 -0
  156. package/lib/src/errors.js.map +1 -1
  157. package/lib/src/index.d.ts +2 -2
  158. package/lib/src/index.d.ts.map +1 -1
  159. package/lib/src/index.js +2 -2
  160. package/lib/src/index.js.map +1 -1
  161. package/lib/src/types.d.ts +142 -45
  162. package/lib/src/types.d.ts.map +1 -1
  163. package/lib/src/types.js +90 -15
  164. package/lib/src/types.js.map +1 -1
  165. package/lib/src/utils/logger.spec.d.ts +20 -5
  166. package/lib/src/utils/logger.spec.d.ts.map +1 -1
  167. package/lib/src/utils/processTrigger.d.ts +3 -2
  168. package/lib/src/utils/processTrigger.d.ts.map +1 -1
  169. package/lib/src/utils/processTrigger.js +4 -2
  170. package/lib/src/utils/processTrigger.js.map +1 -1
  171. package/lib/src/utils.d.ts +5 -1
  172. package/lib/src/utils.d.ts.map +1 -1
  173. package/lib/src/utils.js +8 -1
  174. package/lib/src/utils.js.map +1 -1
  175. package/package.json +1 -1
  176. package/src/embed/app.ts +45 -32
  177. package/src/embed/conversation.ts +11 -0
  178. package/src/embed/hostEventClient/contracts.ts +23 -4
  179. package/src/embed/hostEventClient/host-event-client.spec.ts +7 -1
  180. package/src/embed/hostEventClient/host-event-client.ts +22 -11
  181. package/src/embed/liveboard.spec.ts +1 -1
  182. package/src/embed/liveboard.ts +18 -5
  183. package/src/embed/sage.ts +11 -0
  184. package/src/embed/search-bar.tsx +11 -0
  185. package/src/embed/search.ts +11 -0
  186. package/src/embed/ts-embed.spec.ts +205 -18
  187. package/src/embed/ts-embed.ts +45 -9
  188. package/src/errors.ts +1 -0
  189. package/src/index.ts +6 -0
  190. package/src/types.ts +146 -43
  191. package/src/utils/processTrigger.ts +6 -3
  192. package/src/utils.ts +10 -1
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.44.3 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.44.4-HE-beta.1 */
2
2
  'use client';
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
@@ -182,57 +182,71 @@ var AuthType;
182
182
  })(AuthType || (AuthType = {}));
183
183
  /**
184
184
  *
185
- * This option does not apply to the classic homepage experience.
186
- * To access the updated modular homepage,
187
- * set `modularHomeExperience` to `true`
188
- * (available as Early Access feature in 9.12.5.cl).
185
+ * **Note**: This attribute is not supported in the classic (V1) homepage experience.
189
186
  *
190
187
  */
191
188
  var HomeLeftNavItem;
192
189
  (function (HomeLeftNavItem) {
193
190
  /**
191
+ * The *Search data* option in
192
+ * the *Insights* left navigation panel.
194
193
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
195
194
  */
196
195
  HomeLeftNavItem["SearchData"] = "search-data";
197
196
  /**
197
+ * The *Home* menu option in
198
+ * the *Insights* left navigation panel.
198
199
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
199
200
  */
200
201
  HomeLeftNavItem["Home"] = "insights-home";
201
202
  /**
203
+ * The *Liveboards* menu option in
204
+ * the *Insights* left navigation panel.
202
205
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
203
206
  */
204
207
  HomeLeftNavItem["Liveboards"] = "liveboards";
205
208
  /**
209
+ * The *Answers* menu option in
210
+ * the *Insights* left navigation panel.
206
211
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
207
212
  */
208
213
  HomeLeftNavItem["Answers"] = "answers";
209
214
  /**
215
+ * The *Monitor subscriptions* menu option in
216
+ * the *Insights* left navigation panel.
210
217
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
211
218
  */
212
219
  HomeLeftNavItem["MonitorSubscription"] = "monitor-alerts";
213
220
  /**
221
+ * The *SpotIQ analysis* menu option in
222
+ * the *Insights* left navigation panel.
214
223
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
215
224
  */
216
225
  HomeLeftNavItem["SpotIQAnalysis"] = "spotiq-analysis";
217
226
  /**
227
+ * The *Liveboard schedules* menu option in
228
+ * the *Insights* left navigation panel.
218
229
  * @version SDK: 1.34.0| ThoughtSpot: 10.3.0.cl
219
230
  */
220
231
  HomeLeftNavItem["LiveboardSchedules"] = "liveboard-schedules";
221
232
  /**
222
- * Create new options in the insights left navigation,
223
- * available when new navigation V3 is enabled.
233
+ * The create option in the *Insights*
234
+ * left navigation panel.
235
+ * Available in the V3 navigation experience.
224
236
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
225
237
  */
226
238
  HomeLeftNavItem["Create"] = "create";
227
239
  /**
228
- * Spotter option in the insights left navigation,
229
- * available when new navigation V3 is enabled.
240
+ * The *Spotter* menu option in the *Insights*
241
+ * left navigation panel.
242
+ * Available in the V3 navigation experience.
230
243
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
231
244
  */
232
245
  HomeLeftNavItem["Spotter"] = "spotter";
233
246
  /**
234
- * Favorites option in the insights left navigation,
235
- * available when new navigation V3 is enabled.
247
+ * The *Favorites* section in the *Insights*
248
+ * left navigation panel.
249
+ * Available in the V3 navigation experience.
236
250
  * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
237
251
  */
238
252
  HomeLeftNavItem["Favorites"] = "favorites";
@@ -304,10 +318,11 @@ var RuntimeFilterOp;
304
318
  RuntimeFilterOp["NOT_IN"] = "NOT_IN";
305
319
  })(RuntimeFilterOp || (RuntimeFilterOp = {}));
306
320
  /**
307
- * Home page module that can be hidden.
308
- * **Note**: This option does not apply to the classic homepage.
309
- * To access the updated modular homepage, set
310
- * `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
321
+ * Home page modules that can be hidden
322
+ * via `hiddenHomepageModules` and reordered via
323
+ * `reorderedHomepageModules`.
324
+ *
325
+ * **Note**: This option is not supported in the classic (v1) experience.
311
326
  * @version SDK: 1.28.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw
312
327
  */
313
328
  var HomepageModule;
@@ -321,7 +336,7 @@ var HomepageModule;
321
336
  */
322
337
  HomepageModule["Watchlist"] = "WATCHLIST";
323
338
  /**
324
- * favorite objects
339
+ * Favorite module
325
340
  */
326
341
  HomepageModule["Favorite"] = "FAVORITE";
327
342
  /**
@@ -1477,6 +1492,28 @@ var EmbedEvent;
1477
1492
  * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1478
1493
  */
1479
1494
  EmbedEvent["PreviewSpotterData"] = "PreviewSpotterData";
1495
+ /**
1496
+ * Emitted when user opens up the Add to Coaching modal on any visualization in Spotter Embed.
1497
+ * @example
1498
+ * ```js
1499
+ * spotterEmbed.on(EmbedEvent.AddToCoaching, (payload) => {
1500
+ * console.log('payload', payload);
1501
+ * })
1502
+ *```
1503
+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
1504
+ */
1505
+ EmbedEvent["AddToCoaching"] = "addToCoaching";
1506
+ /**
1507
+ * Emitted when user opens up the data model instructions modal in Spotter embed.
1508
+ * @example
1509
+ * ```js
1510
+ * spotterEmbed.on(EmbedEvent.DataModelInstructions, (payload) => {
1511
+ * console.log('payload', payload);
1512
+ * })
1513
+ * ```
1514
+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
1515
+ */
1516
+ EmbedEvent["DataModelInstructions"] = "DataModelInstructions";
1480
1517
  /**
1481
1518
  * Emitted when the Spotter query is triggered in Spotter embed.
1482
1519
  * @example
@@ -2901,6 +2938,26 @@ var HostEvent;
2901
2938
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
2902
2939
  */
2903
2940
  HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
2941
+ /**
2942
+ * Opens the Add to Coaching modal from a visualization in Spotter Embed.
2943
+ * @param - `vizId ` refers to the Visualization ID in Spotter embed and is required.
2944
+ * @example
2945
+ * ```js
2946
+ * spotterEmbed.trigger(HostEvent.AddToCoaching, { vizId: '730496d6-6903-4601-937e-2c691821af3c' });
2947
+ *
2948
+ *```
2949
+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
2950
+ */
2951
+ HostEvent["AddToCoaching"] = "addToCoaching";
2952
+ /**
2953
+ * Opens the data model instructions modal in Spotter Embed.
2954
+ * @example
2955
+ * ```js
2956
+ * spotterEmbed.trigger(HostEvent.DataModelInstructions);
2957
+ * ```
2958
+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
2959
+ */
2960
+ HostEvent["DataModelInstructions"] = "DataModelInstructions";
2904
2961
  /**
2905
2962
  * Resets the Spotter Embed Conversation.
2906
2963
  * @example
@@ -3003,6 +3060,15 @@ var HostEvent;
3003
3060
  * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
3004
3061
  */
3005
3062
  HostEvent["StartNewSpotterConversation"] = "StartNewSpotterConversation";
3063
+ /**
3064
+ * Get the current context of the embedded page.
3065
+ * @example
3066
+ * ```js
3067
+ * const context = await liveboardEmbed.trigger(HostEvent.GetPageContext);
3068
+ * ```
3069
+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
3070
+ */
3071
+ HostEvent["GetPageContext"] = "GetPageContext";
3006
3072
  })(HostEvent || (HostEvent = {}));
3007
3073
  /**
3008
3074
  * The different visual modes that the data sources panel within
@@ -4712,7 +4778,16 @@ var EmbedErrorCodes;
4712
4778
  EmbedErrorCodes["HOST_EVENT_TYPE_UNDEFINED"] = "HOST_EVENT_TYPE_UNDEFINED";
4713
4779
  /** Error parsing api intercept body */
4714
4780
  EmbedErrorCodes["PARSING_API_INTERCEPT_BODY_ERROR"] = "PARSING_API_INTERCEPT_BODY_ERROR";
4781
+ /** Failed to update embed parameters during pre-render */
4782
+ EmbedErrorCodes["UPDATE_PARAMS_FAILED"] = "UPDATE_PARAMS_FAILED";
4715
4783
  })(EmbedErrorCodes || (EmbedErrorCodes = {}));
4784
+ var ContextType;
4785
+ (function (ContextType) {
4786
+ ContextType["Search"] = "search-answer";
4787
+ ContextType["Liveboard"] = "liveboard";
4788
+ ContextType["Answer"] = "answer";
4789
+ ContextType["Spotter"] = "spotter";
4790
+ })(ContextType || (ContextType = {}));
4716
4791
  /**
4717
4792
  * Enum for the type of API intercepted
4718
4793
  */
@@ -4885,6 +4960,7 @@ const ERROR_MESSAGE = {
4885
4960
  LOGIN_FAILED: 'Login failed',
4886
4961
  ERROR_PARSING_API_INTERCEPT_BODY: 'Error parsing api intercept body',
4887
4962
  SSR_ENVIRONMENT_ERROR: 'SSR environment detected. This function cannot be called in SSR environment.',
4963
+ UPDATE_PARAMS_FAILED: 'Failed to update embed parameters',
4888
4964
  };
4889
4965
  const CUSTOM_ACTIONS_ERROR_MESSAGE = {
4890
4966
  INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
@@ -5010,7 +5086,8 @@ const isValidCssMargin = (value) => {
5010
5086
  logger$3.error('Please provide a valid lazyLoadingMargin value (e.g., "10px")');
5011
5087
  return false;
5012
5088
  }
5013
- // This pattern allows for an optional negative sign, and numbers that can be integers or decimals (including leading dot).
5089
+ // This pattern allows for an optional negative sign, and numbers
5090
+ // that can be integers or decimals (including leading dot).
5014
5091
  const cssUnitPattern = /^-?(\d+(\.\d*)?|\.\d+)(px|em|rem|%|vh|vw)$/i;
5015
5092
  const parts = value.trim().split(/\s+/);
5016
5093
  if (parts.length > 4) {
@@ -5350,6 +5427,12 @@ const formatTemplate = (template, values) => {
5350
5427
  return values[key] !== undefined ? String(values[key]) : match;
5351
5428
  });
5352
5429
  };
5430
+ const getHostEventsConfig = (viewConfig) => {
5431
+ return {
5432
+ shouldBypassPayloadValidation: viewConfig.shouldBypassPayloadValidation,
5433
+ useHostEventsV2: viewConfig.useHostEventsV2,
5434
+ };
5435
+ };
5353
5436
  /**
5354
5437
  * Check if the window is undefined
5355
5438
  * If the window is undefined, it means the code is running in a SSR environment.
@@ -7647,7 +7730,12 @@ var UIPassthroughEvent;
7647
7730
  UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
7648
7731
  UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
7649
7732
  UIPassthroughEvent["GetUnsavedAnswerTML"] = "getUnsavedAnswerTML";
7650
- })(UIPassthroughEvent || (UIPassthroughEvent = {}));
7733
+ })(UIPassthroughEvent || (UIPassthroughEvent = {}));
7734
+ var PageType;
7735
+ (function (PageType) {
7736
+ PageType["PAGE"] = "page";
7737
+ PageType["DIALOG"] = "dialog";
7738
+ })(PageType || (PageType = {}));
7651
7739
 
7652
7740
  const EndPoints = {
7653
7741
  AUTH_VERIFICATION: '/callosum/v1/session/info',
@@ -8546,7 +8634,7 @@ class AnswerService {
8546
8634
  async getTML() {
8547
8635
  const { object } = await this.executeQuery(getAnswerTML, {});
8548
8636
  const edoc = object[0].edoc;
8549
- const YAML = await import('./index-D0n5LIka.js');
8637
+ const YAML = await import('./index-CI6s4VMY.js');
8550
8638
  const parsedDoc = YAML.parse(edoc);
8551
8639
  return {
8552
8640
  answer: {
@@ -17434,6 +17522,7 @@ const reload = (iFrame) => {
17434
17522
  * @param message
17435
17523
  * @param message.type
17436
17524
  * @param message.data
17525
+ * @param message.context
17437
17526
  * @param thoughtSpotHost
17438
17527
  * @param channel
17439
17528
  */
@@ -17448,8 +17537,9 @@ const TRIGGER_TIMEOUT = 30000;
17448
17537
  * @param messageType
17449
17538
  * @param thoughtSpotHost
17450
17539
  * @param data
17540
+ * @param context
17451
17541
  */
17452
- function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
17542
+ function processTrigger(iFrame, messageType, thoughtSpotHost, data, context) {
17453
17543
  return new Promise((res, rej) => {
17454
17544
  var _a;
17455
17545
  if (messageType === HostEvent.Reload) {
@@ -17483,7 +17573,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
17483
17573
  channel.port1.close();
17484
17574
  res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
17485
17575
  }, TRIGGER_TIMEOUT);
17486
- return postIframeMessage(iFrame, { type: messageType, data }, thoughtSpotHost, channel);
17576
+ return postIframeMessage(iFrame, { type: messageType, data, context }, thoughtSpotHost, channel);
17487
17577
  });
17488
17578
  }
17489
17579
 
@@ -17982,7 +18072,7 @@ function processEventData(type, eventData, thoughtSpotHost, containerEl) {
17982
18072
  return eventData;
17983
18073
  }
17984
18074
 
17985
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.44.3";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={".":{"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,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};
18075
+ 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={".":{"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,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};
17986
18076
 
17987
18077
  class HostEventClient {
17988
18078
  constructor(iFrame) {
@@ -17994,16 +18084,16 @@ class HostEventClient {
17994
18084
  * @param {any} data Data to send with the host event
17995
18085
  * @returns {Promise<any>} - the response from the process trigger
17996
18086
  */
17997
- async processTrigger(message, data) {
18087
+ async processTrigger(message, data, context) {
17998
18088
  if (!this.iFrame) {
17999
18089
  throw new Error('Iframe element is not set');
18000
18090
  }
18001
18091
  const thoughtspotHost = getEmbedConfig().thoughtSpotHost;
18002
- return processTrigger(this.iFrame, message, thoughtspotHost, data);
18092
+ return processTrigger(this.iFrame, message, thoughtspotHost, data, context);
18003
18093
  }
18004
- async handleHostEventWithParam(apiName, parameters) {
18094
+ async handleHostEventWithParam(apiName, parameters, context) {
18005
18095
  var _a, _b, _c, _d;
18006
- 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];
18096
+ 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];
18007
18097
  if (!response) {
18008
18098
  const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
18009
18099
  // eslint-disable-next-line no-throw-literal
@@ -18018,8 +18108,8 @@ class HostEventClient {
18018
18108
  }
18019
18109
  return { ...response.value };
18020
18110
  }
18021
- async hostEventFallback(hostEvent, data) {
18022
- return this.processTrigger(hostEvent, data);
18111
+ async hostEventFallback(hostEvent, data, context) {
18112
+ return this.processTrigger(hostEvent, data, context);
18023
18113
  }
18024
18114
  /**
18025
18115
  * Setter for the iframe element used for host events
@@ -18028,49 +18118,49 @@ class HostEventClient {
18028
18118
  setIframeElement(iFrame) {
18029
18119
  this.iFrame = iFrame;
18030
18120
  }
18031
- async triggerUIPassthroughApi(apiName, parameters) {
18121
+ async triggerUIPassthroughApi(apiName, parameters, context) {
18032
18122
  const res = await this.processTrigger(HostEvent.UIPassthrough, {
18033
18123
  type: apiName,
18034
18124
  parameters,
18035
- });
18125
+ }, context);
18036
18126
  return res;
18037
18127
  }
18038
- async handlePinEvent(payload) {
18128
+ async handlePinEvent(payload, context) {
18039
18129
  var _a, _b;
18040
18130
  if (!payload || !('newVizName' in payload)) {
18041
- return this.hostEventFallback(HostEvent.Pin, payload);
18131
+ return this.hostEventFallback(HostEvent.Pin, payload, context);
18042
18132
  }
18043
18133
  const formattedPayload = {
18044
18134
  ...payload,
18045
18135
  pinboardId: (_a = payload.liveboardId) !== null && _a !== void 0 ? _a : payload.pinboardId,
18046
18136
  newPinboardName: (_b = payload.newLiveboardName) !== null && _b !== void 0 ? _b : payload.newPinboardName,
18047
18137
  };
18048
- const data = await this.handleHostEventWithParam(UIPassthroughEvent.PinAnswerToLiveboard, formattedPayload);
18138
+ const data = await this.handleHostEventWithParam(UIPassthroughEvent.PinAnswerToLiveboard, formattedPayload, context);
18049
18139
  return {
18050
18140
  ...data,
18051
18141
  liveboardId: data.pinboardId,
18052
18142
  };
18053
18143
  }
18054
- async handleSaveAnswerEvent(payload) {
18144
+ async handleSaveAnswerEvent(payload, context) {
18055
18145
  var _a, _b, _c, _d;
18056
18146
  if (!payload || !('name' in payload) || !('description' in payload)) {
18057
18147
  // Save is the fallback for SaveAnswer
18058
- return this.hostEventFallback(HostEvent.Save, payload);
18148
+ return this.hostEventFallback(HostEvent.Save, payload, context);
18059
18149
  }
18060
- const data = await this.handleHostEventWithParam(UIPassthroughEvent.SaveAnswer, payload);
18150
+ const data = await this.handleHostEventWithParam(UIPassthroughEvent.SaveAnswer, payload, context);
18061
18151
  return {
18062
18152
  ...data,
18063
18153
  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,
18064
18154
  };
18065
18155
  }
18066
- async triggerHostEvent(hostEvent, payload) {
18156
+ async triggerHostEvent(hostEvent, payload, context) {
18067
18157
  switch (hostEvent) {
18068
18158
  case HostEvent.Pin:
18069
- return this.handlePinEvent(payload);
18159
+ return this.handlePinEvent(payload, context);
18070
18160
  case HostEvent.SaveAnswer:
18071
- return this.handleSaveAnswerEvent(payload);
18161
+ return this.handleSaveAnswerEvent(payload, context);
18072
18162
  default:
18073
- return this.hostEventFallback(hostEvent, payload);
18163
+ return this.hostEventFallback(hostEvent, payload, context);
18074
18164
  }
18075
18165
  }
18076
18166
  }
@@ -18705,6 +18795,7 @@ class TsEmbed {
18705
18795
  hiddenListColumns: this.viewConfig.hiddenListColumns || [],
18706
18796
  customActions: customActionsResult.actions,
18707
18797
  ...getInterceptInitData(this.viewConfig),
18798
+ ...getHostEventsConfig(this.viewConfig),
18708
18799
  };
18709
18800
  return baseInitData;
18710
18801
  }
@@ -18725,9 +18816,10 @@ class TsEmbed {
18725
18816
  .join('/');
18726
18817
  return `${basePath}#`;
18727
18818
  }
18728
- getUpdateEmbedParamsObject() {
18819
+ async getUpdateEmbedParamsObject() {
18729
18820
  let queryParams = this.getEmbedParamsObject();
18730
- queryParams = { ...this.viewConfig, ...queryParams, ...this.getAppInitData() };
18821
+ const appInitData = await this.getAppInitData();
18822
+ queryParams = { ...this.viewConfig, ...queryParams, ...appInitData };
18731
18823
  return queryParams;
18732
18824
  }
18733
18825
  /**
@@ -19036,6 +19128,8 @@ class TsEmbed {
19036
19128
  preRenderWrapper.id = preRenderIds.wrapper;
19037
19129
  const initialPreRenderWrapperStyle = {
19038
19130
  position: 'absolute',
19131
+ top: '0',
19132
+ left: '0',
19039
19133
  width: '100vw',
19040
19134
  height: '100vh',
19041
19135
  };
@@ -19326,7 +19420,7 @@ class TsEmbed {
19326
19420
  * @param {any} data The payload to send with the message
19327
19421
  * @returns A promise that resolves with the response from the embedded app
19328
19422
  */
19329
- async trigger(messageType, data = {}) {
19423
+ async trigger(messageType, data = {}, context) {
19330
19424
  uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
19331
19425
  if (!this.isRendered) {
19332
19426
  this.handleError({
@@ -19353,7 +19447,7 @@ class TsEmbed {
19353
19447
  return null;
19354
19448
  }
19355
19449
  // send an empty object, this is needed for liveboard default handlers
19356
- return this.hostEventClient.triggerHostEvent(messageType, data);
19450
+ return this.hostEventClient.triggerHostEvent(messageType, data, context);
19357
19451
  }
19358
19452
  /**
19359
19453
  * Triggers an event to the embedded app, skipping the UI flow.
@@ -19386,6 +19480,19 @@ class TsEmbed {
19386
19480
  handleRenderForPrerender() {
19387
19481
  return this.render();
19388
19482
  }
19483
+ /**
19484
+ * Get the current context of the embedded TS component.
19485
+ * @returns The current context object containing the page type and object ids.
19486
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
19487
+ */
19488
+ async getCurrentContext() {
19489
+ return new Promise((resolve) => {
19490
+ this.executeAfterEmbedContainerLoaded(async () => {
19491
+ const context = await this.trigger(HostEvent.GetPageContext, {});
19492
+ resolve(context);
19493
+ });
19494
+ });
19495
+ }
19389
19496
  /**
19390
19497
  * Creates the preRender shell
19391
19498
  * @param showPreRenderByDefault - Show the preRender after render, hidden by default
@@ -19500,8 +19607,20 @@ class TsEmbed {
19500
19607
  }
19501
19608
  this.validatePreRenderViewConfig(this.viewConfig);
19502
19609
  logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
19503
- this.executeAfterEmbedContainerLoaded(() => {
19504
- this.trigger(HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
19610
+ this.executeAfterEmbedContainerLoaded(async () => {
19611
+ try {
19612
+ const params = await this.getUpdateEmbedParamsObject();
19613
+ this.trigger(HostEvent.UpdateEmbedParams, params);
19614
+ }
19615
+ catch (error) {
19616
+ logger$3.error(ERROR_MESSAGE.UPDATE_PARAMS_FAILED, error);
19617
+ this.handleError({
19618
+ errorType: ErrorDetailsTypes.API,
19619
+ message: (error === null || error === void 0 ? void 0 : error.message) || ERROR_MESSAGE.UPDATE_PARAMS_FAILED,
19620
+ code: EmbedErrorCodes.UPDATE_PARAMS_FAILED,
19621
+ error: (error === null || error === void 0 ? void 0 : error.message) || error,
19622
+ });
19623
+ }
19505
19624
  });
19506
19625
  }
19507
19626
  this.beforePrerenderVisible();
@@ -19521,7 +19640,7 @@ class TsEmbed {
19521
19640
  this.resizeObserver.observe(this.el);
19522
19641
  }
19523
19642
  }
19524
- removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
19643
+ removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events', 'overflow']);
19525
19644
  this.subscribeToEvents();
19526
19645
  // Setup fullscreen change handler for prerendered components
19527
19646
  if (this.iFrame) {
@@ -19564,7 +19683,10 @@ class TsEmbed {
19564
19683
  opacity: '0',
19565
19684
  pointerEvents: 'none',
19566
19685
  zIndex: '-1000',
19567
- position: 'absolute ',
19686
+ position: 'absolute',
19687
+ top: '0',
19688
+ left: '0',
19689
+ overflow: 'hidden',
19568
19690
  };
19569
19691
  setStyleProperties(this.preRenderWrapper, preRenderHideStyles);
19570
19692
  if (this.resizeObserver) {
@@ -20244,6 +20366,7 @@ class LiveboardEmbed extends V1Embed {
20244
20366
  super(domSelector, viewConfig);
20245
20367
  this.defaultHeight = 500;
20246
20368
  this.sendFullHeightLazyLoadData = () => {
20369
+ console.log('sendFullHeightLazyLoadData', this.iFrame);
20247
20370
  const data = calculateVisibleElementData(this.iFrame);
20248
20371
  this.trigger(HostEvent.VisibleEmbedCoordinates, data);
20249
20372
  };
@@ -20504,7 +20627,7 @@ class LiveboardEmbed extends V1Embed {
20504
20627
  * @param {any} data The payload to send with the message
20505
20628
  * @returns A promise that resolves with the response from the embedded app
20506
20629
  */
20507
- trigger(messageType, data = {}) {
20630
+ trigger(messageType, data = {}, context) {
20508
20631
  const dataWithVizId = data;
20509
20632
  if (messageType === HostEvent.SetActiveTab) {
20510
20633
  this.setActiveTab(data);
@@ -20513,7 +20636,7 @@ class LiveboardEmbed extends V1Embed {
20513
20636
  if (typeof dataWithVizId === 'object' && this.viewConfig.vizId) {
20514
20637
  dataWithVizId.vizId = this.viewConfig.vizId;
20515
20638
  }
20516
- return super.trigger(messageType, dataWithVizId);
20639
+ return super.trigger(messageType, dataWithVizId, context);
20517
20640
  }
20518
20641
  /**
20519
20642
  * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
@@ -20582,6 +20705,15 @@ class LiveboardEmbed extends V1Embed {
20582
20705
  }
20583
20706
  return url;
20584
20707
  }
20708
+ /**
20709
+ * Get the current context of the embedded liveboard.
20710
+ * @returns The current context object containing the page type and object ids.
20711
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
20712
+ */
20713
+ async getCurrentContext() {
20714
+ const context = await super.getCurrentContext();
20715
+ return context;
20716
+ }
20585
20717
  }
20586
20718
  /**
20587
20719
  * @hidden
@@ -20762,6 +20894,15 @@ class SearchEmbed extends TsEmbed {
20762
20894
  });
20763
20895
  return this;
20764
20896
  }
20897
+ /**
20898
+ * Get the current context of the embedded search.
20899
+ * @returns The current context object containing the page type and object ids.
20900
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
20901
+ */
20902
+ async getCurrentContext() {
20903
+ const context = await super.getCurrentContext();
20904
+ return context;
20905
+ }
20765
20906
  }
20766
20907
 
20767
20908
  /**
@@ -20837,6 +20978,15 @@ class SearchBarEmbed extends TsEmbed {
20837
20978
  const defaultAppInitData = await super.getAppInitData();
20838
20979
  return { ...defaultAppInitData, ...this.getSearchInitData() };
20839
20980
  }
20981
+ /**
20982
+ * Get the current context of the embedded search bar.
20983
+ * @returns The current context object containing the page type and object ids.
20984
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
20985
+ */
20986
+ async getCurrentContext() {
20987
+ const context = await super.getCurrentContext();
20988
+ return context;
20989
+ }
20840
20990
  }
20841
20991
 
20842
20992
  const createConversation = `
@@ -21466,6 +21616,15 @@ class SpotterEmbed extends TsEmbed {
21466
21616
  await this.renderIFrame(src);
21467
21617
  return this;
21468
21618
  }
21619
+ /**
21620
+ * Get the current context of the embedded SpotterEmbed.
21621
+ * @returns The current context object containing the page type and object ids.
21622
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
21623
+ */
21624
+ async getCurrentContext() {
21625
+ const context = await super.getCurrentContext();
21626
+ return context;
21627
+ }
21469
21628
  }
21470
21629
  /**
21471
21630
  * Embed ThoughtSpot AI Conversation.
@@ -21572,6 +21731,15 @@ class SageEmbed extends V1Embed {
21572
21731
  await this.renderV1Embed(src);
21573
21732
  return this;
21574
21733
  }
21734
+ /**
21735
+ * Get the current context of the embedded SageEmbed.
21736
+ * @returns The current context object containing the page type and object ids.
21737
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
21738
+ */
21739
+ async getCurrentContext() {
21740
+ const context = await super.getCurrentContext();
21741
+ return context;
21742
+ }
21575
21743
  }
21576
21744
 
21577
21745
  const getAnswerSessionFromQuery = `
@@ -22096,4 +22264,4 @@ const createLiveboardWithAnswers = async (answers, name) => {
22096
22264
  return result;
22097
22265
  };
22098
22266
 
22099
- export { Action, AnswerService, AppEmbed, AuthEvent, AuthFailureType, AuthStatus, AuthType, BodylessConversation, ContextMenuTriggerOptions, ConversationEmbed, CustomActionTarget, CustomActionsPosition, DataPanelCustomColumnGroupsAccordionState$1 as DataPanelCustomColumnGroupsAccordionState, DataSourceVisualMode, EmbedEvent, HomeLeftNavItem, HomePage, HomePageSearchBarMode, HomepageModule, HostEvent, InterceptedApiType, ListPage, ListPageColumns, LiveboardEmbed, LogLevel, MIXPANEL_EVENT, Page, PinboardEmbed, PrefetchFeatures, PrimaryNavbarVersion, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, SpotterAgentEmbed, SpotterEmbed, UIPassthroughEvent, createLiveboardWithAnswers, executeTML, exportTML, getAnswerFromQuery, getEmbedConfig as getInitConfig, getSessionInfo, init, logout, prefetch, reloadIframe, resetCachedAuthToken, tokenizedFetch, uploadMixpanelEvent };
22267
+ export { Action, AnswerService, AppEmbed, AuthEvent, AuthFailureType, AuthStatus, AuthType, BodylessConversation, ContextMenuTriggerOptions, ContextType, ConversationEmbed, CustomActionTarget, CustomActionsPosition, DataPanelCustomColumnGroupsAccordionState$1 as DataPanelCustomColumnGroupsAccordionState, DataSourceVisualMode, EmbedErrorCodes, EmbedEvent, ErrorDetailsTypes, HomeLeftNavItem, HomePage, HomePageSearchBarMode, HomepageModule, HostEvent, InterceptedApiType, ListPage, ListPageColumns, LiveboardEmbed, LogLevel, MIXPANEL_EVENT, Page, PinboardEmbed, PrefetchFeatures, PrimaryNavbarVersion, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, SpotterAgentEmbed, SpotterEmbed, UIPassthroughEvent, createLiveboardWithAnswers, executeTML, exportTML, getAnswerFromQuery, getEmbedConfig as getInitConfig, getSessionInfo, init, logout, prefetch, reloadIframe, resetCachedAuthToken, tokenizedFetch, uploadMixpanelEvent };