@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
@@ -525,6 +525,46 @@ export interface AppViewConfig extends AllEmbedViewConfig {
525
525
  * ```
526
526
  */
527
527
  isLiveboardStylingAndGroupingEnabled?: boolean;
528
+ /**
529
+ * This flag is used to enable the full height lazy load data.
530
+ *
531
+ * @example
532
+ * ```js
533
+ * const embed = new AppEmbed('#embed-container', {
534
+ * // ...other options
535
+ * fullHeight: true,
536
+ * lazyLoadingForFullHeight: true,
537
+ * })
538
+ * ```
539
+ *
540
+ * @type {boolean}
541
+ * @default false
542
+ * @version SDK: 1.40.0 | ThoughtSpot:10.12.0.cl
543
+ */
544
+ lazyLoadingForFullHeight?: boolean;
545
+ /**
546
+ * The margin to be used for lazy loading.
547
+ *
548
+ * For example, if the margin is set to '10px',
549
+ * the visualization will be loaded 10px before the its top edge is visible in the
550
+ * viewport.
551
+ *
552
+ * The format is similar to CSS margin.
553
+ *
554
+ * @example
555
+ * ```js
556
+ * const embed = new AppEmbed('#embed-container', {
557
+ * // ...other options
558
+ * fullHeight: true,
559
+ * lazyLoadingForFullHeight: true,
560
+ * // Using 0px, the visualization will be only loaded when its visible in the viewport.
561
+ * lazyLoadingMargin: '0px',
562
+ * })
563
+ * ```
564
+ * @type {string}
565
+ * @version SDK: 1.40.0 | ThoughtSpot:10.12.0.cl
566
+ */
567
+ lazyLoadingMargin?: string;
528
568
  }
529
569
  /**
530
570
  * Embeds full ThoughtSpot experience in a host application.
@@ -561,6 +601,11 @@ export class AppEmbed extends V1Embed {
561
601
  * @version SDK: 1.12.0 | ThoughtSpot: 8.4.0.cl, 8.4.1-sw
562
602
  */
563
603
  navigateToPage(path: string | number, noReload?: boolean): void;
604
+ /**
605
+ * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
606
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
607
+ */
608
+ destroy(): void;
564
609
  /**
565
610
  * Renders the embedded application pages in the ThoughtSpot app.
566
611
  * @param renderOptions An object containing the page ID
@@ -1012,6 +1057,46 @@ export interface LiveboardViewConfig extends BaseViewConfig, LiveboardOtherViewC
1012
1057
  * ```
1013
1058
  */
1014
1059
  isLiveboardStylingAndGroupingEnabled?: boolean;
1060
+ /**
1061
+ * This flag is used to enable the full height lazy load data.
1062
+ *
1063
+ * @example
1064
+ * ```js
1065
+ * const embed = new LiveboardEmbed('#embed-container', {
1066
+ * // ...other options
1067
+ * fullHeight: true,
1068
+ * lazyLoadingForFullHeight: true,
1069
+ * })
1070
+ * ```
1071
+ *
1072
+ * @type {boolean}
1073
+ * @default false
1074
+ * @version SDK: 1.40.0 | ThoughtSpot:10.12.0.cl
1075
+ */
1076
+ lazyLoadingForFullHeight?: boolean;
1077
+ /**
1078
+ * The margin to be used for lazy loading.
1079
+ *
1080
+ * For example, if the margin is set to '10px',
1081
+ * the visualization will be loaded 10px before the its top edge is visible in the
1082
+ * viewport.
1083
+ *
1084
+ * The format is similar to CSS margin.
1085
+ *
1086
+ * @example
1087
+ * ```js
1088
+ * const embed = new LiveboardEmbed('#embed-container', {
1089
+ * // ...other options
1090
+ * fullHeight: true,
1091
+ * lazyLoadingForFullHeight: true,
1092
+ * // Using 0px, the visualization will be only loaded when its visible in the viewport.
1093
+ * lazyLoadingMargin: '0px',
1094
+ * })
1095
+ * ```
1096
+ * @type {string}
1097
+ * @version SDK: 1.40.0 | ThoughtSpot:10.12.0.cl
1098
+ */
1099
+ lazyLoadingMargin?: string;
1015
1100
  }
