@thoughtspot/visual-embed-sdk 1.39.2 → 1.40.0

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 (173) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/config.spec.js +9 -0
  3. package/cjs/src/config.spec.js.map +1 -1
  4. package/cjs/src/embed/app.d.ts +75 -15
  5. package/cjs/src/embed/app.d.ts.map +1 -1
  6. package/cjs/src/embed/app.js +69 -9
  7. package/cjs/src/embed/app.js.map +1 -1
  8. package/cjs/src/embed/app.spec.js +378 -15
  9. package/cjs/src/embed/app.spec.js.map +1 -1
  10. package/cjs/src/embed/bodyless-conversation.d.ts +23 -7
  11. package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
  12. package/cjs/src/embed/bodyless-conversation.js +31 -5
  13. package/cjs/src/embed/bodyless-conversation.js.map +1 -1
  14. package/cjs/src/embed/bodyless-conversation.spec.js +8 -190
  15. package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
  16. package/cjs/src/embed/conversation.spec.js +28 -0
  17. package/cjs/src/embed/conversation.spec.js.map +1 -1
  18. package/cjs/src/embed/embedConfig.d.ts +9 -7
  19. package/cjs/src/embed/embedConfig.d.ts.map +1 -1
  20. package/cjs/src/embed/embedConfig.js +9 -7
  21. package/cjs/src/embed/embedConfig.js.map +1 -1
  22. package/cjs/src/embed/liveboard.d.ts +56 -17
  23. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  24. package/cjs/src/embed/liveboard.js +48 -4
  25. package/cjs/src/embed/liveboard.js.map +1 -1
  26. package/cjs/src/embed/liveboard.spec.js +218 -11
  27. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  28. package/cjs/src/errors.d.ts +1 -0
  29. package/cjs/src/errors.d.ts.map +1 -1
  30. package/cjs/src/errors.js +1 -0
  31. package/cjs/src/errors.js.map +1 -1
  32. package/cjs/src/index.d.ts +2 -2
  33. package/cjs/src/index.d.ts.map +1 -1
  34. package/cjs/src/index.js +2 -1
  35. package/cjs/src/index.js.map +1 -1
  36. package/cjs/src/react/all-types-export.d.ts +1 -1
  37. package/cjs/src/react/all-types-export.d.ts.map +1 -1
  38. package/cjs/src/react/all-types-export.js +3 -2
  39. package/cjs/src/react/all-types-export.js.map +1 -1
  40. package/cjs/src/react/index.d.ts +73 -20
  41. package/cjs/src/react/index.d.ts.map +1 -1
  42. package/cjs/src/react/index.js +79 -42
  43. package/cjs/src/react/index.js.map +1 -1
  44. package/cjs/src/react/index.spec.js +438 -100
  45. package/cjs/src/react/index.spec.js.map +1 -1
  46. package/cjs/src/types.d.ts +331 -13
  47. package/cjs/src/types.d.ts.map +1 -1
  48. package/cjs/src/types.js +296 -8
  49. package/cjs/src/types.js.map +1 -1
  50. package/cjs/src/utils/global-styles.js +1 -1
  51. package/cjs/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  52. package/cjs/src/utils/graphql/nlsService/conversation-service.js +7 -1
  53. package/cjs/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
  54. package/cjs/src/utils/processTrigger.js +2 -1
  55. package/cjs/src/utils/processTrigger.js.map +1 -1
  56. package/cjs/src/utils.d.ts +6 -0
  57. package/cjs/src/utils.d.ts.map +1 -1
  58. package/cjs/src/utils.js +23 -3
  59. package/cjs/src/utils.js.map +1 -1
  60. package/cjs/src/utils.spec.js +237 -1
  61. package/cjs/src/utils.spec.js.map +1 -1
  62. package/dist/{index-CmEQfuE3.js → index-CAEHQGLc.js} +1 -1
  63. package/dist/src/embed/app.d.ts +75 -15
  64. package/dist/src/embed/app.d.ts.map +1 -1
  65. package/dist/src/embed/bodyless-conversation.d.ts +23 -7
  66. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  67. package/dist/src/embed/embedConfig.d.ts +9 -7
  68. package/dist/src/embed/embedConfig.d.ts.map +1 -1
  69. package/dist/src/embed/liveboard.d.ts +56 -17
  70. package/dist/src/embed/liveboard.d.ts.map +1 -1
  71. package/dist/src/errors.d.ts +1 -0
  72. package/dist/src/errors.d.ts.map +1 -1
  73. package/dist/src/index.d.ts +2 -2
  74. package/dist/src/index.d.ts.map +1 -1
  75. package/dist/src/react/all-types-export.d.ts +1 -1
  76. package/dist/src/react/all-types-export.d.ts.map +1 -1
  77. package/dist/src/react/index.d.ts +73 -20
  78. package/dist/src/react/index.d.ts.map +1 -1
  79. package/dist/src/types.d.ts +331 -13
  80. package/dist/src/types.d.ts.map +1 -1
  81. package/dist/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  82. package/dist/src/utils.d.ts +6 -0
  83. package/dist/src/utils.d.ts.map +1 -1
  84. package/dist/tsembed-react.es.js +568 -87
  85. package/dist/tsembed-react.js +568 -85
  86. package/dist/tsembed.es.js +486 -40
  87. package/dist/tsembed.js +484 -38
  88. package/dist/visual-embed-sdk-react-full.d.ts +545 -79
  89. package/dist/visual-embed-sdk-react.d.ts +545 -79
  90. package/dist/visual-embed-sdk.d.ts +473 -60
  91. package/lib/package.json +1 -1
  92. package/lib/src/config.spec.js +9 -0
  93. package/lib/src/config.spec.js.map +1 -1
  94. package/lib/src/embed/app.d.ts +75 -15
  95. package/lib/src/embed/app.d.ts.map +1 -1
  96. package/lib/src/embed/app.js +69 -9
  97. package/lib/src/embed/app.js.map +1 -1
  98. package/lib/src/embed/app.spec.js +380 -17
  99. package/lib/src/embed/app.spec.js.map +1 -1
  100. package/lib/src/embed/bodyless-conversation.d.ts +23 -7
  101. package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
  102. package/lib/src/embed/bodyless-conversation.js +30 -5
  103. package/lib/src/embed/bodyless-conversation.js.map +1 -1
  104. package/lib/src/embed/bodyless-conversation.spec.js +9 -191
  105. package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
  106. package/lib/src/embed/conversation.spec.js +30 -2
  107. package/lib/src/embed/conversation.spec.js.map +1 -1
  108. package/lib/src/embed/embedConfig.d.ts +9 -7
  109. package/lib/src/embed/embedConfig.d.ts.map +1 -1
  110. package/lib/src/embed/embedConfig.js +9 -7
  111. package/lib/src/embed/embedConfig.js.map +1 -1
  112. package/lib/src/embed/liveboard.d.ts +56 -17
  113. package/lib/src/embed/liveboard.d.ts.map +1 -1
  114. package/lib/src/embed/liveboard.js +49 -5
  115. package/lib/src/embed/liveboard.js.map +1 -1
  116. package/lib/src/embed/liveboard.spec.js +218 -11
  117. package/lib/src/embed/liveboard.spec.js.map +1 -1
  118. package/lib/src/errors.d.ts +1 -0
  119. package/lib/src/errors.d.ts.map +1 -1
  120. package/lib/src/errors.js +1 -0
  121. package/lib/src/errors.js.map +1 -1
  122. package/lib/src/index.d.ts +2 -2
  123. package/lib/src/index.d.ts.map +1 -1
  124. package/lib/src/index.js +2 -2
  125. package/lib/src/index.js.map +1 -1
  126. package/lib/src/react/all-types-export.d.ts +1 -1
  127. package/lib/src/react/all-types-export.d.ts.map +1 -1
  128. package/lib/src/react/all-types-export.js +1 -1
  129. package/lib/src/react/all-types-export.js.map +1 -1
  130. package/lib/src/react/index.d.ts +73 -20
  131. package/lib/src/react/index.d.ts.map +1 -1
  132. package/lib/src/react/index.js +79 -43
  133. package/lib/src/react/index.js.map +1 -1
  134. package/lib/src/react/index.spec.js +441 -103
  135. package/lib/src/react/index.spec.js.map +1 -1
  136. package/lib/src/types.d.ts +331 -13
  137. package/lib/src/types.d.ts.map +1 -1
  138. package/lib/src/types.js +296 -8
  139. package/lib/src/types.js.map +1 -1
  140. package/lib/src/utils/global-styles.js +1 -1
  141. package/lib/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  142. package/lib/src/utils/graphql/nlsService/conversation-service.js +7 -1
  143. package/lib/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
  144. package/lib/src/utils/processTrigger.js +2 -1
  145. package/lib/src/utils/processTrigger.js.map +1 -1
  146. package/lib/src/utils.d.ts +6 -0
  147. package/lib/src/utils.d.ts.map +1 -1
  148. package/lib/src/utils.js +21 -2
  149. package/lib/src/utils.js.map +1 -1
  150. package/lib/src/utils.spec.js +238 -2
  151. package/lib/src/utils.spec.js.map +1 -1
  152. package/lib/src/visual-embed-sdk.d.ts +474 -61
  153. package/package.json +1 -1
  154. package/src/config.spec.ts +11 -0
  155. package/src/embed/app.spec.ts +486 -30
  156. package/src/embed/app.ts +133 -27
  157. package/src/embed/bodyless-conversation.spec.ts +9 -203
  158. package/src/embed/bodyless-conversation.ts +34 -10
  159. package/src/embed/conversation.spec.ts +40 -2
  160. package/src/embed/embedConfig.ts +10 -8
  161. package/src/embed/liveboard.spec.ts +259 -5
  162. package/src/embed/liveboard.ts +98 -27
  163. package/src/errors.ts +1 -0
  164. package/src/index.ts +2 -0
  165. package/src/react/all-types-export.ts +2 -1
  166. package/src/react/index.spec.tsx +558 -157
  167. package/src/react/index.tsx +117 -51
  168. package/src/types.ts +368 -50
  169. package/src/utils/global-styles.ts +1 -1
  170. package/src/utils/graphql/nlsService/conversation-service.ts +7 -1
  171. package/src/utils/processTrigger.ts +1 -1
  172. package/src/utils.spec.ts +279 -2
  173. package/src/utils.ts +28 -2
