@thoughtspot/visual-embed-sdk 1.46.3 → 1.46.5-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 (172) hide show
  1. package/cjs/package.json +3 -3
  2. package/cjs/src/auth.d.ts +2 -1
  3. package/cjs/src/auth.d.ts.map +1 -1
  4. package/cjs/src/auth.js +2 -1
  5. package/cjs/src/auth.js.map +1 -1
  6. package/cjs/src/authToken.d.ts.map +1 -1
  7. package/cjs/src/authToken.js.map +1 -1
  8. package/cjs/src/css-variables.d.ts +51 -17
  9. package/cjs/src/css-variables.d.ts.map +1 -1
  10. package/cjs/src/embed/app.d.ts +1 -0
  11. package/cjs/src/embed/app.d.ts.map +1 -1
  12. package/cjs/src/embed/app.js +10 -1
  13. package/cjs/src/embed/app.js.map +1 -1
  14. package/cjs/src/embed/app.spec.js +46 -1
  15. package/cjs/src/embed/app.spec.js.map +1 -1
  16. package/cjs/src/embed/base.d.ts.map +1 -1
  17. package/cjs/src/embed/base.js.map +1 -1
  18. package/cjs/src/embed/base.spec.js.map +1 -1
  19. package/cjs/src/embed/events.spec.js +72 -0
  20. package/cjs/src/embed/events.spec.js.map +1 -1
  21. package/cjs/src/embed/hostEventClient/contracts.d.ts +74 -3
  22. package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  23. package/cjs/src/embed/hostEventClient/contracts.js +7 -0
  24. package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
  25. package/cjs/src/embed/hostEventClient/host-event-client.d.ts +10 -0
  26. package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  27. package/cjs/src/embed/hostEventClient/host-event-client.js +46 -9
  28. package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
  29. package/cjs/src/embed/hostEventClient/host-event-client.spec.js +155 -0
  30. package/cjs/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  31. package/cjs/src/embed/liveboard.d.ts +1 -0
  32. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  33. package/cjs/src/embed/liveboard.js +11 -2
  34. package/cjs/src/embed/liveboard.js.map +1 -1
  35. package/cjs/src/embed/liveboard.spec.js +96 -2
  36. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  37. package/cjs/src/embed/sage.d.ts.map +1 -1
  38. package/cjs/src/embed/sage.js.map +1 -1
  39. package/cjs/src/embed/search.spec.js.map +1 -1
  40. package/cjs/src/embed/ts-embed.d.ts +41 -2
  41. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  42. package/cjs/src/embed/ts-embed.js +41 -2
  43. package/cjs/src/embed/ts-embed.js.map +1 -1
  44. package/cjs/src/react/index.d.ts.map +1 -1
  45. package/cjs/src/react/index.js +58 -53
  46. package/cjs/src/react/index.js.map +1 -1
  47. package/cjs/src/types.d.ts +730 -32
  48. package/cjs/src/types.d.ts.map +1 -1
  49. package/cjs/src/types.js +734 -3
  50. package/cjs/src/types.js.map +1 -1
  51. package/cjs/src/utils/graphql/answerService/answerService.d.ts +4 -2
  52. package/cjs/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  53. package/cjs/src/utils/graphql/answerService/answerService.js +4 -2
  54. package/cjs/src/utils/graphql/answerService/answerService.js.map +1 -1
  55. package/cjs/src/utils/graphql/preview-service.d.ts.map +1 -1
  56. package/cjs/src/utils/graphql/preview-service.js.map +1 -1
  57. package/cjs/src/utils/processData.d.ts.map +1 -1
  58. package/cjs/src/utils/processData.js.map +1 -1
  59. package/dist/{index-DyX-x6uN.js → index-DW2wEHqy.js} +1 -1
  60. package/dist/src/auth.d.ts +2 -1
  61. package/dist/src/auth.d.ts.map +1 -1
  62. package/dist/src/authToken.d.ts.map +1 -1
  63. package/dist/src/css-variables.d.ts +51 -17
  64. package/dist/src/css-variables.d.ts.map +1 -1
  65. package/dist/src/embed/app.d.ts +1 -0
  66. package/dist/src/embed/app.d.ts.map +1 -1
  67. package/dist/src/embed/base.d.ts.map +1 -1
  68. package/dist/src/embed/hostEventClient/contracts.d.ts +74 -3
  69. package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  70. package/dist/src/embed/hostEventClient/host-event-client.d.ts +10 -0
  71. package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  72. package/dist/src/embed/liveboard.d.ts +1 -0
  73. package/dist/src/embed/liveboard.d.ts.map +1 -1
  74. package/dist/src/embed/sage.d.ts.map +1 -1
  75. package/dist/src/embed/ts-embed.d.ts +41 -2
  76. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  77. package/dist/src/react/index.d.ts.map +1 -1
  78. package/dist/src/types.d.ts +730 -32
  79. package/dist/src/types.d.ts.map +1 -1
  80. package/dist/src/utils/graphql/answerService/answerService.d.ts +4 -2
  81. package/dist/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  82. package/dist/src/utils/graphql/preview-service.d.ts.map +1 -1
  83. package/dist/src/utils/processData.d.ts.map +1 -1
  84. package/dist/tsembed-react.es.js +917 -77
  85. package/dist/tsembed-react.js +915 -75
  86. package/dist/tsembed.es.js +859 -24
  87. package/dist/tsembed.js +857 -22
  88. package/dist/visual-embed-sdk-react-full.d.ts +892 -54
  89. package/dist/visual-embed-sdk-react.d.ts +892 -54
  90. package/dist/visual-embed-sdk.d.ts +912 -56
  91. package/lib/package.json +3 -3
  92. package/lib/src/auth.d.ts +2 -1
  93. package/lib/src/auth.d.ts.map +1 -1
  94. package/lib/src/auth.js +2 -1
  95. package/lib/src/auth.js.map +1 -1
  96. package/lib/src/authToken.d.ts.map +1 -1
  97. package/lib/src/authToken.js.map +1 -1
  98. package/lib/src/css-variables.d.ts +51 -17
  99. package/lib/src/css-variables.d.ts.map +1 -1
  100. package/lib/src/embed/app.d.ts +1 -0
  101. package/lib/src/embed/app.d.ts.map +1 -1
  102. package/lib/src/embed/app.js +10 -1
  103. package/lib/src/embed/app.js.map +1 -1
  104. package/lib/src/embed/app.spec.js +46 -1
  105. package/lib/src/embed/app.spec.js.map +1 -1
  106. package/lib/src/embed/base.d.ts.map +1 -1
  107. package/lib/src/embed/base.js.map +1 -1
  108. package/lib/src/embed/base.spec.js.map +1 -1
  109. package/lib/src/embed/events.spec.js +73 -1
  110. package/lib/src/embed/events.spec.js.map +1 -1
  111. package/lib/src/embed/hostEventClient/contracts.d.ts +74 -3
  112. package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
  113. package/lib/src/embed/hostEventClient/contracts.js +7 -0
  114. package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
  115. package/lib/src/embed/hostEventClient/host-event-client.d.ts +10 -0
  116. package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
  117. package/lib/src/embed/hostEventClient/host-event-client.js +46 -9
  118. package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
  119. package/lib/src/embed/hostEventClient/host-event-client.spec.js +155 -0
  120. package/lib/src/embed/hostEventClient/host-event-client.spec.js.map +1 -1
  121. package/lib/src/embed/liveboard.d.ts +1 -0
  122. package/lib/src/embed/liveboard.d.ts.map +1 -1
  123. package/lib/src/embed/liveboard.js +11 -2
  124. package/lib/src/embed/liveboard.js.map +1 -1
  125. package/lib/src/embed/liveboard.spec.js +96 -2
  126. package/lib/src/embed/liveboard.spec.js.map +1 -1
  127. package/lib/src/embed/sage.d.ts.map +1 -1
  128. package/lib/src/embed/sage.js.map +1 -1
  129. package/lib/src/embed/search.spec.js.map +1 -1
  130. package/lib/src/embed/ts-embed.d.ts +41 -2
  131. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  132. package/lib/src/embed/ts-embed.js +42 -3
  133. package/lib/src/embed/ts-embed.js.map +1 -1
  134. package/lib/src/react/index.d.ts.map +1 -1
  135. package/lib/src/react/index.js +58 -53
  136. package/lib/src/react/index.js.map +1 -1
  137. package/lib/src/types.d.ts +730 -32
  138. package/lib/src/types.d.ts.map +1 -1
  139. package/lib/src/types.js +734 -3
  140. package/lib/src/types.js.map +1 -1
  141. package/lib/src/utils/graphql/answerService/answerService.d.ts +4 -2
  142. package/lib/src/utils/graphql/answerService/answerService.d.ts.map +1 -1
  143. package/lib/src/utils/graphql/answerService/answerService.js +4 -2
  144. package/lib/src/utils/graphql/answerService/answerService.js.map +1 -1
  145. package/lib/src/utils/graphql/preview-service.d.ts.map +1 -1
  146. package/lib/src/utils/graphql/preview-service.js.map +1 -1
  147. package/lib/src/utils/processData.d.ts.map +1 -1
  148. package/lib/src/utils/processData.js.map +1 -1
  149. package/lib/src/visual-embed-sdk.d.ts +973 -116
  150. package/package.json +3 -3
  151. package/src/auth.spec.ts +1 -1
  152. package/src/auth.ts +2 -1
  153. package/src/authToken.ts +0 -1
  154. package/src/css-variables.ts +51 -17
  155. package/src/embed/app.spec.ts +62 -3
  156. package/src/embed/app.ts +10 -1
  157. package/src/embed/base.spec.ts +1 -2
  158. package/src/embed/base.ts +1 -4
  159. package/src/embed/events.spec.ts +88 -0
  160. package/src/embed/hostEventClient/contracts.ts +74 -2
  161. package/src/embed/hostEventClient/host-event-client.spec.ts +257 -0
  162. package/src/embed/hostEventClient/host-event-client.ts +70 -15
  163. package/src/embed/liveboard.spec.ts +126 -2
  164. package/src/embed/liveboard.ts +11 -2
  165. package/src/embed/sage.ts +0 -1
  166. package/src/embed/search.spec.ts +0 -2
  167. package/src/embed/ts-embed.ts +43 -3
  168. package/src/react/index.tsx +76 -72
  169. package/src/types.ts +739 -31
  170. package/src/utils/graphql/answerService/answerService.ts +4 -5
  171. package/src/utils/graphql/preview-service.ts +0 -1
  172. package/src/utils/processData.ts +0 -5
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.46.3 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.46.5-beta.1 */
2
2
  'use client';
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
@@ -70,6 +70,7 @@ var AuthType;
70
70
  * @deprecated This option is deprecated.
