@thoughtspot/visual-embed-sdk 1.42.2 → 1.43.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 (43) hide show
  1. package/cjs/package.json +1 -1
  2. package/cjs/src/embed/base.d.ts.map +1 -1
  3. package/cjs/src/embed/base.js +2 -0
  4. package/cjs/src/embed/base.js.map +1 -1
  5. package/cjs/src/embed/ts-embed.d.ts.map +1 -1
  6. package/cjs/src/embed/ts-embed.js +17 -2
  7. package/cjs/src/embed/ts-embed.js.map +1 -1
  8. package/cjs/src/embed/ts-embed.spec.js +134 -41
  9. package/cjs/src/embed/ts-embed.spec.js.map +1 -1
  10. package/cjs/src/types.d.ts +159 -69
  11. package/cjs/src/types.d.ts.map +1 -1
  12. package/cjs/src/types.js +146 -68
  13. package/cjs/src/types.js.map +1 -1
  14. package/dist/{index-CjbriUI0.js → index-HZ94j9Ey.js} +1 -1
  15. package/dist/src/embed/base.d.ts.map +1 -1
  16. package/dist/src/embed/ts-embed.d.ts.map +1 -1
  17. package/dist/src/types.d.ts +159 -69
  18. package/dist/src/types.d.ts.map +1 -1
  19. package/dist/tsembed-react.es.js +168 -73
  20. package/dist/tsembed-react.js +167 -72
  21. package/dist/tsembed.es.js +168 -73
  22. package/dist/tsembed.js +167 -72
  23. package/dist/visual-embed-sdk-react-full.d.ts +159 -69
  24. package/dist/visual-embed-sdk-react.d.ts +159 -69
  25. package/dist/visual-embed-sdk.d.ts +159 -69
  26. package/lib/package.json +1 -1
  27. package/lib/src/embed/base.d.ts.map +1 -1
  28. package/lib/src/embed/base.js +2 -0
  29. package/lib/src/embed/base.js.map +1 -1
  30. package/lib/src/embed/ts-embed.d.ts.map +1 -1
  31. package/lib/src/embed/ts-embed.js +17 -2
  32. package/lib/src/embed/ts-embed.js.map +1 -1
  33. package/lib/src/embed/ts-embed.spec.js +134 -41
  34. package/lib/src/embed/ts-embed.spec.js.map +1 -1
  35. package/lib/src/types.d.ts +159 -69
  36. package/lib/src/types.d.ts.map +1 -1
  37. package/lib/src/types.js +146 -68
  38. package/lib/src/types.js.map +1 -1
  39. package/package.json +1 -1
  40. package/src/embed/base.ts +2 -0
  41. package/src/embed/ts-embed.spec.ts +168 -44
  42. package/src/embed/ts-embed.ts +14 -1
  43. package/src/types.ts +159 -68
package/dist/tsembed.js CHANGED
@@ -1,4 +1,4 @@
1
- /* @thoughtspot/visual-embed-sdk version 1.42.2 */
1
+ /* @thoughtspot/visual-embed-sdk version 1.43.0 */
2
2
  'use client';
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
@@ -922,7 +922,7 @@
922
922
  */
923
923
  EmbedEvent["Load"] = "load";
924
924
  /**
925
- * Data pertaining to an Answer or Liveboard is received.
925
+ * Data pertaining to an Answer, Liveboard or Spotter visualization is received.
926
926
  * The event payload includes the raw data of the object.
927
927
  * @return data - Answer of Liveboard data
928
928
  * @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
@@ -1341,6 +1341,17 @@
1341
1341
  *```
1342
1342
  */
1343
1343
  EmbedEvent["AnswerDelete"] = "answerDelete";