@@ -1,7 +1,7 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.39.2 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.40.0 */
2
2
  'use client';
3
3
  import * as React from 'react';
4
- import React__default, { useRef } from 'react';
4
+ import React__default, { useRef, useCallback } from 'react';
5
5
 
6
6
  function _mergeNamespaces(n, m) {
7
7
  m.forEach(function (e) {
@@ -399,6 +399,12 @@ var HomeLeftNavItem;
399
399
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
400
400
  */
401
401
  HomeLeftNavItem["Spotter"] = "spotter";
402
+ /**
403
+ * Favorites option in the insights left navigation,
404
+ * available when new navigation V3 is enabled.
405
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
406
+ */
407
+ HomeLeftNavItem["Favorites"] = "favorites";
402
408
  })(HomeLeftNavItem || (HomeLeftNavItem = {}));
403
409
  /**
404
410
  * A map of the supported runtime filter operations
@@ -1217,7 +1223,7 @@ var EmbedEvent;
1217
1223
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1218
1224
  * @example
1219
1225
  *```js
1220
- * liveboardEmbed.on(EmbedEvent.AnswerChartSwitcher, payload => {
1226
+ * liveboardEmbed.on(EmbedEvent.LiveboardInfo, payload => {
1221
1227
  * console.log('Liveboard details', payload);
1222
1228
  * })
1223
1229
  *```
@@ -1585,6 +1591,89 @@ var EmbedEvent;
1585
1591
  * @version SDK : 1.40.0 | ThoughtSpot: 10.11.0.cl
1586
1592
  */
1587
1593
  EmbedEvent["ExitPresentMode"] = "exitPresentMode";
1594
+ /**
1595
+ * Emitted when a user requests the full height lazy load data.
1596
+ * @version SDK : 1.39.0 | ThoughtSpot : 10.10.0.cl
1597
+ * @hidden
1598
+ */
1599
+ EmbedEvent["RequestVisibleEmbedCoordinates"] = "requestVisibleEmbedCoordinates";
1600
+ /**
1601
+ * Emitted when Spotter response is text data
1602
+ * @example
1603
+ * ```js
1604
+ * spotterEmbed.on(EmbedEvent.SpotterData, (payload) => {
1605
+ * console.log('payload', payload);
1606
+ * })
1607
+ *```
1608
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1609
+ */
1610
+ EmbedEvent["SpotterData"] = "SpotterData";
1611
+ /**
1612
+ * Emitted when user opens up the worksheet preview modal in Spotter embed.
1613
+ * @example
1614
+ * ```js
1615
+ * spotterEmbed.on(EmbedEvent.PreviewSpotterData, (payload) => {
1616
+ * console.log('payload', payload);
1617
+ * })
1618
+ *```
1619
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1620
+ */
1621
+ EmbedEvent["PreviewSpotterData"] = "PreviewSpotterData";
1622
+ /**
1623
+ * Emitted when the Spotter query is triggered in Spotter embed.
1624
+ * @example
1625
+ * ```js
1626
+ * spotterEmbed.on(EmbedEvent.SpotterQueryTriggered, (payload) => {
1627
+ * console.log('payload', payload);
1628
+ * })
1629
+ *```
1630
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1631
+ */
1632
+ EmbedEvent["SpotterQueryTriggered"] = "SpotterQueryTriggered";
1633
+ /**
1634
+ * Emitted when the last Spotter query is edited in Spotter embed.
1635
+ * @example
1636
+ * ```js
1637
+ * spotterEmbed.on(EmbedEvent.LastPromptEdited, (payload) => {
1638
+ * console.log('payload', payload);
1639
+ * })
1640
+ *```
1641
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1642
+ */
1643
+ EmbedEvent["LastPromptEdited"] = "LastPromptEdited";
1644
+ /**
1645
+ * Emitted when the last Spotter query is deleted in Spotter embed.
1646
+ * @example
1647
+ * ```js
1648
+ * spotterEmbed.on(EmbedEvent.LastPromptDeleted, (payload) => {
1649
+ * console.log('payload', payload);
1650
+ * })
1651
+ *```
1652
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1653
+ */
1654
+ EmbedEvent["LastPromptDeleted"] = "LastPromptDeleted";
1655
+ /**
1656
+ * Emitted when the coversation is reset in spotter embed.
1657
+ * @example
1658
+ * ```js
1659
+ * spotterEmbed.on(EmbedEvent.ResetSpotterConversation, (payload) => {
1660
+ * console.log('payload', payload);
1661
+ * })
1662
+ *```
1663
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1664
+ */
1665
+ EmbedEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
1666
+ /**
1667
+ * Emitted when the *Spotter* is initialized.
1668
+ * @example
1669
+ * ```js
1670
+ * spotterEmbed.on(EmbedEvent.SpotterInit, (payload) => {
1671
+ * console.log('payload', payload);
1672
+ * })
1673
+ *```
1674
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1675
+ */
1676
+ EmbedEvent["SpotterInit"] = "spotterInit";
1588
1677
  })(EmbedEvent || (EmbedEvent = {}));