1016
1101
  /**
1017
1102
  * Embed a ThoughtSpot Liveboard or visualization. When rendered it already
@@ -1045,6 +1130,11 @@ export class LiveboardEmbed extends V1Embed {
1045
1130
  * @returns A promise that resolves with the response from the embedded app
1046
1131
  */
1047
1132
  trigger<HostEventT extends HostEvent, PayloadT>(messageType: HostEventT, data?: TriggerPayload<PayloadT, HostEventT>): Promise<TriggerResponse<PayloadT, HostEventT>>;
1133
+ /**
1134
+ * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
1135
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
1136
+ */
1137
+ destroy(): void;
1048
1138
  /**
1049
1139
  * Render an embedded ThoughtSpot Liveboard or visualization
1050
1140
  * @param renderOptions An object specifying the Liveboard ID,
@@ -1537,8 +1627,6 @@ export interface SpotterAgentMessageViewConfig extends SpotterAgentEmbedViewConf
1537
1627
  genNo: number;
1538
1628
  acSessionId: string;
1539
1629
  acGenNo: number;
1540
- convId: string;
1541
- messageId: string;
1542
1630
  }
1543
1631
  export class ConversationMessage extends TsEmbed {
1544
1632
  protected viewConfig: SpotterAgentMessageViewConfig;
@@ -1586,8 +1674,6 @@ export class SpotterAgentEmbed {
1586
1674
  data?: undefined;
1587
1675
  } | {
1588
1676
  data: {
1589
- convId: any;
1590
- messageId: any;
1591
1677
  sessionId: any;
1592
1678
  genNo: any;
1593
1679
  acSessionId: any;
@@ -4706,82 +4792,11 @@ export enum EmbedEvent {
4706
4792
  */
4707
4793
  ExitPresentMode = "exitPresentMode",
4708
4794
  /**
4709
- * Emitted when spotter response is text data
4710
- * @example
4711
- * ```js
4712
- * spotterEmbed.on(EmbedEvent.SpotterData, (payload) => {
4713
- * console.log('payload', payload);
4714
- * })
4715
- *```
4716
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
4717
- */
4718
- SpotterData = "SpotterData",
4719
- /**
4720
- * Emitted when user opens up the worksheet preview modal in spotter embed.
4721
- * @example
4722
- * ```js
4723
- * spotterEmbed.on(EmbedEvent.PreviewSpotterData, (payload) => {
4724
- * console.log('payload', payload);
4725
- * })
4726
- *```
4727
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
4728
- */
4729
- PreviewSpotterData = "PreviewSpotterData",
4730
- /**
4731
- * Emitted when the spotter query is triggered in spotter embed.
4732
- * @example
4733
- * ```js
4734
- * spotterEmbed.on(EmbedEvent.SpotterQueryTriggered, (payload) => {
4735
- * console.log('payload', payload);
4736
- * })
4737
- *```
4738
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
4739
- */
4740
- SpotterQueryTriggered = "SpotterQueryTriggered",
4741
- /**
4742
- * Emitted when the last spotter query is edited in spotter embed.
4743
- * @example
4744
- * ```js
4745
- * spotterEmbed.on(EmbedEvent.LastPromptEdited, (payload) => {
4746
- * console.log('payload', payload);
4747
- * })
4748
- *```
4749
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
4750
- */
4751
- LastPromptEdited = "LastPromptEdited",
4752
- /**
4753
- * Emitted when the last spotter query is deleted in spotter embed.
4754
- * @example
4755
- * ```js
4756
- * spotterEmbed.on(EmbedEvent.LastPromptDeleted, (payload) => {
4757
- * console.log('payload', payload);
4758
- * })
4759
- *```
4760
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
4761
- */
4762
- LastPromptDeleted = "LastPromptDeleted",
4763
- /**
4764
- * Emitted when the coversation is reset in spotter embed.
4765
- * @example
4766
- * ```js
4767
- * spotterEmbed.on(EmbedEvent.ResetSpotterConversation, (payload) => {
4768
- * console.log('payload', payload);
4769
- * })
4770
- *```
4771
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
4772
- */
4773
- ResetSpotterConversation = "ResetSpotterConversation",
4774
- /**
4775
- * Emitted when the *Spotter* is initialized.
4776
- * @example
4777
- * ```js
4778
- * spotterEmbed.on(EmbedEvent.SpotterInit, (payload) => {
4779
- * console.log('payload', payload);
4780
- * })
4781
- *```
4782
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
4795
+ * Emitted when a user requests the full height lazy load data.
4796
+ * @version SDK : 1.39.0 | ThoughtSpot : 10.10.0.cl
4797
+ * @hidden
4783
4798
  */
