@thoughtspot/visual-embed-sdk 1.44.2 → 1.44.4-HE-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/README.md +1 -1
  2. package/cjs/package.json +1 -1
  3. package/cjs/src/embed/app.d.ts +44 -32
  4. package/cjs/src/embed/app.d.ts.map +1 -1
  5. package/cjs/src/embed/app.js.map +1 -1
  6. package/cjs/src/embed/base.d.ts +1 -1
  7. package/cjs/src/embed/base.d.ts.map +1 -1
  8. package/cjs/src/embed/base.js +4 -0
  9. package/cjs/src/embed/base.js.map +1 -1
  10. package/cjs/src/embed/base.spec.js +60 -0
  11. package/cjs/src/embed/base.spec.js.map +1 -1
  12. package/cjs/src/embed/conversation.d.ts +7 -0
  13. package/cjs/src/embed/conversation.d.ts.map +1 -1
  14. package/cjs/src/embed/conversation.js +9 -0
  15. package/cjs/src/embed/conversation.js.map +1 -1
  16. package/cjs/src/embed/hostEventClient/contracts.d.ts +20 -3
  17. package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  18. package/cjs/src/embed/hostEventClient/contracts.js +6 -1
  19. package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
  20. package/cjs/src/embed/hostEventClient/host-event-client.d.ts +8 -8
  21. package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  22. package/cjs/src/embed/hostEventClient/host-event-client.js +18 -18
  23. package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
  24. package/cjs/src/embed/hostEventClient/host-event-client.spec.js +7 -7
  25. package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  26. package/cjs/src/embed/liveboard.d.ts +10 -4
  27. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  28. package/cjs/src/embed/liveboard.js +12 -2
  29. package/cjs/src/embed/liveboard.js.map +1 -1
  30. package/cjs/src/embed/liveboard.spec.js +1 -1
  31. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  32. package/cjs/src/embed/sage.d.ts +7 -0
  33. package/cjs/src/embed/sage.d.ts.map +1 -1
  34. package/cjs/src/embed/sage.js +9 -0
  35. package/cjs/src/embed/sage.js.map +1 -1
  36. package/cjs/src/embed/search-bar.d.ts +7 -0
  37. package/cjs/src/embed/search-bar.d.ts.map +1 -1
  38. package/cjs/src/embed/search-bar.js +9 -0
  39. package/cjs/src/embed/search-bar.js.map +1 -1
  40. package/cjs/src/embed/search.d.ts +7 -0
  41. package/cjs/src/embed/search.d.ts.map +1 -1
  42. package/cjs/src/embed/search.js +9 -0
  43. package/cjs/src/embed/search.js.map +1 -1
  44. package/cjs/src/embed/ts-embed.d.ts +9 -3
  45. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  46. package/cjs/src/embed/ts-embed.js +41 -8
  47. package/cjs/src/embed/ts-embed.js.map +1 -1
  48. package/cjs/src/embed/ts-embed.spec.js +156 -24
  49. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  50. package/cjs/src/errors.d.ts +2 -0
  51. package/cjs/src/errors.d.ts.map +1 -1
  52. package/cjs/src/errors.js +2 -0
  53. package/cjs/src/errors.js.map +1 -1
  54. package/cjs/src/index.d.ts +2 -2
  55. package/cjs/src/index.d.ts.map +1 -1
  56. package/cjs/src/index.js +5 -1
  57. package/cjs/src/index.js.map +1 -1
  58. package/cjs/src/types.d.ts +142 -45
  59. package/cjs/src/types.d.ts.map +1 -1
  60. package/cjs/src/types.js +91 -16
  61. package/cjs/src/types.js.map +1 -1
  62. package/cjs/src/utils/logger.spec.d.ts +20 -5
  63. package/cjs/src/utils/logger.spec.d.ts.map +1 -1
  64. package/cjs/src/utils/processTrigger.d.ts +3 -2
  65. package/cjs/src/utils/processTrigger.d.ts.map +1 -1
  66. package/cjs/src/utils/processTrigger.js +4 -2
  67. package/cjs/src/utils/processTrigger.js.map +1 -1
  68. package/cjs/src/utils.d.ts +15 -4
  69. package/cjs/src/utils.d.ts.map +1 -1
  70. package/cjs/src/utils.js +38 -6
  71. package/cjs/src/utils.js.map +1 -1
  72. package/cjs/src/utils.spec.js +53 -0
  73. package/cjs/src/utils.spec.js.map +1 -1
  74. package/dist/index-BFdRRz03.js +7371 -0
  75. package/dist/index-BUfrYJ3w.js +7371 -0
  76. package/dist/index-CI6s4VMY.js +7371 -0
  77. package/dist/{index-CSFjfTVk.js → index-CWQnMX2L.js} +1 -1
  78. package/dist/index-CaW-1mu5.js +7371 -0
  79. package/dist/index-CcSgNJVi.js +7371 -0
  80. package/dist/index-Djtv-y7A.js +7371 -0
  81. package/dist/index-UY-4yjBN.js +7371 -0
  82. package/dist/src/embed/app.d.ts +44 -32
  83. package/dist/src/embed/app.d.ts.map +1 -1
  84. package/dist/src/embed/base.d.ts +1 -1
  85. package/dist/src/embed/base.d.ts.map +1 -1
  86. package/dist/src/embed/conversation.d.ts +7 -0
  87. package/dist/src/embed/conversation.d.ts.map +1 -1
  88. package/dist/src/embed/hostEventClient/contracts.d.ts +20 -3
  89. package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  90. package/dist/src/embed/hostEventClient/host-event-client.d.ts +8 -8
  91. package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  92. package/dist/src/embed/liveboard.d.ts +10 -4
  93. package/dist/src/embed/liveboard.d.ts.map +1 -1
  94. package/dist/src/embed/sage.d.ts +7 -0
  95. package/dist/src/embed/sage.d.ts.map +1 -1
  96. package/dist/src/embed/search-bar.d.ts +7 -0
  97. package/dist/src/embed/search-bar.d.ts.map +1 -1
  98. package/dist/src/embed/search.d.ts +7 -0
  99. package/dist/src/embed/search.d.ts.map +1 -1
  100. package/dist/src/embed/ts-embed.d.ts +9 -3
  101. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  102. package/dist/src/errors.d.ts +2 -0
  103. package/dist/src/errors.d.ts.map +1 -1
  104. package/dist/src/index.d.ts +2 -2
  105. package/dist/src/index.d.ts.map +1 -1
  106. package/dist/src/types.d.ts +142 -45
  107. package/dist/src/types.d.ts.map +1 -1
  108. package/dist/src/utils/logger.spec.d.ts +20 -5
  109. package/dist/src/utils/logger.spec.d.ts.map +1 -1
  110. package/dist/src/utils/processTrigger.d.ts +3 -2
  111. package/dist/src/utils/processTrigger.d.ts.map +1 -1
  112. package/dist/src/utils.d.ts +15 -4
  113. package/dist/src/utils.d.ts.map +1 -1
  114. package/dist/tsembed-react.es.js +288 -95
  115. package/dist/tsembed-react.js +287 -94
  116. package/dist/tsembed.es.js +289 -96
  117. package/dist/tsembed.js +314 -121
  118. package/dist/visual-embed-sdk-react-full.d.ts +246 -83
  119. package/dist/visual-embed-sdk-react.d.ts +251 -90
  120. package/dist/visual-embed-sdk.d.ts +299 -93
  121. package/lib/package.json +1 -1
  122. package/lib/src/embed/app.d.ts +44 -32
  123. package/lib/src/embed/app.d.ts.map +1 -1
  124. package/lib/src/embed/app.js.map +1 -1
  125. package/lib/src/embed/base.d.ts +1 -1
  126. package/lib/src/embed/base.d.ts.map +1 -1
  127. package/lib/src/embed/base.js +5 -1
  128. package/lib/src/embed/base.js.map +1 -1
  129. package/lib/src/embed/base.spec.js +61 -1
  130. package/lib/src/embed/base.spec.js.map +1 -1
  131. package/lib/src/embed/conversation.d.ts +7 -0
  132. package/lib/src/embed/conversation.d.ts.map +1 -1
  133. package/lib/src/embed/conversation.js +9 -0
  134. package/lib/src/embed/conversation.js.map +1 -1
  135. package/lib/src/embed/hostEventClient/contracts.d.ts +20 -3
  136. package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  137. package/lib/src/embed/hostEventClient/contracts.js +5 -0
  138. package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
  139. package/lib/src/embed/hostEventClient/host-event-client.d.ts +8 -8
  140. package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  141. package/lib/src/embed/hostEventClient/host-event-client.js +18 -18
  142. package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
  143. package/lib/src/embed/hostEventClient/host-event-client.spec.js +7 -7
  144. package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  145. package/lib/src/embed/liveboard.d.ts +10 -4
  146. package/lib/src/embed/liveboard.d.ts.map +1 -1
  147. package/lib/src/embed/liveboard.js +12 -2
  148. package/lib/src/embed/liveboard.js.map +1 -1
  149. package/lib/src/embed/liveboard.spec.js +1 -1
  150. package/lib/src/embed/liveboard.spec.js.map +1 -1
  151. package/lib/src/embed/sage.d.ts +7 -0
  152. package/lib/src/embed/sage.d.ts.map +1 -1
  153. package/lib/src/embed/sage.js +9 -0
  154. package/lib/src/embed/sage.js.map +1 -1
  155. package/lib/src/embed/search-bar.d.ts +7 -0
  156. package/lib/src/embed/search-bar.d.ts.map +1 -1
  157. package/lib/src/embed/search-bar.js +9 -0
  158. package/lib/src/embed/search-bar.js.map +1 -1
  159. package/lib/src/embed/search.d.ts +7 -0
  160. package/lib/src/embed/search.d.ts.map +1 -1
  161. package/lib/src/embed/search.js +9 -0
  162. package/lib/src/embed/search.js.map +1 -1
  163. package/lib/src/embed/ts-embed.d.ts +9 -3
  164. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  165. package/lib/src/embed/ts-embed.js +41 -8
  166. package/lib/src/embed/ts-embed.js.map +1 -1
  167. package/lib/src/embed/ts-embed.spec.js +156 -24
  168. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  169. package/lib/src/errors.d.ts +2 -0
  170. package/lib/src/errors.d.ts.map +1 -1
  171. package/lib/src/errors.js +2 -0
  172. package/lib/src/errors.js.map +1 -1
  173. package/lib/src/index.d.ts +2 -2
  174. package/lib/src/index.d.ts.map +1 -1
  175. package/lib/src/index.js +2 -2
  176. package/lib/src/index.js.map +1 -1
  177. package/lib/src/types.d.ts +142 -45
  178. package/lib/src/types.d.ts.map +1 -1
  179. package/lib/src/types.js +90 -15
  180. package/lib/src/types.js.map +1 -1
  181. package/lib/src/utils/logger.spec.d.ts +20 -5
  182. package/lib/src/utils/logger.spec.d.ts.map +1 -1
  183. package/lib/src/utils/processTrigger.d.ts +3 -2
  184. package/lib/src/utils/processTrigger.d.ts.map +1 -1
  185. package/lib/src/utils/processTrigger.js +4 -2
  186. package/lib/src/utils/processTrigger.js.map +1 -1
  187. package/lib/src/utils.d.ts +15 -4
  188. package/lib/src/utils.d.ts.map +1 -1
  189. package/lib/src/utils.js +35 -5
  190. package/lib/src/utils.js.map +1 -1
  191. package/lib/src/utils.spec.js +54 -1
  192. package/lib/src/utils.spec.js.map +1 -1
  193. package/package.json +1 -1
  194. package/src/embed/app.ts +45 -32
  195. package/src/embed/base.spec.ts +79 -1
  196. package/src/embed/base.ts +5 -2
  197. package/src/embed/conversation.ts +11 -0
  198. package/src/embed/hostEventClient/contracts.ts +23 -4
  199. package/src/embed/hostEventClient/host-event-client.spec.ts +7 -1
  200. package/src/embed/hostEventClient/host-event-client.ts +22 -11
  201. package/src/embed/liveboard.spec.ts +1 -1
  202. package/src/embed/liveboard.ts +18 -5
  203. package/src/embed/sage.ts +11 -0
  204. package/src/embed/search-bar.tsx +11 -0
  205. package/src/embed/search.ts +11 -0
  206. package/src/embed/ts-embed.spec.ts +205 -18
  207. package/src/embed/ts-embed.ts +45 -9
  208. package/src/errors.ts +2 -0
  209. package/src/index.ts +6 -0
  210. package/src/types.ts +146 -43
  211. package/src/utils/processTrigger.ts +6 -3
  212. package/src/utils.spec.ts +78 -0
  213. package/src/utils.ts +35 -8
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.44.2 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.44.4-HE-beta.1 */
2
2
  'use client';
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
@@ -372,57 +372,71 @@
372
372
  })(AuthType || (AuthType = {}));
