@thoughtspot/visual-embed-sdk 1.42.0 → 1.42.1-HE2.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 +2 -2
- package/cjs/src/embed/app.d.ts +20 -0
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +7 -1
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +52 -0
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.d.ts +9 -2
- package/cjs/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/contracts.js +9 -1
- package/cjs/src/embed/hostEventClient/contracts.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +5 -5
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.js +6 -6
- package/cjs/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +2 -2
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +6 -3
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +22 -0
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +15 -2
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +63 -23
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +83 -0
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/errors.d.ts +1 -0
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +1 -0
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/types.d.ts +119 -61
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +103 -60
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/processTrigger.d.ts +3 -1
- package/cjs/src/utils/processTrigger.d.ts.map +1 -1
- package/cjs/src/utils/processTrigger.js +4 -2
- package/cjs/src/utils/processTrigger.js.map +1 -1
- package/dist/{index-BpSohedu.js → index-CWQnMX2L.js} +1 -1
- package/dist/index-Djtv-y7A.js +7371 -0
- package/dist/index-UY-4yjBN.js +7371 -0
- package/dist/src/embed/app.d.ts +20 -0
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/contracts.d.ts +9 -2
- package/dist/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +5 -5
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +2 -2
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +15 -2
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/errors.d.ts +1 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/types.d.ts +119 -61
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/processTrigger.d.ts +3 -1
- package/dist/src/utils/processTrigger.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +202 -99
- package/dist/tsembed-react.js +201 -98
- package/dist/tsembed.es.js +202 -99
- package/dist/tsembed.js +201 -98
- package/dist/visual-embed-sdk-react-full.d.ts +164 -68
- package/dist/visual-embed-sdk-react.d.ts +164 -68
- package/dist/visual-embed-sdk.d.ts +164 -68
- package/lib/package.json +2 -2
- package/lib/src/embed/app.d.ts +20 -0
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +7 -1
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +52 -0
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.d.ts +9 -2
- package/lib/src/embed/hostEventClient/contracts.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/contracts.js +8 -0
- package/lib/src/embed/hostEventClient/contracts.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +5 -5
- package/lib/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.js +6 -6
- package/lib/src/embed/hostEventClient/host-event-client.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +2 -2
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +6 -3
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +22 -0
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +15 -2
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +63 -23
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +83 -0
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/errors.d.ts +1 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +1 -0
- package/lib/src/errors.js.map +1 -1
- package/lib/src/types.d.ts +119 -61
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +103 -60
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/processTrigger.d.ts +3 -1
- package/lib/src/utils/processTrigger.d.ts.map +1 -1
- package/lib/src/utils/processTrigger.js +4 -2
- package/lib/src/utils/processTrigger.js.map +1 -1
- package/package.json +2 -2
- package/src/embed/app.spec.ts +73 -0
- package/src/embed/app.ts +30 -0
- package/src/embed/hostEventClient/contracts.ts +11 -3
- package/src/embed/hostEventClient/host-event-client.ts +10 -5
- package/src/embed/liveboard.spec.ts +30 -0
- package/src/embed/liveboard.ts +10 -4
- package/src/embed/ts-embed.spec.ts +111 -0
- package/src/embed/ts-embed.ts +79 -27
- package/src/errors.ts +1 -0
- package/src/types.ts +119 -61
- package/src/utils/processTrigger.ts +6 -2
package/dist/tsembed.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.42.0 */
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.42.1-HE2.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
|
|
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
|
|
@@ -2293,7 +2293,7 @@
|
|
|
2293
2293
|
* the following parameters:
|
|
2294
2294
|
*
|
|
2295
2295
|
* @param
|
|
2296
|
-
* `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
|
|
2296
|
+
* `vizId`- GUID of the saved Answer or Spotter visualization ID to pin to a Liveboard.
|
|
2297
2297
|
* Optional when pinning a new chart or table generated from a Search query.
|
|
2298
2298
|
* **Required** in Spotter Embed.
|
|
2299
2299
|
* @param
|
|
@@ -2345,10 +2345,16 @@
|
|
|
2345
2345
|
* ```
|
|
2346
2346
|
* @example
|
|
2347
2347
|
* ```js
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2348
|
+
|
|
2349
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event.
|
|
2350
|
+
* let latestSpotterVizId = '';
|
|
2351
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2352
|
+
* latestSpotterVizId = payload.data.id;
|
|
2353
|
+
* });
|
|
2354
|
+
*
|
|
2355
|
+
* spotterEmbed.trigger(HostEvent.Pin, { vizId: latestSpotterVizId });
|
|
2356
|
+
* ```
|
|
2357
|
+
*
|
|
2352
2358
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2353
2359
|
*/
|
|
2354
2360
|
HostEvent["Pin"] = "pin";
|
|
@@ -2423,10 +2429,15 @@
|
|
|
2423
2429
|
* ```
|
|
2424
2430
|
* @example
|
|
2425
2431
|
* ```js
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2432
|
+
|
|
2433
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPdf host event.
|
|
2434
|
+
* let latestSpotterVizId = '';
|
|
2435
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2436
|
+
* latestSpotterVizId = payload.data.id;
|
|
2437
|
+
* });
|
|
2438
|
+
*
|
|
2439
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPdf, { vizId: latestSpotterVizId });
|
|
2440
|
+
* ```
|
|
2430
2441
|
*
|
|
2431
2442
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2432
2443
|
*/
|
|
@@ -2453,10 +2464,14 @@
|
|
|
2453
2464
|
* ```
|
|
2454
2465
|
* @example
|
|
2455
2466
|
* ```js
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2467
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in MakeACopy host event.
|
|
2468
|
+
* let latestSpotterVizId = '';
|
|
2469
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2470
|
+
* latestSpotterVizId = payload.data.id;
|
|
2471
|
+
* });
|
|
2472
|
+
*
|
|
2473
|
+
* spotterEmbed.trigger(HostEvent.MakeACopy, { vizId: latestSpotterVizId });
|
|
2474
|
+
* ```
|
|
2460
2475
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2461
2476
|
*/
|
|
2462
2477
|
HostEvent["MakeACopy"] = "makeACopy";
|
|
@@ -2541,15 +2556,7 @@
|
|
|
2541
2556
|
* ```
|
|
2542
2557
|
* @example
|
|
2543
2558
|
* ```js
|
|
2544
|
-
*
|
|
2545
|
-
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2546
|
-
* });
|
|
2547
|
-
* ```
|
|
2548
|
-
* @example
|
|
2549
|
-
* ```js
|
|
2550
|
-
* const editResponse = await spotterEmbed.trigger(HostEvent.Edit, {
|
|
2551
|
-
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2552
|
-
* });
|
|
2559
|
+
* spotterEmbed.trigger(HostEvent.Edit);
|
|
2553
2560
|
* ```
|
|
2554
2561
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2555
2562
|
*/
|
|
@@ -2598,16 +2605,23 @@
|
|
|
2598
2605
|
* );
|
|
2599
2606
|
* })
|
|
2600
2607
|
* ```
|
|
2601
|
-
* @example
|
|
2608
|
+
* * @example
|
|
2602
2609
|
* ```js
|
|
2603
|
-
|
|
2604
|
-
|
|
2610
|
+
|
|
2611
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in Pin host event.
|
|
2612
|
+
* let latestSpotterVizId = '';
|
|
2613
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2614
|
+
* latestSpotterVizId = payload.data.id;
|
|
2615
|
+
* });
|
|
2616
|
+
*
|
|
2617
|
+
* spotterEmbed.trigger(HostEvent.GetTML, {
|
|
2618
|
+
* vizId: latestSpotterVizId
|
|
2605
2619
|
* }).then((tml) => {
|
|
2606
2620
|
* console.log(
|
|
2607
2621
|
* tml.answer.search_query // TML representation of the search query
|
|
2608
2622
|
* );
|
|
2609
2623
|
* })
|
|
2610
|
-
|
|
2624
|
+
* ```
|
|
2611
2625
|
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
|
|
2612
2626
|
* @important
|
|
2613
2627
|
*/
|
|
@@ -2671,7 +2685,7 @@
|
|
|
2671
2685
|
/**
|
|
2672
2686
|
* Trigger the **Download** action on charts in
|
|
2673
2687
|
* the embedded view.
|
|
2674
|
-
* @param - `vizId` refers to the
|
|
2688
|
+
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
2675
2689
|
* @example
|
|
2676
2690
|
* ```js
|
|
2677
2691
|
* liveboardEmbed.trigger(HostEvent.Download, {vizId:
|
|
@@ -2681,10 +2695,14 @@
|
|
|
2681
2695
|
* embed.trigger(HostEvent.Download)
|
|
2682
2696
|
* ```
|
|
2683
2697
|
* ```js
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2698
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in Download host event.
|
|
2699
|
+
* let latestSpotterVizId = '';
|
|
2700
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2701
|
+
* latestSpotterVizId = payload.data.id;
|
|
2702
|
+
* });
|
|
2703
|
+
*
|
|
2704
|
+
* spotterEmbed.trigger(HostEvent.Download, { vizId: latestSpotterVizId });
|
|
2705
|
+
* ```
|
|
2688
2706
|
* @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
|
|
2689
2707
|
* Use {@link DownloadAsPng}
|
|
2690
2708
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
@@ -2702,9 +2720,13 @@
|
|
|
2702
2720
|
*
|
|
2703
2721
|
* searchEmbed.trigger(HostEvent.DownloadAsPng)
|
|
2704
2722
|
*
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2723
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsPng host event.
|
|
2724
|
+
* let latestSpotterVizId = '';
|
|
2725
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2726
|
+
* latestSpotterVizId = payload.data.id;
|
|
2727
|
+
* });
|
|
2728
|
+
*
|
|
2729
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPng, { vizId: latestSpotterVizId });
|
|
2708
2730
|
* ```
|
|
2709
2731
|
*
|
|
2710
2732
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
|
|
@@ -2713,7 +2735,7 @@
|
|
|
2713
2735
|
/**
|
|
2714
2736
|
* Trigger the **Download** > **CSV** action on tables in
|
|
2715
2737
|
* the embedded view.
|
|
2716
|
-
* @param - `vizId` refers to the
|
|
2738
|
+
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
2717
2739
|
* @example
|
|
2718
2740
|
* ```js
|
|
2719
2741
|
* liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
|
|
@@ -2726,9 +2748,13 @@
|
|
|
2726
2748
|
* searchEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
2727
2749
|
* ```
|
|
2728
2750
|
* ```js
|
|
2729
|
-
|
|
2730
|
-
|
|
2731
|
-
|
|
2751
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsCsv host event.
|
|
2752
|
+
* let latestSpotterVizId = '';
|
|
2753
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2754
|
+
* latestSpotterVizId = payload.data.id;
|
|
2755
|
+
* });
|
|
2756
|
+
*
|
|
2757
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsCsv, { vizId: latestSpotterVizId });
|
|
2732
2758
|
* ```
|
|
2733
2759
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2734
2760
|
*/
|
|
@@ -2736,7 +2762,7 @@
|
|
|
2736
2762
|
/**
|
|
2737
2763
|
* Trigger the **Download** > **XLSX** action on tables
|
|
2738
2764
|
* in the embedded view.
|
|
2739
|
-
* @param - `vizId` refers to the
|
|
2765
|
+
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required in Spotter embed.
|
|
2740
2766
|
* @example
|
|
2741
2767
|
* ```js
|
|
2742
2768
|
* liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
|
|
@@ -2749,9 +2775,13 @@
|
|
|
2749
2775
|
* searchEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
2750
2776
|
* ```
|
|
2751
2777
|
* ```js
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2778
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in DownloadAsXlsx host event.
|
|
2779
|
+
* let latestSpotterVizId = '';
|
|
2780
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2781
|
+
* latestSpotterVizId = payload.data.id;
|
|
2782
|
+
* });
|
|
2783
|
+
*
|
|
2784
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsXlsx, { vizId: latestSpotterVizId });
|
|
2755
2785
|
* ```
|
|
2756
2786
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2757
2787
|
*/
|
|
@@ -2788,7 +2818,7 @@
|
|
|
2788
2818
|
* ```
|
|
2789
2819
|
*
|
|
2790
2820
|
* ```js
|
|
2791
|
-
* // Save
|
|
2821
|
+
* // Save a Visualization in Spotter (requires vizId)
|
|
2792
2822
|
* spotterEmbed.trigger(HostEvent.Save, {
|
|
2793
2823
|
* vizId: "730496d6-6903-4601-937e-2c691821af3c"
|
|
2794
2824
|
* })
|
|
@@ -3110,11 +3140,13 @@
|
|
|
3110
3140
|
* });
|
|
3111
3141
|
*```
|
|
3112
3142
|
*```js
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3143
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in GetParameters host event.
|
|
3144
|
+
* let latestSpotterVizId = '';
|
|
3145
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
3146
|
+
* latestSpotterVizId = payload.data.id;
|
|
3147
|
+
* });
|
|
3148
|
+
*
|
|
3149
|
+
* spotterEmbed.trigger(HostEvent.GetParameters, { vizId: latestSpotterVizId });
|
|
3118
3150
|
*```
|
|
3119
3151
|
* @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
3120
3152
|
*/
|
|
@@ -3157,11 +3189,13 @@
|
|
|
3157
3189
|
* ```
|
|
3158
3190
|
* @example
|
|
3159
3191
|
* ```js
|
|
3160
|
-
*
|
|
3161
|
-
*
|
|
3162
|
-
*
|
|
3163
|
-
*
|
|
3192
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId and use in SaveAnswer host event.
|
|
3193
|
+
* let latestSpotterVizId = '';
|
|
3194
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
3195
|
+
* latestSpotterVizId = payload.data.id;
|
|
3164
3196
|
* });
|
|
3197
|
+
*
|
|
3198
|
+
* spotterEmbed.trigger(HostEvent.SaveAnswer, { vizId: latestSpotterVizId });
|
|
3165
3199
|
* ```
|
|
3166
3200
|
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
3167
3201
|
*/
|
|
@@ -3245,12 +3279,15 @@
|
|
|
3245
3279
|
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
3246
3280
|
/**
|
|
3247
3281
|
* Toggle the visualization to chart or table view.
|
|
3248
|
-
* @param - `vizId ` refers to the
|
|
3282
|
+
* @param - `vizId ` refers to the Visualization ID in Spotter embed and is required.
|
|
3249
3283
|
* @example
|
|
3250
3284
|
* ```js
|
|
3251
|
-
*
|
|
3252
|
-
*
|
|
3285
|
+
* let latestSpotterVizId = '';
|
|
3286
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
3287
|
+
* latestSpotterVizId = payload.data.id;
|
|
3253
3288
|
* });
|
|
3289
|
+
*
|
|
3290
|
+
* spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, { vizId: latestSpotterVizId });
|
|
3254
3291
|
*```
|
|
3255
3292
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3256
3293
|
*/
|
|
@@ -3279,12 +3316,16 @@
|
|
|
3279
3316
|
*/
|
|
3280
3317
|
HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
|
|
3281
3318
|
/**
|
|
3282
|
-
* Trigger the *
|
|
3283
|
-
* @param - `vizId` refers to the
|
|
3319
|
+
* Trigger the *Spotter* action for visualizations present on the liveboard's vizzes.
|
|
3320
|
+
* @param - `vizId` refers to the Visualization ID in Spotter embed and is required.
|
|
3284
3321
|
* @example
|
|
3285
3322
|
* ```js
|
|
3286
|
-
*
|
|
3287
|
-
* {
|
|
3323
|
+
* let latestSpotterVizId = '';
|
|
3324
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
3325
|
+
* latestSpotterVizId = payload.data.id;
|
|
3326
|
+
* });
|
|
3327
|
+
*
|
|
3328
|
+
* spotterEmbed.trigger(HostEvent.AskSpotter, { vizId: latestSpotterVizId });
|
|
3288
3329
|
* ```
|
|
3289
3330
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
3290
3331
|
*/
|
|
@@ -3342,6 +3383,7 @@
|
|
|
3342
3383
|
Param["HideResult"] = "hideResult";
|
|
3343
3384
|
Param["UseLastSelectedDataSource"] = "useLastSelectedSources";
|
|
3344
3385
|
Param["Tag"] = "tag";
|
|
3386
|
+
Param["HideTagFilterChips"] = "hideTagFilterChips";
|
|
3345
3387
|
Param["AutoLogin"] = "autoLogin";
|
|
3346
3388
|
Param["searchTokenString"] = "searchTokenString";
|
|
3347
3389
|
Param["executeSearch"] = "executeSearch";
|
|
@@ -3446,6 +3488,7 @@
|
|
|
3446
3488
|
Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
|
|
3447
3489
|
Param["LiveboardXLSXCSVDownload"] = "isLiveboardXLSXCSVDownloadEnabled";
|
|
3448
3490
|
Param["isPNGInScheduledEmailsEnabled"] = "isPNGInScheduledEmailsEnabled";
|
|
3491
|
+
Param["isLinkParametersEnabled"] = "isLinkParametersEnabled";
|
|
3449
3492
|
})(Param || (Param = {}));
|
|
3450
3493
|
/**
|
|
3451
3494
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -7238,6 +7281,7 @@
|
|
|
7238
7281
|
MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
|
|
7239
7282
|
RENDER_CALLED_BEFORE_INIT: 'Looks like render was called before calling init, the render won\'t start until init is called.\nFor more info check\n1. https://developers.thoughtspot.com/docs/Function_init#_init\n2.https://developers.thoughtspot.com/docs/getting-started#initSdk',
|
|
7240
7283
|
SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
|
|
7284
|
+
OFFLINE_WARNING: 'Network not Detected. Embed is offline. Please reconnect and refresh',
|
|
7241
7285
|
};
|
|
7242
7286
|
const CUSTOM_ACTIONS_ERROR_MESSAGE = {
|
|
7243
7287
|
INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
|
|
@@ -17486,7 +17530,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17486
17530
|
return e;
|
|
17487
17531
|
}
|
|
17488
17532
|
|
|
17489
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.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
|
|
17533
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.1-HE2.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 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};
|
|
17490
17534
|
|
|
17491
17535
|
/**
|
|
17492
17536
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -17505,6 +17549,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17505
17549
|
* @param message
|
|
17506
17550
|
* @param message.type
|
|
17507
17551
|
* @param message.data
|
|
17552
|
+
* @param message.context
|
|
17508
17553
|
* @param thoughtSpotHost
|
|
17509
17554
|
* @param channel
|
|
17510
17555
|
*/
|
|
@@ -17519,8 +17564,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17519
17564
|
* @param messageType
|
|
17520
17565
|
* @param thoughtSpotHost
|
|
17521
17566
|
* @param data
|
|
17567
|
+
* @param context
|
|
17522
17568
|
*/
|
|
17523
|
-
function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
17569
|
+
function processTrigger(iFrame, messageType, thoughtSpotHost, data, context) {
|
|
17524
17570
|
return new Promise((res, rej) => {
|
|
17525
17571
|
var _a;
|
|
17526
17572
|
if (messageType === exports.HostEvent.Reload) {
|
|
@@ -17554,7 +17600,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17554
17600
|
channel.port1.close();
|
|
17555
17601
|
res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
|
|
17556
17602
|
}, TRIGGER_TIMEOUT);
|
|
17557
|
-
return postIframeMessage(iFrame, { type: messageType, data }, thoughtSpotHost, channel);
|
|
17603
|
+
return postIframeMessage(iFrame, { type: messageType, data, context }, thoughtSpotHost, channel);
|
|
17558
17604
|
});
|
|
17559
17605
|
}
|
|
17560
17606
|
|
|
@@ -17566,7 +17612,15 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17566
17612
|
UIPassthroughEvent["GetAvailableUIPassthroughs"] = "getAvailableUiPassthroughs";
|
|
17567
17613
|
UIPassthroughEvent["GetAnswerConfig"] = "getAnswerPageConfig";
|
|
17568
17614
|
UIPassthroughEvent["GetLiveboardConfig"] = "getPinboardPageConfig";
|
|
17569
|
-
})(exports.UIPassthroughEvent || (exports.UIPassthroughEvent = {}));
|
|
17615
|
+
})(exports.UIPassthroughEvent || (exports.UIPassthroughEvent = {}));
|
|
17616
|
+
var ContextType;
|
|
17617
|
+
(function (ContextType) {
|
|
17618
|
+
ContextType["Search"] = "search";
|
|
17619
|
+
ContextType["Liveboard"] = "liveboard";
|
|
17620
|
+
ContextType["Answer"] = "answer";
|
|
17621
|
+
ContextType["Spotter"] = "spotter";
|
|
17622
|
+
ContextType["None"] = "";
|
|
17623
|
+
})(ContextType || (ContextType = {}));
|
|
17570
17624
|
|
|
17571
17625
|
class HostEventClient {
|
|
17572
17626
|
constructor(iFrame) {
|
|
@@ -17578,12 +17632,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17578
17632
|
* @param {any} data Data to send with the host event
|
|
17579
17633
|
* @returns {Promise<any>} - the response from the process trigger
|
|
17580
17634
|
*/
|
|
17581
|
-
async processTrigger(message, data) {
|
|
17635
|
+
async processTrigger(message, data, context) {
|
|
17582
17636
|
if (!this.iFrame) {
|
|
17583
17637
|
throw new Error('Iframe element is not set');
|
|
17584
17638
|
}
|
|
17585
17639
|
const thoughtspotHost = getEmbedConfig().thoughtSpotHost;
|
|
17586
|
-
return processTrigger(this.iFrame, message, thoughtspotHost, data);
|
|
17640
|
+
return processTrigger(this.iFrame, message, thoughtspotHost, data, context);
|
|
17587
17641
|
}
|
|
17588
17642
|
async handleHostEventWithParam(apiName, parameters) {
|
|
17589
17643
|
var _a, _b, _c, _d;
|
|
@@ -17602,8 +17656,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17602
17656
|
}
|
|
17603
17657
|
return { ...response.value };
|
|
17604
17658
|
}
|
|
17605
|
-
async hostEventFallback(hostEvent, data) {
|
|
17606
|
-
return this.processTrigger(hostEvent, data);
|
|
17659
|
+
async hostEventFallback(hostEvent, data, context) {
|
|
17660
|
+
return this.processTrigger(hostEvent, data, context);
|
|
17607
17661
|
}
|
|
17608
17662
|
/**
|
|
17609
17663
|
* Setter for the iframe element used for host events
|
|
@@ -17647,14 +17701,14 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17647
17701
|
answerId: (_d = (_c = (_b = (_a = data === null || data === void 0 ? void 0 : data.saveResponse) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.Answer__save) === null || _c === void 0 ? void 0 : _c.answer) === null || _d === void 0 ? void 0 : _d.id,
|
|
17648
17702
|
};
|
|
17649
17703
|
}
|
|
17650
|
-
async triggerHostEvent(hostEvent, payload) {
|
|
17704
|
+
async triggerHostEvent(hostEvent, payload, context) {
|
|
17651
17705
|
switch (hostEvent) {
|
|
17652
17706
|
case exports.HostEvent.Pin:
|
|
17653
17707
|
return this.handlePinEvent(payload);
|
|
17654
17708
|
case exports.HostEvent.SaveAnswer:
|
|
17655
17709
|
return this.handleSaveAnswerEvent(payload);
|
|
17656
17710
|
default:
|
|
17657
|
-
return this.hostEventFallback(hostEvent, payload);
|
|
17711
|
+
return this.hostEventFallback(hostEvent, payload, context);
|
|
17658
17712
|
}
|
|
17659
17713
|
}
|
|
17660
17714
|
}
|
|
@@ -17956,39 +18010,69 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17956
18010
|
return eventData;
|
|
17957
18011
|
}
|
|
17958
18012
|
/**
|
|
17959
|
-
*
|
|
17960
|
-
*
|
|
17961
|
-
* embed instance through an identifier contained in the payload,
|
|
17962
|
-
* and executes the registered callbacks accordingly.
|
|
18013
|
+
* Subscribe to network events (online/offline) that should
|
|
18014
|
+
* work regardless of auth status
|
|
17963
18015
|
*/
|
|
17964
|
-
|
|
17965
|
-
this.
|
|
17966
|
-
const messageEventListener = (event) => {
|
|
17967
|
-
const eventType = this.getEventType(event);
|
|
17968
|
-
const eventPort = this.getEventPort(event);
|
|
17969
|
-
const eventData = this.formatEventData(event, eventType);
|
|
17970
|
-
if (event.source === this.iFrame.contentWindow) {
|
|
17971
|
-
this.executeCallbacks(eventType, processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el), eventPort);
|
|
17972
|
-
}
|
|
17973
|
-
};
|
|
17974
|
-
window.addEventListener('message', messageEventListener);
|
|
18016
|
+
subscribeToNetworkEvents() {
|
|
18017
|
+
this.unsubscribeToNetworkEvents();
|
|
17975
18018
|
const onlineEventListener = (e) => {
|
|
17976
18019
|
this.trigger(exports.HostEvent.Reload);
|
|
17977
18020
|
};
|
|
17978
18021
|
window.addEventListener('online', onlineEventListener);
|
|
17979
18022
|
const offlineEventListener = (e) => {
|
|
17980
|
-
const offlineWarning =
|
|
18023
|
+
const offlineWarning = ERROR_MESSAGE.OFFLINE_WARNING;
|
|
17981
18024
|
this.executeCallbacks(exports.EmbedEvent.Error, {
|
|
17982
18025
|
offlineWarning,
|
|
17983
18026
|
});
|
|
17984
18027
|
logger$3.warn(offlineWarning);
|
|
17985
18028
|
};
|
|
17986
18029
|
window.addEventListener('offline', offlineEventListener);
|
|
17987
|
-
this.subscribedListeners =
|
|
17988
|
-
|
|
17989
|
-
|
|
17990
|
-
|
|
18030
|
+
this.subscribedListeners.online = onlineEventListener;
|
|
18031
|
+
this.subscribedListeners.offline = offlineEventListener;
|
|
18032
|
+
}
|
|
18033
|
+
/**
|
|
18034
|
+
* Subscribe to message events that depend on successful iframe setup
|
|
18035
|
+
*/
|
|
18036
|
+
subscribeToMessageEvents() {
|
|
18037
|
+
this.unsubscribeToMessageEvents();
|
|
18038
|
+
const messageEventListener = (event) => {
|
|
18039
|
+
const eventType = this.getEventType(event);
|
|
18040
|
+
const eventPort = this.getEventPort(event);
|
|
18041
|
+
const eventData = this.formatEventData(event, eventType);
|
|
18042
|
+
if (event.source === this.iFrame.contentWindow) {
|
|
18043
|
+
this.executeCallbacks(eventType, processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el), eventPort);
|
|
18044
|
+
}
|
|
17991
18045
|
};
|
|
18046
|
+
window.addEventListener('message', messageEventListener);
|
|
18047
|
+
this.subscribedListeners.message = messageEventListener;
|
|
18048
|
+
}
|
|
18049
|
+
/**
|
|
18050
|
+
* Adds event listeners for both network and message events.
|
|
18051
|
+
* This maintains backward compatibility with the existing method.
|
|
18052
|
+
* Adds a global event listener to window for "message" events.
|
|
18053
|
+
* ThoughtSpot detects if a particular event is targeted to this
|
|
18054
|
+
* embed instance through an identifier contained in the payload,
|
|
18055
|
+
* and executes the registered callbacks accordingly.
|
|
18056
|
+
*/
|
|
18057
|
+
subscribeToEvents() {
|
|
18058
|
+
this.subscribeToNetworkEvents();
|
|
18059
|
+
this.subscribeToMessageEvents();
|
|
18060
|
+
}
|
|
18061
|
+
unsubscribeToNetworkEvents() {
|
|
18062
|
+
if (this.subscribedListeners.online) {
|
|
18063
|
+
window.removeEventListener('online', this.subscribedListeners.online);
|
|
18064
|
+
delete this.subscribedListeners.online;
|
|
18065
|
+
}
|
|
18066
|
+
if (this.subscribedListeners.offline) {
|
|
18067
|
+
window.removeEventListener('offline', this.subscribedListeners.offline);
|
|
18068
|
+
delete this.subscribedListeners.offline;
|
|
18069
|
+
}
|
|
18070
|
+
}
|
|
18071
|
+
unsubscribeToMessageEvents() {
|
|
18072
|
+
if (this.subscribedListeners.message) {
|
|
18073
|
+
window.removeEventListener('message', this.subscribedListeners.message);
|
|
18074
|
+
delete this.subscribedListeners.message;
|
|
18075
|
+
}
|
|
17992
18076
|
}
|
|
17993
18077
|
unsubscribeToEvents() {
|
|
17994
18078
|
Object.keys(this.subscribedListeners).forEach((key) => {
|
|
@@ -18289,6 +18373,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18289
18373
|
type: exports.EmbedEvent.Init,
|
|
18290
18374
|
});
|
|
18291
18375
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_START);
|
|
18376
|
+
// Always subscribe to network events, regardless of auth status
|
|
18377
|
+
this.subscribeToNetworkEvents();
|
|
18292
18378
|
return (_a = getAuthPromise()) === null || _a === void 0 ? void 0 : _a.then((isLoggedIn) => {
|
|
18293
18379
|
if (!isLoggedIn) {
|
|
18294
18380
|
this.handleInsertionIntoDOM(this.embedConfig.loginFailedMessage);
|
|
@@ -18331,7 +18417,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18331
18417
|
el.remove();
|
|
18332
18418
|
});
|
|
18333
18419
|
}
|
|
18334
|
-
|
|
18420
|
+
// Subscribe to message events only after successful
|
|
18421
|
+
// auth and iframe setup
|
|
18422
|
+
this.subscribeToMessageEvents();
|
|
18335
18423
|
}).catch((error) => {
|
|
18336
18424
|
nextInQueue();
|
|
18337
18425
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_FAILED, {
|
|
@@ -18641,7 +18729,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18641
18729
|
* @param {any} data The payload to send with the message
|
|
18642
18730
|
* @returns A promise that resolves with the response from the embedded app
|
|
18643
18731
|
*/
|
|
18644
|
-
async trigger(messageType, data = {}) {
|
|
18732
|
+
async trigger(messageType, data = {}, context) {
|
|
18645
18733
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
18646
18734
|
if (!this.isRendered) {
|
|
18647
18735
|
this.handleError('Please call render before triggering events');
|
|
@@ -18651,8 +18739,14 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18651
18739
|
this.handleError('Host event type is undefined');
|
|
18652
18740
|
return null;
|
|
18653
18741
|
}
|
|
18742
|
+
// Check if iframe exists before triggering -
|
|
18743
|
+
// this prevents the error when auth fails
|
|
18744
|
+
if (!this.iFrame) {
|
|
18745
|
+
logger$3.debug(`Cannot trigger ${messageType} - iframe not available (likely due to auth failure)`);
|
|
18746
|
+
return null;
|
|
18747
|
+
}
|
|
18654
18748
|
// send an empty object, this is needed for liveboard default handlers
|
|
18655
|
-
return this.hostEventClient.triggerHostEvent(messageType, data);
|
|
18749
|
+
return this.hostEventClient.triggerHostEvent(messageType, data, context);
|
|
18656
18750
|
}
|
|
18657
18751
|
/**
|
|
18658
18752
|
* Triggers an event to the embedded app, skipping the UI flow.
|
|
@@ -19170,7 +19264,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19170
19264
|
* embedded Liveboard or visualization.
|
|
19171
19265
|
*/
|
|
19172
19266
|
getEmbedParams() {
|
|
19173
|
-
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = exports.DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, } = this.viewConfig;
|
|
19267
|
+
const { tag, hideTagFilterChips, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = true, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = exports.DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, isLinkParametersEnabled, } = this.viewConfig;
|
|
19174
19268
|
let params = {};
|
|
19175
19269
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
19176
19270
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -19238,6 +19332,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19238
19332
|
if (isPNGInScheduledEmailsEnabled !== undefined) {
|
|
19239
19333
|
params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
|
|
19240
19334
|
}
|
|
19335
|
+
if (hideTagFilterChips !== undefined) {
|
|
19336
|
+
params[Param.HideTagFilterChips] = hideTagFilterChips;
|
|
19337
|
+
}
|
|
19338
|
+
if (isLinkParametersEnabled !== undefined) {
|
|
19339
|
+
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
|
|
19340
|
+
}
|
|
19241
19341
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
19242
19342
|
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
|
|
19243
19343
|
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
@@ -19592,7 +19692,7 @@ query GetEurekaVizSnapshots(
|
|
|
19592
19692
|
getEmbedParamsObject() {
|
|
19593
19693
|
let params = {};
|
|
19594
19694
|
params = this.getBaseQueryParams(params);
|
|
19595
|
-
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, } = this.viewConfig;
|
|
19695
|
+
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = true, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, liveboardXLSXCSVDownload = false, isLiveboardStylingAndGroupingEnabled, isPNGInScheduledEmailsEnabled = false, showSpotterLimitations, isLinkParametersEnabled, } = this.viewConfig;
|
|
19596
19696
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
19597
19697
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
19598
19698
|
if (fullHeight === true) {
|
|
@@ -19657,6 +19757,9 @@ query GetEurekaVizSnapshots(
|
|
|
19657
19757
|
if (showSpotterLimitations !== undefined) {
|
|
19658
19758
|
params[Param.ShowSpotterLimitations] = showSpotterLimitations;
|
|
19659
19759
|
}
|
|
19760
|
+
if (isLinkParametersEnabled !== undefined) {
|
|
19761
|
+
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
|
|
19762
|
+
}
|
|
19660
19763
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
19661
19764
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
19662
19765
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
@@ -19753,7 +19856,7 @@ query GetEurekaVizSnapshots(
|
|
|
19753
19856
|
* @param {any} data The payload to send with the message
|
|
19754
19857
|
* @returns A promise that resolves with the response from the embedded app
|
|
19755
19858
|
*/
|
|
19756
|
-
trigger(messageType, data = {}) {
|
|
19859
|
+
trigger(messageType, data = {}, context) {
|
|
19757
19860
|
const dataWithVizId = data;
|
|
19758
19861
|
if (messageType === exports.HostEvent.SetActiveTab) {
|
|
19759
19862
|
this.setActiveTab(data);
|
|
@@ -19762,7 +19865,7 @@ query GetEurekaVizSnapshots(
|
|
|
19762
19865
|
if (typeof dataWithVizId === 'object' && this.viewConfig.vizId) {
|
|
19763
19866
|
dataWithVizId.vizId = this.viewConfig.vizId;
|
|
19764
19867
|
}
|
|
19765
|
-
return super.trigger(messageType, dataWithVizId);
|
|
19868
|
+
return super.trigger(messageType, dataWithVizId, context);
|
|
19766
19869
|
}
|
|
19767
19870
|
/**
|
|
19768
19871
|
* Destroys the ThoughtSpot embed, and remove any nodes from the DOM.
|