@thoughtspot/visual-embed-sdk 1.40.1-alpha.2 → 1.41.0-pre-render-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 +5 -4
- 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.map +1 -1
- package/cjs/src/embed/app.js +8 -0
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +12 -2
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +63 -2
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +10 -2
- 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 -2
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +21 -7
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +185 -4
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/sage.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +22 -7
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +75 -46
- 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 +152 -44
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +139 -42
- 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-BDlM0f0T.js +7371 -0
- 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.map +1 -1
- package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +63 -2
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +11 -2
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +22 -7
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/types.d.ts +152 -44
- 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 +256 -100
- package/dist/tsembed-react.js +255 -99
- package/dist/tsembed.es.js +277 -106
- package/dist/tsembed.js +276 -105
- package/dist/visual-embed-sdk-react-full.d.ts +575 -57
- package/dist/visual-embed-sdk-react.d.ts +575 -57
- package/dist/visual-embed-sdk.d.ts +575 -57
- package/lib/package.json +5 -4
- 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.map +1 -1
- package/lib/src/embed/app.js +8 -0
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +12 -2
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +63 -2
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +11 -3
- 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 -2
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +21 -7
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +185 -4
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/sage.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +22 -7
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +75 -46
- 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 +152 -44
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +139 -42
- 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 +576 -58
- package/package.json +5 -4
- package/src/css-variables.ts +396 -1
- package/src/embed/app.spec.ts +17 -2
- package/src/embed/app.ts +8 -0
- package/src/embed/bodyless-conversation.ts +0 -1
- package/src/embed/conversation.spec.ts +131 -5
- package/src/embed/conversation.ts +89 -10
- package/src/embed/liveboard.spec.ts +236 -5
- package/src/embed/liveboard.ts +22 -7
- package/src/embed/sage.ts +1 -1
- package/src/embed/ts-embed.spec.ts +345 -113
- package/src/embed/ts-embed.ts +83 -56
- package/src/types.ts +199 -91
- package/src/utils/liveboardService/liveboardService.ts +21 -6
package/dist/tsembed.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.41.0-pre-render-1 */
|
|
2
2
|
'use client';
|
|
3
3
|
function _mergeNamespaces(n, m) {
|
|
4
4
|
m.forEach(function (e) {
|
|
@@ -1496,7 +1496,7 @@ var EmbedEvent;
|
|
|
1496
1496
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1497
1497
|
* @example
|
|
1498
1498
|
*```js
|
|
1499
|
-
* liveboardEmbed.on(EmbedEvent.
|
|
1499
|
+
* liveboardEmbed.on(EmbedEvent.LiveboardInfo, payload => {
|
|
1500
1500
|
* console.log('Liveboard details', payload);
|
|
1501
1501
|
* })
|
|
1502
1502
|
*```
|
|
@@ -1871,58 +1871,58 @@ var EmbedEvent;
|
|
|
1871
1871
|
*/
|
|
1872
1872
|
EmbedEvent["RequestVisibleEmbedCoordinates"] = "requestVisibleEmbedCoordinates";
|
|
1873
1873
|
/**
|
|
1874
|
-
* Emitted when
|
|
1874
|
+
* Emitted when Spotter response is text data
|
|
1875
1875
|
* @example
|
|
1876
1876
|
* ```js
|
|
1877
1877
|
* spotterEmbed.on(EmbedEvent.SpotterData, (payload) => {
|
|
1878
1878
|
* console.log('payload', payload);
|
|
1879
1879
|
* })
|
|
1880
1880
|
*```
|
|
1881
|
-
* @version SDK: 1.
|
|
1881
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1882
1882
|
*/
|
|
1883
1883
|
EmbedEvent["SpotterData"] = "SpotterData";
|
|
1884
1884
|
/**
|
|
1885
|
-
* Emitted when user opens up the worksheet preview modal in
|
|
1885
|
+
* Emitted when user opens up the worksheet preview modal in Spotter embed.
|
|
1886
1886
|
* @example
|
|
1887
1887
|
* ```js
|
|
1888
1888
|
* spotterEmbed.on(EmbedEvent.PreviewSpotterData, (payload) => {
|
|
1889
1889
|
* console.log('payload', payload);
|
|
1890
1890
|
* })
|
|
1891
1891
|
*```
|
|
1892
|
-
* @version SDK: 1.
|
|
1892
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1893
1893
|
*/
|
|
1894
1894
|
EmbedEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
1895
1895
|
/**
|
|
1896
|
-
* Emitted when the
|
|
1896
|
+
* Emitted when the Spotter query is triggered in Spotter embed.
|
|
1897
1897
|
* @example
|
|
1898
1898
|
* ```js
|
|
1899
1899
|
* spotterEmbed.on(EmbedEvent.SpotterQueryTriggered, (payload) => {
|
|
1900
1900
|
* console.log('payload', payload);
|
|
1901
1901
|
* })
|
|
1902
1902
|
*```
|
|
1903
|
-
* @version SDK: 1.
|
|
1903
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1904
1904
|
*/
|
|
1905
1905
|
EmbedEvent["SpotterQueryTriggered"] = "SpotterQueryTriggered";
|
|
1906
1906
|
/**
|
|
1907
|
-
* Emitted when the last
|
|
1907
|
+
* Emitted when the last Spotter query is edited in Spotter embed.
|
|
1908
1908
|
* @example
|
|
1909
1909
|
* ```js
|
|
1910
1910
|
* spotterEmbed.on(EmbedEvent.LastPromptEdited, (payload) => {
|
|
1911
1911
|
* console.log('payload', payload);
|
|
1912
1912
|
* })
|
|
1913
1913
|
*```
|
|
1914
|
-
* @version SDK: 1.
|
|
1914
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1915
1915
|
*/
|
|
1916
1916
|
EmbedEvent["LastPromptEdited"] = "LastPromptEdited";
|
|
1917
1917
|
/**
|
|
1918
|
-
* Emitted when the last
|
|
1918
|
+
* Emitted when the last Spotter query is deleted in Spotter embed.
|
|
1919
1919
|
* @example
|
|
1920
1920
|
* ```js
|
|
1921
1921
|
* spotterEmbed.on(EmbedEvent.LastPromptDeleted, (payload) => {
|
|
1922
1922
|
* console.log('payload', payload);
|
|
1923
1923
|
* })
|
|
1924
1924
|
*```
|
|
1925
|
-
* @version SDK: 1.
|
|
1925
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1926
1926
|
*/
|
|
1927
1927
|
EmbedEvent["LastPromptDeleted"] = "LastPromptDeleted";
|
|
1928
1928
|
/**
|
|
@@ -1933,7 +1933,7 @@ var EmbedEvent;
|
|
|
1933
1933
|
* console.log('payload', payload);
|
|
1934
1934
|
* })
|
|
1935
1935
|
*```
|
|
1936
|
-
* @version SDK: 1.
|
|
1936
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1937
1937
|
*/
|
|
1938
1938
|
EmbedEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
1939
1939
|
/**
|
|
@@ -1946,7 +1946,19 @@ var EmbedEvent;
|
|
|
1946
1946
|
*```
|
|
1947
1947
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1948
1948
|
*/
|
|
1949
|
-
EmbedEvent["SpotterInit"] = "
|
|
1949
|
+
EmbedEvent["SpotterInit"] = "spotterInit";
|
|
1950
|
+
/**
|
|
1951
|
+
* @hidden
|
|
1952
|
+
* Triggers when the embed listener is ready to receive events.
|
|
1953
|
+
* This is used to trigger events after the embed container is loaded.
|
|
1954
|
+
* @example
|
|
1955
|
+
* ```js
|
|
1956
|
+
* liveboardEmbed.on(EmbedEvent.EmbedListenerReady, () => {
|
|
1957
|
+
* console.log('EmbedListenerReady');
|
|
1958
|
+
* })
|
|
1959
|
+
* ```
|
|
1960
|
+
*/
|
|
1961
|
+
EmbedEvent["EmbedListenerReady"] = "EmbedListenerReady";
|
|
1950
1962
|
})(EmbedEvent || (EmbedEvent = {}));
|
|
1951
1963
|
/**
|
|
1952
1964
|
* Event types that can be triggered by the host application
|
|
@@ -2036,6 +2048,7 @@ var HostEvent;
|
|
|
2036
2048
|
* done automatically on the most popular column.
|
|
2037
2049
|
* @param - vizId [TS >= 9.8.0] - Optional. The GUID of the visualization to drill
|
|
2038
2050
|
* in case of a Liveboard.
|
|
2051
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2039
2052
|
* @example
|
|
2040
2053
|
* ```js
|
|
2041
2054
|
* searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
|
|
@@ -2355,12 +2368,21 @@ var HostEvent;
|
|
|
2355
2368
|
* Trigger the **Download PDF** action on an embedded Liveboard,
|
|
2356
2369
|
* visualization or Answer.
|
|
2357
2370
|
*
|
|
2371
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2372
|
+
*
|
|
2358
2373
|
* **NOTE**: The **Download** > **PDF** action is available on
|
|
2359
2374
|
* visualizations and Answers if the data is in tabular format.
|
|
2360
2375
|
* @example
|
|
2361
2376
|
* ```js
|
|
2362
2377
|
* liveboardEmbed.trigger(HostEvent.DownloadAsPdf)
|
|
2363
2378
|
* ```
|
|
2379
|
+
* @example
|
|
2380
|
+
* ```js
|
|
2381
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPdf, {
|
|
2382
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2383
|
+
* });
|
|
2384
|
+
* ```
|
|
2385
|
+
*
|
|
2364
2386
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2365
2387
|
*/
|
|
2366
2388
|
HostEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
@@ -2462,7 +2484,8 @@ var HostEvent;
|
|
|
2462
2484
|
* This event is not supported in visualization embed and search embed.
|
|
2463
2485
|
* @param - object - To trigger the action for a specific visualization
|
|
2464
2486
|
* in Liveboard embed, pass in `vizId` as a key.
|
|
2465
|
-
*
|
|
2487
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2488
|
+
*
|
|
2466
2489
|
* @example
|
|
2467
2490
|
* ```js
|
|
2468
2491
|
* liveboardEmbed.trigger(HostEvent.Edit)
|
|
@@ -2477,6 +2500,12 @@ var HostEvent;
|
|
|
2477
2500
|
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2478
2501
|
* });
|
|
2479
2502
|
* ```
|
|
2503
|
+
* @example
|
|
2504
|
+
* ```js
|
|
2505
|
+
* const editResponse = await spotterEmbed.trigger(HostEvent.Edit, {
|
|
2506
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2507
|
+
* });
|
|
2508
|
+
* ```
|
|
2480
2509
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2481
2510
|
*/
|
|
2482
2511
|
HostEvent["Edit"] = "edit";
|
|
@@ -2597,6 +2626,7 @@ var HostEvent;
|
|
|
2597
2626
|
/**
|
|
2598
2627
|
* Trigger the **Download** action on charts in
|
|
2599
2628
|
* the embedded view.
|
|
2629
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2600
2630
|
* @example
|
|
2601
2631
|
* ```js
|
|
2602
2632
|
* liveboardEmbed.trigger(HostEvent.Download, {vizId:
|
|
@@ -2605,6 +2635,11 @@ var HostEvent;
|
|
|
2605
2635
|
* ```js
|
|
2606
2636
|
* embed.trigger(HostEvent.Download)
|
|
2607
2637
|
* ```
|
|
2638
|
+
* ```js
|
|
2639
|
+
* spotterEmbed.trigger(HostEvent.Download, {
|
|
2640
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2641
|
+
* });
|
|
2642
|
+
* ```
|
|
2608
2643
|
* @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
|
|
2609
2644
|
* Use {@link DownloadAsPng}
|
|
2610
2645
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
@@ -2633,6 +2668,7 @@ var HostEvent;
|
|
|
2633
2668
|
/**
|
|
2634
2669
|
* Trigger the **Download** > **CSV** action on tables in
|
|
2635
2670
|
* the embedded view.
|
|
2671
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2636
2672
|
* @example
|
|
2637
2673
|
* ```js
|
|
2638
2674
|
* liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
|
|
@@ -2655,6 +2691,7 @@ var HostEvent;
|
|
|
2655
2691
|
/**
|
|
2656
2692
|
* Trigger the **Download** > **XLSX** action on tables
|
|
2657
2693
|
* in the embedded view.
|
|
2694
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2658
2695
|
* @example
|
|
2659
2696
|
* ```js
|
|
2660
2697
|
* liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
|
|
@@ -2690,7 +2727,7 @@ var HostEvent;
|
|
|
2690
2727
|
/**
|
|
2691
2728
|
* Trigger the **Save** action on a Liveboard or Answer.
|
|
2692
2729
|
* Saves the changes.
|
|
2693
|
-
* @param - `vizId` is required in Spotter
|
|
2730
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2694
2731
|
* @example
|
|
2695
2732
|
* ```js
|
|
2696
2733
|
* liveboardEmbed.trigger(HostEvent.Save)
|
|
@@ -3000,6 +3037,7 @@ var HostEvent;
|
|
|
3000
3037
|
HostEvent["UpdateParameters"] = "UpdateParameters";
|
|
3001
3038
|
/**
|
|
3002
3039
|
* Triggers GetParameters to fetch the runtime Parameters.
|
|
3040
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
3003
3041
|
* ```js
|
|
3004
3042
|
* liveboardEmbed.trigger(HostEvent.GetParameters).then((parameter) => {
|
|
3005
3043
|
* console.log('parameters', parameter);
|
|
@@ -3043,7 +3081,7 @@ var HostEvent;
|
|
|
3043
3081
|
* @param - optional attributes to set Answer properties.
|
|
3044
3082
|
* `name` - Name string for the Answer.
|
|
3045
3083
|
* `description` - Description text for the Answer.
|
|
3046
|
-
*
|
|
3084
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
3047
3085
|
* @example
|
|
3048
3086
|
* ```js
|
|
3049
3087
|
* const saveAnswerResponse = await searchEmbed.trigger(HostEvent.SaveAnswer, {
|
|
@@ -3051,6 +3089,14 @@ var HostEvent;
|
|
|
3051
3089
|
* description: "Total sales by states in MidWest"
|
|
3052
3090
|
* });
|
|
3053
3091
|
* ```
|
|
3092
|
+
* @example
|
|
3093
|
+
* ```js
|
|
3094
|
+
* const saveAnswerResponse = await spotterEmbed.trigger(HostEvent.SaveAnswer, {
|
|
3095
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c',
|
|
3096
|
+
* name: "Sales by states",
|
|
3097
|
+
* description: "Total sales by states in MidWest"
|
|
3098
|
+
* });
|
|
3099
|
+
* ```
|
|
3054
3100
|
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
3055
3101
|
*/
|
|
3056
3102
|
HostEvent["SaveAnswer"] = "saveAnswer";
|
|
@@ -3082,7 +3128,7 @@ var HostEvent;
|
|
|
3082
3128
|
/**
|
|
3083
3129
|
* Triggers a search operation with the search tokens specified in
|
|
3084
3130
|
* the search query string in spotter embed.
|
|
3085
|
-
* @param - `
|
|
3131
|
+
* @param - `query`: Text string in Natural Language format
|
|
3086
3132
|
* @param - `executeSearch`: Boolean to execute search and update search query
|
|
3087
3133
|
* @example
|
|
3088
3134
|
* ```js
|
|
@@ -3091,6 +3137,7 @@ var HostEvent;
|
|
|
3091
3137
|
* executeSearch: true,
|
|
3092
3138
|
* })
|
|
3093
3139
|
* ```
|
|
3140
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3094
3141
|
*/
|
|
3095
3142
|
HostEvent["SpotterSearch"] = "SpotterSearch";
|
|
3096
3143
|
/**
|
|
@@ -3100,6 +3147,7 @@ var HostEvent;
|
|
|
3100
3147
|
* ```js
|
|
3101
3148
|
* spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year");
|
|
3102
3149
|
* ```
|
|
3150
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3103
3151
|
*/
|
|
3104
3152
|
HostEvent["EditLastPrompt"] = "EditLastPrompt";
|
|
3105
3153
|
/**
|
|
@@ -3108,6 +3156,7 @@ var HostEvent;
|
|
|
3108
3156
|
* ```js
|
|
3109
3157
|
* spotterEmbed.trigger(HostEvent.PreviewSpotterData);
|
|
3110
3158
|
* ```
|
|
3159
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3111
3160
|
*/
|
|
3112
3161
|
HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
3113
3162
|
/**
|
|
@@ -3116,6 +3165,7 @@ var HostEvent;
|
|
|
3116
3165
|
* ```js
|
|
3117
3166
|
* spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
|
|
3118
3167
|
* ```
|
|
3168
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3119
3169
|
*/
|
|
3120
3170
|
HostEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
3121
3171
|
/**
|
|
@@ -3124,17 +3174,19 @@ var HostEvent;
|
|
|
3124
3174
|
* ```js
|
|
3125
3175
|
* spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
|
|
3126
3176
|
* ```
|
|
3177
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3127
3178
|
*/
|
|
3128
3179
|
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
3129
3180
|
/**
|
|
3130
3181
|
* Toggle the visualization to chart or table view.
|
|
3131
|
-
* @param - `vizId `
|
|
3182
|
+
* @param - `vizId ` refers to the answer id in spotter Embed, it is required in spotter Embed.
|
|
3132
3183
|
* @example
|
|
3133
3184
|
* ```js
|
|
3134
3185
|
* spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {
|
|
3135
|
-
* vizId:
|
|
3186
|
+
* vizId:'b535c760-8bbe-4e6f-bb26-af56b4129a1e'
|
|
3136
3187
|
* });
|
|
3137
3188
|
*```
|
|
3189
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3138
3190
|
*/
|
|
3139
3191
|
HostEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
|
|
3140
3192
|
/**
|
|
@@ -3161,15 +3213,16 @@ var HostEvent;
|
|
|
3161
3213
|
*/
|
|
3162
3214
|
HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
|
|
3163
3215
|
/**
|
|
3164
|
-
* Trigger the *Ask
|
|
3216
|
+
* Trigger the *Ask Spotter* action for visualizations
|
|
3217
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
3165
3218
|
* @example
|
|
3166
3219
|
* ```js
|
|
3167
|
-
*
|
|
3168
|
-
* {
|
|
3220
|
+
* spotterEmbed.trigger(HostEvent.AskSpotter,
|
|
3221
|
+
* {vizId:'730496d6-6903-4601-937e-2c691821af3c'})
|
|
3169
3222
|
* ```
|
|
3170
3223
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
3171
3224
|
*/
|
|
3172
|
-
HostEvent["AskSpotter"] = "
|
|
3225
|
+
HostEvent["AskSpotter"] = "AskSpotter";
|
|
3173
3226
|
/**
|
|
3174
3227
|
* @hidden
|
|
3175
3228
|
* Triggers the update of the embed params.
|
|
@@ -3479,27 +3532,27 @@ var Action;
|
|
|
3479
3532
|
*/
|
|
3480
3533
|
Action["ConfigureFilter"] = "configureFilter";
|
|
3481
3534
|
/**
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3486
|
-
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3535
|
+
* The **Collapse data sources** icon on the Search page.
|
|
3536
|
+
* Collapses the panel showing data sources.
|
|
3537
|
+
*
|
|
3538
|
+
* @example
|
|
3539
|
+
* ```js
|
|
3540
|
+
* disabledActions: [Action.CollapseDataPanel]
|
|
3541
|
+
* ```
|
|
3542
|
+
* @version: SDK: 1.1.0 | ThoughtSpot Cloud: ts7.may.cl, 8.4.1.sw
|
|
3543
|
+
*/
|
|
3491
3544
|
Action["CollapseDataSources"] = "collapseDataSources";
|
|
3492
3545
|
/**
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3546
|
+
* The **Collapse data panel** icon on the Search page.
|
|
3547
|
+
* Collapses the data panel view.
|
|
3548
|
+
*
|
|
3549
|
+
* @version: SDK: 1.34.0 | ThoughtSpot Cloud: 10.3.0.cl
|
|
3550
|
+
*
|
|
3551
|
+
* @example
|
|
3552
|
+
* ```js
|
|
3553
|
+
* disabledActions: [Action.CollapseDataPanel]
|
|
3554
|
+
* ```
|
|
3555
|
+
*/
|
|
3503
3556
|
Action["CollapseDataPanel"] = "collapseDataPanel";
|
|
3504
3557
|
/**
|
|
3505
3558
|
* The **Choose sources** button on Search page.
|
|
@@ -4195,6 +4248,17 @@ var Action;
|
|
|
4195
4248
|
* @version SDK: 1.25.0 | ThoughtSpot Cloud: 9.6.0.cl
|
|
4196
4249
|
*/
|
|
4197
4250
|
Action["EnableContextualChangeAnalysis"] = "enableContextualChangeAnalysis";
|
|
4251
|
+
/**
|
|
4252
|
+
* Action ID to hide or disable Iterative Change Analysis option
|
|
4253
|
+
* on contextual change analysis Inisght charts context menu
|
|
4254
|
+
*
|
|
4255
|
+
* @example
|
|
4256
|
+
* ```js
|
|
4257
|
+
* disabledActions: [Action.EnableIterativeChangeAnalysis]
|
|
4258
|
+
* ```
|
|
4259
|
+
* @version SDK: 1.41.0 | ThoughtSpot Cloud: 9.12.0.cl
|
|
4260
|
+
*/
|
|
4261
|
+
Action["EnableIterativeChangeAnalysis"] = "enableIterativeChangeAnalysis";
|
|
4198
4262
|
/**
|
|
4199
4263
|
* Action ID to hide or disable Natural Language Search query.
|
|
4200
4264
|
*
|
|
@@ -4564,6 +4628,39 @@ var Action;
|
|
|
4564
4628
|
* @version SDK: 1.39.0 | ThoughtSpot Cloud: 10.10.0.cl
|
|
4565
4629
|
*/
|
|
4566
4630
|
Action["InConversationTraining"] = "InConversationTraining";
|
|
4631
|
+
/**
|
|
4632
|
+
* Action ID to hide the warnings banner in
|
|
4633
|
+
* Spotter results. It's an EA feature and
|
|
4634
|
+
* handled by LD.
|
|
4635
|
+
* @example
|
|
4636
|
+
* ```js
|
|
4637
|
+
* hiddenAction: [Action.SpotterWarningsBanner]
|
|
4638
|
+
* ```
|
|
4639
|
+
* @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl
|
|
4640
|
+
*/
|
|
4641
|
+
Action["SpotterWarningsBanner"] = "SpotterWarningsBanner";
|
|
4642
|
+
/**
|
|
4643
|
+
* Action ID to hide the warnings border on the knowledge
|
|
4644
|
+
* card in Spotter results. It's an EA feature and
|
|
4645
|
+
* handled by LD.
|
|
4646
|
+
* @example
|
|
4647
|
+
* ```js
|
|
4648
|
+
* hiddenAction: [Action.SpotterWarningsOnTokens]
|
|
4649
|
+
* ```
|
|
4650
|
+
* @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl
|
|
4651
|
+
*/
|
|
4652
|
+
Action["SpotterWarningsOnTokens"] = "SpotterWarningsOnTokens";
|
|
4653
|
+
/**
|
|
4654
|
+
* Action ID to disable the click event handler on knowledge
|
|
4655
|
+
* card in Spotter results. It's an EA feature and
|
|
4656
|
+
* handled by LD.
|
|
4657
|
+
* @example
|
|
4658
|
+
* ```js
|
|
4659
|
+
* hiddenAction: [Action.SpotterTokenQuickEdit]
|
|
4660
|
+
* ```
|
|
4661
|
+
* @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl
|
|
4662
|
+
*/
|
|
4663
|
+
Action["SpotterTokenQuickEdit"] = "SpotterTokenQuickEdit";
|
|
4567
4664
|
})(Action || (Action = {}));
|
|
4568
4665
|
var PrefetchFeatures;
|
|
4569
4666
|
(function (PrefetchFeatures) {
|
|
@@ -7921,7 +8018,7 @@ class AnswerService {
|
|
|
7921
8018
|
async getTML() {
|
|
7922
8019
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
7923
8020
|
const edoc = object[0].edoc;
|
|
7924
|
-
const YAML = await import('./index-
|
|
8021
|
+
const YAML = await import('./index-BDlM0f0T.js');
|
|
7925
8022
|
const parsedDoc = YAML.parse(edoc);
|
|
7926
8023
|
return {
|
|
7927
8024
|
answer: {
|
|
@@ -15821,7 +15918,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
|
15821
15918
|
return e;
|
|
15822
15919
|
}
|
|
15823
15920
|
|
|
15824
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
15921
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.41.0-pre-render-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={".":{"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":"^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:"^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":"^2.0.0",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
|
|
15825
15922
|
|
|
15826
15923
|
/**
|
|
15827
15924
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -16047,7 +16144,6 @@ class TsEmbed {
|
|
|
16047
16144
|
*/
|
|
16048
16145
|
this.fullscreenChangeHandler = null;
|
|
16049
16146
|
this.subscribedListeners = {};
|
|
16050
|
-
this.isEmbedContainerLoaded = false;
|
|
16051
16147
|
/**
|
|
16052
16148
|
* Send Custom style as part of payload of APP_INIT
|
|
16053
16149
|
* @param _
|
|
@@ -16119,20 +16215,49 @@ class TsEmbed {
|
|
|
16119
16215
|
});
|
|
16120
16216
|
notifyAuthFailure(AuthFailureType.IDLE_SESSION_TIMEOUT);
|
|
16121
16217
|
};
|
|
16122
|
-
this.pendingEvents = [];
|
|
16123
16218
|
/**
|
|
16124
16219
|
* Register APP_INIT event and sendback init payload
|
|
16125
16220
|
*/
|
|
16126
16221
|
this.registerAppInit = () => {
|
|
16127
16222
|
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);
|
|
16132
16223
|
this.on(EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
|
|
16133
16224
|
this.on(EmbedEvent.IdleSessionTimeout, this.idleSessionTimeout, { start: false }, true);
|
|
16225
|
+
const embedListenerReadyHandler = this.createEmbedContainerHandler(EmbedEvent.EmbedListenerReady);
|
|
16226
|
+
this.on(EmbedEvent.EmbedListenerReady, embedListenerReadyHandler, { start: false }, true);
|
|
16227
|
+
const authInitHandler = this.createEmbedContainerHandler(EmbedEvent.AuthInit);
|
|
16228
|
+
this.on(EmbedEvent.AuthInit, authInitHandler, { start: false }, true);
|
|
16134
16229
|
};
|
|
16135
16230
|
this.showPreRenderByDefault = false;
|
|
16231
|
+
/**
|
|
16232
|
+
* @hidden
|
|
16233
|
+
* Internal state to track if the embed container is loaded.
|
|
16234
|
+
* This is used to trigger events after the embed container is loaded.
|
|
16235
|
+
*/
|
|
16236
|
+
this.isEmbedContainerLoaded = false;
|
|
16237
|
+
/**
|
|
16238
|
+
* @hidden
|
|
16239
|
+
* Internal state to track the callbacks to be executed after the embed container
|
|
16240
|
+
* is loaded.
|
|
16241
|
+
* This is used to trigger events after the embed container is loaded.
|
|
16242
|
+
*/
|
|
16243
|
+
this.embedContainerReadyCallbacks = [];
|
|
16244
|
+
this.createEmbedContainerHandler = (source) => () => {
|
|
16245
|
+
const processEmbedContainerReady = () => {
|
|
16246
|
+
logger$3.debug('processEmbedContainerReady');
|
|
16247
|
+
this.isEmbedContainerLoaded = true;
|
|
16248
|
+
this.executeEmbedContainerReadyCallbacks();
|
|
16249
|
+
};
|
|
16250
|
+
if (source === EmbedEvent.AuthInit) {
|
|
16251
|
+
const AUTH_INIT_FALLBACK_DELAY = 1000;
|
|
16252
|
+
// Wait for 1 second to ensure the embed container is loaded
|
|
16253
|
+
// This is a workaround to ensure the embed container is loaded
|
|
16254
|
+
// this is needed until all clusters have EmbedListenerReady event
|
|
16255
|
+
setTimeout(processEmbedContainerReady, AUTH_INIT_FALLBACK_DELAY);
|
|
16256
|
+
}
|
|
16257
|
+
else if (source === EmbedEvent.EmbedListenerReady) {
|
|
16258
|
+
processEmbedContainerReady();
|
|
16259
|
+
}
|
|
16260
|
+
};
|
|
16136
16261
|
this.validatePreRenderViewConfig = (viewConfig) => {
|
|
16137
16262
|
var _a;
|
|
16138
16263
|
const preRenderAllowedKeys = ['preRenderId', 'vizId', 'liveboardId'];
|
|
@@ -16154,7 +16279,6 @@ class TsEmbed {
|
|
|
16154
16279
|
});
|
|
16155
16280
|
}
|
|
16156
16281
|
};
|
|
16157
|
-
this.id = Date.now().toString();
|
|
16158
16282
|
this.el = getDOMNode(domSelector);
|
|
16159
16283
|
this.eventHandlerMap = new Map();
|
|
16160
16284
|
this.isError = false;
|
|
@@ -16167,9 +16291,9 @@ class TsEmbed {
|
|
|
16167
16291
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
16168
16292
|
...viewConfig,
|
|
16169
16293
|
});
|
|
16170
|
-
this.hostEventClient = new HostEventClient(this.iFrame);
|
|
16171
16294
|
const embedConfig = getEmbedConfig();
|
|
16172
16295
|
this.embedConfig = embedConfig;
|
|
16296
|
+
this.hostEventClient = new HostEventClient(this.iFrame);
|
|
16173
16297
|
this.isReadyForRenderPromise = getInitPromise().then(async () => {
|
|
16174
16298
|
if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
|
|
16175
16299
|
this.embedConfig.authTriggerContainer = domSelector;
|
|
@@ -16341,43 +16465,6 @@ class TsEmbed {
|
|
|
16341
16465
|
async getAppInitData() {
|
|
16342
16466
|
return this.getDefaultAppInitData();
|
|
16343
16467
|
}
|
|
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
|
-
}
|
|
16381
16468
|
/**
|
|
16382
16469
|
* Constructs the base URL string to load the ThoughtSpot app.
|
|
16383
16470
|
* @param query
|
|
@@ -16932,6 +17019,43 @@ class TsEmbed {
|
|
|
16932
17019
|
logger$3.log('Event Port is not defined');
|
|
16933
17020
|
}
|
|
16934
17021
|
}
|
|
17022
|
+
getPreRenderObj() {
|
|
17023
|
+
var _a;
|
|
17024
|
+
const embedObj = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
|
|
17025
|
+
if (embedObj === this) {
|
|
17026
|
+
logger$3.info('embedObj is same as this');
|
|
17027
|
+
}
|
|
17028
|
+
return embedObj;
|
|
17029
|
+
}
|
|
17030
|
+
checkEmbedContainerLoaded() {
|
|
17031
|
+
if (this.isEmbedContainerLoaded)
|
|
17032
|
+
return true;
|
|
17033
|
+
const preRenderObj = this.getPreRenderObj();
|
|
17034
|
+
if (preRenderObj && preRenderObj.isEmbedContainerLoaded) {
|
|
17035
|
+
this.isEmbedContainerLoaded = true;
|
|
17036
|
+
}
|
|
17037
|
+
return this.isEmbedContainerLoaded;
|
|
17038
|
+
}
|
|
17039
|
+
executeEmbedContainerReadyCallbacks() {
|
|
17040
|
+
logger$3.debug('executePendingEvents', this.embedContainerReadyCallbacks);
|
|
17041
|
+
this.embedContainerReadyCallbacks.forEach((callback) => {
|
|
17042
|
+
callback === null || callback === void 0 ? void 0 : callback();
|
|
17043
|
+
});
|
|
17044
|
+
this.embedContainerReadyCallbacks = [];
|
|
17045
|
+
}
|
|
17046
|
+
/**
|
|
17047
|
+
* Executes a callback after the embed container is loaded.
|
|
17048
|
+
* @param callback The callback to execute
|
|
17049
|
+
*/
|
|
17050
|
+
executeAfterEmbedContainerLoaded(callback) {
|
|
17051
|
+
if (this.checkEmbedContainerLoaded()) {
|
|
17052
|
+
callback === null || callback === void 0 ? void 0 : callback();
|
|
17053
|
+
}
|
|
17054
|
+
else {
|
|
17055
|
+
logger$3.debug('pushing callback to embedContainerReadyCallbacks', callback);
|
|
17056
|
+
this.embedContainerReadyCallbacks.push(callback);
|
|
17057
|
+
}
|
|
17058
|
+
}
|
|
16935
17059
|
/**
|
|
16936
17060
|
* Triggers an event to the embedded app
|
|
16937
17061
|
* @param {HostEvent} messageType The event type
|
|
@@ -17077,7 +17201,9 @@ class TsEmbed {
|
|
|
17077
17201
|
}
|
|
17078
17202
|
this.validatePreRenderViewConfig(this.viewConfig);
|
|
17079
17203
|
logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
|
|
17080
|
-
this.
|
|
17204
|
+
this.executeAfterEmbedContainerLoaded(() => {
|
|
17205
|
+
this.trigger(HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
|
|
17206
|
+
});
|
|
17081
17207
|
}
|
|
17082
17208
|
this.beforePrerenderVisible();
|
|
17083
17209
|
if (this.el) {
|
|
@@ -17534,10 +17660,18 @@ class AppEmbed extends V1Embed {
|
|
|
17534
17660
|
else {
|
|
17535
17661
|
params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL;
|
|
17536
17662
|
}
|
|
17663
|
+
// Set navigation to v2 by default to avoid problems like the app
|
|
17664
|
+
// switcher (9-dot menu) not showing when v3 navigation is turned on
|
|
17665
|
+
// at the cluster level.
|
|
17666
|
+
// To use v3 navigation, we must manually set the discoveryExperience
|
|
17667
|
+
// settings.
|
|
17668
|
+
params[Param.NavigationVersion] = 'v2';
|
|
17537
17669
|
if (discoveryExperience) {
|
|
17538
17670
|
// primaryNavbarVersion v3 will enabled the new left navigation
|
|
17539
17671
|
if (discoveryExperience.primaryNavbarVersion === PrimaryNavbarVersion.Sliding) {
|
|
17540
17672
|
params[Param.NavigationVersion] = discoveryExperience.primaryNavbarVersion;
|
|
17673
|
+
// Enable the modularHomeExperience when Sliding is enabled.
|
|
17674
|
+
params[Param.ModularHomeExperienceEnabled] = true;
|
|
17541
17675
|
}
|
|
17542
17676
|
// homePage v2 will enable the modular home page
|
|
17543
17677
|
// and it will override the modularHomeExperience value
|
|
@@ -17821,7 +17955,16 @@ class LiveboardEmbed extends V1Embed {
|
|
|
17821
17955
|
}
|
|
17822
17956
|
this.setIFrameHeight(frameHeight || this.defaultHeight);
|
|
17823
17957
|
};
|
|
17824
|
-
|
|
17958
|
+
/**
|
|
17959
|
+
* @hidden
|
|
17960
|
+
* Internal state to track the current liveboard id.
|
|
17961
|
+
* This is used to navigate to the correct liveboard when the prerender is visible.
|
|
17962
|
+
*/
|
|
17963
|
+
this.currentLiveboardState = {
|
|
17964
|
+
liveboardId: this.viewConfig.liveboardId,
|
|
17965
|
+
vizId: this.viewConfig.vizId,
|
|
17966
|
+
activeTabId: this.viewConfig.activeTabId,
|
|
17967
|
+
};
|
|
17825
17968
|
if (this.viewConfig.fullHeight === true) {
|
|
17826
17969
|
if (this.viewConfig.vizId) {
|
|
17827
17970
|
logger$3.warn('Full height is currently only supported for Liveboard embeds.' +
|
|
@@ -17995,10 +18138,15 @@ class LiveboardEmbed extends V1Embed {
|
|
|
17995
18138
|
}
|
|
17996
18139
|
beforePrerenderVisible() {
|
|
17997
18140
|
const embedObj = this.getPreRenderObj();
|
|
17998
|
-
|
|
17999
|
-
|
|
18000
|
-
if (embedObj)
|
|
18001
|
-
embedObj.
|
|
18141
|
+
this.executeAfterEmbedContainerLoaded(() => {
|
|
18142
|
+
this.navigateToLiveboard(this.viewConfig.liveboardId, this.viewConfig.vizId, this.viewConfig.activeTabId);
|
|
18143
|
+
if (embedObj) {
|
|
18144
|
+
embedObj.currentLiveboardState = {
|
|
18145
|
+
liveboardId: this.viewConfig.liveboardId,
|
|
18146
|
+
vizId: this.viewConfig.vizId,
|
|
18147
|
+
activeTabId: this.viewConfig.activeTabId,
|
|
18148
|
+
};
|
|
18149
|
+
}
|
|
18002
18150
|
});
|
|
18003
18151
|
}
|
|
18004
18152
|
async handleRenderForPrerender() {
|
|
@@ -18061,13 +18209,13 @@ class LiveboardEmbed extends V1Embed {
|
|
|
18061
18209
|
this.postRender();
|
|
18062
18210
|
return this;
|
|
18063
18211
|
}
|
|
18064
|
-
navigateToLiveboard(liveboardId, vizId, activeTabId
|
|
18212
|
+
navigateToLiveboard(liveboardId, vizId, activeTabId) {
|
|
18065
18213
|
const path = this.getIframeSuffixSrc(liveboardId, vizId, activeTabId);
|
|
18066
18214
|
this.viewConfig.liveboardId = liveboardId;
|
|
18067
18215
|
this.viewConfig.activeTabId = activeTabId;
|
|
18068
18216
|
this.viewConfig.vizId = vizId;
|
|
18069
18217
|
if (this.isRendered) {
|
|
18070
|
-
this.
|
|
18218
|
+
this.trigger(HostEvent.Navigate, path.substring(1));
|
|
18071
18219
|
}
|
|
18072
18220
|
else if (this.viewConfig.preRenderId) {
|
|
18073
18221
|
this.preRender(true);
|
|
@@ -18915,7 +19063,7 @@ class SpotterEmbed extends TsEmbed {
|
|
|
18915
19063
|
this.viewConfig = viewConfig;
|
|
18916
19064
|
}
|
|
18917
19065
|
getEmbedParamsObject() {
|
|
18918
|
-
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, } = this.viewConfig;
|
|
19066
|
+
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
18919
19067
|
if (!worksheetId) {
|
|
18920
19068
|
this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
|
|
18921
19069
|
}
|
|
@@ -18939,7 +19087,7 @@ class SpotterEmbed extends TsEmbed {
|
|
|
18939
19087
|
return queryParams;
|
|
18940
19088
|
}
|
|
18941
19089
|
getIframeSrc() {
|
|
18942
|
-
const { worksheetId, searchOptions, } = this.viewConfig;
|
|
19090
|
+
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
18943
19091
|
const path = 'insights/conv-assist';
|
|
18944
19092
|
const queryParams = this.getEmbedParamsObject();
|
|
18945
19093
|
let query = '';
|
|
@@ -18947,6 +19095,14 @@ class SpotterEmbed extends TsEmbed {
|
|
|
18947
19095
|
if (queryParamsString) {
|
|
18948
19096
|
query = `?${queryParamsString}`;
|
|
18949
19097
|
}
|
|
19098
|
+
const filterQuery = getFilterQuery(runtimeFilters || []);
|
|
19099
|
+
if (filterQuery && !excludeRuntimeFiltersfromURL) {
|
|
19100
|
+
query += `&${filterQuery}`;
|
|
19101
|
+
}
|
|
19102
|
+
const parameterQuery = getRuntimeParameters(runtimeParameters || []);
|
|
19103
|
+
if (parameterQuery && !excludeRuntimeParametersfromURL) {
|
|
19104
|
+
query += `&${parameterQuery}`;
|
|
19105
|
+
}
|
|
18950
19106
|
const tsPostHashParams = this.getThoughtSpotPostUrlParams({
|
|
18951
19107
|
worksheet: worksheetId,
|
|
18952
19108
|
query: (searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.searchQuery) || '',
|
|
@@ -19519,16 +19675,31 @@ const getAnswerFromQuery = async (query, worksheetId) => {
|
|
|
19519
19675
|
};
|
|
19520
19676
|
|
|
19521
19677
|
/**
|
|
19522
|
-
*
|
|
19523
|
-
*
|
|
19524
|
-
*
|
|
19678
|
+
* Creates a new Liveboard in ThoughtSpot using the provided AnswerService instances.
|
|
19679
|
+
*
|
|
19680
|
+
* Each answer will be added as a visualization to the newly created Liveboard.
|
|
19681
|
+
*
|
|
19682
|
+
* @param {AnswerService[]} answers - An array of initialized `AnswerService` instances
|
|
19683
|
+
* representing the answers to be added to the Liveboard.
|
|
19684
|
+
* @param {string} name - The name of the Liveboard to create.
|
|
19525
19685
|
* @returns result Promise
|
|
19526
19686
|
* @version SDK: 1.33.1 | ThoughtSpot: *
|
|
19527
19687
|
* @example
|
|
19528
19688
|
* ```js
|
|
19529
|
-
*
|
|
19530
|
-
*
|
|
19531
|
-
*
|
|
19689
|
+
* import { EmbedEvent, AnswerService } from "@thoughtspot/visual-embed-sdk";
|
|
19690
|
+
*
|
|
19691
|
+
* embed.on(EmbedEvent.Data, async () => {
|
|
19692
|
+
* try {
|
|
19693
|
+
* const answerService = await embed.getAnswerService();
|
|
19694
|
+
* const lb = await createLiveboardWithAnswers(
|
|
19695
|
+
* [answerService],
|
|
19696
|
+
* "My Liveboard"
|
|
19697
|
+
* );
|
|
19698
|
+
* console.log("Liveboard created:", lb);
|
|
19699
|
+
* } catch (err) {
|
|
19700
|
+
* console.error("Failed to create liveboard:", err);
|
|
19701
|
+
* }
|
|
19702
|
+
* });
|
|
19532
19703
|
* ```
|
|
19533
19704
|
*/
|
|
19534
19705
|
const createLiveboardWithAnswers = async (answers, name) => {
|