1589
1678
  /**
1590
1679
  * Event types that can be triggered by the host application
@@ -1602,7 +1691,7 @@ var EmbedEvent;
1602
1691
  * // create the liveboard embed.
1603
1692
  *
1604
1693
  * liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
1605
- * { columnName: 'state, operator: RuntimeFilterOp.EQ, values: ['california']}
1694
+ * { columnName: 'state', operator: RuntimeFilterOp.EQ, values: ["california"]}
1606
1695
  * ]);
1607
1696
  * ```
1608
1697
  * @example
@@ -1674,6 +1763,7 @@ var HostEvent;
1674
1763
  * done automatically on the most popular column.
1675
1764
  * @param - vizId [TS >= 9.8.0] - Optional. The GUID of the visualization to drill
1676
1765
  * in case of a Liveboard.
1766
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
1677
1767
  * @example
1678
1768
  * ```js
1679
1769
  * searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
@@ -1812,12 +1902,12 @@ var HostEvent;
1812
1902
  * Works with Search and Liveboard embed.
1813
1903
  * @param - { columnId: string,
1814
1904
  * name: string,
1815
- * type: INT64/CHAR/DATE,
1816
- * dataType: ATTRIBUTE/MEASURE }
1905
+ * type: ATTRIBUTE/MEASURE,
1906
+ * dataType: INT64/CHAR/DATE }
1817
1907
  * @example
1818
1908
  * ```js
1819
1909
  * searchEmbed.trigger(HostEvent.OpenFilter,
1820
- * {column: { columnId: '<column-GUID>', name: 'column name', type: 'INT64', dataType: 'ATTRIBUTE'}})
1910
+ * {column: { columnId: '<column-GUID>', name: 'column name', type: 'ATTRIBUTE', dataType: 'INT64'}})
1821
1911
  * ```
1822
1912
  * @example
1823
1913
  * ```js
@@ -1875,6 +1965,7 @@ var HostEvent;
1875
1965
  * @param
1876
1966
  * `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
1877
1967
  * Optional when pinning a new chart or table generated from a Search query.
1968
+ * **Required** in Spotter Embed.
1878
1969
  * @param
1879
1970
  * `liveboardID` - GUID of the Liveboard to pin an Answer. If there is no Liveboard,
1880
1971
  * specify the `newLiveboardName` parameter to create a new Liveboard.
@@ -1922,6 +2013,12 @@ var HostEvent;
1922
2013
  * ```js
1923
2014
  * appEmbed.trigger(HostEvent.Pin)
1924
2015
  * ```
2016
+ * @example
2017
+ * ```js
2018
+ * const pinResponse = await spotterEmbed.trigger(HostEvent.Pin, {
2019
+ * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2020
+ * });
2021
+ * ```
1925
2022
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1926
2023
  */
1927
2024
  HostEvent["Pin"] = "pin";
@@ -1986,12 +2083,21 @@ var HostEvent;
1986
2083
  * Trigger the **Download PDF** action on an embedded Liveboard,
1987
2084
  * visualization or Answer.
1988
2085
  *
2086
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2087
+ *
1989
2088
  * **NOTE**: The **Download** > **PDF** action is available on
1990
2089
  * visualizations and Answers if the data is in tabular format.
1991
2090
  * @example
1992
2091
  * ```js
1993
2092
  * liveboardEmbed.trigger(HostEvent.DownloadAsPdf)
1994
2093
  * ```
2094
+ * @example
2095
+ * ```js
2096
+ * spotterEmbed.trigger(HostEvent.DownloadAsPdf, {
2097
+ * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2098
+ * });
2099
+ * ```
2100
+ *
1995
2101
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
1996
2102
  */
1997
2103
  HostEvent["DownloadAsPdf"] = "downloadAsPdf";
@@ -2015,6 +2121,12 @@ var HostEvent;
2015
2121
  * ```js
2016
2122
  * searchEmbed.trigger(HostEvent.MakeACopy)
2017
2123
  * ```
2124
+ * @example
2125
+ * ```js
2126
+ * const pinResponse = await spotterEmbed.trigger(HostEvent.MakeACopy, {
2127
+ * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2128
+ * });
2129
+ * ```
2018
2130
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2019
2131
  */
2020
2132
  HostEvent["MakeACopy"] = "makeACopy";
@@ -2087,6 +2199,8 @@ var HostEvent;
2087
2199
  * This event is not supported in visualization embed and search embed.
2088
2200
  * @param - object - To trigger the action for a specific visualization
2089
2201
  * in Liveboard embed, pass in `vizId` as a key.
2202
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2203
+ *
2090
2204
  * @example
2091
2205
  * ```js
2092
2206
  * liveboardEmbed.trigger(HostEvent.Edit)
@@ -2095,6 +2209,18 @@ var HostEvent;
2095
2209
  * liveboardEmbed.trigger(HostEvent.Edit, {vizId:
2096
2210
  * '730496d6-6903-4601-937e-2c691821af3c'})
2097
2211
  * ```
2212
+ * @example
2213
+ * ```js
2214
+ * const pinResponse = await spotterEmbed.trigger(HostEvent.Edit, {
2215
+ * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2216
+ * });
2217
+ * ```
2218
+ * @example
2219
+ * ```js
2220
+ * const editResponse = await spotterEmbed.trigger(HostEvent.Edit, {
2221
+ * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2222
+ * });
2223
+ * ```
2098
2224
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2099
2225
  */
2100
2226
  HostEvent["Edit"] = "edit";
@@ -2142,6 +2268,16 @@ var HostEvent;
2142
2268
  * );
2143
2269
  * })
2144
2270
  * ```
2271
+ * @example
2272
+ * ```js
2273
+ * spotterEmbed.trigger(HostEvent.GetTML, {
2274
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2275
+ * }).then((tml) => {
2276
+ * console.log(
2277
+ * tml.answer.search_query // TML representation of the search query
2278
+ * );
2279
+ * })
2280
+ * ```
2145
2281
  * @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
2146
2282
  * @important
2147
2283
  */
@@ -2205,6 +2341,7 @@ var HostEvent;
2205
2341
  /**
2206
2342
  * Trigger the **Download** action on charts in
2207
2343
  * the embedded view.
2344
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2208
2345
  * @example
2209
2346
  * ```js