71
71
  * @hidden
72
72
  */
73
+ // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
73
74
  AuthType["SAML"] = "SSO_SAML";
74
75
  /**
75
76
  * SSO using SAML
@@ -115,6 +116,7 @@ var AuthType;
115
116
  * });
116
117
  * ```
117
118
  */
119
+ // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
118
120
  AuthType["SAMLRedirect"] = "SSO_SAML";
119
121
  /**
120
122
  * SSO using OIDC
@@ -128,6 +130,7 @@ var AuthType;
128
130
  * Will make the host application redirect to the OIDC IdP.
129
131
  * See code samples in {@link SAMLRedirect}.
130
132
  */
133
+ // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
131
134
  AuthType["OIDCRedirect"] = "SSO_OIDC";
132
135
  /**
133
136
  * Trusted authentication server
@@ -153,6 +156,7 @@ var AuthType;
153
156
  * });
154
157
  * ```
155
158
  */
159
+ // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
156
160
  AuthType["TrustedAuthToken"] = "AuthServer";
157
161
  /**
158
162
  * Trusted authentication server Cookieless, Use your own authentication
@@ -1292,22 +1296,45 @@ var EmbedEvent;
1292
1296
  /**
1293
1297
  * Emitted when name, status (private or public) or filter values of a
1294
1298
  * Personalised view is updated.
1299
+ * This event is deprecated. Use {@link EmbedEvent.UpdatePersonalizedView} instead.
1295
1300
  * @returns viewName: string
1296
1301
  * @returns viewId: string
1297
1302
  * @returns liveboardId: string
1298
1303
  * @returns isPublic: boolean
1299
1304
  * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
1305
+ * @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
1300
1306
  */
1301
1307
  EmbedEvent["UpdatePersonalisedView"] = "updatePersonalisedView";
1308
+ /**
1309
+ * Emitted when name, status (private or public) or filter values of a
1310
+ * Personalized view is updated.
1311
+ * @returns viewName: string
1312
+ * @returns viewId: string
1313
+ * @returns liveboardId: string
1314
+ * @returns isPublic: boolean
1315
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
1316
+ */
1317
+ EmbedEvent["UpdatePersonalizedView"] = "updatePersonalisedView";
1302
1318
  /**
1303
1319
  * Emitted when a Personalised view is saved.
1320
+ * This event is deprecated. Use {@link EmbedEvent.SavePersonalizedView} instead.
1304
1321
  * @returns viewName: string
1305
1322
  * @returns viewId: string
1306
1323
  * @returns liveboardId: string
1307
1324
  * @returns isPublic: boolean
1308
1325
  * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
1326
+ * @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
1309
1327
  */
1310
1328
  EmbedEvent["SavePersonalisedView"] = "savePersonalisedView";
1329
+ /**
1330
+ * Emitted when a Personalized view is saved.
1331
+ * @returns viewName: string
1332
+ * @returns viewId: string
1333
+ * @returns liveboardId: string
1334
+ * @returns isPublic: boolean
1335
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
1336
+ */
1337
+ EmbedEvent["SavePersonalizedView"] = "savePersonalisedView";
1311
1338
  /**
1312
1339
  * Emitted when a Liveboard is reset.
1313
1340
  * @returns viewName: string
@@ -1319,11 +1346,41 @@ var EmbedEvent;
1319
1346
  EmbedEvent["ResetLiveboard"] = "resetLiveboard";
1320
1347
  /**
1321
1348
  * Emitted when a PersonalisedView is deleted.
1349
+ * This event is deprecated. Use {@link EmbedEvent.DeletePersonalizedView} instead.
1322
1350
  * @returns views: string[]
1323
1351
  * @returns liveboardId: string
1324
1352
  * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
1353
+ * @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
1325
1354
  */
1326
1355
  EmbedEvent["DeletePersonalisedView"] = "deletePersonalisedView";
1356
+ /**
1357
+ * Emitted when a PersonalizedView is deleted.
1358
+ * @returns views: string[]
1359
+ * @returns liveboardId: string
1360
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
1361
+ */
1362
+ EmbedEvent["DeletePersonalizedView"] = "deletePersonalisedView";
1363
+ /**
1364
+ * Emitted when a user selects a different Personalized View or
1365
+ * resets to the original/default view on a Liveboard.
1366
+ * @example
1367
+ * ```js
1368
+ * liveboardEmbed.on(EmbedEvent.ChangePersonalizedView, (data) => {
1369
+ * console.log(data.viewName); // 'Q4 Revenue' or 'Original View'
1370
+ * console.log(data.viewId); // '2a021a12-...' or null (default)
1371
+ * console.log(data.liveboardId); // 'abc123...'
1372
+ * console.log(data.isPublic); // true | false
1373
+ * })
1374
+ * ```
1375
+ * @returns viewName: string - Name of the selected view,
1376
+ * or 'Original View' when reset to default.
1377
+ * @returns viewId: string | null - GUID of the selected view,
1378
+ * or null when reset to default.
1379
+ * @returns liveboardId: string
1380
+ * @returns isPublic: boolean
1381
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
1382
+ */
1383
+ EmbedEvent["ChangePersonalizedView"] = "changePersonalisedView";
1327
1384
  /**
1328
1385
  * Emitted when a user creates a Worksheet.
1329
1386
  * @version SDK: 1.27.0 | ThoughtSpot: 9.8.0.cl, 9.8.0.sw
@@ -1357,7 +1414,8 @@ var EmbedEvent;
1357
1414
  * @param - Includes the following parameters:
1358
1415
  * - `payload`: The payload received from the embed related to the Data API call.
1359
1416
  * - `responder`: Contains elements that let developers define whether ThoughtSpot
1360
- * will run or block the search operation, and if blocked, which error message to provide.
1417
+ * will run or block the search operation, and if blocked, which error message to
1418
+ * provide.
1361
1419
  * - `execute` - When `execute` returns `true`, the search is run.
1362
1420
  * When `execute` returns `false`, the search is not executed.
1363
1421
  * - `error` - Developers can customize the user-facing error message when `execute`
@@ -1791,6 +1849,25 @@ var EmbedEvent;
1791
1849
  * );
1792
1850
  * }
1793
1851
  * ```
1852
+ *
1853
+ * **Context Parameter (SDK: 1.45.2+)**
1854
+ *
1855
+ * Starting from SDK version 1.45.2 | ThoughtSpot: 26.3.0.cl, you can optionally pass a
1856
+ * `ContextType` as the third parameter to the `trigger` method to specify the context
1857
+ * from which the event is triggered. This helps ThoughtSpot understand the current page
1858
+ * context (Search, Answer, Liveboard, or Spotter) for better event handling.
1859
+ *
1860
+ * @example
1861
+ * ```js
1862
+ * import { HostEvent, ContextType } from '@thoughtspot/visual-embed-sdk';
1863
+ *
1864
+ * // Trigger Pin event with Search context
1865
+ * appEmbed.trigger(HostEvent.Pin, {
1866
+ * vizId: "123",
1867
+ * liveboardId: "456"
1868
+ * }, ContextType.Search);
1869
+ * ```
1870
+ *
1794
1871
  * @group Events
1795
1872
  */
1796
1873
  var HostEvent;
@@ -1813,6 +1890,16 @@ var HostEvent;
1813
1890
  execute: true
1814
1891
  });
1815
1892
  * ```
1893
+ * @example
1894
+ * ```js
1895
+ * // Trigger search from search context
1896
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
1897
+ * appEmbed.trigger(HostEvent.Search, {
1898
+ * searchQuery: "[revenue] by [region]",
1899
+ * dataSources: ["cd252e5c-b552-49a8-821d-3eadaa049cca"],
1900
+ * execute: true
1901
+ * }, ContextType.Search);
1902
+ * ```
1816
1903
  */
1817
1904
  HostEvent["Search"] = "search";
1818
1905
  /**
@@ -1863,6 +1950,24 @@ var HostEvent;
1863
1950
  * });
1864
1951
  * })
1865
1952
  * ```
1953
+ * @example
1954
+ * ```js
1955
+ * // Drill down from answer context
1956
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
1957
+ * appEmbed.trigger(HostEvent.DrillDown, {
1958
+ * points: { clickedPoint, selectedPoints },
1959
+ * autoDrillDown: true
1960
+ * }, ContextType.Answer);
1961
+ * ```
1962
+ * @example
1963
+ * ```js
1964
+ * // Drill down from search context
1965
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
1966
+ * searchEmbed.trigger(HostEvent.DrillDown, {
1967
+ * points: { clickedPoint, selectedPoints },
1968
+ * columnGuid: "column-guid"
1969
+ * }, ContextType.Search);
1970
+ * ```
1866
1971
  * @version SDK: 1.5.0 | ThoughtSpot: ts7.oct.cl, 7.2.1
1867
1972
  */
1868
1973
  HostEvent["DrillDown"] = "triggerDrillDown";
@@ -1883,6 +1988,13 @@ var HostEvent;
1883
1988
  * const url = embed.trigger(HostEvent.GetIframeUrl);
1884
1989
  * console.log("iFrameURL",url);
