@thoughtspot/visual-embed-sdk 1.40.1-alpha.1 → 1.40.1-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +1 -1
- package/cjs/src/embed/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/liveboard.d.ts +1 -0
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +30 -14
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +29 -4
- 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 +2 -0
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +18 -17
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/dist/index-k7pkZMhx.js +7371 -0
- package/dist/src/embed/bodyless-conversation.d.ts +5 -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/liveboard.d.ts +3 -1
- 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 +9 -0
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/react/index.d.ts +2 -0
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +220 -7
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +375 -60
- package/dist/tsembed-react.js +374 -59
- package/dist/tsembed.es.js +375 -60
- package/dist/tsembed.js +374 -59
- package/dist/visual-embed-sdk-react-full.d.ts +240 -8
- package/dist/visual-embed-sdk-react.d.ts +240 -8
- package/dist/visual-embed-sdk.d.ts +238 -8
- package/lib/package.json +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/liveboard.d.ts +1 -0
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +30 -14
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +29 -4
- 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 +2 -0
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +18 -17
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +238 -8
- package/package.json +2 -1
- package/src/embed/bodyless-conversation.ts +9 -3
- package/src/embed/conversation.ts +13 -2
- package/src/embed/liveboard.spec.ts +32 -4
- package/src/embed/liveboard.ts +36 -16
- package/src/embed/sage.ts +11 -6
- package/src/embed/search-bar.tsx +14 -7
- package/src/embed/search.ts +18 -7
- package/src/embed/ts-embed.ts +21 -18
package/dist/tsembed.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.40.1-alpha.2 */
|
|
2
2
|
'use client';
|
|
3
3
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
m.forEach(function (e) {
|
|
@@ -1870,6 +1870,83 @@ var EmbedEvent;
|
|
|
1870
1870
|
* @hidden
|
|
1871
1871
|
*/
|
|
1872
1872
|
EmbedEvent["RequestVisibleEmbedCoordinates"] = "requestVisibleEmbedCoordinates";
|
|
1873
|
+
/**
|
|
1874
|
+
* Emitted when spotter response is text data
|
|
1875
|
+
* @example
|
|
1876
|
+
* ```js
|
|
1877
|
+
* spotterEmbed.on(EmbedEvent.SpotterData, (payload) => {
|
|
1878
|
+
* console.log('payload', payload);
|
|
1879
|
+
* })
|
|
1880
|
+
*```
|
|
1881
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1882
|
+
*/
|
|
1883
|
+
EmbedEvent["SpotterData"] = "SpotterData";
|
|
1884
|
+
/**
|
|
1885
|
+
* Emitted when user opens up the worksheet preview modal in spotter embed.
|
|
1886
|
+
* @example
|
|
1887
|
+
* ```js
|
|
1888
|
+
* spotterEmbed.on(EmbedEvent.PreviewSpotterData, (payload) => {
|
|
1889
|
+
* console.log('payload', payload);
|
|
1890
|
+
* })
|
|
1891
|
+
*```
|
|
1892
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1893
|
+
*/
|
|
1894
|
+
EmbedEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
1895
|
+
/**
|
|
1896
|
+
* Emitted when the spotter query is triggered in spotter embed.
|
|
1897
|
+
* @example
|
|
1898
|
+
* ```js
|
|
1899
|
+
* spotterEmbed.on(EmbedEvent.SpotterQueryTriggered, (payload) => {
|
|
1900
|
+
* console.log('payload', payload);
|
|
1901
|
+
* })
|
|
1902
|
+
*```
|
|
1903
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1904
|
+
*/
|
|
1905
|
+
EmbedEvent["SpotterQueryTriggered"] = "SpotterQueryTriggered";
|
|
1906
|
+
/**
|
|
1907
|
+
* Emitted when the last spotter query is edited in spotter embed.
|
|
1908
|
+
* @example
|
|
1909
|
+
* ```js
|
|
1910
|
+
* spotterEmbed.on(EmbedEvent.LastPromptEdited, (payload) => {
|
|
1911
|
+
* console.log('payload', payload);
|
|
1912
|
+
* })
|
|
1913
|
+
*```
|
|
1914
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1915
|
+
*/
|
|
1916
|
+
EmbedEvent["LastPromptEdited"] = "LastPromptEdited";
|
|
1917
|
+
/**
|
|
1918
|
+
* Emitted when the last spotter query is deleted in spotter embed.
|
|
1919
|
+
* @example
|
|
1920
|
+
* ```js
|
|
1921
|
+
* spotterEmbed.on(EmbedEvent.LastPromptDeleted, (payload) => {
|
|
1922
|
+
* console.log('payload', payload);
|
|
1923
|
+
* })
|
|
1924
|
+
*```
|
|
1925
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1926
|
+
*/
|
|
1927
|
+
EmbedEvent["LastPromptDeleted"] = "LastPromptDeleted";
|
|
1928
|
+
/**
|
|
1929
|
+
* Emitted when the coversation is reset in spotter embed.
|
|
1930
|
+
* @example
|
|
1931
|
+
* ```js
|
|
1932
|
+
* spotterEmbed.on(EmbedEvent.ResetSpotterConversation, (payload) => {
|
|
1933
|
+
* console.log('payload', payload);
|
|
1934
|
+
* })
|
|
1935
|
+
*```
|
|
1936
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1937
|
+
*/
|
|
1938
|
+
EmbedEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
1939
|
+
/**
|
|
1940
|
+
* Emitted when the *Spotter* is initialized.
|
|
1941
|
+
* @example
|
|
1942
|
+
* ```js
|
|
1943
|
+
* spotterEmbed.on(EmbedEvent.SpotterInit, (payload) => {
|
|
1944
|
+
* console.log('payload', payload);
|
|
1945
|
+
* })
|
|
1946
|
+
*```
|
|
1947
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1948
|
+
*/
|
|
1949
|
+
EmbedEvent["SpotterInit"] = "SpotterInit";
|
|
1873
1950
|
})(EmbedEvent || (EmbedEvent = {}));
|
|
1874
1951
|
/**
|
|
1875
1952
|
* Event types that can be triggered by the host application
|
|
@@ -1887,7 +1964,7 @@ var EmbedEvent;
|
|
|
1887
1964
|
* // create the liveboard embed.
|
|
1888
1965
|
*
|
|
1889
1966
|
* liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
|
|
1890
|
-
* { columnName: 'state, operator: RuntimeFilterOp.EQ, values: [
|
|
1967
|
+
* { columnName: 'state', operator: RuntimeFilterOp.EQ, values: ["california"]}
|
|
1891
1968
|
* ]);
|
|
1892
1969
|
* ```
|
|
1893
1970
|
* @example
|
|
@@ -2097,12 +2174,12 @@ var HostEvent;
|
|
|
2097
2174
|
* Works with Search and Liveboard embed.
|
|
2098
2175
|
* @param - { columnId: string,
|
|
2099
2176
|
* name: string,
|
|
2100
|
-
* type:
|
|
2101
|
-
* dataType:
|
|
2177
|
+
* type: ATTRIBUTE/MEASURE,
|
|
2178
|
+
* dataType: INT64/CHAR/DATE }
|
|
2102
2179
|
* @example
|
|
2103
2180
|
* ```js
|
|
2104
2181
|
* searchEmbed.trigger(HostEvent.OpenFilter,
|
|
2105
|
-
* {column: { columnId: '<column-GUID>', name: 'column name', type: '
|
|
2182
|
+
* {column: { columnId: '<column-GUID>', name: 'column name', type: 'ATTRIBUTE', dataType: 'INT64'}})
|
|
2106
2183
|
* ```
|
|
2107
2184
|
* @example
|
|
2108
2185
|
* ```js
|
|
@@ -2160,6 +2237,7 @@ var HostEvent;
|
|
|
2160
2237
|
* @param
|
|
2161
2238
|
* `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
|
|
2162
2239
|
* Optional when pinning a new chart or table generated from a Search query.
|
|
2240
|
+
* **Required** in Spotter Embed.
|
|
2163
2241
|
* @param
|
|
2164
2242
|
* `liveboardID` - GUID of the Liveboard to pin an Answer. If there is no Liveboard,
|
|
2165
2243
|
* specify the `newLiveboardName` parameter to create a new Liveboard.
|
|
@@ -2207,6 +2285,12 @@ var HostEvent;
|
|
|
2207
2285
|
* ```js
|
|
2208
2286
|
* appEmbed.trigger(HostEvent.Pin)
|
|
2209
2287
|
* ```
|
|
2288
|
+
* @example
|
|
2289
|
+
* ```js
|
|
2290
|
+
* const pinResponse = await spotterEmbed.trigger(HostEvent.Pin, {
|
|
2291
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2292
|
+
* });
|
|
2293
|
+
* ```
|
|
2210
2294
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2211
2295
|
*/
|
|
2212
2296
|
HostEvent["Pin"] = "pin";
|
|
@@ -2300,6 +2384,12 @@ var HostEvent;
|
|
|
2300
2384
|
* ```js
|
|
2301
2385
|
* searchEmbed.trigger(HostEvent.MakeACopy)
|
|
2302
2386
|
* ```
|
|
2387
|
+
* @example
|
|
2388
|
+
* ```js
|
|
2389
|
+
* const pinResponse = await spotterEmbed.trigger(HostEvent.MakeACopy, {
|
|
2390
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2391
|
+
* });
|
|
2392
|
+
* ```
|
|
2303
2393
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2304
2394
|
*/
|
|
2305
2395
|
HostEvent["MakeACopy"] = "makeACopy";
|
|
@@ -2372,6 +2462,7 @@ var HostEvent;
|
|
|
2372
2462
|
* This event is not supported in visualization embed and search embed.
|
|
2373
2463
|
* @param - object - To trigger the action for a specific visualization
|
|
2374
2464
|
* in Liveboard embed, pass in `vizId` as a key.
|
|
2465
|
+
* **Required** in Spotter embed.
|
|
2375
2466
|
* @example
|
|
2376
2467
|
* ```js
|
|
2377
2468
|
* liveboardEmbed.trigger(HostEvent.Edit)
|
|
@@ -2380,6 +2471,12 @@ var HostEvent;
|
|
|
2380
2471
|
* liveboardEmbed.trigger(HostEvent.Edit, {vizId:
|
|
2381
2472
|
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
2382
2473
|
* ```
|
|
2474
|
+
* @example
|
|
2475
|
+
* ```js
|
|
2476
|
+
* const pinResponse = await spotterEmbed.trigger(HostEvent.Edit, {
|
|
2477
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2478
|
+
* });
|
|
2479
|
+
* ```
|
|
2383
2480
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2384
2481
|
*/
|
|
2385
2482
|
HostEvent["Edit"] = "edit";
|
|
@@ -2427,6 +2524,16 @@ var HostEvent;
|
|
|
2427
2524
|
* );
|
|
2428
2525
|
* })
|
|
2429
2526
|
* ```
|
|
2527
|
+
* @example
|
|
2528
|
+
* ```js
|
|
2529
|
+
* spotterEmbed.trigger(HostEvent.GetTML, {
|
|
2530
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2531
|
+
* }).then((tml) => {
|
|
2532
|
+
* console.log(
|
|
2533
|
+
* tml.answer.search_query // TML representation of the search query
|
|
2534
|
+
* );
|
|
2535
|
+
* })
|
|
2536
|
+
* ```
|
|
2430
2537
|
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
|
|
2431
2538
|
* @important
|
|
2432
2539
|
*/
|
|
@@ -2514,7 +2621,12 @@ var HostEvent;
|
|
|
2514
2621
|
* vizEmbed.trigger(HostEvent.DownloadAsPng)
|
|
2515
2622
|
*
|
|
2516
2623
|
* searchEmbed.trigger(HostEvent.DownloadAsPng)
|
|
2624
|
+
*
|
|
2625
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPng, {
|
|
2626
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2627
|
+
* })
|
|
2517
2628
|
* ```
|
|
2629
|
+
*
|
|
2518
2630
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
|
|
2519
2631
|
*/
|
|
2520
2632
|
HostEvent["DownloadAsPng"] = "downloadAsPng";
|
|
@@ -2532,6 +2644,11 @@ var HostEvent;
|
|
|
2532
2644
|
* ```js
|
|
2533
2645
|
* searchEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
2534
2646
|
* ```
|
|
2647
|
+
* ```js
|
|
2648
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsCsv, {
|
|
2649
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2650
|
+
* })
|
|
2651
|
+
* ```
|
|
2535
2652
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2536
2653
|
*/
|
|
2537
2654
|
HostEvent["DownloadAsCsv"] = "downloadAsCSV";
|
|
@@ -2549,6 +2666,11 @@ var HostEvent;
|
|
|
2549
2666
|
* ```js
|
|
2550
2667
|
* searchEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
2551
2668
|
* ```
|
|
2669
|
+
* ```js
|
|
2670
|
+
* spotterEmbed.trigger(HostEvent.downloadAsXLSX, {
|
|
2671
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2672
|
+
* })
|
|
2673
|
+
* ```
|
|
2552
2674
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2553
2675
|
*/
|
|
2554
2676
|
HostEvent["DownloadAsXlsx"] = "downloadAsXLSX";
|
|
@@ -2568,6 +2690,7 @@ var HostEvent;
|
|
|
2568
2690
|
/**
|
|
2569
2691
|
* Trigger the **Save** action on a Liveboard or Answer.
|
|
2570
2692
|
* Saves the changes.
|
|
2693
|
+
* @param - `vizId` is required in Spotter Embed.
|
|
2571
2694
|
* @example
|
|
2572
2695
|
* ```js
|
|
2573
2696
|
* liveboardEmbed.trigger(HostEvent.Save)
|
|
@@ -2575,6 +2698,11 @@ var HostEvent;
|
|
|
2575
2698
|
* ```js
|
|
2576
2699
|
* searchEmbed.trigger(HostEvent.Save)
|
|
2577
2700
|
* ```
|
|
2701
|
+
* ```js
|
|
2702
|
+
* spotterEmbed.trigger(HostEvent.Save, {
|
|
2703
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2704
|
+
* })
|
|
2705
|
+
* ```
|
|
2578
2706
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2579
2707
|
*/
|
|
2580
2708
|
HostEvent["Save"] = "save";
|
|
@@ -2858,7 +2986,7 @@ var HostEvent;
|
|
|
2858
2986
|
HostEvent["ResetLiveboardPersonalisedView"] = "ResetLiveboardPersonalisedView";
|
|
2859
2987
|
/**
|
|
2860
2988
|
* Triggers an action to update Parameter values on embedded
|
|
2861
|
-
* Answers and
|
|
2989
|
+
* Answers, Liveboard and Spotter answer in Edit mode.
|
|
2862
2990
|
*
|
|
2863
2991
|
* @example
|
|
2864
2992
|
* ```js
|
|
@@ -2877,6 +3005,13 @@ var HostEvent;
|
|
|
2877
3005
|
* console.log('parameters', parameter);
|
|
2878
3006
|
* });
|
|
2879
3007
|
*```
|
|
3008
|
+
*```js
|
|
3009
|
+
* spotterEmbed.trigger(HostEvent.GetParameters, {
|
|
3010
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
3011
|
+
* }).then((parameter) => {
|
|
3012
|
+
* console.log('parameters', parameter);
|
|
3013
|
+
* });
|
|
3014
|
+
*```
|
|
2880
3015
|
* @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
2881
3016
|
*/
|
|
2882
3017
|
HostEvent["GetParameters"] = "GetParameters";
|
|
@@ -2944,6 +3079,64 @@ var HostEvent;
|
|
|
2944
3079
|
* @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
|
|
2945
3080
|
*/
|
|
2946
3081
|
HostEvent["TransformTableVizData"] = "TransformTableVizData";
|
|
3082
|
+
/**
|
|
3083
|
+
* Triggers a search operation with the search tokens specified in
|
|
3084
|
+
* the search query string in spotter embed.
|
|
3085
|
+
* @param - `queryString`: Text string in Natural Language format
|
|
3086
|
+
* @param - `executeSearch`: Boolean to execute search and update search query
|
|
3087
|
+
* @example
|
|
3088
|
+
* ```js
|
|
3089
|
+
* spotterEmbed.trigger(HostEvent.SpotterSearch, {
|
|
3090
|
+
* query: 'revenue per year',
|
|
3091
|
+
* executeSearch: true,
|
|
3092
|
+
* })
|
|
3093
|
+
* ```
|
|
3094
|
+
*/
|
|
3095
|
+
HostEvent["SpotterSearch"] = "SpotterSearch";
|
|
3096
|
+
/**
|
|
3097
|
+
* Edits the last prompt in spotter embed.
|
|
3098
|
+
* @param - `query`: Text string
|
|
3099
|
+
* @example
|
|
3100
|
+
* ```js
|
|
3101
|
+
* spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year");
|
|
3102
|
+
* ```
|
|
3103
|
+
*/
|
|
3104
|
+
HostEvent["EditLastPrompt"] = "EditLastPrompt";
|
|
3105
|
+
/**
|
|
3106
|
+
* Opens the Worksheet preview modal in Spotter Embed.
|
|
3107
|
+
* @example
|
|
3108
|
+
* ```js
|
|
3109
|
+
* spotterEmbed.trigger(HostEvent.PreviewSpotterData);
|
|
3110
|
+
* ```
|
|
3111
|
+
*/
|
|
3112
|
+
HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
3113
|
+
/**
|
|
3114
|
+
* Resets the Spotter Embed Conversation.
|
|
3115
|
+
* @example
|
|
3116
|
+
* ```js
|
|
3117
|
+
* spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
|
|
3118
|
+
* ```
|
|
3119
|
+
*/
|
|
3120
|
+
HostEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
3121
|
+
/**
|
|
3122
|
+
* Deletes the last prompt in spotter embed.
|
|
3123
|
+
* @example
|
|
3124
|
+
* ```js
|
|
3125
|
+
* spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
|
|
3126
|
+
* ```
|
|
3127
|
+
*/
|
|
3128
|
+
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
3129
|
+
/**
|
|
3130
|
+
* Toggle the visualization to chart or table view.
|
|
3131
|
+
* @param - `vizId ` In Spotter Embed, vizId is required.
|
|
3132
|
+
* @example
|
|
3133
|
+
* ```js
|
|
3134
|
+
* spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {
|
|
3135
|
+
* vizId:"'b535c760-8bbe-4e6f-bb26-af56b4129a1e'"
|
|
3136
|
+
* });
|
|
3137
|
+
*```
|
|
3138
|
+
*/
|
|
3139
|
+
HostEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
|
|
2947
3140
|
/**
|
|
2948
3141
|
* @hidden
|
|
2949
3142
|
* Trigger exit from presentation mode when user exits fullscreen.
|
|
@@ -2967,6 +3160,26 @@ var HostEvent;
|
|
|
2967
3160
|
* @hidden
|
|
2968
3161
|
*/
|
|
2969
3162
|
HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
|
|
3163
|
+
/**
|
|
3164
|
+
* Trigger the *Ask Sage* action for visualizations
|
|
3165
|
+
* @example
|
|
3166
|
+
* ```js
|
|
3167
|
+
* liveboardEmbed.trigger(HostEvent.AskSpotter,
|
|
3168
|
+
* {containerId:'730496d6-6903-4601-937e-2c691821af3c'})
|
|
3169
|
+
* ```
|
|
3170
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
3171
|
+
*/
|
|
3172
|
+
HostEvent["AskSpotter"] = "askSpotter";
|
|
3173
|
+
/**
|
|
3174
|
+
* @hidden
|
|
3175
|
+
* Triggers the update of the embed params.
|
|
3176
|
+
*
|
|
3177
|
+
* @example
|
|
3178
|
+
* ```js
|
|
3179
|
+
* liveboardEmbed.trigger(HostEvent.UpdateEmbedParams, viewConfig);
|
|
3180
|
+
* ```
|
|
3181
|
+
*/
|
|
3182
|
+
HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
|
|
2970
3183
|
})(HostEvent || (HostEvent = {}));
|
|
2971
3184
|
/**
|
|
2972
3185
|
* The different visual modes that the data sources panel within
|
|
@@ -7708,7 +7921,7 @@ class AnswerService {
|
|
|
7708
7921
|
async getTML() {
|
|
7709
7922
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
7710
7923
|
const edoc = object[0].edoc;
|
|
7711
|
-
const YAML = await import('./index-
|
|
7924
|
+
const YAML = await import('./index-k7pkZMhx.js');
|
|
7712
7925
|
const parsedDoc = YAML.parse(edoc);
|
|
7713
7926
|
return {
|
|
7714
7927
|
answer: {
|
|
@@ -15608,7 +15821,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
|
15608
15821
|
return e;
|
|
15609
15822
|
}
|
|
15610
15823
|
|
|
15611
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
15824
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.40.1-alpha.2";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"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 | coveralls","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":"^8.2.6","@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",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.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":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 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};
|
|
15612
15825
|
|
|
15613
15826
|
/**
|
|
15614
15827
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -15834,6 +16047,7 @@ class TsEmbed {
|
|
|
15834
16047
|
*/
|
|
15835
16048
|
this.fullscreenChangeHandler = null;
|
|
15836
16049
|
this.subscribedListeners = {};
|
|
16050
|
+
this.isEmbedContainerLoaded = false;
|
|
15837
16051
|
/**
|
|
15838
16052
|
* Send Custom style as part of payload of APP_INIT
|
|
15839
16053
|
* @param _
|
|
@@ -15860,7 +16074,8 @@ class TsEmbed {
|
|
|
15860
16074
|
this.updateAuthToken = async (_, responder) => {
|
|
15861
16075
|
const { authType } = this.embedConfig;
|
|
15862
16076
|
let { autoLogin } = this.embedConfig;
|
|
15863
|
-
// Default autoLogin: true for cookieless if undefined/null, otherwise
|
|
16077
|
+
// Default autoLogin: true for cookieless if undefined/null, otherwise
|
|
16078
|
+
// false
|
|
15864
16079
|
autoLogin = autoLogin !== null && autoLogin !== void 0 ? autoLogin : (authType === AuthType.TrustedAuthTokenCookieless);
|
|
15865
16080
|
if (autoLogin && authType === AuthType.TrustedAuthTokenCookieless) {
|
|
15866
16081
|
try {
|
|
@@ -15904,11 +16119,16 @@ class TsEmbed {
|
|
|
15904
16119
|
});
|
|
15905
16120
|
notifyAuthFailure(AuthFailureType.IDLE_SESSION_TIMEOUT);
|
|
15906
16121
|
};
|
|
16122
|
+
this.pendingEvents = [];
|
|
15907
16123
|
/**
|
|
15908
16124
|
* Register APP_INIT event and sendback init payload
|
|
15909
16125
|
*/
|
|
15910
16126
|
this.registerAppInit = () => {
|
|
15911
16127
|
this.on(EmbedEvent.APP_INIT, this.appInitCb, { start: false }, true);
|
|
16128
|
+
this.on(EmbedEvent.AuthInit, () => {
|
|
16129
|
+
this.isEmbedContainerLoaded = true;
|
|
16130
|
+
this.executePendingEvents();
|
|
16131
|
+
}, { start: false }, true);
|
|
15912
16132
|
this.on(EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
|
|
15913
16133
|
this.on(EmbedEvent.IdleSessionTimeout, this.idleSessionTimeout, { start: false }, true);
|
|
15914
16134
|
};
|
|
@@ -15934,6 +16154,7 @@ class TsEmbed {
|
|
|
15934
16154
|
});
|
|
15935
16155
|
}
|
|
15936
16156
|
};
|
|
16157
|
+
this.id = Date.now().toString();
|
|
15937
16158
|
this.el = getDOMNode(domSelector);
|
|
15938
16159
|
this.eventHandlerMap = new Map();
|
|
15939
16160
|
this.isError = false;
|
|
@@ -15947,9 +16168,9 @@ class TsEmbed {
|
|
|
15947
16168
|
...viewConfig,
|
|
15948
16169
|
});
|
|
15949
16170
|
this.hostEventClient = new HostEventClient(this.iFrame);
|
|
16171
|
+
const embedConfig = getEmbedConfig();
|
|
16172
|
+
this.embedConfig = embedConfig;
|
|
15950
16173
|
this.isReadyForRenderPromise = getInitPromise().then(async () => {
|
|
15951
|
-
const embedConfig = getEmbedConfig();
|
|
15952
|
-
this.embedConfig = embedConfig;
|
|
15953
16174
|
if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
|
|
15954
16175
|
this.embedConfig.authTriggerContainer = domSelector;
|
|
15955
16176
|
}
|
|
@@ -15982,7 +16203,6 @@ class TsEmbed {
|
|
|
15982
16203
|
*/
|
|
15983
16204
|
getEventType(event) {
|
|
15984
16205
|
var _a, _b;
|
|
15985
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
15986
16206
|
return ((_a = event.data) === null || _a === void 0 ? void 0 : _a.type) || ((_b = event.data) === null || _b === void 0 ? void 0 : _b.__type);
|
|
15987
16207
|
}
|
|
15988
16208
|
/**
|
|
@@ -16121,6 +16341,43 @@ class TsEmbed {
|
|
|
16121
16341
|
async getAppInitData() {
|
|
16122
16342
|
return this.getDefaultAppInitData();
|
|
16123
16343
|
}
|
|
16344
|
+
getPreRenderObj() {
|
|
16345
|
+
var _a;
|
|
16346
|
+
const embedObj = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
|
|
16347
|
+
if (embedObj === this) {
|
|
16348
|
+
logger$3.info('embedObj is same as this');
|
|
16349
|
+
}
|
|
16350
|
+
return embedObj;
|
|
16351
|
+
}
|
|
16352
|
+
checkEmbedContainerLoaded() {
|
|
16353
|
+
if (this.isEmbedContainerLoaded)
|
|
16354
|
+
return true;
|
|
16355
|
+
const preRenderObj = this.getPreRenderObj();
|
|
16356
|
+
if (preRenderObj && preRenderObj.isEmbedContainerLoaded) {
|
|
16357
|
+
this.isEmbedContainerLoaded = true;
|
|
16358
|
+
}
|
|
16359
|
+
return this.isEmbedContainerLoaded;
|
|
16360
|
+
}
|
|
16361
|
+
executePendingEvents() {
|
|
16362
|
+
logger$3.debug('executePendingEvents', this.pendingEvents);
|
|
16363
|
+
setTimeout(() => {
|
|
16364
|
+
this.pendingEvents.forEach((event) => {
|
|
16365
|
+
var _a;
|
|
16366
|
+
this.trigger(event.eventType, event.data);
|
|
16367
|
+
(_a = event.onEventTriggered) === null || _a === void 0 ? void 0 : _a.call(event);
|
|
16368
|
+
});
|
|
16369
|
+
this.pendingEvents = [];
|
|
16370
|
+
}, 1000);
|
|
16371
|
+
}
|
|
16372
|
+
triggerAfterLoad(eventType, data, onEventTriggered) {
|
|
16373
|
+
if (this.checkEmbedContainerLoaded()) {
|
|
16374
|
+
this.trigger(eventType, data);
|
|
16375
|
+
onEventTriggered === null || onEventTriggered === void 0 ? void 0 : onEventTriggered();
|
|
16376
|
+
}
|
|
16377
|
+
else {
|
|
16378
|
+
this.pendingEvents.push({ eventType, data, onEventTriggered });
|
|
16379
|
+
}
|
|
16380
|
+
}
|
|
16124
16381
|
/**
|
|
16125
16382
|
* Constructs the base URL string to load the ThoughtSpot app.
|
|
16126
16383
|
* @param query
|
|
@@ -16135,6 +16392,11 @@ class TsEmbed {
|
|
|
16135
16392
|
.join('/');
|
|
16136
16393
|
return `${basePath}#`;
|
|
16137
16394
|
}
|
|
16395
|
+
getUpdateEmbedParamsObject() {
|
|
16396
|
+
let queryParams = this.getEmbedParamsObject();
|
|
16397
|
+
queryParams = { ...this.viewConfig, ...queryParams };
|
|
16398
|
+
return queryParams;
|
|
16399
|
+
}
|
|
16138
16400
|
/**
|
|
16139
16401
|
* Common query params set for all the embed modes.
|
|
16140
16402
|
* @param queryParams
|
|
@@ -16284,9 +16546,13 @@ class TsEmbed {
|
|
|
16284
16546
|
return path;
|
|
16285
16547
|
}
|
|
16286
16548
|
getEmbedParams() {
|
|
16287
|
-
const queryParams = this.
|
|
16549
|
+
const queryParams = this.getEmbedParamsObject();
|
|
16288
16550
|
return getQueryParamString(queryParams);
|
|
16289
16551
|
}
|
|
16552
|
+
getEmbedParamsObject() {
|
|
16553
|
+
const params = this.getBaseQueryParams();
|
|
16554
|
+
return params;
|
|
16555
|
+
}
|
|
16290
16556
|
getRootIframeSrc() {
|
|
16291
16557
|
const query = this.getEmbedParams();
|
|
16292
16558
|
return this.getEmbedBasePath(query);
|
|
@@ -16385,7 +16651,8 @@ class TsEmbed {
|
|
|
16385
16651
|
}
|
|
16386
16652
|
});
|
|
16387
16653
|
}
|
|
16388
|
-
// Setup fullscreen change handler after iframe is
|
|
16654
|
+
// Setup fullscreen change handler after iframe is
|
|
16655
|
+
// loaded and ready
|
|
16389
16656
|
this.setupFullscreenChangeHandler();
|
|
16390
16657
|
});
|
|
16391
16658
|
this.iFrame.addEventListener('error', () => {
|
|
@@ -16487,7 +16754,6 @@ class TsEmbed {
|
|
|
16487
16754
|
const div = document.createElement('div');
|
|
16488
16755
|
div.innerHTML = child;
|
|
16489
16756
|
div.id = TS_EMBED_ID;
|
|
16490
|
-
// eslint-disable-next-line no-param-reassign
|
|
16491
16757
|
child = div;
|
|
16492
16758
|
}
|
|
16493
16759
|
if (((_a = this.el.nextElementSibling) === null || _a === void 0 ? void 0 : _a.id) === TS_EMBED_ID) {
|
|
@@ -16810,7 +17076,10 @@ class TsEmbed {
|
|
|
16810
17076
|
return this.preRender(true);
|
|
16811
17077
|
}
|
|
16812
17078
|
this.validatePreRenderViewConfig(this.viewConfig);
|
|
17079
|
+
logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
|
|
17080
|
+
this.triggerAfterLoad(HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
|
|
16813
17081
|
}
|
|
17082
|
+
this.beforePrerenderVisible();
|
|
16814
17083
|
if (this.el) {
|
|
16815
17084
|
this.syncPreRenderStyle();
|
|
16816
17085
|
if (!this.viewConfig.doNotTrackPreRenderSize) {
|
|
@@ -16827,7 +17096,6 @@ class TsEmbed {
|
|
|
16827
17096
|
this.resizeObserver.observe(this.el);
|
|
16828
17097
|
}
|
|
16829
17098
|
}
|
|
16830
|
-
this.beforePrerenderVisible();
|
|
16831
17099
|
removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
|
|
16832
17100
|
this.subscribeToEvents();
|
|
16833
17101
|
// Setup fullscreen change handler for prerendered components
|
|
@@ -16920,7 +17188,8 @@ class TsEmbed {
|
|
|
16920
17188
|
const isFullscreen = !!document.fullscreenElement;
|
|
16921
17189
|
if (!isFullscreen) {
|
|
16922
17190
|
logger$3.info('Exited fullscreen mode - triggering ExitPresentMode');
|
|
16923
|
-
// Only trigger if iframe is available and contentWindow is
|
|
17191
|
+
// Only trigger if iframe is available and contentWindow is
|
|
17192
|
+
// accessible
|
|
16924
17193
|
if (this.iFrame && this.iFrame.contentWindow) {
|
|
16925
17194
|
this.trigger(HostEvent.ExitPresentMode);
|
|
16926
17195
|
}
|
|
@@ -16954,7 +17223,6 @@ class V1Embed extends TsEmbed {
|
|
|
16954
17223
|
* Only for testing purposes.
|
|
16955
17224
|
* @hidden
|
|
16956
17225
|
*/
|
|
16957
|
-
// eslint-disable-next-line camelcase
|
|
16958
17226
|
this.test__executeCallbacks = this.executeCallbacks;
|
|
16959
17227
|
this.viewConfig = { excludeRuntimeFiltersfromURL: false, ...viewConfig };
|
|
16960
17228
|
}
|
|
@@ -17442,7 +17710,7 @@ const addPreviewStylesIfNotPresent = () => {
|
|
|
17442
17710
|
return;
|
|
17443
17711
|
}
|
|
17444
17712
|
const previewStyles = `
|
|
17445
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community@32.0.2/styles/ag-grid.min.css">
|
|
17713
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community@32.0.2/styles/ag-grid.min.css" integrity="sha384-PvEsKa6emq5KYa9mf+Q7eYF5C2OCacYzZ+hBngp21NA4o1A9iU9smnytEmqUFbEZ" crossorigin="anonymous">
|
|
17446
17714
|
<style id="ts-preview-style">
|
|
17447
17715
|
.ts-viz-preview-loader {
|
|
17448
17716
|
position: absolute;
|
|
@@ -17553,6 +17821,7 @@ class LiveboardEmbed extends V1Embed {
|
|
|
17553
17821
|
}
|
|
17554
17822
|
this.setIFrameHeight(frameHeight || this.defaultHeight);
|
|
17555
17823
|
};
|
|
17824
|
+
this.currentLiveboardId = this.viewConfig.liveboardId;
|
|
17556
17825
|
if (this.viewConfig.fullHeight === true) {
|
|
17557
17826
|
if (this.viewConfig.vizId) {
|
|
17558
17827
|
logger$3.warn('Full height is currently only supported for Liveboard embeds.' +
|
|
@@ -17569,6 +17838,11 @@ class LiveboardEmbed extends V1Embed {
|
|
|
17569
17838
|
* embedded Liveboard or visualization.
|
|
17570
17839
|
*/
|
|
17571
17840
|
getEmbedParams() {
|
|
17841
|
+
const params = this.getEmbedParamsObject();
|
|
17842
|
+
const queryParams = getQueryParamString(params, true);
|
|
17843
|
+
return queryParams;
|
|
17844
|
+
}
|
|
17845
|
+
getEmbedParamsObject() {
|
|
17572
17846
|
let params = {};
|
|
17573
17847
|
params = this.getBaseQueryParams(params);
|
|
17574
17848
|
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;
|
|
@@ -17638,8 +17912,27 @@ class LiveboardEmbed extends V1Embed {
|
|
|
17638
17912
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
17639
17913
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
17640
17914
|
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
17641
|
-
|
|
17642
|
-
|
|
17915
|
+
if (oAuthPollingInterval !== undefined) {
|
|
17916
|
+
params[Param.OauthPollingInterval] = oAuthPollingInterval;
|
|
17917
|
+
}
|
|
17918
|
+
if (isForceRedirect) {
|
|
17919
|
+
params[Param.IsForceRedirect] = isForceRedirect;
|
|
17920
|
+
}
|
|
17921
|
+
if (dataSourceId !== undefined) {
|
|
17922
|
+
params[Param.DataSourceId] = dataSourceId;
|
|
17923
|
+
}
|
|
17924
|
+
if (isLiveboardStylingAndGroupingEnabled !== undefined) {
|
|
17925
|
+
params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
|
|
17926
|
+
}
|
|
17927
|
+
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
17928
|
+
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
17929
|
+
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
17930
|
+
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
|
|
17931
|
+
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
17932
|
+
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
17933
|
+
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
17934
|
+
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
17935
|
+
return params;
|
|
17643
17936
|
}
|
|
17644
17937
|
getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
|
|
17645
17938
|
let suffix = `/embed/viz/${liveboardId}`;
|
|
@@ -17701,16 +17994,12 @@ class LiveboardEmbed extends V1Embed {
|
|
|
17701
17994
|
}
|
|
17702
17995
|
}
|
|
17703
17996
|
beforePrerenderVisible() {
|
|
17704
|
-
|
|
17705
|
-
const
|
|
17706
|
-
|
|
17707
|
-
|
|
17708
|
-
|
|
17709
|
-
|
|
17710
|
-
if (showDifferentLib) {
|
|
17711
|
-
const libId = this.viewConfig.liveboardId;
|
|
17712
|
-
this.navigateToLiveboard(libId);
|
|
17713
|
-
}
|
|
17997
|
+
const embedObj = this.getPreRenderObj();
|
|
17998
|
+
const libId = this.currentLiveboardId;
|
|
17999
|
+
this.navigateToLiveboard(libId, this.viewConfig.vizId, this.viewConfig.activeTabId, () => {
|
|
18000
|
+
if (embedObj)
|
|
18001
|
+
embedObj.currentLiveboardId = libId;
|
|
18002
|
+
});
|
|
17714
18003
|
}
|
|
17715
18004
|
async handleRenderForPrerender() {
|
|
17716
18005
|
if (isUndefined$1(this.viewConfig.liveboardId)) {
|
|
@@ -17772,13 +18061,13 @@ class LiveboardEmbed extends V1Embed {
|
|
|
17772
18061
|
this.postRender();
|
|
17773
18062
|
return this;
|
|
17774
18063
|
}
|
|
17775
|
-
navigateToLiveboard(liveboardId, vizId, activeTabId) {
|
|
18064
|
+
navigateToLiveboard(liveboardId, vizId, activeTabId, onNavigateCalled) {
|
|
17776
18065
|
const path = this.getIframeSuffixSrc(liveboardId, vizId, activeTabId);
|
|
17777
18066
|
this.viewConfig.liveboardId = liveboardId;
|
|
17778
18067
|
this.viewConfig.activeTabId = activeTabId;
|
|
17779
18068
|
this.viewConfig.vizId = vizId;
|
|
17780
18069
|
if (this.isRendered) {
|
|
17781
|
-
this.
|
|
18070
|
+
this.triggerAfterLoad(HostEvent.Navigate, path.substring(1), onNavigateCalled);
|
|
17782
18071
|
}
|
|
17783
18072
|
else if (this.viewConfig.preRenderId) {
|
|
17784
18073
|
this.preRender(true);
|
|
@@ -17880,11 +18169,9 @@ class SearchEmbed extends TsEmbed {
|
|
|
17880
18169
|
const defaultAppInitData = await super.getAppInitData();
|
|
17881
18170
|
return { ...defaultAppInitData, ...this.getSearchInitData() };
|
|
17882
18171
|
}
|
|
17883
|
-
|
|
18172
|
+
getEmbedParamsObject() {
|
|
17884
18173
|
var _a;
|
|
17885
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
|
|
17886
|
-
/* eslint-disable-next-line max-len */
|
|
17887
|
-
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
|
|
18174
|
+
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
|
|
17888
18175
|
const queryParams = this.getBaseQueryParams();
|
|
17889
18176
|
queryParams[Param.HideActions] = [
|
|
17890
18177
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -17917,7 +18204,6 @@ class SearchEmbed extends TsEmbed {
|
|
|
17917
18204
|
queryParams[Param.HideSearchBar] = true;
|
|
17918
18205
|
}
|
|
17919
18206
|
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
17920
|
-
/* eslint-disable-next-line max-len */
|
|
17921
18207
|
queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
17922
18208
|
}
|
|
17923
18209
|
if (!focusSearchBarOnRender) {
|
|
@@ -17930,20 +18216,22 @@ class SearchEmbed extends TsEmbed {
|
|
|
17930
18216
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
17931
18217
|
}
|
|
17932
18218
|
queryParams[Param.searchEmbed] = true;
|
|
17933
|
-
/* eslint-disable-next-line max-len */
|
|
17934
18219
|
queryParams[Param.CollapseSearchBarInitially] = collapseSearchBarInitially || collapseSearchBar;
|
|
17935
18220
|
queryParams[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
17936
18221
|
if (dataPanelCustomGroupsAccordionInitialState
|
|
17937
18222
|
=== DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
|
|
17938
18223
|
|| dataPanelCustomGroupsAccordionInitialState
|
|
17939
18224
|
=== DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST) {
|
|
17940
|
-
/* eslint-disable-next-line max-len */
|
|
17941
18225
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
|
|
17942
18226
|
}
|
|
17943
18227
|
else {
|
|
17944
|
-
/* eslint-disable-next-line max-len */
|
|
17945
18228
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
|
|
17946
18229
|
}
|
|
18230
|
+
return queryParams;
|
|
18231
|
+
}
|
|
18232
|
+
getEmbedParams() {
|
|
18233
|
+
const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
|
|
18234
|
+
const queryParams = this.getEmbedParamsObject();
|
|
17947
18235
|
let query = '';
|
|
17948
18236
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
17949
18237
|
if (queryParamsString) {
|
|
@@ -17999,15 +18287,9 @@ class SearchBarEmbed extends TsEmbed {
|
|
|
17999
18287
|
this.embedComponentType = 'SearchBarEmbed';
|
|
18000
18288
|
this.viewConfig = viewConfig;
|
|
18001
18289
|
}
|
|
18002
|
-
|
|
18003
|
-
* Construct the URL of the embedded ThoughtSpot search to be
|
|
18004
|
-
* loaded in the iframe
|
|
18005
|
-
* @param dataSources A list of data source GUIDs
|
|
18006
|
-
*/
|
|
18007
|
-
getIFrameSrc() {
|
|
18290
|
+
getEmbedParamsObject() {
|
|
18008
18291
|
var _a;
|
|
18009
18292
|
const { searchOptions, dataSource, dataSources, useLastSelectedSources = false, excludeSearchTokenStringFromURL, } = this.viewConfig;
|
|
18010
|
-
const path = 'search-bar-embed';
|
|
18011
18293
|
const queryParams = this.getBaseQueryParams();
|
|
18012
18294
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
18013
18295
|
if (dataSources && dataSources.length) {
|
|
@@ -18029,6 +18311,16 @@ class SearchBarEmbed extends TsEmbed {
|
|
|
18029
18311
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
18030
18312
|
}
|
|
18031
18313
|
queryParams[Param.searchEmbed] = true;
|
|
18314
|
+
return queryParams;
|
|
18315
|
+
}
|
|
18316
|
+
/**
|
|
18317
|
+
* Construct the URL of the embedded ThoughtSpot search to be
|
|
18318
|
+
* loaded in the iframe
|
|
18319
|
+
* @param dataSources A list of data source GUIDs
|
|
18320
|
+
*/
|
|
18321
|
+
getIFrameSrc() {
|
|
18322
|
+
const queryParams = this.getEmbedParamsObject();
|
|
18323
|
+
const path = 'search-bar-embed';
|
|
18032
18324
|
let query = '';
|
|
18033
18325
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
18034
18326
|
if (queryParamsString) {
|
|
@@ -18423,7 +18715,11 @@ class Conversation {
|
|
|
18423
18715
|
return {
|
|
18424
18716
|
convId: this.conversationId,
|
|
18425
18717
|
messageId: responses[0].msgId,
|
|
18426
|
-
data:
|
|
18718
|
+
data: {
|
|
18719
|
+
...data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
|
|
18720
|
+
convId: this.conversationId,
|
|
18721
|
+
messageId: responses[0].msgId,
|
|
18722
|
+
},
|
|
18427
18723
|
error: null,
|
|
18428
18724
|
};
|
|
18429
18725
|
}
|
|
@@ -18447,13 +18743,17 @@ class ConversationMessage extends TsEmbed {
|
|
|
18447
18743
|
super(container, viewConfig);
|
|
18448
18744
|
this.viewConfig = viewConfig;
|
|
18449
18745
|
}
|
|
18450
|
-
|
|
18746
|
+
getEmbedParamsObject() {
|
|
18451
18747
|
var _a;
|
|
18452
|
-
const { sessionId, genNo, acSessionId, acGenNo, } = this.viewConfig;
|
|
18453
|
-
const path = 'conv-assist-answer';
|
|
18454
18748
|
const queryParams = this.getBaseQueryParams();
|
|
18455
18749
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
18456
18750
|
queryParams[Param.isSpotterAgentEmbed] = true;
|
|
18751
|
+
return queryParams;
|
|
18752
|
+
}
|
|
18753
|
+
getIframeSrc() {
|
|
18754
|
+
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
18755
|
+
const path = 'conv-assist-answer';
|
|
18756
|
+
const queryParams = this.getEmbedParamsObject();
|
|
18457
18757
|
let query = '';
|
|
18458
18758
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
18459
18759
|
if (queryParamsString) {
|
|
@@ -18464,6 +18764,8 @@ class ConversationMessage extends TsEmbed {
|
|
|
18464
18764
|
genNo,
|
|
18465
18765
|
acSessionId,
|
|
18466
18766
|
acGenNo,
|
|
18767
|
+
convId,
|
|
18768
|
+
messageId,
|
|
18467
18769
|
});
|
|
18468
18770
|
return `${this.getEmbedBasePath(query)}/embed/${path}${tsPostHashParams}`;
|
|
18469
18771
|
}
|
|
@@ -18507,6 +18809,8 @@ class SpotterAgentEmbed {
|
|
|
18507
18809
|
const container = document.createElement('div');
|
|
18508
18810
|
const embed = new ConversationMessage(container, {
|
|
18509
18811
|
...this.viewConfig,
|
|
18812
|
+
convId: data.convId,
|
|
18813
|
+
messageId: data.messageId,
|
|
18510
18814
|
sessionId: data.sessionId,
|
|
18511
18815
|
genNo: data.genNo,
|
|
18512
18816
|
acSessionId: data.stateKey.transactionId,
|
|
@@ -18527,6 +18831,8 @@ class SpotterAgentEmbed {
|
|
|
18527
18831
|
return { error };
|
|
18528
18832
|
}
|
|
18529
18833
|
return { data: {
|
|
18834
|
+
convId: data.convId,
|
|
18835
|
+
messageId: data.messageId,
|
|
18530
18836
|
sessionId: data.sessionId,
|
|
18531
18837
|
genNo: data.genNo,
|
|
18532
18838
|
acSessionId: data.stateKey.transactionId,
|
|
@@ -18608,9 +18914,8 @@ class SpotterEmbed extends TsEmbed {
|
|
|
18608
18914
|
super(container, viewConfig);
|
|
18609
18915
|
this.viewConfig = viewConfig;
|
|
18610
18916
|
}
|
|
18611
|
-
|
|
18917
|
+
getEmbedParamsObject() {
|
|
18612
18918
|
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, } = this.viewConfig;
|
|
18613
|
-
const path = 'insights/conv-assist';
|
|
18614
18919
|
if (!worksheetId) {
|
|
18615
18920
|
this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
|
|
18616
18921
|
}
|
|
@@ -18631,6 +18936,12 @@ class SpotterEmbed extends TsEmbed {
|
|
|
18631
18936
|
if (!isUndefined_1(hideSampleQuestions)) {
|
|
18632
18937
|
queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
18633
18938
|
}
|
|
18939
|
+
return queryParams;
|
|
18940
|
+
}
|
|
18941
|
+
getIframeSrc() {
|
|
18942
|
+
const { worksheetId, searchOptions, } = this.viewConfig;
|
|
18943
|
+
const path = 'insights/conv-assist';
|
|
18944
|
+
const queryParams = this.getEmbedParamsObject();
|
|
18634
18945
|
let query = '';
|
|
18635
18946
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
18636
18947
|
if (queryParamsString) {
|
|
@@ -18694,12 +19005,7 @@ class SageEmbed extends V1Embed {
|
|
|
18694
19005
|
viewConfig.embedComponentType = 'SageEmbed';
|
|
18695
19006
|
super(domSelector, viewConfig);
|
|
18696
19007
|
}
|
|
18697
|
-
|
|
18698
|
-
* Constructs a map of parameters to be passed on to the
|
|
18699
|
-
* embedded Eureka or Sage search page.
|
|
18700
|
-
* @returns {string} query string
|
|
18701
|
-
*/
|
|
18702
|
-
getEmbedParams() {
|
|
19008
|
+
getEmbedParamsObject() {
|
|
18703
19009
|
const { disableWorksheetChange, hideWorksheetSelector, showObjectSuggestions, dataPanelV2, hideSampleQuestions, isProductTour, hideSageAnswerHeader, hideAutocompleteSuggestions, } = this.viewConfig;
|
|
18704
19010
|
const params = this.getBaseQueryParams();
|
|
18705
19011
|
params[Param.DataPanelV2Enabled] = !!dataPanelV2;
|
|
@@ -18714,6 +19020,15 @@ class SageEmbed extends V1Embed {
|
|
|
18714
19020
|
params[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
18715
19021
|
params[Param.IsProductTour] = !!isProductTour;
|
|
18716
19022
|
params[Param.HideSageAnswerHeader] = !!hideSageAnswerHeader;
|
|
19023
|
+
return params;
|
|
19024
|
+
}
|
|
19025
|
+
/**
|
|
19026
|
+
* Constructs a map of parameters to be passed on to the
|
|
19027
|
+
* embedded Eureka or Sage search page.
|
|
19028
|
+
* @returns {string} query string
|
|
19029
|
+
*/
|
|
19030
|
+
getEmbedParams() {
|
|
19031
|
+
const params = this.getEmbedParamsObject();
|
|
18717
19032
|
return getQueryParamString(params, true);
|
|
18718
19033
|
}
|
|
18719
19034
|
/**
|