4784
- SpotterInit = "SpotterInit"
4799
+ RequestVisibleEmbedCoordinates = "requestVisibleEmbedCoordinates"
4785
4800
  }
4786
4801
  /**
4787
4802
  * Event types that can be triggered by the host application
@@ -5070,7 +5085,6 @@ export enum HostEvent {
5070
5085
  * @param
5071
5086
  * `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
5072
5087
  * Optional when pinning a new chart or table generated from a Search query.
5073
- * **Required** in Spotter Embed.
5074
5088
  * @param
5075
5089
  * `liveboardID` - GUID of the Liveboard to pin an Answer. If there is no Liveboard,
5076
5090
  * specify the `newLiveboardName` parameter to create a new Liveboard.
@@ -5118,12 +5132,6 @@ export enum HostEvent {
5118
5132
  * ```js
5119
5133
  * appEmbed.trigger(HostEvent.Pin)
5120
5134
  * ```
5121
- * @example
5122
- * ```js
5123
- * const pinResponse = await spotterEmbed.trigger(HostEvent.Pin, {
5124
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
5125
- * });
5126
- * ```
5127
5135
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
5128
5136
  */
5129
5137
  Pin = "pin",
@@ -5217,12 +5225,6 @@ export enum HostEvent {
5217
5225
  * ```js
5218
5226
  * searchEmbed.trigger(HostEvent.MakeACopy)
5219
5227
  * ```
5220
- * @example
5221
- * ```js
5222
- * const pinResponse = await spotterEmbed.trigger(HostEvent.MakeACopy, {
5223
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
5224
- * });
5225
- * ```
5226
5228
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
5227
5229
  */
5228
5230
  MakeACopy = "makeACopy",
@@ -5295,7 +5297,6 @@ export enum HostEvent {
5295
5297
  * This event is not supported in visualization embed and search embed.
5296
5298
  * @param - object - To trigger the action for a specific visualization
5297
5299
  * in Liveboard embed, pass in `vizId` as a key.
5298
- * **Required** in Spotter embed.
5299
5300
  * @example
5300
5301
  * ```js
5301
5302
  * liveboardEmbed.trigger(HostEvent.Edit)
@@ -5304,12 +5305,6 @@ export enum HostEvent {
5304
5305
  * liveboardEmbed.trigger(HostEvent.Edit, {vizId:
5305
5306
  * '730496d6-6903-4601-937e-2c691821af3c'})
5306
5307
  * ```
5307
- * @example
5308
- * ```js
5309
- * const pinResponse = await spotterEmbed.trigger(HostEvent.Edit, {
5310
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
5311
- * });
5312
- * ```
5313
5308
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
5314
5309
  */
5315
5310
  Edit = "edit",
@@ -5357,16 +5352,6 @@ export enum HostEvent {
5357
5352
  * );
5358
5353
  * })
