@thoughtspot/visual-embed-sdk 1.40.1-alpha.2 → 1.40.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +7 -6
- package/cjs/src/css-variables.d.ts +316 -0
- package/cjs/src/css-variables.d.ts.map +1 -1
- package/cjs/src/embed/app.d.ts +6 -1
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +22 -0
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +39 -2
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.d.ts +0 -1
- package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js +3 -7
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +63 -3
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +11 -8
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +102 -0
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +11 -3
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +23 -33
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +182 -29
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/sage.d.ts +0 -1
- package/cjs/src/embed/sage.d.ts.map +1 -1
- package/cjs/src/embed/sage.js +6 -10
- package/cjs/src/embed/sage.js.map +1 -1
- package/cjs/src/embed/search-bar.d.ts +0 -1
- package/cjs/src/embed/search-bar.d.ts.map +1 -1
- package/cjs/src/embed/search-bar.js +7 -11
- package/cjs/src/embed/search-bar.js.map +1 -1
- package/cjs/src/embed/search.d.ts +0 -1
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +8 -7
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +22 -9
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +75 -59
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/embed/ts-embed.spec.js +173 -1
- package/cjs/src/embed/ts-embed.spec.js.map +1 -1
- package/cjs/src/types.d.ts +154 -54
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +140 -52
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/liveboardService/liveboardService.d.ts +21 -6
- package/cjs/src/utils/liveboardService/liveboardService.d.ts.map +1 -1
- package/cjs/src/utils/liveboardService/liveboardService.js +21 -6
- package/cjs/src/utils/liveboardService/liveboardService.js.map +1 -1
- package/dist/{index-CmEQfuE3.js → index-P5YjBOuJ.js} +1 -1
- package/dist/src/css-variables.d.ts +316 -0
- package/dist/src/css-variables.d.ts.map +1 -1
- package/dist/src/embed/app.d.ts +6 -1
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/bodyless-conversation.d.ts +0 -1
- package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +63 -3
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +11 -3
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/sage.d.ts +0 -1
- package/dist/src/embed/sage.d.ts.map +1 -1
- package/dist/src/embed/search-bar.d.ts +0 -1
- package/dist/src/embed/search-bar.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts +0 -1
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +22 -9
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/types.d.ts +154 -54
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/liveboardService/liveboardService.d.ts +21 -6
- package/dist/src/utils/liveboardService/liveboardService.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +298 -190
- package/dist/tsembed-react.js +297 -189
- package/dist/tsembed.es.js +319 -196
- package/dist/tsembed.js +318 -195
- package/dist/visual-embed-sdk-react-full.d.ts +583 -76
- package/dist/visual-embed-sdk-react.d.ts +583 -76
- package/dist/visual-embed-sdk.d.ts +583 -76
- package/lib/package.json +7 -6
- package/lib/src/css-variables.d.ts +316 -0
- package/lib/src/css-variables.d.ts.map +1 -1
- package/lib/src/embed/app.d.ts +6 -1
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +22 -0
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +39 -2
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.d.ts +0 -1
- package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/lib/src/embed/bodyless-conversation.js +3 -7
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +63 -3
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +12 -9
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +104 -2
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +11 -3
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +23 -33
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +182 -29
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/sage.d.ts +0 -1
- package/lib/src/embed/sage.d.ts.map +1 -1
- package/lib/src/embed/sage.js +6 -10
- package/lib/src/embed/sage.js.map +1 -1
- package/lib/src/embed/search-bar.d.ts +0 -1
- package/lib/src/embed/search-bar.d.ts.map +1 -1
- package/lib/src/embed/search-bar.js +7 -11
- package/lib/src/embed/search-bar.js.map +1 -1
- package/lib/src/embed/search.d.ts +0 -1
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +8 -7
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +22 -9
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +75 -59
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/embed/ts-embed.spec.js +173 -1
- package/lib/src/embed/ts-embed.spec.js.map +1 -1
- package/lib/src/types.d.ts +154 -54
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +140 -52
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/liveboardService/liveboardService.d.ts +21 -6
- package/lib/src/utils/liveboardService/liveboardService.d.ts.map +1 -1
- package/lib/src/utils/liveboardService/liveboardService.js +21 -6
- package/lib/src/utils/liveboardService/liveboardService.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +584 -77
- package/package.json +7 -6
- package/src/css-variables.ts +396 -1
- package/src/embed/app.spec.ts +54 -2
- package/src/embed/app.ts +24 -0
- package/src/embed/bodyless-conversation.ts +3 -9
- package/src/embed/conversation.spec.ts +131 -5
- package/src/embed/conversation.ts +87 -23
- package/src/embed/liveboard.spec.ts +233 -32
- package/src/embed/liveboard.ts +24 -39
- package/src/embed/sage.ts +6 -11
- package/src/embed/search-bar.tsx +7 -14
- package/src/embed/search.ts +7 -18
- package/src/embed/ts-embed.spec.ts +344 -112
- package/src/embed/ts-embed.ts +82 -70
- package/src/types.ts +153 -54
- package/src/utils/liveboardService/liveboardService.ts +21 -6
- package/dist/index-D1pyb7RG.js +0 -7371
- package/dist/index-DeFzsyFF.js +0 -7371
- package/dist/index-Dpf0rd6w.js +0 -7371
- package/dist/index-UuEbsISo.js +0 -7447
- package/dist/index-e3Uw3YFO.js +0 -7371
- package/dist/index-k7pkZMhx.js +0 -7371
package/dist/tsembed.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.40.1
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.40.1 */
|
|
2
2
|
'use client';
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
@@ -1502,7 +1502,7 @@
|
|
|
1502
1502
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1503
1503
|
* @example
|
|
1504
1504
|
*```js
|
|
1505
|
-
* liveboardEmbed.on(EmbedEvent.
|
|
1505
|
+
* liveboardEmbed.on(EmbedEvent.LiveboardInfo, payload => {
|
|
1506
1506
|
* console.log('Liveboard details', payload);
|
|
1507
1507
|
* })
|
|
1508
1508
|
*```
|
|
@@ -1877,58 +1877,58 @@
|
|
|
1877
1877
|
*/
|
|
1878
1878
|
EmbedEvent["RequestVisibleEmbedCoordinates"] = "requestVisibleEmbedCoordinates";
|
|
1879
1879
|
/**
|
|
1880
|
-
* Emitted when
|
|
1880
|
+
* Emitted when Spotter response is text data
|
|
1881
1881
|
* @example
|
|
1882
1882
|
* ```js
|
|
1883
1883
|
* spotterEmbed.on(EmbedEvent.SpotterData, (payload) => {
|
|
1884
1884
|
* console.log('payload', payload);
|
|
1885
1885
|
* })
|
|
1886
1886
|
*```
|
|
1887
|
-
* @version SDK: 1.
|
|
1887
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1888
1888
|
*/
|
|
1889
1889
|
EmbedEvent["SpotterData"] = "SpotterData";
|
|
1890
1890
|
/**
|
|
1891
|
-
* Emitted when user opens up the worksheet preview modal in
|
|
1891
|
+
* Emitted when user opens up the worksheet preview modal in Spotter embed.
|
|
1892
1892
|
* @example
|
|
1893
1893
|
* ```js
|
|
1894
1894
|
* spotterEmbed.on(EmbedEvent.PreviewSpotterData, (payload) => {
|
|
1895
1895
|
* console.log('payload', payload);
|
|
1896
1896
|
* })
|
|
1897
1897
|
*```
|
|
1898
|
-
* @version SDK: 1.
|
|
1898
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1899
1899
|
*/
|
|
1900
1900
|
EmbedEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
1901
1901
|
/**
|
|
1902
|
-
* Emitted when the
|
|
1902
|
+
* Emitted when the Spotter query is triggered in Spotter embed.
|
|
1903
1903
|
* @example
|
|
1904
1904
|
* ```js
|
|
1905
1905
|
* spotterEmbed.on(EmbedEvent.SpotterQueryTriggered, (payload) => {
|
|
1906
1906
|
* console.log('payload', payload);
|
|
1907
1907
|
* })
|
|
1908
1908
|
*```
|
|
1909
|
-
* @version SDK: 1.
|
|
1909
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1910
1910
|
*/
|
|
1911
1911
|
EmbedEvent["SpotterQueryTriggered"] = "SpotterQueryTriggered";
|
|
1912
1912
|
/**
|
|
1913
|
-
* Emitted when the last
|
|
1913
|
+
* Emitted when the last Spotter query is edited in Spotter embed.
|
|
1914
1914
|
* @example
|
|
1915
1915
|
* ```js
|
|
1916
1916
|
* spotterEmbed.on(EmbedEvent.LastPromptEdited, (payload) => {
|
|
1917
1917
|
* console.log('payload', payload);
|
|
1918
1918
|
* })
|
|
1919
1919
|
*```
|
|
1920
|
-
* @version SDK: 1.
|
|
1920
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1921
1921
|
*/
|
|
1922
1922
|
EmbedEvent["LastPromptEdited"] = "LastPromptEdited";
|
|
1923
1923
|
/**
|
|
1924
|
-
* Emitted when the last
|
|
1924
|
+
* Emitted when the last Spotter query is deleted in Spotter embed.
|
|
1925
1925
|
* @example
|
|
1926
1926
|
* ```js
|
|
1927
1927
|
* spotterEmbed.on(EmbedEvent.LastPromptDeleted, (payload) => {
|
|
1928
1928
|
* console.log('payload', payload);
|
|
1929
1929
|
* })
|
|
1930
1930
|
*```
|
|
1931
|
-
* @version SDK: 1.
|
|
1931
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1932
1932
|
*/
|
|
1933
1933
|
EmbedEvent["LastPromptDeleted"] = "LastPromptDeleted";
|
|
1934
1934
|
/**
|
|
@@ -1939,7 +1939,7 @@
|
|
|
1939
1939
|
* console.log('payload', payload);
|
|
1940
1940
|
* })
|
|
1941
1941
|
*```
|
|
1942
|
-
* @version SDK: 1.
|
|
1942
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1943
1943
|
*/
|
|
1944
1944
|
EmbedEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
1945
1945
|
/**
|
|
@@ -1952,7 +1952,19 @@
|
|
|
1952
1952
|
*```
|
|
1953
1953
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1954
1954
|
*/
|
|
1955
|
-
EmbedEvent["SpotterInit"] = "
|
|
1955
|
+
EmbedEvent["SpotterInit"] = "spotterInit";
|
|
1956
|
+
/**
|
|
1957
|
+
* @hidden
|
|
1958
|
+
* Triggers when the embed listener is ready to receive events.
|
|
1959
|
+
* This is used to trigger events after the embed container is loaded.
|
|
1960
|
+
* @example
|
|
1961
|
+
* ```js
|
|
1962
|
+
* liveboardEmbed.on(EmbedEvent.EmbedListenerReady, () => {
|
|
1963
|
+
* console.log('EmbedListenerReady');
|
|
1964
|
+
* })
|
|
1965
|
+
* ```
|
|
1966
|
+
*/
|
|
1967
|
+
EmbedEvent["EmbedListenerReady"] = "EmbedListenerReady";
|
|
1956
1968
|
})(exports.EmbedEvent || (exports.EmbedEvent = {}));
|
|
1957
1969
|
/**
|
|
1958
1970
|
* Event types that can be triggered by the host application
|
|
@@ -2042,6 +2054,7 @@
|
|
|
2042
2054
|
* done automatically on the most popular column.
|
|
2043
2055
|
* @param - vizId [TS >= 9.8.0] - Optional. The GUID of the visualization to drill
|
|
2044
2056
|
* in case of a Liveboard.
|
|
2057
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2045
2058
|
* @example
|
|
2046
2059
|
* ```js
|
|
2047
2060
|
* searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
|
|
@@ -2361,12 +2374,21 @@
|
|
|
2361
2374
|
* Trigger the **Download PDF** action on an embedded Liveboard,
|
|
2362
2375
|
* visualization or Answer.
|
|
2363
2376
|
*
|
|
2377
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2378
|
+
*
|
|
2364
2379
|
* **NOTE**: The **Download** > **PDF** action is available on
|
|
2365
2380
|
* visualizations and Answers if the data is in tabular format.
|
|
2366
2381
|
* @example
|
|
2367
2382
|
* ```js
|
|
2368
2383
|
* liveboardEmbed.trigger(HostEvent.DownloadAsPdf)
|
|
2369
2384
|
* ```
|
|
2385
|
+
* @example
|
|
2386
|
+
* ```js
|
|
2387
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPdf, {
|
|
2388
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2389
|
+
* });
|
|
2390
|
+
* ```
|
|
2391
|
+
*
|
|
2370
2392
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2371
2393
|
*/
|
|
2372
2394
|
HostEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
@@ -2468,7 +2490,8 @@
|
|
|
2468
2490
|
* This event is not supported in visualization embed and search embed.
|
|
2469
2491
|
* @param - object - To trigger the action for a specific visualization
|
|
2470
2492
|
* in Liveboard embed, pass in `vizId` as a key.
|
|
2471
|
-
*
|
|
2493
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2494
|
+
*
|
|
2472
2495
|
* @example
|
|
2473
2496
|
* ```js
|
|
2474
2497
|
* liveboardEmbed.trigger(HostEvent.Edit)
|
|
@@ -2483,6 +2506,12 @@
|
|
|
2483
2506
|
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2484
2507
|
* });
|
|
2485
2508
|
* ```
|
|
2509
|
+
* @example
|
|
2510
|
+
* ```js
|
|
2511
|
+
* const editResponse = await spotterEmbed.trigger(HostEvent.Edit, {
|
|
2512
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2513
|
+
* });
|
|
2514
|
+
* ```
|
|
2486
2515
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2487
2516
|
*/
|
|
2488
2517
|
HostEvent["Edit"] = "edit";
|
|
@@ -2603,6 +2632,7 @@
|
|
|
2603
2632
|
/**
|
|
2604
2633
|
* Trigger the **Download** action on charts in
|
|
2605
2634
|
* the embedded view.
|
|
2635
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2606
2636
|
* @example
|
|
2607
2637
|
* ```js
|
|
2608
2638
|
* liveboardEmbed.trigger(HostEvent.Download, {vizId:
|
|
@@ -2611,6 +2641,11 @@
|
|
|
2611
2641
|
* ```js
|
|
2612
2642
|
* embed.trigger(HostEvent.Download)
|
|
2613
2643
|
* ```
|
|
2644
|
+
* ```js
|
|
2645
|
+
* spotterEmbed.trigger(HostEvent.Download, {
|
|
2646
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2647
|
+
* });
|
|
2648
|
+
* ```
|
|
2614
2649
|
* @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
|
|
2615
2650
|
* Use {@link DownloadAsPng}
|
|
2616
2651
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
@@ -2639,6 +2674,7 @@
|
|
|
2639
2674
|
/**
|
|
2640
2675
|
* Trigger the **Download** > **CSV** action on tables in
|
|
2641
2676
|
* the embedded view.
|
|
2677
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2642
2678
|
* @example
|
|
2643
2679
|
* ```js
|
|
2644
2680
|
* liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
|
|
@@ -2661,6 +2697,7 @@
|
|
|
2661
2697
|
/**
|
|
2662
2698
|
* Trigger the **Download** > **XLSX** action on tables
|
|
2663
2699
|
* in the embedded view.
|
|
2700
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2664
2701
|
* @example
|
|
2665
2702
|
* ```js
|
|
2666
2703
|
* liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
|
|
@@ -2696,7 +2733,7 @@
|
|
|
2696
2733
|
/**
|
|
2697
2734
|
* Trigger the **Save** action on a Liveboard or Answer.
|
|
2698
2735
|
* Saves the changes.
|
|
2699
|
-
* @param - `vizId` is required in Spotter
|
|
2736
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2700
2737
|
* @example
|
|
2701
2738
|
* ```js
|
|
2702
2739
|
* liveboardEmbed.trigger(HostEvent.Save)
|
|
@@ -3006,6 +3043,7 @@
|
|
|
3006
3043
|
HostEvent["UpdateParameters"] = "UpdateParameters";
|
|
3007
3044
|
/**
|
|
3008
3045
|
* Triggers GetParameters to fetch the runtime Parameters.
|
|
3046
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
3009
3047
|
* ```js
|
|
3010
3048
|
* liveboardEmbed.trigger(HostEvent.GetParameters).then((parameter) => {
|
|
3011
3049
|
* console.log('parameters', parameter);
|
|
@@ -3049,7 +3087,7 @@
|
|
|
3049
3087
|
* @param - optional attributes to set Answer properties.
|
|
3050
3088
|
* `name` - Name string for the Answer.
|
|
3051
3089
|
* `description` - Description text for the Answer.
|
|
3052
|
-
*
|
|
3090
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
3053
3091
|
* @example
|
|
3054
3092
|
* ```js
|
|
3055
3093
|
* const saveAnswerResponse = await searchEmbed.trigger(HostEvent.SaveAnswer, {
|
|
@@ -3057,6 +3095,14 @@
|
|
|
3057
3095
|
* description: "Total sales by states in MidWest"
|
|
3058
3096
|
* });
|
|
3059
3097
|
* ```
|
|
3098
|
+
* @example
|
|
3099
|
+
* ```js
|
|
3100
|
+
* const saveAnswerResponse = await spotterEmbed.trigger(HostEvent.SaveAnswer, {
|
|
3101
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c',
|
|
3102
|
+
* name: "Sales by states",
|
|
3103
|
+
* description: "Total sales by states in MidWest"
|
|
3104
|
+
* });
|
|
3105
|
+
* ```
|
|
3060
3106
|
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
3061
3107
|
*/
|
|
3062
3108
|
HostEvent["SaveAnswer"] = "saveAnswer";
|
|
@@ -3088,7 +3134,7 @@
|
|
|
3088
3134
|
/**
|
|
3089
3135
|
* Triggers a search operation with the search tokens specified in
|
|
3090
3136
|
* the search query string in spotter embed.
|
|
3091
|
-
* @param - `
|
|
3137
|
+
* @param - `query`: Text string in Natural Language format
|
|
3092
3138
|
* @param - `executeSearch`: Boolean to execute search and update search query
|
|
3093
3139
|
* @example
|
|
3094
3140
|
* ```js
|
|
@@ -3097,6 +3143,7 @@
|
|
|
3097
3143
|
* executeSearch: true,
|
|
3098
3144
|
* })
|
|
3099
3145
|
* ```
|
|
3146
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3100
3147
|
*/
|
|
3101
3148
|
HostEvent["SpotterSearch"] = "SpotterSearch";
|
|
3102
3149
|
/**
|
|
@@ -3106,6 +3153,7 @@
|
|
|
3106
3153
|
* ```js
|
|
3107
3154
|
* spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year");
|
|
3108
3155
|
* ```
|
|
3156
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3109
3157
|
*/
|
|
3110
3158
|
HostEvent["EditLastPrompt"] = "EditLastPrompt";
|
|
3111
3159
|
/**
|
|
@@ -3114,6 +3162,7 @@
|
|
|
3114
3162
|
* ```js
|
|
3115
3163
|
* spotterEmbed.trigger(HostEvent.PreviewSpotterData);
|
|
3116
3164
|
* ```
|
|
3165
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3117
3166
|
*/
|
|
3118
3167
|
HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
3119
3168
|
/**
|
|
@@ -3122,6 +3171,7 @@
|
|
|
3122
3171
|
* ```js
|
|
3123
3172
|
* spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
|
|
3124
3173
|
* ```
|
|
3174
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3125
3175
|
*/
|
|
3126
3176
|
HostEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
3127
3177
|
/**
|
|
@@ -3130,17 +3180,19 @@
|
|
|
3130
3180
|
* ```js
|
|
3131
3181
|
* spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
|
|
3132
3182
|
* ```
|
|
3183
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3133
3184
|
*/
|
|
3134
3185
|
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
3135
3186
|
/**
|
|
3136
3187
|
* Toggle the visualization to chart or table view.
|
|
3137
|
-
* @param - `vizId `
|
|
3188
|
+
* @param - `vizId ` refers to the answer id in spotter Embed, it is required in spotter Embed.
|
|
3138
3189
|
* @example
|
|
3139
3190
|
* ```js
|
|
3140
3191
|
* spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {
|
|
3141
|
-
* vizId:
|
|
3192
|
+
* vizId:'b535c760-8bbe-4e6f-bb26-af56b4129a1e'
|
|
3142
3193
|
* });
|
|
3143
3194
|
*```
|
|
3195
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3144
3196
|
*/
|
|
3145
3197
|
HostEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
|
|
3146
3198
|
/**
|
|
@@ -3167,25 +3219,16 @@
|
|
|
3167
3219
|
*/
|
|
3168
3220
|
HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
|
|
3169
3221
|
/**
|
|
3170
|
-
* Trigger the *Ask
|
|
3222
|
+
* Trigger the *Ask Spotter* action for visualizations
|
|
3223
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
3171
3224
|
* @example
|
|
3172
3225
|
* ```js
|
|
3173
|
-
*
|
|
3174
|
-
* {
|
|
3226
|
+
* spotterEmbed.trigger(HostEvent.AskSpotter,
|
|
3227
|
+
* {vizId:'730496d6-6903-4601-937e-2c691821af3c'})
|
|
3175
3228
|
* ```
|
|
3176
3229
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
3177
3230
|
*/
|
|
3178
|
-
HostEvent["AskSpotter"] = "
|
|
3179
|
-
/**
|
|
3180
|
-
* @hidden
|
|
3181
|
-
* Triggers the update of the embed params.
|
|
3182
|
-
*
|
|
3183
|
-
* @example
|
|
3184
|
-
* ```js
|
|
3185
|
-
* liveboardEmbed.trigger(HostEvent.UpdateEmbedParams, viewConfig);
|
|
3186
|
-
* ```
|
|
3187
|
-
*/
|
|
3188
|
-
HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
|
|
3231
|
+
HostEvent["AskSpotter"] = "AskSpotter";
|
|
3189
3232
|
})(exports.HostEvent || (exports.HostEvent = {}));
|
|
3190
3233
|
/**
|
|
3191
3234
|
* The different visual modes that the data sources panel within
|
|
@@ -3291,6 +3334,7 @@
|
|
|
3291
3334
|
Param["Query"] = "query";
|
|
3292
3335
|
Param["HideHomepageLeftNav"] = "hideHomepageLeftNav";
|
|
3293
3336
|
Param["ModularHomeExperienceEnabled"] = "modularHomeExperience";
|
|
3337
|
+
Param["HomepageVersion"] = "homepageVersion";
|
|
3294
3338
|
Param["ListPageVersion"] = "listpageVersion";
|
|
3295
3339
|
Param["PendoTrackingKey"] = "additionalPendoKey";
|
|
3296
3340
|
Param["LiveboardHeaderSticky"] = "isLiveboardHeaderSticky";
|
|
@@ -3485,27 +3529,27 @@
|
|
|
3485
3529
|
*/
|
|
3486
3530
|
Action["ConfigureFilter"] = "configureFilter";
|
|
3487
3531
|
/**
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3532
|
+
* The **Collapse data sources** icon on the Search page.
|
|
3533
|
+
* Collapses the panel showing data sources.
|
|
3534
|
+
*
|
|
3535
|
+
* @example
|
|
3536
|
+
* ```js
|
|
3537
|
+
* disabledActions: [Action.CollapseDataPanel]
|
|
3538
|
+
* ```
|
|
3539
|
+
* @version: SDK: 1.1.0 | ThoughtSpot Cloud: ts7.may.cl, 8.4.1.sw
|
|
3540
|
+
*/
|
|
3497
3541
|
Action["CollapseDataSources"] = "collapseDataSources";
|
|
3498
3542
|
/**
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3543
|
+
* The **Collapse data panel** icon on the Search page.
|
|
3544
|
+
* Collapses the data panel view.
|
|
3545
|
+
*
|
|
3546
|
+
* @version: SDK: 1.34.0 | ThoughtSpot Cloud: 10.3.0.cl
|
|
3547
|
+
*
|
|
3548
|
+
* @example
|
|
3549
|
+
* ```js
|
|
3550
|
+
* disabledActions: [Action.CollapseDataPanel]
|
|
3551
|
+
* ```
|
|
3552
|
+
*/
|
|
3509
3553
|
Action["CollapseDataPanel"] = "collapseDataPanel";
|
|
3510
3554
|
/**
|
|
3511
3555
|
* The **Choose sources** button on Search page.
|
|
@@ -4201,6 +4245,17 @@
|
|
|
4201
4245
|
* @version SDK: 1.25.0 | ThoughtSpot Cloud: 9.6.0.cl
|
|
4202
4246
|
*/
|
|
4203
4247
|
Action["EnableContextualChangeAnalysis"] = "enableContextualChangeAnalysis";
|
|
4248
|
+
/**
|
|
4249
|
+
* Action ID to hide or disable Iterative Change Analysis option
|
|
4250
|
+
* on contextual change analysis Inisght charts context menu
|
|
4251
|
+
*
|
|
4252
|
+
* @example
|
|
4253
|
+
* ```js
|
|
4254
|
+
* disabledActions: [Action.EnableIterativeChangeAnalysis]
|
|
4255
|
+
* ```
|
|
4256
|
+
* @version SDK: 1.41.0 | ThoughtSpot Cloud: 9.12.0.cl
|
|
4257
|
+
*/
|
|
4258
|
+
Action["EnableIterativeChangeAnalysis"] = "enableIterativeChangeAnalysis";
|
|
4204
4259
|
/**
|
|
4205
4260
|
* Action ID to hide or disable Natural Language Search query.
|
|
4206
4261
|
*
|
|
@@ -4570,6 +4625,39 @@
|
|
|
4570
4625
|
* @version SDK: 1.39.0 | ThoughtSpot Cloud: 10.10.0.cl
|
|
4571
4626
|
*/
|
|
4572
4627
|
Action["InConversationTraining"] = "InConversationTraining";
|
|
4628
|
+
/**
|
|
4629
|
+
* Action ID to hide the warnings banner in
|
|
4630
|
+
* Spotter results. It's an EA feature and
|
|
4631
|
+
* handled by LD.
|
|
4632
|
+
* @example
|
|
4633
|
+
* ```js
|
|
4634
|
+
* hiddenAction: [Action.SpotterWarningsBanner]
|
|
4635
|
+
* ```
|
|
4636
|
+
* @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl
|
|
4637
|
+
*/
|
|
4638
|
+
Action["SpotterWarningsBanner"] = "SpotterWarningsBanner";
|
|
4639
|
+
/**
|
|
4640
|
+
* Action ID to hide the warnings border on the knowledge
|
|
4641
|
+
* card in Spotter results. It's an EA feature and
|
|
4642
|
+
* handled by LD.
|
|
4643
|
+
* @example
|
|
4644
|
+
* ```js
|
|
4645
|
+
* hiddenAction: [Action.SpotterWarningsOnTokens]
|
|
4646
|
+
* ```
|
|
4647
|
+
* @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl
|
|
4648
|
+
*/
|
|
4649
|
+
Action["SpotterWarningsOnTokens"] = "SpotterWarningsOnTokens";
|
|
4650
|
+
/**
|
|
4651
|
+
* Action ID to disable the click event handler on knowledge
|
|
4652
|
+
* card in Spotter results. It's an EA feature and
|
|
4653
|
+
* handled by LD.
|
|
4654
|
+
* @example
|
|
4655
|
+
* ```js
|
|
4656
|
+
* hiddenAction: [Action.SpotterTokenQuickEdit]
|
|
4657
|
+
* ```
|
|
4658
|
+
* @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl
|
|
4659
|
+
*/
|
|
4660
|
+
Action["SpotterTokenQuickEdit"] = "SpotterTokenQuickEdit";
|
|
4573
4661
|
})(exports.Action || (exports.Action = {}));
|
|
4574
4662
|
exports.PrefetchFeatures = void 0;
|
|
4575
4663
|
(function (PrefetchFeatures) {
|
|
@@ -15827,7 +15915,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15827
15915
|
return e;
|
|
15828
15916
|
}
|
|
15829
15917
|
|
|
15830
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.40.1
|
|
15918
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.40.1";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 . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | npx coveralls-next","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^11.2.0","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",ajv:"^8.17.1",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1","coveralls-next":"^5.0.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",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};
|
|
15831
15919
|
|
|
15832
15920
|
/**
|
|
15833
15921
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -16053,7 +16141,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16053
16141
|
*/
|
|
16054
16142
|
this.fullscreenChangeHandler = null;
|
|
16055
16143
|
this.subscribedListeners = {};
|
|
16056
|
-
this.isEmbedContainerLoaded = false;
|
|
16057
16144
|
/**
|
|
16058
16145
|
* Send Custom style as part of payload of APP_INIT
|
|
16059
16146
|
* @param _
|
|
@@ -16125,20 +16212,49 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16125
16212
|
});
|
|
16126
16213
|
notifyAuthFailure(exports.AuthFailureType.IDLE_SESSION_TIMEOUT);
|
|
16127
16214
|
};
|
|
16128
|
-
this.pendingEvents = [];
|
|
16129
16215
|
/**
|
|
16130
16216
|
* Register APP_INIT event and sendback init payload
|
|
16131
16217
|
*/
|
|
16132
16218
|
this.registerAppInit = () => {
|
|
16133
16219
|
this.on(exports.EmbedEvent.APP_INIT, this.appInitCb, { start: false }, true);
|
|
16134
|
-
this.on(exports.EmbedEvent.AuthInit, () => {
|
|
16135
|
-
this.isEmbedContainerLoaded = true;
|
|
16136
|
-
this.executePendingEvents();
|
|
16137
|
-
}, { start: false }, true);
|
|
16138
16220
|
this.on(exports.EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
|
|
16139
16221
|
this.on(exports.EmbedEvent.IdleSessionTimeout, this.idleSessionTimeout, { start: false }, true);
|
|
16222
|
+
const embedListenerReadyHandler = this.createEmbedContainerHandler(exports.EmbedEvent.EmbedListenerReady);
|
|
16223
|
+
this.on(exports.EmbedEvent.EmbedListenerReady, embedListenerReadyHandler, { start: false }, true);
|
|
16224
|
+
const authInitHandler = this.createEmbedContainerHandler(exports.EmbedEvent.AuthInit);
|
|
16225
|
+
this.on(exports.EmbedEvent.AuthInit, authInitHandler, { start: false }, true);
|
|
16140
16226
|
};
|
|
16141
16227
|
this.showPreRenderByDefault = false;
|
|
16228
|
+
/**
|
|
16229
|
+
* @hidden
|
|
16230
|
+
* Internal state to track if the embed container is loaded.
|
|
16231
|
+
* This is used to trigger events after the embed container is loaded.
|
|
16232
|
+
*/
|
|
16233
|
+
this.isEmbedContainerLoaded = false;
|
|
16234
|
+
/**
|
|
16235
|
+
* @hidden
|
|
16236
|
+
* Internal state to track the callbacks to be executed after the embed container
|
|
16237
|
+
* is loaded.
|
|
16238
|
+
* This is used to trigger events after the embed container is loaded.
|
|
16239
|
+
*/
|
|
16240
|
+
this.embedContainerReadyCallbacks = [];
|
|
16241
|
+
this.createEmbedContainerHandler = (source) => () => {
|
|
16242
|
+
const processEmbedContainerReady = () => {
|
|
16243
|
+
logger$3.debug('processEmbedContainerReady');
|
|
16244
|
+
this.isEmbedContainerLoaded = true;
|
|
16245
|
+
this.executeEmbedContainerReadyCallbacks();
|
|
16246
|
+
};
|
|
16247
|
+
if (source === exports.EmbedEvent.AuthInit) {
|
|
16248
|
+
const AUTH_INIT_FALLBACK_DELAY = 1000;
|
|
16249
|
+
// Wait for 1 second to ensure the embed container is loaded
|
|
16250
|
+
// This is a workaround to ensure the embed container is loaded
|
|
16251
|
+
// this is needed until all clusters have EmbedListenerReady event
|
|
16252
|
+
setTimeout(processEmbedContainerReady, AUTH_INIT_FALLBACK_DELAY);
|
|
16253
|
+
}
|
|
16254
|
+
else if (source === exports.EmbedEvent.EmbedListenerReady) {
|
|
16255
|
+
processEmbedContainerReady();
|
|
16256
|
+
}
|
|
16257
|
+
};
|
|
16142
16258
|
this.validatePreRenderViewConfig = (viewConfig) => {
|
|
16143
16259
|
var _a;
|
|
16144
16260
|
const preRenderAllowedKeys = ['preRenderId', 'vizId', 'liveboardId'];
|
|
@@ -16160,7 +16276,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16160
16276
|
});
|
|
16161
16277
|
}
|
|
16162
16278
|
};
|
|
16163
|
-
this.id = Date.now().toString();
|
|
16164
16279
|
this.el = getDOMNode(domSelector);
|
|
16165
16280
|
this.eventHandlerMap = new Map();
|
|
16166
16281
|
this.isError = false;
|
|
@@ -16174,9 +16289,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16174
16289
|
...viewConfig,
|
|
16175
16290
|
});
|
|
16176
16291
|
this.hostEventClient = new HostEventClient(this.iFrame);
|
|
16177
|
-
const embedConfig = getEmbedConfig();
|
|
16178
|
-
this.embedConfig = embedConfig;
|
|
16179
16292
|
this.isReadyForRenderPromise = getInitPromise().then(async () => {
|
|
16293
|
+
const embedConfig = getEmbedConfig();
|
|
16294
|
+
this.embedConfig = embedConfig;
|
|
16180
16295
|
if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
|
|
16181
16296
|
this.embedConfig.authTriggerContainer = domSelector;
|
|
16182
16297
|
}
|
|
@@ -16347,43 +16462,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16347
16462
|
async getAppInitData() {
|
|
16348
16463
|
return this.getDefaultAppInitData();
|
|
16349
16464
|
}
|
|
16350
|
-
getPreRenderObj() {
|
|
16351
|
-
var _a;
|
|
16352
|
-
const embedObj = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
|
|
16353
|
-
if (embedObj === this) {
|
|
16354
|
-
logger$3.info('embedObj is same as this');
|
|
16355
|
-
}
|
|
16356
|
-
return embedObj;
|
|
16357
|
-
}
|
|
16358
|
-
checkEmbedContainerLoaded() {
|
|
16359
|
-
if (this.isEmbedContainerLoaded)
|
|
16360
|
-
return true;
|
|
16361
|
-
const preRenderObj = this.getPreRenderObj();
|
|
16362
|
-
if (preRenderObj && preRenderObj.isEmbedContainerLoaded) {
|
|
16363
|
-
this.isEmbedContainerLoaded = true;
|
|
16364
|
-
}
|
|
16365
|
-
return this.isEmbedContainerLoaded;
|
|
16366
|
-
}
|
|
16367
|
-
executePendingEvents() {
|
|
16368
|
-
logger$3.debug('executePendingEvents', this.pendingEvents);
|
|
16369
|
-
setTimeout(() => {
|
|
16370
|
-
this.pendingEvents.forEach((event) => {
|
|
16371
|
-
var _a;
|
|
16372
|
-
this.trigger(event.eventType, event.data);
|
|
16373
|
-
(_a = event.onEventTriggered) === null || _a === void 0 ? void 0 : _a.call(event);
|
|
16374
|
-
});
|
|
16375
|
-
this.pendingEvents = [];
|
|
16376
|
-
}, 1000);
|
|
16377
|
-
}
|
|
16378
|
-
triggerAfterLoad(eventType, data, onEventTriggered) {
|
|
16379
|
-
if (this.checkEmbedContainerLoaded()) {
|
|
16380
|
-
this.trigger(eventType, data);
|
|
16381
|
-
onEventTriggered === null || onEventTriggered === void 0 ? void 0 : onEventTriggered();
|
|
16382
|
-
}
|
|
16383
|
-
else {
|
|
16384
|
-
this.pendingEvents.push({ eventType, data, onEventTriggered });
|
|
16385
|
-
}
|
|
16386
|
-
}
|
|
16387
16465
|
/**
|
|
16388
16466
|
* Constructs the base URL string to load the ThoughtSpot app.
|
|
16389
16467
|
* @param query
|
|
@@ -16398,11 +16476,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16398
16476
|
.join('/');
|
|
16399
16477
|
return `${basePath}#`;
|
|
16400
16478
|
}
|
|
16401
|
-
getUpdateEmbedParamsObject() {
|
|
16402
|
-
let queryParams = this.getEmbedParamsObject();
|
|
16403
|
-
queryParams = { ...this.viewConfig, ...queryParams };
|
|
16404
|
-
return queryParams;
|
|
16405
|
-
}
|
|
16406
16479
|
/**
|
|
16407
16480
|
* Common query params set for all the embed modes.
|
|
16408
16481
|
* @param queryParams
|
|
@@ -16552,13 +16625,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16552
16625
|
return path;
|
|
16553
16626
|
}
|
|
16554
16627
|
getEmbedParams() {
|
|
16555
|
-
const queryParams = this.
|
|
16628
|
+
const queryParams = this.getBaseQueryParams();
|
|
16556
16629
|
return getQueryParamString(queryParams);
|
|
16557
16630
|
}
|
|
16558
|
-
getEmbedParamsObject() {
|
|
16559
|
-
const params = this.getBaseQueryParams();
|
|
16560
|
-
return params;
|
|
16561
|
-
}
|
|
16562
16631
|
getRootIframeSrc() {
|
|
16563
16632
|
const query = this.getEmbedParams();
|
|
16564
16633
|
return this.getEmbedBasePath(query);
|
|
@@ -16938,6 +17007,43 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16938
17007
|
logger$3.log('Event Port is not defined');
|
|
16939
17008
|
}
|
|
16940
17009
|
}
|
|
17010
|
+
getPreRenderObj() {
|
|
17011
|
+
var _a;
|
|
17012
|
+
const embedObj = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
|
|
17013
|
+
if (embedObj === this) {
|
|
17014
|
+
logger$3.info('embedObj is same as this');
|
|
17015
|
+
}
|
|
17016
|
+
return embedObj;
|
|
17017
|
+
}
|
|
17018
|
+
checkEmbedContainerLoaded() {
|
|
17019
|
+
if (this.isEmbedContainerLoaded)
|
|
17020
|
+
return true;
|
|
17021
|
+
const preRenderObj = this.getPreRenderObj();
|
|
17022
|
+
if (preRenderObj && preRenderObj.isEmbedContainerLoaded) {
|
|
17023
|
+
this.isEmbedContainerLoaded = true;
|
|
17024
|
+
}
|
|
17025
|
+
return this.isEmbedContainerLoaded;
|
|
17026
|
+
}
|
|
17027
|
+
executeEmbedContainerReadyCallbacks() {
|
|
17028
|
+
logger$3.debug('executePendingEvents', this.embedContainerReadyCallbacks);
|
|
17029
|
+
this.embedContainerReadyCallbacks.forEach((callback) => {
|
|
17030
|
+
callback === null || callback === void 0 ? void 0 : callback();
|
|
17031
|
+
});
|
|
17032
|
+
this.embedContainerReadyCallbacks = [];
|
|
17033
|
+
}
|
|
17034
|
+
/**
|
|
17035
|
+
* Executes a callback after the embed container is loaded.
|
|
17036
|
+
* @param callback The callback to execute
|
|
17037
|
+
*/
|
|
17038
|
+
executeAfterEmbedContainerLoaded(callback) {
|
|
17039
|
+
if (this.checkEmbedContainerLoaded()) {
|
|
17040
|
+
callback === null || callback === void 0 ? void 0 : callback();
|
|
17041
|
+
}
|
|
17042
|
+
else {
|
|
17043
|
+
logger$3.debug('pushing callback to embedContainerReadyCallbacks', callback);
|
|
17044
|
+
this.embedContainerReadyCallbacks.push(callback);
|
|
17045
|
+
}
|
|
17046
|
+
}
|
|
16941
17047
|
/**
|
|
16942
17048
|
* Triggers an event to the embedded app
|
|
16943
17049
|
* @param {HostEvent} messageType The event type
|
|
@@ -17082,10 +17188,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17082
17188
|
return this.preRender(true);
|
|
17083
17189
|
}
|
|
17084
17190
|
this.validatePreRenderViewConfig(this.viewConfig);
|
|
17085
|
-
logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
|
|
17086
|
-
this.triggerAfterLoad(exports.HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
|
|
17087
17191
|
}
|
|
17088
|
-
this.beforePrerenderVisible();
|
|
17089
17192
|
if (this.el) {
|
|
17090
17193
|
this.syncPreRenderStyle();
|
|
17091
17194
|
if (!this.viewConfig.doNotTrackPreRenderSize) {
|
|
@@ -17102,6 +17205,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17102
17205
|
this.resizeObserver.observe(this.el);
|
|
17103
17206
|
}
|
|
17104
17207
|
}
|
|
17208
|
+
this.beforePrerenderVisible();
|
|
17105
17209
|
removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
|
|
17106
17210
|
this.subscribeToEvents();
|
|
17107
17211
|
// Setup fullscreen change handler for prerendered components
|
|
@@ -17375,6 +17479,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17375
17479
|
* It serves as the foundational version of the home page.
|
|
17376
17480
|
*/
|
|
17377
17481
|
HomePage["Modular"] = "v2";
|
|
17482
|
+
/**
|
|
17483
|
+
* ModularWithStylingChanges (v3) introduces Modular Home Experience
|
|
17484
|
+
* with styling changes.
|
|
17485
|
+
*/
|
|
17486
|
+
HomePage["ModularWithStylingChanges"] = "v3";
|
|
17378
17487
|
})(exports.HomePage || (exports.HomePage = {}));
|
|
17379
17488
|
/**
|
|
17380
17489
|
* Define the version of the list page
|
|
@@ -17540,16 +17649,33 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17540
17649
|
else {
|
|
17541
17650
|
params[Param.DataPanelCustomGroupsAccordionInitialState] = exports.DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
|
|
17542
17651
|
}
|
|
17652
|
+
// Set navigation to v2 by default to avoid problems like the app
|
|
17653
|
+
// switcher (9-dot menu) not showing when v3 navigation is turned on
|
|
17654
|
+
// at the cluster level.
|
|
17655
|
+
// To use v3 navigation, we must manually set the discoveryExperience
|
|
17656
|
+
// settings.
|
|
17657
|
+
params[Param.NavigationVersion] = 'v2';
|
|
17658
|
+
// Set homePageVersion to v2 by default to reset the LD flag value
|
|
17659
|
+
// for the homepageVersion.
|
|
17660
|
+
params[Param.HomepageVersion] = 'v2';
|
|
17543
17661
|
if (discoveryExperience) {
|
|
17544
17662
|
// primaryNavbarVersion v3 will enabled the new left navigation
|
|
17545
17663
|
if (discoveryExperience.primaryNavbarVersion === exports.PrimaryNavbarVersion.Sliding) {
|
|
17546
17664
|
params[Param.NavigationVersion] = discoveryExperience.primaryNavbarVersion;
|
|
17665
|
+
// Enable the modularHomeExperience when Sliding is enabled.
|
|
17666
|
+
params[Param.ModularHomeExperienceEnabled] = true;
|
|
17547
17667
|
}
|
|
17548
17668
|
// homePage v2 will enable the modular home page
|
|
17549
17669
|
// and it will override the modularHomeExperience value
|
|
17550
17670
|
if (discoveryExperience.homePage === exports.HomePage.Modular) {
|
|
17551
17671
|
params[Param.ModularHomeExperienceEnabled] = true;
|
|
17552
17672
|
}
|
|
17673
|
+
// ModularWithStylingChanges (v3) introduces the styling changes
|
|
17674
|
+
// to the Modular Homepage.
|
|
17675
|
+
// v3 will be the base version of homePageVersion.
|
|
17676
|
+
if (discoveryExperience.homePage === exports.HomePage.ModularWithStylingChanges) {
|
|
17677
|
+
params[Param.HomepageVersion] = exports.HomePage.ModularWithStylingChanges;
|
|
17678
|
+
}
|
|
17553
17679
|
// listPageVersion v3 will enable the new list page
|
|
17554
17680
|
if (discoveryExperience.listPageVersion === exports.ListPage.ListWithUXChanges) {
|
|
17555
17681
|
params[Param.ListPageVersion] = discoveryExperience.listPageVersion;
|
|
@@ -17827,7 +17953,16 @@ query GetEurekaVizSnapshots(
|
|
|
17827
17953
|
}
|
|
17828
17954
|
this.setIFrameHeight(frameHeight || this.defaultHeight);
|
|
17829
17955
|
};
|
|
17830
|
-
|
|
17956
|
+
/**
|
|
17957
|
+
* @hidden
|
|
17958
|
+
* Internal state to track the current liveboard id.
|
|
17959
|
+
* This is used to navigate to the correct liveboard when the prerender is visible.
|
|
17960
|
+
*/
|
|
17961
|
+
this.currentLiveboardState = {
|
|
17962
|
+
liveboardId: this.viewConfig.liveboardId,
|
|
17963
|
+
vizId: this.viewConfig.vizId,
|
|
17964
|
+
activeTabId: this.viewConfig.activeTabId,
|
|
17965
|
+
};
|
|
17831
17966
|
if (this.viewConfig.fullHeight === true) {
|
|
17832
17967
|
if (this.viewConfig.vizId) {
|
|
17833
17968
|
logger$3.warn('Full height is currently only supported for Liveboard embeds.' +
|
|
@@ -17844,11 +17979,6 @@ query GetEurekaVizSnapshots(
|
|
|
17844
17979
|
* embedded Liveboard or visualization.
|
|
17845
17980
|
*/
|
|
17846
17981
|
getEmbedParams() {
|
|
17847
|
-
const params = this.getEmbedParamsObject();
|
|
17848
|
-
const queryParams = getQueryParamString(params, true);
|
|
17849
|
-
return queryParams;
|
|
17850
|
-
}
|
|
17851
|
-
getEmbedParamsObject() {
|
|
17852
17982
|
let params = {};
|
|
17853
17983
|
params = this.getBaseQueryParams(params);
|
|
17854
17984
|
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 = false, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
|
|
@@ -17918,27 +18048,8 @@ query GetEurekaVizSnapshots(
|
|
|
17918
18048
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
17919
18049
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
17920
18050
|
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
17921
|
-
|
|
17922
|
-
|
|
17923
|
-
}
|
|
17924
|
-
if (isForceRedirect) {
|
|
17925
|
-
params[Param.IsForceRedirect] = isForceRedirect;
|
|
17926
|
-
}
|
|
17927
|
-
if (dataSourceId !== undefined) {
|
|
17928
|
-
params[Param.DataSourceId] = dataSourceId;
|
|
17929
|
-
}
|
|
17930
|
-
if (isLiveboardStylingAndGroupingEnabled !== undefined) {
|
|
17931
|
-
params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
|
|
17932
|
-
}
|
|
17933
|
-
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
17934
|
-
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
17935
|
-
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
17936
|
-
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
|
|
17937
|
-
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
17938
|
-
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
17939
|
-
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
17940
|
-
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
17941
|
-
return params;
|
|
18051
|
+
const queryParams = getQueryParamString(params, true);
|
|
18052
|
+
return queryParams;
|
|
17942
18053
|
}
|
|
17943
18054
|
getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
|
|
17944
18055
|
let suffix = `/embed/viz/${liveboardId}`;
|
|
@@ -18001,10 +18112,15 @@ query GetEurekaVizSnapshots(
|
|
|
18001
18112
|
}
|
|
18002
18113
|
beforePrerenderVisible() {
|
|
18003
18114
|
const embedObj = this.getPreRenderObj();
|
|
18004
|
-
|
|
18005
|
-
|
|
18006
|
-
if (embedObj)
|
|
18007
|
-
embedObj.
|
|
18115
|
+
this.executeAfterEmbedContainerLoaded(() => {
|
|
18116
|
+
this.navigateToLiveboard(this.viewConfig.liveboardId, this.viewConfig.vizId, this.viewConfig.activeTabId);
|
|
18117
|
+
if (embedObj) {
|
|
18118
|
+
embedObj.currentLiveboardState = {
|
|
18119
|
+
liveboardId: this.viewConfig.liveboardId,
|
|
18120
|
+
vizId: this.viewConfig.vizId,
|
|
18121
|
+
activeTabId: this.viewConfig.activeTabId,
|
|
18122
|
+
};
|
|
18123
|
+
}
|
|
18008
18124
|
});
|
|
18009
18125
|
}
|
|
18010
18126
|
async handleRenderForPrerender() {
|
|
@@ -18067,13 +18183,13 @@ query GetEurekaVizSnapshots(
|
|
|
18067
18183
|
this.postRender();
|
|
18068
18184
|
return this;
|
|
18069
18185
|
}
|
|
18070
|
-
navigateToLiveboard(liveboardId, vizId, activeTabId
|
|
18186
|
+
navigateToLiveboard(liveboardId, vizId, activeTabId) {
|
|
18071
18187
|
const path = this.getIframeSuffixSrc(liveboardId, vizId, activeTabId);
|
|
18072
18188
|
this.viewConfig.liveboardId = liveboardId;
|
|
18073
18189
|
this.viewConfig.activeTabId = activeTabId;
|
|
18074
18190
|
this.viewConfig.vizId = vizId;
|
|
18075
18191
|
if (this.isRendered) {
|
|
18076
|
-
this.
|
|
18192
|
+
this.trigger(exports.HostEvent.Navigate, path.substring(1));
|
|
18077
18193
|
}
|
|
18078
18194
|
else if (this.viewConfig.preRenderId) {
|
|
18079
18195
|
this.preRender(true);
|
|
@@ -18175,9 +18291,11 @@ query GetEurekaVizSnapshots(
|
|
|
18175
18291
|
const defaultAppInitData = await super.getAppInitData();
|
|
18176
18292
|
return { ...defaultAppInitData, ...this.getSearchInitData() };
|
|
18177
18293
|
}
|
|
18178
|
-
|
|
18294
|
+
getEmbedParams() {
|
|
18179
18295
|
var _a;
|
|
18180
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
|
|
18296
|
+
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
|
|
18297
|
+
/* eslint-disable-next-line max-len */
|
|
18298
|
+
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
|
|
18181
18299
|
const queryParams = this.getBaseQueryParams();
|
|
18182
18300
|
queryParams[Param.HideActions] = [
|
|
18183
18301
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -18210,6 +18328,7 @@ query GetEurekaVizSnapshots(
|
|
|
18210
18328
|
queryParams[Param.HideSearchBar] = true;
|
|
18211
18329
|
}
|
|
18212
18330
|
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
18331
|
+
/* eslint-disable-next-line max-len */
|
|
18213
18332
|
queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
18214
18333
|
}
|
|
18215
18334
|
if (!focusSearchBarOnRender) {
|
|
@@ -18222,22 +18341,20 @@ query GetEurekaVizSnapshots(
|
|
|
18222
18341
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
18223
18342
|
}
|
|
18224
18343
|
queryParams[Param.searchEmbed] = true;
|
|
18344
|
+
/* eslint-disable-next-line max-len */
|
|
18225
18345
|
queryParams[Param.CollapseSearchBarInitially] = collapseSearchBarInitially || collapseSearchBar;
|
|
18226
18346
|
queryParams[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
18227
18347
|
if (dataPanelCustomGroupsAccordionInitialState
|
|
18228
18348
|
=== DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
|
|
18229
18349
|
|| dataPanelCustomGroupsAccordionInitialState
|
|
18230
18350
|
=== DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST) {
|
|
18351
|
+
/* eslint-disable-next-line max-len */
|
|
18231
18352
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
|
|
18232
18353
|
}
|
|
18233
18354
|
else {
|
|
18355
|
+
/* eslint-disable-next-line max-len */
|
|
18234
18356
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
|
|
18235
18357
|
}
|
|
18236
|
-
return queryParams;
|
|
18237
|
-
}
|
|
18238
|
-
getEmbedParams() {
|
|
18239
|
-
const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
|
|
18240
|
-
const queryParams = this.getEmbedParamsObject();
|
|
18241
18358
|
let query = '';
|
|
18242
18359
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
18243
18360
|
if (queryParamsString) {
|
|
@@ -18293,9 +18410,15 @@ query GetEurekaVizSnapshots(
|
|
|
18293
18410
|
this.embedComponentType = 'SearchBarEmbed';
|
|
18294
18411
|
this.viewConfig = viewConfig;
|
|
18295
18412
|
}
|
|
18296
|
-
|
|
18413
|
+
/**
|
|
18414
|
+
* Construct the URL of the embedded ThoughtSpot search to be
|
|
18415
|
+
* loaded in the iframe
|
|
18416
|
+
* @param dataSources A list of data source GUIDs
|
|
18417
|
+
*/
|
|
18418
|
+
getIFrameSrc() {
|
|
18297
18419
|
var _a;
|
|
18298
18420
|
const { searchOptions, dataSource, dataSources, useLastSelectedSources = false, excludeSearchTokenStringFromURL, } = this.viewConfig;
|
|
18421
|
+
const path = 'search-bar-embed';
|
|
18299
18422
|
const queryParams = this.getBaseQueryParams();
|
|
18300
18423
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
18301
18424
|
if (dataSources && dataSources.length) {
|
|
@@ -18317,16 +18440,6 @@ query GetEurekaVizSnapshots(
|
|
|
18317
18440
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
18318
18441
|
}
|
|
18319
18442
|
queryParams[Param.searchEmbed] = true;
|
|
18320
|
-
return queryParams;
|
|
18321
|
-
}
|
|
18322
|
-
/**
|
|
18323
|
-
* Construct the URL of the embedded ThoughtSpot search to be
|
|
18324
|
-
* loaded in the iframe
|
|
18325
|
-
* @param dataSources A list of data source GUIDs
|
|
18326
|
-
*/
|
|
18327
|
-
getIFrameSrc() {
|
|
18328
|
-
const queryParams = this.getEmbedParamsObject();
|
|
18329
|
-
const path = 'search-bar-embed';
|
|
18330
18443
|
let query = '';
|
|
18331
18444
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
18332
18445
|
if (queryParamsString) {
|
|
@@ -18749,17 +18862,13 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18749
18862
|
super(container, viewConfig);
|
|
18750
18863
|
this.viewConfig = viewConfig;
|
|
18751
18864
|
}
|
|
18752
|
-
|
|
18865
|
+
getIframeSrc() {
|
|
18753
18866
|
var _a;
|
|
18867
|
+
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
18868
|
+
const path = 'conv-assist-answer';
|
|
18754
18869
|
const queryParams = this.getBaseQueryParams();
|
|
18755
18870
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
18756
18871
|
queryParams[Param.isSpotterAgentEmbed] = true;
|
|
18757
|
-
return queryParams;
|
|
18758
|
-
}
|
|
18759
|
-
getIframeSrc() {
|
|
18760
|
-
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
18761
|
-
const path = 'conv-assist-answer';
|
|
18762
|
-
const queryParams = this.getEmbedParamsObject();
|
|
18763
18872
|
let query = '';
|
|
18764
18873
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
18765
18874
|
if (queryParamsString) {
|
|
@@ -18920,8 +19029,9 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18920
19029
|
super(container, viewConfig);
|
|
18921
19030
|
this.viewConfig = viewConfig;
|
|
18922
19031
|
}
|
|
18923
|
-
|
|
18924
|
-
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, } = this.viewConfig;
|
|
19032
|
+
getIframeSrc() {
|
|
19033
|
+
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
19034
|
+
const path = 'insights/conv-assist';
|
|
18925
19035
|
if (!worksheetId) {
|
|
18926
19036
|
this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
|
|
18927
19037
|
}
|
|
@@ -18942,17 +19052,19 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18942
19052
|
if (!isUndefined_1(hideSampleQuestions)) {
|
|
18943
19053
|
queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
18944
19054
|
}
|
|
18945
|
-
return queryParams;
|
|
18946
|
-
}
|
|
18947
|
-
getIframeSrc() {
|
|
18948
|
-
const { worksheetId, searchOptions, } = this.viewConfig;
|
|
18949
|
-
const path = 'insights/conv-assist';
|
|
18950
|
-
const queryParams = this.getEmbedParamsObject();
|
|
18951
19055
|
let query = '';
|
|
18952
19056
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
18953
19057
|
if (queryParamsString) {
|
|
18954
19058
|
query = `?${queryParamsString}`;
|
|
18955
19059
|
}
|
|
19060
|
+
const filterQuery = getFilterQuery(runtimeFilters || []);
|
|
19061
|
+
if (filterQuery && !excludeRuntimeFiltersfromURL) {
|
|
19062
|
+
query += `&${filterQuery}`;
|
|
19063
|
+
}
|
|
19064
|
+
const parameterQuery = getRuntimeParameters(runtimeParameters || []);
|
|
19065
|
+
if (parameterQuery && !excludeRuntimeParametersfromURL) {
|
|
19066
|
+
query += `&${parameterQuery}`;
|
|
19067
|
+
}
|
|
18956
19068
|
const tsPostHashParams = this.getThoughtSpotPostUrlParams({
|
|
18957
19069
|
worksheet: worksheetId,
|
|
18958
19070
|
query: (searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.searchQuery) || '',
|
|
@@ -19011,7 +19123,12 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
19011
19123
|
viewConfig.embedComponentType = 'SageEmbed';
|
|
19012
19124
|
super(domSelector, viewConfig);
|
|
19013
19125
|
}
|
|
19014
|
-
|
|
19126
|
+
/**
|
|
19127
|
+
* Constructs a map of parameters to be passed on to the
|
|
19128
|
+
* embedded Eureka or Sage search page.
|
|
19129
|
+
* @returns {string} query string
|
|
19130
|
+
*/
|
|
19131
|
+
getEmbedParams() {
|
|
19015
19132
|
const { disableWorksheetChange, hideWorksheetSelector, showObjectSuggestions, dataPanelV2, hideSampleQuestions, isProductTour, hideSageAnswerHeader, hideAutocompleteSuggestions, } = this.viewConfig;
|
|
19016
19133
|
const params = this.getBaseQueryParams();
|
|
19017
19134
|
params[Param.DataPanelV2Enabled] = !!dataPanelV2;
|
|
@@ -19026,15 +19143,6 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
19026
19143
|
params[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
19027
19144
|
params[Param.IsProductTour] = !!isProductTour;
|
|
19028
19145
|
params[Param.HideSageAnswerHeader] = !!hideSageAnswerHeader;
|
|
19029
|
-
return params;
|
|
19030
|
-
}
|
|
19031
|
-
/**
|
|
19032
|
-
* Constructs a map of parameters to be passed on to the
|
|
19033
|
-
* embedded Eureka or Sage search page.
|
|
19034
|
-
* @returns {string} query string
|
|
19035
|
-
*/
|
|
19036
|
-
getEmbedParams() {
|
|
19037
|
-
const params = this.getEmbedParamsObject();
|
|
19038
19146
|
return getQueryParamString(params, true);
|
|
19039
19147
|
}
|
|
19040
19148
|
/**
|
|
@@ -19525,16 +19633,31 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
19525
19633
|
};
|
|
19526
19634
|
|
|
19527
19635
|
/**
|
|
19528
|
-
*
|
|
19529
|
-
*
|
|
19530
|
-
*
|
|
19636
|
+
* Creates a new Liveboard in ThoughtSpot using the provided AnswerService instances.
|
|
19637
|
+
*
|
|
19638
|
+
* Each answer will be added as a visualization to the newly created Liveboard.
|
|
19639
|
+
*
|
|
19640
|
+
* @param {AnswerService[]} answers - An array of initialized `AnswerService` instances
|
|
19641
|
+
* representing the answers to be added to the Liveboard.
|
|
19642
|
+
* @param {string} name - The name of the Liveboard to create.
|
|
19531
19643
|
* @returns result Promise
|
|
19532
19644
|
* @version SDK: 1.33.1 | ThoughtSpot: *
|
|
19533
19645
|
* @example
|
|
19534
19646
|
* ```js
|
|
19535
|
-
*
|
|
19536
|
-
*
|
|
19537
|
-
*
|
|
19647
|
+
* import { EmbedEvent, AnswerService } from "@thoughtspot/visual-embed-sdk";
|
|
19648
|
+
*
|
|
19649
|
+
* embed.on(EmbedEvent.Data, async () => {
|
|
19650
|
+
* try {
|
|
19651
|
+
* const answerService = await embed.getAnswerService();
|
|
19652
|
+
* const lb = await createLiveboardWithAnswers(
|
|
19653
|
+
* [answerService],
|
|
19654
|
+
* "My Liveboard"
|
|
19655
|
+
* );
|
|
19656
|
+
* console.log("Liveboard created:", lb);
|
|
19657
|
+
* } catch (err) {
|
|
19658
|
+
* console.error("Failed to create liveboard:", err);
|
|
19659
|
+
* }
|
|
19660
|
+
* });
|
|
19538
19661
|
* ```
|
|
19539
19662
|
*/
|
|
19540
19663
|
const createLiveboardWithAnswers = async (answers, name) => {
|