@thoughtspot/visual-embed-sdk 1.39.3 → 1.40.1-alpha.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 (93) hide show
  1. package/cjs/src/embed/app.d.ts +56 -0
  2. package/cjs/src/embed/app.d.ts.map +1 -1
  3. package/cjs/src/embed/app.js +47 -8
  4. package/cjs/src/embed/app.js.map +1 -1
  5. package/cjs/src/embed/app.spec.js +322 -7
  6. package/cjs/src/embed/app.spec.js.map +1 -1
  7. package/cjs/src/embed/liveboard.d.ts +58 -1
  8. package/cjs/src/embed/liveboard.d.ts.map +1 -1
  9. package/cjs/src/embed/liveboard.js +59 -8
  10. package/cjs/src/embed/liveboard.js.map +1 -1
  11. package/cjs/src/embed/liveboard.spec.js +206 -0
  12. package/cjs/src/embed/liveboard.spec.js.map +1 -1
  13. package/cjs/src/embed/ts-embed.d.ts +7 -0
  14. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  15. package/cjs/src/embed/ts-embed.js +61 -7
  16. package/cjs/src/embed/ts-embed.js.map +1 -1
  17. package/cjs/src/types.d.ts +37 -6
  18. package/cjs/src/types.d.ts.map +1 -1
  19. package/cjs/src/types.js +35 -4
  20. package/cjs/src/types.js.map +1 -1
  21. package/cjs/src/utils/processTrigger.js +2 -1
  22. package/cjs/src/utils/processTrigger.js.map +1 -1
  23. package/cjs/src/utils.d.ts +6 -0
  24. package/cjs/src/utils.d.ts.map +1 -1
  25. package/cjs/src/utils.js +23 -3
  26. package/cjs/src/utils.js.map +1 -1
  27. package/cjs/src/utils.spec.js +212 -1
  28. package/cjs/src/utils.spec.js.map +1 -1
  29. package/dist/{index-ZrE8YYq8.js → index-CmEQfuE3.js} +1 -1
  30. package/dist/index-D1pyb7RG.js +7371 -0
  31. package/dist/index-DeFzsyFF.js +7371 -0
  32. package/dist/index-Dpf0rd6w.js +7371 -0
  33. package/dist/index-UuEbsISo.js +7447 -0
  34. package/dist/index-e3Uw3YFO.js +7371 -0
  35. package/dist/src/embed/app.d.ts +56 -0
  36. package/dist/src/embed/app.d.ts.map +1 -1
  37. package/dist/src/embed/bodyless-conversation.d.ts +0 -4
  38. package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
  39. package/dist/src/embed/liveboard.d.ts +56 -0
  40. package/dist/src/embed/liveboard.d.ts.map +1 -1
  41. package/dist/src/react/index.d.ts +0 -2
  42. package/dist/src/react/index.d.ts.map +1 -1
  43. package/dist/src/types.d.ts +16 -198
  44. package/dist/src/types.d.ts.map +1 -1
  45. package/dist/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
  46. package/dist/src/utils.d.ts +6 -0
  47. package/dist/src/utils.d.ts.map +1 -1
  48. package/dist/tsembed-react.es.js +137 -224
  49. package/dist/tsembed-react.js +136 -223
  50. package/dist/tsembed.es.js +137 -224
  51. package/dist/tsembed.js +136 -223
  52. package/dist/visual-embed-sdk-react-full.d.ts +106 -204
  53. package/dist/visual-embed-sdk-react.d.ts +106 -204
  54. package/dist/visual-embed-sdk.d.ts +106 -202
  55. package/lib/src/embed/app.d.ts +56 -0
  56. package/lib/src/embed/app.d.ts.map +1 -1
  57. package/lib/src/embed/app.js +48 -9
  58. package/lib/src/embed/app.js.map +1 -1
  59. package/lib/src/embed/app.spec.js +322 -7
  60. package/lib/src/embed/app.spec.js.map +1 -1
  61. package/lib/src/embed/liveboard.d.ts +58 -1
  62. package/lib/src/embed/liveboard.d.ts.map +1 -1
  63. package/lib/src/embed/liveboard.js +60 -9
  64. package/lib/src/embed/liveboard.js.map +1 -1
  65. package/lib/src/embed/liveboard.spec.js +206 -0
  66. package/lib/src/embed/liveboard.spec.js.map +1 -1
  67. package/lib/src/embed/ts-embed.d.ts +7 -0
  68. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  69. package/lib/src/embed/ts-embed.js +61 -7
  70. package/lib/src/embed/ts-embed.js.map +1 -1
  71. package/lib/src/types.d.ts +37 -6
  72. package/lib/src/types.d.ts.map +1 -1
  73. package/lib/src/types.js +35 -4
  74. package/lib/src/types.js.map +1 -1
  75. package/lib/src/utils/processTrigger.js +2 -1
  76. package/lib/src/utils/processTrigger.js.map +1 -1
  77. package/lib/src/utils.d.ts +6 -0
  78. package/lib/src/utils.d.ts.map +1 -1
  79. package/lib/src/utils.js +21 -2
  80. package/lib/src/utils.js.map +1 -1
  81. package/lib/src/utils.spec.js +213 -2
  82. package/lib/src/utils.spec.js.map +1 -1
  83. package/lib/src/visual-embed-sdk.d.ts +106 -202
  84. package/package.json +1 -2
  85. package/src/embed/app.spec.ts +397 -8
  86. package/src/embed/app.ts +106 -12
  87. package/src/embed/liveboard.spec.ts +254 -1
  88. package/src/embed/liveboard.ts +109 -11
  89. package/src/embed/ts-embed.ts +84 -21
  90. package/src/types.ts +36 -5
  91. package/src/utils/processTrigger.ts +1 -1
  92. package/src/utils.spec.ts +250 -2
  93. package/src/utils.ts +28 -2
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.39.3 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.39.2-alpha.3 */
2
2
  'use client';
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
@@ -1614,82 +1614,11 @@
1614
1614
  */