5359
5354
  * ```
5360
- * @example
5361
- * ```js
5362
- * spotterEmbed.trigger(HostEvent.GetTML, {
5363
- * vizId: '730496d6-6903-4601-937e-2c691821af3c'
5364
- * }).then((tml) => {
5365
- * console.log(
5366
- * tml.answer.search_query // TML representation of the search query
5367
- * );
5368
- * })
5369
- * ```
5370
5355
  * @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
5371
5356
  * @important
5372
5357
  */
@@ -5454,12 +5439,7 @@ export enum HostEvent {
5454
5439
  * vizEmbed.trigger(HostEvent.DownloadAsPng)
5455
5440
  *
5456
5441
  * searchEmbed.trigger(HostEvent.DownloadAsPng)
5457
- *
5458
- * spotterEmbed.trigger(HostEvent.DownloadAsPng, {
5459
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
5460
- * })
5461
5442
  * ```
5462
- *
5463
5443
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
5464
5444
  */
5465
5445
  DownloadAsPng = "downloadAsPng",
@@ -5477,11 +5457,6 @@ export enum HostEvent {
5477
5457
  * ```js
5478
5458
  * searchEmbed.trigger(HostEvent.DownloadAsCsv)
5479
5459
  * ```
5480
- * ```js
5481
- * spotterEmbed.trigger(HostEvent.DownloadAsCsv, {
5482
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
5483
- * })
5484
- * ```
5485
5460
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
5486
5461
  */
5487
5462
  DownloadAsCsv = "downloadAsCSV",
@@ -5499,11 +5474,6 @@ export enum HostEvent {
5499
5474
  * ```js
5500
5475
  * searchEmbed.trigger(HostEvent.DownloadAsXlsx)
5501
5476
  * ```
5502
- * ```js
5503
- * spotterEmbed.trigger(HostEvent.downloadAsXLSX, {
5504
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
5505
- * })
5506
- * ```
5507
5477
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
5508
5478
  */
5509
5479
  DownloadAsXlsx = "downloadAsXLSX",
@@ -5523,7 +5493,6 @@ export enum HostEvent {
5523
5493
  /**
5524
5494
  * Trigger the **Save** action on a Liveboard or Answer.
5525
5495
  * Saves the changes.
5526
- * @param - `vizId` is required in Spotter Embed.
5527
5496
  * @example
5528
5497
  * ```js
5529
5498
  * liveboardEmbed.trigger(HostEvent.Save)
@@ -5531,11 +5500,6 @@ export enum HostEvent {
5531
5500
  * ```js
5532
5501
  * searchEmbed.trigger(HostEvent.Save)
5533
5502
  * ```
5534
- * ```js
5535
- * spotterEmbed.trigger(HostEvent.Save, {
5536
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
5537
- * })
5538
- * ```
5539
5503
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
5540
5504
  */
5541
5505
  Save = "save",
@@ -5819,7 +5783,7 @@ export enum HostEvent {
5819
5783
  ResetLiveboardPersonalisedView = "ResetLiveboardPersonalisedView",
5820
5784
  /**
5821
5785
  * Triggers an action to update Parameter values on embedded
5822
- * Answers, Liveboard and Spotter answer in Edit mode.
5786
+ * Answers and Liveboard.
5823
5787
  *
5824
5788
  * @example
5825
5789
  * ```js
@@ -5838,13 +5802,6 @@ export enum HostEvent {
5838
5802
  * console.log('parameters', parameter);
5839
5803
  * });
5840
5804
  *```
5841
- *```js
5842
- * spotterEmbed.trigger(HostEvent.GetParameters, {
5843
- * vizId: '730496d6-6903-4601-937e-2c691821af3c'
5844
- * }).then((parameter) => {
5845
- * console.log('parameters', parameter);
5846
- * });
5847
- *```
5848
5805
  * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
5849
5806
  */
5850
5807
  GetParameters = "GetParameters",
@@ -5912,64 +5869,6 @@ export enum HostEvent {
5912
5869
  * @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
5913
5870
  */
5914
5871
  TransformTableVizData = "TransformTableVizData",
5915
- /**
5916
- * Triggers a search operation with the search tokens specified in
5917
- * the search query string in spotter embed.
5918
- * @param - `queryString`: Text string in Natural Language format
5919
- * @param - `executeSearch`: Boolean to execute search and update search query
5920
- * @example
5921
- * ```js
5922
- * spotterEmbed.trigger(HostEvent.SpotterSearch, {
5923
- * query: 'revenue per year',
5924
- * executeSearch: true,
5925
- * })
5926
- * ```
5927
- */
5928
- SpotterSearch = "SpotterSearch",
5929
- /**
5930
- * Edits the last prompt in spotter embed.
5931
- * @param - `query`: Text string
5932
- * @example
5933
- * ```js
5934
- * spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year");
5935
- * ```
5936
- */
5937
- EditLastPrompt = "EditLastPrompt",
5938
- /**
5939
- * Opens the Worksheet preview modal in Spotter Embed.
5940
- * @example
5941
- * ```js
5942
- * spotterEmbed.trigger(HostEvent.PreviewSpotterData);
5943
- * ```
5944
- */
5945
- PreviewSpotterData = "PreviewSpotterData",
5946
- /**
5947
- * Resets the Spotter Embed Conversation.
5948
- * @example
5949
- * ```js
5950
- * spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
5951
- * ```
5952
- */
5953
- ResetSpotterConversation = "ResetSpotterConversation",
5954
- /**
5955
- * Deletes the last prompt in spotter embed.
5956
- * @example
5957
- * ```js
5958
- * spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
5959
- * ```
5960
- */
5961
- DeleteLastPrompt = "DeleteLastPrompt",
5962
- /**
5963
- * Toggle the visualization to chart or table view.
5964
- * @param - `vizId ` In Spotter Embed, vizId is required.
5965
- * @example
5966
- * ```js
5967
- * spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {
5968
- * vizId:"'b535c760-8bbe-4e6f-bb26-af56b4129a1e'"
5969
- * });
5970
- *```
5971
- */
5972
- AnswerChartSwitcher = "answerChartSwitcher",
5973
5872
  /**
5974
5873
  * @hidden
5975
5874
  * Trigger exit from presentation mode when user exits fullscreen.
@@ -5981,15 +5880,18 @@ export enum HostEvent {
5981
5880
  */
5982
5881
  ExitPresentMode = "exitPresentMode",
5983
5882
  /**
5984
- * Trigger the *Ask Sage* action for visualizations
5883
+ * Triggers the full height lazy load data.
5985
5884
  * @example
5986
5885
  * ```js
5987
- * liveboardEmbed.trigger(HostEvent.AskSpotter,
5988
- * {containerId:'730496d6-6903-4601-937e-2c691821af3c'})
5886
+ * liveboardEmbed.on(EmbedEvent.RequestVisibleEmbedCoordinates, (payload) => {
5887
+ * console.log(payload);
5888
+ * });
5989
5889
  * ```
5990
- * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
5890
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
5891
+ *
5892
+ * @hidden
5991
5893
  */
5992
- AskSpotter = "askSpotter"
5894
+ VisibleEmbedCoordinates = "visibleEmbedCoordinates"
5993
5895
  }
5994
5896
  /**
5995
5897
  * The different visual modes that the data sources panel within
@@ -6123,7 +6025,9 @@ export enum Param {
6123
6025
  CoverAndFilterOptionInPDF = "arePdfCoverFilterPageCheckboxesEnabled",
6124
6026
  PrimaryAction = "primaryAction",
6125
6027
  isSpotterAgentEmbed = "isSpotterAgentEmbed",
6126
- IsLiveboardStylingAndGroupingEnabled = "isLiveboardStylingAndGroupingEnabled"
6028
+ IsLiveboardStylingAndGroupingEnabled = "isLiveboardStylingAndGroupingEnabled",
6029
+ IsLazyLoadingForEmbedEnabled = "isLazyLoadingForEmbedEnabled",
6030
+ RootMarginForLazyLoad = "rootMarginForLazyLoad"
6127
6031
  }
6128
6032
  /**
6129
6033
  * ThoughtSpot application pages include actions and menu commands
@@ -511,6 +511,46 @@ export interface AppViewConfig extends AllEmbedViewConfig {
511
511
  * ```
512
512
  */
513
513
  isLiveboardStylingAndGroupingEnabled?: boolean;
514
+ /**
515
+ * This flag is used to enable the full height lazy load data.
516
+ *
517
+ * @example
518
+ * ```js
519
+ * const embed = new AppEmbed('#embed-container', {
520
+ * // ...other options
521
+ * fullHeight: true,
522
+ * lazyLoadingForFullHeight: true,
523
+ * })
524
+ * ```
525
+ *
526
+ * @type {boolean}
527
+ * @default false
528
+ * @version SDK: 1.40.0 | ThoughtSpot:10.12.0.cl
529
+ */
530
+ lazyLoadingForFullHeight?: boolean;
531
+ /**
532
+ * The margin to be used for lazy loading.
533
+ *
534
+ * For example, if the margin is set to '10px',
535
+ * the visualization will be loaded 10px before the its top edge is visible in the
536
+ * viewport.
537
+ *
538
+ * The format is similar to CSS margin.
539
+ *
540
+ * @example
541
+ * ```js
542
+ * const embed = new AppEmbed('#embed-container', {
543
+ * // ...other options
544
+ * fullHeight: true,
545
+ * lazyLoadingForFullHeight: true,
546
+ * // Using 0px, the visualization will be only loaded when its visible in the viewport.
547
+ * lazyLoadingMargin: '0px',
548
+ * })
549
+ * ```
550
+ * @type {string}
551
+ * @version SDK: 1.40.0 | ThoughtSpot:10.12.0.cl
552
+ */
553
+ lazyLoadingMargin?: string;
514
554
  }
515
555
  /**
516
556
  * Embeds full ThoughtSpot experience in a host application.
@@ -525,6 +565,14 @@ export declare class AppEmbed extends V1Embed {
525
565
  * embedded Liveboard or visualization.
526
566
  */
527
567
  protected getEmbedParams(): string;
568
+ private sendFullHeightLazyLoadData;
569
+ /**
570
+ * This is a handler for the RequestVisibleEmbedCoordinates event.
571
+ * It is used to send the visible coordinates data to the host application.
572
+ * @param data The event payload
573
+ * @param responder The responder function
574
+ */
575
+ private requestVisibleEmbedCoordinatesHandler;
528
576
  /**
529
577
  * Constructs the URL of the ThoughtSpot app page to be rendered.
530
578
  * @param pageId The ID of the page to be embedded.
@@ -562,6 +610,14 @@ export declare class AppEmbed extends V1Embed {
562
610
  * @version SDK: 1.12.0 | ThoughtSpot: 8.4.0.cl, 8.4.1-sw
563
611
  */
564
612
  navigateToPage(path: string | number, noReload?: boolean): void;
613
+ /**
614
+ * Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
615
+ * @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
616
+ */
617
+ destroy(): void;
618
+ private postRender;
619
+ private registerLazyLoadEvents;
620
+ private unregisterLazyLoadEvents;
565
621
  /**
566
622
  * Renders the embedded application pages in the ThoughtSpot app.
567
623
  * @param renderOptions An object containing the page ID
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/embed/app.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAEH,WAAW,EAGX,cAAc,EACd,kBAAkB,EACrB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC;;GAEG;AAEH,oBAAY,IAAI;IACZ;;OAEG;IACH,IAAI,SAAS;IACb;;OAEG;IACH,MAAM,WAAW;IACjB;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,UAAU,eAAe;IACzB;;OAEG;IACH,SAAS,cAAc;IACvB;;OAEG;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