373
373
  /**
374
374
  *
375
- * This option does not apply to the classic homepage experience.
376
- * To access the updated modular homepage,
377
- * set `modularHomeExperience` to `true`
378
- * (available as Early Access feature in 9.12.5.cl).
375
+ * **Note**: This attribute is not supported in the classic (V1) homepage experience.
379
376
  *
380
377
  */
381
378
  exports.HomeLeftNavItem = void 0;
382
379
  (function (HomeLeftNavItem) {
383
380
  /**
381
+ * The *Search data* option in
382
+ * the *Insights* left navigation panel.
384
383
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
385
384
  */
386
385
  HomeLeftNavItem["SearchData"] = "search-data";
387
386
  /**
387
+ * The *Home* menu option in
388
+ * the *Insights* left navigation panel.
388
389
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
389
390
  */
390
391
  HomeLeftNavItem["Home"] = "insights-home";
391
392
  /**
393
+ * The *Liveboards* menu option in
394
+ * the *Insights* left navigation panel.
392
395
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
393
396
  */
394
397
  HomeLeftNavItem["Liveboards"] = "liveboards";
395
398
  /**
399
+ * The *Answers* menu option in
400
+ * the *Insights* left navigation panel.
396
401
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
397
402
  */
398
403
  HomeLeftNavItem["Answers"] = "answers";
399
404
  /**
405
+ * The *Monitor subscriptions* menu option in
406
+ * the *Insights* left navigation panel.
400
407
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
401
408
  */
402
409
  HomeLeftNavItem["MonitorSubscription"] = "monitor-alerts";
403
410
  /**
411
+ * The *SpotIQ analysis* menu option in
412
+ * the *Insights* left navigation panel.
404
413
  * @version SDK: 1.28.0| ThoughtSpot: 9.12.5.cl
405
414
  */
406
415
  HomeLeftNavItem["SpotIQAnalysis"] = "spotiq-analysis";
407
416
  /**
417
+ * The *Liveboard schedules* menu option in
418
+ * the *Insights* left navigation panel.
408
419
  * @version SDK: 1.34.0| ThoughtSpot: 10.3.0.cl
409
420
  */
410
421
  HomeLeftNavItem["LiveboardSchedules"] = "liveboard-schedules";
411
422
  /**
412
- * Create new options in the insights left navigation,
413
- * available when new navigation V3 is enabled.
423
+ * The create option in the *Insights*
424
+ * left navigation panel.
425
+ * Available in the V3 navigation experience.
414
426
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
415
427
  */
416
428
  HomeLeftNavItem["Create"] = "create";
417
429
  /**
418
- * Spotter option in the insights left navigation,
419
- * available when new navigation V3 is enabled.
430
+ * The *Spotter* menu option in the *Insights*
431
+ * left navigation panel.
432
+ * Available in the V3 navigation experience.
420
433
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
421
434
  */
422
435
  HomeLeftNavItem["Spotter"] = "spotter";
423
436
  /**
424
- * Favorites option in the insights left navigation,
425
- * available when new navigation V3 is enabled.
437
+ * The *Favorites* section in the *Insights*
438
+ * left navigation panel.
439
+ * Available in the V3 navigation experience.
426
440
  * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
427
441
  */
428
442
  HomeLeftNavItem["Favorites"] = "favorites";
@@ -494,10 +508,11 @@
494
508
  RuntimeFilterOp["NOT_IN"] = "NOT_IN";
495
509
  })(exports.RuntimeFilterOp || (exports.RuntimeFilterOp = {}));