2210
2347
  * liveboardEmbed.trigger(HostEvent.Download, {vizId:
@@ -2213,6 +2350,11 @@ var HostEvent;
2213
2350
  * ```js
2214
2351
  * embed.trigger(HostEvent.Download)
2215
2352
  * ```
2353
+ * ```js
2354
+ * spotterEmbed.trigger(HostEvent.Download, {
2355
+ * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2356
+ * });
2357
+ * ```
2216
2358
  * @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
2217
2359
  * Use {@link DownloadAsPng}
2218
2360
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
@@ -2229,13 +2371,19 @@ var HostEvent;
2229
2371
  * vizEmbed.trigger(HostEvent.DownloadAsPng)
2230
2372
  *
2231
2373
  * searchEmbed.trigger(HostEvent.DownloadAsPng)
2374
+ *
2375
+ * spotterEmbed.trigger(HostEvent.DownloadAsPng, {
2376
+ * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2377
+ * })
2232
2378
  * ```
2379
+ *
2233
2380
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
2234
2381
  */
2235
2382
  HostEvent["DownloadAsPng"] = "downloadAsPng";
2236
2383
  /**
2237
2384
  * Trigger the **Download** > **CSV** action on tables in
2238
2385
  * the embedded view.
2386
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2239
2387
  * @example
2240
2388
  * ```js
2241
2389
  * liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
@@ -2247,12 +2395,18 @@ var HostEvent;
2247
2395
  * ```js
2248
2396
  * searchEmbed.trigger(HostEvent.DownloadAsCsv)
2249
2397
  * ```
2398
+ * ```js
2399
+ * spotterEmbed.trigger(HostEvent.DownloadAsCsv, {
2400
+ * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2401
+ * })
2402
+ * ```
2250
2403
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2251
2404
  */
2252
2405
  HostEvent["DownloadAsCsv"] = "downloadAsCSV";
2253
2406
  /**
2254
2407
  * Trigger the **Download** > **XLSX** action on tables
2255
2408
  * in the embedded view.
2409
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2256
2410
  * @example
2257
2411
  * ```js
2258
2412
  * liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
@@ -2264,6 +2418,11 @@ var HostEvent;
2264
2418
  * ```js
2265
2419
  * searchEmbed.trigger(HostEvent.DownloadAsXlsx)
2266
2420
  * ```
2421
+ * ```js
2422
+ * spotterEmbed.trigger(HostEvent.downloadAsXLSX, {
2423
+ * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2424
+ * })
2425
+ * ```
2267
2426
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2268
2427
  */
2269
2428
  HostEvent["DownloadAsXlsx"] = "downloadAsXLSX";
@@ -2283,6 +2442,7 @@ var HostEvent;
2283
2442
  /**
2284
2443
  * Trigger the **Save** action on a Liveboard or Answer.
2285
2444
  * Saves the changes.
2445
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2286
2446
  * @example
2287
2447
  * ```js
2288
2448
  * liveboardEmbed.trigger(HostEvent.Save)
@@ -2290,6 +2450,11 @@ var HostEvent;
2290
2450
  * ```js
2291
2451
  * searchEmbed.trigger(HostEvent.Save)
2292
2452
  * ```
2453
+ * ```js
2454
+ * spotterEmbed.trigger(HostEvent.Save, {
2455
+ * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2456
+ * })
2457
+ * ```
2293
2458
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2294
2459
  */
2295
2460
  HostEvent["Save"] = "save";
@@ -2573,7 +2738,7 @@ var HostEvent;
2573
2738
  HostEvent["ResetLiveboardPersonalisedView"] = "ResetLiveboardPersonalisedView";
2574
2739
  /**
2575
2740
  * Triggers an action to update Parameter values on embedded
2576
- * Answers and Liveboard.
2741
+ * Answers, Liveboard and Spotter answer in Edit mode.
2577
2742
  *
2578
2743
  * @example
2579
2744
  * ```js
@@ -2587,11 +2752,19 @@ var HostEvent;
2587
2752
  HostEvent["UpdateParameters"] = "UpdateParameters";
2588
2753
  /**
2589
2754
  * Triggers GetParameters to fetch the runtime Parameters.
2755
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2590
2756
  * ```js
2591
2757
  * liveboardEmbed.trigger(HostEvent.GetParameters).then((parameter) => {
2592
2758
  * console.log('parameters', parameter);
2593
2759
  * });
2594
2760
  *```
2761
+ *```js
2762
+ * spotterEmbed.trigger(HostEvent.GetParameters, {
2763
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2764
+ * }).then((parameter) => {
2765
+ * console.log('parameters', parameter);
2766
+ * });
2767
+ *```
2595
2768
  * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
2596
2769
  */
2597
2770
  HostEvent["GetParameters"] = "GetParameters";
@@ -2623,7 +2796,7 @@ var HostEvent;
2623
2796
  * @param - optional attributes to set Answer properties.
2624
2797
  * `name` - Name string for the Answer.
2625
2798
  * `description` - Description text for the Answer.
2626
- *
2799
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2627
2800
  * @example
2628
2801
  * ```js
2629
2802
  * const saveAnswerResponse = await searchEmbed.trigger(HostEvent.SaveAnswer, {
@@ -2631,6 +2804,14 @@ var HostEvent;
2631
2804
  * description: "Total sales by states in MidWest"
2632
2805
  * });
2633
2806
  * ```
2807
+ * @example
2808
+ * ```js
2809
+ * const saveAnswerResponse = await spotterEmbed.trigger(HostEvent.SaveAnswer, {
2810
+ * vizId: '730496d6-6903-4601-937e-2c691821af3c',
2811
+ * name: "Sales by states",
2812
+ * description: "Total sales by states in MidWest"
2813
+ * });
2814
+ * ```
2634
2815
  * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
2635
2816
  */
2636
2817
  HostEvent["SaveAnswer"] = "saveAnswer";
@@ -2659,6 +2840,70 @@ var HostEvent;
2659
2840
  * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
2660
2841
  */
2661
2842
  HostEvent["TransformTableVizData"] = "TransformTableVizData";
2843
+ /**
2844
+ * Triggers a search operation with the search tokens specified in
2845
+ * the search query string in spotter embed.
2846
+ * @param - `query`: Text string in Natural Language format
2847
+ * @param - `executeSearch`: Boolean to execute search and update search query
2848
+ * @example
2849
+ * ```js
2850
+ * spotterEmbed.trigger(HostEvent.SpotterSearch, {
2851
+ * query: 'revenue per year',
2852
+ * executeSearch: true,
2853
+ * })
2854
+ * ```
2855
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
2856
+ */
2857
+ HostEvent["SpotterSearch"] = "SpotterSearch";
2858
+ /**
2859
+ * Edits the last prompt in spotter embed.
2860
+ * @param - `query`: Text string
2861
+ * @example
2862
+ * ```js
2863
+ * spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year");
2864
+ * ```
2865
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
2866
+ */
2867
+ HostEvent["EditLastPrompt"] = "EditLastPrompt";
2868
+ /**
2869
+ * Opens the Worksheet preview modal in Spotter Embed.
2870
+ * @example
2871
+ * ```js
2872
+ * spotterEmbed.trigger(HostEvent.PreviewSpotterData);
2873
+ * ```
2874
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
2875
+ */
2876
+ HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
2877
+ /**
2878
+ * Resets the Spotter Embed Conversation.
2879
+ * @example
2880
+ * ```js
2881
+ * spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
2882
+ * ```
2883
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
2884
+ */
2885
+ HostEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
2886
+ /**
2887
+ * Deletes the last prompt in spotter embed.
2888
+ * @example
2889
+ * ```js
2890
+ * spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
2891
+ * ```
2892
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
2893
+ */
2894
+ HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
2895
+ /**
2896
+ * Toggle the visualization to chart or table view.
2897
+ * @param - `vizId ` refers to the answer id in spotter Embed, it is required in spotter Embed.
2898
+ * @example
2899
+ * ```js
2900
+ * spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {
2901
+ * vizId:'b535c760-8bbe-4e6f-bb26-af56b4129a1e'
2902
+ * });
2903
+ *```
2904
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
2905
+ */
2906
+ HostEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
2662
2907
  /**
2663
2908
  * @hidden
2664
2909
  * Trigger exit from presentation mode when user exits fullscreen.
@@ -2669,6 +2914,30 @@ var HostEvent;
2669
2914
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
2670
2915
  */
2671
2916
  HostEvent["ExitPresentMode"] = "exitPresentMode";
2917
+ /**
2918
+ * Triggers the full height lazy load data.
2919
+ * @example
2920
+ * ```js
2921
+ * liveboardEmbed.on(EmbedEvent.RequestVisibleEmbedCoordinates, (payload) => {
2922
+ * console.log(payload);
2923
+ * });
2924
+ * ```
2925
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
2926
+ *
2927
+ * @hidden
2928
+ */
2929
+ HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
2930
+ /**
2931
+ * Trigger the *Ask Spotter* action for visualizations
2932
+ * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2933
+ * @example
2934
+ * ```js
2935
+ * spotterEmbed.trigger(HostEvent.AskSpotter,
2936
+ * {vizId:'730496d6-6903-4601-937e-2c691821af3c'})
2937
+ * ```
2938
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
2939
+ */
2940
+ HostEvent["AskSpotter"] = "AskSpotter";
2672
2941
  })(HostEvent || (HostEvent = {}));
