@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
  import * as React from 'react';
4
4
  import React__default, { useRef, useCallback } from 'react';
@@ -350,57 +350,71 @@ var AuthType;
350
350
  })(AuthType || (AuthType = {}));
351
351
  /**
352
352
  *
353
- * This option does not apply to the classic homepage experience.
354
- * To access the updated modular homepage,
355
- * set `modularHomeExperience` to `true`
356
- * (available as Early Access feature in 9.12.5.cl).
353
+ * **Note**: This attribute is not supported in the classic (V1) homepage experience.
357
354
  *
358
355
  */
359
356
  var HomeLeftNavItem;
360
357
  (function (HomeLeftNavItem) {
361
358
  /**
359
+ * The *Search data* option in
360
+ * the *Insights* left navigation panel.
362
361
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
363
362
  */
364
363
  HomeLeftNavItem["SearchData"] = "search-data";
365
364
  /**
365
+ * The *Home* menu option in
366
+ * the *Insights* left navigation panel.
366
367
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
367
368
  */
368
369
  HomeLeftNavItem["Home"] = "insights-home";
369
370
  /**
371
+ * The *Liveboards* menu option in
372
+ * the *Insights* left navigation panel.
370
373
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
371
374
  */
372
375
  HomeLeftNavItem["Liveboards"] = "liveboards";
373
376
  /**
377
+ * The *Answers* menu option in
378
+ * the *Insights* left navigation panel.
374
379
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
375
380
  */
376
381
  HomeLeftNavItem["Answers"] = "answers";
377
382
  /**
383
+ * The *Monitor subscriptions* menu option in
384
+ * the *Insights* left navigation panel.
378
385
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
379
386
  */
380
387
  HomeLeftNavItem["MonitorSubscription"] = "monitor-alerts";
381
388
  /**
389
+ * The *SpotIQ analysis* menu option in
390
+ * the *Insights* left navigation panel.
382
391
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
383
392
  */
384
393
  HomeLeftNavItem["SpotIQAnalysis"] = "spotiq-analysis";
385
394
  /**
395
+ * The *Liveboard schedules* menu option in
396
+ * the *Insights* left navigation panel.
386
397
  * @version SDK: 1.34.0| ThoughtSpot: 10.3.0.cl
387
398
  */
388
399
  HomeLeftNavItem["LiveboardSchedules"] = "liveboard-schedules";
389
400
  /**
390
- * Create new options in the insights left navigation,
391
- * available when new navigation V3 is enabled.
401
+ * The create option in the *Insights*
402
+ * left navigation panel.
403
+ * Available in the V3 navigation experience.
392
404
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
393
405
  */
394
406
  HomeLeftNavItem["Create"] = "create";
395
407
  /**
396
- * Spotter option in the insights left navigation,
397
- * available when new navigation V3 is enabled.
408
+ * The *Spotter* menu option in the *Insights*
409
+ * left navigation panel.
410
+ * Available in the V3 navigation experience.
398
411
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
399
412
  */
400
413
  HomeLeftNavItem["Spotter"] = "spotter";
401
414
  /**
402
- * Favorites option in the insights left navigation,
403
- * available when new navigation V3 is enabled.
415
+ * The *Favorites* section in the *Insights*
416
+ * left navigation panel.
417
+ * Available in the V3 navigation experience.
404
418
  * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
405
419
  */
406
420
  HomeLeftNavItem["Favorites"] = "favorites";
@@ -472,10 +486,11 @@ var RuntimeFilterOp;
472
486
  RuntimeFilterOp["NOT_IN"] = "NOT_IN";
473
487
  })(RuntimeFilterOp || (RuntimeFilterOp = {}));
474
488
  /**
475
- * Home page module that can be hidden.
476
- * **Note**: This option does not apply to the classic homepage.
477
- * To access the updated modular homepage, set
478
- * `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
489
+ * Home page modules that can be hidden
490
+ * via `hiddenHomepageModules` and reordered via
491
+ * `reorderedHomepageModules`.
492
+ *
493
+ * **Note**: This option is not supported in the classic (v1) experience.
479
494
  * @version SDK: 1.28.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw
480
495
  */