1615
1615
  EmbedEvent["ExitPresentMode"] = "exitPresentMode";
1616
1616
  /**
1617
- * Emitted when spotter response is text data
1618
- * @example
1619
- * ```js
1620
- * spotterEmbed.on(EmbedEvent.SpotterData, (payload) => {
1621
- * console.log('payload', payload);
1622
- * })
1623
- *```
1624
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1625
- */
1626
- EmbedEvent["SpotterData"] = "SpotterData";
1627
- /**
1628
- * Emitted when user opens up the worksheet preview modal in spotter embed.
1629
- * @example
1630
- * ```js
1631
- * spotterEmbed.on(EmbedEvent.PreviewSpotterData, (payload) => {
1632
- * console.log('payload', payload);
1633
- * })
1634
- *```
1635
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1636
- */
1637
- EmbedEvent["PreviewSpotterData"] = "PreviewSpotterData";
1638
- /**
1639
- * Emitted when the spotter query is triggered in spotter embed.
1640
- * @example
1641
- * ```js
1642
- * spotterEmbed.on(EmbedEvent.SpotterQueryTriggered, (payload) => {
1643
- * console.log('payload', payload);
1644
- * })
1645
- *```
1646
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1647
- */
1648
- EmbedEvent["SpotterQueryTriggered"] = "SpotterQueryTriggered";
1649
- /**
1650
- * Emitted when the last spotter query is edited in spotter embed.
1651
- * @example
1652
- * ```js
1653
- * spotterEmbed.on(EmbedEvent.LastPromptEdited, (payload) => {
1654
- * console.log('payload', payload);
1655
- * })
1656
- *```
1657
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1658
- */
1659
- EmbedEvent["LastPromptEdited"] = "LastPromptEdited";
1660
- /**
1661
- * Emitted when the last spotter query is deleted in spotter embed.
1662
- * @example
1663
- * ```js
1664
- * spotterEmbed.on(EmbedEvent.LastPromptDeleted, (payload) => {
1665
- * console.log('payload', payload);
1666
- * })
1667
- *```
1668
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1669
- */
1670
- EmbedEvent["LastPromptDeleted"] = "LastPromptDeleted";
1671
- /**
1672
- * Emitted when the coversation is reset in spotter embed.
1673
- * @example
1674
- * ```js
1675
- * spotterEmbed.on(EmbedEvent.ResetSpotterConversation, (payload) => {
1676
- * console.log('payload', payload);
1677
- * })
1678
- *```
1679
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1680
- */
1681
- EmbedEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
1682
- /**
1683
- * Emitted when the *Spotter* is initialized.
1684
- * @example
1685
- * ```js
1686
- * spotterEmbed.on(EmbedEvent.SpotterInit, (payload) => {
1687
- * console.log('payload', payload);
1688
- * })
1689
- *```
1690
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
1617
+ * Emitted when a user requests the full height lazy load data.
1618
+ * @version SDK : 1.39.0 | ThoughtSpot : 10.10.0.cl
1619
+ * @hidden
1691
1620
  */