1344
+ /**
1345
+ * Emitted when the AI Highlights action is triggered on a Liveboard
1346
+ * @version SDK: 1.44.0 | ThoughtSpot: 10.15.0.cl
1347
+ * @example
1348
+ *```js
1349
+ * liveboardEmbed.on(EmbedEvent.AIHighlights, (payload) => {
1350
+ * console.log('AI Highlights', payload);
1351
+ * })
1352
+ *```
1353
+ */
1354
+ EmbedEvent["AIHighlights"] = "AIHighlights";
1344
1355
  /**
1345
1356
  * Emitted when a user initiates the Pin action to
1346
1357
  * add an Answer to a Liveboard.
@@ -2291,7 +2302,7 @@
2291
2302
  * the following parameters:
2292
2303
  *
2293
2304
  * @param
2294
- * `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
2305
+ * `vizId`- GUID of the saved Answer or Spotter visualization ID to pin to a Liveboard.
2295
2306
  * Optional when pinning a new chart or table generated from a Search query.
2296
2307
  * **Required** in Spotter Embed.
2297
2308
  * @param
@@ -2343,10 +2354,16 @@
2343
2354
  * ```
2344
2355
  * @example
2345
2356
  * ```js
2346
- * const pinResponse = await spotterEmbed.trigger(HostEvent.Pin, {
2347
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2348
- * });
2349
- * ```
2357
+
2358
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event.
2359
+ * let latestSpotterVizId = '';
2360
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
2361
+ * latestSpotterVizId = payload.data.id;
2362
+ * });
2363
+ *
2364
+ * spotterEmbed.trigger(HostEvent.Pin, { vizId: latestSpotterVizId });
2365
+ * ```
2366
+ *
2350
2367
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2351
2368
  */
2352
2369
  HostEvent["Pin"] = "pin";
@@ -2421,14 +2438,29 @@
2421
2438
  * ```
2422
2439
  * @example
2423
2440
  * ```js
2424
- * spotterEmbed.trigger(HostEvent.DownloadAsPdf, {
2425
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2426
- * });
2427
- * ```
2441
+
2442
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPdf host event.
2443
+ * let latestSpotterVizId = '';
2444
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
2445
+ * latestSpotterVizId = payload.data.id;
2446
+ * });
2447
+ *
2448
+ * spotterEmbed.trigger(HostEvent.DownloadAsPdf, { vizId: latestSpotterVizId });
2449
+ * ```
2428
2450
  *
2429
2451
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2430
2452
  */
2431
2453
  HostEvent["DownloadAsPdf"] = "downloadAsPdf";
2454
+ /**
2455
+ * Trigger the **AI Highlights** action on an embedded Liveboard
2456
+ *
2457
+ * @example
2458
+ * ```js
2459
+ * liveboardEmbed.trigger(HostEvent.AIHighlights)
2460
+ * ```
2461
+ * @version SDK: 1.44.0 | ThoughtSpot: 10.15.0.cl
2462
+ */
2463
+ HostEvent["AIHighlights"] = "AIHighlights";
2432
2464
  /**
2433
2465
  * Trigger the **Make a copy** action on a Liveboard,
2434
2466
  * visualization, or Answer page.
@@ -2451,10 +2483,14 @@
2451
2483
  * ```
2452
2484
  * @example
2453
2485
  * ```js
2454
- * const pinResponse = await spotterEmbed.trigger(HostEvent.MakeACopy, {
2455
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2456
- * });
2457
- * ```
2486
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in MakeACopy host event.
2487
+ * let latestSpotterVizId = '';
2488
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
2489
+ * latestSpotterVizId = payload.data.id;
2490
+ * });
2491
+ *
2492
+ * spotterEmbed.trigger(HostEvent.MakeACopy, { vizId: latestSpotterVizId });
2493
+ * ```
2458
2494
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2459
2495
  */
2460
2496
  HostEvent["MakeACopy"] = "makeACopy";
@@ -2539,15 +2575,7 @@
2539
2575
  * ```
2540
2576
  * @example
2541
2577
  * ```js
2542
- * const pinResponse = await spotterEmbed.trigger(HostEvent.Edit, {
2543
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2544
- * });
2545
- * ```
2546
- * @example
2547
- * ```js
2548
- * const editResponse = await spotterEmbed.trigger(HostEvent.Edit, {
2549
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2550
- * });
2578
+ * spotterEmbed.trigger(HostEvent.Edit);
2551
2579
  * ```
2552
2580
  * @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
2553
2581
  */
@@ -2596,16 +2624,23 @@
2596
2624
  * );
2597
2625
  * })
2598
2626
  * ```
2599
- * @example
2627
+ * * @example
2600
2628
  * ```js
2601
- * spotterEmbed.trigger(HostEvent.GetTML, {
2602
- * vizId: '730496d6-6903-4601-937e-2c691821af3c'
2629
+
2630
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event.
2631
+ * let latestSpotterVizId = '';
2632
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
2633
+ * latestSpotterVizId = payload.data.id;
2634
+ * });
2635
+ *
2636
+ * spotterEmbed.trigger(HostEvent.GetTML, {
2637
+ * vizId: latestSpotterVizId
2603
2638
  * }).then((tml) => {
2604
2639
  * console.log(
2605
2640
  * tml.answer.search_query // TML representation of the search query
2606
2641
  * );
2607
2642
  * })
2608
- * ```
2643
+ * ```
2609
2644
  * @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
2610
2645
  * @important
2611
2646
  */
@@ -2669,7 +2704,7 @@
2669
2704
  /**
2670
2705
  * Trigger the **Download** action on charts in
2671
2706
  * the embedded view.
2672
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2707
+ * @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
2673
2708
  * @example
2674
2709
  * ```js