496
510
  /**
497
- * Home page module that can be hidden.
498
- * **Note**: This option does not apply to the classic homepage.
499
- * To access the updated modular homepage, set
500
- * `modularHomeExperience` to `true` (available as Early Access feature in 9.12.5.cl).
511
+ * Home page modules that can be hidden
512
+ * via `hiddenHomepageModules` and reordered via
513
+ * `reorderedHomepageModules`.
514
+ *
515
+ * **Note**: This option is not supported in the classic (v1) experience.
501
516
  * @version SDK: 1.28.0 | ThoughtSpot: 9.12.5.cl, 10.1.0.sw
502
517
  */
503
518
  exports.HomepageModule = void 0;
@@ -511,7 +526,7 @@
511
526
  */
512
527
  HomepageModule["Watchlist"] = "WATCHLIST";
513
528
  /**
514
- * favorite objects
529
+ * Favorite module
515
530
  */
516
531
  HomepageModule["Favorite"] = "FAVORITE";
517
532
  /**
@@ -1667,6 +1682,28 @@
1667
1682
  * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1668
1683
  */
1669
1684
  EmbedEvent["PreviewSpotterData"] = "PreviewSpotterData";
1685
+ /**
1686
+ * Emitted when user opens up the Add to Coaching modal on any visualization in Spotter Embed.
1687
+ * @example
1688
+ * ```js
1689
+ * spotterEmbed.on(EmbedEvent.AddToCoaching, (payload) => {
1690
+ * console.log('payload', payload);
1691
+ * })
1692
+ *```
1693
+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
1694
+ */
1695
+ EmbedEvent["AddToCoaching"] = "addToCoaching";
1696
+ /**
1697
+ * Emitted when user opens up the data model instructions modal in Spotter embed.
1698
+ * @example
1699
+ * ```js
1700
+ * spotterEmbed.on(EmbedEvent.DataModelInstructions, (payload) => {
1701
+ * console.log('payload', payload);
1702
+ * })
1703
+ * ```
1704
+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
1705
+ */
1706
+ EmbedEvent["DataModelInstructions"] = "DataModelInstructions";
1670
1707
  /**
1671
1708
  * Emitted when the Spotter query is triggered in Spotter embed.
1672
1709
  * @example
@@ -3091,6 +3128,26 @@
3091
3128
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
3092
3129
  */
3093
3130
  HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
3131
+ /**
3132
+ * Opens the Add to Coaching modal from a visualization in Spotter Embed.
3133
+ * @param - `vizId ` refers to the Visualization ID in Spotter embed and is required.
3134
+ * @example
3135
+ * ```js
3136
+ * spotterEmbed.trigger(HostEvent.AddToCoaching, { vizId: '730496d6-6903-4601-937e-2c691821af3c' });
3137
+ *
3138
+ *```
3139
+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
3140
+ */
3141
+ HostEvent["AddToCoaching"] = "addToCoaching";
3142
+ /**
3143
+ * Opens the data model instructions modal in Spotter Embed.
3144
+ * @example
3145
+ * ```js
3146
+ * spotterEmbed.trigger(HostEvent.DataModelInstructions);
3147
+ * ```
3148
+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
3149
+ */
3150
+ HostEvent["DataModelInstructions"] = "DataModelInstructions";
3094
3151
  /**
3095
3152
  * Resets the Spotter Embed Conversation.
3096
3153
  * @example
@@ -3193,6 +3250,15 @@
3193
3250
  * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
3194
3251
  */