1885
1990
  * ```
1991
+ * @example
1992
+ * ```js
1993
+ * // Get iframe URL from specific context
1994
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
1995
+ * const url = await appEmbed.trigger(HostEvent.GetIframeUrl, {}, ContextType.Answer);
1996
+ * console.log("iFrameURL", url);
1997
+ * ```
1886
1998
  * @version SDK: 1.35.0 | ThoughtSpot: 10.4.0.cl
1887
1999
  */
1888
2000
  HostEvent["GetIframeUrl"] = "GetIframeUrl";
@@ -1896,6 +2008,15 @@ var HostEvent;
1896
2008
  * '730496d6-6903-4601-937e-2c691821af3c',
1897
2009
  * 'd547ec54-2a37-4516-a222-2b06719af726'])
1898
2010
  * ```
2011
+ * @example
2012
+ * ```js
2013
+ * // Set visible vizs from liveboard context
2014
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2015
+ * liveboardEmbed.trigger(HostEvent.SetVisibleVizs, [
2016
+ * '730496d6-6903-4601-937e-2c691821af3c',
2017
+ * 'd547ec54-2a37-4516-a222-2b06719af726'
2018
+ * ], ContextType.Liveboard);
2019
+ * ```
1899
2020
  * @version SDK: 1.6.0 | ThoughtSpot: ts8.nov.cl, 8.4.1.sw
1900
2021
  */
1901
2022
  HostEvent["SetVisibleVizs"] = "SetPinboardVisibleVizs";
@@ -1908,6 +2029,14 @@ var HostEvent;
1908
2029
  * tabId:'730496d6-6903-4601-937e-2c691821af3c'
1909
2030
  * })
1910
2031
  * ```
2032
+ * @example
2033
+ * ```js
2034
+ * // Set active tab from liveboard context
2035
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2036
+ * liveboardEmbed.trigger(HostEvent.SetActiveTab, {
2037
+ * tabId: '730496d6-6903-4601-937e-2c691821af3c'
2038
+ * }, ContextType.Liveboard);
2039
+ * ```
1911
2040
  * @version SDK: 1.24.0 | ThoughtSpot: 9.5.0.cl, 9.5.1-sw
1912
2041
  */
1913
2042
  HostEvent["SetActiveTab"] = "SetActiveTab";
@@ -1941,6 +2070,15 @@ var HostEvent;
1941
2070
  * {columnName: "item type",operator: RuntimeFilterOp.EQ,values: ["Jackets"]}
1942
2071
  * ])
1943
2072
  * ```
2073
+ * @example
2074
+ * ```js
2075
+ * // Update runtime filters from liveboard context
2076
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2077
+ * liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
2078
+ * {columnName: "region", operator: RuntimeFilterOp.EQ, values: ["west"]},
2079
+ * {columnName: "product", operator: RuntimeFilterOp.IN, values: ["shoes", "boots"]}
2080
+ * ], ContextType.Liveboard);
2081
+ * ```
1944
2082
  * @version SDK: 1.9.0 | ThoughtSpot: 8.1.0.cl, 8.4.1.sw
1945
2083
  * @important
1946
2084
  */
@@ -1974,6 +2112,14 @@ var HostEvent;
1974
2112
  * LiveboardEmbed.trigger(HostEvent.OpenFilter,
1975
2113
  * { column: {columnId: '<column-GUID>'}})
1976
2114
  * ```
2115
+ * @example
2116
+ * ```js
2117
+ * // Open filter from search context
2118
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2119
+ * searchEmbed.trigger(HostEvent.OpenFilter, {
2120
+ * column: { columnId: '<column-GUID>', name: 'region', type: 'ATTRIBUTE', dataType: 'CHAR'}
2121
+ * }, ContextType.Search);
2122
+ * ```
1977
2123
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
1978
2124
  */
1979
2125
  HostEvent["OpenFilter"] = "openFilter";
@@ -1984,6 +2130,14 @@ var HostEvent;
1984
2130
  * ```js
1985
2131
  * searchEmbed.trigger(HostEvent.AddColumns, { columnIds: ['<column-GUID>','<column-GUID>'] })
1986
2132
  * ```
2133
+ * @example
2134
+ * ```js
2135
+ * // Add columns from search context
2136
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2137
+ * searchEmbed.trigger(HostEvent.AddColumns, {
2138
+ * columnIds: ['col-guid-1', 'col-guid-2']
2139
+ * }, ContextType.Search);
2140
+ * ```
1987
2141
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
1988
2142
  */
1989
2143
  HostEvent["AddColumns"] = "addColumns";
@@ -1994,6 +2148,14 @@ var HostEvent;
1994
2148
  * ```js
1995
2149
  * searchEmbed.trigger(HostEvent.RemoveColumn, { columnId: '<column-Guid>' })
1996
2150
  * ```
2151
+ * @example
2152
+ * ```js
2153
+ * // Remove column from search context
2154
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2155
+ * searchEmbed.trigger(HostEvent.RemoveColumn, {
2156
+ * columnId: 'column-guid'
2157
+ * }, ContextType.Search);
2158
+ * ```
1997
2159
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl
1998
2160
  */
1999
2161
  HostEvent["RemoveColumn"] = "removeColumn";
@@ -2080,6 +2242,37 @@ var HostEvent;
2080
2242
  *
2081
2243
  * spotterEmbed.trigger(HostEvent.Pin, { vizId: latestSpotterVizId });
2082
2244
  * ```
2245
+ * @example
2246
+ * ```js
2247
+ * // Using context parameter to specify the context type (SDK: 1.45.2+)
2248
+ * // Pin from a search answer context
2249
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2250
+ * appEmbed.trigger(HostEvent.Pin, {
2251
+ * vizId: "123",
2252
+ * newVizName: "Sales by region",
2253
+ * liveboardId: "456"
2254
+ * }, ContextType.Search);
2255
+ * ```
2256
+ * @example
2257
+ * ```js
2258
+ * // Pin from an answer context (explore modal/page) (SDK: 1.45.2+)
2259
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2260
+ * appEmbed.trigger(HostEvent.Pin, {
2261
+ * vizId: "789",
2262
+ * newVizName: "Revenue trends",
2263
+ * liveboardId: "456"
2264
+ * }, ContextType.Answer);
2265
+ * ```
2266
+ * @example
2267
+ * ```js
2268
+ * // Pin from a spotter context (SDK: 1.45.2+)
2269
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2270
+ * appEmbed.trigger(HostEvent.Pin, {
2271
+ * vizId: latestSpotterVizId,
2272
+ * newVizName: "AI-generated insights",
2273
+ * liveboardId: "456"
2274
+ * }, ContextType.Spotter);
2275
+ * ```
2083
2276
  *
2084
2277
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2085
2278
  */
@@ -2090,6 +2283,12 @@ var HostEvent;
2090
2283
  * @example
2091
2284
  * ```js
2092
2285
  * liveboardEmbed.trigger(HostEvent.LiveboardInfo)
2286
+ *```
2287
+ * @example
2288
+ * ```js
2289
+ * // Show liveboard info from liveboard context
2290
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2291
+ * liveboardEmbed.trigger(HostEvent.LiveboardInfo, {}, ContextType.Liveboard);
2093
2292
  * ```
2094
2293
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2095
2294
  */
@@ -2100,6 +2299,12 @@ var HostEvent;
2100
2299
  * ```js
2101
2300
  * liveboardEmbed.trigger(HostEvent.Schedule)
2102
2301
  * ```
2302
+ * @example
2303
+ * ```js
2304
+ * // Schedule from liveboard context
2305
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2306
+ * liveboardEmbed.trigger(HostEvent.Schedule, {}, ContextType.Liveboard);
2307
+ * ```
2103
2308
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2104
2309
  */
2105
2310
  HostEvent["Schedule"] = "subscription";
@@ -2109,6 +2314,12 @@ var HostEvent;
2109
2314
  * ```js
2110
2315
  * liveboardEmbed.trigger(HostEvent.ScheduleList)
2111
2316
  * ```
2317
+ * @example
2318
+ * ```js
2319
+ * // Manage schedules from liveboard context
2320
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2321
+ * liveboardEmbed.trigger(HostEvent.ScheduleList, {}, ContextType.Liveboard);
2322
+ * ```
2112
2323
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2113
2324
  */
2114
2325
  HostEvent["SchedulesList"] = "schedule-list";
@@ -2119,6 +2330,18 @@ var HostEvent;
2119
2330
  * ```js
2120
2331
  * liveboardEmbed.trigger(HostEvent.ExportTML)
2121
2332
  * ```
2333
+ * @example
2334
+ * ```js
2335
+ * // Export TML from liveboard context
2336
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2337
+ * liveboardEmbed.trigger(HostEvent.ExportTML, {}, ContextType.Liveboard);
2338
+ * ```
2339
+ * @example
2340
+ * ```js
2341
+ * // Export TML from search-answer context
2342
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2343
+ * appEmbed.trigger(HostEvent.ExportTML, {}, ContextType.Search);
2344
+ * ```
2122
2345
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2123
2346
  */
2124
2347
  HostEvent["ExportTML"] = "exportTSL";
@@ -2129,6 +2352,18 @@ var HostEvent;
2129
2352
  * ```js
2130
2353
  * liveboardEmbed.trigger(HostEvent.EditTML)
2131
2354
  * ```
2355
+ * @example
2356
+ * ```js
2357
+ * // Edit TML from liveboard context
2358
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2359
+ * liveboardEmbed.trigger(HostEvent.EditTML, {}, ContextType.Liveboard);
2360
+ * ```
2361
+ * @example
2362
+ * ```js
2363
+ * // Edit TML from search-answer context
2364
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2365
+ * appEmbed.trigger(HostEvent.EditTML, {}, ContextType.Search);
2366
+ * ```
2132
2367
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2133
2368
  */
2134
2369
  HostEvent["EditTML"] = "editTSL";
@@ -2138,6 +2373,12 @@ var HostEvent;
2138
2373
  * ```js
2139
2374
  * liveboardEmbed.trigger(HostEvent.UpdateTML)
2140
2375
  * ```