481
496
  var HomepageModule;
@@ -489,7 +504,7 @@ var HomepageModule;
489
504
  */
490
505
  HomepageModule["Watchlist"] = "WATCHLIST";
491
506
  /**
492
- * favorite objects
507
+ * Favorite module
493
508
  */
494
509
  HomepageModule["Favorite"] = "FAVORITE";
495
510
  /**
@@ -1645,6 +1660,28 @@ var EmbedEvent;
1645
1660
  * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1646
1661
  */
1647
1662
  EmbedEvent["PreviewSpotterData"] = "PreviewSpotterData";
1663
+ /**
1664
+ * Emitted when user opens up the Add to Coaching modal on any visualization in Spotter Embed.
1665
+ * @example
1666
+ * ```js
1667
+ * spotterEmbed.on(EmbedEvent.AddToCoaching, (payload) => {
1668
+ * console.log('payload', payload);
1669
+ * })
1670
+ *```
1671
+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
1672
+ */
1673
+ EmbedEvent["AddToCoaching"] = "addToCoaching";
1674
+ /**
1675
+ * Emitted when user opens up the data model instructions modal in Spotter embed.
1676
+ * @example
1677
+ * ```js
1678
+ * spotterEmbed.on(EmbedEvent.DataModelInstructions, (payload) => {
1679
+ * console.log('payload', payload);
1680
+ * })
1681
+ * ```
1682
+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
1683
+ */
1684
+ EmbedEvent["DataModelInstructions"] = "DataModelInstructions";
1648
1685
  /**
1649
1686
  * Emitted when the Spotter query is triggered in Spotter embed.
1650
1687
  * @example
@@ -3069,6 +3106,26 @@ var HostEvent;
3069
3106
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
3070
3107
  */
3071
3108
  HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
3109
+ /**
3110
+ * Opens the Add to Coaching modal from a visualization in Spotter Embed.
3111
+ * @param - `vizId ` refers to the Visualization ID in Spotter embed and is required.
3112
+ * @example
3113
+ * ```js
3114
+ * spotterEmbed.trigger(HostEvent.AddToCoaching, { vizId: '730496d6-6903-4601-937e-2c691821af3c' });
3115
+ *
3116
+ *```
3117
+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
3118
+ */
3119
+ HostEvent["AddToCoaching"] = "addToCoaching";
3120
+ /**
3121
+ * Opens the data model instructions modal in Spotter Embed.
3122
+ * @example
3123
+ * ```js
3124
+ * spotterEmbed.trigger(HostEvent.DataModelInstructions);
3125
+ * ```
3126
+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
3127
+ */
3128
+ HostEvent["DataModelInstructions"] = "DataModelInstructions";
3072
3129
  /**
3073
3130
  * Resets the Spotter Embed Conversation.
3074
3131
  * @example
@@ -3171,6 +3228,15 @@ var HostEvent;
3171
3228
  * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
3172
3229
  */
3173
3230
  HostEvent["StartNewSpotterConversation"] = "StartNewSpotterConversation";
3231
+ /**
3232
+ * Get the current context of the embedded page.
3233
+ * @example
3234
+ * ```js
3235
+ * const context = await liveboardEmbed.trigger(HostEvent.GetPageContext);
3236
+ * ```
3237
+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
3238
+ */
3239
+ HostEvent["GetPageContext"] = "GetPageContext";
3174
3240
  })(HostEvent || (HostEvent = {}));
3175
3241
  /**
3176
3242
  * The different visual modes that the data sources panel within
@@ -4880,7 +4946,16 @@ var EmbedErrorCodes;
4880
4946
  EmbedErrorCodes["HOST_EVENT_TYPE_UNDEFINED"] = "HOST_EVENT_TYPE_UNDEFINED";
4881
4947
  /** Error parsing api intercept body */
4882
4948
  EmbedErrorCodes["PARSING_API_INTERCEPT_BODY_ERROR"] = "PARSING_API_INTERCEPT_BODY_ERROR";