2673
2942
  /**
2674
2943
  * The different visual modes that the data sources panel within
@@ -2774,6 +3043,7 @@ var Param;
2774
3043
  Param["Query"] = "query";
2775
3044
  Param["HideHomepageLeftNav"] = "hideHomepageLeftNav";
2776
3045
  Param["ModularHomeExperienceEnabled"] = "modularHomeExperience";
3046
+ Param["ListPageVersion"] = "listpageVersion";
2777
3047
  Param["PendoTrackingKey"] = "additionalPendoKey";
2778
3048
  Param["LiveboardHeaderSticky"] = "isLiveboardHeaderSticky";
2779
3049
  Param["IsProductTour"] = "isProductTour";
@@ -2808,10 +3078,12 @@ var Param;
2808
3078
  Param["DataSourceId"] = "dataSourceId";
2809
3079
  Param["preAuthCache"] = "preAuthCache";
2810
3080
  Param["ShowSpotterLimitations"] = "showSpotterLimitations";
2811
- Param["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
3081
+ Param["CoverAndFilterOptionInPDF"] = "arePdfCoverFilterPageCheckboxesEnabled";
2812
3082
  Param["PrimaryAction"] = "primaryAction";
2813
3083
  Param["isSpotterAgentEmbed"] = "isSpotterAgentEmbed";
2814
3084
  Param["IsLiveboardStylingAndGroupingEnabled"] = "isLiveboardStylingAndGroupingEnabled";
3085
+ Param["IsLazyLoadingForEmbedEnabled"] = "isLazyLoadingForEmbedEnabled";
3086
+ Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
2815
3087
  })(Param || (Param = {}));
2816
3088
  /**
2817
3089
  * ThoughtSpot application pages include actions and menu commands
@@ -4034,6 +4306,22 @@ var Action;
4034
4306
  * @version SDK: 1.37.0 | ThoughtSpot Cloud: 10.8.0.cl
4035
4307
  */
4036
4308
  Action["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
4309
+ /**
4310
+ * Action ID for hide or disable the
4311
+ * Spotter in conversation training widget.
4312
+ * The Add to Coaching feature is currently in beta
4313
+ * and is disabled by default on embed deployments.
4314
+ * To enable this feature on your instance,
4315
+ * contact ThoughtSpot Support.
4316
+ * @example
4317
+ * ```js
4318
+ * hiddenAction: [Action.InConversationTraining]
4319
+ * disabledActions: [Action.InConversationTraining]
4320
+ *
4321
+ * ```
4322
+ * @version SDK: 1.39.0 | ThoughtSpot Cloud: 10.10.0.cl
4323
+ */
4324
+ Action["InConversationTraining"] = "InConversationTraining";
4037
4325
  })(Action || (Action = {}));
4038
4326
  var PrefetchFeatures;