2376
+ * @example
2377
+ * ```js
2378
+ * // Update TML from liveboard context
2379
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2380
+ * liveboardEmbed.trigger(HostEvent.UpdateTML, {}, ContextType.Liveboard);
2381
+ * ```
2141
2382
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2142
2383
  */
2143
2384
  HostEvent["UpdateTML"] = "updateTSL";
@@ -2164,6 +2405,18 @@ var HostEvent;
2164
2405
  *
2165
2406
  * spotterEmbed.trigger(HostEvent.DownloadAsPdf, { vizId: latestSpotterVizId });
2166
2407
  * ```
2408
+ * @example
2409
+ * ```js
2410
+ * // Download as PDF from search-answer context
2411
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2412
+ * appEmbed.trigger(HostEvent.DownloadAsPdf, {}, ContextType.Search);
2413
+ * ```
2414
+ * @example
2415
+ * ```js
2416
+ * // Download as PDF from liveboard context
2417
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2418
+ * liveboardEmbed.trigger(HostEvent.DownloadAsPdf, {}, ContextType.Liveboard);
2419
+ * ```
2167
2420
  *
2168
2421
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2169
2422
  */
@@ -2208,6 +2461,18 @@ var HostEvent;
2208
2461
  *
2209
2462
  * spotterEmbed.trigger(HostEvent.MakeACopy, { vizId: latestSpotterVizId });
2210
2463
  * ```
2464
+ * @example
2465
+ * ```js
2466
+ * // Make a copy from answer context
2467
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2468
+ * appEmbed.trigger(HostEvent.MakeACopy, {}, ContextType.Answer);
2469
+ * ```
2470
+ * @example
2471
+ * ```js
2472
+ * // Make a copy from search context
2473
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2474
+ * appEmbed.trigger(HostEvent.MakeACopy, {}, ContextType.Search);
2475
+ * ```
2211
2476
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2212
2477
  */
2213
2478
  HostEvent["MakeACopy"] = "makeACopy";
@@ -2232,6 +2497,14 @@ var HostEvent;
2232
2497
  * ```js
2233
2498
  * liveboardEmbed.trigger(HostEvent.Explore, {vizId: '730496d6-6903-4601-937e-2c691821af3c'})
2234
2499
  * ```
2500
+ * @example
2501
+ * ```js
2502
+ * // Explore from liveboard context
2503
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2504
+ * liveboardEmbed.trigger(HostEvent.Explore, {
2505
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2506
+ * }, ContextType.Liveboard);
2507
+ * ```
2235
2508
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2236
2509
  */
2237
2510
  HostEvent["Explore"] = "explore";
@@ -2249,6 +2522,20 @@ var HostEvent;
2249
2522
  * ```js
2250
2523
  * searchEmbed.trigger(HostEvent.CreateMonitor)
2251
2524
  * ```
2525
+ * @example
2526
+ * ```js
2527
+ * // Create monitor from answer context
2528
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2529
+ * appEmbed.trigger(HostEvent.CreateMonitor, {}, ContextType.Answer);
2530
+ * ```
2531
+ * @example
2532
+ * ```js
2533
+ * // Create monitor from liveboard context
2534
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2535
+ * liveboardEmbed.trigger(HostEvent.CreateMonitor, {
2536
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2537
+ * }, ContextType.Liveboard);
2538
+ * ```
2252
2539
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2253
2540
  */
2254
2541
  HostEvent["CreateMonitor"] = "createMonitor";
@@ -2270,6 +2557,20 @@ var HostEvent;
2270
2557
  * ```js
2271
2558
  * vizEmbed.trigger(HostEvent.ManageMonitor)
2272
2559
  * ```
2560
+ * @example
2561
+ * ```js
2562
+ * // Manage monitor from answer context
2563
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2564
+ * appEmbed.trigger(HostEvent.ManageMonitor, {}, ContextType.Answer);
2565
+ * ```
2566
+ * @example
2567
+ * ```js
2568
+ * // Manage monitor from liveboard context
2569
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2570
+ * liveboardEmbed.trigger(HostEvent.ManageMonitor, {
2571
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2572
+ * }, ContextType.Liveboard);
2573
+ * ```
2273
2574
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2274
2575
  */
2275
2576
  HostEvent["ManageMonitor"] = "manageMonitor";
@@ -2295,6 +2596,26 @@ var HostEvent;
2295
2596
  * ```js
2296
2597
  * spotterEmbed.trigger(HostEvent.Edit);
2297
2598
  * ```
2599
+ * @example
2600
+ * ```js
2601
+ * // Using context parameter to edit liveboard context
2602
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2603
+ * liveboardEmbed.trigger(HostEvent.Edit, {}, ContextType.Liveboard);
2604
+ * ```
2605
+ * @example
2606
+ * ```js
2607
+ * // Edit from search context
2608
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2609
+ * appEmbed.trigger(HostEvent.Edit, {}, ContextType.Search);
2610
+ * ```
2611
+ * * @example
2612
+ * ```js
2613
+ * // Edit from spotter context
2614
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2615
+ * appEmbed.trigger(HostEvent.Edit, {
2616
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2617
+ * }, ContextType.Spotter);
2618
+ * ```
2298
2619
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2299
2620
  */
2300
2621
  HostEvent["Edit"] = "edit";
@@ -2312,6 +2633,20 @@ var HostEvent;
2312
2633
  * ```js
2313
2634
  * vizEmbed.trigger(HostEvent.CopyLink)
2314
2635
  * ```
2636
+ * @example
2637
+ * ```js
2638
+ * // Copy link from liveboard context
2639
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2640
+ * liveboardEmbed.trigger(HostEvent.CopyLink, {}, ContextType.Liveboard);
2641
+ * ```
2642
+ * @example
2643
+ * ```js
2644
+ * // Copy link from liveboard visualization context
2645
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2646
+ * liveboardEmbed.trigger(HostEvent.CopyLink, {
2647
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2648
+ * }, ContextType.Liveboard);
2649
+ * ```
2315
2650
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2316
2651
  */
2317
2652
  HostEvent["CopyLink"] = "embedDocument";
@@ -2329,6 +2664,20 @@ var HostEvent;
2329
2664
  * ```js
2330
2665
  * vizEmbed.trigger(HostEvent.Present)
2331
2666
  * ```
2667
+ * @example
2668
+ * ```js
2669
+ * // Present from liveboard visualization context
2670
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2671
+ * liveboardEmbed.trigger(HostEvent.Present, {
2672
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2673
+ * }, ContextType.Liveboard);
2674
+ * ```
2675
+ * @example
2676
+ * ```js
2677
+ * // Present from liveboard context
2678
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2679
+ * liveboardEmbed.trigger(HostEvent.Present, {}, ContextType.Liveboard);
2680
+ * ```
2332
2681
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2333
2682
  */
2334
2683
  HostEvent["Present"] = "present";
@@ -2357,6 +2706,22 @@ var HostEvent;
2357
2706
  * tml.answer.search_query // TML representation of the search query
2358
2707
  * );
2359
2708
  * })
2709
+ * ```
2710
+ * @example
2711
+ * ```js
2712
+ * // Get TML from search context
2713
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2714
+ * appEmbed.trigger(HostEvent.GetTML, {}, ContextType.Search).then((tml) => {
2715
+ * console.log(tml.answer.search_query);
2716
+ * });
2717
+ * ```
2718
+ * @example
2719
+ * ```js
2720
+ * // Get TML from search-answer context
2721
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2722
+ * appEmbed.trigger(HostEvent.GetTML, {}, ContextType.Search).then((tml) => {
2723
+ * console.log(tml.answer);
2724
+ * });
2360
2725
  * ```
2361
2726
  * @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
2362
2727
  * @important
@@ -2378,6 +2743,20 @@ var HostEvent;
2378
2743
  * ```js
2379
2744
  * searchEmbed.trigger(HostEvent.ShowUnderlyingData)
2380
2745
  * ```
2746
+ * @example
2747
+ * ```js
2748
+ * // Show underlying data from liveboard visualization context
2749
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2750
+ * appEmbed.trigger(HostEvent.ShowUnderlyingData, {
2751
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2752
+ * }, ContextType.Liveboard);
2753
+ * ```
2754
+ * @example
2755
+ * ```js
2756
+ * // Show underlying data from search context
2757
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2758
+ * appEmbed.trigger(HostEvent.ShowUnderlyingData, {}, ContextType.Search);
2759
+ * ```
2381
2760
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2382
2761
  */
2383
2762
  HostEvent["ShowUnderlyingData"] = "showUnderlyingData";
@@ -2395,6 +2774,18 @@ var HostEvent;
2395
2774
  * ```js
2396
2775
  * searchEmbed.trigger(HostEvent.Delete)
2397
2776
  * ```
2777
+ * @example
2778
+ * ```js
2779
+ * // Delete from liveboard context
2780
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2781
+ * liveboardEmbed.trigger(HostEvent.Delete, {}, ContextType.Liveboard);
2782
+ * ```
2783
+ * @example
2784
+ * ```js
2785
+ * // Delete from search context
2786
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2787
+ * appEmbed.trigger(HostEvent.Delete, {}, ContextType.Search);
2788
+ * ```
2398
2789
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2399
2790
  */
2400
2791
  HostEvent["Delete"] = "onDeleteAnswer";
@@ -2415,6 +2806,20 @@ var HostEvent;
2415
2806
  * ```js
2416
2807
  * searchEmbed.trigger(HostEvent.SpotIQAnalyze)
2417
2808
  * ```
2809
+ * @example
2810
+ * ```js
2811
+ * // SpotIQ analyze from search-answer context
2812
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2813
+ * appEmbed.trigger(HostEvent.SpotIQAnalyze, { vizId: '730496d6-6903-4601-937e-2c691821af3c' }, ContextType.Search);
2814
+ * ```
2815
+ * @example
2816
+ * ```js
2817
+ * // SpotIQ analyze from search context
2818
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2819
+ * liveboardEmbed.trigger(HostEvent.SpotIQAnalyze, {
2820
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2821
+ * }, ContextType.Liveboard);
2822
+ * ```
2418
2823
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2419
2824
  */
2420
2825
  HostEvent["SpotIQAnalyze"] = "spotIQAnalyze";
@@ -2466,9 +2871,16 @@ var HostEvent;
2466
2871
  *
2467
2872
  * spotterEmbed.trigger(HostEvent.DownloadAsPng, { vizId: latestSpotterVizId });
2468
2873
  * ```