3195
3252
  HostEvent["StartNewSpotterConversation"] = "StartNewSpotterConversation";
3253
+ /**
3254
+ * Get the current context of the embedded page.
3255
+ * @example
3256
+ * ```js
3257
+ * const context = await liveboardEmbed.trigger(HostEvent.GetPageContext);
3258
+ * ```
3259
+ * @version SDK: 1.45.0 | ThoughtSpot: 26.2.0.cl
3260
+ */
3261
+ HostEvent["GetPageContext"] = "GetPageContext";
3196
3262
  })(exports.HostEvent || (exports.HostEvent = {}));
3197
3263
  /**
3198
3264
  * The different visual modes that the data sources panel within
@@ -4902,7 +4968,16 @@
4902
4968
  EmbedErrorCodes["HOST_EVENT_TYPE_UNDEFINED"] = "HOST_EVENT_TYPE_UNDEFINED";
4903
4969
  /** Error parsing api intercept body */
4904
4970
  EmbedErrorCodes["PARSING_API_INTERCEPT_BODY_ERROR"] = "PARSING_API_INTERCEPT_BODY_ERROR";
4971
+ /** Failed to update embed parameters during pre-render */
4972
+ EmbedErrorCodes["UPDATE_PARAMS_FAILED"] = "UPDATE_PARAMS_FAILED";
4905
4973
  })(EmbedErrorCodes || (EmbedErrorCodes = {}));
4974
+ var ContextType;
4975
+ (function (ContextType) {
4976
+ ContextType["Search"] = "search-answer";
4977
+ ContextType["Liveboard"] = "liveboard";
4978
+ ContextType["Answer"] = "answer";
4979
+ ContextType["Spotter"] = "spotter";
4980
+ })(ContextType || (ContextType = {}));
4906
4981
  /**
4907
4982
  * Enum for the type of API intercepted
4908
4983
  */
@@ -4992,6 +5067,49 @@
4992
5067
  }
4993
5068
  const logger$3 = new Logger();
4994
5069
 
5070
+ const ERROR_MESSAGE = {
5071
+ INVALID_THOUGHTSPOT_HOST: 'Error parsing ThoughtSpot host. Please provide a valid URL.',
5072
+ SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND: 'Please select a Model to get started',
5073
+ LIVEBOARD_VIZ_ID_VALIDATION: 'Please select a Liveboard to embed.',
5074
+ TRIGGER_TIMED_OUT: 'Trigger timed-out in getting a response',
5075
+ SEARCHEMBED_BETA_WRANING_MESSAGE: 'SearchEmbed is in Beta in this release.',
5076
+ SAGE_EMBED_BETA_WARNING_MESSAGE: 'SageEmbed is in Beta in this release.',
5077
+ THIRD_PARTY_COOKIE_BLOCKED_ALERT: 'Third-party cookie access is blocked on this browser. Please allow third-party cookies for this to work properly. \nYou can use `suppressNoCookieAccessAlert` to suppress this message.',
5078
+ DUPLICATE_TOKEN_ERR: 'Duplicate token. Please issue a new token every time getAuthToken callback is called. See https://developers.thoughtspot.com/docs/?pageid=embed-auth#trusted-auth-embed for more details.',
5079
+ SDK_NOT_INITIALIZED: 'SDK not initialized',
5080
+ SESSION_INFO_FAILED: 'Failed to get session information',
5081
+ INVALID_TOKEN_ERROR: 'Received invalid token from getAuthToken callback or authToken endpoint.',
5082
+ INVALID_TOKEN_TYPE_ERROR: 'Expected getAuthToken to return a string, but received a {invalidType}.',
5083
+ MIXPANEL_TOKEN_NOT_FOUND: 'Mixpanel token not found in session info',
5084
+ PRERENDER_ID_MISSING: 'PreRender ID is required for preRender',
5085
+ SYNC_STYLE_CALLED_BEFORE_RENDER: 'PreRender should be called before using syncPreRenderStyle',
5086
+ CSP_VIOLATION_ALERT: 'CSP violation detected. Please check the console errors for more details.',
5087
+ CSP_FRAME_HOST_VIOLATION_LOG_MESSAGE: 'Please set up CSP correctly for the application to start working. For more information, see https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts. \n If the issue persists, refer to https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts',
5088
+ MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
5089
+ RENDER_CALLED_BEFORE_INIT: 'Looks like render was called before calling init, the render won\'t start until init is called.\nFor more info check\n1. https://developers.thoughtspot.com/docs/Function_init#_init\n2.https://developers.thoughtspot.com/docs/getting-started#initSdk',
5090
+ SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
5091
+ OFFLINE_WARNING: 'Network not Detected. Embed is offline. Please reconnect and refresh',
5092
+ INIT_SDK_REQUIRED: 'You need to init the ThoughtSpot SDK module first',
5093
+ CONFLICTING_ACTIONS_CONFIG: 'You cannot have both hidden actions and visible actions',
5094
+ CONFLICTING_TABS_CONFIG: 'You cannot have both hidden Tabs and visible Tabs',
5095
+ RENDER_BEFORE_EVENTS_REQUIRED: 'Please call render before triggering events',
5096
+ HOST_EVENT_TYPE_UNDEFINED: 'Host event type is undefined',
5097
+ LOGIN_FAILED: 'Login failed',
5098
+ ERROR_PARSING_API_INTERCEPT_BODY: 'Error parsing api intercept body',
5099
+ SSR_ENVIRONMENT_ERROR: 'SSR environment detected. This function cannot be called in SSR environment.',
5100
+ UPDATE_PARAMS_FAILED: 'Failed to update embed parameters',
5101
+ };
5102
+ const CUSTOM_ACTIONS_ERROR_MESSAGE = {
5103
+ INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
5104
+ MISSING_REQUIRED_FIELDS: (id, missingFields) => `Custom Action Validation Error for '${id}': Missing required fields: ${missingFields.join(', ')}`,
5105
+ UNSUPPORTED_TARGET: (id, targetType) => `Custom Action Validation Error for '${id}': Target type '${targetType}' is not supported`,
5106
+ INVALID_POSITION: (position, targetType, supportedPositions) => `Position '${position}' is not supported for ${targetType.toLowerCase()}-level custom actions. Supported positions: ${supportedPositions}`,
5107
+ INVALID_METADATA_IDS: (targetType, invalidIds, supportedIds) => `Invalid metadata IDs for ${targetType.toLowerCase()}-level custom actions: ${invalidIds.join(', ')}. Supported metadata IDs: ${supportedIds}`,
5108
+ INVALID_DATA_MODEL_IDS: (targetType, invalidIds, supportedIds) => `Invalid data model IDs for ${targetType.toLowerCase()}-level custom actions: ${invalidIds.join(', ')}. Supported data model IDs: ${supportedIds}`,
5109
+ INVALID_FIELDS: (targetType, invalidFields, supportedFields) => `Invalid fields for ${targetType.toLowerCase()}-level custom actions: ${invalidFields.join(', ')}. Supported fields: ${supportedFields}`,
5110
+ DUPLICATE_IDS: (id, duplicateNames, keptName) => `Duplicate custom action ID '${id}' found. Actions with names '${duplicateNames.join("', '")}' will be ignored. Keeping '${keptName}'.`,
5111
+ };
5112
+
4995
5113
  /**
4996
5114
  * Copyright (c) 2023
4997
5115
  *
@@ -5105,7 +5223,8 @@
5105
5223
  logger$3.error('Please provide a valid lazyLoadingMargin value (e.g., "10px")');
5106
5224
  return false;
5107
5225
  }
5108
- // This pattern allows for an optional negative sign, and numbers that can be integers or decimals (including leading dot).
5226
+ // This pattern allows for an optional negative sign, and numbers
5227
+ // that can be integers or decimals (including leading dot).
5109
5228
  const cssUnitPattern = /^-?(\d+(\.\d*)?|\.\d+)(px|em|rem|%|vh|vw)$/i;
5110
5229
  const parts = value.trim().split(/\s+/);
5111
5230
  if (parts.length > 4) {
@@ -5312,6 +5431,8 @@
5312
5431
  * @version SDK: 1.36.2 | ThoughtSpot: *
5313
5432
  */