1692
- EmbedEvent["SpotterInit"] = "SpotterInit";
1621
+ EmbedEvent["RequestVisibleEmbedCoordinates"] = "requestVisibleEmbedCoordinates";
1693
1622
  })(exports.EmbedEvent || (exports.EmbedEvent = {}));
1694
1623
  /**
1695
1624
  * Event types that can be triggered by the host application
@@ -1980,7 +1909,6 @@
1980
1909
  * @param
1981
1910
  * `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
1982
1911
  * Optional when pinning a new chart or table generated from a Search query.
1983
- * **Required** in Spotter Embed.
1984
1912
  * @param
1985
1913
  * `liveboardID` - GUID of the Liveboard to pin an Answer. If there is no Liveboard,
1986
1914
  * specify the `newLiveboardName` parameter to create a new Liveboard.
@@ -2028,12 +1956,6 @@
2028
1956
  * ```js
2029
1957
  * appEmbed.trigger(HostEvent.Pin)
2030
1958
  * ```
2031
- * @example
2032
- * ```js
2033
- * const pinResponse = await spotterEmbed.trigger(HostEvent.Pin, {
2034
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2035
- * });
2036
- * ```
2037
1959
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2038
1960
  */
2039
1961
  HostEvent["Pin"] = "pin";
@@ -2127,12 +2049,6 @@
2127
2049
  * ```js
2128
2050
  * searchEmbed.trigger(HostEvent.MakeACopy)
2129
2051
  * ```
2130
- * @example
2131
- * ```js
2132
- * const pinResponse = await spotterEmbed.trigger(HostEvent.MakeACopy, {
2133
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2134
- * });
2135
- * ```
2136
2052
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2137
2053
  */
2138
2054
  HostEvent["MakeACopy"] = "makeACopy";
@@ -2205,7 +2121,6 @@
2205
2121
  * This event is not supported in visualization embed and search embed.
2206
2122
  * @param - object - To trigger the action for a specific visualization
2207
2123
  * in Liveboard embed, pass in `vizId` as a key.
2208
- * **Required** in Spotter embed.
2209
2124
  * @example
2210
2125
  * ```js
2211
2126
  * liveboardEmbed.trigger(HostEvent.Edit)
@@ -2214,12 +2129,6 @@
2214
2129
  * liveboardEmbed.trigger(HostEvent.Edit, {vizId:
2215
2130
  * '730496d6-6903-4601-937e-2c691821af3c'})
2216
2131
  * ```
2217
- * @example
2218
- * ```js
2219
- * const pinResponse = await spotterEmbed.trigger(HostEvent.Edit, {
2220
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2221
- * });
2222
- * ```
2223
2132
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2224
2133
  */
2225
2134
  HostEvent["Edit"] = "edit";
@@ -2267,16 +2176,6 @@
2267
2176
  * );
2268
2177
  * })
2269
2178
  * ```
2270
- * @example
2271
- * ```js
2272
- * spotterEmbed.trigger(HostEvent.GetTML, {
2273
- * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2274
- * }).then((tml) => {
2275
- * console.log(
2276
- * tml.answer.search_query // TML representation of the search query
2277
- * );
2278
- * })
2279
- * ```
2280
2179
  * @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
2281
2180
  * @important
2282
2181
  */
@@ -2364,12 +2263,7 @@
2364
2263
  * vizEmbed.trigger(HostEvent.DownloadAsPng)
2365
2264
  *
2366
2265
  * searchEmbed.trigger(HostEvent.DownloadAsPng)
2367
- *
2368
- * spotterEmbed.trigger(HostEvent.DownloadAsPng, {
2369
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2370
- * })
2371
2266
  * ```
2372
- *
2373
2267
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
2374
2268
  */
2375
2269
  HostEvent["DownloadAsPng"] = "downloadAsPng";
@@ -2387,11 +2281,6 @@
2387
2281
  * ```js
2388
2282
  * searchEmbed.trigger(HostEvent.DownloadAsCsv)
2389
2283
  * ```
2390
- * ```js
2391
- * spotterEmbed.trigger(HostEvent.DownloadAsCsv, {
2392
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2393
- * })
2394
- * ```
2395
2284
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2396
2285
  */