2675
2710
  * liveboardEmbed.trigger(HostEvent.Download, {vizId:
@@ -2679,10 +2714,14 @@
2679
2714
  * embed.trigger(HostEvent.Download)
2680
2715
  * ```
2681
2716
  * ```js
2682
- * spotterEmbed.trigger(HostEvent.Download, {
2683
- * vizId:'730496d6-6903-4601-937e-2c691821af3c'
2684
- * });
2685
- * ```
2717
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in Download host event.
2718
+ * let latestSpotterVizId = '';
2719
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
2720
+ * latestSpotterVizId = payload.data.id;
2721
+ * });
2722
+ *
2723
+ * spotterEmbed.trigger(HostEvent.Download, { vizId: latestSpotterVizId });
2724
+ * ```
2686
2725
  * @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
2687
2726
  * Use {@link DownloadAsPng}
2688
2727
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
@@ -2700,9 +2739,13 @@
2700
2739
  *
2701
2740
  * searchEmbed.trigger(HostEvent.DownloadAsPng)
2702
2741
  *
2703
- * spotterEmbed.trigger(HostEvent.DownloadAsPng, {
2704
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2705
- * })
2742
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPng host event.
2743
+ * let latestSpotterVizId = '';
2744
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
2745
+ * latestSpotterVizId = payload.data.id;
2746
+ * });
2747
+ *
2748
+ * spotterEmbed.trigger(HostEvent.DownloadAsPng, { vizId: latestSpotterVizId });
2706
2749
  * ```
2707
2750
  *
2708
2751
  * @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
@@ -2711,7 +2754,7 @@
2711
2754
  /**
2712
2755
  * Trigger the **Download** > **CSV** action on tables in
2713
2756
  * the embedded view.
2714
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2757
+ * @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
2715
2758
  * @example
2716
2759
  * ```js
2717
2760
  * liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
@@ -2724,9 +2767,13 @@
2724
2767
  * searchEmbed.trigger(HostEvent.DownloadAsCsv)
2725
2768
  * ```
2726
2769
  * ```js
2727
- * spotterEmbed.trigger(HostEvent.DownloadAsCsv, {
2728
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2729
- * })
2770
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsCsv host event.
2771
+ * let latestSpotterVizId = '';
2772
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
2773
+ * latestSpotterVizId = payload.data.id;
2774
+ * });
2775
+ *
2776
+ * spotterEmbed.trigger(HostEvent.DownloadAsCsv, { vizId: latestSpotterVizId });
2730
2777
  * ```
2731
2778
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2732
2779
  */
@@ -2734,7 +2781,7 @@
2734
2781
  /**
2735
2782
  * Trigger the **Download** > **XLSX** action on tables
2736
2783
  * in the embedded view.
2737
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
2784
+ * @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
2738
2785
  * @example
2739
2786
  * ```js
2740
2787
  * liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
@@ -2747,9 +2794,13 @@
2747
2794
  * searchEmbed.trigger(HostEvent.DownloadAsXlsx)
2748
2795
  * ```
2749
2796
  * ```js
2750
- * spotterEmbed.trigger(HostEvent.downloadAsXLSX, {
2751
- * vizId:"730496d6-6903-4601-937e-2c691821af3c"
2752
- * })
2797
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsXlsx host event.
2798
+ * let latestSpotterVizId = '';
2799
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
2800
+ * latestSpotterVizId = payload.data.id;
2801
+ * });
2802
+ *
2803
+ * spotterEmbed.trigger(HostEvent.DownloadAsXlsx, { vizId: latestSpotterVizId });
2753
2804
  * ```
2754
2805
  * @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
2755
2806
  */
@@ -2786,7 +2837,7 @@
2786
2837
  * ```
2787
2838
  *
