@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.
- package/cjs/package.json +1 -1
- package/cjs/src/embed/base.d.ts.map +1 -1
- package/cjs/src/embed/base.js +2 -0
- package/cjs/src/embed/base.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +17 -2
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +134 -41
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/types.d.ts +159 -69
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +146 -68
- package/cjs/src/types.js.map +1 -1
- package/dist/{index-CjbriUI0.js → index-HZ94j9Ey.js} +1 -1
- package/dist/src/embed/base.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/types.d.ts +159 -69
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +168 -73
- package/dist/tsembed-react.js +167 -72
- package/dist/tsembed.es.js +168 -73
- package/dist/tsembed.js +167 -72
- package/dist/visual-embed-sdk-react-full.d.ts +159 -69
- package/dist/visual-embed-sdk-react.d.ts +159 -69
- package/dist/visual-embed-sdk.d.ts +159 -69
- package/lib/package.json +1 -1
- package/lib/src/embed/base.d.ts.map +1 -1
- package/lib/src/embed/base.js +2 -0
- package/lib/src/embed/base.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +17 -2
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +134 -41
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/types.d.ts +159 -69
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +146 -68
- package/lib/src/types.js.map +1 -1
- package/package.json +1 -1
- package/src/embed/base.ts +2 -0
- package/src/embed/ts-embed.spec.ts +168 -44
- package/src/embed/ts-embed.ts +14 -1
- package/src/types.ts +159 -68
package/dist/tsembed.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.43.0 */
|
|
2
2
|
'use client';
|
|
3
3
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
m.forEach(function (e) {
|
|
@@ -916,7 +916,7 @@ var EmbedEvent;
|
|
|
916
916
|
*/
|
|
917
917
|
EmbedEvent["Load"] = "load";
|
|
918
918
|
/**
|
|
919
|
-
* Data pertaining to an Answer or
|
|
919
|
+
* Data pertaining to an Answer, Liveboard or Spotter visualization is received.
|
|
920
920
|
* The event payload includes the raw data of the object.
|
|
921
921
|
* @return data - Answer of Liveboard data
|
|
922
922
|
* @version SDK: 1.1.0 | ThoughtSpot: ts7.may.cl, 8.4.1.sw
|
|
@@ -1335,6 +1335,17 @@ var EmbedEvent;
|
|
|
1335
1335
|
*```
|
|
1336
1336
|
*/
|
|
1337
1337
|
EmbedEvent["AnswerDelete"] = "answerDelete";
|
|
1338
|
+
/**
|
|
1339
|
+
* Emitted when the AI Highlights action is triggered on a Liveboard
|
|
1340
|
+
* @version SDK: 1.44.0 | ThoughtSpot: 10.15.0.cl
|
|
1341
|
+
* @example
|
|
1342
|
+
*```js
|
|
1343
|
+
* liveboardEmbed.on(EmbedEvent.AIHighlights, (payload) => {
|
|
1344
|
+
* console.log('AI Highlights', payload);
|
|
1345
|
+
* })
|
|
1346
|
+
*```
|
|
1347
|
+
*/
|
|
1348
|
+
EmbedEvent["AIHighlights"] = "AIHighlights";
|
|
1338
1349
|
/**
|
|
1339
1350
|
* Emitted when a user initiates the Pin action to
|
|
1340
1351
|
* add an Answer to a Liveboard.
|
|
@@ -2285,7 +2296,7 @@ var HostEvent;
|
|
|
2285
2296
|
* the following parameters:
|
|
2286
2297
|
*
|
|
2287
2298
|
* @param
|
|
2288
|
-
* `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
|
|
2299
|
+
* `vizId`- GUID of the saved Answer or Spotter visualization ID to pin to a Liveboard.
|
|
2289
2300
|
* Optional when pinning a new chart or table generated from a Search query.
|
|
2290
2301
|
* **Required** in Spotter Embed.
|
|
2291
2302
|
* @param
|
|
@@ -2337,10 +2348,16 @@ var HostEvent;
|
|
|
2337
2348
|
* ```
|
|
2338
2349
|
* @example
|
|
2339
2350
|
* ```js
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2351
|
+
|
|
2352
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event.
|
|
2353
|
+
* let latestSpotterVizId = '';
|
|
2354
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2355
|
+
* latestSpotterVizId = payload.data.id;
|
|
2356
|
+
* });
|
|
2357
|
+
*
|
|
2358
|
+
* spotterEmbed.trigger(HostEvent.Pin, { vizId: latestSpotterVizId });
|
|
2359
|
+
* ```
|
|
2360
|
+
*
|
|
2344
2361
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2345
2362
|
*/
|
|
2346
2363
|
HostEvent["Pin"] = "pin";
|
|
@@ -2415,14 +2432,29 @@ var HostEvent;
|
|
|
2415
2432
|
* ```
|
|
2416
2433
|
* @example
|
|
2417
2434
|
* ```js
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2435
|
+
|
|
2436
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPdf host event.
|
|
2437
|
+
* let latestSpotterVizId = '';
|
|
2438
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2439
|
+
* latestSpotterVizId = payload.data.id;
|
|
2440
|
+
* });
|
|
2441
|
+
*
|
|
2442
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPdf, { vizId: latestSpotterVizId });
|
|
2443
|
+
* ```
|
|
2422
2444
|
*
|
|
2423
2445
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2424
2446
|
*/
|
|
2425
2447
|
HostEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
2448
|
+
/**
|
|
2449
|
+
* Trigger the **AI Highlights** action on an embedded Liveboard
|
|
2450
|
+
*
|
|
2451
|
+
* @example
|
|
2452
|
+
* ```js
|
|
2453
|
+
* liveboardEmbed.trigger(HostEvent.AIHighlights)
|
|
2454
|
+
* ```
|
|
2455
|
+
* @version SDK: 1.44.0 | ThoughtSpot: 10.15.0.cl
|
|
2456
|
+
*/
|
|
2457
|
+
HostEvent["AIHighlights"] = "AIHighlights";
|
|
2426
2458
|
/**
|
|
2427
2459
|
* Trigger the **Make a copy** action on a Liveboard,
|
|
2428
2460
|
* visualization, or Answer page.
|
|
@@ -2445,10 +2477,14 @@ var HostEvent;
|
|
|
2445
2477
|
* ```
|
|
2446
2478
|
* @example
|
|
2447
2479
|
* ```js
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2480
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in MakeACopy host event.
|
|
2481
|
+
* let latestSpotterVizId = '';
|
|
2482
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2483
|
+
* latestSpotterVizId = payload.data.id;
|
|
2484
|
+
* });
|
|
2485
|
+
*
|
|
2486
|
+
* spotterEmbed.trigger(HostEvent.MakeACopy, { vizId: latestSpotterVizId });
|
|
2487
|
+
* ```
|
|
2452
2488
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2453
2489
|
*/
|
|
2454
2490
|
HostEvent["MakeACopy"] = "makeACopy";
|
|
@@ -2533,15 +2569,7 @@ var HostEvent;
|
|
|
2533
2569
|
* ```
|
|
2534
2570
|
* @example
|
|
2535
2571
|
* ```js
|
|
2536
|
-
*
|
|
2537
|
-
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2538
|
-
* });
|
|
2539
|
-
* ```
|
|
2540
|
-
* @example
|
|
2541
|
-
* ```js
|
|
2542
|
-
* const editResponse = await spotterEmbed.trigger(HostEvent.Edit, {
|
|
2543
|
-
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2544
|
-
* });
|
|
2572
|
+
* spotterEmbed.trigger(HostEvent.Edit);
|
|
2545
2573
|
* ```
|
|
2546
2574
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2547
2575
|
*/
|
|
@@ -2590,16 +2618,23 @@ var HostEvent;
|
|
|
2590
2618
|
* );
|
|
2591
2619
|
* })
|
|
2592
2620
|
* ```
|
|
2593
|
-
* @example
|
|
2621
|
+
* * @example
|
|
2594
2622
|
* ```js
|
|
2595
|
-
|
|
2596
|
-
|
|
2623
|
+
|
|
2624
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event.
|
|
2625
|
+
* let latestSpotterVizId = '';
|
|
2626
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2627
|
+
* latestSpotterVizId = payload.data.id;
|
|
2628
|
+
* });
|
|
2629
|
+
*
|
|
2630
|
+
* spotterEmbed.trigger(HostEvent.GetTML, {
|
|
2631
|
+
* vizId: latestSpotterVizId
|
|
2597
2632
|
* }).then((tml) => {
|
|
2598
2633
|
* console.log(
|
|
2599
2634
|
* tml.answer.search_query // TML representation of the search query
|
|
2600
2635
|
* );
|
|
2601
2636
|
* })
|
|
2602
|
-
|
|
2637
|
+
* ```
|
|
2603
2638
|
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
|
|
2604
2639
|
* @important
|
|
2605
2640
|
*/
|
|
@@ -2663,7 +2698,7 @@ var HostEvent;
|
|
|
2663
2698
|
/**
|
|
2664
2699
|
* Trigger the **Download** action on charts in
|
|
2665
2700
|
* the embedded view.
|
|
2666
|
-
* @param - `vizId` refers to the
|
|
2701
|
+
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
2667
2702
|
* @example
|
|
2668
2703
|
* ```js
|
|
2669
2704
|
* liveboardEmbed.trigger(HostEvent.Download, {vizId:
|
|
@@ -2673,10 +2708,14 @@ var HostEvent;
|
|
|
2673
2708
|
* embed.trigger(HostEvent.Download)
|
|
2674
2709
|
* ```
|
|
2675
2710
|
* ```js
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2711
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in Download host event.
|
|
2712
|
+
* let latestSpotterVizId = '';
|
|
2713
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2714
|
+
* latestSpotterVizId = payload.data.id;
|
|
2715
|
+
* });
|
|
2716
|
+
*
|
|
2717
|
+
* spotterEmbed.trigger(HostEvent.Download, { vizId: latestSpotterVizId });
|
|
2718
|
+
* ```
|
|
2680
2719
|
* @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
|
|
2681
2720
|
* Use {@link DownloadAsPng}
|
|
2682
2721
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
@@ -2694,9 +2733,13 @@ var HostEvent;
|
|
|
2694
2733
|
*
|
|
2695
2734
|
* searchEmbed.trigger(HostEvent.DownloadAsPng)
|
|
2696
2735
|
*
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2736
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPng host event.
|
|
2737
|
+
* let latestSpotterVizId = '';
|
|
2738
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2739
|
+
* latestSpotterVizId = payload.data.id;
|
|
2740
|
+
* });
|
|
2741
|
+
*
|
|
2742
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPng, { vizId: latestSpotterVizId });
|
|
2700
2743
|
* ```
|
|
2701
2744
|
*
|
|
2702
2745
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
|
|
@@ -2705,7 +2748,7 @@ var HostEvent;
|
|
|
2705
2748
|
/**
|
|
2706
2749
|
* Trigger the **Download** > **CSV** action on tables in
|
|
2707
2750
|
* the embedded view.
|
|
2708
|
-
* @param - `vizId` refers to the
|
|
2751
|
+
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
2709
2752
|
* @example
|
|
2710
2753
|
* ```js
|
|
2711
2754
|
* liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
|
|
@@ -2718,9 +2761,13 @@ var HostEvent;
|
|
|
2718
2761
|
* searchEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
2719
2762
|
* ```
|
|
2720
2763
|
* ```js
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
2764
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsCsv host event.
|
|
2765
|
+
* let latestSpotterVizId = '';
|
|
2766
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2767
|
+
* latestSpotterVizId = payload.data.id;
|
|
2768
|
+
* });
|
|
2769
|
+
*
|
|
2770
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsCsv, { vizId: latestSpotterVizId });
|
|
2724
2771
|
* ```
|
|
2725
2772
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2726
2773
|
*/
|
|
@@ -2728,7 +2775,7 @@ var HostEvent;
|
|
|
2728
2775
|
/**
|
|
2729
2776
|
* Trigger the **Download** > **XLSX** action on tables
|
|
2730
2777
|
* in the embedded view.
|
|
2731
|
-
* @param - `vizId` refers to the
|
|
2778
|
+
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
2732
2779
|
* @example
|
|
2733
2780
|
* ```js
|
|
2734
2781
|
* liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
|
|
@@ -2741,9 +2788,13 @@ var HostEvent;
|
|
|
2741
2788
|
* searchEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
2742
2789
|
* ```
|
|
2743
2790
|
* ```js
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2791
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsXlsx host event.
|
|
2792
|
+
* let latestSpotterVizId = '';
|
|
2793
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2794
|
+
* latestSpotterVizId = payload.data.id;
|
|
2795
|
+
* });
|
|
2796
|
+
*
|
|
2797
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsXlsx, { vizId: latestSpotterVizId });
|
|
2747
2798
|
* ```
|
|
2748
2799
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2749
2800
|
*/
|
|
@@ -2780,7 +2831,7 @@ var HostEvent;
|
|
|
2780
2831
|
* ```
|
|
2781
2832
|
*
|
|
2782
2833
|
* ```js
|
|
2783
|
-
* // Save
|
|
2834
|
+
* // Save a Visualization in Spotter (requires vizId)
|
|
2784
2835
|
* spotterEmbed.trigger(HostEvent.Save, {
|
|
2785
2836
|
* vizId: "730496d6-6903-4601-937e-2c691821af3c"
|
|
2786
2837
|
* })
|
|
@@ -3081,15 +3132,21 @@ var HostEvent;
|
|
|
3081
3132
|
HostEvent["ResetLiveboardPersonalisedView"] = "ResetLiveboardPersonalisedView";
|
|
3082
3133
|
/**
|
|
3083
3134
|
* Triggers an action to update Parameter values on embedded
|
|
3084
|
-
* Answers, Liveboard and Spotter answer in Edit mode.
|
|
3135
|
+
* Answers, Liveboard, and Spotter answer in Edit mode.
|
|
3136
|
+
* @param - `name` - Name of the Parameter
|
|
3137
|
+
* @param - `value` - The value to set for the Parameter.
|
|
3138
|
+
*
|
|
3139
|
+
* Optionally, to control the visibility of the Parameter chip,
|
|
3140
|
+
* use the `isVisibleToUser` attribute when applying an override.
|
|
3085
3141
|
*
|
|
3086
3142
|
* @example
|
|
3087
3143
|
* ```js
|
|
3088
3144
|
* liveboardEmbed.trigger(HostEvent.UpdateParameters, [{
|
|
3089
|
-
*
|
|
3090
|
-
*
|
|
3145
|
+
* name: "Integer Range Param",
|
|
3146
|
+
* value: 10,
|
|
3147
|
+
* isVisibleToUser: false
|
|
3091
3148
|
* }])
|
|
3092
|
-
*
|
|
3149
|
+
* ```
|
|
3093
3150
|
* @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
3094
3151
|
*/
|
|
3095
3152
|
HostEvent["UpdateParameters"] = "UpdateParameters";
|
|
@@ -3102,11 +3159,13 @@ var HostEvent;
|
|
|
3102
3159
|
* });
|
|
3103
3160
|
*```
|
|
3104
3161
|
*```js
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3162
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in GetParameters host event.
|
|
3163
|
+
* let latestSpotterVizId = '';
|
|
3164
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
3165
|
+
* latestSpotterVizId = payload.data.id;
|
|
3166
|
+
* });
|
|
3167
|
+
*
|
|
3168
|
+
* spotterEmbed.trigger(HostEvent.GetParameters, { vizId: latestSpotterVizId });
|
|
3110
3169
|
*```
|
|
3111
3170
|
* @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
3112
3171
|
*/
|
|
@@ -3136,10 +3195,11 @@ var HostEvent;
|
|
|
3136
3195
|
* If no parameters are specified, the save action is
|
|
3137
3196
|
* triggered with a modal to prompt users to
|
|
3138
3197
|
* add a name and description for the Answer.
|
|
3139
|
-
* @param -
|
|
3140
|
-
*
|
|
3141
|
-
*
|
|
3142
|
-
* @param - `
|
|
3198
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed
|
|
3199
|
+
* and is required in Spotter embed.
|
|
3200
|
+
* Optional attributes to set Answer properties include:
|
|
3201
|
+
* @param - `name` - Name string for the Answer.
|
|
3202
|
+
* @param - `description` - Description text for the Answer.
|
|
3143
3203
|
* @example
|
|
3144
3204
|
* ```js
|
|
3145
3205
|
* const saveAnswerResponse = await searchEmbed.trigger(HostEvent.SaveAnswer, {
|
|
@@ -3149,11 +3209,13 @@ var HostEvent;
|
|
|
3149
3209
|
* ```
|
|
3150
3210
|
* @example
|
|
3151
3211
|
* ```js
|
|
3152
|
-
*
|
|
3153
|
-
*
|
|
3154
|
-
*
|
|
3155
|
-
*
|
|
3212
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in SaveAnswer host event.
|
|
3213
|
+
* let latestSpotterVizId = '';
|
|
3214
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
3215
|
+
* latestSpotterVizId = payload.data.id;
|
|
3156
3216
|
* });
|
|
3217
|
+
*
|
|
3218
|
+
* spotterEmbed.trigger(HostEvent.SaveAnswer, { vizId: latestSpotterVizId });
|
|
3157
3219
|
* ```
|
|
3158
3220
|
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
3159
3221
|
*/
|
|
@@ -3237,12 +3299,15 @@ var HostEvent;
|
|
|
3237
3299
|
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
3238
3300
|
/**
|
|
3239
3301
|
* Toggle the visualization to chart or table view.
|
|
3240
|
-
* @param - `vizId ` refers to the
|
|
3302
|
+
* @param - `vizId ` refers to the Visualization ID in Spotter embed and is required.
|
|
3241
3303
|
* @example
|
|
3242
3304
|
* ```js
|
|
3243
|
-
*
|
|
3244
|
-
*
|
|
3305
|
+
* let latestSpotterVizId = '';
|
|
3306
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
3307
|
+
* latestSpotterVizId = payload.data.id;
|
|
3245
3308
|
* });
|
|
3309
|
+
*
|
|
3310
|
+
* spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, { vizId: latestSpotterVizId });
|
|
3246
3311
|
*```
|
|
3247
3312
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3248
3313
|
*/
|
|
@@ -3271,12 +3336,16 @@ var HostEvent;
|
|
|
3271
3336
|
*/
|
|
3272
3337
|
HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
|
|
3273
3338
|
/**
|
|
3274
|
-
* Trigger the *
|
|
3275
|
-
* @param - `vizId` refers to the
|
|
3339
|
+
* Trigger the *Spotter* action for visualizations present on the liveboard's vizzes.
|
|
3340
|
+
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required.
|
|
3276
3341
|
* @example
|
|
3277
3342
|
* ```js
|
|
3278
|
-
*
|
|
3279
|
-
* {
|
|
3343
|
+
* let latestSpotterVizId = '';
|
|
3344
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
3345
|
+
* latestSpotterVizId = payload.data.id;
|
|
3346
|
+
* });
|
|
3347
|
+
*
|
|
3348
|
+
* spotterEmbed.trigger(HostEvent.AskSpotter, { vizId: latestSpotterVizId });
|
|
3280
3349
|
* ```
|
|
3281
3350
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
3282
3351
|
*/
|
|
@@ -3291,6 +3360,15 @@ var HostEvent;
|
|
|
3291
3360
|
* ```
|
|
3292
3361
|
*/
|
|
3293
3362
|
HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
|
|
3363
|
+
/**
|
|
3364
|
+
* Triggered when the embed is needed to be destroyed. This is used to clean up any embed related resources internally.
|
|
3365
|
+
* @example
|
|
3366
|
+
* ```js
|
|
3367
|
+
* liveboardEmbed.trigger(HostEvent.DestroyEmbed);
|
|
3368
|
+
* ```
|
|
3369
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
3370
|
+
*/
|
|
3371
|
+
HostEvent["DestroyEmbed"] = "EmbedDestroyed";
|
|
3294
3372
|
})(HostEvent || (HostEvent = {}));
|
|
3295
3373
|
/**
|
|
3296
3374
|
* The different visual modes that the data sources panel within
|
|
@@ -8155,7 +8233,7 @@ class AnswerService {
|
|
|
8155
8233
|
async getTML() {
|
|
8156
8234
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
8157
8235
|
const edoc = object[0].edoc;
|
|
8158
|
-
const YAML = await import('./index-
|
|
8236
|
+
const YAML = await import('./index-HZ94j9Ey.js');
|
|
8159
8237
|
const parsedDoc = YAML.parse(edoc);
|
|
8160
8238
|
return {
|
|
8161
8239
|
answer: {
|
|
@@ -17040,6 +17118,8 @@ const CONFIG_DEFAULTS = {
|
|
|
17040
17118
|
authTriggerText: 'Authorize',
|
|
17041
17119
|
authType: AuthType.None,
|
|
17042
17120
|
logLevel: LogLevel.ERROR,
|
|
17121
|
+
waitForCleanupOnDestroy: false,
|
|
17122
|
+
cleanupTimeout: 5000,
|
|
17043
17123
|
};
|
|
17044
17124
|
let authPromise;
|
|
17045
17125
|
const getAuthPromise = () => authPromise;
|
|
@@ -17502,7 +17582,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
|
17502
17582
|
return e;
|
|
17503
17583
|
}
|
|
17504
17584
|
|
|
17505
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
17585
|
+
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={".":{"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,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};
|
|
17506
17586
|
|
|
17507
17587
|
/**
|
|
17508
17588
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -18789,11 +18869,26 @@ class TsEmbed {
|
|
|
18789
18869
|
* @version SDK: 1.19.1 | ThoughtSpot: *
|
|
18790
18870
|
*/
|
|
18791
18871
|
destroy() {
|
|
18792
|
-
var _a;
|
|
18872
|
+
var _a, _b;
|
|
18793
18873
|
try {
|
|
18794
18874
|
this.removeFullscreenChangeHandler();
|
|
18795
|
-
(_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a.parentNode.removeChild(this.insertedDomEl);
|
|
18796
18875
|
this.unsubscribeToEvents();
|
|
18876
|
+
if (!getEmbedConfig().waitForCleanupOnDestroy) {
|
|
18877
|
+
this.trigger(HostEvent.DestroyEmbed);
|
|
18878
|
+
(_b = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(this.insertedDomEl);
|
|
18879
|
+
}
|
|
18880
|
+
else {
|
|
18881
|
+
const cleanupTimeout = getEmbedConfig().cleanupTimeout;
|
|
18882
|
+
Promise.race([
|
|
18883
|
+
this.trigger(HostEvent.DestroyEmbed),
|
|
18884
|
+
new Promise((resolve) => setTimeout(resolve, cleanupTimeout)),
|
|
18885
|
+
]).then(() => {
|
|
18886
|
+
var _a, _b;
|
|
18887
|
+
(_b = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(this.insertedDomEl);
|
|
18888
|
+
}).catch((e) => {
|
|
18889
|
+
logger$3.log('Error destroying TS Embed', e);
|
|
18890
|
+
});
|
|
18891
|
+
}
|
|
18797
18892
|
}
|
|
18798
18893
|
catch (e) {
|
|
18799
18894
|
logger$3.log('Error destroying TS Embed', e);
|