2397
2286
  HostEvent["DownloadAsCsv"] = "downloadAsCSV";
@@ -2409,11 +2298,6 @@
2409
2298
  * ```js
2410
2299
  * searchEmbed.trigger(HostEvent.DownloadAsXlsx)
2411
2300
  * ```
2412
- * ```js
2413
- * spotterEmbed.trigger(HostEvent.downloadAsXLSX, {
2414
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2415
- * })
2416
- * ```
2417
2301
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2418
2302
  */
2419
2303
  HostEvent["DownloadAsXlsx"] = "downloadAsXLSX";
@@ -2433,7 +2317,6 @@
2433
2317
  /**
2434
2318
  * Trigger the **Save** action on a Liveboard or Answer.
2435
2319
  * Saves the changes.
2436
- * @param - `vizId` is required in Spotter Embed.
2437
2320
  * @example
2438
2321
  * ```js
2439
2322
  * liveboardEmbed.trigger(HostEvent.Save)
@@ -2441,11 +2324,6 @@
2441
2324
  * ```js
2442
2325
  * searchEmbed.trigger(HostEvent.Save)
2443
2326
  * ```
2444
- * ```js
2445
- * spotterEmbed.trigger(HostEvent.Save, {
2446
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2447
- * })
2448
- * ```
2449
2327
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2450
2328
  */
2451
2329
  HostEvent["Save"] = "save";
@@ -2729,7 +2607,7 @@
2729
2607
  HostEvent["ResetLiveboardPersonalisedView"] = "ResetLiveboardPersonalisedView";
2730
2608
  /**
2731
2609
  * Triggers an action to update Parameter values on embedded
2732
- * Answers, Liveboard and Spotter answer in Edit mode.
2610
+ * Answers and Liveboard.
2733
2611
  *
2734
2612
  * @example
2735
2613
  * ```js
@@ -2748,13 +2626,6 @@
2748
2626
  * console.log('parameters', parameter);
2749
2627
  * });
2750
2628
  *```
2751
- *```js
2752
- * spotterEmbed.trigger(HostEvent.GetParameters, {
2753
- * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2754
- * }).then((parameter) => {
2755
- * console.log('parameters', parameter);
2756
- * });
2757
- *```
2758
2629
  * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
2759
2630
  */
2760
2631
  HostEvent["GetParameters"] = "GetParameters";
@@ -2822,64 +2693,6 @@
2822
2693
  * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
2823
2694
  */
2824
2695
  HostEvent["TransformTableVizData"] = "TransformTableVizData";
2825
- /**
2826
- * Triggers a search operation with the search tokens specified in
2827
- * the search query string in spotter embed.
2828
- * @param - `queryString`: Text string in Natural Language format
2829
- * @param - `executeSearch`: Boolean to execute search and update search query
2830
- * @example
2831
- * ```js
2832
- * spotterEmbed.trigger(HostEvent.SpotterSearch, {
2833
- * query: 'revenue per year',
2834
- * executeSearch: true,
2835
- * })
2836
- * ```
2837
- */
2838
- HostEvent["SpotterSearch"] = "SpotterSearch";
2839
- /**
2840
- * Edits the last prompt in spotter embed.
2841
- * @param - `query`: Text string
2842
- * @example
2843
- * ```js
2844
- * spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year");
2845
- * ```
2846
- */
2847
- HostEvent["EditLastPrompt"] = "EditLastPrompt";
2848
- /**
2849
- * Opens the Worksheet preview modal in Spotter Embed.
2850
- * @example
2851
- * ```js
2852
- * spotterEmbed.trigger(HostEvent.PreviewSpotterData);
2853
- * ```
2854
- */
2855
- HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
2856
- /**
2857
- * Resets the Spotter Embed Conversation.
2858
- * @example
2859
- * ```js
2860
- * spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
2861
- * ```
2862
- */
2863
- HostEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
2864
- /**
2865
- * Deletes the last prompt in spotter embed.
2866
- * @example
2867
- * ```js
2868
- * spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
2869
- * ```
2870
- */
2871
- HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
2872
- /**
2873
- * Toggle the visualization to chart or table view.
2874
- * @param - `vizId ` In Spotter Embed, vizId is required.
2875
- * @example
2876
- * ```js
2877
- * spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {
2878
- * vizId:"'b535c760-8bbe-4e6f-bb26-af56b4129a1e'"
2879
- * });
2880
- *```
2881
- */
2882
- HostEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
2883
2696
  /**
2884
2697
  * @hidden
2885
2698
  * Trigger exit from presentation mode when user exits fullscreen.
@@ -2891,15 +2704,18 @@
2891
2704
  */
