@thoughtspot/visual-embed-sdk 1.41.1 → 1.42.1-HE2
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 +9 -9
- package/cjs/src/css-variables.d.ts +52 -14
- package/cjs/src/css-variables.d.ts.map +1 -1
- 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/bodyless-conversation.d.ts +1 -0
- package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js +7 -3
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +1 -0
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +7 -2
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/hostEventClient/host-event-client.d.ts +3 -3
- 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 +1 -0
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +10 -2
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +35 -0
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/sage.d.ts +1 -0
- package/cjs/src/embed/sage.d.ts.map +1 -1
- package/cjs/src/embed/sage.js +10 -6
- package/cjs/src/embed/sage.js.map +1 -1
- package/cjs/src/embed/search-bar.d.ts +1 -0
- package/cjs/src/embed/search-bar.d.ts.map +1 -1
- package/cjs/src/embed/search-bar.js +11 -7
- package/cjs/src/embed/search-bar.js.map +1 -1
- package/cjs/src/embed/search.d.ts +1 -0
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +7 -8
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +20 -5
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +84 -31
- 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/react/all-types-export.spec.js +1 -1
- package/cjs/src/react/all-types-export.spec.js.map +1 -1
- package/cjs/src/react/util.js.map +1 -1
- package/cjs/src/react/util.spec.d.ts +2 -0
- package/cjs/src/react/util.spec.d.ts.map +1 -0
- package/cjs/src/react/util.spec.js +78 -0
- package/cjs/src/react/util.spec.js.map +1 -0
- package/cjs/src/types.d.ts +153 -64
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +136 -62
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/processTrigger.d.ts +2 -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-DQueHwfQ.js → index-CWQnMX2L.js} +1 -1
- package/dist/index-Djtv-y7A.js +7371 -0
- package/dist/src/css-variables.d.ts +52 -14
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +20 -0
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/bodyless-conversation.d.ts +1 -0
- package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +1 -0
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/hostEventClient/host-event-client.d.ts +3 -3
- package/dist/src/embed/hostEventClient/host-event-client.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +1 -0
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/sage.d.ts +1 -0
- package/dist/src/embed/sage.d.ts.map +1 -1
- package/dist/src/embed/search-bar.d.ts +1 -0
- package/dist/src/embed/search-bar.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts +1 -0
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +20 -5
- 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/react/util.spec.d.ts +2 -0
- package/dist/src/react/util.spec.d.ts.map +1 -0
- package/dist/src/types.d.ts +153 -64
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/processTrigger.d.ts +2 -1
- package/dist/src/utils/processTrigger.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +294 -134
- package/dist/tsembed-react.js +293 -133
- package/dist/tsembed.es.js +294 -134
- package/dist/tsembed.js +293 -133
- package/dist/visual-embed-sdk-react-full.d.ts +9401 -9916
- package/dist/visual-embed-sdk-react.d.ts +9273 -9922
- package/dist/visual-embed-sdk.d.ts +9440 -9533
- package/lib/package.json +9 -9
- package/lib/src/css-variables.d.ts +52 -14
- package/lib/src/css-variables.d.ts.map +1 -1
- 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/bodyless-conversation.d.ts +1 -0
- package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/lib/src/embed/bodyless-conversation.js +7 -3
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +1 -0
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +7 -2
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/hostEventClient/host-event-client.d.ts +3 -3
- 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 +1 -0
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +10 -2
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +35 -0
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/sage.d.ts +1 -0
- package/lib/src/embed/sage.d.ts.map +1 -1
- package/lib/src/embed/sage.js +10 -6
- package/lib/src/embed/sage.js.map +1 -1
- package/lib/src/embed/search-bar.d.ts +1 -0
- package/lib/src/embed/search-bar.d.ts.map +1 -1
- package/lib/src/embed/search-bar.js +11 -7
- package/lib/src/embed/search-bar.js.map +1 -1
- package/lib/src/embed/search.d.ts +1 -0
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +7 -8
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +20 -5
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +84 -31
- 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/react/all-types-export.spec.js +1 -1
- package/lib/src/react/all-types-export.spec.js.map +1 -1
- package/lib/src/react/util.js.map +1 -1
- package/lib/src/react/util.spec.d.ts +2 -0
- package/lib/src/react/util.spec.d.ts.map +1 -0
- package/lib/src/react/util.spec.js +76 -0
- package/lib/src/react/util.spec.js.map +1 -0
- package/lib/src/types.d.ts +153 -64
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +136 -62
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/processTrigger.d.ts +2 -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 +9 -9
- package/src/css-variables.ts +53 -16
- package/src/embed/app.spec.ts +73 -0
- package/src/embed/app.ts +30 -0
- package/src/embed/bodyless-conversation.ts +8 -3
- package/src/embed/conversation.ts +17 -2
- package/src/embed/hostEventClient/host-event-client.ts +7 -3
- package/src/embed/liveboard.spec.ts +44 -0
- package/src/embed/liveboard.ts +12 -1
- package/src/embed/sage.ts +14 -9
- package/src/embed/search-bar.tsx +14 -7
- package/src/embed/search.ts +18 -7
- package/src/embed/ts-embed.spec.ts +112 -1
- package/src/embed/ts-embed.ts +104 -37
- package/src/errors.ts +1 -0
- package/src/react/all-types-export.spec.ts +1 -1
- package/src/react/util.spec.tsx +88 -0
- package/src/react/util.ts +3 -3
- package/src/types.ts +211 -121
- package/src/utils/processTrigger.ts +5 -2
- package/lib/src/visual-embed-sdk.d.ts +0 -9779
package/dist/tsembed.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.42.1-HE2 */
|
|
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
|
*/
|
|
@@ -2770,21 +2800,42 @@
|
|
|
2770
2800
|
*/
|
|
2771
2801
|
HostEvent["Share"] = "share";
|
|
2772
2802
|
/**
|
|
2773
|
-
* Trigger the **Save**
|
|
2803
|
+
* Trigger the **Save** action on a Liveboard, Answer, or Spotter.
|
|
2774
2804
|
* Saves the changes.
|
|
2775
|
-
*
|
|
2805
|
+
*
|
|
2806
|
+
* @param - `vizId` refers to the Spotter Visualization Id used in Spotter embed.
|
|
2807
|
+
* It is required and can be retrieved from the data embed event.
|
|
2808
|
+
*
|
|
2776
2809
|
* @example
|
|
2777
2810
|
* ```js
|
|
2811
|
+
* // Save changes in a Liveboard
|
|
2778
2812
|
* liveboardEmbed.trigger(HostEvent.Save)
|
|
2779
2813
|
* ```
|
|
2814
|
+
*
|
|
2780
2815
|
* ```js
|
|
2816
|
+
* // Save the current Answer in Search embed
|
|
2781
2817
|
* searchEmbed.trigger(HostEvent.Save)
|
|
2782
2818
|
* ```
|
|
2819
|
+
*
|
|
2783
2820
|
* ```js
|
|
2821
|
+
* // Save a Visualization in Spotter (requires vizId)
|
|
2784
2822
|
* spotterEmbed.trigger(HostEvent.Save, {
|
|
2785
|
-
*
|
|
2823
|
+
* vizId: "730496d6-6903-4601-937e-2c691821af3c"
|
|
2786
2824
|
* })
|
|
2787
2825
|
* ```
|
|
2826
|
+
*
|
|
2827
|
+
* ```js
|
|
2828
|
+
* // How to get the vizId in Spotter?
|
|
2829
|
+
*
|
|
2830
|
+
* // You can use the Data event dispatched on each answer creation to get the vizId.
|
|
2831
|
+
* let latestSpotterVizId = '';
|
|
2832
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
2833
|
+
* latestSpotterVizId = payload.data.id;
|
|
2834
|
+
* });
|
|
2835
|
+
*
|
|
2836
|
+
* spotterEmbed.trigger(HostEvent.Save, { vizId: latestSpotterVizId });
|
|
2837
|
+
* ```
|
|
2838
|
+
*
|
|
2788
2839
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2789
2840
|
*/
|
|
2790
2841
|
HostEvent["Save"] = "save";
|
|
@@ -3089,11 +3140,13 @@
|
|
|
3089
3140
|
* });
|
|
3090
3141
|
*```
|
|
3091
3142
|
*```js
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
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 });
|
|
3097
3150
|
*```
|
|
3098
3151
|
* @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
3099
3152
|
*/
|
|
@@ -3136,11 +3189,13 @@
|
|
|
3136
3189
|
* ```
|
|
3137
3190
|
* @example
|
|
3138
3191
|
* ```js
|
|
3139
|
-
*
|
|
3140
|
-
*
|
|
3141
|
-
*
|
|
3142
|
-
*
|
|
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;
|
|
3143
3196
|
* });
|
|
3197
|
+
*
|
|
3198
|
+
* spotterEmbed.trigger(HostEvent.SaveAnswer, { vizId: latestSpotterVizId });
|
|
3144
3199
|
* ```
|
|
3145
3200
|
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
3146
3201
|
*/
|
|
@@ -3224,12 +3279,15 @@
|
|
|
3224
3279
|
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
3225
3280
|
/**
|
|
3226
3281
|
* Toggle the visualization to chart or table view.
|
|
3227
|
-
* @param - `vizId ` refers to the
|
|
3282
|
+
* @param - `vizId ` refers to the Visualization ID in Spotter embed and is required.
|
|
3228
3283
|
* @example
|
|
3229
3284
|
* ```js
|
|
3230
|
-
*
|
|
3231
|
-
*
|
|
3285
|
+
* let latestSpotterVizId = '';
|
|
3286
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
3287
|
+
* latestSpotterVizId = payload.data.id;
|
|
3232
3288
|
* });
|
|
3289
|
+
*
|
|
3290
|
+
* spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, { vizId: latestSpotterVizId });
|
|
3233
3291
|
*```
|
|
3234
3292
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3235
3293
|
*/
|
|
@@ -3258,16 +3316,30 @@
|
|
|
3258
3316
|
*/
|
|
3259
3317
|
HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
|
|
3260
3318
|
/**
|
|
3261
|
-
* Trigger the *
|
|
3262
|
-
* @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.
|
|
3263
3321
|
* @example
|
|
3264
3322
|
* ```js
|
|
3265
|
-
*
|
|
3266
|
-
* {
|
|
3323
|
+
* let latestSpotterVizId = '';
|
|
3324
|
+
* spotterEmbed.on(EmbedEvent.Data, (payload) => {
|
|
3325
|
+
* latestSpotterVizId = payload.data.id;
|
|
3326
|
+
* });
|
|
3327
|
+
*
|
|
3328
|
+
* spotterEmbed.trigger(HostEvent.AskSpotter, { vizId: latestSpotterVizId });
|
|
3267
3329
|
* ```
|
|
3268
3330
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
3269
3331
|
*/
|
|
3270
3332
|
HostEvent["AskSpotter"] = "AskSpotter";
|
|
3333
|
+
/**
|
|
3334
|
+
* @hidden
|
|
3335
|
+
* Triggers the update of the embed params.
|
|
3336
|
+
*
|
|
3337
|
+
* @example
|
|
3338
|
+
* ```js
|
|
3339
|
+
* liveboardEmbed.trigger(HostEvent.UpdateEmbedParams, viewConfig);
|
|
3340
|
+
* ```
|
|
3341
|
+
*/
|
|
3342
|
+
HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
|
|
3271
3343
|
})(exports.HostEvent || (exports.HostEvent = {}));
|
|
3272
3344
|
/**
|
|
3273
3345
|
* The different visual modes that the data sources panel within
|
|
@@ -3311,6 +3383,7 @@
|
|
|
3311
3383
|
Param["HideResult"] = "hideResult";
|
|
3312
3384
|
Param["UseLastSelectedDataSource"] = "useLastSelectedSources";
|
|
3313
3385
|
Param["Tag"] = "tag";
|
|
3386
|
+
Param["HideTagFilterChips"] = "hideTagFilterChips";
|
|
3314
3387
|
Param["AutoLogin"] = "autoLogin";
|
|
3315
3388
|
Param["searchTokenString"] = "searchTokenString";
|
|
3316
3389
|
Param["executeSearch"] = "executeSearch";
|
|
@@ -3415,6 +3488,7 @@
|
|
|
3415
3488
|
Param["RootMarginForLazyLoad"] = "rootMarginForLazyLoad";
|
|
3416
3489
|
Param["LiveboardXLSXCSVDownload"] = "isLiveboardXLSXCSVDownloadEnabled";
|
|
3417
3490
|
Param["isPNGInScheduledEmailsEnabled"] = "isPNGInScheduledEmailsEnabled";
|
|
3491
|
+
Param["isLinkParametersEnabled"] = "isLinkParametersEnabled";
|
|
3418
3492
|
})(Param || (Param = {}));
|
|
3419
3493
|
/**
|
|
3420
3494
|
* ThoughtSpot application pages include actions and menu commands
|
|
@@ -7207,6 +7281,7 @@
|
|
|
7207
7281
|
MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
|
|
7208
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',
|
|
7209
7283
|
SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
|
|
7284
|
+
OFFLINE_WARNING: 'Network not Detected. Embed is offline. Please reconnect and refresh',
|
|
7210
7285
|
};
|
|
7211
7286
|
const CUSTOM_ACTIONS_ERROR_MESSAGE = {
|
|
7212
7287
|
INVALID_ACTION_OBJECT: 'Custom Action Validation Error: Invalid action object provided',
|
|
@@ -17455,7 +17530,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17455
17530
|
return e;
|
|
17456
17531
|
}
|
|
17457
17532
|
|
|
17458
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
17533
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.42.1-HE2";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};
|
|
17459
17534
|
|
|
17460
17535
|
/**
|
|
17461
17536
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -17474,6 +17549,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17474
17549
|
* @param message
|
|
17475
17550
|
* @param message.type
|
|
17476
17551
|
* @param message.data
|
|
17552
|
+
* @param message.context
|
|
17477
17553
|
* @param thoughtSpotHost
|
|
17478
17554
|
* @param channel
|
|
17479
17555
|
*/
|
|
@@ -17488,8 +17564,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17488
17564
|
* @param messageType
|
|
17489
17565
|
* @param thoughtSpotHost
|
|
17490
17566
|
* @param data
|
|
17567
|
+
* @param context
|
|
17491
17568
|
*/
|
|
17492
|
-
function processTrigger(iFrame, messageType, thoughtSpotHost, data) {
|
|
17569
|
+
function processTrigger(iFrame, messageType, thoughtSpotHost, data, context) {
|
|
17493
17570
|
return new Promise((res, rej) => {
|
|
17494
17571
|
var _a;
|
|
17495
17572
|
if (messageType === exports.HostEvent.Reload) {
|
|
@@ -17523,7 +17600,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17523
17600
|
channel.port1.close();
|
|
17524
17601
|
res(new Error(ERROR_MESSAGE.TRIGGER_TIMED_OUT));
|
|
17525
17602
|
}, TRIGGER_TIMEOUT);
|
|
17526
|
-
return postIframeMessage(iFrame, { type: messageType, data }, thoughtSpotHost, channel);
|
|
17603
|
+
return postIframeMessage(iFrame, { type: messageType, data, context }, thoughtSpotHost, channel);
|
|
17527
17604
|
});
|
|
17528
17605
|
}
|
|
17529
17606
|
|
|
@@ -17547,12 +17624,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17547
17624
|
* @param {any} data Data to send with the host event
|
|
17548
17625
|
* @returns {Promise<any>} - the response from the process trigger
|
|
17549
17626
|
*/
|
|
17550
|
-
async processTrigger(message, data) {
|
|
17627
|
+
async processTrigger(message, data, context) {
|
|
17551
17628
|
if (!this.iFrame) {
|
|
17552
17629
|
throw new Error('Iframe element is not set');
|
|
17553
17630
|
}
|
|
17554
17631
|
const thoughtspotHost = getEmbedConfig().thoughtSpotHost;
|
|
17555
|
-
return processTrigger(this.iFrame, message, thoughtspotHost, data);
|
|
17632
|
+
return processTrigger(this.iFrame, message, thoughtspotHost, data, context);
|
|
17556
17633
|
}
|
|
17557
17634
|
async handleHostEventWithParam(apiName, parameters) {
|
|
17558
17635
|
var _a, _b, _c, _d;
|
|
@@ -17571,8 +17648,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17571
17648
|
}
|
|
17572
17649
|
return { ...response.value };
|
|
17573
17650
|
}
|
|
17574
|
-
async hostEventFallback(hostEvent, data) {
|
|
17575
|
-
return this.processTrigger(hostEvent, data);
|
|
17651
|
+
async hostEventFallback(hostEvent, data, context) {
|
|
17652
|
+
return this.processTrigger(hostEvent, data, context);
|
|
17576
17653
|
}
|
|
17577
17654
|
/**
|
|
17578
17655
|
* Setter for the iframe element used for host events
|
|
@@ -17616,14 +17693,14 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17616
17693
|
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,
|
|
17617
17694
|
};
|
|
17618
17695
|
}
|
|
17619
|
-
async triggerHostEvent(hostEvent, payload) {
|
|
17696
|
+
async triggerHostEvent(hostEvent, payload, context) {
|
|
17620
17697
|
switch (hostEvent) {
|
|
17621
17698
|
case exports.HostEvent.Pin:
|
|
17622
17699
|
return this.handlePinEvent(payload);
|
|
17623
17700
|
case exports.HostEvent.SaveAnswer:
|
|
17624
17701
|
return this.handleSaveAnswerEvent(payload);
|
|
17625
17702
|
default:
|
|
17626
|
-
return this.hostEventFallback(hostEvent, payload);
|
|
17703
|
+
return this.hostEventFallback(hostEvent, payload, context);
|
|
17627
17704
|
}
|
|
17628
17705
|
}
|
|
17629
17706
|
}
|
|
@@ -17766,10 +17843,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17766
17843
|
};
|
|
17767
17844
|
this.showPreRenderByDefault = false;
|
|
17768
17845
|
/**
|
|
17769
|
-
|
|
17770
|
-
|
|
17771
|
-
|
|
17772
|
-
|
|
17846
|
+
* @hidden
|
|
17847
|
+
* Internal state to track if the embed container is loaded.
|
|
17848
|
+
* This is used to trigger events after the embed container is loaded.
|
|
17849
|
+
*/
|
|
17773
17850
|
this.isEmbedContainerLoaded = false;
|
|
17774
17851
|
/**
|
|
17775
17852
|
* @hidden
|
|
@@ -17828,10 +17905,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17828
17905
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
17829
17906
|
...viewConfig,
|
|
17830
17907
|
});
|
|
17908
|
+
const embedConfig = getEmbedConfig();
|
|
17909
|
+
this.embedConfig = embedConfig;
|
|
17831
17910
|
this.hostEventClient = new HostEventClient(this.iFrame);
|
|
17832
17911
|
this.isReadyForRenderPromise = getInitPromise().then(async () => {
|
|
17833
|
-
const embedConfig = getEmbedConfig();
|
|
17834
|
-
this.embedConfig = embedConfig;
|
|
17835
17912
|
if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
|
|
17836
17913
|
this.embedConfig.authTriggerContainer = domSelector;
|
|
17837
17914
|
}
|
|
@@ -17925,39 +18002,69 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17925
18002
|
return eventData;
|
|
17926
18003
|
}
|
|
17927
18004
|
/**
|
|
17928
|
-
*
|
|
17929
|
-
*
|
|
17930
|
-
* embed instance through an identifier contained in the payload,
|
|
17931
|
-
* and executes the registered callbacks accordingly.
|
|
18005
|
+
* Subscribe to network events (online/offline) that should
|
|
18006
|
+
* work regardless of auth status
|
|
17932
18007
|
*/
|
|
17933
|
-
|
|
17934
|
-
this.
|
|
17935
|
-
const messageEventListener = (event) => {
|
|
17936
|
-
const eventType = this.getEventType(event);
|
|
17937
|
-
const eventPort = this.getEventPort(event);
|
|
17938
|
-
const eventData = this.formatEventData(event, eventType);
|
|
17939
|
-
if (event.source === this.iFrame.contentWindow) {
|
|
17940
|
-
this.executeCallbacks(eventType, processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el), eventPort);
|
|
17941
|
-
}
|
|
17942
|
-
};
|
|
17943
|
-
window.addEventListener('message', messageEventListener);
|
|
18008
|
+
subscribeToNetworkEvents() {
|
|
18009
|
+
this.unsubscribeToNetworkEvents();
|
|
17944
18010
|
const onlineEventListener = (e) => {
|
|
17945
18011
|
this.trigger(exports.HostEvent.Reload);
|
|
17946
18012
|
};
|
|
17947
18013
|
window.addEventListener('online', onlineEventListener);
|
|
17948
18014
|
const offlineEventListener = (e) => {
|
|
17949
|
-
const offlineWarning =
|
|
18015
|
+
const offlineWarning = ERROR_MESSAGE.OFFLINE_WARNING;
|
|
17950
18016
|
this.executeCallbacks(exports.EmbedEvent.Error, {
|
|
17951
18017
|
offlineWarning,
|
|
17952
18018
|
});
|
|
17953
18019
|
logger$3.warn(offlineWarning);
|
|
17954
18020
|
};
|
|
17955
18021
|
window.addEventListener('offline', offlineEventListener);
|
|
17956
|
-
this.subscribedListeners =
|
|
17957
|
-
|
|
17958
|
-
|
|
17959
|
-
|
|
18022
|
+
this.subscribedListeners.online = onlineEventListener;
|
|
18023
|
+
this.subscribedListeners.offline = offlineEventListener;
|
|
18024
|
+
}
|
|
18025
|
+
/**
|
|
18026
|
+
* Subscribe to message events that depend on successful iframe setup
|
|
18027
|
+
*/
|
|
18028
|
+
subscribeToMessageEvents() {
|
|
18029
|
+
this.unsubscribeToMessageEvents();
|
|
18030
|
+
const messageEventListener = (event) => {
|
|
18031
|
+
const eventType = this.getEventType(event);
|
|
18032
|
+
const eventPort = this.getEventPort(event);
|
|
18033
|
+
const eventData = this.formatEventData(event, eventType);
|
|
18034
|
+
if (event.source === this.iFrame.contentWindow) {
|
|
18035
|
+
this.executeCallbacks(eventType, processEventData(eventType, eventData, this.thoughtSpotHost, this.isPreRendered ? this.preRenderWrapper : this.el), eventPort);
|
|
18036
|
+
}
|
|
17960
18037
|
};
|
|
18038
|
+
window.addEventListener('message', messageEventListener);
|
|
18039
|
+
this.subscribedListeners.message = messageEventListener;
|
|
18040
|
+
}
|
|
18041
|
+
/**
|
|
18042
|
+
* Adds event listeners for both network and message events.
|
|
18043
|
+
* This maintains backward compatibility with the existing method.
|
|
18044
|
+
* Adds a global event listener to window for "message" events.
|
|
18045
|
+
* ThoughtSpot detects if a particular event is targeted to this
|
|
18046
|
+
* embed instance through an identifier contained in the payload,
|
|
18047
|
+
* and executes the registered callbacks accordingly.
|
|
18048
|
+
*/
|
|
18049
|
+
subscribeToEvents() {
|
|
18050
|
+
this.subscribeToNetworkEvents();
|
|
18051
|
+
this.subscribeToMessageEvents();
|
|
18052
|
+
}
|
|
18053
|
+
unsubscribeToNetworkEvents() {
|
|
18054
|
+
if (this.subscribedListeners.online) {
|
|
18055
|
+
window.removeEventListener('online', this.subscribedListeners.online);
|
|
18056
|
+
delete this.subscribedListeners.online;
|
|
18057
|
+
}
|
|
18058
|
+
if (this.subscribedListeners.offline) {
|
|
18059
|
+
window.removeEventListener('offline', this.subscribedListeners.offline);
|
|
18060
|
+
delete this.subscribedListeners.offline;
|
|
18061
|
+
}
|
|
18062
|
+
}
|
|
18063
|
+
unsubscribeToMessageEvents() {
|
|
18064
|
+
if (this.subscribedListeners.message) {
|
|
18065
|
+
window.removeEventListener('message', this.subscribedListeners.message);
|
|
18066
|
+
delete this.subscribedListeners.message;
|
|
18067
|
+
}
|
|
17961
18068
|
}
|
|
17962
18069
|
unsubscribeToEvents() {
|
|
17963
18070
|
Object.keys(this.subscribedListeners).forEach((key) => {
|
|
@@ -18027,6 +18134,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18027
18134
|
.join('/');
|
|
18028
18135
|
return `${basePath}#`;
|
|
18029
18136
|
}
|
|
18137
|
+
getUpdateEmbedParamsObject() {
|
|
18138
|
+
let queryParams = this.getEmbedParamsObject();
|
|
18139
|
+
queryParams = { ...this.viewConfig, ...queryParams };
|
|
18140
|
+
return queryParams;
|
|
18141
|
+
}
|
|
18030
18142
|
/**
|
|
18031
18143
|
* Common query params set for all the embed modes.
|
|
18032
18144
|
* @param queryParams
|
|
@@ -18176,9 +18288,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18176
18288
|
return path;
|
|
18177
18289
|
}
|
|
18178
18290
|
getEmbedParams() {
|
|
18179
|
-
const queryParams = this.
|
|
18291
|
+
const queryParams = this.getEmbedParamsObject();
|
|
18180
18292
|
return getQueryParamString(queryParams);
|
|
18181
18293
|
}
|
|
18294
|
+
getEmbedParamsObject() {
|
|
18295
|
+
const params = this.getBaseQueryParams();
|
|
18296
|
+
return params;
|
|
18297
|
+
}
|
|
18182
18298
|
getRootIframeSrc() {
|
|
18183
18299
|
const query = this.getEmbedParams();
|
|
18184
18300
|
return this.getEmbedBasePath(query);
|
|
@@ -18249,6 +18365,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18249
18365
|
type: exports.EmbedEvent.Init,
|
|
18250
18366
|
});
|
|
18251
18367
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_START);
|
|
18368
|
+
// Always subscribe to network events, regardless of auth status
|
|
18369
|
+
this.subscribeToNetworkEvents();
|
|
18252
18370
|
return (_a = getAuthPromise()) === null || _a === void 0 ? void 0 : _a.then((isLoggedIn) => {
|
|
18253
18371
|
if (!isLoggedIn) {
|
|
18254
18372
|
this.handleInsertionIntoDOM(this.embedConfig.loginFailedMessage);
|
|
@@ -18291,7 +18409,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18291
18409
|
el.remove();
|
|
18292
18410
|
});
|
|
18293
18411
|
}
|
|
18294
|
-
|
|
18412
|
+
// Subscribe to message events only after successful
|
|
18413
|
+
// auth and iframe setup
|
|
18414
|
+
this.subscribeToMessageEvents();
|
|
18295
18415
|
}).catch((error) => {
|
|
18296
18416
|
nextInQueue();
|
|
18297
18417
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_RENDER_FAILED, {
|
|
@@ -18601,7 +18721,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18601
18721
|
* @param {any} data The payload to send with the message
|
|
18602
18722
|
* @returns A promise that resolves with the response from the embedded app
|
|
18603
18723
|
*/
|
|
18604
|
-
async trigger(messageType, data = {}) {
|
|
18724
|
+
async trigger(messageType, data = {}, context = {}) {
|
|
18605
18725
|
uploadMixpanelEvent(`${MIXPANEL_EVENT.VISUAL_SDK_TRIGGER}-${messageType}`);
|
|
18606
18726
|
if (!this.isRendered) {
|
|
18607
18727
|
this.handleError('Please call render before triggering events');
|
|
@@ -18611,8 +18731,14 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18611
18731
|
this.handleError('Host event type is undefined');
|
|
18612
18732
|
return null;
|
|
18613
18733
|
}
|
|
18734
|
+
// Check if iframe exists before triggering -
|
|
18735
|
+
// this prevents the error when auth fails
|
|
18736
|
+
if (!this.iFrame) {
|
|
18737
|
+
logger$3.debug(`Cannot trigger ${messageType} - iframe not available (likely due to auth failure)`);
|
|
18738
|
+
return null;
|
|
18739
|
+
}
|
|
18614
18740
|
// send an empty object, this is needed for liveboard default handlers
|
|
18615
|
-
return this.hostEventClient.triggerHostEvent(messageType, data);
|
|
18741
|
+
return this.hostEventClient.triggerHostEvent(messageType, data, context);
|
|
18616
18742
|
}
|
|
18617
18743
|
/**
|
|
18618
18744
|
* Triggers an event to the embedded app, skipping the UI flow.
|
|
@@ -18743,7 +18869,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18743
18869
|
return this.preRender(true);
|
|
18744
18870
|
}
|
|
18745
18871
|
this.validatePreRenderViewConfig(this.viewConfig);
|
|
18872
|
+
logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
|
|
18873
|
+
this.executeAfterEmbedContainerLoaded(() => {
|
|
18874
|
+
this.trigger(exports.HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
|
|
18875
|
+
});
|
|
18746
18876
|
}
|
|
18877
|
+
this.beforePrerenderVisible();
|
|
18747
18878
|
if (this.el) {
|
|
18748
18879
|
this.syncPreRenderStyle();
|
|
18749
18880
|
if (!this.viewConfig.doNotTrackPreRenderSize) {
|
|
@@ -18760,7 +18891,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
18760
18891
|
this.resizeObserver.observe(this.el);
|
|
18761
18892
|
}
|
|
18762
18893
|
}
|
|
18763
|
-
this.beforePrerenderVisible();
|
|
18764
18894
|
removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
|
|
18765
18895
|
this.subscribeToEvents();
|
|
18766
18896
|
// Setup fullscreen change handler for prerendered components
|
|
@@ -19126,7 +19256,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19126
19256
|
* embedded Liveboard or visualization.
|
|
19127
19257
|
*/
|
|
19128
19258
|
getEmbedParams() {
|
|
19129
|
-
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;
|
|
19259
|
+
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;
|
|
19130
19260
|
let params = {};
|
|
19131
19261
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
19132
19262
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -19194,6 +19324,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
19194
19324
|
if (isPNGInScheduledEmailsEnabled !== undefined) {
|
|
19195
19325
|
params[Param.isPNGInScheduledEmailsEnabled] = isPNGInScheduledEmailsEnabled;
|
|
19196
19326
|
}
|
|
19327
|
+
if (hideTagFilterChips !== undefined) {
|
|
19328
|
+
params[Param.HideTagFilterChips] = hideTagFilterChips;
|
|
19329
|
+
}
|
|
19330
|
+
if (isLinkParametersEnabled !== undefined) {
|
|
19331
|
+
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
|
|
19332
|
+
}
|
|
19197
19333
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
19198
19334
|
params[Param.HideHomepageLeftNav] = hideHomepageLeftNav;
|
|
19199
19335
|
params[Param.ModularHomeExperienceEnabled] = modularHomeExperience;
|
|
@@ -19541,9 +19677,14 @@ query GetEurekaVizSnapshots(
|
|
|
19541
19677
|
* embedded Liveboard or visualization.
|
|
19542
19678
|
*/
|
|
19543
19679
|
getEmbedParams() {
|
|
19680
|
+
const params = this.getEmbedParamsObject();
|
|
19681
|
+
const queryParams = getQueryParamString(params, true);
|
|
19682
|
+
return queryParams;
|
|
19683
|
+
}
|
|
19684
|
+
getEmbedParamsObject() {
|
|
19544
19685
|
let params = {};
|
|
19545
19686
|
params = this.getBaseQueryParams(params);
|
|
19546
|
-
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;
|
|
19687
|
+
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;
|
|
19547
19688
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
19548
19689
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
19549
19690
|
if (fullHeight === true) {
|
|
@@ -19608,6 +19749,9 @@ query GetEurekaVizSnapshots(
|
|
|
19608
19749
|
if (showSpotterLimitations !== undefined) {
|
|
19609
19750
|
params[Param.ShowSpotterLimitations] = showSpotterLimitations;
|
|
19610
19751
|
}
|
|
19752
|
+
if (isLinkParametersEnabled !== undefined) {
|
|
19753
|
+
params[Param.isLinkParametersEnabled] = isLinkParametersEnabled;
|
|
19754
|
+
}
|
|
19611
19755
|
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
19612
19756
|
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
19613
19757
|
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
@@ -19617,8 +19761,8 @@ query GetEurekaVizSnapshots(
|
|
|
19617
19761
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
19618
19762
|
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
19619
19763
|
params[Param.LiveboardXLSXCSVDownload] = !!liveboardXLSXCSVDownload;
|
|
19620
|
-
|
|
19621
|
-
return
|
|
19764
|
+
getQueryParamString(params, true);
|
|
19765
|
+
return params;
|
|
19622
19766
|
}
|
|
19623
19767
|
getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
|
|
19624
19768
|
let suffix = `/embed/viz/${liveboardId}`;
|
|
@@ -19860,11 +20004,9 @@ query GetEurekaVizSnapshots(
|
|
|
19860
20004
|
const defaultAppInitData = await super.getAppInitData();
|
|
19861
20005
|
return { ...defaultAppInitData, ...this.getSearchInitData() };
|
|
19862
20006
|
}
|
|
19863
|
-
|
|
20007
|
+
getEmbedParamsObject() {
|
|
19864
20008
|
var _a;
|
|
19865
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
|
|
19866
|
-
/* eslint-disable-next-line max-len */
|
|
19867
|
-
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
|
|
20009
|
+
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = true, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
|
|
19868
20010
|
const queryParams = this.getBaseQueryParams();
|
|
19869
20011
|
queryParams[Param.HideActions] = [
|
|
19870
20012
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -19897,7 +20039,6 @@ query GetEurekaVizSnapshots(
|
|
|
19897
20039
|
queryParams[Param.HideSearchBar] = true;
|
|
19898
20040
|
}
|
|
19899
20041
|
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
19900
|
-
/* eslint-disable-next-line max-len */
|
|
19901
20042
|
queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
19902
20043
|
}
|
|
19903
20044
|
if (!focusSearchBarOnRender) {
|
|
@@ -19910,20 +20051,22 @@ query GetEurekaVizSnapshots(
|
|
|
19910
20051
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
19911
20052
|
}
|
|
19912
20053
|
queryParams[Param.searchEmbed] = true;
|
|
19913
|
-
/* eslint-disable-next-line max-len */
|
|
19914
20054
|
queryParams[Param.CollapseSearchBarInitially] = collapseSearchBarInitially || collapseSearchBar;
|
|
19915
20055
|
queryParams[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
19916
20056
|
if (dataPanelCustomGroupsAccordionInitialState
|
|
19917
20057
|
=== DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
|
|
19918
20058
|
|| dataPanelCustomGroupsAccordionInitialState
|
|
19919
20059
|
=== DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST) {
|
|
19920
|
-
/* eslint-disable-next-line max-len */
|
|
19921
20060
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
|
|
19922
20061
|
}
|
|
19923
20062
|
else {
|
|
19924
|
-
/* eslint-disable-next-line max-len */
|
|
19925
20063
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
|
|
19926
20064
|
}
|
|
20065
|
+
return queryParams;
|
|
20066
|
+
}
|
|
20067
|
+
getEmbedParams() {
|
|
20068
|
+
const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
|
|
20069
|
+
const queryParams = this.getEmbedParamsObject();
|
|
19927
20070
|
let query = '';
|
|
19928
20071
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
19929
20072
|
if (queryParamsString) {
|
|
@@ -19979,15 +20122,9 @@ query GetEurekaVizSnapshots(
|
|
|
19979
20122
|
this.embedComponentType = 'SearchBarEmbed';
|
|
19980
20123
|
this.viewConfig = viewConfig;
|
|
19981
20124
|
}
|
|
19982
|
-
|
|
19983
|
-
* Construct the URL of the embedded ThoughtSpot search to be
|
|
19984
|
-
* loaded in the iframe
|
|
19985
|
-
* @param dataSources A list of data source GUIDs
|
|
19986
|
-
*/
|
|
19987
|
-
getIFrameSrc() {
|
|
20125
|
+
getEmbedParamsObject() {
|
|
19988
20126
|
var _a;
|
|
19989
20127
|
const { searchOptions, dataSource, dataSources, useLastSelectedSources = false, excludeSearchTokenStringFromURL, } = this.viewConfig;
|
|
19990
|
-
const path = 'search-bar-embed';
|
|
19991
20128
|
const queryParams = this.getBaseQueryParams();
|
|
19992
20129
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
19993
20130
|
if (dataSources && dataSources.length) {
|
|
@@ -20009,6 +20146,16 @@ query GetEurekaVizSnapshots(
|
|
|
20009
20146
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
20010
20147
|
}
|
|
20011
20148
|
queryParams[Param.searchEmbed] = true;
|
|
20149
|
+
return queryParams;
|
|
20150
|
+
}
|
|
20151
|
+
/**
|
|
20152
|
+
* Construct the URL of the embedded ThoughtSpot search to be
|
|
20153
|
+
* loaded in the iframe
|
|
20154
|
+
* @param dataSources A list of data source GUIDs
|
|
20155
|
+
*/
|
|
20156
|
+
getIFrameSrc() {
|
|
20157
|
+
const queryParams = this.getEmbedParamsObject();
|
|
20158
|
+
const path = 'search-bar-embed';
|
|
20012
20159
|
let query = '';
|
|
20013
20160
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
20014
20161
|
if (queryParamsString) {
|
|
@@ -20431,13 +20578,17 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20431
20578
|
super(container, viewConfig);
|
|
20432
20579
|
this.viewConfig = viewConfig;
|
|
20433
20580
|
}
|
|
20434
|
-
|
|
20581
|
+
getEmbedParamsObject() {
|
|
20435
20582
|
var _a;
|
|
20436
|
-
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
20437
|
-
const path = 'conv-assist-answer';
|
|
20438
20583
|
const queryParams = this.getBaseQueryParams();
|
|
20439
20584
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
20440
20585
|
queryParams[Param.isSpotterAgentEmbed] = true;
|
|
20586
|
+
return queryParams;
|
|
20587
|
+
}
|
|
20588
|
+
getIframeSrc() {
|
|
20589
|
+
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
20590
|
+
const path = 'conv-assist-answer';
|
|
20591
|
+
const queryParams = this.getEmbedParamsObject();
|
|
20441
20592
|
let query = '';
|
|
20442
20593
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
20443
20594
|
if (queryParamsString) {
|
|
@@ -20598,9 +20749,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20598
20749
|
super(container, viewConfig);
|
|
20599
20750
|
this.viewConfig = viewConfig;
|
|
20600
20751
|
}
|
|
20601
|
-
|
|
20752
|
+
getEmbedParamsObject() {
|
|
20602
20753
|
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
20603
|
-
const path = 'insights/conv-assist';
|
|
20604
20754
|
if (!worksheetId) {
|
|
20605
20755
|
this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
|
|
20606
20756
|
}
|
|
@@ -20621,6 +20771,12 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20621
20771
|
if (!isUndefined_1(hideSampleQuestions)) {
|
|
20622
20772
|
queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
20623
20773
|
}
|
|
20774
|
+
return queryParams;
|
|
20775
|
+
}
|
|
20776
|
+
getIframeSrc() {
|
|
20777
|
+
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
20778
|
+
const path = 'insights/conv-assist';
|
|
20779
|
+
const queryParams = this.getEmbedParamsObject();
|
|
20624
20780
|
let query = '';
|
|
20625
20781
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
20626
20782
|
if (queryParamsString) {
|
|
@@ -20692,12 +20848,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20692
20848
|
viewConfig.embedComponentType = 'SageEmbed';
|
|
20693
20849
|
super(domSelector, viewConfig);
|
|
20694
20850
|
}
|
|
20695
|
-
|
|
20696
|
-
* Constructs a map of parameters to be passed on to the
|
|
20697
|
-
* embedded Eureka or Sage search page.
|
|
20698
|
-
* @returns {string} query string
|
|
20699
|
-
*/
|
|
20700
|
-
getEmbedParams() {
|
|
20851
|
+
getEmbedParamsObject() {
|
|
20701
20852
|
const { disableWorksheetChange, hideWorksheetSelector, showObjectSuggestions, dataPanelV2, hideSampleQuestions, isProductTour, hideSageAnswerHeader, hideAutocompleteSuggestions, } = this.viewConfig;
|
|
20702
20853
|
const params = this.getBaseQueryParams();
|
|
20703
20854
|
params[Param.DataPanelV2Enabled] = !!dataPanelV2;
|
|
@@ -20712,6 +20863,15 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
20712
20863
|
params[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
20713
20864
|
params[Param.IsProductTour] = !!isProductTour;
|
|
20714
20865
|
params[Param.HideSageAnswerHeader] = !!hideSageAnswerHeader;
|
|
20866
|
+
return params;
|
|
20867
|
+
}
|
|
20868
|
+
/**
|
|
20869
|
+
* Constructs a map of parameters to be passed on to the
|
|
20870
|
+
* embedded Eureka or Sage search page.
|
|
20871
|
+
* @returns {string} query string
|
|
20872
|
+
*/
|
|
20873
|
+
getEmbedParams() {
|
|
20874
|
+
const params = this.getEmbedParamsObject();
|
|
20715
20875
|
return getQueryParamString(params, true);
|
|
20716
20876
|
}
|
|
20717
20877
|
/**
|