4949
+ /** Failed to update embed parameters during pre-render */
4950
+ EmbedErrorCodes["UPDATE_PARAMS_FAILED"] = "UPDATE_PARAMS_FAILED";
4883
4951
  })(EmbedErrorCodes || (EmbedErrorCodes = {}));
4952
+ var ContextType;
4953
+ (function (ContextType) {
4954
+ ContextType["Search"] = "search-answer";
4955
+ ContextType["Liveboard"] = "liveboard";
4956
+ ContextType["Answer"] = "answer";
4957
+ ContextType["Spotter"] = "spotter";
4958
+ })(ContextType || (ContextType = {}));
4884
4959
  /**
4885
4960
  * Enum for the type of API intercepted
4886
4961
  */
@@ -5000,6 +5075,7 @@ const ERROR_MESSAGE = {
5000
5075
  LOGIN_FAILED: 'Login failed',
5001
5076
  ERROR_PARSING_API_INTERCEPT_BODY: 'Error parsing api intercept body',
5002
5077
  SSR_ENVIRONMENT_ERROR: 'SSR environment detected. This function cannot be called in SSR environment.',
5078
+ UPDATE_PARAMS_FAILED: 'Failed to update embed parameters',
5003
5079
  };
5004
5080
  const CUSTOM_ACTIONS_ERROR_MESSAGE = {
5005
5081
  INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
@@ -5125,7 +5201,8 @@ const isValidCssMargin = (value) => {
5125
5201
  logger$3.error('Please provide a valid lazyLoadingMargin value (e.g., "10px")');
5126
5202
  return false;
5127
5203
  }
5128
- // This pattern allows for an optional negative sign, and numbers that can be integers or decimals (including leading dot).
5204
+ // This pattern allows for an optional negative sign, and numbers
5205
+ // that can be integers or decimals (including leading dot).
5129
5206
  const cssUnitPattern = /^-?(\d+(\.\d*)?|\.\d+)(px|em|rem|%|vh|vw)$/i;
5130
5207
  const parts = value.trim().split(/\s+/);
5131
5208
  if (parts.length > 4) {
@@ -5465,6 +5542,12 @@ const formatTemplate = (template, values) => {
5465
5542
  return values[key] !== undefined ? String(values[key]) : match;
5466
5543
  });
5467
5544
  };
5545
+ const getHostEventsConfig = (viewConfig) => {
5546
+ return {
5547
+ shouldBypassPayloadValidation: viewConfig.shouldBypassPayloadValidation,
5548
+ useHostEventsV2: viewConfig.useHostEventsV2,
5549
+ };
5550
+ };
5468
5551
  /**
5469
5552
  * Check if the window is undefined
5470
5553
  * If the window is undefined, it means the code is running in a SSR environment.
@@ -7762,7 +7845,12 @@ var UIPassthroughEvent;
7762
7845
  UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
7763
7846
  UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
7764
7847
  UIPassthroughEvent["GetUnsavedAnswerTML"] = "getUnsavedAnswerTML";
7765
- })(UIPassthroughEvent || (UIPassthroughEvent = {}));
7848
+ })(UIPassthroughEvent || (UIPassthroughEvent = {}));
7849
+ var PageType;
7850
+ (function (PageType) {
7851
+ PageType["PAGE"] = "page";
7852
+ PageType["DIALOG"] = "dialog";
7853
+ })(PageType || (PageType = {}));
7766
7854
 
7767
7855
  const EndPoints = {
7768
7856
  AUTH_VERIFICATION: '/callosum/v1/session/info',
@@ -8661,7 +8749,7 @@ class AnswerService {
8661
8749
  async getTML() {
8662
8750
  const { object } = await this.executeQuery(getAnswerTML, {});
8663
8751
  const edoc = object[0].edoc;
8664
- const YAML = await import('./index-D0n5LIka.js');
8752
+ const YAML = await import('./index-CI6s4VMY.js');
8665
8753
  const parsedDoc = YAML.parse(edoc);
8666
8754
  return {
8667
8755
  answer: {
@@ -17523,6 +17611,7 @@ const reload = (iFrame) => {
17523
17611
  * @param message
17524
17612
  * @param message.type
17525
17613
  * @param message.data
17614
+ * @param message.context
17526
17615
  * @param thoughtSpotHost
17527
17616
  * @param channel
17528
17617
  */