2874
+ * @example
2875
+ * ```js
2876
+ * // Download as PNG from search-answer context
2877
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2878
+ * appEmbed.trigger(HostEvent.DownloadAsPng, {}, ContextType.Search);
2879
+ * ```
2469
2880
  *
2470
2881
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
2471
2882
  */
2883
+ // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
2472
2884
  HostEvent["DownloadAsPng"] = "downloadAsPng";
2473
2885
  /**
2474
2886
  * Trigger the **Download** > **CSV** action on tables in
@@ -2494,6 +2906,18 @@ var HostEvent;
2494
2906
  *
2495
2907
  * spotterEmbed.trigger(HostEvent.DownloadAsCsv, { vizId: latestSpotterVizId });
2496
2908
  * ```
2909
+ * @example
2910
+ * ```js
2911
+ * // Download as CSV from search-answer context
2912
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2913
+ * appEmbed.trigger(HostEvent.DownloadAsCsv, {}, ContextType.Search);
2914
+ * ```
2915
+ * @example
2916
+ * ```js
2917
+ * // Download as CSV from search context
2918
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2919
+ * searchEmbed.trigger(HostEvent.DownloadAsCsv, {}, ContextType.Search);
2920
+ * ```
2497
2921
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2498
2922
  */
2499
2923
  HostEvent["DownloadAsCsv"] = "downloadAsCSV";
@@ -2521,6 +2945,18 @@ var HostEvent;
2521
2945
  *
2522
2946
  * spotterEmbed.trigger(HostEvent.DownloadAsXlsx, { vizId: latestSpotterVizId });
2523
2947
  * ```
2948
+ * @example
2949
+ * ```js
2950
+ * // Download as XLSX from answer context
2951
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2952
+ * appEmbed.trigger(HostEvent.DownloadAsXlsx, {}, ContextType.Answer);
2953
+ * ```
2954
+ * @example
2955
+ * ```js
2956
+ * // Download as XLSX from search context
2957
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2958
+ * searchEmbed.trigger(HostEvent.DownloadAsXlsx, {}, ContextType.Search);
2959
+ * ```
2524
2960
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2525
2961
  */
2526
2962
  HostEvent["DownloadAsXlsx"] = "downloadAsXLSX";
@@ -2534,6 +2970,18 @@ var HostEvent;
2534
2970
  * ```js
2535
2971
  * searchEmbed.trigger(HostEvent.Share)
2536
2972
  * ```
2973
+ * @example
2974
+ * ```js
2975
+ * // Share from Liveboard context
2976
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2977
+ * liveboardEmbed.trigger(HostEvent.Share, {}, ContextType.Liveboard);
2978
+ * ```
2979
+ * @example
2980
+ * ```js
2981
+ * // Share from search-answer context
2982
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
2983
+ * appEmbed.trigger(HostEvent.Share, {}, ContextType.Search);
2984
+ * ```
2537
2985
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2538
2986
  */
2539
2987
  HostEvent["Share"] = "share";
@@ -2573,6 +3021,18 @@ var HostEvent;
2573
3021
  *
2574
3022
  * spotterEmbed.trigger(HostEvent.Save, { vizId: latestSpotterVizId });
2575
3023
  * ```
3024
+ * @example
3025
+ * ```js
3026
+ * // Save from answer context
3027
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3028
+ * appEmbed.trigger(HostEvent.Save, {}, ContextType.Answer);
3029
+ * ```
3030
+ * @example
3031
+ * ```js
3032
+ * // Save from search context
3033
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3034
+ * searchEmbed.trigger(HostEvent.Save, {}, ContextType.Search);
3035
+ * ```
2576
3036
  *
2577
3037
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2578
3038
  */
@@ -2589,6 +3049,20 @@ var HostEvent;
2589
3049
  * ```js
2590
3050
  * vizEmbed.trigger(HostEvent.SyncToSheets)
2591
3051
  * ```
3052
+ * @example
3053
+ * ```js
3054
+ * // Sync to sheets from answer context
3055
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3056
+ * appEmbed.trigger(HostEvent.SyncToSheets, {}, ContextType.Answer);
3057
+ * ```
3058
+ * @example
3059
+ * ```js
3060
+ * // Sync to sheets from liveboard context
3061
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3062
+ * liveboardEmbed.trigger(HostEvent.SyncToSheets, {
3063
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
3064
+ * }, ContextType.Liveboard);
3065
+ * ```
2592
3066
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2593
3067
  */
2594
3068
  HostEvent["SyncToSheets"] = "sync-to-sheets";
@@ -2605,6 +3079,20 @@ var HostEvent;
2605
3079
  * ```js
2606
3080
  * vizEmbed.trigger(HostEvent.SyncToOtherApps)
2607
3081
  * ```
3082
+ * @example
3083
+ * ```js
3084
+ * // Sync to other apps from answer context
3085
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3086
+ * appEmbed.trigger(HostEvent.SyncToOtherApps, {}, ContextType.Answer);
3087
+ * ```
3088
+ * @example
3089
+ * ```js
3090
+ * // Sync to other apps from liveboard context
3091
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3092
+ * liveboardEmbed.trigger(HostEvent.SyncToOtherApps, {
3093
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
3094
+ * }, ContextType.Liveboard);
3095
+ * ```
2608
3096
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2609
3097
  */
2610
3098
  HostEvent["SyncToOtherApps"] = "sync-to-other-apps";
@@ -2621,6 +3109,20 @@ var HostEvent;
2621
3109
  * ```js
2622
3110
  * vizEmbed.trigger(HostEvent.ManagePipelines)
2623
3111
  * ```
3112
+ * @example
3113
+ * ```js
3114
+ * // Manage pipelines from answer context
3115
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3116
+ * appEmbed.trigger(HostEvent.ManagePipelines, {}, ContextType.Answer);
3117
+ * ```
3118
+ * @example
3119
+ * ```js
3120
+ * // Manage pipelines from liveboard context
3121
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3122
+ * liveboardEmbed.trigger(HostEvent.ManagePipelines, {
3123
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
3124
+ * }, ContextType.Liveboard);
3125
+ * ```
2624
3126
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2625
3127
  */
2626
3128
  HostEvent["ManagePipelines"] = "manage-pipeline";
@@ -2633,6 +3135,12 @@ var HostEvent;
2633
3135
  * ```js
2634
3136
  * appEmbed.trigger(HostEvent.ResetSearch)
2635
3137
  * ```
3138
+ * @example
3139
+ * ```js
3140
+ * // Reset search from search context
3141
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3142
+ * searchEmbed.trigger(HostEvent.ResetSearch, {}, ContextType.Search);
3143
+ * ```
2636
3144
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.0.1.sw
2637
3145
  */
2638
3146
  HostEvent["ResetSearch"] = "resetSearch";
@@ -2644,6 +3152,13 @@ var HostEvent;
2644
3152
  * const data = await liveboardEmbed.trigger(HostEvent.GetFilters);
2645
3153
  * console.log('data', data);
2646
3154
  * ```
3155
+ * @example
3156
+ * ```js
3157
+ * // Get filters from liveboard context
3158
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3159
+ * const data = await liveboardEmbed.trigger(HostEvent.GetFilters, {}, ContextType.Liveboard);
3160
+ * console.log('filters', data);
3161
+ * ```
2647
3162
  * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
2648
3163
  */
2649
3164
  HostEvent["GetFilters"] = "getFilters";
@@ -2651,7 +3166,8 @@ var HostEvent;
2651
3166
  * Update one or several filters applied on a Liveboard.
2652
3167
  * @param - Includes the following keys:
2653
3168
  * - `filter`: A single filter object containing column name, filter operator, and
2654
- * values. - `filters`: Multiple filter objects with column name, filter operator,
3169
+ * values.
3170
+ * - `filters`: Multiple filter objects with column name, filter operator,
2655
3171
  * and values for each.
2656
3172
  *
2657
3173
  * Each filter object must include the following attributes:
@@ -2734,6 +3250,18 @@ var HostEvent;
2734
3250
  * }]
2735
3251
  * });
2736
3252
  * ```
3253
+ * @example
3254
+ * ```js
3255
+ * // Update filters from liveboard context
3256
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3257
+ * liveboardEmbed.trigger(HostEvent.UpdateFilters, {
3258
+ * filter: {
3259
+ * column: "item type",
3260
+ * oper: "IN",
3261
+ * values: ["shoes", "boots"]
3262
+ * }
3263
+ * }, ContextType.Liveboard);
3264
+ * ```
2737
3265
  * @version SDK: 1.23.0 | ThoughtSpot: 9.4.0.cl
2738
3266
  */
2739
3267
  HostEvent["UpdateFilters"] = "updateFilters";
@@ -2747,6 +3275,14 @@ var HostEvent;
2747
3275
  * );
2748
3276
  * })
2749
3277
  * ```
3278
+ * @example
3279
+ * ```js
3280
+ * // Get tabs from liveboard context
3281
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3282
+ * liveboardEmbed.trigger(HostEvent.GetTabs, {}, ContextType.Liveboard).then((tabDetails) => {
3283
+ * console.log('tabs', tabDetails);
3284
+ * });
3285
+ * ```
2750
3286
  * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl
2751
3287
  */
2752
3288
  HostEvent["GetTabs"] = "getTabs";
@@ -2760,6 +3296,15 @@ var HostEvent;
2760
3296
  * '430496d6-6903-4601-937e-2c691821af3c',
2761
3297
  * 'f547ec54-2a37-4516-a222-2b06719af726'])
2762
3298
  * ```