2788
2839
  * ```js
2789
- * // Save an Answer in Spotter (requires vizId)
2840
+ * // Save a Visualization in Spotter (requires vizId)
2790
2841
  * spotterEmbed.trigger(HostEvent.Save, {
2791
2842
  * vizId: "730496d6-6903-4601-937e-2c691821af3c"
2792
2843
  * })
@@ -3087,15 +3138,21 @@
3087
3138
  HostEvent["ResetLiveboardPersonalisedView"] = "ResetLiveboardPersonalisedView";
3088
3139
  /**
3089
3140
  * Triggers an action to update Parameter values on embedded
3090
- * Answers, Liveboard and Spotter answer in Edit mode.
3141
+ * Answers, Liveboard, and Spotter answer in Edit mode.
3142
+ * @param - `name` - Name of the Parameter
3143
+ * @param - `value` - The value to set for the Parameter.
3144
+ *
3145
+ * Optionally, to control the visibility of the Parameter chip,
3146
+ * use the `isVisibleToUser` attribute when applying an override.
3091
3147
  *
3092
3148
  * @example
3093
3149
  * ```js
3094
3150
  * liveboardEmbed.trigger(HostEvent.UpdateParameters, [{
3095
- * name: "Color",
3096
- * value: "almond"
3151
+ * name: "Integer Range Param",
3152
+ * value: 10,
3153
+ * isVisibleToUser: false
3097
3154
  * }])
3098
- *
3155
+ * ```
3099
3156
  * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
3100
3157
  */
3101
3158
  HostEvent["UpdateParameters"] = "UpdateParameters";
@@ -3108,11 +3165,13 @@
3108
3165
  * });
3109
3166
  *```
3110
3167
  *```js
3111
- * spotterEmbed.trigger(HostEvent.GetParameters, {
3112
- * vizId: '730496d6-6903-4601-937e-2c691821af3c'
3113
- * }).then((parameter) => {
3114
- * console.log('parameters', parameter);
3115
- * });
3168
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in GetParameters host event.
3169
+ * let latestSpotterVizId = '';
3170
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
3171
+ * latestSpotterVizId = payload.data.id;
3172
+ * });
3173
+ *
3174
+ * spotterEmbed.trigger(HostEvent.GetParameters, { vizId: latestSpotterVizId });
3116
3175
  *```
3117
3176
  * @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
3118
3177
  */
@@ -3142,10 +3201,11 @@
3142
3201
  * If no parameters are specified, the save action is
3143
3202
  * triggered with a modal to prompt users to
3144
3203
  * add a name and description for the Answer.
3145
- * @param - optional attributes to set Answer properties.
3146
- * `name` - Name string for the Answer.
3147
- * `description` - Description text for the Answer.
3148
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
3204
+ * @param - `vizId` refers to the Answer ID in Spotter embed
3205
+ * and is required in Spotter embed.
3206
+ * Optional attributes to set Answer properties include:
3207
+ * @param - `name` - Name string for the Answer.
3208
+ * @param - `description` - Description text for the Answer.
3149
3209
  * @example
3150
3210
  * ```js
3151
3211
  * const saveAnswerResponse = await searchEmbed.trigger(HostEvent.SaveAnswer, {
@@ -3155,11 +3215,13 @@
3155
3215
  * ```
3156
3216
  * @example
3157
3217
  * ```js
3158
- * const saveAnswerResponse = await spotterEmbed.trigger(HostEvent.SaveAnswer, {
3159
- * vizId: '730496d6-6903-4601-937e-2c691821af3c',
3160
- * name: "Sales by states",
3161
- * description: "Total sales by states in MidWest"
3218
+ * // You can use the Data event dispatched on each answer creation to get the vizId and use in SaveAnswer host event.
3219
+ * let latestSpotterVizId = '';
3220
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
3221
+ * latestSpotterVizId = payload.data.id;
3162
3222
  * });
3223
+ *
3224
+ * spotterEmbed.trigger(HostEvent.SaveAnswer, { vizId: latestSpotterVizId });
3163
3225
  * ```
3164
3226
  * @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
3165
3227
  */
@@ -3243,12 +3305,15 @@
3243
3305
  HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
3244
3306
  /**
3245
3307
  * Toggle the visualization to chart or table view.
3246
- * @param - `vizId ` refers to the answer id in spotter Embed, it is required in spotter Embed.
3308
+ * @param - `vizId ` refers to the Visualization ID in Spotter embed and is required.
3247
3309
  * @example
3248
3310
  * ```js
3249
- * spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {
3250
- * vizId:'b535c760-8bbe-4e6f-bb26-af56b4129a1e'
3311
+ * let latestSpotterVizId = '';
3312
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
3313
+ * latestSpotterVizId = payload.data.id;
3251
3314
  * });
3315
+ *
3316
+ * spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, { vizId: latestSpotterVizId });
3252
3317
  *```
3253
3318
  * @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
3254
3319
  */