5314
5433
  function storeValueInWindow(key, value, options = {}) {
5434
+ if (isWindowUndefined())
5435
+ return value;
5315
5436
  if (!window[sdkWindowKey]) {
5316
5437
  window[sdkWindowKey] = {};
5317
5438
  }
@@ -5322,11 +5443,16 @@
5322
5443
  return value;
5323
5444
  }
5324
5445
  /**
5325
- * Retrieves a stored value from the global `window` object under the `_tsEmbedSDK` namespace.
5326
- * @param key - The key whose value needs to be retrieved.
5327
- * @returns The stored value or `undefined` if the key is not found.
5446
+ * Retrieves a stored value from the global
5447
+ * `window` object under the `_tsEmbedSDK` namespace.
5448
+ * Returns undefined in SSR environment.
5328
5449
  */
5329
- const getValueFromWindow = (key) => { var _a; return (_a = window === null || window === void 0 ? void 0 : window[sdkWindowKey]) === null || _a === void 0 ? void 0 : _a[key]; };
5450
+ const getValueFromWindow = (key) => {
5451
+ var _a;
5452
+ if (isWindowUndefined())
5453
+ return undefined;
5454
+ return (_a = window === null || window === void 0 ? void 0 : window[sdkWindowKey]) === null || _a === void 0 ? void 0 : _a[key];
5455
+ };
5330
5456
  /**
5331
5457
  * Check if an array includes a string value
5332
5458
  * @param arr - The array to check
@@ -5437,6 +5563,25 @@
5437
5563
  return template.replace(/\{(\w+)\}/g, (match, key) => {
5438
5564
  return values[key] !== undefined ? String(values[key]) : match;
5439
5565
  });
5566
+ };
5567
+ const getHostEventsConfig = (viewConfig) => {
5568
+ return {
5569
+ shouldBypassPayloadValidation: viewConfig.shouldBypassPayloadValidation,
5570
+ useHostEventsV2: viewConfig.useHostEventsV2,
5571
+ };
5572
+ };
5573
+ /**
5574
+ * Check if the window is undefined
5575
+ * If the window is undefined, it means the code is running in a SSR environment.
5576
+ * @returns true if the window is undefined, false otherwise
5577
+ *
5578
+ */
5579
+ const isWindowUndefined = () => {
5580
+ if (typeof window === 'undefined') {
5581
+ logger$3.error(ERROR_MESSAGE.SSR_ENVIRONMENT_ERROR);
5582
+ return true;
5583
+ }
5584
+ return false;
5440
5585
  };
5441
5586
 