3299
+ * @example
3300
+ * ```js
3301
+ * // Set visible tabs from liveboard context
3302
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3303
+ * liveboardEmbed.trigger(HostEvent.SetVisibleTabs, [
3304
+ * '430496d6-6903-4601-937e-2c691821af3c',
3305
+ * 'f547ec54-2a37-4516-a222-2b06719af726'
3306
+ * ], ContextType.Liveboard);
3307
+ * ```
2763
3308
  * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
2764
3309
  */
2765
3310
  HostEvent["SetVisibleTabs"] = "SetPinboardVisibleTabs";
@@ -2773,6 +3318,15 @@ var HostEvent;
2773
3318
  * '630496d6-6903-4601-937e-2c691821af3c',
2774
3319
  * 'i547ec54-2a37-4516-a222-2b06719af726'])
2775
3320
  * ```
3321
+ * @example
3322
+ * ```js
3323
+ * // Set hidden tabs from liveboard context
3324
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3325
+ * liveboardEmbed.trigger(HostEvent.SetHiddenTabs, [
3326
+ * '630496d6-6903-4601-937e-2c691821af3c',
3327
+ * 'i547ec54-2a37-4516-a222-2b06719af726'
3328
+ * ], ContextType.Liveboard);
3329
+ * ```
2776
3330
  * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 9.8.0.sw
2777
3331
  */
2778
3332
  HostEvent["SetHiddenTabs"] = "SetPinboardHiddenTabs";
@@ -2849,13 +3403,24 @@ var HostEvent;
2849
3403
  HostEvent["UpdateCrossFilter"] = "UpdateCrossFilter";
2850
3404
  /**
2851
3405
  * Trigger reset action for a personalized Liveboard view.
3406
+ * This event is deprecated. Use {@link HostEvent.ResetLiveboardPersonalizedView} instead.
2852
3407
  * @example
2853
3408
  * ```js
2854
3409
  * liveboardEmbed.trigger(HostEvent.ResetLiveboardPersonalisedView);
2855
3410
  * ```
2856
3411
  * @version SDK: 1.29.0 | ThoughtSpot Cloud: 10.1.0.cl, 10.1.0.sw
3412
+ * @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
2857
3413
  */
2858
3414
  HostEvent["ResetLiveboardPersonalisedView"] = "ResetLiveboardPersonalisedView";
3415
+ /**
3416
+ * Trigger reset action for a personalized Liveboard view.
3417
+ * @example
3418
+ * ```js
3419
+ * liveboardEmbed.trigger(HostEvent.ResetLiveboardPersonalizedView);
3420
+ * ```
3421
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
3422
+ */
3423
+ HostEvent["ResetLiveboardPersonalizedView"] = "ResetLiveboardPersonalisedView";
2859
3424
  /**
2860
3425
  * Triggers an action to update Parameter values on embedded
2861
3426
  * Answers, Liveboard, and Spotter answer in Edit mode.
@@ -2872,6 +3437,16 @@ var HostEvent;
2872
3437
  * isVisibleToUser: false
2873
3438
  * }])
2874
3439
  * ```
3440
+ * @example
3441
+ * ```js
3442
+ * // Update parameters from liveboard context
3443
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3444
+ * liveboardEmbed.trigger(HostEvent.UpdateParameters, [{
3445
+ * name: "Region Param",
3446
+ * value: "West",
3447
+ * isVisibleToUser: true
3448
+ * }], ContextType.Liveboard);
3449
+ * ```
2875
3450
  * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
2876
3451
  */
2877
3452
  HostEvent["UpdateParameters"] = "UpdateParameters";
@@ -2891,18 +3466,77 @@ var HostEvent;
2891
3466
  * });
2892
3467
  *
2893
3468
  * spotterEmbed.trigger(HostEvent.GetParameters, { vizId: latestSpotterVizId });
3469
+ *```
3470
+ * @example
3471
+ * ```js
3472
+ * // Get parameters from liveboard context
3473
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3474
+ * liveboardEmbed.trigger(HostEvent.GetParameters, {}, ContextType.Liveboard).then((parameters) => {
3475
+ * console.log('parameters', parameters);
3476
+ * });
2894
3477
  * ```
2895
3478
  * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
2896
3479
  */
2897
3480
  HostEvent["GetParameters"] = "GetParameters";
2898
3481
  /**
2899
3482
  * Triggers an event to update a personalized view of a Liveboard.
3483
+ * This event is deprecated. Use {@link HostEvent.UpdatePersonalizedView} instead.
2900
3484
  * ```js
2901
3485
  * liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {viewId: '1234'})
2902
3486
  * ```
3487
+ * @example
3488
+ * ```js
3489
+ * // Update personalized view from liveboard context
3490
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3491
+ * liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {
3492
+ * viewId: '1234'
3493
+ * }, ContextType.Liveboard);
3494
+ * ```
2903
3495
  * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
3496
+ * @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
2904
3497
  */
2905
3498
  HostEvent["UpdatePersonalisedView"] = "UpdatePersonalisedView";
3499
+ /**
3500
+ * Triggers an event to update a personalized view of a Liveboard.
3501
+ * ```js
3502
+ * liveboardEmbed.trigger(HostEvent.UpdatePersonalisedView, {viewId: '1234'})
3503
+ * ```
3504
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
3505
+ */
3506
+ HostEvent["UpdatePersonalizedView"] = "UpdatePersonalisedView";
3507
+ /**
3508
+ * Triggers selection of a specific Personalized View on a
3509
+ * Liveboard without reloading the embed. Pass either a
3510
+ * `viewId` (GUID) or `viewName`. If both are provided, `viewId` takes precedence.
3511
+ * If neither is provided, the Liveboard resets to the original/default view.
3512
+ * When a `viewName` is provided and multiple views share
3513
+ * the same name, the first match is selected.
3514
+ * @example
3515
+ * ```js
3516
+ * liveboardEmbed.trigger(
3517
+ * HostEvent.SelectPersonalizedView,
3518
+ * { viewId: '2a021a12-1aed-425d-984b-141ee916ce72' },
3519
+ * )
3520
+ * ```
3521
+ * @example
3522
+ * ```js
3523
+ * // Select by name
3524
+ * liveboardEmbed.trigger(
3525
+ * HostEvent.SelectPersonalizedView,
3526
+ * { viewName: 'Dr Smith Cardiology' },
3527
+ * )
3528
+ * ```
3529
+ * @example
3530
+ * ```js
3531
+ * // Reset to default view
3532
+ * liveboardEmbed.trigger(
3533
+ * HostEvent.SelectPersonalizedView,
3534
+ * {},
3535
+ * )
3536
+ * ```
3537
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
3538
+ */
3539
+ HostEvent["SelectPersonalizedView"] = "SelectPersonalisedView";
2906
3540
  /**
2907
3541
  * @hidden
2908
3542
  * Notify when info call is completed successfully
@@ -2922,7 +3556,8 @@ var HostEvent;
2922
3556
  * add a name and description for the Answer.
2923
3557
  * @param - Includes the following keys:
2924
3558
  * - `vizId`: Refers to the Answer ID in Spotter embed and is **required** in Spotter
2925
- * embed. - `name`: Optional. Name string for the Answer.
3559
+ * embed.
3560
+ * - `name`: Optional. Name string for the Answer.
2926
3561
  * - `description`: Optional. Description text for the Answer.
2927
3562
  * @example
2928
3563
  * ```js
@@ -2941,6 +3576,34 @@ var HostEvent;
2941
3576
  *
2942
3577
  * spotterEmbed.trigger(HostEvent.SaveAnswer, { vizId: latestSpotterVizId });
2943
3578
  * ```
3579
+ * @example
3580
+ * ```js
3581
+ * // Using context parameter to save answer from search context
3582
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3583
+ * const saveAnswerResponse = await appEmbed.trigger(HostEvent.SaveAnswer, {
3584
+ * name: "Regional sales analysis",
3585
+ * description: "Sales breakdown by region"
3586
+ * }, ContextType.Search);
3587
+ * ```
3588
+ * @example
3589
+ * ```js
3590
+ * // Save answer from answer context (explore modal)
3591
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3592
+ * const saveAnswerResponse = await appEmbed.trigger(HostEvent.SaveAnswer, {
3593
+ * name: "Modified analysis",
3594
+ * description: "Updated from explore view"
3595
+ * }, ContextType.Answer);
3596
+ * ```
3597
+ * @example
3598
+ * ```js
3599
+ * // Save answer from spotter context
3600
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3601
+ * const saveAnswerResponse = await appEmbed.trigger(HostEvent.SaveAnswer, {
3602
+ * vizId: latestSpotterVizId,
3603
+ * name: "AI insights",
3604
+ * description: "Generated from Spotter"
3605
+ * }, ContextType.Spotter);
3606
+ * ```
2944
3607
  * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
2945
3608
  */
2946
3609
  HostEvent["SaveAnswer"] = "saveAnswer";
@@ -2982,6 +3645,15 @@ var HostEvent;
2982
3645
  * executeSearch: true,
2983
3646
  * })
2984
3647
  * ```
3648
+ * @example
3649
+ * ```js
3650
+ * // Spotter search from spotter context
3651
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3652
+ * spotterEmbed.trigger(HostEvent.SpotterSearch, {
3653
+ * query: 'sales by region',
3654
+ * executeSearch: true
3655
+ * }, ContextType.Spotter);
3656
+ * ```
2985
3657
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
2986
3658
  */
2987
3659
  HostEvent["SpotterSearch"] = "SpotterSearch";
@@ -2992,6 +3664,12 @@ var HostEvent;
2992
3664
  * ```js
2993
3665
  * spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year");
2994
3666
  * ```
3667
+ * @example
3668
+ * ```js
3669
+ * // Edit last prompt from spotter context
3670
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3671
+ * spotterEmbed.trigger(HostEvent.EditLastPrompt, "sales by region", ContextType.Spotter);
3672
+ * ```
2995
3673
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
2996
3674
  */