2892
2705
  HostEvent["ExitPresentMode"] = "exitPresentMode";
2893
2706
  /**
2894
- * Trigger the *Ask Sage* action for visualizations
2707
+ * Triggers the full height lazy load data.
2895
2708
  * @example
2896
2709
  * ```js
2897
- * liveboardEmbed.trigger(HostEvent.AskSpotter,
2898
- * {containerId:'730496d6-6903-4601-937e-2c691821af3c'})
2710
+ * liveboardEmbed.on(EmbedEvent.RequestVisibleEmbedCoordinates, (payload) => {
2711
+ * console.log(payload);
2712
+ * });
2899
2713
  * ```
2900
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
2714
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
2715
+ *
2716
+ * @hidden
2901
2717
  */
2902
- HostEvent["AskSpotter"] = "askSpotter";
2718
+ HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
2903
2719
  })(exports.HostEvent || (exports.HostEvent = {}));
2904
2720
  /**
2905
2721
  * The different visual modes that the data sources panel within
@@ -3044,6 +2860,8 @@
3044
2860
  Param["PrimaryAction"] = "primaryAction";
3045
2861
  Param["isSpotterAgentEmbed"] = "isSpotterAgentEmbed";
3046
2862
  Param["IsLiveboardStylingAndGroupingEnabled"] = "isLiveboardStylingAndGroupingEnabled";
2863
+ Param["IsLazyLoadingForEmbedEnabled"] = "isLazyLoadingForEmbedEnabled";
2864
+ Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
3047
2865
  })(Param || (Param = {}));
3048
2866
  /**
3049
2867
  * ThoughtSpot application pages include actions and menu commands
@@ -4665,7 +4483,6 @@
4665
4483
  function removeTypename(obj) {
4666
4484
  if (!obj || typeof obj !== 'object')
4667
4485
  return obj;
4668
- // eslint-disable-next-line no-restricted-syntax
4669
4486
  for (const key in obj) {
4670
4487
  if (key === '__typename') {
4671
4488
  delete obj[key];
@@ -4694,7 +4511,11 @@
4694
4511
  if (!(element === null || element === void 0 ? void 0 : element.style))
4695
4512
  return;
4696
4513
  Object.keys(styleProperties).forEach((styleProperty) => {
4697
- element.style[styleProperty] = styleProperties[styleProperty].toString();
4514
+ const styleKey = styleProperty;
4515
+ const value = styleProperties[styleKey];
4516
+ if (value !== undefined) {
4517
+ element.style[styleKey] = value.toString();
4518
+ }
4698
4519
  });
4699
4520
  };
4700
4521
  /**
@@ -4822,6 +4643,22 @@
4822
4643
  }
4823
4644
  }
4824
4645
  logger$3.warn('Exit fullscreen API is not supported by this browser.');
4646
+ };
4647
+ const calculateVisibleElementData = (element) => {
4648
+ const rect = element.getBoundingClientRect();
4649
+ const windowHeight = window.innerHeight;
4650
+ const windowWidth = window.innerWidth;
4651
+ const frameRelativeTop = Math.max(rect.top, 0);
4652
+ const frameRelativeLeft = Math.max(rect.left, 0);
4653
+ const frameRelativeBottom = Math.min(windowHeight, rect.bottom);
4654
+ const frameRelativeRight = Math.min(windowWidth, rect.right);
4655
+ const data = {
4656
+ top: Math.max(0, rect.top * -1),
4657
+ height: Math.max(0, frameRelativeBottom - frameRelativeTop),
4658
+ left: Math.max(0, rect.left * -1),
4659
+ width: Math.max(0, frameRelativeRight - frameRelativeLeft),
4660
+ };
4661
+ return data;
4825
4662
  };
4826
4663
 
4827
4664
  /**
@@ -15742,7 +15579,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15742
15579
  return e;
15743
15580
  }
15744
15581
 
15745
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.39.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$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --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$1,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};
15582
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.39.2-alpha.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$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --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$1,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};
15746
15583
 
15747
15584
  /**
15748
15585
  * Reloads the ThoughtSpot iframe.
@@ -15765,7 +15602,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
15765
15602
  * @param channel
15766
15603
  */