4039
4327
  (function (PrefetchFeatures) {
@@ -4417,7 +4705,6 @@ const getOperationNameFromQuery = (query) => {
4417
4705
  function removeTypename(obj) {
4418
4706
  if (!obj || typeof obj !== 'object')
4419
4707
  return obj;
4420
- // eslint-disable-next-line no-restricted-syntax
4421
4708
  for (const key in obj) {
4422
4709
  if (key === '__typename') {
4423
4710
  delete obj[key];
@@ -4446,7 +4733,11 @@ const setStyleProperties = (element, styleProperties) => {
4446
4733
  if (!(element === null || element === void 0 ? void 0 : element.style))
4447
4734
  return;
4448
4735
  Object.keys(styleProperties).forEach((styleProperty) => {
4449
- element.style[styleProperty] = styleProperties[styleProperty].toString();
4736
+ const styleKey = styleProperty;
4737
+ const value = styleProperties[styleKey];
4738
+ if (value !== undefined) {
4739
+ element.style[styleKey] = value.toString();
4740
+ }
4450
4741
  });
4451
4742
  };
4452
4743
  /**
@@ -4574,6 +4865,22 @@ const handleExitPresentMode = async () => {
4574
4865
  }
4575
4866
  }
4576
4867
  logger$3.warn('Exit fullscreen API is not supported by this browser.');
4868
+ };
4869
+ const calculateVisibleElementData = (element) => {
4870
+ const rect = element.getBoundingClientRect();
4871
+ const windowHeight = window.innerHeight;
4872
+ const windowWidth = window.innerWidth;
4873
+ const frameRelativeTop = Math.max(rect.top, 0);
4874
+ const frameRelativeLeft = Math.max(rect.left, 0);
4875
+ const frameRelativeBottom = Math.min(windowHeight, rect.bottom);
4876
+ const frameRelativeRight = Math.min(windowWidth, rect.right);
4877
+ const data = {
4878
+ top: Math.max(0, rect.top * -1),
4879
+ height: Math.max(0, frameRelativeBottom - frameRelativeTop),
4880
+ left: Math.max(0, rect.left * -1),
4881
+ width: Math.max(0, frameRelativeRight - frameRelativeLeft),
4882
+ };
4883
+ return data;
4577
4884
  };
4578
4885
 
4579
4886
  /**
@@ -6869,6 +7176,7 @@ const ERROR_MESSAGE = {
6869
7176
  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',
6870
7177
  MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
6871
7178
  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',
7179
+ SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
6872
7180
  };
6873
7181
 
6874
7182
  const EndPoints = {
@@ -7076,13 +7384,14 @@ const configKey = 'embedConfig';
7076
7384
  *
7077
7385
  * @example
7078
7386
  * ```js
7387
+ * import { getInitConfig } from '@thoughtspot/visual-embed-sdk';
7388
+ * // Call the getInitConfig method to retrieve the embed configuration
7079
7389
  * const config = getInitConfig();
7390
+ * // Log the configuration settings
7080
7391
  * console.log(config);
7081
7392
  * ```
7082
- * @example
7083
- *
7084
- * Returns the `EmbedConfig` object, which
7085
- * contains the configuration settings used to
7393
+ * Returns the link:https://developers.thoughtspot.com/docs/Interface_EmbedConfig[EmbedConfig]
7394
+ * object, which contains the configuration settings used to
7086
7395
  * initialize the SDK, including the following:
7087
7396
  *
7088
7397
  * - `thoughtSpotHost` - ThoughtSpot host URL
@@ -7091,9 +7400,10 @@ const configKey = 'embedConfig';
7091
7400
  * - `customizations` - Style, text, and icon customization settings
7092
7401
  * that were applied during the SDK initialization.
7093
7402
  *
7094
- * For a comprehensive list of embed configuration settings,
7095
- * see link:https://developers.thoughtspot.com/docs/Interface_EmbedConfig[Developer Documentation].
7403
+ * The following JSON output shows the embed configuration
7404
+ * settings returned from the code in the previous example:
7096
7405
  *
7406
+ * @example
7097
7407
  * ```json
7098
7408
  * {
7099
7409
  * "thoughtSpotHost": "https://{ThoughtSpot-Host}",
@@ -7115,7 +7425,7 @@ const configKey = 'embedConfig';
7115
7425
  * "authTriggerContainer": "#your-own-div"
7116
7426
  * }
7117
7427
  * ```
7118
- * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.cl, and later
7428
+ * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw, and later
7119
7429
  * @group Global methods
7120
7430
  */
7121
7431
  const getEmbedConfig = () => getValueFromWindow(configKey) || {};
@@ -7757,7 +8067,7 @@ class AnswerService {
7757
8067
  async getTML() {
7758
8068
  const { object } = await this.executeQuery(getAnswerTML, {});
7759
8069
  const edoc = object[0].edoc;
7760
- const YAML = await import('./index-CmEQfuE3.js');
8070
+ const YAML = await import('./index-CAEHQGLc.js');
7761
8071
  const parsedDoc = YAML.parse(edoc);
7762
8072
  return {
7763
8073
  answer: {
@@ -15491,7 +15801,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
15491
15801
  return e;
15492
15802
  }
15493
15803
 
15494
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.39.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={".":{"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 . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.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 | coveralls","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":"^8.2.6","@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":"^22.2.3","@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",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",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":"^1.1.1",jest:"^26.6.3","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":"^26.5.5","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:"31 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};
15804
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.40.0";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 . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.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 | coveralls","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":"^8.2.6","@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":"^22.2.3","@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",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",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":"^1.1.1",jest:"^26.6.3","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":"^26.5.5","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:"31 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};
15495
15805
 
15496
15806
  /**
15497
15807
  * Reloads the ThoughtSpot iframe.
@@ -15514,7 +15824,8 @@ const reload = (iFrame) => {
15514
15824
  * @param channel
15515
15825
  */
15516
15826
  function postIframeMessage(iFrame, message, thoughtSpotHost, channel) {
15517
- return iFrame.contentWindow.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
15827
+ var _a;
15828
+ return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
15518
15829
  }
15519
15830
  const TRIGGER_TIMEOUT = 30000;
15520
15831
  /**
@@ -17227,7 +17538,6 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
17227
17538
  /**
17228
17539
  * Pages within the ThoughtSpot app that can be embedded.
17229
17540
  */
17230
- // eslint-disable-next-line no-shadow
17231
17541
  var Page;
17232
17542
  (function (Page) {
17233
17543
  /**
@@ -17313,16 +17623,46 @@ var HomePage;
17313
17623
  */
17314
17624
  HomePage["Modular"] = "v2";
17315
17625
  })(HomePage || (HomePage = {}));
17626
+ /**
17627
+ * Define the version of the list page
17628
+ * @version SDK: 1.40.0 | ThoughtSpot: 10.12.0.cl
17629
+ */
17630
+ var ListPage;
17631
+ (function (ListPage) {
17632
+ /**
17633
+ * List (v2) is the traditional List Experience.
17634
+ * It serves as the foundational version of the list page.
17635
+ */
17636
+ ListPage["List"] = "v2";
17637
+ /**
17638
+ * ListWithUXChanges (v3) introduces the new updated list page with UX changes.
17639
+ */
17640
+ ListPage["ListWithUXChanges"] = "v3";
17641
+ })(ListPage || (ListPage = {}));
17316
17642
  /**
17317
17643
  * Embeds full ThoughtSpot experience in a host application.
17318
17644
  * @group Embed components
17319
17645
  */
17320
17646
  let AppEmbed$1 = class AppEmbed extends V1Embed {
17321
- // eslint-disable-next-line no-useless-constructor
17322
17647
  constructor(domSelector, viewConfig) {
17323
17648
  viewConfig.embedComponentType = 'AppEmbed';
17324
17649
  super(domSelector, viewConfig);
17325
17650
  this.defaultHeight = '100%';
17651
+ this.sendFullHeightLazyLoadData = () => {
17652
+ const data = calculateVisibleElementData(this.iFrame);
17653
+ this.trigger(HostEvent.VisibleEmbedCoordinates, data);
17654
+ };
17655
+ /**
17656
+ * This is a handler for the RequestVisibleEmbedCoordinates event.
17657
+ * It is used to send the visible coordinates data to the host application.
17658
+ * @param data The event payload
17659
+ * @param responder The responder function
17660
+ */
17661
+ this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
17662
+ logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
17663
+ const visibleCoordinatesData = calculateVisibleElementData(this.iFrame);
17664
+ responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
17665
+ };
17326
17666
  /**
17327
17667
  * Set the iframe height as per the computed height received
17328
17668
  * from the ThoughtSpot app.
@@ -17331,6 +17671,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
17331
17671
  this.updateIFrameHeight = (data) => {
17332
17672
  var _a;
17333
17673
  this.setIFrameHeight(Math.max(data.data, (_a = this.iFrame) === null || _a === void 0 ? void 0 : _a.scrollHeight));
17674
+ this.sendFullHeightLazyLoadData();
17334
17675
  };
17335
17676
  this.embedIframeCenter = (data, responder) => {
17336
17677
  const obj = this.getIframeCenter();
@@ -17360,6 +17701,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
17360
17701
  this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
17361
17702
  this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
17362
17703
  this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
17704
+ this.on(EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
17363
17705
  }
17364
17706
  }
17365
17707
  /**
@@ -17367,9 +17709,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
17367
17709
  * embedded Liveboard or visualization.
17368
17710
  */
17369
17711
  getEmbedParams() {
17370
- const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
17371
- /* eslint-disable-next-line max-len */
17372
- dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
17712
+ const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
17373
17713
  let params = {};
17374
17714
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
17375
17715
  params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
@@ -17385,6 +17725,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
17385
17725
  params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
17386
17726
  params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
17387
17727
  params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
17728
+ params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
17388
17729
  params = this.getBaseQueryParams(params);
17389
17730
  if (hideObjectSearch) {
17390
17731
  params[Param.HideObjectSearch] = !!hideObjectSearch;
@@ -17397,6 +17738,10 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
17397
17738
  }
17398
17739
  if (fullHeight === true) {
17399
17740
  params[Param.fullHeight] = true;
17741
+ if (this.viewConfig.lazyLoadingForFullHeight) {
17742
+ params[Param.IsLazyLoadingForEmbedEnabled] = true;
17743
+ params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
17744
+ }
17400
17745
  }
17401
17746
  if (tag) {
17402
17747
  params[Param.Tag] = tag;
@@ -17417,7 +17762,6 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
17417
17762
  params[Param.enableAskSage] = enableAskSage;
17418
17763
  }
17419
17764
  if (isOnBeforeGetVizDataInterceptEnabled) {
17420
- /* eslint-disable-next-line max-len */
17421
17765
  params[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
17422
17766
  }
17423
17767
  if (homePageSearchBarMode) {
@@ -17438,11 +17782,9 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
17438
17782
  === DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
17439
17783
  || dataPanelCustomGroupsAccordionInitialState
17440
17784
  === DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST) {
17441
- /* eslint-disable-next-line max-len */
17442
17785
  params[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
17443
17786
  }
17444
17787
  else {
17445
- /* eslint-disable-next-line max-len */
17446
17788
  params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
17447
17789
  }
17448
17790
  if (discoveryExperience) {
@@ -17455,6 +17797,10 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
17455
17797
  if (discoveryExperience.homePage === HomePage.Modular) {
17456
17798
  params[Param.ModularHomeExperienceEnabled] = true;
17457
17799
  }
17800
+ // listPageVersion v3 will enable the new list page
17801
+ if (discoveryExperience.listPageVersion === ListPage.ListWithUXChanges) {
17802
+ params[Param.ListPageVersion] = discoveryExperience.listPageVersion;
17803
+ }
17458
17804
  }
17459
17805
  const queryParams = getQueryParamString(params, true);
17460
17806
  return queryParams;
@@ -17542,6 +17888,30 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
17542
17888
  this.iFrame.src = `${iframeSrc.split(currentPath)[0]}${currentPath}/${path.replace(/^\/?#?\//, '')}`;
17543
17889
  }
17544
17890
  }
17891
+ /**
17892
+ * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
17893
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
17894
+ */
17895
+ destroy() {
17896
+ super.destroy();
17897
+ this.unregisterLazyLoadEvents();
17898
+ }
17899
+ postRender() {
17900
+ this.registerLazyLoadEvents();
17901
+ }
17902
+ registerLazyLoadEvents() {
17903
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
17904
+ // TODO: Use passive: true, install modernizr to check for passive
17905
+ window.addEventListener('resize', this.sendFullHeightLazyLoadData);
17906
+ window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
17907
+ }
17908
+ }
17909
+ unregisterLazyLoadEvents() {
17910
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
17911
+ window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
17912
+ window.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
17913
+ }
17914
+ }
17545
17915
  /**
17546
17916
  * Renders the embedded application pages in the ThoughtSpot app.
17547
17917
  * @param renderOptions An object containing the page ID
@@ -17551,6 +17921,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
17551
17921
  await super.render();
17552
17922
  const src = this.getIFrameSrc();
17553
17923
  await this.renderV1Embed(src);
17924
+ this.postRender();
17554
17925
  return this;
17555
17926
  }
17556
17927
  };
@@ -17592,7 +17963,7 @@ const addPreviewStylesIfNotPresent = () => {
17592
17963
  return;
17593
17964
  }
17594
17965
  const previewStyles = `
17595
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community@32.0.2/styles/ag-grid.min.css">
17966
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community@32.0.2/styles/ag-grid.min.css" integrity="sha384-PvEsKa6emq5KYa9mf+Q7eYF5C2OCacYzZ+hBngp21NA4o1A9iU9smnytEmqUFbEZ" crossorigin="anonymous">
17596
17967
  <style id="ts-preview-style">
17597
17968
  .ts-viz-preview-loader {
17598
17969
  position: absolute;
@@ -17655,6 +18026,21 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
17655
18026
  viewConfig.embedComponentType = 'LiveboardEmbed';
17656
18027
  super(domSelector, viewConfig);
17657
18028
  this.defaultHeight = 500;
18029
+ this.sendFullHeightLazyLoadData = () => {
18030
+ const data = calculateVisibleElementData(this.iFrame);
18031
+ this.trigger(HostEvent.VisibleEmbedCoordinates, data);
18032
+ };
18033
+ /**
18034
+ * This is a handler for the RequestVisibleEmbedCoordinates event.
18035
+ * It is used to send the visible coordinates data to the host application.
18036
+ * @param data The event payload
18037
+ * @param responder The responder function
18038
+ */
18039
+ this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
18040
+ logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
18041
+ const visibleCoordinatesData = calculateVisibleElementData(this.iFrame);
18042
+ responder({ type: EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
18043
+ };
17658
18044
  /**
17659
18045
  * Set the iframe height as per the computed height received
17660
18046
  * from the ThoughtSpot app.
@@ -17662,6 +18048,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
17662
18048
  */
17663
18049
  this.updateIFrameHeight = (data) => {
17664
18050
  this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
18051
+ this.sendFullHeightLazyLoadData();
17665
18052
  };
17666
18053
  this.embedIframeCenter = (data, responder) => {
17667
18054
  const obj = this.getIframeCenter();
@@ -17695,6 +18082,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
17695
18082
  this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
17696
18083
  this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
17697
18084
  this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
18085
+ this.on(EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
17698
18086
  }
17699
18087
  }
17700
18088
  /**
@@ -17704,11 +18092,15 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
17704
18092
  getEmbedParams() {
17705
18093
  let params = {};
17706
18094
  params = this.getBaseQueryParams(params);
17707
- const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = false, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
18095
+ const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = false, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
17708
18096
  const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
17709
18097
  || this.viewConfig.preventPinboardFilterRemoval;
17710
18098
  if (fullHeight === true) {
17711
18099
  params[Param.fullHeight] = true;
18100
+ if (this.viewConfig.lazyLoadingForFullHeight) {
18101
+ params[Param.IsLazyLoadingForEmbedEnabled] = true;
18102
+ params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
18103
+ }
17712
18104
  }
17713
18105
  if (defaultHeight) {
17714
18106
  this.defaultHeight = defaultHeight;
@@ -17756,9 +18148,6 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
17756
18148
  if (dataSourceId !== undefined) {
17757
18149
  params[Param.DataSourceId] = dataSourceId;
17758
18150
  }
17759
- if (coverAndFilterOptionInPDF !== undefined) {
17760
- params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
17761
- }
17762
18151
  if (isLiveboardStylingAndGroupingEnabled !== undefined) {
17763
18152
  params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
17764
18153
  }
@@ -17769,6 +18158,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
17769
18158
  params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
17770
18159
  params[Param.DataPanelV2Enabled] = dataPanelV2;
17771
18160
  params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
18161
+ params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
17772
18162
  const queryParams = getQueryParamString(params, true);
17773
18163
  return queryParams;
17774
18164
  }
@@ -17866,6 +18256,30 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
17866
18256
  }
17867
18257
  return super.trigger(messageType, dataWithVizId);
17868
18258
  }
18259
+ /**
18260
+ * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
18261
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
18262
+ */
18263
+ destroy() {
18264
+ super.destroy();
18265
+ this.unregisterLazyLoadEvents();
18266
+ }
18267
+ postRender() {
18268
+ this.registerLazyLoadEvents();
18269
+ }
18270
+ registerLazyLoadEvents() {
18271
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
18272
+ // TODO: Use passive: true, install modernizr to check for passive
18273
+ window.addEventListener('resize', this.sendFullHeightLazyLoadData);
18274
+ window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
18275
+ }
18276
+ }
18277
+ unregisterLazyLoadEvents() {
18278
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
18279
+ window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
18280
+ window.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
18281
+ }
18282
+ }
17869
18283
  /**
17870
18284
  * Render an embedded ThoughtSpot Liveboard or visualization
17871
18285
  * @param renderOptions An object specifying the Liveboard ID,
@@ -17876,6 +18290,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
17876
18290
  const src = this.getIFrameSrc();
17877
18291
  await this.renderV1Embed(src);
17878
18292
  this.showPreviewLoader();
18293
+ this.postRender();
17879
18294
  return this;
17880
18295
  }
17881
18296
  navigateToLiveboard(liveboardId, vizId, activeTabId) {
@@ -18272,7 +18687,13 @@ class Conversation {
18272
18687
  });
18273
18688
  const data = responses[0].data;
18274
18689
  return {
18275
- data: data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
18690
+ convId: this.conversationId,
18691
+ messageId: responses[0].msgId,
18692
+ data: {
18693
+ ...data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
18694
+ convId: this.conversationId,
18695
+ messageId: responses[0].msgId,
18696
+ },
18276
18697
  error: null,
18277
18698
  };
18278
18699
  }
@@ -18290,7 +18711,7 @@ class Conversation {
18290
18711
  }
18291
18712
  }
18292
18713
 
18293
- class ConversationMessage extends TsEmbed {
18714
+ let ConversationMessage$1 = class ConversationMessage extends TsEmbed {
18294
18715
  constructor(container, viewConfig) {
18295
18716
  viewConfig.embedComponentType = 'bodyless-conversation';
18296
18717
  super(container, viewConfig);
@@ -18298,7 +18719,7 @@ class ConversationMessage extends TsEmbed {
18298
18719
  }
18299
18720
  getIframeSrc() {
18300
18721
  var _a;
18301
- const { sessionId, genNo, acSessionId, acGenNo, } = this.viewConfig;
18722
+ const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
18302
18723
  const path = 'conv-assist-answer';
18303
18724
  const queryParams = this.getBaseQueryParams();
18304
18725
  queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
@@ -18313,6 +18734,8 @@ class ConversationMessage extends TsEmbed {
18313
18734
  genNo,
18314
18735
  acSessionId,
18315
18736
  acGenNo,
18737
+ convId,
18738
+ messageId,
18316
18739
  });
18317
18740
  return `${this.getEmbedBasePath(query)}/embed/${path}${tsPostHashParams}`;
18318
18741
  }
@@ -18322,7 +18745,7 @@ class ConversationMessage extends TsEmbed {
18322
18745
  await this.renderIFrame(src);
18323
18746
  return this;
18324
18747
  }
18325
- }
18748
+ };
18326
18749
  /**
18327
18750
  * Create a conversation embed, which can be integrated inside
18328
18751
  * chatbots or other conversational interfaces.
@@ -18342,7 +18765,7 @@ class ConversationMessage extends TsEmbed {
18342
18765
  * @group Embed components
18343
18766
  * @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
18344
18767
  */
18345
- let SpotterAgentEmbed$1 = class SpotterAgentEmbed {
18768
+ class SpotterAgentEmbed {
18346
18769
  constructor(viewConfig) {
18347
18770
  this.viewConfig = viewConfig;
18348
18771
  const embedConfig = getEmbedConfig();
@@ -18354,11 +18777,10 @@ let SpotterAgentEmbed$1 = class SpotterAgentEmbed {
18354
18777
  return { error };
18355
18778
  }
18356
18779
  const container = document.createElement('div');
18357
- if (this.viewConfig.containerClassName) {
18358
- container.className = this.viewConfig.containerClassName;
18359
- }
18360
- const embed = new ConversationMessage(container, {
18780
+ const embed = new ConversationMessage$1(container, {
18361
18781
  ...this.viewConfig,
18782
+ convId: data.convId,
18783
+ messageId: data.messageId,
18362
18784
  sessionId: data.sessionId,
18363
18785
  genNo: data.genNo,
18364
18786
  acSessionId: data.stateKey.transactionId,
@@ -18367,7 +18789,31 @@ let SpotterAgentEmbed$1 = class SpotterAgentEmbed {
18367
18789
  await embed.render();
18368
18790
  return { container, viz: embed };
18369
18791
  }
18370
- };
18792
+ /**
18793
+ * Send a message to the conversation service and return only the data.
18794
+ * @param userMessage - The message to send to the conversation service.
18795
+ * @returns The data from the conversation service.
18796
+ */
18797
+ async sendMessageData(userMessage) {
18798
+ try {
18799
+ const { data, error } = await this.conversationService.sendMessage(userMessage);
18800
+ if (error) {
18801
+ return { error };
18802
+ }
18803
+ return { data: {
18804
+ convId: data.convId,
18805
+ messageId: data.messageId,
18806
+ sessionId: data.sessionId,
18807
+ genNo: data.genNo,
18808
+ acSessionId: data.stateKey.transactionId,
18809
+ acGenNo: data.stateKey.generationNumber,
18810
+ } };
18811
+ }
18812
+ catch (error) {
18813
+ return { error: error };
18814
+ }
18815
+ }
18816
+ }
18371
18817
 
18372
18818
  /**
18373
18819
  *
@@ -18742,55 +19188,34 @@ const SpotterEmbed = componentFactory(SpotterEmbed$1);
18742
19188
  * ```
18743
19189
  */
18744
19190
  const ConversationEmbed = componentFactory(ConversationEmbed$1);
19191
+ const ConversationMessage = componentFactory(ConversationMessage$1);
18745
19192
  /**
18746
- * React component for SpotterAgent embed, which can be integrated inside
18747
- * chatbots or other conversational interfaces.
19193
+ * React component for displaying individual conversation messages from SpotterAgent.
19194
+ *
19195
+ * This component renders a single message response from your ThoughtSpot conversation,
19196
+ * showing charts, visualizations, or text responses based on the user's query.
19197
+ *
18748
19198
  * @example
18749
19199
  * ```tsx
18750
- * function SpotterAgent() {
18751
- * const ref = useRef();
19200
+ * const { sendMessage } = useSpotterAgent({ worksheetId: 'worksheetId' });
19201
+ * const result = await sendMessage('show me sales by region');
18752
19202
  *
18753
- * const handleSendMessage = async () => {
18754
- * const { container, error } = await ref.current.sendMessage('show me sales by region');
18755
- * if (container) {
18756
- * document.body.appendChild(container);
18757
- * }
18758
- * };
19203
+ * if (!result.error) {
19204
+ * // Simple usage - just pass the message data
19205
+ * <SpotterMessage message={result.message} />
18759
19206
  *
18760
- * return (
18761
- * <div>
18762
- * <SpotterAgentEmbed ref={ref} worksheetId="worksheetId" />
18763
- * <button onClick={handleSendMessage}>Send Message</button>
18764
- * </div>
18765
- * );
19207
+ * // With optional query for context
19208
+ * <SpotterMessage
19209
+ * message={result.message}
19210
+ * query={result.query}
19211
+ * />
18766
19212
  * }
18767
19213
  * ```
19214
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.11.0.cl
18768
19215
  */
18769
- const SpotterAgentEmbed = React__default.forwardRef((props, ref) => {
18770
- const { className, ...restProps } = props;
18771
- const serviceRef = useRef(null);
18772
- useDeepCompareEffect(() => {
18773
- if (serviceRef.current) {
18774
- serviceRef.current = null;
18775
- }
18776
- const configProps = {
18777
- ...restProps,
18778
- ...(className ? { containerClassName: className } : {})
18779
- };
18780
- serviceRef.current = new SpotterAgentEmbed$1(configProps);
18781
- if (ref) {
18782
- if (typeof ref === 'function') {
18783
- ref(serviceRef.current);
18784
- }
18785
- else {
18786
- ref.current = serviceRef.current;
18787
- }
18788
- }
18789
- return () => {
18790
- serviceRef.current = null;
18791
- };
18792
- }, [props]);
18793
- return null;
19216
+ const SpotterMessage = React__default.forwardRef((props, ref) => {
19217
+ const { message, query: _, ...otherProps } = props;
19218
+ return (React__default.createElement(ConversationMessage, { ref: ref, ...message, ...otherProps }));
18794
19219
  });
18795
19220
  /**
18796
19221
  * React component for PreRendered Conversation embed.
@@ -18850,6 +19275,62 @@ function useInit(config) {
18850
19275
  ref.current = authEE;
18851
19276
  }, [config]);
18852
19277
  return ref;
19278
+ }
19279
+ /**
19280
+ * React hook for interacting with SpotterAgent AI conversations.
19281
+ *
19282
+ * This hook provides a sendMessage function that allows you to send natural language
19283
+ * queries to your data and get back AI-generated responses with visualizations.
19284
+ *
19285
+ * @param config - Configuration object containing worksheetId and other options
19286
+ * @returns Object with sendMessage function that returns conversation results
19287
+ * @example
19288
+ * ```tsx
19289
+ * const { sendMessage } = useSpotterAgent({ worksheetId: 'worksheetId' });
19290
+ *
19291
+ * const handleQuery = async () => {
19292
+ * const result = await sendMessage('show me sales by region');
19293
+ *
19294
+ * if (!result.error) {
19295
+ * // Display the message response
19296
+ * <SpotterMessage message={result.message} />
19297
+ * } else {
19298
+ * console.error('Error:', result.error);
19299
+ * }
19300
+ * };
19301
+ * ```
19302
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.11.0.cl
19303
+ */
19304
+ function useSpotterAgent(config) {
19305
+ const serviceRef = useRef(null);
19306
+ useDeepCompareEffect(() => {
19307
+ if (serviceRef.current) {
19308
+ serviceRef.current = null;
19309
+ }
19310
+ serviceRef.current = new SpotterAgentEmbed(config);
19311
+ return () => {
19312
+ serviceRef.current = null;
19313
+ };
19314
+ }, [config]);
19315
+ const sendMessage = useCallback(async (query) => {
19316
+ if (!serviceRef.current) {
19317
+ return { error: new Error(ERROR_MESSAGE.SPOTTER_AGENT_NOT_INITIALIZED) };
19318
+ }
19319
+ const result = await serviceRef.current.sendMessageData(query);
19320
+ if (result.error) {
19321
+ return { error: result.error };
19322
+ }
19323
+ return {
19324
+ query: query,
19325
+ message: {
19326
+ ...result.data,
19327
+ worksheetId: config.worksheetId,
19328
+ },
19329
+ };
19330
+ }, [config.worksheetId]);
19331
+ return {
19332
+ sendMessage,
19333
+ };
18853
19334
  }
18854
19335
 
18855
- export { Action, AppEmbed, ConversationEmbed, EmbedEvent, HomeLeftNavItem, HomepageModule, HostEvent, ListPageColumns, LiveboardEmbed, LogLevel, Page, PinboardEmbed, PreRenderedAppEmbed, PreRenderedConversationEmbed, PreRenderedLiveboardEmbed, PreRenderedPinboardEmbed, PreRenderedSageEmbed, PreRenderedSearchBarEmbed, PreRenderedSearchEmbed, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, SpotterAgentEmbed, SpotterEmbed, getSessionInfo, useEmbedRef, useInit };
19336
+ export { Action, AppEmbed, ConversationEmbed, ConversationMessage, EmbedEvent, HomeLeftNavItem, HomepageModule, HostEvent, ListPageColumns, LiveboardEmbed, LogLevel, Page, PinboardEmbed, PreRenderedAppEmbed, PreRenderedConversationEmbed, PreRenderedLiveboardEmbed, PreRenderedPinboardEmbed, PreRenderedSageEmbed, PreRenderedSearchBarEmbed, PreRenderedSearchEmbed, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, SpotterEmbed, SpotterMessage, getSessionInfo, useEmbedRef, useInit, useSpotterAgent };