2997
3675
  HostEvent["EditLastPrompt"] = "EditLastPrompt";
@@ -3001,6 +3679,12 @@ var HostEvent;
3001
3679
  * ```js
3002
3680
  * spotterEmbed.trigger(HostEvent.PreviewSpotterData);
3003
3681
  * ```
3682
+ * @example
3683
+ * ```js
3684
+ * // Preview spotter data from spotter context
3685
+ * import { ContextType } from '@thoughtspot/visual-embed-sdk';
3686
+ * spotterEmbed.trigger(HostEvent.PreviewSpotterData, {}, ContextType.Spotter);
3687
+ * ```
3004
3688
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
3005
3689
  */
3006
3690
  HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
@@ -3759,6 +4443,7 @@ var Action;
3759
4443
  * disabledActions: [Action.LiveboardInfo]
3760
4444
  * ```
3761
4445
  */
4446
+ // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
3762
4447
  Action["LiveboardInfo"] = "pinboardInfo";
3763
4448
  /**
3764
4449
  * @hidden
@@ -3789,6 +4474,7 @@ var Action;
3789
4474
  * disabledActions: [Action.Subscription]
3790
4475
  * ```
3791
4476
  */
4477
+ // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
3792
4478
  Action["Subscription"] = "subscription";
3793
4479
  /**
3794
4480
  * The **Explore** action on Liveboard visualizations
@@ -4268,13 +4954,25 @@ var Action;
4268
4954
  /**
4269
4955
  * The Liveboard Personalised Views dropdown.
4270
4956
  * Allows navigating to a personalized Liveboard View.
4957
+ * This action is deprecated. Use {@link Action.PersonalizedViewsDropdown} instead.
4271
4958
  * @example
4272
4959
  * ```js
4273
4960
  * disabledActions: [Action.PersonalisedViewsDropdown]
4274
4961
  * ```
4275
4962
  * @version SDK: 1.26.0 | ThoughtSpot: 9.7.0.cl, 10.1.0.sw
4963
+ * @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
4276
4964
  */
4277
4965
  Action["PersonalisedViewsDropdown"] = "personalisedViewsDropdown";
4966
+ /**
4967
+ * The Liveboard Personalized Views dropdown.
4968
+ * Allows navigating to a personalized Liveboard View.
4969
+ * @example
4970
+ * ```js
4971
+ * disabledActions: [Action.PersonalizedViewsDropdown]
4972
+ * ```
4973
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
4974
+ */
4975
+ Action["PersonalizedViewsDropdown"] = "personalisedViewsDropdown";
4278
4976
  /**
4279
4977
  * Action ID for show or hide the user details on a
4280
4978
  * Liveboard (Recently visited / social proof)
@@ -4362,14 +5060,27 @@ var Action;
4362
5060
  /**
4363
5061
  * The **Organize Favourites** action on Homepage
4364
5062
  * *Favorites* module.
5063
+ * This action is deprecated. Use {@link Action.OrganizeFavorites} instead.
4365
5064
  *
4366
5065
  * @example
4367
5066
  * ```js
4368
5067
  * disabledActions: [Action.OrganiseFavourites]
4369
5068
  * ```
4370
5069
  * @version SDK: 1.32.0 | ThoughtSpot: 10.0.0.cl
5070
+ * @deprecated SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
4371
5071
  */
4372
5072
  Action["OrganiseFavourites"] = "organiseFavourites";
5073
+ /**
5074
+ * The **Organize Favorites** action on Homepage
5075
+ * *Favorites* module.
5076
+ *
5077
+ * @example
5078
+ * ```js
5079
+ * disabledActions: [Action.OrganizeFavorites]
5080
+ * ```
5081
+ * @version SDK: 1.48.0 | ThoughtSpot: 26.5.0.cl
5082
+ */
5083
+ Action["OrganizeFavorites"] = "organiseFavourites";
4373
5084
  /**
4374
5085
  * The **AI Highlights** action on a Liveboard.
4375
5086
  *
@@ -5119,6 +5830,22 @@ var EmbedErrorCodes;
5119
5830
  /** Invalid URL provided in configuration */
5120
5831
  EmbedErrorCodes["INVALID_URL"] = "INVALID_URL";
5121
5832
  })(EmbedErrorCodes || (EmbedErrorCodes = {}));
5833
+ /**
5834
+ * Context types for specifying the page context when triggering host events.
5835
+ * Used as the third parameter in the `trigger` method to help ThoughtSpot
5836
+ * understand the current page context for better event handling.
5837
+ *
5838
+ * @example
5839
+ * ```js
5840
+ * import { HostEvent, ContextType } from '@thoughtspot/visual-embed-sdk';
5841
+ *
5842
+ * // Trigger an event with specific context
5843
+ * embed.trigger(HostEvent.Pin, { vizId: "123", liveboardId: "456" }, ContextType.Search);
5844
+ * ```
5845
+ *
5846
+ * @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
5847
+ * @group Events
5848
+ */
5122
5849
  var ContextType;
5123
5850
  (function (ContextType) {
5124
5851
  /**
@@ -5137,6 +5864,10 @@ var ContextType;
5137
5864
  * Spotter context for spotter modal/page.
5138
5865
  */
5139
5866
  ContextType["Spotter"] = "spotter";
5867
+ /**
5868
+ * Other context for any other generic page.
5869
+ */
5870
+ ContextType["Other"] = "other";
5140
5871
  })(ContextType || (ContextType = {}));
5141
5872
  /**
5142
5873
  * Enum for the type of API intercepted
@@ -8119,6 +8850,13 @@ var UIPassthroughEvent;
8119
8850
  UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
8120
8851
  UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
8121
8852
  UIPassthroughEvent["GetUnsavedAnswerTML"] = "getUnsavedAnswerTML";
8853
+ UIPassthroughEvent["GetAnswerSession"] = "getAnswerSession";
8854
+ UIPassthroughEvent["GetFilters"] = "getFilters";
8855
+ UIPassthroughEvent["GetIframeUrl"] = "getIframeUrl";
8856
+ UIPassthroughEvent["GetParameters"] = "getParameters";
8857
+ UIPassthroughEvent["GetTML"] = "getTML";
8858
+ UIPassthroughEvent["GetTabs"] = "getTabs";
8859
+ UIPassthroughEvent["GetExportRequestForCurrentPinboard"] = "getExportRequestForCurrentPinboard";
8122
8860
  })(UIPassthroughEvent || (UIPassthroughEvent = {}));
8123
8861
 
8124
8862
  const EndPoints = {
@@ -8752,9 +9490,11 @@ const DATA_TYPES = ['DATE', 'DATE_TIME', 'TIME'];
8752
9490
  * You can use this service to:
8753
9491
  *
8754
9492
  * - Add or remove columns from Answers (`addColumns`, `removeColumns`,
8755
- * `addColumnsByName`) - Apply filters to Answers (`addFilter`)
9493
+ * `addColumnsByName`)
9494
+ * - Apply filters to Answers (`addFilter`)
8756
9495
  * - Get data from Answers in different formats (JSON, CSV, PNG) (`fetchData`,
8757
- * `fetchCSVBlob`, `fetchPNGBlob`) - Get data for specific points in visualizations
9496
+ * `fetchCSVBlob`, `fetchPNGBlob`)
9497
+ * - Get data for specific points in visualizations
8758
9498
  * (`getUnderlyingDataForPoint`)
8759
9499
  * - Run custom queries (`executeQuery`)
8760
9500
  * - Add visualizations to Liveboards (`addDisplayedVizToLiveboard`)
@@ -9048,7 +9788,7 @@ class AnswerService {
9048
9788
  async getTML() {
9049
9789
  const { object } = await this.executeQuery(getAnswerTML, {});
9050
9790
  const edoc = object[0].edoc;
9051
- const YAML = await import('./index-DyX-x6uN.js');
9791
+ const YAML = await import('./index-DW2wEHqy.js');
9052
9792
  const parsedDoc = YAML.parse(edoc);
9053
9793
  return {
9054
9794
  answer: {
@@ -17516,7 +18256,8 @@ var AuthFailureType;
17516
18256
  /**
17517
18257
  * The current authentication token or session has expired.
17518
18258
  *
17519
- * Emitted when the embed receives an auth-expiry signal and starts auth refresh handling.
18259
+ * Emitted when the embed receives an auth-expiry signal and starts auth refresh
18260
+ * handling.
17520
18261
  */
17521
18262
  AuthFailureType["EXPIRY"] = "EXPIRY";