5442
5587
  /**
@@ -7722,48 +7867,12 @@
7722
7867
  UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
7723
7868
  UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
7724
7869
  UIPassthroughEvent["GetUnsavedAnswerTML"] = "getUnsavedAnswerTML";
7725
- })(UIPassthroughEvent || (UIPassthroughEvent = {}));
7726
-
7727
- const ERROR_MESSAGE = {
7728
- INVALID_THOUGHTSPOT_HOST: 'Error parsing ThoughtSpot host. Please provide a valid URL.',
7729
- SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND: 'Please select a Model to get started',
7730
- LIVEBOARD_VIZ_ID_VALIDATION: 'Please select a Liveboard to embed.',
7731
- TRIGGER_TIMED_OUT: 'Trigger timed-out in getting a response',
7732
- SEARCHEMBED_BETA_WRANING_MESSAGE: 'SearchEmbed is in Beta in this release.',
7733
- SAGE_EMBED_BETA_WARNING_MESSAGE: 'SageEmbed is in Beta in this release.',
7734
- THIRD_PARTY_COOKIE_BLOCKED_ALERT: 'Third-party cookie access is blocked on this browser. Please allow third-party cookies for this to work properly. \nYou can use `suppressNoCookieAccessAlert` to suppress this message.',
7735
- DUPLICATE_TOKEN_ERR: 'Duplicate token. Please issue a new token every time getAuthToken callback is called. See https://developers.thoughtspot.com/docs/?pageid=embed-auth#trusted-auth-embed for more details.',
7736
- SDK_NOT_INITIALIZED: 'SDK not initialized',
7737
- SESSION_INFO_FAILED: 'Failed to get session information',
7738
- INVALID_TOKEN_ERROR: 'Received invalid token from getAuthToken callback or authToken endpoint.',
7739
- INVALID_TOKEN_TYPE_ERROR: 'Expected getAuthToken to return a string, but received a {invalidType}.',
7740
- MIXPANEL_TOKEN_NOT_FOUND: 'Mixpanel token not found in session info',
7741
- PRERENDER_ID_MISSING: 'PreRender ID is required for preRender',
7742
- SYNC_STYLE_CALLED_BEFORE_RENDER: 'PreRender should be called before using syncPreRenderStyle',
7743
- CSP_VIOLATION_ALERT: 'CSP violation detected. Please check the console errors for more details.',
7744
- CSP_FRAME_HOST_VIOLATION_LOG_MESSAGE: 'Please set up CSP correctly for the application to start working. For more information, see https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts. \n If the issue persists, refer to https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts',
7745
- MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
7746
- RENDER_CALLED_BEFORE_INIT: 'Looks like render was called before calling init, the render won\'t start until init is called.\nFor more info check\n1. https://developers.thoughtspot.com/docs/Function_init#_init\n2.https://developers.thoughtspot.com/docs/getting-started#initSdk',
7747
- SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
7748
- OFFLINE_WARNING: 'Network not Detected. Embed is offline. Please reconnect and refresh',
7749
- INIT_SDK_REQUIRED: 'You need to init the ThoughtSpot SDK module first',
7750
- CONFLICTING_ACTIONS_CONFIG: 'You cannot have both hidden actions and visible actions',
7751
- CONFLICTING_TABS_CONFIG: 'You cannot have both hidden Tabs and visible Tabs',
7752
- RENDER_BEFORE_EVENTS_REQUIRED: 'Please call render before triggering events',
7753
- HOST_EVENT_TYPE_UNDEFINED: 'Host event type is undefined',
7754
- LOGIN_FAILED: 'Login failed',
7755
- ERROR_PARSING_API_INTERCEPT_BODY: 'Error parsing api intercept body',
7756
- };
7757
- const CUSTOM_ACTIONS_ERROR_MESSAGE = {
7758
- INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
7759
- MISSING_REQUIRED_FIELDS: (id, missingFields) => `Custom Action Validation Error for '${id}': Missing required fields: ${missingFields.join(', ')}`,
7760
- UNSUPPORTED_TARGET: (id, targetType) => `Custom Action Validation Error for '${id}': Target type '${targetType}' is not supported`,
7761
- INVALID_POSITION: (position, targetType, supportedPositions) => `Position '${position}' is not supported for ${targetType.toLowerCase()}-level custom actions. Supported positions: ${supportedPositions}`,
7762
- INVALID_METADATA_IDS: (targetType, invalidIds, supportedIds) => `Invalid metadata IDs for ${targetType.toLowerCase()}-level custom actions: ${invalidIds.join(', ')}. Supported metadata IDs: ${supportedIds}`,
7763
- INVALID_DATA_MODEL_IDS: (targetType, invalidIds, supportedIds) => `Invalid data model IDs for ${targetType.toLowerCase()}-level custom actions: ${invalidIds.join(', ')}. Supported data model IDs: ${supportedIds}`,
7764
- INVALID_FIELDS: (targetType, invalidFields, supportedFields) => `Invalid fields for ${targetType.toLowerCase()}-level custom actions: ${invalidFields.join(', ')}. Supported fields: ${supportedFields}`,
7765
- DUPLICATE_IDS: (id, duplicateNames, keptName) => `Duplicate custom action ID '${id}' found. Actions with names '${duplicateNames.join("', '")}' will be ignored. Keeping '${keptName}'.`,
7766
- };
7870
+ })(UIPassthroughEvent || (UIPassthroughEvent = {}));
7871
+ var PageType;
7872
+ (function (PageType) {
7873
+ PageType["PAGE"] = "page";
7874
+ PageType["DIALOG"] = "dialog";
7875
+ })(PageType || (PageType = {}));
7767
7876
 
7768
7877
  const EndPoints = {
7769
7878
  AUTH_VERIFICATION: '/callosum/v1/session/info',
@@ -17524,6 +17633,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17524
17633
  * @param message
17525
17634
  * @param message.type
17526
17635
  * @param message.data
17636
+ * @param message.context
17527
17637
  * @param thoughtSpotHost
17528
17638
  * @param channel
17529
17639
  */
@@ -17538,8 +17648,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17538
17648
  * @param messageType
17539
17649
  * @param thoughtSpotHost
17540
17650
  * @param data
17651
+ * @param context
17541
17652
  */
17542
- function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
17653
+ function processTrigger(iFrame, messageType, thoughtSpotHost, data, context) {
17543
17654
  return new Promise((res, rej) => {
17544
17655
  var _a;
17545
17656
  if (messageType === exports.HostEvent.Reload) {
@@ -17573,7 +17684,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17573
17684
  channel.port1.close();
17574
17685
  res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
17575
17686
  }, TRIGGER_TIMEOUT);
17576
- return postIframeMessage(iFrame, { type: messageType, data }, thoughtSpotHost, channel);
17687
+ return postIframeMessage(iFrame, { type: messageType, data, context }, thoughtSpotHost, channel);
17577
17688
  });
17578
17689
  }
17579
17690
 
@@ -17694,6 +17805,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17694
17805
  }
17695
17806
  const initFlagKey = 'initFlagKey';