@@ -17537,8 +17626,9 @@ const TRIGGER_TIMEOUT = 30000;
17537
17626
  * @param messageType
17538
17627
  * @param thoughtSpotHost
17539
17628
  * @param data
17629
+ * @param context
17540
17630
  */
17541
- function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
17631
+ function processTrigger(iFrame, messageType, thoughtSpotHost, data, context) {
17542
17632
  return new Promise((res, rej) => {
17543
17633
  var _a;
17544
17634
  if (messageType === HostEvent.Reload) {
@@ -17572,7 +17662,7 @@ function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
17572
17662
  channel.port1.close();
17573
17663
  res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
17574
17664
  }, TRIGGER_TIMEOUT);
17575
- return postIframeMessage(iFrame, { type: messageType, data }, thoughtSpotHost, channel);
17665
+ return postIframeMessage(iFrame, { type: messageType, data, context }, thoughtSpotHost, channel);
17576
17666
  });
17577
17667
  }
17578
17668
 
@@ -17918,7 +18008,7 @@ function processEventData(type, eventData, thoughtSpotHost, containerEl) {
17918
18008
  return eventData;
17919
18009
  }
17920
18010
 
17921
- 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};
18011
+ 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};
17922
18012
 
17923
18013
  class HostEventClient {
17924
18014
  constructor(iFrame) {
@@ -17930,16 +18020,16 @@ class HostEventClient {
17930
18020
  * @param {any} data Data to send with the host event
17931
18021
  * @returns {Promise<any>} - the response from the process trigger
17932
18022
  */
17933
- async processTrigger(message, data) {
18023
+ async processTrigger(message, data, context) {
17934
18024
  if (!this.iFrame) {
17935
18025
  throw new Error('Iframe element is not set');
17936
18026
  }
17937
18027
  const thoughtspotHost = getEmbedConfig().thoughtSpotHost;
17938
- return processTrigger(this.iFrame, message, thoughtspotHost, data);
18028
+ return processTrigger(this.iFrame, message, thoughtspotHost, data, context);
17939
18029
  }
17940
- async handleHostEventWithParam(apiName, parameters) {
18030
+ async handleHostEventWithParam(apiName, parameters, context) {
17941
18031
  var _a, _b, _c, _d;
17942
- 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];
18032
+ 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];
17943
18033
  if (!response) {
17944
18034
  const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
17945
18035
  // eslint-disable-next-line no-throw-literal
@@ -17954,8 +18044,8 @@ class HostEventClient {
17954
18044
  }
17955
18045
  return { ...response.value };
17956
18046
  }
17957
- async hostEventFallback(hostEvent, data) {
17958
- return this.processTrigger(hostEvent, data);
18047
+ async hostEventFallback(hostEvent, data, context) {
18048
+ return this.processTrigger(hostEvent, data, context);
17959
18049
  }
17960
18050
  /**
17961
18051
  * Setter for the iframe element used for host events
@@ -17964,49 +18054,49 @@ class HostEventClient {
17964
18054
  setIframeElement(iFrame) {
17965
18055
  this.iFrame = iFrame;
17966
18056
  }
17967
- async triggerUIPassthroughApi(apiName, parameters) {
18057
+ async triggerUIPassthroughApi(apiName, parameters, context) {
17968
18058
  const res = await this.processTrigger(HostEvent.UIPassthrough, {
17969
18059
  type: apiName,
17970
18060
  parameters,
17971
- });
18061
+ }, context);
17972
18062
  return res;
17973
18063
  }
17974
- async handlePinEvent(payload) {
18064
+ async handlePinEvent(payload, context) {
17975
18065
  var _a, _b;
17976
18066
  if (!payload || !('newVizName' in payload)) {
17977
- return this.hostEventFallback(HostEvent.Pin, payload);
18067
+ return this.hostEventFallback(HostEvent.Pin, payload, context);
17978
18068
  }
17979
18069
  const formattedPayload = {
17980
18070
  ...payload,
17981
18071
  pinboardId: (_a = payload.liveboardId) !== null && _a !== void 0 ? _a : payload.pinboardId,
17982
18072
  newPinboardName: (_b = payload.newLiveboardName) !== null && _b !== void 0 ? _b : payload.newPinboardName,
17983
18073
  };
17984
- const data = await this.handleHostEventWithParam(UIPassthroughEvent.PinAnswerToLiveboard, formattedPayload);
18074
+ const data = await this.handleHostEventWithParam(UIPassthroughEvent.PinAnswerToLiveboard, formattedPayload, context);
17985
18075
  return {
17986
18076
  ...data,
17987
18077
  liveboardId: data.pinboardId,
17988
18078
  };
17989
18079
  }
17990
- async handleSaveAnswerEvent(payload) {
18080
+ async handleSaveAnswerEvent(payload, context) {
17991
18081
  var _a, _b, _c, _d;
17992
18082
  if (!payload || !('name' in payload) || !('description' in payload)) {
17993
18083
  // Save is the fallback for SaveAnswer
17994
- return this.hostEventFallback(HostEvent.Save, payload);
18084
+ return this.hostEventFallback(HostEvent.Save, payload, context);
17995
18085
  }
17996
- const data = await this.handleHostEventWithParam(UIPassthroughEvent.SaveAnswer, payload);
18086
+ const data = await this.handleHostEventWithParam(UIPassthroughEvent.SaveAnswer, payload, context);
17997
18087
  return {
17998
18088
  ...data,
17999
18089
  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,
18000
18090
  };
18001
18091
  }
18002
- async triggerHostEvent(hostEvent, payload) {
18092
+ async triggerHostEvent(hostEvent, payload, context) {
18003
18093
  switch (hostEvent) {
18004
18094
  case HostEvent.Pin:
18005
- return this.handlePinEvent(payload);
18095
+ return this.handlePinEvent(payload, context);
18006
18096
  case HostEvent.SaveAnswer:
18007
- return this.handleSaveAnswerEvent(payload);
18097
+ return this.handleSaveAnswerEvent(payload, context);
18008
18098
  default:
18009
- return this.hostEventFallback(hostEvent, payload);
18099
+ return this.hostEventFallback(hostEvent, payload, context);
18010
18100
  }
18011
18101
  }
18012
18102
  }
@@ -18641,6 +18731,7 @@ class TsEmbed {
18641
18731
  hiddenListColumns: this.viewConfig.hiddenListColumns || [],
18642
18732
  customActions: customActionsResult.actions,
18643
18733
  ...getInterceptInitData(this.viewConfig),
18734
+ ...getHostEventsConfig(this.viewConfig),
18644
18735
  };
18645
18736
  return baseInitData;
18646
18737
  }
@@ -18661,9 +18752,10 @@ class TsEmbed {
18661
18752
  .join('/');
18662
18753
  return `${basePath}#`;
18663
18754
  }
18664
- getUpdateEmbedParamsObject() {
18755
+ async getUpdateEmbedParamsObject() {
18665
18756
  let queryParams = this.getEmbedParamsObject();
18666
- queryParams = { ...this.viewConfig, ...queryParams, ...this.getAppInitData() };
18757
+ const appInitData = await this.getAppInitData();
18758
+ queryParams = { ...this.viewConfig, ...queryParams, ...appInitData };
18667
18759
  return queryParams;
18668
18760
  }
18669
18761
  /**
@@ -18972,6 +19064,8 @@ class TsEmbed {
18972
19064
  preRenderWrapper.id = preRenderIds.wrapper;
18973
19065
  const initialPreRenderWrapperStyle = {
18974
19066
  position: 'absolute',
19067
+ top: '0',
19068
+ left: '0',
18975
19069
  width: '100vw',
18976
19070
  height: '100vh',
18977
19071
  };
@@ -19262,7 +19356,7 @@ class TsEmbed {
19262
19356
  * @param {any} data The payload to send with the message
19263
19357
  * @returns A promise that resolves with the response from the embedded app
19264
19358
  */
19265
- async trigger(messageType, data = {}) {
19359
+ async trigger(messageType, data = {}, context) {
19266
19360
  uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
19267
19361
  if (!this.isRendered) {
19268
19362
  this.handleError({
@@ -19289,7 +19383,7 @@ class TsEmbed {
19289
19383
  return null;
19290
19384
  }
19291
19385
  // send an empty object, this is needed for liveboard default handlers
19292
- return this.hostEventClient.triggerHostEvent(messageType, data);
19386
+ return this.hostEventClient.triggerHostEvent(messageType, data, context);
19293
19387
  }
19294
19388
  /**
19295
19389
  * Triggers an event to the embedded app, skipping the UI flow.
@@ -19322,6 +19416,19 @@ class TsEmbed {
19322
19416
  handleRenderForPrerender() {
19323
19417
  return this.render();
19324
19418
  }
19419
+ /**
19420
+ * Get the current context of the embedded TS component.
19421
+ * @returns The current context object containing the page type and object ids.
19422
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
19423
+ */
19424
+ async getCurrentContext() {
19425
+ return new Promise((resolve) => {
19426
+ this.executeAfterEmbedContainerLoaded(async () => {
19427
+ const context = await this.trigger(HostEvent.GetPageContext, {});
19428
+ resolve(context);
19429
+ });
19430
+ });
19431
+ }
19325
19432
  /**
19326
19433
  * Creates the preRender shell
19327
19434
  * @param showPreRenderByDefault - Show the preRender after render, hidden by default
@@ -19436,8 +19543,20 @@ class TsEmbed {
19436
19543
  }
19437
19544
  this.validatePreRenderViewConfig(this.viewConfig);
19438
19545
  logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
19439
- this.executeAfterEmbedContainerLoaded(() => {
19440
- this.trigger(HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
19546
+ this.executeAfterEmbedContainerLoaded(async () => {
19547
+ try {
19548
+ const params = await this.getUpdateEmbedParamsObject();
19549
+ this.trigger(HostEvent.UpdateEmbedParams, params);
19550
+ }
19551
+ catch (error) {
19552
+ logger$3.error(ERROR_MESSAGE.UPDATE_PARAMS_FAILED, error);
19553
+ this.handleError({
19554
+ errorType: ErrorDetailsTypes.API,
19555
+ message: (error === null || error === void 0 ? void 0 : error.message) || ERROR_MESSAGE.UPDATE_PARAMS_FAILED,
19556
+ code: EmbedErrorCodes.UPDATE_PARAMS_FAILED,
19557
+ error: (error === null || error === void 0 ? void 0 : error.message) || error,
19558
+ });
19559
+ }
19441
19560
  });
19442
19561
  }
19443
19562
  this.beforePrerenderVisible();
@@ -19457,7 +19576,7 @@ class TsEmbed {
19457
19576
  this.resizeObserver.observe(this.el);
19458
19577
  }
19459
19578
  }
19460
- removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
19579
+ removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events', 'overflow']);
19461
19580
  this.subscribeToEvents();
19462
19581
  // Setup fullscreen change handler for prerendered components
19463
19582
  if (this.iFrame) {
@@ -19500,7 +19619,10 @@ class TsEmbed {
19500
19619
  opacity: '0',
19501
19620
  pointerEvents: 'none',
19502
19621
  zIndex: '-1000',
19503
- position: 'absolute ',
19622
+ position: 'absolute',
19623
+ top: '0',
19624
+ left: '0',
19625
+ overflow: 'hidden',
19504
19626
  };
19505
19627
  setStyleProperties(this.preRenderWrapper, preRenderHideStyles);
19506
19628
  if (this.resizeObserver) {
@@ -19707,6 +19829,15 @@ let SearchBarEmbed$1 = class SearchBarEmbed extends TsEmbed {
19707
19829
  const defaultAppInitData = await super.getAppInitData();
19708
19830
  return { ...defaultAppInitData, ...this.getSearchInitData() };
19709
19831
  }
19832
+ /**
19833
+ * Get the current context of the embedded search bar.
19834
+ * @returns The current context object containing the page type and object ids.
19835
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
19836
+ */
19837
+ async getCurrentContext() {
19838
+ const context = await super.getCurrentContext();
19839
+ return context;
19840
+ }
19710
19841
  };
19711
19842
 
19712
19843
  /**
@@ -19789,6 +19920,15 @@ let SageEmbed$1 = class SageEmbed extends V1Embed {
19789
19920
  await this.renderV1Embed(src);
19790
19921
  return this;
19791
19922
  }
19923
+ /**
19924
+ * Get the current context of the embedded SageEmbed.
19925
+ * @returns The current context object containing the page type and object ids.
19926
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
19927
+ */
19928
+ async getCurrentContext() {
19929
+ const context = await super.getCurrentContext();
19930
+ return context;
19931
+ }
19792
19932
  };
19793
19933
 
19794
19934
  /**
@@ -19964,6 +20104,15 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
19964
20104
  });
19965
20105
  return this;
19966
20106
  }
20107
+ /**
20108
+ * Get the current context of the embedded search.
20109
+ * @returns The current context object containing the page type and object ids.
20110
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
20111
+ */
20112
+ async getCurrentContext() {
20113
+ const context = await super.getCurrentContext();
20114
+ return context;
20115
+ }
19967
20116
  };
19968
20117
 
19969
20118
  /**
@@ -20512,6 +20661,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
20512
20661
  super(domSelector, viewConfig);
20513
20662
  this.defaultHeight = 500;
20514
20663
  this.sendFullHeightLazyLoadData = () => {
20664
+ console.log('sendFullHeightLazyLoadData', this.iFrame);
20515
20665
  const data = calculateVisibleElementData(this.iFrame);
20516
20666
  this.trigger(HostEvent.VisibleEmbedCoordinates, data);
20517
20667
  };
@@ -20772,7 +20922,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
20772
20922
  * @param {any} data The payload to send with the message
20773
20923
  * @returns A promise that resolves with the response from the embedded app
20774
20924
  */
20775
- trigger(messageType, data = {}) {
20925
+ trigger(messageType, data = {}, context) {
20776
20926
  const dataWithVizId = data;
20777
20927
  if (messageType === HostEvent.SetActiveTab) {
20778
20928
  this.setActiveTab(data);
@@ -20781,7 +20931,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
20781
20931
  if (typeof dataWithVizId === 'object' && this.viewConfig.vizId) {
20782
20932
  dataWithVizId.vizId = this.viewConfig.vizId;
20783
20933
  }
20784
- return super.trigger(messageType, dataWithVizId);
20934
+ return super.trigger(messageType, dataWithVizId, context);
20785
20935
  }
20786
20936
  /**
20787
20937
  * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
@@ -20850,6 +21000,15 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
20850
21000
  }
20851
21001
  return url;
20852
21002
  }
21003
+ /**
21004
+ * Get the current context of the embedded liveboard.
21005
+ * @returns The current context object containing the page type and object ids.
21006
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
21007
+ */
21008
+ async getCurrentContext() {
21009
+ const context = await super.getCurrentContext();
21010
+ return context;
21011
+ }
20853
21012
  };
20854
21013
 
20855
21014
  const createConversation = `
@@ -21474,6 +21633,15 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
21474
21633
  await this.renderIFrame(src);
21475
21634
  return this;
21476
21635
  }
21636
+ /**
21637
+ * Get the current context of the embedded SpotterEmbed.
21638
+ * @returns The current context object containing the page type and object ids.
21639
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
21640
+ */
21641
+ async getCurrentContext() {
21642
+ const context = await super.getCurrentContext();
21643
+ return context;
21644
+ }
21477
21645
  };
21478
21646
  /**
21479
21647
  * Embed ThoughtSpot AI Conversation.