@@ -3277,12 +3342,16 @@
3277
3342
  */
3278
3343
  HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
3279
3344
  /**
3280
- * Trigger the *Ask Spotter* action for visualizations
3281
- * @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
3345
+ * Trigger the *Spotter* action for visualizations present on the liveboard's vizzes.
3346
+ * @param - `vizId` refers to the Visualization ID in Spotter embed and is required.
3282
3347
  * @example
3283
3348
  * ```js
3284
- * spotterEmbed.trigger(HostEvent.AskSpotter,
3285
- * {vizId:'730496d6-6903-4601-937e-2c691821af3c'})
3349
+ * let latestSpotterVizId = '';
3350
+ * spotterEmbed.on(EmbedEvent.Data, (payload) => {
3351
+ * latestSpotterVizId = payload.data.id;
3352
+ * });
3353
+ *
3354
+ * spotterEmbed.trigger(HostEvent.AskSpotter, { vizId: latestSpotterVizId });
3286
3355
  * ```
3287
3356
  * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
3288
3357
  */
@@ -3297,6 +3366,15 @@
3297
3366
  * ```
3298
3367
  */
3299
3368
  HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
3369
+ /**
3370
+ * Triggered when the embed is needed to be destroyed. This is used to clean up any embed related resources internally.
3371
+ * @example
3372
+ * ```js
3373
+ * liveboardEmbed.trigger(HostEvent.DestroyEmbed);
3374
+ * ```
3375
+ * @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
3376
+ */
3377
+ HostEvent["DestroyEmbed"] = "EmbedDestroyed";
3300
3378
  })(exports.HostEvent || (exports.HostEvent = {}));
3301
3379
  /**
3302
3380
  * The different visual modes that the data sources panel within
@@ -17046,6 +17124,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17046
17124
  authTriggerText: 'Authorize',
17047
17125
  authType: exports.AuthType.None,
17048
17126
  logLevel: exports.LogLevel.ERROR,
17127
+ waitForCleanupOnDestroy: false,
17128
+ cleanupTimeout: 5000,
17049
17129
  };
17050
17130
  let authPromise;
17051
17131
  const getAuthPromise = () => authPromise;
@@ -17508,7 +17588,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
17508
17588
  return e;
17509
17589
  }
17510
17590
 
17511
- var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.2";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^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",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^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:"32 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
17591
+ var name="@thoughtspot/visual-embed-sdk";var version$1="1.43.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$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p tsconfig.build.json --incremental false; tsc -p tsconfig.build.json --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle-generator --config ./dts-config/dts-bundle-file.config.js","bundle-dts":"dts-bundle-generator --config ./dts-config/dts-bundle.config.js","bundle-dts-react":"dts-bundle-generator --config ./dts-config/dts-bundle-react.config.js","bundle-dts-react-full":"dts-bundle-generator --config ./dts-config/dts-bundle-react-full.config.js",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.build.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^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",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle-generator":"^9.5.1",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^2.0.0",jest:"^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:"32 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
17512
17592
 
17513
17593
  /**
17514
17594
  * Reloads the ThoughtSpot iframe.
@@ -18795,11 +18875,26 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
18795
18875
  * @version SDK: 1.19.1 | ThoughtSpot: *
18796
18876
  */
18797
18877
  destroy() {
18798
- var _a;
18878
+ var _a, _b;
18799
18879
  try {
18800
18880
  this.removeFullscreenChangeHandler();
18801
- (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a.parentNode.removeChild(this.insertedDomEl);
18802
18881
  this.unsubscribeToEvents();
18882
+ if (!getEmbedConfig().waitForCleanupOnDestroy) {
18883
+ this.trigger(exports.HostEvent.DestroyEmbed);
18884
+ (_b = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(this.insertedDomEl);
18885
+ }
18886
+ else {
18887
+ const cleanupTimeout = getEmbedConfig().cleanupTimeout;
18888
+ Promise.race([
18889
+ this.trigger(exports.HostEvent.DestroyEmbed),
18890
+ new Promise((resolve) => setTimeout(resolve, cleanupTimeout)),
18891
+ ]).then(() => {
18892
+ var _a, _b;
18893
+ (_b = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(this.insertedDomEl);
18894
+ }).catch((e) => {
18895
+ logger$3.log('Error destroying TS Embed', e);
18896
+ });
18897
+ }
18803
18898
  }
18804
18899
  catch (e) {
18805
18900
  logger$3.log('Error destroying TS Embed', e);