@thoughtspot/visual-embed-sdk 1.40.1-alpha.1 → 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 +1 -0
- package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js +7 -3
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/conversation.d.ts +64 -2
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +16 -3
- 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 +12 -2
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +48 -18
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +211 -5
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/embed/sage.d.ts +1 -0
- package/cjs/src/embed/sage.d.ts.map +1 -1
- package/cjs/src/embed/sage.js +10 -6
- package/cjs/src/embed/sage.js.map +1 -1
- package/cjs/src/embed/search-bar.d.ts +1 -0
- package/cjs/src/embed/search-bar.d.ts.map +1 -1
- package/cjs/src/embed/search-bar.js +11 -7
- package/cjs/src/embed/search-bar.js.map +1 -1
- package/cjs/src/embed/search.d.ts +1 -0
- package/cjs/src/embed/search.d.ts.map +1 -1
- package/cjs/src/embed/search.js +7 -8
- package/cjs/src/embed/search.js.map +1 -1
- package/cjs/src/embed/ts-embed.d.ts +24 -7
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +87 -57
- 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/index-k7pkZMhx.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 +5 -0
- package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/dist/src/embed/conversation.d.ts +64 -2
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +11 -0
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/embed/sage.d.ts +1 -0
- package/dist/src/embed/sage.d.ts.map +1 -1
- package/dist/src/embed/search-bar.d.ts +1 -0
- package/dist/src/embed/search-bar.d.ts.map +1 -1
- package/dist/src/embed/search.d.ts +1 -0
- package/dist/src/embed/search.d.ts.map +1 -1
- package/dist/src/embed/ts-embed.d.ts +24 -0
- package/dist/src/embed/ts-embed.d.ts.map +1 -1
- package/dist/src/react/index.d.ts +2 -0
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +351 -30
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/graphql/nlsService/conversation-service.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 +551 -80
- package/dist/tsembed-react.js +550 -79
- package/dist/tsembed.es.js +572 -86
- package/dist/tsembed.js +571 -85
- package/dist/visual-embed-sdk-react-full.d.ts +787 -37
- package/dist/visual-embed-sdk-react.d.ts +787 -37
- package/dist/visual-embed-sdk.d.ts +785 -37
- 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 +1 -0
- package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/lib/src/embed/bodyless-conversation.js +7 -3
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/conversation.d.ts +64 -2
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +17 -4
- 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 +12 -2
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +48 -18
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +211 -5
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/embed/sage.d.ts +1 -0
- package/lib/src/embed/sage.d.ts.map +1 -1
- package/lib/src/embed/sage.js +10 -6
- package/lib/src/embed/sage.js.map +1 -1
- package/lib/src/embed/search-bar.d.ts +1 -0
- package/lib/src/embed/search-bar.d.ts.map +1 -1
- package/lib/src/embed/search-bar.js +11 -7
- package/lib/src/embed/search-bar.js.map +1 -1
- package/lib/src/embed/search.d.ts +1 -0
- package/lib/src/embed/search.d.ts.map +1 -1
- package/lib/src/embed/search.js +7 -8
- package/lib/src/embed/search.js.map +1 -1
- package/lib/src/embed/ts-embed.d.ts +24 -7
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +87 -57
- 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 +786 -38
- package/package.json +6 -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 +8 -3
- package/src/embed/conversation.spec.ts +131 -5
- package/src/embed/conversation.ts +102 -12
- package/src/embed/liveboard.spec.ts +264 -5
- package/src/embed/liveboard.ts +55 -20
- package/src/embed/sage.ts +12 -7
- package/src/embed/search-bar.tsx +14 -7
- package/src/embed/search.ts +18 -7
- package/src/embed/ts-embed.spec.ts +345 -113
- package/src/embed/ts-embed.ts +97 -67
- 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
|
*```
|
|
@@ -1870,6 +1870,95 @@ var EmbedEvent;
|
|
|
1870
1870
|
* @hidden
|
|
1871
1871
|
*/
|
|
1872
1872
|
EmbedEvent["RequestVisibleEmbedCoordinates"] = "requestVisibleEmbedCoordinates";
|
|
1873
|
+
/**
|
|
1874
|
+
* Emitted when Spotter response is text data
|
|
1875
|
+
* @example
|
|
1876
|
+
* ```js
|
|
1877
|
+
* spotterEmbed.on(EmbedEvent.SpotterData, (payload) => {
|
|
1878
|
+
* console.log('payload', payload);
|
|
1879
|
+
* })
|
|
1880
|
+
*```
|
|
1881
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1882
|
+
*/
|
|
1883
|
+
EmbedEvent["SpotterData"] = "SpotterData";
|
|
1884
|
+
/**
|
|
1885
|
+
* Emitted when user opens up the worksheet preview modal in Spotter embed.
|
|
1886
|
+
* @example
|
|
1887
|
+
* ```js
|
|
1888
|
+
* spotterEmbed.on(EmbedEvent.PreviewSpotterData, (payload) => {
|
|
1889
|
+
* console.log('payload', payload);
|
|
1890
|
+
* })
|
|
1891
|
+
*```
|
|
1892
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1893
|
+
*/
|
|
1894
|
+
EmbedEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
1895
|
+
/**
|
|
1896
|
+
* Emitted when the Spotter query is triggered in Spotter embed.
|
|
1897
|
+
* @example
|
|
1898
|
+
* ```js
|
|
1899
|
+
* spotterEmbed.on(EmbedEvent.SpotterQueryTriggered, (payload) => {
|
|
1900
|
+
* console.log('payload', payload);
|
|
1901
|
+
* })
|
|
1902
|
+
*```
|
|
1903
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1904
|
+
*/
|
|
1905
|
+
EmbedEvent["SpotterQueryTriggered"] = "SpotterQueryTriggered";
|
|
1906
|
+
/**
|
|
1907
|
+
* Emitted when the last Spotter query is edited in Spotter embed.
|
|
1908
|
+
* @example
|
|
1909
|
+
* ```js
|
|
1910
|
+
* spotterEmbed.on(EmbedEvent.LastPromptEdited, (payload) => {
|
|
1911
|
+
* console.log('payload', payload);
|
|
1912
|
+
* })
|
|
1913
|
+
*```
|
|
1914
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1915
|
+
*/
|
|
1916
|
+
EmbedEvent["LastPromptEdited"] = "LastPromptEdited";
|
|
1917
|
+
/**
|
|
1918
|
+
* Emitted when the last Spotter query is deleted in Spotter embed.
|
|
1919
|
+
* @example
|
|
1920
|
+
* ```js
|
|
1921
|
+
* spotterEmbed.on(EmbedEvent.LastPromptDeleted, (payload) => {
|
|
1922
|
+
* console.log('payload', payload);
|
|
1923
|
+
* })
|
|
1924
|
+
*```
|
|
1925
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1926
|
+
*/
|
|
1927
|
+
EmbedEvent["LastPromptDeleted"] = "LastPromptDeleted";
|
|
1928
|
+
/**
|
|
1929
|
+
* Emitted when the coversation is reset in spotter embed.
|
|
1930
|
+
* @example
|
|
1931
|
+
* ```js
|
|
1932
|
+
* spotterEmbed.on(EmbedEvent.ResetSpotterConversation, (payload) => {
|
|
1933
|
+
* console.log('payload', payload);
|
|
1934
|
+
* })
|
|
1935
|
+
*```
|
|
1936
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1937
|
+
*/
|
|
1938
|
+
EmbedEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
1939
|
+
/**
|
|
1940
|
+
* Emitted when the *Spotter* is initialized.
|
|
1941
|
+
* @example
|
|
1942
|
+
* ```js
|
|
1943
|
+
* spotterEmbed.on(EmbedEvent.SpotterInit, (payload) => {
|
|
1944
|
+
* console.log('payload', payload);
|
|
1945
|
+
* })
|
|
1946
|
+
*```
|
|
1947
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1948
|
+
*/
|
|
1949
|
+
EmbedEvent["SpotterInit"] = "spotterInit";
|
|
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";
|
|
1873
1962
|
})(EmbedEvent || (EmbedEvent = {}));
|
|
1874
1963
|
/**
|
|
1875
1964
|
* Event types that can be triggered by the host application
|
|
@@ -1887,7 +1976,7 @@ var EmbedEvent;
|
|
|
1887
1976
|
* // create the liveboard embed.
|
|
1888
1977
|
*
|
|
1889
1978
|
* liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
|
|
1890
|
-
* { columnName: 'state, operator: RuntimeFilterOp.EQ, values: [
|
|
1979
|
+
* { columnName: 'state', operator: RuntimeFilterOp.EQ, values: ["california"]}
|
|
1891
1980
|
* ]);
|
|
1892
1981
|
* ```
|
|
1893
1982
|
* @example
|
|
@@ -1959,6 +2048,7 @@ var HostEvent;
|
|
|
1959
2048
|
* done automatically on the most popular column.
|
|
1960
2049
|
* @param - vizId [TS >= 9.8.0] - Optional. The GUID of the visualization to drill
|
|
1961
2050
|
* in case of a Liveboard.
|
|
2051
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
1962
2052
|
* @example
|
|
1963
2053
|
* ```js
|
|
1964
2054
|
* searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
|
|
@@ -2097,12 +2187,12 @@ var HostEvent;
|
|
|
2097
2187
|
* Works with Search and Liveboard embed.
|
|
2098
2188
|
* @param - { columnId: string,
|
|
2099
2189
|
* name: string,
|
|
2100
|
-
* type:
|
|
2101
|
-
* dataType:
|
|
2190
|
+
* type: ATTRIBUTE/MEASURE,
|
|
2191
|
+
* dataType: INT64/CHAR/DATE }
|
|
2102
2192
|
* @example
|
|
2103
2193
|
* ```js
|
|
2104
2194
|
* searchEmbed.trigger(HostEvent.OpenFilter,
|
|
2105
|
-
* {column: { columnId: '<column-GUID>', name: 'column name', type: '
|
|
2195
|
+
* {column: { columnId: '<column-GUID>', name: 'column name', type: 'ATTRIBUTE', dataType: 'INT64'}})
|
|
2106
2196
|
* ```
|
|
2107
2197
|
* @example
|
|
2108
2198
|
* ```js
|
|
@@ -2160,6 +2250,7 @@ var HostEvent;
|
|
|
2160
2250
|
* @param
|
|
2161
2251
|
* `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
|
|
2162
2252
|
* Optional when pinning a new chart or table generated from a Search query.
|
|
2253
|
+
* **Required** in Spotter Embed.
|
|
2163
2254
|
* @param
|
|
2164
2255
|
* `liveboardID` - GUID of the Liveboard to pin an Answer. If there is no Liveboard,
|
|
2165
2256
|
* specify the `newLiveboardName` parameter to create a new Liveboard.
|
|
@@ -2207,6 +2298,12 @@ var HostEvent;
|
|
|
2207
2298
|
* ```js
|
|
2208
2299
|
* appEmbed.trigger(HostEvent.Pin)
|
|
2209
2300
|
* ```
|
|
2301
|
+
* @example
|
|
2302
|
+
* ```js
|
|
2303
|
+
* const pinResponse = await spotterEmbed.trigger(HostEvent.Pin, {
|
|
2304
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2305
|
+
* });
|
|
2306
|
+
* ```
|
|
2210
2307
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2211
2308
|
*/
|
|
2212
2309
|
HostEvent["Pin"] = "pin";
|
|
@@ -2271,12 +2368,21 @@ var HostEvent;
|
|
|
2271
2368
|
* Trigger the **Download PDF** action on an embedded Liveboard,
|
|
2272
2369
|
* visualization or Answer.
|
|
2273
2370
|
*
|
|
2371
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2372
|
+
*
|
|
2274
2373
|
* **NOTE**: The **Download** > **PDF** action is available on
|
|
2275
2374
|
* visualizations and Answers if the data is in tabular format.
|
|
2276
2375
|
* @example
|
|
2277
2376
|
* ```js
|
|
2278
2377
|
* liveboardEmbed.trigger(HostEvent.DownloadAsPdf)
|
|
2279
2378
|
* ```
|
|
2379
|
+
* @example
|
|
2380
|
+
* ```js
|
|
2381
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPdf, {
|
|
2382
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2383
|
+
* });
|
|
2384
|
+
* ```
|
|
2385
|
+
*
|
|
2280
2386
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2281
2387
|
*/
|
|
2282
2388
|
HostEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
@@ -2300,6 +2406,12 @@ var HostEvent;
|
|
|
2300
2406
|
* ```js
|
|
2301
2407
|
* searchEmbed.trigger(HostEvent.MakeACopy)
|
|
2302
2408
|
* ```
|
|
2409
|
+
* @example
|
|
2410
|
+
* ```js
|
|
2411
|
+
* const pinResponse = await spotterEmbed.trigger(HostEvent.MakeACopy, {
|
|
2412
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2413
|
+
* });
|
|
2414
|
+
* ```
|
|
2303
2415
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2304
2416
|
*/
|
|
2305
2417
|
HostEvent["MakeACopy"] = "makeACopy";
|
|
@@ -2372,6 +2484,8 @@ var HostEvent;
|
|
|
2372
2484
|
* This event is not supported in visualization embed and search embed.
|
|
2373
2485
|
* @param - object - To trigger the action for a specific visualization
|
|
2374
2486
|
* in Liveboard embed, pass in `vizId` as a key.
|
|
2487
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2488
|
+
*
|
|
2375
2489
|
* @example
|
|
2376
2490
|
* ```js
|
|
2377
2491
|
* liveboardEmbed.trigger(HostEvent.Edit)
|
|
@@ -2380,6 +2494,18 @@ var HostEvent;
|
|
|
2380
2494
|
* liveboardEmbed.trigger(HostEvent.Edit, {vizId:
|
|
2381
2495
|
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
2382
2496
|
* ```
|
|
2497
|
+
* @example
|
|
2498
|
+
* ```js
|
|
2499
|
+
* const pinResponse = await spotterEmbed.trigger(HostEvent.Edit, {
|
|
2500
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2501
|
+
* });
|
|
2502
|
+
* ```
|
|
2503
|
+
* @example
|
|
2504
|
+
* ```js
|
|
2505
|
+
* const editResponse = await spotterEmbed.trigger(HostEvent.Edit, {
|
|
2506
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2507
|
+
* });
|
|
2508
|
+
* ```
|
|
2383
2509
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2384
2510
|
*/
|
|
2385
2511
|
HostEvent["Edit"] = "edit";
|
|
@@ -2427,6 +2553,16 @@ var HostEvent;
|
|
|
2427
2553
|
* );
|
|
2428
2554
|
* })
|
|
2429
2555
|
* ```
|
|
2556
|
+
* @example
|
|
2557
|
+
* ```js
|
|
2558
|
+
* spotterEmbed.trigger(HostEvent.GetTML, {
|
|
2559
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2560
|
+
* }).then((tml) => {
|
|
2561
|
+
* console.log(
|
|
2562
|
+
* tml.answer.search_query // TML representation of the search query
|
|
2563
|
+
* );
|
|
2564
|
+
* })
|
|
2565
|
+
* ```
|
|
2430
2566
|
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
|
|
2431
2567
|
* @important
|
|
2432
2568
|
*/
|
|
@@ -2490,6 +2626,7 @@ var HostEvent;
|
|
|
2490
2626
|
/**
|
|
2491
2627
|
* Trigger the **Download** action on charts in
|
|
2492
2628
|
* the embedded view.
|
|
2629
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2493
2630
|
* @example
|
|
2494
2631
|
* ```js
|
|
2495
2632
|
* liveboardEmbed.trigger(HostEvent.Download, {vizId:
|
|
@@ -2498,6 +2635,11 @@ var HostEvent;
|
|
|
2498
2635
|
* ```js
|
|
2499
2636
|
* embed.trigger(HostEvent.Download)
|
|
2500
2637
|
* ```
|
|
2638
|
+
* ```js
|
|
2639
|
+
* spotterEmbed.trigger(HostEvent.Download, {
|
|
2640
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2641
|
+
* });
|
|
2642
|
+
* ```
|
|
2501
2643
|
* @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
|
|
2502
2644
|
* Use {@link DownloadAsPng}
|
|
2503
2645
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
@@ -2514,13 +2656,19 @@ var HostEvent;
|
|
|
2514
2656
|
* vizEmbed.trigger(HostEvent.DownloadAsPng)
|
|
2515
2657
|
*
|
|
2516
2658
|
* searchEmbed.trigger(HostEvent.DownloadAsPng)
|
|
2659
|
+
*
|
|
2660
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPng, {
|
|
2661
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2662
|
+
* })
|
|
2517
2663
|
* ```
|
|
2664
|
+
*
|
|
2518
2665
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
|
|
2519
2666
|
*/
|
|
2520
2667
|
HostEvent["DownloadAsPng"] = "downloadAsPng";
|
|
2521
2668
|
/**
|
|
2522
2669
|
* Trigger the **Download** > **CSV** action on tables in
|
|
2523
2670
|
* the embedded view.
|
|
2671
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2524
2672
|
* @example
|
|
2525
2673
|
* ```js
|
|
2526
2674
|
* liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
|
|
@@ -2532,12 +2680,18 @@ var HostEvent;
|
|
|
2532
2680
|
* ```js
|
|
2533
2681
|
* searchEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
2534
2682
|
* ```
|
|
2683
|
+
* ```js
|
|
2684
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsCsv, {
|
|
2685
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2686
|
+
* })
|
|
2687
|
+
* ```
|
|
2535
2688
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2536
2689
|
*/
|
|
2537
2690
|
HostEvent["DownloadAsCsv"] = "downloadAsCSV";
|
|
2538
2691
|
/**
|
|
2539
2692
|
* Trigger the **Download** > **XLSX** action on tables
|
|
2540
2693
|
* in the embedded view.
|
|
2694
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2541
2695
|
* @example
|
|
2542
2696
|
* ```js
|
|
2543
2697
|
* liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
|
|
@@ -2549,6 +2703,11 @@ var HostEvent;
|
|
|
2549
2703
|
* ```js
|
|
2550
2704
|
* searchEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
2551
2705
|
* ```
|
|
2706
|
+
* ```js
|
|
2707
|
+
* spotterEmbed.trigger(HostEvent.downloadAsXLSX, {
|
|
2708
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2709
|
+
* })
|
|
2710
|
+
* ```
|
|
2552
2711
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2553
2712
|
*/
|
|
2554
2713
|
HostEvent["DownloadAsXlsx"] = "downloadAsXLSX";
|
|
@@ -2568,6 +2727,7 @@ var HostEvent;
|
|
|
2568
2727
|
/**
|
|
2569
2728
|
* Trigger the **Save** action on a Liveboard or Answer.
|
|
2570
2729
|
* Saves the changes.
|
|
2730
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2571
2731
|
* @example
|
|
2572
2732
|
* ```js
|
|
2573
2733
|
* liveboardEmbed.trigger(HostEvent.Save)
|
|
@@ -2575,6 +2735,11 @@ var HostEvent;
|
|
|
2575
2735
|
* ```js
|
|
2576
2736
|
* searchEmbed.trigger(HostEvent.Save)
|
|
2577
2737
|
* ```
|
|
2738
|
+
* ```js
|
|
2739
|
+
* spotterEmbed.trigger(HostEvent.Save, {
|
|
2740
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2741
|
+
* })
|
|
2742
|
+
* ```
|
|
2578
2743
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2579
2744
|
*/
|
|
2580
2745
|
HostEvent["Save"] = "save";
|
|
@@ -2858,7 +3023,7 @@ var HostEvent;
|
|
|
2858
3023
|
HostEvent["ResetLiveboardPersonalisedView"] = "ResetLiveboardPersonalisedView";
|
|
2859
3024
|
/**
|
|
2860
3025
|
* Triggers an action to update Parameter values on embedded
|
|
2861
|
-
* Answers and
|
|
3026
|
+
* Answers, Liveboard and Spotter answer in Edit mode.
|
|
2862
3027
|
*
|
|
2863
3028
|
* @example
|
|
2864
3029
|
* ```js
|
|
@@ -2872,11 +3037,19 @@ var HostEvent;
|
|
|
2872
3037
|
HostEvent["UpdateParameters"] = "UpdateParameters";
|
|
2873
3038
|
/**
|
|
2874
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.
|
|
2875
3041
|
* ```js
|
|
2876
3042
|
* liveboardEmbed.trigger(HostEvent.GetParameters).then((parameter) => {
|
|
2877
3043
|
* console.log('parameters', parameter);
|
|
2878
3044
|
* });
|
|
2879
3045
|
*```
|
|
3046
|
+
*```js
|
|
3047
|
+
* spotterEmbed.trigger(HostEvent.GetParameters, {
|
|
3048
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
3049
|
+
* }).then((parameter) => {
|
|
3050
|
+
* console.log('parameters', parameter);
|
|
3051
|
+
* });
|
|
3052
|
+
*```
|
|
2880
3053
|
* @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
2881
3054
|
*/
|
|
2882
3055
|
HostEvent["GetParameters"] = "GetParameters";
|
|
@@ -2908,7 +3081,7 @@ var HostEvent;
|
|
|
2908
3081
|
* @param - optional attributes to set Answer properties.
|
|
2909
3082
|
* `name` - Name string for the Answer.
|
|
2910
3083
|
* `description` - Description text for the Answer.
|
|
2911
|
-
*
|
|
3084
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2912
3085
|
* @example
|
|
2913
3086
|
* ```js
|
|
2914
3087
|
* const saveAnswerResponse = await searchEmbed.trigger(HostEvent.SaveAnswer, {
|
|
@@ -2916,6 +3089,14 @@ var HostEvent;
|
|
|
2916
3089
|
* description: "Total sales by states in MidWest"
|
|
2917
3090
|
* });
|
|
2918
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
|
+
* ```
|
|
2919
3100
|
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
2920
3101
|
*/
|
|
2921
3102
|
HostEvent["SaveAnswer"] = "saveAnswer";
|
|
@@ -2944,6 +3125,70 @@ var HostEvent;
|
|
|
2944
3125
|
* @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
|
|
2945
3126
|
*/
|
|
2946
3127
|
HostEvent["TransformTableVizData"] = "TransformTableVizData";
|
|
3128
|
+
/**
|
|
3129
|
+
* Triggers a search operation with the search tokens specified in
|
|
3130
|
+
* the search query string in spotter embed.
|
|
3131
|
+
* @param - `query`: Text string in Natural Language format
|
|
3132
|
+
* @param - `executeSearch`: Boolean to execute search and update search query
|
|
3133
|
+
* @example
|
|
3134
|
+
* ```js
|
|
3135
|
+
* spotterEmbed.trigger(HostEvent.SpotterSearch, {
|
|
3136
|
+
* query: 'revenue per year',
|
|
3137
|
+
* executeSearch: true,
|
|
3138
|
+
* })
|
|
3139
|
+
* ```
|
|
3140
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3141
|
+
*/
|
|
3142
|
+
HostEvent["SpotterSearch"] = "SpotterSearch";
|
|
3143
|
+
/**
|
|
3144
|
+
* Edits the last prompt in spotter embed.
|
|
3145
|
+
* @param - `query`: Text string
|
|
3146
|
+
* @example
|
|
3147
|
+
* ```js
|
|
3148
|
+
* spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year");
|
|
3149
|
+
* ```
|
|
3150
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3151
|
+
*/
|
|
3152
|
+
HostEvent["EditLastPrompt"] = "EditLastPrompt";
|
|
3153
|
+
/**
|
|
3154
|
+
* Opens the Worksheet preview modal in Spotter Embed.
|
|
3155
|
+
* @example
|
|
3156
|
+
* ```js
|
|
3157
|
+
* spotterEmbed.trigger(HostEvent.PreviewSpotterData);
|
|
3158
|
+
* ```
|
|
3159
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3160
|
+
*/
|
|
3161
|
+
HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
3162
|
+
/**
|
|
3163
|
+
* Resets the Spotter Embed Conversation.
|
|
3164
|
+
* @example
|
|
3165
|
+
* ```js
|
|
3166
|
+
* spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
|
|
3167
|
+
* ```
|
|
3168
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3169
|
+
*/
|
|
3170
|
+
HostEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
3171
|
+
/**
|
|
3172
|
+
* Deletes the last prompt in spotter embed.
|
|
3173
|
+
* @example
|
|
3174
|
+
* ```js
|
|
3175
|
+
* spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
|
|
3176
|
+
* ```
|
|
3177
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3178
|
+
*/
|
|
3179
|
+
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
3180
|
+
/**
|
|
3181
|
+
* Toggle the visualization to chart or table view.
|
|
3182
|
+
* @param - `vizId ` refers to the answer id in spotter Embed, it is required in spotter Embed.
|
|
3183
|
+
* @example
|
|
3184
|
+
* ```js
|
|
3185
|
+
* spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {
|
|
3186
|
+
* vizId:'b535c760-8bbe-4e6f-bb26-af56b4129a1e'
|
|
3187
|
+
* });
|
|
3188
|
+
*```
|
|
3189
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
3190
|
+
*/
|
|
3191
|
+
HostEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
|
|
2947
3192
|
/**
|
|
2948
3193
|
* @hidden
|
|
2949
3194
|
* Trigger exit from presentation mode when user exits fullscreen.
|
|
@@ -2967,6 +3212,27 @@ var HostEvent;
|
|
|
2967
3212
|
* @hidden
|
|
2968
3213
|
*/
|
|
2969
3214
|
HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
|
|
3215
|
+
/**
|
|
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.
|
|
3218
|
+
* @example
|
|
3219
|
+
* ```js
|
|
3220
|
+
* spotterEmbed.trigger(HostEvent.AskSpotter,
|
|
3221
|
+
* {vizId:'730496d6-6903-4601-937e-2c691821af3c'})
|
|
3222
|
+
* ```
|
|
3223
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
3224
|
+
*/
|
|
3225
|
+
HostEvent["AskSpotter"] = "AskSpotter";
|
|
3226
|
+
/**
|
|
3227
|
+
* @hidden
|
|
3228
|
+
* Triggers the update of the embed params.
|
|
3229
|
+
*
|
|
3230
|
+
* @example
|
|
3231
|
+
* ```js
|
|
3232
|
+
* liveboardEmbed.trigger(HostEvent.UpdateEmbedParams, viewConfig);
|
|
3233
|
+
* ```
|
|
3234
|
+
*/
|
|
3235
|
+
HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
|
|
2970
3236
|
})(HostEvent || (HostEvent = {}));
|
|
2971
3237
|
/**
|
|
2972
3238
|
* The different visual modes that the data sources panel within
|
|
@@ -3266,27 +3532,27 @@ var Action;
|
|
|
3266
3532
|
*/
|
|
3267
3533
|
Action["ConfigureFilter"] = "configureFilter";
|
|
3268
3534
|
/**
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
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
|
+
*/
|
|
3278
3544
|
Action["CollapseDataSources"] = "collapseDataSources";
|
|
3279
3545
|
/**
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
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
|
+
*/
|
|
3290
3556
|
Action["CollapseDataPanel"] = "collapseDataPanel";
|
|
3291
3557
|
/**
|
|
3292
3558
|
* The **Choose sources** button on Search page.
|
|
@@ -3982,6 +4248,17 @@ var Action;
|
|
|
3982
4248
|
* @version SDK: 1.25.0 | ThoughtSpot Cloud: 9.6.0.cl
|
|
3983
4249
|
*/
|
|
3984
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";
|
|
3985
4262
|
/**
|
|
3986
4263
|
* Action ID to hide or disable Natural Language Search query.
|
|
3987
4264
|
*
|
|
@@ -4351,6 +4628,39 @@ var Action;
|
|
|
4351
4628
|
* @version SDK: 1.39.0 | ThoughtSpot Cloud: 10.10.0.cl
|
|
4352
4629
|
*/
|
|
4353
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";
|
|
4354
4664
|
})(Action || (Action = {}));
|
|
4355
4665
|
var PrefetchFeatures;
|
|
4356
4666
|
(function (PrefetchFeatures) {
|
|
@@ -7708,7 +8018,7 @@ class AnswerService {
|
|
|
7708
8018
|
async getTML() {
|
|
7709
8019
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
7710
8020
|
const edoc = object[0].edoc;
|
|
7711
|
-
const YAML = await import('./index-
|
|
8021
|
+
const YAML = await import('./index-BDlM0f0T.js');
|
|
7712
8022
|
const parsedDoc = YAML.parse(edoc);
|
|
7713
8023
|
return {
|
|
7714
8024
|
answer: {
|
|
@@ -15608,7 +15918,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
|
15608
15918
|
return e;
|
|
15609
15919
|
}
|
|
15610
15920
|
|
|
15611
|
-
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};
|
|
15612
15922
|
|
|
15613
15923
|
/**
|
|
15614
15924
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -15860,7 +16170,8 @@ class TsEmbed {
|
|
|
15860
16170
|
this.updateAuthToken = async (_, responder) => {
|
|
15861
16171
|
const { authType } = this.embedConfig;
|
|
15862
16172
|
let { autoLogin } = this.embedConfig;
|
|
15863
|
-
// Default autoLogin: true for cookieless if undefined/null, otherwise
|
|
16173
|
+
// Default autoLogin: true for cookieless if undefined/null, otherwise
|
|
16174
|
+
// false
|
|
15864
16175
|
autoLogin = autoLogin !== null && autoLogin !== void 0 ? autoLogin : (authType === AuthType.TrustedAuthTokenCookieless);
|
|
15865
16176
|
if (autoLogin && authType === AuthType.TrustedAuthTokenCookieless) {
|
|
15866
16177
|
try {
|
|
@@ -15911,8 +16222,42 @@ class TsEmbed {
|
|
|
15911
16222
|
this.on(EmbedEvent.APP_INIT, this.appInitCb, { start: false }, true);
|
|
15912
16223
|
this.on(EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
|
|
15913
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);
|
|
15914
16229
|
};
|
|
15915
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
|
+
};
|
|
15916
16261
|
this.validatePreRenderViewConfig = (viewConfig) => {
|
|
15917
16262
|
var _a;
|
|
15918
16263
|
const preRenderAllowedKeys = ['preRenderId', 'vizId', 'liveboardId'];
|
|
@@ -15946,10 +16291,10 @@ class TsEmbed {
|
|
|
15946
16291
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
15947
16292
|
...viewConfig,
|
|
15948
16293
|
});
|
|
16294
|
+
const embedConfig = getEmbedConfig();
|
|
16295
|
+
this.embedConfig = embedConfig;
|
|
15949
16296
|
this.hostEventClient = new HostEventClient(this.iFrame);
|
|
15950
16297
|
this.isReadyForRenderPromise = getInitPromise().then(async () => {
|
|
15951
|
-
const embedConfig = getEmbedConfig();
|
|
15952
|
-
this.embedConfig = embedConfig;
|
|
15953
16298
|
if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
|
|
15954
16299
|
this.embedConfig.authTriggerContainer = domSelector;
|
|
15955
16300
|
}
|
|
@@ -15982,7 +16327,6 @@ class TsEmbed {
|
|
|
15982
16327
|
*/
|
|
15983
16328
|
getEventType(event) {
|
|
15984
16329
|
var _a, _b;
|
|
15985
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
15986
16330
|
return ((_a = event.data) === null || _a === void 0 ? void 0 : _a.type) || ((_b = event.data) === null || _b === void 0 ? void 0 : _b.__type);
|
|
15987
16331
|
}
|
|
15988
16332
|
/**
|
|
@@ -16135,6 +16479,11 @@ class TsEmbed {
|
|
|
16135
16479
|
.join('/');
|
|
16136
16480
|
return `${basePath}#`;
|
|
16137
16481
|
}
|
|
16482
|
+
getUpdateEmbedParamsObject() {
|
|
16483
|
+
let queryParams = this.getEmbedParamsObject();
|
|
16484
|
+
queryParams = { ...this.viewConfig, ...queryParams };
|
|
16485
|
+
return queryParams;
|
|
16486
|
+
}
|
|
16138
16487
|
/**
|
|
16139
16488
|
* Common query params set for all the embed modes.
|
|
16140
16489
|
* @param queryParams
|
|
@@ -16284,9 +16633,13 @@ class TsEmbed {
|
|
|
16284
16633
|
return path;
|
|
16285
16634
|
}
|
|
16286
16635
|
getEmbedParams() {
|
|
16287
|
-
const queryParams = this.
|
|
16636
|
+
const queryParams = this.getEmbedParamsObject();
|
|
16288
16637
|
return getQueryParamString(queryParams);
|
|
16289
16638
|
}
|
|
16639
|
+
getEmbedParamsObject() {
|
|
16640
|
+
const params = this.getBaseQueryParams();
|
|
16641
|
+
return params;
|
|
16642
|
+
}
|
|
16290
16643
|
getRootIframeSrc() {
|
|
16291
16644
|
const query = this.getEmbedParams();
|
|
16292
16645
|
return this.getEmbedBasePath(query);
|
|
@@ -16385,7 +16738,8 @@ class TsEmbed {
|
|
|
16385
16738
|
}
|
|
16386
16739
|
});
|
|
16387
16740
|
}
|
|
16388
|
-
// Setup fullscreen change handler after iframe is
|
|
16741
|
+
// Setup fullscreen change handler after iframe is
|
|
16742
|
+
// loaded and ready
|
|
16389
16743
|
this.setupFullscreenChangeHandler();
|
|
16390
16744
|
});
|
|
16391
16745
|
this.iFrame.addEventListener('error', () => {
|
|
@@ -16487,7 +16841,6 @@ class TsEmbed {
|
|
|
16487
16841
|
const div = document.createElement('div');
|
|
16488
16842
|
div.innerHTML = child;
|
|
16489
16843
|
div.id = TS_EMBED_ID;
|
|
16490
|
-
// eslint-disable-next-line no-param-reassign
|
|
16491
16844
|
child = div;
|
|
16492
16845
|
}
|
|
16493
16846
|
if (((_a = this.el.nextElementSibling) === null || _a === void 0 ? void 0 : _a.id) === TS_EMBED_ID) {
|
|
@@ -16666,6 +17019,43 @@ class TsEmbed {
|
|
|
16666
17019
|
logger$3.log('Event Port is not defined');
|
|
16667
17020
|
}
|
|
16668
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
|
+
}
|
|
16669
17059
|
/**
|
|
16670
17060
|
* Triggers an event to the embedded app
|
|
16671
17061
|
* @param {HostEvent} messageType The event type
|
|
@@ -16810,7 +17200,12 @@ class TsEmbed {
|
|
|
16810
17200
|
return this.preRender(true);
|
|
16811
17201
|
}
|
|
16812
17202
|
this.validatePreRenderViewConfig(this.viewConfig);
|
|
17203
|
+
logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
|
|
17204
|
+
this.executeAfterEmbedContainerLoaded(() => {
|
|
17205
|
+
this.trigger(HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
|
|
17206
|
+
});
|
|
16813
17207
|
}
|
|
17208
|
+
this.beforePrerenderVisible();
|
|
16814
17209
|
if (this.el) {
|
|
16815
17210
|
this.syncPreRenderStyle();
|
|
16816
17211
|
if (!this.viewConfig.doNotTrackPreRenderSize) {
|
|
@@ -16827,7 +17222,6 @@ class TsEmbed {
|
|
|
16827
17222
|
this.resizeObserver.observe(this.el);
|
|
16828
17223
|
}
|
|
16829
17224
|
}
|
|
16830
|
-
this.beforePrerenderVisible();
|
|
16831
17225
|
removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
|
|
16832
17226
|
this.subscribeToEvents();
|
|
16833
17227
|
// Setup fullscreen change handler for prerendered components
|
|
@@ -16920,7 +17314,8 @@ class TsEmbed {
|
|
|
16920
17314
|
const isFullscreen = !!document.fullscreenElement;
|
|
16921
17315
|
if (!isFullscreen) {
|
|
16922
17316
|
logger$3.info('Exited fullscreen mode - triggering ExitPresentMode');
|
|
16923
|
-
// Only trigger if iframe is available and contentWindow is
|
|
17317
|
+
// Only trigger if iframe is available and contentWindow is
|
|
17318
|
+
// accessible
|
|
16924
17319
|
if (this.iFrame && this.iFrame.contentWindow) {
|
|
16925
17320
|
this.trigger(HostEvent.ExitPresentMode);
|
|
16926
17321
|
}
|
|
@@ -16954,7 +17349,6 @@ class V1Embed extends TsEmbed {
|
|
|
16954
17349
|
* Only for testing purposes.
|
|
16955
17350
|
* @hidden
|
|
16956
17351
|
*/
|
|
16957
|
-
// eslint-disable-next-line camelcase
|
|
16958
17352
|
this.test__executeCallbacks = this.executeCallbacks;
|
|
16959
17353
|
this.viewConfig = { excludeRuntimeFiltersfromURL: false, ...viewConfig };
|
|
16960
17354
|
}
|
|
@@ -17266,10 +17660,18 @@ class AppEmbed extends V1Embed {
|
|
|
17266
17660
|
else {
|
|
17267
17661
|
params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL;
|
|
17268
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';
|
|
17269
17669
|
if (discoveryExperience) {
|
|
17270
17670
|
// primaryNavbarVersion v3 will enabled the new left navigation
|
|
17271
17671
|
if (discoveryExperience.primaryNavbarVersion === PrimaryNavbarVersion.Sliding) {
|
|
17272
17672
|
params[Param.NavigationVersion] = discoveryExperience.primaryNavbarVersion;
|
|
17673
|
+
// Enable the modularHomeExperience when Sliding is enabled.
|
|
17674
|
+
params[Param.ModularHomeExperienceEnabled] = true;
|
|
17273
17675
|
}
|
|
17274
17676
|
// homePage v2 will enable the modular home page
|
|
17275
17677
|
// and it will override the modularHomeExperience value
|
|
@@ -17442,7 +17844,7 @@ const addPreviewStylesIfNotPresent = () => {
|
|
|
17442
17844
|
return;
|
|
17443
17845
|
}
|
|
17444
17846
|
const previewStyles = `
|
|
17445
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community@32.0.2/styles/ag-grid.min.css">
|
|
17847
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community@32.0.2/styles/ag-grid.min.css" integrity="sha384-PvEsKa6emq5KYa9mf+Q7eYF5C2OCacYzZ+hBngp21NA4o1A9iU9smnytEmqUFbEZ" crossorigin="anonymous">
|
|
17446
17848
|
<style id="ts-preview-style">
|
|
17447
17849
|
.ts-viz-preview-loader {
|
|
17448
17850
|
position: absolute;
|
|
@@ -17553,6 +17955,16 @@ class LiveboardEmbed extends V1Embed {
|
|
|
17553
17955
|
}
|
|
17554
17956
|
this.setIFrameHeight(frameHeight || this.defaultHeight);
|
|
17555
17957
|
};
|
|
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
|
+
};
|
|
17556
17968
|
if (this.viewConfig.fullHeight === true) {
|
|
17557
17969
|
if (this.viewConfig.vizId) {
|
|
17558
17970
|
logger$3.warn('Full height is currently only supported for Liveboard embeds.' +
|
|
@@ -17569,6 +17981,11 @@ class LiveboardEmbed extends V1Embed {
|
|
|
17569
17981
|
* embedded Liveboard or visualization.
|
|
17570
17982
|
*/
|
|
17571
17983
|
getEmbedParams() {
|
|
17984
|
+
const params = this.getEmbedParamsObject();
|
|
17985
|
+
const queryParams = getQueryParamString(params, true);
|
|
17986
|
+
return queryParams;
|
|
17987
|
+
}
|
|
17988
|
+
getEmbedParamsObject() {
|
|
17572
17989
|
let params = {};
|
|
17573
17990
|
params = this.getBaseQueryParams(params);
|
|
17574
17991
|
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = false, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
|
|
@@ -17638,8 +18055,27 @@ class LiveboardEmbed extends V1Embed {
|
|
|
17638
18055
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
17639
18056
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
17640
18057
|
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
17641
|
-
|
|
17642
|
-
|
|
18058
|
+
if (oAuthPollingInterval !== undefined) {
|
|
18059
|
+
params[Param.OauthPollingInterval] = oAuthPollingInterval;
|
|
18060
|
+
}
|
|
18061
|
+
if (isForceRedirect) {
|
|
18062
|
+
params[Param.IsForceRedirect] = isForceRedirect;
|
|
18063
|
+
}
|
|
18064
|
+
if (dataSourceId !== undefined) {
|
|
18065
|
+
params[Param.DataSourceId] = dataSourceId;
|
|
18066
|
+
}
|
|
18067
|
+
if (isLiveboardStylingAndGroupingEnabled !== undefined) {
|
|
18068
|
+
params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
|
|
18069
|
+
}
|
|
18070
|
+
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
18071
|
+
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
18072
|
+
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
18073
|
+
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
|
|
18074
|
+
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
18075
|
+
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
18076
|
+
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
18077
|
+
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
18078
|
+
return params;
|
|
17643
18079
|
}
|
|
17644
18080
|
getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
|
|
17645
18081
|
let suffix = `/embed/viz/${liveboardId}`;
|
|
@@ -17701,16 +18137,17 @@ class LiveboardEmbed extends V1Embed {
|
|
|
17701
18137
|
}
|
|
17702
18138
|
}
|
|
17703
18139
|
beforePrerenderVisible() {
|
|
17704
|
-
|
|
17705
|
-
|
|
17706
|
-
|
|
17707
|
-
|
|
17708
|
-
|
|
17709
|
-
|
|
17710
|
-
|
|
17711
|
-
|
|
17712
|
-
|
|
17713
|
-
|
|
18140
|
+
const embedObj = this.getPreRenderObj();
|
|
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
|
+
}
|
|
18150
|
+
});
|
|
17714
18151
|
}
|
|
17715
18152
|
async handleRenderForPrerender() {
|
|
17716
18153
|
if (isUndefined$1(this.viewConfig.liveboardId)) {
|
|
@@ -17880,11 +18317,9 @@ class SearchEmbed extends TsEmbed {
|
|
|
17880
18317
|
const defaultAppInitData = await super.getAppInitData();
|
|
17881
18318
|
return { ...defaultAppInitData, ...this.getSearchInitData() };
|
|
17882
18319
|
}
|
|
17883
|
-
|
|
18320
|
+
getEmbedParamsObject() {
|
|
17884
18321
|
var _a;
|
|
17885
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
|
|
17886
|
-
/* eslint-disable-next-line max-len */
|
|
17887
|
-
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
|
|
18322
|
+
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
|
|
17888
18323
|
const queryParams = this.getBaseQueryParams();
|
|
17889
18324
|
queryParams[Param.HideActions] = [
|
|
17890
18325
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -17917,7 +18352,6 @@ class SearchEmbed extends TsEmbed {
|
|
|
17917
18352
|
queryParams[Param.HideSearchBar] = true;
|
|
17918
18353
|
}
|
|
17919
18354
|
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
17920
|
-
/* eslint-disable-next-line max-len */
|
|
17921
18355
|
queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
17922
18356
|
}
|
|
17923
18357
|
if (!focusSearchBarOnRender) {
|
|
@@ -17930,20 +18364,22 @@ class SearchEmbed extends TsEmbed {
|
|
|
17930
18364
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
17931
18365
|
}
|
|
17932
18366
|
queryParams[Param.searchEmbed] = true;
|
|
17933
|
-
/* eslint-disable-next-line max-len */
|
|
17934
18367
|
queryParams[Param.CollapseSearchBarInitially] = collapseSearchBarInitially || collapseSearchBar;
|
|
17935
18368
|
queryParams[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
17936
18369
|
if (dataPanelCustomGroupsAccordionInitialState
|
|
17937
18370
|
=== DataPanelCustomColumnGroupsAccordionState.COLLAPSE_ALL
|
|
17938
18371
|
|| dataPanelCustomGroupsAccordionInitialState
|
|
17939
18372
|
=== DataPanelCustomColumnGroupsAccordionState.EXPAND_FIRST) {
|
|
17940
|
-
/* eslint-disable-next-line max-len */
|
|
17941
18373
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
|
|
17942
18374
|
}
|
|
17943
18375
|
else {
|
|
17944
|
-
/* eslint-disable-next-line max-len */
|
|
17945
18376
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
|
|
17946
18377
|
}
|
|
18378
|
+
return queryParams;
|
|
18379
|
+
}
|
|
18380
|
+
getEmbedParams() {
|
|
18381
|
+
const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
|
|
18382
|
+
const queryParams = this.getEmbedParamsObject();
|
|
17947
18383
|
let query = '';
|
|
17948
18384
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
17949
18385
|
if (queryParamsString) {
|
|
@@ -17999,15 +18435,9 @@ class SearchBarEmbed extends TsEmbed {
|
|
|
17999
18435
|
this.embedComponentType = 'SearchBarEmbed';
|
|
18000
18436
|
this.viewConfig = viewConfig;
|
|
18001
18437
|
}
|
|
18002
|
-
|
|
18003
|
-
* Construct the URL of the embedded ThoughtSpot search to be
|
|
18004
|
-
* loaded in the iframe
|
|
18005
|
-
* @param dataSources A list of data source GUIDs
|
|
18006
|
-
*/
|
|
18007
|
-
getIFrameSrc() {
|
|
18438
|
+
getEmbedParamsObject() {
|
|
18008
18439
|
var _a;
|
|
18009
18440
|
const { searchOptions, dataSource, dataSources, useLastSelectedSources = false, excludeSearchTokenStringFromURL, } = this.viewConfig;
|
|
18010
|
-
const path = 'search-bar-embed';
|
|
18011
18441
|
const queryParams = this.getBaseQueryParams();
|
|
18012
18442
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
18013
18443
|
if (dataSources && dataSources.length) {
|
|
@@ -18029,6 +18459,16 @@ class SearchBarEmbed extends TsEmbed {
|
|
|
18029
18459
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
18030
18460
|
}
|
|
18031
18461
|
queryParams[Param.searchEmbed] = true;
|
|
18462
|
+
return queryParams;
|
|
18463
|
+
}
|
|
18464
|
+
/**
|
|
18465
|
+
* Construct the URL of the embedded ThoughtSpot search to be
|
|
18466
|
+
* loaded in the iframe
|
|
18467
|
+
* @param dataSources A list of data source GUIDs
|
|
18468
|
+
*/
|
|
18469
|
+
getIFrameSrc() {
|
|
18470
|
+
const queryParams = this.getEmbedParamsObject();
|
|
18471
|
+
const path = 'search-bar-embed';
|
|
18032
18472
|
let query = '';
|
|
18033
18473
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
18034
18474
|
if (queryParamsString) {
|
|
@@ -18423,7 +18863,11 @@ class Conversation {
|
|
|
18423
18863
|
return {
|
|
18424
18864
|
convId: this.conversationId,
|
|
18425
18865
|
messageId: responses[0].msgId,
|
|
18426
|
-
data:
|
|
18866
|
+
data: {
|
|
18867
|
+
...data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
|
|
18868
|
+
convId: this.conversationId,
|
|
18869
|
+
messageId: responses[0].msgId,
|
|
18870
|
+
},
|
|
18427
18871
|
error: null,
|
|
18428
18872
|
};
|
|
18429
18873
|
}
|
|
@@ -18447,13 +18891,17 @@ class ConversationMessage extends TsEmbed {
|
|
|
18447
18891
|
super(container, viewConfig);
|
|
18448
18892
|
this.viewConfig = viewConfig;
|
|
18449
18893
|
}
|
|
18450
|
-
|
|
18894
|
+
getEmbedParamsObject() {
|
|
18451
18895
|
var _a;
|
|
18452
|
-
const { sessionId, genNo, acSessionId, acGenNo, } = this.viewConfig;
|
|
18453
|
-
const path = 'conv-assist-answer';
|
|
18454
18896
|
const queryParams = this.getBaseQueryParams();
|
|
18455
18897
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
18456
18898
|
queryParams[Param.isSpotterAgentEmbed] = true;
|
|
18899
|
+
return queryParams;
|
|
18900
|
+
}
|
|
18901
|
+
getIframeSrc() {
|
|
18902
|
+
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
18903
|
+
const path = 'conv-assist-answer';
|
|
18904
|
+
const queryParams = this.getEmbedParamsObject();
|
|
18457
18905
|
let query = '';
|
|
18458
18906
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
18459
18907
|
if (queryParamsString) {
|
|
@@ -18464,6 +18912,8 @@ class ConversationMessage extends TsEmbed {
|
|
|
18464
18912
|
genNo,
|
|
18465
18913
|
acSessionId,
|
|
18466
18914
|
acGenNo,
|
|
18915
|
+
convId,
|
|
18916
|
+
messageId,
|
|
18467
18917
|
});
|
|
18468
18918
|
return `${this.getEmbedBasePath(query)}/embed/${path}${tsPostHashParams}`;
|
|
18469
18919
|
}
|
|
@@ -18507,6 +18957,8 @@ class SpotterAgentEmbed {
|
|
|
18507
18957
|
const container = document.createElement('div');
|
|
18508
18958
|
const embed = new ConversationMessage(container, {
|
|
18509
18959
|
...this.viewConfig,
|
|
18960
|
+
convId: data.convId,
|
|
18961
|
+
messageId: data.messageId,
|
|
18510
18962
|
sessionId: data.sessionId,
|
|
18511
18963
|
genNo: data.genNo,
|
|
18512
18964
|
acSessionId: data.stateKey.transactionId,
|
|
@@ -18527,6 +18979,8 @@ class SpotterAgentEmbed {
|
|
|
18527
18979
|
return { error };
|
|
18528
18980
|
}
|
|
18529
18981
|
return { data: {
|
|
18982
|
+
convId: data.convId,
|
|
18983
|
+
messageId: data.messageId,
|
|
18530
18984
|
sessionId: data.sessionId,
|
|
18531
18985
|
genNo: data.genNo,
|
|
18532
18986
|
acSessionId: data.stateKey.transactionId,
|
|
@@ -18608,9 +19062,8 @@ class SpotterEmbed extends TsEmbed {
|
|
|
18608
19062
|
super(container, viewConfig);
|
|
18609
19063
|
this.viewConfig = viewConfig;
|
|
18610
19064
|
}
|
|
18611
|
-
|
|
18612
|
-
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, } = this.viewConfig;
|
|
18613
|
-
const path = 'insights/conv-assist';
|
|
19065
|
+
getEmbedParamsObject() {
|
|
19066
|
+
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
18614
19067
|
if (!worksheetId) {
|
|
18615
19068
|
this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
|
|
18616
19069
|
}
|
|
@@ -18631,11 +19084,25 @@ class SpotterEmbed extends TsEmbed {
|
|
|
18631
19084
|
if (!isUndefined_1(hideSampleQuestions)) {
|
|
18632
19085
|
queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
18633
19086
|
}
|
|
19087
|
+
return queryParams;
|
|
19088
|
+
}
|
|
19089
|
+
getIframeSrc() {
|
|
19090
|
+
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
19091
|
+
const path = 'insights/conv-assist';
|
|
19092
|
+
const queryParams = this.getEmbedParamsObject();
|
|
18634
19093
|
let query = '';
|
|
18635
19094
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
18636
19095
|
if (queryParamsString) {
|
|
18637
19096
|
query = `?${queryParamsString}`;
|
|
18638
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
|
+
}
|
|
18639
19106
|
const tsPostHashParams = this.getThoughtSpotPostUrlParams({
|
|
18640
19107
|
worksheet: worksheetId,
|
|
18641
19108
|
query: (searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.searchQuery) || '',
|
|
@@ -18694,12 +19161,7 @@ class SageEmbed extends V1Embed {
|
|
|
18694
19161
|
viewConfig.embedComponentType = 'SageEmbed';
|
|
18695
19162
|
super(domSelector, viewConfig);
|
|
18696
19163
|
}
|
|
18697
|
-
|
|
18698
|
-
* Constructs a map of parameters to be passed on to the
|
|
18699
|
-
* embedded Eureka or Sage search page.
|
|
18700
|
-
* @returns {string} query string
|
|
18701
|
-
*/
|
|
18702
|
-
getEmbedParams() {
|
|
19164
|
+
getEmbedParamsObject() {
|
|
18703
19165
|
const { disableWorksheetChange, hideWorksheetSelector, showObjectSuggestions, dataPanelV2, hideSampleQuestions, isProductTour, hideSageAnswerHeader, hideAutocompleteSuggestions, } = this.viewConfig;
|
|
18704
19166
|
const params = this.getBaseQueryParams();
|
|
18705
19167
|
params[Param.DataPanelV2Enabled] = !!dataPanelV2;
|
|
@@ -18714,6 +19176,15 @@ class SageEmbed extends V1Embed {
|
|
|
18714
19176
|
params[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
18715
19177
|
params[Param.IsProductTour] = !!isProductTour;
|
|
18716
19178
|
params[Param.HideSageAnswerHeader] = !!hideSageAnswerHeader;
|
|
19179
|
+
return params;
|
|
19180
|
+
}
|
|
19181
|
+
/**
|
|
19182
|
+
* Constructs a map of parameters to be passed on to the
|
|
19183
|
+
* embedded Eureka or Sage search page.
|
|
19184
|
+
* @returns {string} query string
|
|
19185
|
+
*/
|
|
19186
|
+
getEmbedParams() {
|
|
19187
|
+
const params = this.getEmbedParamsObject();
|
|
18717
19188
|
return getQueryParamString(params, true);
|
|
18718
19189
|
}
|
|
18719
19190
|
/**
|
|
@@ -19204,16 +19675,31 @@ const getAnswerFromQuery = async (query, worksheetId) => {
|
|
|
19204
19675
|
};
|
|
19205
19676
|
|
|
19206
19677
|
/**
|
|
19207
|
-
*
|
|
19208
|
-
*
|
|
19209
|
-
*
|
|
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.
|
|
19210
19685
|
* @returns result Promise
|
|
19211
19686
|
* @version SDK: 1.33.1 | ThoughtSpot: *
|
|
19212
19687
|
* @example
|
|
19213
19688
|
* ```js
|
|
19214
|
-
*
|
|
19215
|
-
*
|
|
19216
|
-
*
|
|
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
|
+
* });
|
|
19217
19703
|
* ```
|
|
19218
19704
|
*/
|
|
19219
19705
|
const createLiveboardWithAnswers = async (answers, name) => {
|