@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.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 (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
@@ -1502,7 +1502,7 @@
|
|
|
1502
1502
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1503
1503
|
* @example
|
|
1504
1504
|
*```js
|
|
1505
|
-
* liveboardEmbed.on(EmbedEvent.
|
|
1505
|
+
* liveboardEmbed.on(EmbedEvent.LiveboardInfo, payload => {
|
|
1506
1506
|
* console.log('Liveboard details', payload);
|
|
1507
1507
|
* })
|
|
1508
1508
|
*```
|
|
@@ -1877,58 +1877,58 @@
|
|
|
1877
1877
|
*/
|
|
1878
1878
|
EmbedEvent["RequestVisibleEmbedCoordinates"] = "requestVisibleEmbedCoordinates";
|
|
1879
1879
|
/**
|
|
1880
|
-
* Emitted when
|
|
1880
|
+
* Emitted when Spotter response is text data
|
|
1881
1881
|
* @example
|
|
1882
1882
|
* ```js
|
|
1883
1883
|
* spotterEmbed.on(EmbedEvent.SpotterData, (payload) => {
|
|
1884
1884
|
* console.log('payload', payload);
|
|
1885
1885
|
* })
|
|
1886
1886
|
*```
|
|
1887
|
-
* @version SDK: 1.
|
|
1887
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1888
1888
|
*/
|
|
1889
1889
|
EmbedEvent["SpotterData"] = "SpotterData";
|
|
1890
1890
|
/**
|
|
1891
|
-
* Emitted when user opens up the worksheet preview modal in
|
|
1891
|
+
* Emitted when user opens up the worksheet preview modal in Spotter embed.
|
|
1892
1892
|
* @example
|
|
1893
1893
|
* ```js
|
|
1894
1894
|
* spotterEmbed.on(EmbedEvent.PreviewSpotterData, (payload) => {
|
|
1895
1895
|
* console.log('payload', payload);
|
|
1896
1896
|
* })
|
|
1897
1897
|
*```
|
|
1898
|
-
* @version SDK: 1.
|
|
1898
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1899
1899
|
*/
|
|
1900
1900
|
EmbedEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
1901
1901
|
/**
|
|
1902
|
-
* Emitted when the
|
|
1902
|
+
* Emitted when the Spotter query is triggered in Spotter embed.
|
|
1903
1903
|
* @example
|
|
1904
1904
|
* ```js
|
|
1905
1905
|
* spotterEmbed.on(EmbedEvent.SpotterQueryTriggered, (payload) => {
|
|
1906
1906
|
* console.log('payload', payload);
|
|
1907
1907
|
* })
|
|
1908
1908
|
*```
|
|
1909
|
-
* @version SDK: 1.
|
|
1909
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1910
1910
|
*/
|
|
1911
1911
|
EmbedEvent["SpotterQueryTriggered"] = "SpotterQueryTriggered";
|
|
1912
1912
|
/**
|
|
1913
|
-
* Emitted when the last
|
|
1913
|
+
* Emitted when the last Spotter query is edited in Spotter embed.
|
|
1914
1914
|
* @example
|
|
1915
1915
|
* ```js
|
|
1916
1916
|
* spotterEmbed.on(EmbedEvent.LastPromptEdited, (payload) => {
|
|
1917
1917
|
* console.log('payload', payload);
|
|
1918
1918
|
* })
|
|
1919
1919
|
*```
|
|
1920
|
-
* @version SDK: 1.
|
|
1920
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1921
1921
|
*/
|
|
1922
1922
|
EmbedEvent["LastPromptEdited"] = "LastPromptEdited";
|
|
1923
1923
|
/**
|
|
1924
|
-
* Emitted when the last
|
|
1924
|
+
* Emitted when the last Spotter query is deleted in Spotter embed.
|
|
1925
1925
|
* @example
|
|
1926
1926
|
* ```js
|
|
1927
1927
|
* spotterEmbed.on(EmbedEvent.LastPromptDeleted, (payload) => {
|
|
1928
1928
|
* console.log('payload', payload);
|
|
1929
1929
|
* })
|
|
1930
1930
|
*```
|
|
1931
|
-
* @version SDK: 1.
|
|
1931
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1932
1932
|
*/
|
|
1933
1933
|
EmbedEvent["LastPromptDeleted"] = "LastPromptDeleted";
|
|
1934
1934
|
/**
|
|
@@ -1939,7 +1939,7 @@
|
|
|
1939
1939
|
* console.log('payload', payload);
|
|
1940
1940
|
* })
|
|
1941
1941
|
*```
|
|
1942
|
-
* @version SDK: 1.
|
|
1942
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1943
1943
|
*/
|
|
1944
1944
|
EmbedEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
1945
1945
|
/**
|
|
@@ -1952,7 +1952,19 @@
|
|
|
1952
1952
|
*```
|
|
1953
1953
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1954
1954
|
*/
|
|
1955
|
-
EmbedEvent["SpotterInit"] = "
|
|
1955
|
+
EmbedEvent["SpotterInit"] = "spotterInit";
|
|
1956
|
+
/**
|
|
1957
|
+
* @hidden
|
|
1958
|
+
* Triggers when the embed listener is ready to receive events.
|
|
1959
|
+
* This is used to trigger events after the embed container is loaded.
|
|
1960
|
+
* @example
|
|
1961
|
+
* ```js
|
|
1962
|
+
* liveboardEmbed.on(EmbedEvent.EmbedListenerReady, () => {
|
|
1963
|
+
* console.log('EmbedListenerReady');
|
|
1964
|
+
* })
|
|
1965
|
+
* ```
|
|
1966
|
+
*/
|
|
1967
|
+
EmbedEvent["EmbedListenerReady"] = "EmbedListenerReady";
|
|
1956
1968
|
})(exports.EmbedEvent || (exports.EmbedEvent = {}));
|
|
1957
1969
|
/**
|
|
1958
1970
|
* Event types that can be triggered by the host application
|
|
@@ -2042,6 +2054,7 @@
|
|
|
2042
2054
|
* done automatically on the most popular column.
|
|
2043
2055
|
* @param - vizId [TS >= 9.8.0] - Optional. The GUID of the visualization to drill
|
|
2044
2056
|
* in case of a Liveboard.
|
|
2057
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2045
2058
|
* @example
|
|
2046
2059
|
* ```js
|
|
2047
2060
|
* searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
|
|
@@ -2361,12 +2374,21 @@
|
|
|
2361
2374
|
* Trigger the **Download PDF** action on an embedded Liveboard,
|
|
2362
2375
|
* visualization or Answer.
|
|
2363
2376
|
*
|
|
2377
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2378
|
+
*
|
|
2364
2379
|
* **NOTE**: The **Download** > **PDF** action is available on
|
|
2365
2380
|
* visualizations and Answers if the data is in tabular format.
|
|
2366
2381
|
* @example
|
|
2367
2382
|
* ```js
|
|
2368
2383
|
* liveboardEmbed.trigger(HostEvent.DownloadAsPdf)
|
|
2369
2384
|
* ```
|
|
2385
|
+
* @example
|
|
2386
|
+
* ```js
|
|
2387
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPdf, {
|
|
2388
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2389
|
+
* });
|
|
2390
|
+
* ```
|
|
2391
|
+
*
|
|
2370
2392
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2371
2393
|
*/
|
|
2372
2394
|
HostEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
@@ -2468,7 +2490,8 @@
|
|
|
2468
2490
|
* This event is not supported in visualization embed and search embed.
|
|
2469
2491
|
* @param - object - To trigger the action for a specific visualization
|
|
2470
2492
|
* in Liveboard embed, pass in `vizId` as a key.
|
|
2471
|
-
*
|
|
2493
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2494
|
+
*
|
|
2472
2495
|
* @example
|
|
2473
2496
|
* ```js
|
|
2474
2497
|
* liveboardEmbed.trigger(HostEvent.Edit)
|
|
@@ -2483,6 +2506,12 @@
|
|
|
2483
2506
|
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2484
2507
|
* });
|
|
2485
2508
|
* ```
|
|
2509
|
+
* @example
|
|
2510
|
+
* ```js
|
|
2511
|
+
* const editResponse = await spotterEmbed.trigger(HostEvent.Edit, {
|
|
2512
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2513
|
+
* });
|
|
2514
|
+
* ```
|
|
2486
2515
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2487
2516
|
*/
|
|
2488
2517
|
HostEvent["Edit"] = "edit";
|
|
@@ -2603,6 +2632,7 @@
|
|
|
2603
2632
|
/**
|
|
2604
2633
|
* Trigger the **Download** action on charts in
|
|
2605
2634
|
* the embedded view.
|
|
2635
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2606
2636
|
* @example
|
|
2607
2637
|
* ```js
|
|
2608
2638
|
* liveboardEmbed.trigger(HostEvent.Download, {vizId:
|
|
@@ -2611,6 +2641,11 @@
|
|
|
2611
2641
|
* ```js
|
|
2612
2642
|
* embed.trigger(HostEvent.Download)
|
|
2613
2643
|
* ```
|
|
2644
|
+
* ```js
|
|
2645
|
+
* spotterEmbed.trigger(HostEvent.Download, {
|
|
2646
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2647
|
+
* });
|
|
2648
|
+
* ```
|
|
2614
2649
|
* @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
|
|
2615
2650
|
* Use {@link DownloadAsPng}
|
|
2616
2651
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
@@ -2639,6 +2674,7 @@
|
|
|
2639
2674
|
/**
|
|
2640
2675
|
* Trigger the **Download** > **CSV** action on tables in
|
|
2641
2676
|
* the embedded view.
|
|
2677
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2642
2678
|
* @example
|
|
2643
2679
|
* ```js
|
|
2644
2680
|
* liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
|
|
@@ -2661,6 +2697,7 @@
|
|
|
2661
2697
|
/**
|
|
2662
2698
|
* Trigger the **Download** > **XLSX** action on tables
|
|
2663
2699
|
* in the embedded view.
|
|
2700
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2664
2701
|
* @example
|
|
2665
2702
|
* ```js
|
|
2666
2703
|
* liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
|
|
@@ -2696,7 +2733,7 @@
|
|
|
2696
2733
|
/**
|
|
2697
2734
|
* Trigger the **Save** action on a Liveboard or Answer.
|
|
2698
2735
|
* Saves the changes.
|
|
2699
|
-
* @param - `vizId` is required in Spotter
|
|
2736
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2700
2737
|
* @example
|
|
2701
2738
|
* ```js
|
|
2702
2739
|
* liveboardEmbed.trigger(HostEvent.Save)
|
|
@@ -3006,6 +3043,7 @@
|
|
|
3006
3043
|
HostEvent["UpdateParameters"] = "UpdateParameters";
|
|
3007
3044
|
/**
|
|
3008
3045
|
* Triggers GetParameters to fetch the runtime Parameters.
|
|
3046
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
3009
3047
|
* ```js
|
|
3010
3048
|
* liveboardEmbed.trigger(HostEvent.GetParameters).then((parameter) => {
|
|
3011
3049
|
* console.log('parameters', parameter);
|
|
@@ -3049,7 +3087,7 @@
|
|
|
3049
3087
|
* @param - optional attributes to set Answer properties.
|
|
3050
3088
|
* `name` - Name string for the Answer.
|
|
3051
3089
|
* `description` - Description text for the Answer.
|
|
3052
|
-
*
|
|
3090
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
3053
3091
|
* @example
|
|
3054
3092
|
* ```js
|
|
3055
3093
|
* const saveAnswerResponse = await searchEmbed.trigger(HostEvent.SaveAnswer, {
|
|
@@ -3057,6 +3095,14 @@
|
|
|
3057
3095
|
* description: "Total sales by states in MidWest"
|
|
3058
3096
|
* });
|
|
3059
3097
|
* ```
|
|
3098
|
+
* @example
|
|
3099
|
+
* ```js
|
|
3100
|
+
* const saveAnswerResponse = await spotterEmbed.trigger(HostEvent.SaveAnswer, {
|
|
3101
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c',
|
|
3102
|
+
* name: "Sales by states",
|
|
3103
|
+
* description: "Total sales by states in MidWest"
|
|
3104
|
+
* });
|
|
3105
|
+
* ```
|
|
3060
3106
|
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
3061
3107
|
*/
|
|
3062
3108
|
HostEvent["SaveAnswer"] = "saveAnswer";
|
|
@@ -3088,7 +3134,7 @@
|
|
|
3088
3134
|
/**
|
|
3089
3135
|
* Triggers a search operation with the search tokens specified in
|
|
3090
3136
|
* the search query string in spotter embed.
|
|
3091
|
-
* @param - `
|
|
3137
|
+
* @param - `query`: Text string in Natural Language format
|
|
3092
3138
|
* @param - `executeSearch`: Boolean to execute search and update search query
|
|
3093
3139
|
* @example
|
|
3094
3140
|
* ```js
|
|
@@ -3097,6 +3143,7 @@
|
|
|
3097
3143
|
* executeSearch: true,
|
|
3098
3144
|
* })
|
|
3099
3145
|
* ```
|
|
3146
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3100
3147
|
*/
|
|
3101
3148
|
HostEvent["SpotterSearch"] = "SpotterSearch";
|
|
3102
3149
|
/**
|
|
@@ -3106,6 +3153,7 @@
|
|
|
3106
3153
|
* ```js
|
|
3107
3154
|
* spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year");
|
|
3108
3155
|
* ```
|
|
3156
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3109
3157
|
*/
|
|
3110
3158
|
HostEvent["EditLastPrompt"] = "EditLastPrompt";
|
|
3111
3159
|
/**
|
|
@@ -3114,6 +3162,7 @@
|
|
|
3114
3162
|
* ```js
|
|
3115
3163
|
* spotterEmbed.trigger(HostEvent.PreviewSpotterData);
|
|
3116
3164
|
* ```
|
|
3165
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3117
3166
|
*/
|
|
3118
3167
|
HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
3119
3168
|
/**
|
|
@@ -3122,6 +3171,7 @@
|
|
|
3122
3171
|
* ```js
|
|
3123
3172
|
* spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
|
|
3124
3173
|
* ```
|
|
3174
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3125
3175
|
*/
|
|
3126
3176
|
HostEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
3127
3177
|
/**
|
|
@@ -3130,17 +3180,19 @@
|
|
|
3130
3180
|
* ```js
|
|
3131
3181
|
* spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
|
|
3132
3182
|
* ```
|
|
3183
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3133
3184
|
*/
|
|
3134
3185
|
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
3135
3186
|
/**
|
|
3136
3187
|
* Toggle the visualization to chart or table view.
|
|
3137
|
-
* @param - `vizId `
|
|
3188
|
+
* @param - `vizId ` refers to the answer id in spotter Embed, it is required in spotter Embed.
|
|
3138
3189
|
* @example
|
|
3139
3190
|
* ```js
|
|
3140
3191
|
* spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {
|
|
3141
|
-
* vizId:
|
|
3192
|
+
* vizId:'b535c760-8bbe-4e6f-bb26-af56b4129a1e'
|
|
3142
3193
|
* });
|
|
3143
3194
|
*```
|
|
3195
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3144
3196
|
*/
|
|
3145
3197
|
HostEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
|
|
3146
3198
|
/**
|
|
@@ -3167,15 +3219,16 @@
|
|
|
3167
3219
|
*/
|
|
3168
3220
|
HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
|
|
3169
3221
|
/**
|
|
3170
|
-
* Trigger the *Ask
|
|
3222
|
+
* Trigger the *Ask Spotter* action for visualizations
|
|
3223
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
3171
3224
|
* @example
|
|
3172
3225
|
* ```js
|
|
3173
|
-
*
|
|
3174
|
-
* {
|
|
3226
|
+
* spotterEmbed.trigger(HostEvent.AskSpotter,
|
|
3227
|
+
* {vizId:'730496d6-6903-4601-937e-2c691821af3c'})
|
|
3175
3228
|
* ```
|
|
3176
3229
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
3177
3230
|
*/
|
|
3178
|
-
HostEvent["AskSpotter"] = "
|
|
3231
|
+
HostEvent["AskSpotter"] = "AskSpotter";
|
|
3179
3232
|
/**
|
|
3180
3233
|
* @hidden
|
|
3181
3234
|
* Triggers the update of the embed params.
|
|
@@ -3485,27 +3538,27 @@
|
|
|
3485
3538
|
*/
|
|
3486
3539
|
Action["ConfigureFilter"] = "configureFilter";
|
|
3487
3540
|
/**
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3491
|
-
|
|
3492
|
-
|
|
3493
|
-
|
|
3494
|
-
|
|
3495
|
-
|
|
3496
|
-
|
|
3541
|
+
* The **Collapse data sources** icon on the Search page.
|
|
3542
|
+
* Collapses the panel showing data sources.
|
|
3543
|
+
*
|
|
3544
|
+
* @example
|
|
3545
|
+
* ```js
|
|
3546
|
+
* disabledActions: [Action.CollapseDataPanel]
|
|
3547
|
+
* ```
|
|
3548
|
+
* @version: SDK: 1.1.0 | ThoughtSpot Cloud: ts7.may.cl, 8.4.1.sw
|
|
3549
|
+
*/
|
|
3497
3550
|
Action["CollapseDataSources"] = "collapseDataSources";
|
|
3498
3551
|
/**
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3552
|
+
* The **Collapse data panel** icon on the Search page.
|
|
3553
|
+
* Collapses the data panel view.
|
|
3554
|
+
*
|
|
3555
|
+
* @version: SDK: 1.34.0 | ThoughtSpot Cloud: 10.3.0.cl
|
|
3556
|
+
*
|
|
3557
|
+
* @example
|
|
3558
|
+
* ```js
|
|
3559
|
+
* disabledActions: [Action.CollapseDataPanel]
|
|
3560
|
+
* ```
|
|
3561
|
+
*/
|
|
3509
3562
|
Action["CollapseDataPanel"] = "collapseDataPanel";
|
|
3510
3563
|
/**
|
|
3511
3564
|
* The **Choose sources** button on Search page.
|
|
@@ -4201,6 +4254,17 @@
|
|
|
4201
4254
|
* @version SDK: 1.25.0 | ThoughtSpot Cloud: 9.6.0.cl
|
|
4202
4255
|
*/
|
|
4203
4256
|
Action["EnableContextualChangeAnalysis"] = "enableContextualChangeAnalysis";
|
|
4257
|
+
/**
|
|
4258
|
+
* Action ID to hide or disable Iterative Change Analysis option
|
|
4259
|
+
* on contextual change analysis Inisght charts context menu
|
|
4260
|
+
*
|
|
4261
|
+
* @example
|
|
4262
|
+
* ```js
|
|
4263
|
+
* disabledActions: [Action.EnableIterativeChangeAnalysis]
|
|
4264
|
+
* ```
|
|
4265
|
+
* @version SDK: 1.41.0 | ThoughtSpot Cloud: 9.12.0.cl
|
|
4266
|
+
*/
|
|
4267
|
+
Action["EnableIterativeChangeAnalysis"] = "enableIterativeChangeAnalysis";
|
|
4204
4268
|
/**
|
|
4205
4269
|
* Action ID to hide or disable Natural Language Search query.
|
|
4206
4270
|
*
|
|
@@ -4570,6 +4634,39 @@
|
|
|
4570
4634
|
* @version SDK: 1.39.0 | ThoughtSpot Cloud: 10.10.0.cl
|
|
4571
4635
|
*/
|
|
4572
4636
|
Action["InConversationTraining"] = "InConversationTraining";
|
|
4637
|
+
/**
|
|
4638
|
+
* Action ID to hide the warnings banner in
|
|
4639
|
+
* Spotter results. It's an EA feature and
|
|
4640
|
+
* handled by LD.
|
|
4641
|
+
* @example
|
|
4642
|
+
* ```js
|
|
4643
|
+
* hiddenAction: [Action.SpotterWarningsBanner]
|
|
4644
|
+
* ```
|
|
4645
|
+
* @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl
|
|
4646
|
+
*/
|
|
4647
|
+
Action["SpotterWarningsBanner"] = "SpotterWarningsBanner";
|
|
4648
|
+
/**
|
|
4649
|
+
* Action ID to hide the warnings border on the knowledge
|
|
4650
|
+
* card in Spotter results. It's an EA feature and
|
|
4651
|
+
* handled by LD.
|
|
4652
|
+
* @example
|
|
4653
|
+
* ```js
|
|
4654
|
+
* hiddenAction: [Action.SpotterWarningsOnTokens]
|
|
4655
|
+
* ```
|
|
4656
|
+
* @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl
|
|
4657
|
+
*/
|
|
4658
|
+
Action["SpotterWarningsOnTokens"] = "SpotterWarningsOnTokens";
|
|
4659
|
+
/**
|
|
4660
|
+
* Action ID to disable the click event handler on knowledge
|
|
4661
|
+
* card in Spotter results. It's an EA feature and
|
|
4662
|
+
* handled by LD.
|
|
4663
|
+
* @example
|
|
4664
|
+
* ```js
|
|
4665
|
+
* hiddenAction: [Action.SpotterTokenQuickEdit]
|
|
4666
|
+
* ```
|
|
4667
|
+
* @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl
|
|
4668
|
+
*/
|
|
4669
|
+
Action["SpotterTokenQuickEdit"] = "SpotterTokenQuickEdit";
|
|
4573
4670
|
})(exports.Action || (exports.Action = {}));
|
|
4574
4671
|
exports.PrefetchFeatures = void 0;
|
|
4575
4672
|
(function (PrefetchFeatures) {
|
|
@@ -15827,7 +15924,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15827
15924
|
return e;
|
|
15828
15925
|
}
|
|
15829
15926
|
|
|
15830
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
15927
|
+
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$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | 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$1,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"32 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
|
|
15831
15928
|
|
|
15832
15929
|
/**
|
|
15833
15930
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -16053,7 +16150,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16053
16150
|
*/
|
|
16054
16151
|
this.fullscreenChangeHandler = null;
|
|
16055
16152
|
this.subscribedListeners = {};
|
|
16056
|
-
this.isEmbedContainerLoaded = false;
|
|
16057
16153
|
/**
|
|
16058
16154
|
* Send Custom style as part of payload of APP_INIT
|
|
16059
16155
|
* @param _
|
|
@@ -16125,20 +16221,49 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16125
16221
|
});
|
|
16126
16222
|
notifyAuthFailure(exports.AuthFailureType.IDLE_SESSION_TIMEOUT);
|
|
16127
16223
|
};
|
|
16128
|
-
this.pendingEvents = [];
|
|
16129
16224
|
/**
|
|
16130
16225
|
* Register APP_INIT event and sendback init payload
|
|
16131
16226
|
*/
|
|
16132
16227
|
this.registerAppInit = () => {
|
|
16133
16228
|
this.on(exports.EmbedEvent.APP_INIT, this.appInitCb, { start: false }, true);
|
|
16134
|
-
this.on(exports.EmbedEvent.AuthInit, () => {
|
|
16135
|
-
this.isEmbedContainerLoaded = true;
|
|
16136
|
-
this.executePendingEvents();
|
|
16137
|
-
}, { start: false }, true);
|
|
16138
16229
|
this.on(exports.EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
|
|
16139
16230
|
this.on(exports.EmbedEvent.IdleSessionTimeout, this.idleSessionTimeout, { start: false }, true);
|
|
16231
|
+
const embedListenerReadyHandler = this.createEmbedContainerHandler(exports.EmbedEvent.EmbedListenerReady);
|
|
16232
|
+
this.on(exports.EmbedEvent.EmbedListenerReady, embedListenerReadyHandler, { start: false }, true);
|
|
16233
|
+
const authInitHandler = this.createEmbedContainerHandler(exports.EmbedEvent.AuthInit);
|
|
16234
|
+
this.on(exports.EmbedEvent.AuthInit, authInitHandler, { start: false }, true);
|
|
16140
16235
|
};
|
|
16141
16236
|
this.showPreRenderByDefault = false;
|
|
16237
|
+
/**
|
|
16238
|
+
* @hidden
|
|
16239
|
+
* Internal state to track if the embed container is loaded.
|
|
16240
|
+
* This is used to trigger events after the embed container is loaded.
|
|
16241
|
+
*/
|
|
16242
|
+
this.isEmbedContainerLoaded = false;
|
|
16243
|
+
/**
|
|
16244
|
+
* @hidden
|
|
16245
|
+
* Internal state to track the callbacks to be executed after the embed container
|
|
16246
|
+
* is loaded.
|
|
16247
|
+
* This is used to trigger events after the embed container is loaded.
|
|
16248
|
+
*/
|
|
16249
|
+
this.embedContainerReadyCallbacks = [];
|
|
16250
|
+
this.createEmbedContainerHandler = (source) => () => {
|
|
16251
|
+
const processEmbedContainerReady = () => {
|
|
16252
|
+
logger$3.debug('processEmbedContainerReady');
|
|
16253
|
+
this.isEmbedContainerLoaded = true;
|
|
16254
|
+
this.executeEmbedContainerReadyCallbacks();
|
|
16255
|
+
};
|
|
16256
|
+
if (source === exports.EmbedEvent.AuthInit) {
|
|
16257
|
+
const AUTH_INIT_FALLBACK_DELAY = 1000;
|
|
16258
|
+
// Wait for 1 second to ensure the embed container is loaded
|
|
16259
|
+
// This is a workaround to ensure the embed container is loaded
|
|
16260
|
+
// this is needed until all clusters have EmbedListenerReady event
|
|
16261
|
+
setTimeout(processEmbedContainerReady, AUTH_INIT_FALLBACK_DELAY);
|
|
16262
|
+
}
|
|
16263
|
+
else if (source === exports.EmbedEvent.EmbedListenerReady) {
|
|
16264
|
+
processEmbedContainerReady();
|
|
16265
|
+
}
|
|
16266
|
+
};
|
|
16142
16267
|
this.validatePreRenderViewConfig = (viewConfig) => {
|
|
16143
16268
|
var _a;
|
|
16144
16269
|
const preRenderAllowedKeys = ['preRenderId', 'vizId', 'liveboardId'];
|
|
@@ -16160,7 +16285,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16160
16285
|
});
|
|
16161
16286
|
}
|
|
16162
16287
|
};
|
|
16163
|
-
this.id = Date.now().toString();
|
|
16164
16288
|
this.el = getDOMNode(domSelector);
|
|
16165
16289
|
this.eventHandlerMap = new Map();
|
|
16166
16290
|
this.isError = false;
|
|
@@ -16173,9 +16297,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16173
16297
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
16174
16298
|
...viewConfig,
|
|
16175
16299
|
});
|
|
16176
|
-
this.hostEventClient = new HostEventClient(this.iFrame);
|
|
16177
16300
|
const embedConfig = getEmbedConfig();
|
|
16178
16301
|
this.embedConfig = embedConfig;
|
|
16302
|
+
this.hostEventClient = new HostEventClient(this.iFrame);
|
|
16179
16303
|
this.isReadyForRenderPromise = getInitPromise().then(async () => {
|
|
16180
16304
|
if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
|
|
16181
16305
|
this.embedConfig.authTriggerContainer = domSelector;
|
|
@@ -16347,43 +16471,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16347
16471
|
async getAppInitData() {
|
|
16348
16472
|
return this.getDefaultAppInitData();
|
|
16349
16473
|
}
|
|
16350
|
-
getPreRenderObj() {
|
|
16351
|
-
var _a;
|
|
16352
|
-
const embedObj = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
|
|
16353
|
-
if (embedObj === this) {
|
|
16354
|
-
logger$3.info('embedObj is same as this');
|
|
16355
|
-
}
|
|
16356
|
-
return embedObj;
|
|
16357
|
-
}
|
|
16358
|
-
checkEmbedContainerLoaded() {
|
|
16359
|
-
if (this.isEmbedContainerLoaded)
|
|
16360
|
-
return true;
|
|
16361
|
-
const preRenderObj = this.getPreRenderObj();
|
|
16362
|
-
if (preRenderObj && preRenderObj.isEmbedContainerLoaded) {
|
|
16363
|
-
this.isEmbedContainerLoaded = true;
|
|
16364
|
-
}
|
|
16365
|
-
return this.isEmbedContainerLoaded;
|
|
16366
|
-
}
|
|
16367
|
-
executePendingEvents() {
|
|
16368
|
-
logger$3.debug('executePendingEvents', this.pendingEvents);
|
|
16369
|
-
setTimeout(() => {
|
|
16370
|
-
this.pendingEvents.forEach((event) => {
|
|
16371
|
-
var _a;
|
|
16372
|
-
this.trigger(event.eventType, event.data);
|
|
16373
|
-
(_a = event.onEventTriggered) === null || _a === void 0 ? void 0 : _a.call(event);
|
|
16374
|
-
});
|
|
16375
|
-
this.pendingEvents = [];
|
|
16376
|
-
}, 1000);
|
|
16377
|
-
}
|
|
16378
|
-
triggerAfterLoad(eventType, data, onEventTriggered) {
|
|
16379
|
-
if (this.checkEmbedContainerLoaded()) {
|
|
16380
|
-
this.trigger(eventType, data);
|
|
16381
|
-
onEventTriggered === null || onEventTriggered === void 0 ? void 0 : onEventTriggered();
|
|
16382
|
-
}
|
|
16383
|
-
else {
|
|
16384
|
-
this.pendingEvents.push({ eventType, data, onEventTriggered });
|
|
16385
|
-
}
|
|
16386
|
-
}
|
|
16387
16474
|
/**
|
|
16388
16475
|
* Constructs the base URL string to load the ThoughtSpot app.
|
|
16389
16476
|
* @param query
|
|
@@ -16938,6 +17025,43 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16938
17025
|
logger$3.log('Event Port is not defined');
|
|
16939
17026
|
}
|
|
16940
17027
|
}
|
|
17028
|
+
getPreRenderObj() {
|
|
17029
|
+
var _a;
|
|
17030
|
+
const embedObj = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
|
|
17031
|
+
if (embedObj === this) {
|
|
17032
|
+
logger$3.info('embedObj is same as this');
|
|
17033
|
+
}
|
|
17034
|
+
return embedObj;
|
|
17035
|
+
}
|
|
17036
|
+
checkEmbedContainerLoaded() {
|
|
17037
|
+
if (this.isEmbedContainerLoaded)
|
|
17038
|
+
return true;
|
|
17039
|
+
const preRenderObj = this.getPreRenderObj();
|
|
17040
|
+
if (preRenderObj && preRenderObj.isEmbedContainerLoaded) {
|
|
17041
|
+
this.isEmbedContainerLoaded = true;
|
|
17042
|
+
}
|
|
17043
|
+
return this.isEmbedContainerLoaded;
|
|
17044
|
+
}
|
|
17045
|
+
executeEmbedContainerReadyCallbacks() {
|
|
17046
|
+
logger$3.debug('executePendingEvents', this.embedContainerReadyCallbacks);
|
|
17047
|
+
this.embedContainerReadyCallbacks.forEach((callback) => {
|
|
17048
|
+
callback === null || callback === void 0 ? void 0 : callback();
|
|
17049
|
+
});
|
|
17050
|
+
this.embedContainerReadyCallbacks = [];
|
|
17051
|
+
}
|
|
17052
|
+
/**
|
|
17053
|
+
* Executes a callback after the embed container is loaded.
|
|
17054
|
+
* @param callback The callback to execute
|
|
17055
|
+
*/
|
|
17056
|
+
executeAfterEmbedContainerLoaded(callback) {
|
|
17057
|
+
if (this.checkEmbedContainerLoaded()) {
|
|
17058
|
+
callback === null || callback === void 0 ? void 0 : callback();
|
|
17059
|
+
}
|
|
17060
|
+
else {
|
|
17061
|
+
logger$3.debug('pushing callback to embedContainerReadyCallbacks', callback);
|
|
17062
|
+
this.embedContainerReadyCallbacks.push(callback);
|
|
17063
|
+
}
|
|
17064
|
+
}
|
|
16941
17065
|
/**
|
|
16942
17066
|
* Triggers an event to the embedded app
|
|
16943
17067
|
* @param {HostEvent} messageType The event type
|
|
@@ -17083,7 +17207,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17083
17207
|
}
|
|
17084
17208
|
this.validatePreRenderViewConfig(this.viewConfig);
|
|
17085
17209
|
logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
|
|
17086
|
-
this.
|
|
17210
|
+
this.executeAfterEmbedContainerLoaded(() => {
|
|
17211
|
+
this.trigger(exports.HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
|
|
17212
|
+
});
|
|
17087
17213
|
}
|
|
17088
17214
|
this.beforePrerenderVisible();
|
|
17089
17215
|
if (this.el) {
|
|
@@ -17540,10 +17666,18 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17540
17666
|
else {
|
|
17541
17667
|
params[Param.DataPanelCustomGroupsAccordionInitialState] = exports.DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
|
|
17542
17668
|
}
|
|
17669
|
+
// Set navigation to v2 by default to avoid problems like the app
|
|
17670
|
+
// switcher (9-dot menu) not showing when v3 navigation is turned on
|
|
17671
|
+
// at the cluster level.
|
|
17672
|
+
// To use v3 navigation, we must manually set the discoveryExperience
|
|
17673
|
+
// settings.
|
|
17674
|
+
params[Param.NavigationVersion] = 'v2';
|
|
17543
17675
|
if (discoveryExperience) {
|
|
17544
17676
|
// primaryNavbarVersion v3 will enabled the new left navigation
|
|
17545
17677
|
if (discoveryExperience.primaryNavbarVersion === exports.PrimaryNavbarVersion.Sliding) {
|
|
17546
17678
|
params[Param.NavigationVersion] = discoveryExperience.primaryNavbarVersion;
|
|
17679
|
+
// Enable the modularHomeExperience when Sliding is enabled.
|
|
17680
|
+
params[Param.ModularHomeExperienceEnabled] = true;
|
|
17547
17681
|
}
|
|
17548
17682
|
// homePage v2 will enable the modular home page
|
|
17549
17683
|
// and it will override the modularHomeExperience value
|
|
@@ -17827,7 +17961,16 @@ query GetEurekaVizSnapshots(
|
|
|
17827
17961
|
}
|
|
17828
17962
|
this.setIFrameHeight(frameHeight || this.defaultHeight);
|
|
17829
17963
|
};
|
|
17830
|
-
|
|
17964
|
+
/**
|
|
17965
|
+
* @hidden
|
|
17966
|
+
* Internal state to track the current liveboard id.
|
|
17967
|
+
* This is used to navigate to the correct liveboard when the prerender is visible.
|
|
17968
|
+
*/
|
|
17969
|
+
this.currentLiveboardState = {
|
|
17970
|
+
liveboardId: this.viewConfig.liveboardId,
|
|
17971
|
+
vizId: this.viewConfig.vizId,
|
|
17972
|
+
activeTabId: this.viewConfig.activeTabId,
|
|
17973
|
+
};
|
|
17831
17974
|
if (this.viewConfig.fullHeight === true) {
|
|
17832
17975
|
if (this.viewConfig.vizId) {
|
|
17833
17976
|
logger$3.warn('Full height is currently only supported for Liveboard embeds.' +
|
|
@@ -18001,10 +18144,15 @@ query GetEurekaVizSnapshots(
|
|
|
18001
18144
|
}
|
|
18002
18145
|
beforePrerenderVisible() {
|
|
18003
18146
|
const embedObj = this.getPreRenderObj();
|
|
18004
|
-
|
|
18005
|
-
|
|
18006
|
-
if (embedObj)
|
|
18007
|
-
embedObj.
|
|
18147
|
+
this.executeAfterEmbedContainerLoaded(() => {
|
|
18148
|
+
this.navigateToLiveboard(this.viewConfig.liveboardId, this.viewConfig.vizId, this.viewConfig.activeTabId);
|
|
18149
|
+
if (embedObj) {
|
|
18150
|
+
embedObj.currentLiveboardState = {
|
|
18151
|
+
liveboardId: this.viewConfig.liveboardId,
|
|
18152
|
+
vizId: this.viewConfig.vizId,
|
|
18153
|
+
activeTabId: this.viewConfig.activeTabId,
|
|
18154
|
+
};
|
|
18155
|
+
}
|
|
18008
18156
|
});
|
|
18009
18157
|
}
|
|
18010
18158
|
async handleRenderForPrerender() {
|
|
@@ -18067,13 +18215,13 @@ query GetEurekaVizSnapshots(
|
|
|
18067
18215
|
this.postRender();
|
|
18068
18216
|
return this;
|
|
18069
18217
|
}
|
|
18070
|
-
navigateToLiveboard(liveboardId, vizId, activeTabId
|
|
18218
|
+
navigateToLiveboard(liveboardId, vizId, activeTabId) {
|
|
18071
18219
|
const path = this.getIframeSuffixSrc(liveboardId, vizId, activeTabId);
|
|
18072
18220
|
this.viewConfig.liveboardId = liveboardId;
|
|
18073
18221
|
this.viewConfig.activeTabId = activeTabId;
|
|
18074
18222
|
this.viewConfig.vizId = vizId;
|
|
18075
18223
|
if (this.isRendered) {
|
|
18076
|
-
this.
|
|
18224
|
+
this.trigger(exports.HostEvent.Navigate, path.substring(1));
|
|
18077
18225
|
}
|
|
18078
18226
|
else if (this.viewConfig.preRenderId) {
|
|
18079
18227
|
this.preRender(true);
|
|
@@ -18921,7 +19069,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18921
19069
|
this.viewConfig = viewConfig;
|
|
18922
19070
|
}
|
|
18923
19071
|
getEmbedParamsObject() {
|
|
18924
|
-
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, } = this.viewConfig;
|
|
19072
|
+
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
18925
19073
|
if (!worksheetId) {
|
|
18926
19074
|
this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
|
|
18927
19075
|
}
|
|
@@ -18945,7 +19093,7 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18945
19093
|
return queryParams;
|
|
18946
19094
|
}
|
|
18947
19095
|
getIframeSrc() {
|
|
18948
|
-
const { worksheetId, searchOptions, } = this.viewConfig;
|
|
19096
|
+
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
18949
19097
|
const path = 'insights/conv-assist';
|
|
18950
19098
|
const queryParams = this.getEmbedParamsObject();
|
|
18951
19099
|
let query = '';
|
|
@@ -18953,6 +19101,14 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18953
19101
|
if (queryParamsString) {
|
|
18954
19102
|
query = `?${queryParamsString}`;
|
|
18955
19103
|
}
|
|
19104
|
+
const filterQuery = getFilterQuery(runtimeFilters || []);
|
|
19105
|
+
if (filterQuery && !excludeRuntimeFiltersfromURL) {
|
|
19106
|
+
query += `&${filterQuery}`;
|
|
19107
|
+
}
|
|
19108
|
+
const parameterQuery = getRuntimeParameters(runtimeParameters || []);
|
|
19109
|
+
if (parameterQuery && !excludeRuntimeParametersfromURL) {
|
|
19110
|
+
query += `&${parameterQuery}`;
|
|
19111
|
+
}
|
|
18956
19112
|
const tsPostHashParams = this.getThoughtSpotPostUrlParams({
|
|
18957
19113
|
worksheet: worksheetId,
|
|
18958
19114
|
query: (searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.searchQuery) || '',
|
|
@@ -19525,16 +19681,31 @@ query GetEurekaResults($params: Input_eureka_SearchRequest) {
|
|
|
19525
19681
|
};
|
|
19526
19682
|
|
|
19527
19683
|
/**
|
|
19528
|
-
*
|
|
19529
|
-
*
|
|
19530
|
-
*
|
|
19684
|
+
* Creates a new Liveboard in ThoughtSpot using the provided AnswerService instances.
|
|
19685
|
+
*
|
|
19686
|
+
* Each answer will be added as a visualization to the newly created Liveboard.
|
|
19687
|
+
*
|
|
19688
|
+
* @param {AnswerService[]} answers - An array of initialized `AnswerService` instances
|
|
19689
|
+
* representing the answers to be added to the Liveboard.
|
|
19690
|
+
* @param {string} name - The name of the Liveboard to create.
|
|
19531
19691
|
* @returns result Promise
|
|
19532
19692
|
* @version SDK: 1.33.1 | ThoughtSpot: *
|
|
19533
19693
|
* @example
|
|
19534
19694
|
* ```js
|
|
19535
|
-
*
|
|
19536
|
-
*
|
|
19537
|
-
*
|
|
19695
|
+
* import { EmbedEvent, AnswerService } from "@thoughtspot/visual-embed-sdk";
|
|
19696
|
+
*
|
|
19697
|
+
* embed.on(EmbedEvent.Data, async () => {
|
|
19698
|
+
* try {
|
|
19699
|
+
* const answerService = await embed.getAnswerService();
|
|
19700
|
+
* const lb = await createLiveboardWithAnswers(
|
|
19701
|
+
* [answerService],
|
|
19702
|
+
* "My Liveboard"
|
|
19703
|
+
* );
|
|
19704
|
+
* console.log("Liveboard created:", lb);
|
|
19705
|
+
* } catch (err) {
|
|
19706
|
+
* console.error("Failed to create liveboard:", err);
|
|
19707
|
+
* }
|
|
19708
|
+
* });
|
|
19538
19709
|
* ```
|
|
19539
19710
|
*/
|
|
19540
19711
|
const createLiveboardWithAnswers = async (answers, name) => {
|