17522
18263
  /**
@@ -18529,11 +19270,25 @@ function processEventData(type, eventData, thoughtSpotHost, containerEl) {
18529
19270
  return eventData;
18530
19271
  }
18531
19272
 
18532
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.46.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 || echo 'Warning: Coveralls upload failed but not breaking the build.'","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.23","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};
18533
-
19273
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.46.5-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 && node dts-config/wrap-ambient-module.mjs","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 || echo 'Warning: Coveralls upload failed but not breaking the build.'","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"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.23","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};
19274
+
19275
+ /** Host events that use getDataWithPassthroughFallback (getter-style APIs) */
19276
+ const HOST_EVENT_PASSTHROUGH_MAP = {
19277
+ [HostEvent.GetAnswerSession]: UIPassthroughEvent.GetAnswerSession,
19278
+ [HostEvent.GetFilters]: UIPassthroughEvent.GetFilters,
19279
+ [HostEvent.GetIframeUrl]: UIPassthroughEvent.GetIframeUrl,
19280
+ [HostEvent.GetParameters]: UIPassthroughEvent.GetParameters,
19281
+ [HostEvent.GetTML]: UIPassthroughEvent.GetTML,
19282
+ [HostEvent.GetTabs]: UIPassthroughEvent.GetTabs,
19283
+ [HostEvent.getExportRequestForCurrentPinboard]: UIPassthroughEvent.GetExportRequestForCurrentPinboard,
19284
+ };
18534
19285
  class HostEventClient {
18535
19286
  constructor(iFrame) {
18536
19287
  this.iFrame = iFrame;
19288
+ this.customHandlers = {
19289
+ [HostEvent.Pin]: (p, c) => this.handlePinEvent(p, c),
19290
+ [HostEvent.SaveAnswer]: (p, c) => this.handleSaveAnswerEvent(p, c),
19291
+ };
18537
19292
  }
18538
19293
  /**
18539
19294
  * A wrapper over process trigger to
@@ -18550,7 +19305,7 @@ class HostEventClient {
18550
19305
  }
18551
19306
  async handleHostEventWithParam(apiName, parameters, context) {
18552
19307
  var _a, _b, _c, _d;
18553
- 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];
19308
+ const response = (_b = (_a = (await this.triggerUIPassthroughApi(apiName, parameters, context))) === null || _a === void 0 ? void 0 : _a.find) === null || _b === void 0 ? void 0 : _b.call(_a, (r) => r.error || r.value);
18554
19309
  if (!response) {
18555
19310
  const error = `No answer found${parameters.vizId ? ` for vizId: ${parameters.vizId}` : ''}.`;
18556
19311
  throw { error };
@@ -18559,13 +19314,35 @@ class HostEventClient {
18559
19314
  || ((_c = response.value) === null || _c === void 0 ? void 0 : _c.errors)
18560
19315
  || ((_d = response.value) === null || _d === void 0 ? void 0 : _d.error);
18561
19316
  if (errors) {
18562
- throw { error: response.error };
19317
+ const message = typeof errors === 'string' ? errors : JSON.stringify(errors);
19318
+ throw { error: message };
18563
19319
  }
18564
19320
  return { ...response.value };
18565
19321
  }
18566
19322
  async hostEventFallback(hostEvent, data, context) {
18567
19323
  return this.processTrigger(hostEvent, data, context);
18568
19324
  }
19325
+ /**
19326
+ * For getter events that return data. Tries UI passthrough first;
19327
+ * if the app doesn't support it (no response data), falls back to
19328
+ * the legacy host event channel. Real errors are thrown as-is.
19329
+ */
19330
+ async getDataWithPassthroughFallback(passthroughEvent, hostEvent, payload, context) {
19331
+ var _a, _b, _c;
19332
+ const response = await this.triggerUIPassthroughApi(passthroughEvent, payload || {}, context);
19333
+ const matched = (_a = response === null || response === void 0 ? void 0 : response.find) === null || _a === void 0 ? void 0 : _a.call(response, (r) => r.error || r.value);
19334
+ if (!matched) {
19335
+ return this.hostEventFallback(hostEvent, payload, context);
19336
+ }
19337
+ const errors = matched.error
19338
+ || ((_b = matched.value) === null || _b === void 0 ? void 0 : _b.errors)
19339
+ || ((_c = matched.value) === null || _c === void 0 ? void 0 : _c.error);
19340
+ if (errors) {
19341
+ const message = typeof errors === 'string' ? errors : JSON.stringify(errors);
19342
+ throw new Error(message);
19343
+ }
19344
+ return { ...matched.value };
19345
+ }
18569
19346
  /**
18570
19347
  * Setter for the iframe element used for host events
18571
19348
  * @param {HTMLIFrameElement} iFrame - the iframe element to set
@@ -18609,14 +19386,15 @@ class HostEventClient {
18609
19386
  };
18610
19387
  }
18611
19388
  async triggerHostEvent(hostEvent, payload, context) {
18612
- switch (hostEvent) {
18613
- case HostEvent.Pin:
18614
- return this.handlePinEvent(payload, context);
18615
- case HostEvent.SaveAnswer:
18616
- return this.handleSaveAnswerEvent(payload, context);
18617
- default:
18618
- return this.hostEventFallback(hostEvent, payload, context);
19389
+ const customHandler = this.customHandlers[hostEvent];
19390
+ if (customHandler) {
19391
+ return customHandler(payload, context);
18619
19392
  }
19393
+ const passthroughEvent = HOST_EVENT_PASSTHROUGH_MAP[hostEvent];
19394
+ if (passthroughEvent) {
19395
+ return this.getDataWithPassthroughFallback(passthroughEvent, hostEvent, payload, context);
19396
+ }
19397
+ return this.hostEventFallback(hostEvent, payload, context);
18620
19398
  }
18621
19399
  }
18622
19400
 
@@ -19907,7 +20685,21 @@ class TsEmbed {
19907
20685
  * Triggers an event to the embedded app
19908
20686
  * @param {HostEvent} messageType The event type
19909
20687
  * @param {any} data The payload to send with the message
20688
+ * @param {ContextType} context Optional context type to specify the context from which the event is triggered.
20689
+ * Use ContextType.Search for search answer context, ContextType.Answer for answer/explore context,
20690
+ * ContextType.Liveboard for liveboard context, or ContextType.Spotter for spotter context.
20691
+ * Available from SDK version 1.45.2 | ThoughtSpot: 26.3.0.cl
19910
20692
  * @returns A promise that resolves with the response from the embedded app
20693
+ * @example
20694
+ * ```js
20695
+ * // Trigger Pin event with context (SDK: 1.45.2+)
20696
+ * import { HostEvent, ContextType } from '@thoughtspot/visual-embed-sdk';
20697
+ * embed.trigger(HostEvent.Pin, {
20698
+ * vizId: "123",
20699
+ * liveboardId: "456"
20700
+ * }, ContextType.Search);
20701
+ * ```
20702
+ * @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl (for context parameter)
19911
20703
  */
19912
20704
  async trigger(messageType, data = {}, context) {
19913
20705
  uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
@@ -19970,8 +20762,33 @@ class TsEmbed {
19970
20762
  return this.render();
19971
20763
  }
19972
20764
  /**
19973
- * Get the current context of the embedded TS component.
19974
- * @returns The current context object containing the page type and object ids.
20765
+ * Context object for the embedded component.
20766
+ * @returns {ContextObject} The current context object containing the page type and object ids.
20767
+ * @example
20768
+ * ```js
20769
+ * const context = await embed.getCurrentContext();
20770
+ * console.log(context);
20771
+ *
20772
+ * // Example output
20773
+ * {
20774
+ * stack: [
20775
+ * {
20776
+ * name: 'Liveboard',
20777
+ * type: ContextType.Liveboard,
20778
+ * objectIds: {
20779
+ * liveboardId: '123',
20780
+ * },
20781
+ * },
20782
+ * ],
20783
+ * currentContext: {
20784
+ * name: 'Liveboard',
20785
+ * type: ContextType.Liveboard,
20786
+ * objectIds: {
20787
+ * liveboardId: '123',
20788
+ * },
20789
+ * },
20790
+ * }
20791
+ * ```
19975
20792
  * @version SDK: 1.45.2 | ThoughtSpot: 26.3.0.cl
19976
20793
  */
19977
20794
  async getCurrentContext() {
@@ -20455,13 +21272,22 @@ class AppEmbed extends V1Embed {
20455
21272
  const visibleCoordinatesData = calculateVisibleElementData(this.iFrame);
20456
21273
  responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
20457
21274
  };
21275
+ this.HEIGHT_CHANAGE_THRESHOLD = 30;
20458
21276
  /**
20459
21277
  * Set the iframe height as per the computed height received
20460
21278
  * from the ThoughtSpot app.
20461
21279
  * @param data The event payload
20462
21280
  */
20463
21281
  this.updateIFrameHeight = (data) => {
20464
- this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
21282
+ logger$3.error('Updating iframe height', data);
21283
+ const currentHeight = this.iFrame.getBoundingClientRect().height;
21284
+ const heightToSet = Math.max(data.data, this.defaultHeight);
21285
+ const heightChange = Math.abs(heightToSet - currentHeight);
21286
+ if (heightChange < this.HEIGHT_CHANAGE_THRESHOLD) {
21287
+ logger$3.info('Height change is less than the threshold, skipping height update', { heightChange, heightToSet, currentHeight });
21288
+ return;
21289
+ }
21290
+ this.setIFrameHeight(heightToSet);
20465
21291
  this.sendFullHeightLazyLoadData();
20466
21292
  };
20467
21293
  this.embedIframeCenter = (data, responder) => {
@@ -20920,13 +21746,21 @@ class LiveboardEmbed extends V1Embed {
20920
21746
  const visibleCoordinatesData = calculateVisibleElementData(this.iFrame);
20921
21747
  responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
20922
21748
  };
21749
+ this.HEIGHT_CHANAGE_THRESHOLD = 30;
20923
21750
  /**
20924
21751
  * Set the iframe height as per the computed height received
20925
21752
  * from the ThoughtSpot app.
20926
21753
  * @param data The event payload
20927
21754
  */
20928
21755
  this.updateIFrameHeight = (data) => {
20929
- this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
21756
+ const currentHeight = this.iFrame.getBoundingClientRect().height;
21757
+ const heightToSet = Math.max(data.data, this.defaultHeight);
21758
+ const heightChange = Math.abs(heightToSet - currentHeight);
21759
+ if (heightChange < this.HEIGHT_CHANAGE_THRESHOLD) {
21760
+ logger$3.info('Height change is less than the threshold, skipping height update', { heightChange, heightToSet, currentHeight });
21761
+ return;
21762
+ }
21763
+ this.setIFrameHeight(heightToSet);
20930
21764
  this.sendFullHeightLazyLoadData();
20931
21765
  };
20932
21766
  this.embedIframeCenter = (data, responder) => {
@@ -21092,7 +21926,8 @@ class LiveboardEmbed extends V1Embed {
21092
21926
  }
21093
21927
  getIframeSuffixSrc(liveboardId, vizId, activeTabId, personalizedViewId) {
21094
21928
  // Extract view from liveboardId if passed along with it (legacy
21095
- // approach) View must be appended as query param at the end, not
21929
+ // approach)
21930
+ // View must be appended as query param at the end, not
21096
21931
  // embedded in path
21097
21932
  let liveboardGuid = liveboardId;
21098
21933
  let legacyViewId;