15767
15604
  function postIframeMessage(iFrame, message, thoughtSpotHost, channel) {
15768
- return iFrame.contentWindow.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
15605
+ var _a;
15606
+ return (_a = iFrame.contentWindow) === null || _a === void 0 ? void 0 : _a.postMessage(message, thoughtSpotHost, [channel === null || channel === void 0 ? void 0 : channel.port2]);
15769
15607
  }
15770
15608
  const TRIGGER_TIMEOUT = 30000;
15771
15609
  /**
@@ -17478,7 +17316,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17478
17316
  /**
17479
17317
  * Pages within the ThoughtSpot app that can be embedded.
17480
17318
  */
17481
- // eslint-disable-next-line no-shadow
17482
17319
  exports.Page = void 0;
17483
17320
  (function (Page) {
17484
17321
  /**
@@ -17585,11 +17422,25 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17585
17422
  * @group Embed components
17586
17423
  */
17587
17424
  let AppEmbed$1 = class AppEmbed extends V1Embed {
17588
- // eslint-disable-next-line no-useless-constructor
17589
17425
  constructor(domSelector, viewConfig) {
17590
17426
  viewConfig.embedComponentType = 'AppEmbed';
17591
17427
  super(domSelector, viewConfig);
17592
17428
  this.defaultHeight = '100%';
17429
+ this.sendFullHeightLazyLoadData = () => {
17430
+ const data = calculateVisibleElementData(this.iFrame);
17431
+ this.trigger(exports.HostEvent.VisibleEmbedCoordinates, data);
17432
+ };
17433
+ /**
17434
+ * This is a handler for the RequestVisibleEmbedCoordinates event.
17435
+ * It is used to send the visible coordinates data to the host application.
17436
+ * @param data The event payload
17437
+ * @param responder The responder function
17438
+ */
17439
+ this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
17440
+ logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
17441
+ const visibleCoordinatesData = calculateVisibleElementData(this.iFrame);
17442
+ responder({ type: exports.EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
17443
+ };
17593
17444
  /**
17594
17445
  * Set the iframe height as per the computed height received
17595
17446
  * from the ThoughtSpot app.
@@ -17598,6 +17449,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17598
17449
  this.updateIFrameHeight = (data) => {
17599
17450
  var _a;
17600
17451
  this.setIFrameHeight(Math.max(data.data, (_a = this.iFrame) === null || _a === void 0 ? void 0 : _a.scrollHeight));
17452
+ this.sendFullHeightLazyLoadData();
17601
17453
  };
17602
17454
  this.embedIframeCenter = (data, responder) => {
17603
17455
  const obj = this.getIframeCenter();
@@ -17627,6 +17479,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17627
17479
  this.on(exports.EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
17628
17480
  this.on(exports.EmbedEvent.EmbedHeight, this.updateIFrameHeight);
17629
17481
  this.on(exports.EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
17482
+ this.on(exports.EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
17630
17483
  }
17631
17484
  }
17632
17485
  /**
@@ -17634,9 +17487,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17634
17487
  * embedded Liveboard or visualization.
17635
17488
  */
17636
17489
  getEmbedParams() {
17637
- 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,
17638
- /* eslint-disable-next-line max-len */
17639
- 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;
17490
+ 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;
17640
17491
  let params = {};
17641
17492
  params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
17642
17493
  params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
@@ -17665,6 +17516,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17665
17516
  }
17666
17517
  if (fullHeight === true) {
17667
17518
  params[Param.fullHeight] = true;
17519
+ if (this.viewConfig.lazyLoadingForFullHeight) {
17520
+ params[Param.IsLazyLoadingForEmbedEnabled] = true;
17521
+ params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
17522
+ }
17668
17523
  }
17669
17524
  if (tag) {
17670
17525
  params[Param.Tag] = tag;
@@ -17685,7 +17540,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17685
17540
  params[Param.enableAskSage] = enableAskSage;
17686
17541
  }
17687
17542
  if (isOnBeforeGetVizDataInterceptEnabled) {
17688
- /* eslint-disable-next-line max-len */
17689
17543
  params[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
17690
17544
  }
17691
17545
  if (homePageSearchBarMode) {
@@ -17706,11 +17560,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17706
17560
  === DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
17707
17561
  || dataPanelCustomGroupsAccordionInitialState
17708
17562
  === DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST) {
17709
- /* eslint-disable-next-line max-len */
17710
17563
  params[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
17711
17564
  }
17712
17565
  else {
17713
- /* eslint-disable-next-line max-len */
17714
17566
  params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
17715
17567
  }
17716
17568
  if (discoveryExperience) {
@@ -17814,6 +17666,30 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17814
17666
  this.iFrame.src = `${iframeSrc.split(currentPath)[0]}${currentPath}/${path.replace(/^\/?#?\//, '')}`;
17815
17667
  }
17816
17668
  }
17669
+ /**
17670
+ * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
17671
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
17672
+ */
17673
+ destroy() {
17674
+ super.destroy();
17675
+ this.unregisterLazyLoadEvents();
17676
+ }
17677
+ postRender() {
17678
+ this.registerLazyLoadEvents();
17679
+ }
17680
+ registerLazyLoadEvents() {
17681
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
17682
+ // TODO: Use passive: true, install modernizr to check for passive
17683
+ window.addEventListener('resize', this.sendFullHeightLazyLoadData);
17684
+ window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
17685
+ }
17686
+ }
17687
+ unregisterLazyLoadEvents() {
17688
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
17689
+ window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
17690
+ window.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
17691
+ }
17692
+ }
17817
17693
  /**
17818
17694
  * Renders the embedded application pages in the ThoughtSpot app.
17819
17695
  * @param renderOptions An object containing the page ID
@@ -17823,6 +17699,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17823
17699
  await super.render();
17824
17700
  const src = this.getIFrameSrc();
17825
17701
  await this.renderV1Embed(src);
17702
+ this.postRender();
17826
17703
  return this;
17827
17704
  }
17828
17705
  };
@@ -17864,7 +17741,7 @@ query GetEurekaVizSnapshots(
17864
17741
  return;
17865
17742
  }
17866
17743
  const previewStyles = `
17867
- <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">
17744
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community@32.0.2/styles/ag-grid.min.css">
17868
17745
  <style id="ts-preview-style">
17869
17746
  .ts-viz-preview-loader {
17870
17747
  position: absolute;
@@ -17927,6 +17804,21 @@ query GetEurekaVizSnapshots(
17927
17804
  viewConfig.embedComponentType = 'LiveboardEmbed';
17928
17805
  super(domSelector, viewConfig);
17929
17806
  this.defaultHeight = 500;
17807
+ this.sendFullHeightLazyLoadData = () => {
17808
+ const data = calculateVisibleElementData(this.iFrame);
17809
+ this.trigger(exports.HostEvent.VisibleEmbedCoordinates, data);
17810
+ };
17811
+ /**
17812
+ * This is a handler for the RequestVisibleEmbedCoordinates event.
17813
+ * It is used to send the visible coordinates data to the host application.
17814
+ * @param data The event payload
17815
+ * @param responder The responder function
17816
+ */
17817
+ this.requestVisibleEmbedCoordinatesHandler = (data, responder) => {
17818
+ logger$3.info('Sending RequestVisibleEmbedCoordinates', data);
17819
+ const visibleCoordinatesData = calculateVisibleElementData(this.iFrame);
17820
+ responder({ type: exports.EmbedEvent.RequestVisibleEmbedCoordinates, data: visibleCoordinatesData });
17821
+ };
17930
17822
  /**
17931
17823
  * Set the iframe height as per the computed height received
17932
17824
  * from the ThoughtSpot app.
@@ -17934,6 +17826,7 @@ query GetEurekaVizSnapshots(
17934
17826
  */
17935
17827
  this.updateIFrameHeight = (data) => {
17936
17828
  this.setIFrameHeight(Math.max(data.data, this.defaultHeight));
17829
+ this.sendFullHeightLazyLoadData();
17937
17830
  };
17938
17831
  this.embedIframeCenter = (data, responder) => {
17939
17832
  const obj = this.getIframeCenter();
@@ -17967,6 +17860,7 @@ query GetEurekaVizSnapshots(
17967
17860
  this.on(exports.EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
17968
17861
  this.on(exports.EmbedEvent.EmbedHeight, this.updateIFrameHeight);
17969
17862
  this.on(exports.EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);
17863
+ this.on(exports.EmbedEvent.RequestVisibleEmbedCoordinates, this.requestVisibleEmbedCoordinatesHandler);
17970
17864
  }
17971
17865
  }
17972
17866
  /**
@@ -17981,6 +17875,10 @@ query GetEurekaVizSnapshots(
17981
17875
  || this.viewConfig.preventPinboardFilterRemoval;
17982
17876
  if (fullHeight === true) {
17983
17877
  params[Param.fullHeight] = true;
17878
+ if (this.viewConfig.lazyLoadingForFullHeight) {
17879
+ params[Param.IsLazyLoadingForEmbedEnabled] = true;
17880
+ params[Param.RootMarginForLazyLoad] = this.viewConfig.lazyLoadingMargin;
17881
+ }
17984
17882
  }
17985
17883
  if (defaultHeight) {
17986
17884
  this.defaultHeight = defaultHeight;
@@ -18136,6 +18034,30 @@ query GetEurekaVizSnapshots(
18136
18034
  }
18137
18035
  return super.trigger(messageType, dataWithVizId);
18138
18036
  }
18037
+ /**
18038
+ * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
18039
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
18040
+ */
18041
+ destroy() {
18042
+ super.destroy();
18043
+ this.unregisterLazyLoadEvents();
18044
+ }
18045
+ postRender() {
18046
+ this.registerLazyLoadEvents();
18047
+ }
18048
+ registerLazyLoadEvents() {
18049
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
18050
+ // TODO: Use passive: true, install modernizr to check for passive
18051
+ window.addEventListener('resize', this.sendFullHeightLazyLoadData);
18052
+ window.addEventListener('scroll', this.sendFullHeightLazyLoadData, true);
18053
+ }
18054
+ }
18055
+ unregisterLazyLoadEvents() {
18056
+ if (this.viewConfig.fullHeight && this.viewConfig.lazyLoadingForFullHeight) {
18057
+ window.removeEventListener('resize', this.sendFullHeightLazyLoadData);
18058
+ window.removeEventListener('scroll', this.sendFullHeightLazyLoadData);
18059
+ }
18060
+ }
18139
18061
  /**
18140
18062
  * Render an embedded ThoughtSpot Liveboard or visualization
18141
18063
  * @param renderOptions An object specifying the Liveboard ID,
@@ -18146,6 +18068,7 @@ query GetEurekaVizSnapshots(
18146
18068
  const src = this.getIFrameSrc();
18147
18069
  await this.renderV1Embed(src);
18148
18070
  this.showPreviewLoader();
18071
+ this.postRender();
18149
18072
  return this;
18150
18073
  }
18151
18074
  navigateToLiveboard(liveboardId, vizId, activeTabId) {
@@ -18544,11 +18467,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18544
18467
  return {
18545
18468
  convId: this.conversationId,
18546
18469
  messageId: responses[0].msgId,
18547
- data: {
18548
- ...data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
18549
- convId: this.conversationId,
18550
- messageId: responses[0].msgId,
18551
- },
18470
+ data: data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
18552
18471
  error: null,
18553
18472
  };
18554
18473
  }
@@ -18574,7 +18493,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18574
18493
  }
18575
18494
  getIframeSrc() {
18576
18495
  var _a;
18577
- const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
18496
+ const { sessionId, genNo, acSessionId, acGenNo, } = this.viewConfig;
18578
18497
  const path = 'conv-assist-answer';
18579
18498
  const queryParams = this.getBaseQueryParams();
18580
18499
  queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
@@ -18589,8 +18508,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18589
18508
  genNo,
18590
18509
  acSessionId,
18591
18510
  acGenNo,
18592
- convId,
18593
- messageId,
18594
18511
  });
18595
18512
  return `${this.getEmbedBasePath(query)}/embed/${path}${tsPostHashParams}`;
18596
18513
  }
@@ -18634,8 +18551,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18634
18551
  const container = document.createElement('div');
18635
18552
  const embed = new ConversationMessage$1(container, {
18636
18553
  ...this.viewConfig,
18637
- convId: data.convId,
18638
- messageId: data.messageId,
18639
18554
  sessionId: data.sessionId,
18640
18555
  genNo: data.genNo,
18641
18556
  acSessionId: data.stateKey.transactionId,
@@ -18656,8 +18571,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
18656
18571
  return { error };
18657
18572
  }
18658
18573
  return { data: {
18659
- convId: data.convId,
18660
- messageId: data.messageId,
18661
18574
  sessionId: data.sessionId,
18662
18575
  genNo: data.genNo,
18663
18576
  acSessionId: data.stateKey.transactionId,