17696
17807
  const createAndSetInitPromise = () => {
17808
+ if (isWindowUndefined())
17809
+ return;
17697
17810
  const { promise: initPromise, resolve: initPromiseResolve,
17698
17811
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
17699
17812
  // @ts-ignore
@@ -17733,6 +17846,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17733
17846
  */
17734
17847
  const init = (embedConfig) => {
17735
17848
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
17849
+ if (isWindowUndefined())
17850
+ return null;
17736
17851
  sanity(embedConfig);
17737
17852
  resetAllCachedServices();
17738
17853
  embedConfig = setEmbedConfig(backwardCompat({
@@ -17915,7 +18030,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17915
18030
  return eventData;
17916
18031
  }
17917
18032
 
17918
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.44.2";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^30.0.0","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^30.2.0","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^30.2.0","jest-environment-jsdom":"^29.7.0","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^29.4.6","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
18033
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.44.4-HE-beta.1";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^30.0.0","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^30.2.0","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^30.2.0","jest-environment-jsdom":"^29.7.0","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^29.4.6","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
17919
18034
 
17920
18035
  class HostEventClient {
17921
18036
  constructor(iFrame) {
@@ -17927,16 +18042,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17927
18042
  * @param {any} data Data to send with the host event
17928
18043
  * @returns {Promise<any>} - the response from the process trigger
17929
18044
  */
17930
- async processTrigger(message, data) {
18045
+ async processTrigger(message, data, context) {
17931
18046
  if (!this.iFrame) {
17932
18047
  throw new Error('Iframe element is not set');
17933
18048
  }
17934
18049
  const thoughtspotHost = getEmbedConfig().thoughtSpotHost;
17935
- return processTrigger(this.iFrame, message, thoughtspotHost, data);
18050
+ return processTrigger(this.iFrame, message, thoughtspotHost, data, context);
17936
18051
  }
17937
- async handleHostEventWithParam(apiName, parameters) {
18052
+ async handleHostEventWithParam(apiName, parameters, context) {
17938
18053
  var _a, _b, _c, _d;
17939
- 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];
18054
+ 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];
17940
18055
  if (!response) {
17941
18056
  const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
17942
18057
  // eslint-disable-next-line no-throw-literal
@@ -17951,8 +18066,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17951
18066
  }
17952
18067
  return { ...response.value };
17953
18068
  }
17954
- async hostEventFallback(hostEvent, data) {
17955
- return this.processTrigger(hostEvent, data);
18069
+ async hostEventFallback(hostEvent, data, context) {
18070
+ return this.processTrigger(hostEvent, data, context);
17956
18071
  }
17957
18072
  /**
17958
18073
  * Setter for the iframe element used for host events
@@ -17961,49 +18076,49 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17961
18076
  setIframeElement(iFrame) {
17962
18077
  this.iFrame = iFrame;
17963
18078
  }
17964
- async triggerUIPassthroughApi(apiName, parameters) {
18079
+ async triggerUIPassthroughApi(apiName, parameters, context) {
17965
18080
  const res = await this.processTrigger(exports.HostEvent.UIPassthrough, {
17966
18081
  type: apiName,
17967
18082
  parameters,
17968
- });
18083
+ }, context);
17969
18084
  return res;
17970
18085
  }
17971
- async handlePinEvent(payload) {
18086
+ async handlePinEvent(payload, context) {
17972
18087
  var _a, _b;
17973
18088
  if (!payload || !('newVizName' in payload)) {
17974
- return this.hostEventFallback(exports.HostEvent.Pin, payload);
18089
+ return this.hostEventFallback(exports.HostEvent.Pin, payload, context);
17975
18090
  }
17976
18091
  const formattedPayload = {
17977
18092
  ...payload,
17978
18093
  pinboardId: (_a = payload.liveboardId) !== null && _a !== void 0 ? _a : payload.pinboardId,
17979
18094
  newPinboardName: (_b = payload.newLiveboardName) !== null && _b !== void 0 ? _b : payload.newPinboardName,
17980
18095
  };
17981
- const data = await this.handleHostEventWithParam(UIPassthroughEvent.PinAnswerToLiveboard, formattedPayload);
18096
+ const data = await this.handleHostEventWithParam(UIPassthroughEvent.PinAnswerToLiveboard, formattedPayload, context);
17982
18097
  return {
17983
18098
  ...data,
17984
18099
  liveboardId: data.pinboardId,
17985
18100
  };
17986
18101
  }
17987
- async handleSaveAnswerEvent(payload) {
18102
+ async handleSaveAnswerEvent(payload, context) {
17988
18103
  var _a, _b, _c, _d;
17989
18104
  if (!payload || !('name' in payload) || !('description' in payload)) {
17990
18105
  // Save is the fallback for SaveAnswer
17991
- return this.hostEventFallback(exports.HostEvent.Save, payload);
18106
+ return this.hostEventFallback(exports.HostEvent.Save, payload, context);
17992
18107
  }
17993
- const data = await this.handleHostEventWithParam(UIPassthroughEvent.SaveAnswer, payload);
18108
+ const data = await this.handleHostEventWithParam(UIPassthroughEvent.SaveAnswer, payload, context);
17994
18109
  return {
17995
18110
  ...data,
17996
18111
  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,
17997
18112
  };
17998
18113
  }
17999
- async triggerHostEvent(hostEvent, payload) {
18114
+ async triggerHostEvent(hostEvent, payload, context) {
18000
18115
  switch (hostEvent) {
18001
18116
  case exports.HostEvent.Pin:
18002
- return this.handlePinEvent(payload);
18117
+ return this.handlePinEvent(payload, context);
18003
18118
  case exports.HostEvent.SaveAnswer:
18004
- return this.handleSaveAnswerEvent(payload);
18119
+ return this.handleSaveAnswerEvent(payload, context);
18005
18120
  default:
18006
- return this.hostEventFallback(hostEvent, payload);
18121
+ return this.hostEventFallback(hostEvent, payload, context);
18007
18122
  }
18008
18123
  }
18009
18124
  }
@@ -18638,6 +18753,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
18638
18753
  hiddenListColumns: this.viewConfig.hiddenListColumns || [],
18639
18754
  customActions: customActionsResult.actions,
18640
18755
  ...getInterceptInitData(this.viewConfig),
18756
+ ...getHostEventsConfig(this.viewConfig),
18641
18757
  };
18642
18758
  return baseInitData;
18643
18759
  }
@@ -18658,9 +18774,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
18658
18774
  .join('/');
18659
18775
  return `${basePath}#`;
18660
18776
  }
18661
- getUpdateEmbedParamsObject() {
18777
+ async getUpdateEmbedParamsObject() {
18662
18778
  let queryParams = this.getEmbedParamsObject();
18663
- queryParams = { ...this.viewConfig, ...queryParams, ...this.getAppInitData() };
18779
+ const appInitData = await this.getAppInitData();
18780
+ queryParams = { ...this.viewConfig, ...queryParams, ...appInitData };
18664
18781
  return queryParams;
18665
18782
  }
18666
18783
  /**
@@ -18969,6 +19086,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
18969
19086
  preRenderWrapper.id = preRenderIds.wrapper;
18970
19087
  const initialPreRenderWrapperStyle = {
18971
19088
  position: 'absolute',
19089
+ top: '0',
19090
+ left: '0',
18972
19091
  width: '100vw',
18973
19092
  height: '100vh',
18974
19093
  };
@@ -19259,7 +19378,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
19259
19378
  * @param {any} data The payload to send with the message
19260
19379
  * @returns A promise that resolves with the response from the embedded app
19261
19380
  */
19262
- async trigger(messageType, data = {}) {
19381
+ async trigger(messageType, data = {}, context) {
19263
19382
  uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
19264
19383
  if (!this.isRendered) {
19265
19384
  this.handleError({
@@ -19286,7 +19405,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
19286
19405
  return null;
19287
19406
  }
19288
19407
  // send an empty object, this is needed for liveboard default handlers
19289
- return this.hostEventClient.triggerHostEvent(messageType, data);
19408
+ return this.hostEventClient.triggerHostEvent(messageType, data, context);
19290
19409
  }
19291
19410
  /**
19292
19411
  * Triggers an event to the embedded app, skipping the UI flow.
@@ -19319,6 +19438,19 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
19319
19438
  handleRenderForPrerender() {
19320
19439
  return this.render();
19321
19440
  }
19441
+ /**
19442
+ * Get the current context of the embedded TS component.
19443
+ * @returns The current context object containing the page type and object ids.
19444
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
19445
+ */
19446
+ async getCurrentContext() {
19447
+ return new Promise((resolve) => {
19448
+ this.executeAfterEmbedContainerLoaded(async () => {
19449
+ const context = await this.trigger(exports.HostEvent.GetPageContext, {});
19450
+ resolve(context);
19451
+ });
19452
+ });
19453
+ }
19322
19454
  /**
19323
19455
  * Creates the preRender shell
19324
19456
  * @param showPreRenderByDefault - Show the preRender after render, hidden by default
@@ -19433,8 +19565,20 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
19433
19565
  }
19434
19566
  this.validatePreRenderViewConfig(this.viewConfig);
19435
19567
  logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
19436
- this.executeAfterEmbedContainerLoaded(() => {
19437
- this.trigger(exports.HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
19568
+ this.executeAfterEmbedContainerLoaded(async () => {
19569
+ try {
19570
+ const params = await this.getUpdateEmbedParamsObject();
19571
+ this.trigger(exports.HostEvent.UpdateEmbedParams, params);
19572
+ }
19573
+ catch (error) {
19574
+ logger$3.error(ERROR_MESSAGE.UPDATE_PARAMS_FAILED, error);
19575
+ this.handleError({
19576
+ errorType: ErrorDetailsTypes.API,
19577
+ message: (error === null || error === void 0 ? void 0 : error.message) || ERROR_MESSAGE.UPDATE_PARAMS_FAILED,
19578
+ code: EmbedErrorCodes.UPDATE_PARAMS_FAILED,
19579
+ error: (error === null || error === void 0 ? void 0 : error.message) || error,
19580
+ });
19581
+ }
19438
19582
  });
19439
19583
  }
19440
19584
  this.beforePrerenderVisible();
@@ -19454,7 +19598,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
19454
19598
  this.resizeObserver.observe(this.el);
19455
19599
  }
19456
19600
  }
19457
- removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
19601
+ removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events', 'overflow']);
19458
19602
  this.subscribeToEvents();
19459
19603
  // Setup fullscreen change handler for prerendered components
19460
19604
  if (this.iFrame) {
@@ -19497,7 +19641,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
19497
19641
  opacity: '0',
19498
19642
  pointerEvents: 'none',
19499
19643
  zIndex: '-1000',
19500
- position: 'absolute ',
19644
+ position: 'absolute',
19645
+ top: '0',
19646
+ left: '0',
19647
+ overflow: 'hidden',
19501
19648
  };
19502
19649
  setStyleProperties(this.preRenderWrapper, preRenderHideStyles);
19503
19650
  if (this.resizeObserver) {
@@ -19704,6 +19851,15 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
19704
19851
  const defaultAppInitData = await super.getAppInitData();
19705
19852
  return { ...defaultAppInitData, ...this.getSearchInitData() };
19706
19853
  }
19854
+ /**
19855
+ * Get the current context of the embedded search bar.
19856
+ * @returns The current context object containing the page type and object ids.
19857
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
19858
+ */
19859
+ async getCurrentContext() {
19860
+ const context = await super.getCurrentContext();
19861
+ return context;
19862
+ }
19707
19863
  };
19708
19864
 
19709
19865
  /**
@@ -19786,6 +19942,15 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
19786
19942
  await this.renderV1Embed(src);
19787
19943
  return this;
19788
19944
  }
19945
+ /**
19946
+ * Get the current context of the embedded SageEmbed.
19947
+ * @returns The current context object containing the page type and object ids.
19948
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
19949
+ */
19950
+ async getCurrentContext() {
19951
+ const context = await super.getCurrentContext();
19952
+ return context;
19953
+ }
19789
19954
  };
19790
19955
 
19791
19956
  /**
@@ -19961,6 +20126,15 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
19961
20126
  });
19962
20127
  return this;
19963
20128
  }
20129
+ /**
20130
+ * Get the current context of the embedded search.
20131
+ * @returns The current context object containing the page type and object ids.
20132
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
20133
+ */
20134
+ async getCurrentContext() {
20135
+ const context = await super.getCurrentContext();
20136
+ return context;
20137
+ }
19964
20138
  };
19965
20139
 
19966
20140
  /**
@@ -20509,6 +20683,7 @@ query GetEurekaVizSnapshots(
20509
20683
  super(domSelector, viewConfig);
20510
20684
  this.defaultHeight = 500;
20511
20685
  this.sendFullHeightLazyLoadData = () => {
20686
+ console.log('sendFullHeightLazyLoadData', this.iFrame);
20512
20687
  const data = calculateVisibleElementData(this.iFrame);
20513
20688
  this.trigger(exports.HostEvent.VisibleEmbedCoordinates, data);
20514
20689
  };
@@ -20769,7 +20944,7 @@ query GetEurekaVizSnapshots(
20769
20944
  * @param {any} data The payload to send with the message
20770
20945
  * @returns A promise that resolves with the response from the embedded app
20771
20946
  */
20772
- trigger(messageType, data = {}) {
20947
+ trigger(messageType, data = {}, context) {
20773
20948
  const dataWithVizId = data;
20774
20949
  if (messageType === exports.HostEvent.SetActiveTab) {
20775
20950
  this.setActiveTab(data);
@@ -20778,7 +20953,7 @@ query GetEurekaVizSnapshots(
20778
20953
  if (typeof dataWithVizId === 'object' && this.viewConfig.vizId) {
20779
20954
  dataWithVizId.vizId = this.viewConfig.vizId;
20780
20955
  }
20781
- return super.trigger(messageType, dataWithVizId);
20956
+ return super.trigger(messageType, dataWithVizId, context);
20782
20957
  }
20783
20958
  /**
20784
20959
  * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
@@ -20847,6 +21022,15 @@ query GetEurekaVizSnapshots(
20847
21022
  }
20848
21023
  return url;
20849
21024
  }
21025
+ /**
21026
+ * Get the current context of the embedded liveboard.
21027
+ * @returns The current context object containing the page type and object ids.
21028
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
21029
+ */
21030
+ async getCurrentContext() {
21031
+ const context = await super.getCurrentContext();
21032
+ return context;
21033
+ }
20850
21034
  };
20851
21035
 
20852
21036
  const createConversation = `
@@ -21471,6 +21655,15 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
21471
21655
  await this.renderIFrame(src);
21472
21656
  return this;
21473
21657
  }
21658
+ /**
21659
+ * Get the current context of the embedded SpotterEmbed.
21660
+ * @returns The current context object containing the page type and object ids.
21661
+ * @version SDK: 1.46.0 | ThoughtSpot: 26.3.0.cl
21662
+ */
21663
+ async getCurrentContext() {
21664
+ const context = await super.getCurrentContext();
21665
+ return context;
21666
+ }
21474
21667
  };
21475
21668
  /**
21476
21669
  * Embed ThoughtSpot AI Conversation.