@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-react.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, require('react')) :
|
|
@@ -1245,7 +1245,7 @@
|
|
|
1245
1245
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1246
1246
|
* @example
|
|
1247
1247
|
*```js
|
|
1248
|
-
* liveboardEmbed.on(EmbedEvent.
|
|
1248
|
+
* liveboardEmbed.on(EmbedEvent.LiveboardInfo, payload => {
|
|
1249
1249
|
* console.log('Liveboard details', payload);
|
|
1250
1250
|
* })
|
|
1251
1251
|
*```
|
|
@@ -1619,6 +1619,95 @@
|
|
|
1619
1619
|
* @hidden
|
|
1620
1620
|
*/
|
|
1621
1621
|
EmbedEvent["RequestVisibleEmbedCoordinates"] = "requestVisibleEmbedCoordinates";
|
|
1622
|
+
/**
|
|
1623
|
+
* Emitted when Spotter response is text data
|
|
1624
|
+
* @example
|
|
1625
|
+
* ```js
|
|
1626
|
+
* spotterEmbed.on(EmbedEvent.SpotterData, (payload) => {
|
|
1627
|
+
* console.log('payload', payload);
|
|
1628
|
+
* })
|
|
1629
|
+
*```
|
|
1630
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1631
|
+
*/
|
|
1632
|
+
EmbedEvent["SpotterData"] = "SpotterData";
|
|
1633
|
+
/**
|
|
1634
|
+
* Emitted when user opens up the worksheet preview modal in Spotter embed.
|
|
1635
|
+
* @example
|
|
1636
|
+
* ```js
|
|
1637
|
+
* spotterEmbed.on(EmbedEvent.PreviewSpotterData, (payload) => {
|
|
1638
|
+
* console.log('payload', payload);
|
|
1639
|
+
* })
|
|
1640
|
+
*```
|
|
1641
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1642
|
+
*/
|
|
1643
|
+
EmbedEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
1644
|
+
/**
|
|
1645
|
+
* Emitted when the Spotter query is triggered in Spotter embed.
|
|
1646
|
+
* @example
|
|
1647
|
+
* ```js
|
|
1648
|
+
* spotterEmbed.on(EmbedEvent.SpotterQueryTriggered, (payload) => {
|
|
1649
|
+
* console.log('payload', payload);
|
|
1650
|
+
* })
|
|
1651
|
+
*```
|
|
1652
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1653
|
+
*/
|
|
1654
|
+
EmbedEvent["SpotterQueryTriggered"] = "SpotterQueryTriggered";
|
|
1655
|
+
/**
|
|
1656
|
+
* Emitted when the last Spotter query is edited in Spotter embed.
|
|
1657
|
+
* @example
|
|
1658
|
+
* ```js
|
|
1659
|
+
* spotterEmbed.on(EmbedEvent.LastPromptEdited, (payload) => {
|
|
1660
|
+
* console.log('payload', payload);
|
|
1661
|
+
* })
|
|
1662
|
+
*```
|
|
1663
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1664
|
+
*/
|
|
1665
|
+
EmbedEvent["LastPromptEdited"] = "LastPromptEdited";
|
|
1666
|
+
/**
|
|
1667
|
+
* Emitted when the last Spotter query is deleted in Spotter embed.
|
|
1668
|
+
* @example
|
|
1669
|
+
* ```js
|
|
1670
|
+
* spotterEmbed.on(EmbedEvent.LastPromptDeleted, (payload) => {
|
|
1671
|
+
* console.log('payload', payload);
|
|
1672
|
+
* })
|
|
1673
|
+
*```
|
|
1674
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1675
|
+
*/
|
|
1676
|
+
EmbedEvent["LastPromptDeleted"] = "LastPromptDeleted";
|
|
1677
|
+
/**
|
|
1678
|
+
* Emitted when the coversation is reset in spotter embed.
|
|
1679
|
+
* @example
|
|
1680
|
+
* ```js
|
|
1681
|
+
* spotterEmbed.on(EmbedEvent.ResetSpotterConversation, (payload) => {
|
|
1682
|
+
* console.log('payload', payload);
|
|
1683
|
+
* })
|
|
1684
|
+
*```
|
|
1685
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.10.0.cl
|
|
1686
|
+
*/
|
|
1687
|
+
EmbedEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
1688
|
+
/**
|
|
1689
|
+
* Emitted when the *Spotter* is initialized.
|
|
1690
|
+
* @example
|
|
1691
|
+
* ```js
|
|
1692
|
+
* spotterEmbed.on(EmbedEvent.SpotterInit, (payload) => {
|
|
1693
|
+
* console.log('payload', payload);
|
|
1694
|
+
* })
|
|
1695
|
+
*```
|
|
1696
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1697
|
+
*/
|
|
1698
|
+
EmbedEvent["SpotterInit"] = "spotterInit";
|
|
1699
|
+
/**
|
|
1700
|
+
* @hidden
|
|
1701
|
+
* Triggers when the embed listener is ready to receive events.
|
|
1702
|
+
* This is used to trigger events after the embed container is loaded.
|
|
1703
|
+
* @example
|
|
1704
|
+
* ```js
|
|
1705
|
+
* liveboardEmbed.on(EmbedEvent.EmbedListenerReady, () => {
|
|
1706
|
+
* console.log('EmbedListenerReady');
|
|
1707
|
+
* })
|
|
1708
|
+
* ```
|
|
1709
|
+
*/
|
|
1710
|
+
EmbedEvent["EmbedListenerReady"] = "EmbedListenerReady";
|
|
1622
1711
|
})(exports.EmbedEvent || (exports.EmbedEvent = {}));
|
|
1623
1712
|
/**
|
|
1624
1713
|
* Event types that can be triggered by the host application
|
|
@@ -1636,7 +1725,7 @@
|
|
|
1636
1725
|
* // create the liveboard embed.
|
|
1637
1726
|
*
|
|
1638
1727
|
* liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
|
|
1639
|
-
* { columnName: 'state, operator: RuntimeFilterOp.EQ, values: [
|
|
1728
|
+
* { columnName: 'state', operator: RuntimeFilterOp.EQ, values: ["california"]}
|
|
1640
1729
|
* ]);
|
|
1641
1730
|
* ```
|
|
1642
1731
|
* @example
|
|
@@ -1708,6 +1797,7 @@
|
|
|
1708
1797
|
* done automatically on the most popular column.
|
|
1709
1798
|
* @param - vizId [TS >= 9.8.0] - Optional. The GUID of the visualization to drill
|
|
1710
1799
|
* in case of a Liveboard.
|
|
1800
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
1711
1801
|
* @example
|
|
1712
1802
|
* ```js
|
|
1713
1803
|
* searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
|
|
@@ -1846,12 +1936,12 @@
|
|
|
1846
1936
|
* Works with Search and Liveboard embed.
|
|
1847
1937
|
* @param - { columnId: string,
|
|
1848
1938
|
* name: string,
|
|
1849
|
-
* type:
|
|
1850
|
-
* dataType:
|
|
1939
|
+
* type: ATTRIBUTE/MEASURE,
|
|
1940
|
+
* dataType: INT64/CHAR/DATE }
|
|
1851
1941
|
* @example
|
|
1852
1942
|
* ```js
|
|
1853
1943
|
* searchEmbed.trigger(HostEvent.OpenFilter,
|
|
1854
|
-
* {column: { columnId: '<column-GUID>', name: 'column name', type: '
|
|
1944
|
+
* {column: { columnId: '<column-GUID>', name: 'column name', type: 'ATTRIBUTE', dataType: 'INT64'}})
|
|
1855
1945
|
* ```
|
|
1856
1946
|
* @example
|
|
1857
1947
|
* ```js
|
|
@@ -1909,6 +1999,7 @@
|
|
|
1909
1999
|
* @param
|
|
1910
2000
|
* `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
|
|
1911
2001
|
* Optional when pinning a new chart or table generated from a Search query.
|
|
2002
|
+
* **Required** in Spotter Embed.
|
|
1912
2003
|
* @param
|
|
1913
2004
|
* `liveboardID` - GUID of the Liveboard to pin an Answer. If there is no Liveboard,
|
|
1914
2005
|
* specify the `newLiveboardName` parameter to create a new Liveboard.
|
|
@@ -1956,6 +2047,12 @@
|
|
|
1956
2047
|
* ```js
|
|
1957
2048
|
* appEmbed.trigger(HostEvent.Pin)
|
|
1958
2049
|
* ```
|
|
2050
|
+
* @example
|
|
2051
|
+
* ```js
|
|
2052
|
+
* const pinResponse = await spotterEmbed.trigger(HostEvent.Pin, {
|
|
2053
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2054
|
+
* });
|
|
2055
|
+
* ```
|
|
1959
2056
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1960
2057
|
*/
|
|
1961
2058
|
HostEvent["Pin"] = "pin";
|
|
@@ -2020,12 +2117,21 @@
|
|
|
2020
2117
|
* Trigger the **Download PDF** action on an embedded Liveboard,
|
|
2021
2118
|
* visualization or Answer.
|
|
2022
2119
|
*
|
|
2120
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2121
|
+
*
|
|
2023
2122
|
* **NOTE**: The **Download** > **PDF** action is available on
|
|
2024
2123
|
* visualizations and Answers if the data is in tabular format.
|
|
2025
2124
|
* @example
|
|
2026
2125
|
* ```js
|
|
2027
2126
|
* liveboardEmbed.trigger(HostEvent.DownloadAsPdf)
|
|
2028
2127
|
* ```
|
|
2128
|
+
* @example
|
|
2129
|
+
* ```js
|
|
2130
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPdf, {
|
|
2131
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2132
|
+
* });
|
|
2133
|
+
* ```
|
|
2134
|
+
*
|
|
2029
2135
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2030
2136
|
*/
|
|
2031
2137
|
HostEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
@@ -2049,6 +2155,12 @@
|
|
|
2049
2155
|
* ```js
|
|
2050
2156
|
* searchEmbed.trigger(HostEvent.MakeACopy)
|
|
2051
2157
|
* ```
|
|
2158
|
+
* @example
|
|
2159
|
+
* ```js
|
|
2160
|
+
* const pinResponse = await spotterEmbed.trigger(HostEvent.MakeACopy, {
|
|
2161
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2162
|
+
* });
|
|
2163
|
+
* ```
|
|
2052
2164
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2053
2165
|
*/
|
|
2054
2166
|
HostEvent["MakeACopy"] = "makeACopy";
|
|
@@ -2121,6 +2233,8 @@
|
|
|
2121
2233
|
* This event is not supported in visualization embed and search embed.
|
|
2122
2234
|
* @param - object - To trigger the action for a specific visualization
|
|
2123
2235
|
* in Liveboard embed, pass in `vizId` as a key.
|
|
2236
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2237
|
+
*
|
|
2124
2238
|
* @example
|
|
2125
2239
|
* ```js
|
|
2126
2240
|
* liveboardEmbed.trigger(HostEvent.Edit)
|
|
@@ -2129,6 +2243,18 @@
|
|
|
2129
2243
|
* liveboardEmbed.trigger(HostEvent.Edit, {vizId:
|
|
2130
2244
|
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
2131
2245
|
* ```
|
|
2246
|
+
* @example
|
|
2247
|
+
* ```js
|
|
2248
|
+
* const pinResponse = await spotterEmbed.trigger(HostEvent.Edit, {
|
|
2249
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2250
|
+
* });
|
|
2251
|
+
* ```
|
|
2252
|
+
* @example
|
|
2253
|
+
* ```js
|
|
2254
|
+
* const editResponse = await spotterEmbed.trigger(HostEvent.Edit, {
|
|
2255
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2256
|
+
* });
|
|
2257
|
+
* ```
|
|
2132
2258
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2133
2259
|
*/
|
|
2134
2260
|
HostEvent["Edit"] = "edit";
|
|
@@ -2176,6 +2302,16 @@
|
|
|
2176
2302
|
* );
|
|
2177
2303
|
* })
|
|
2178
2304
|
* ```
|
|
2305
|
+
* @example
|
|
2306
|
+
* ```js
|
|
2307
|
+
* spotterEmbed.trigger(HostEvent.GetTML, {
|
|
2308
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2309
|
+
* }).then((tml) => {
|
|
2310
|
+
* console.log(
|
|
2311
|
+
* tml.answer.search_query // TML representation of the search query
|
|
2312
|
+
* );
|
|
2313
|
+
* })
|
|
2314
|
+
* ```
|
|
2179
2315
|
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
|
|
2180
2316
|
* @important
|
|
2181
2317
|
*/
|
|
@@ -2239,6 +2375,7 @@
|
|
|
2239
2375
|
/**
|
|
2240
2376
|
* Trigger the **Download** action on charts in
|
|
2241
2377
|
* the embedded view.
|
|
2378
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2242
2379
|
* @example
|
|
2243
2380
|
* ```js
|
|
2244
2381
|
* liveboardEmbed.trigger(HostEvent.Download, {vizId:
|
|
@@ -2247,6 +2384,11 @@
|
|
|
2247
2384
|
* ```js
|
|
2248
2385
|
* embed.trigger(HostEvent.Download)
|
|
2249
2386
|
* ```
|
|
2387
|
+
* ```js
|
|
2388
|
+
* spotterEmbed.trigger(HostEvent.Download, {
|
|
2389
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2390
|
+
* });
|
|
2391
|
+
* ```
|
|
2250
2392
|
* @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
|
|
2251
2393
|
* Use {@link DownloadAsPng}
|
|
2252
2394
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
@@ -2263,13 +2405,19 @@
|
|
|
2263
2405
|
* vizEmbed.trigger(HostEvent.DownloadAsPng)
|
|
2264
2406
|
*
|
|
2265
2407
|
* searchEmbed.trigger(HostEvent.DownloadAsPng)
|
|
2408
|
+
*
|
|
2409
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPng, {
|
|
2410
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2411
|
+
* })
|
|
2266
2412
|
* ```
|
|
2413
|
+
*
|
|
2267
2414
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
|
|
2268
2415
|
*/
|
|
2269
2416
|
HostEvent["DownloadAsPng"] = "downloadAsPng";
|
|
2270
2417
|
/**
|
|
2271
2418
|
* Trigger the **Download** > **CSV** action on tables in
|
|
2272
2419
|
* the embedded view.
|
|
2420
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2273
2421
|
* @example
|
|
2274
2422
|
* ```js
|
|
2275
2423
|
* liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
|
|
@@ -2281,12 +2429,18 @@
|
|
|
2281
2429
|
* ```js
|
|
2282
2430
|
* searchEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
2283
2431
|
* ```
|
|
2432
|
+
* ```js
|
|
2433
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsCsv, {
|
|
2434
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2435
|
+
* })
|
|
2436
|
+
* ```
|
|
2284
2437
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2285
2438
|
*/
|
|
2286
2439
|
HostEvent["DownloadAsCsv"] = "downloadAsCSV";
|
|
2287
2440
|
/**
|
|
2288
2441
|
* Trigger the **Download** > **XLSX** action on tables
|
|
2289
2442
|
* in the embedded view.
|
|
2443
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2290
2444
|
* @example
|
|
2291
2445
|
* ```js
|
|
2292
2446
|
* liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
|
|
@@ -2298,6 +2452,11 @@
|
|
|
2298
2452
|
* ```js
|
|
2299
2453
|
* searchEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
2300
2454
|
* ```
|
|
2455
|
+
* ```js
|
|
2456
|
+
* spotterEmbed.trigger(HostEvent.downloadAsXLSX, {
|
|
2457
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2458
|
+
* })
|
|
2459
|
+
* ```
|
|
2301
2460
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2302
2461
|
*/
|
|
2303
2462
|
HostEvent["DownloadAsXlsx"] = "downloadAsXLSX";
|
|
@@ -2317,6 +2476,7 @@
|
|
|
2317
2476
|
/**
|
|
2318
2477
|
* Trigger the **Save** action on a Liveboard or Answer.
|
|
2319
2478
|
* Saves the changes.
|
|
2479
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2320
2480
|
* @example
|
|
2321
2481
|
* ```js
|
|
2322
2482
|
* liveboardEmbed.trigger(HostEvent.Save)
|
|
@@ -2324,6 +2484,11 @@
|
|
|
2324
2484
|
* ```js
|
|
2325
2485
|
* searchEmbed.trigger(HostEvent.Save)
|
|
2326
2486
|
* ```
|
|
2487
|
+
* ```js
|
|
2488
|
+
* spotterEmbed.trigger(HostEvent.Save, {
|
|
2489
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2490
|
+
* })
|
|
2491
|
+
* ```
|
|
2327
2492
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2328
2493
|
*/
|
|
2329
2494
|
HostEvent["Save"] = "save";
|
|
@@ -2607,7 +2772,7 @@
|
|
|
2607
2772
|
HostEvent["ResetLiveboardPersonalisedView"] = "ResetLiveboardPersonalisedView";
|
|
2608
2773
|
/**
|
|
2609
2774
|
* Triggers an action to update Parameter values on embedded
|
|
2610
|
-
* Answers and
|
|
2775
|
+
* Answers, Liveboard and Spotter answer in Edit mode.
|
|
2611
2776
|
*
|
|
2612
2777
|
* @example
|
|
2613
2778
|
* ```js
|
|
@@ -2621,11 +2786,19 @@
|
|
|
2621
2786
|
HostEvent["UpdateParameters"] = "UpdateParameters";
|
|
2622
2787
|
/**
|
|
2623
2788
|
* Triggers GetParameters to fetch the runtime Parameters.
|
|
2789
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2624
2790
|
* ```js
|
|
2625
2791
|
* liveboardEmbed.trigger(HostEvent.GetParameters).then((parameter) => {
|
|
2626
2792
|
* console.log('parameters', parameter);
|
|
2627
2793
|
* });
|
|
2628
2794
|
*```
|
|
2795
|
+
*```js
|
|
2796
|
+
* spotterEmbed.trigger(HostEvent.GetParameters, {
|
|
2797
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2798
|
+
* }).then((parameter) => {
|
|
2799
|
+
* console.log('parameters', parameter);
|
|
2800
|
+
* });
|
|
2801
|
+
*```
|
|
2629
2802
|
* @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
2630
2803
|
*/
|
|
2631
2804
|
HostEvent["GetParameters"] = "GetParameters";
|
|
@@ -2657,7 +2830,7 @@
|
|
|
2657
2830
|
* @param - optional attributes to set Answer properties.
|
|
2658
2831
|
* `name` - Name string for the Answer.
|
|
2659
2832
|
* `description` - Description text for the Answer.
|
|
2660
|
-
*
|
|
2833
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2661
2834
|
* @example
|
|
2662
2835
|
* ```js
|
|
2663
2836
|
* const saveAnswerResponse = await searchEmbed.trigger(HostEvent.SaveAnswer, {
|
|
@@ -2665,6 +2838,14 @@
|
|
|
2665
2838
|
* description: "Total sales by states in MidWest"
|
|
2666
2839
|
* });
|
|
2667
2840
|
* ```
|
|
2841
|
+
* @example
|
|
2842
|
+
* ```js
|
|
2843
|
+
* const saveAnswerResponse = await spotterEmbed.trigger(HostEvent.SaveAnswer, {
|
|
2844
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c',
|
|
2845
|
+
* name: "Sales by states",
|
|
2846
|
+
* description: "Total sales by states in MidWest"
|
|
2847
|
+
* });
|
|
2848
|
+
* ```
|
|
2668
2849
|
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
2669
2850
|
*/
|
|
2670
2851
|
HostEvent["SaveAnswer"] = "saveAnswer";
|
|
@@ -2693,6 +2874,70 @@
|
|
|
2693
2874
|
* @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
|
|
2694
2875
|
*/
|
|
2695
2876
|
HostEvent["TransformTableVizData"] = "TransformTableVizData";
|
|
2877
|
+
/**
|
|
2878
|
+
* Triggers a search operation with the search tokens specified in
|
|
2879
|
+
* the search query string in spotter embed.
|
|
2880
|
+
* @param - `query`: Text string in Natural Language format
|
|
2881
|
+
* @param - `executeSearch`: Boolean to execute search and update search query
|
|
2882
|
+
* @example
|
|
2883
|
+
* ```js
|
|
2884
|
+
* spotterEmbed.trigger(HostEvent.SpotterSearch, {
|
|
2885
|
+
* query: 'revenue per year',
|
|
2886
|
+
* executeSearch: true,
|
|
2887
|
+
* })
|
|
2888
|
+
* ```
|
|
2889
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
2890
|
+
*/
|
|
2891
|
+
HostEvent["SpotterSearch"] = "SpotterSearch";
|
|
2892
|
+
/**
|
|
2893
|
+
* Edits the last prompt in spotter embed.
|
|
2894
|
+
* @param - `query`: Text string
|
|
2895
|
+
* @example
|
|
2896
|
+
* ```js
|
|
2897
|
+
* spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year");
|
|
2898
|
+
* ```
|
|
2899
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
2900
|
+
*/
|
|
2901
|
+
HostEvent["EditLastPrompt"] = "EditLastPrompt";
|
|
2902
|
+
/**
|
|
2903
|
+
* Opens the Worksheet preview modal in Spotter Embed.
|
|
2904
|
+
* @example
|
|
2905
|
+
* ```js
|
|
2906
|
+
* spotterEmbed.trigger(HostEvent.PreviewSpotterData);
|
|
2907
|
+
* ```
|
|
2908
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
2909
|
+
*/
|
|
2910
|
+
HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
2911
|
+
/**
|
|
2912
|
+
* Resets the Spotter Embed Conversation.
|
|
2913
|
+
* @example
|
|
2914
|
+
* ```js
|
|
2915
|
+
* spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
|
|
2916
|
+
* ```
|
|
2917
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
2918
|
+
*/
|
|
2919
|
+
HostEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
2920
|
+
/**
|
|
2921
|
+
* Deletes the last prompt in spotter embed.
|
|
2922
|
+
* @example
|
|
2923
|
+
* ```js
|
|
2924
|
+
* spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
|
|
2925
|
+
* ```
|
|
2926
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
2927
|
+
*/
|
|
2928
|
+
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
2929
|
+
/**
|
|
2930
|
+
* Toggle the visualization to chart or table view.
|
|
2931
|
+
* @param - `vizId ` refers to the answer id in spotter Embed, it is required in spotter Embed.
|
|
2932
|
+
* @example
|
|
2933
|
+
* ```js
|
|
2934
|
+
* spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {
|
|
2935
|
+
* vizId:'b535c760-8bbe-4e6f-bb26-af56b4129a1e'
|
|
2936
|
+
* });
|
|
2937
|
+
*```
|
|
2938
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
2939
|
+
*/
|
|
2940
|
+
HostEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
|
|
2696
2941
|
/**
|
|
2697
2942
|
* @hidden
|
|
2698
2943
|
* Trigger exit from presentation mode when user exits fullscreen.
|
|
@@ -2716,6 +2961,27 @@
|
|
|
2716
2961
|
* @hidden
|
|
2717
2962
|
*/
|
|
2718
2963
|
HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
|
|
2964
|
+
/**
|
|
2965
|
+
* Trigger the *Ask Spotter* action for visualizations
|
|
2966
|
+
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2967
|
+
* @example
|
|
2968
|
+
* ```js
|
|
2969
|
+
* spotterEmbed.trigger(HostEvent.AskSpotter,
|
|
2970
|
+
* {vizId:'730496d6-6903-4601-937e-2c691821af3c'})
|
|
2971
|
+
* ```
|
|
2972
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
2973
|
+
*/
|
|
2974
|
+
HostEvent["AskSpotter"] = "AskSpotter";
|
|
2975
|
+
/**
|
|
2976
|
+
* @hidden
|
|
2977
|
+
* Triggers the update of the embed params.
|
|
2978
|
+
*
|
|
2979
|
+
* @example
|
|
2980
|
+
* ```js
|
|
2981
|
+
* liveboardEmbed.trigger(HostEvent.UpdateEmbedParams, viewConfig);
|
|
2982
|
+
* ```
|
|
2983
|
+
*/
|
|
2984
|
+
HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
|
|
2719
2985
|
})(exports.HostEvent || (exports.HostEvent = {}));
|
|
2720
2986
|
/**
|
|
2721
2987
|
* The different visual modes that the data sources panel within
|
|
@@ -3015,27 +3281,27 @@
|
|
|
3015
3281
|
*/
|
|
3016
3282
|
Action["ConfigureFilter"] = "configureFilter";
|
|
3017
3283
|
/**
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3284
|
+
* The **Collapse data sources** icon on the Search page.
|
|
3285
|
+
* Collapses the panel showing data sources.
|
|
3286
|
+
*
|
|
3287
|
+
* @example
|
|
3288
|
+
* ```js
|
|
3289
|
+
* disabledActions: [Action.CollapseDataPanel]
|
|
3290
|
+
* ```
|
|
3291
|
+
* @version: SDK: 1.1.0 | ThoughtSpot Cloud: ts7.may.cl, 8.4.1.sw
|
|
3292
|
+
*/
|
|
3027
3293
|
Action["CollapseDataSources"] = "collapseDataSources";
|
|
3028
3294
|
/**
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3295
|
+
* The **Collapse data panel** icon on the Search page.
|
|
3296
|
+
* Collapses the data panel view.
|
|
3297
|
+
*
|
|
3298
|
+
* @version: SDK: 1.34.0 | ThoughtSpot Cloud: 10.3.0.cl
|
|
3299
|
+
*
|
|
3300
|
+
* @example
|
|
3301
|
+
* ```js
|
|
3302
|
+
* disabledActions: [Action.CollapseDataPanel]
|
|
3303
|
+
* ```
|
|
3304
|
+
*/
|
|
3039
3305
|
Action["CollapseDataPanel"] = "collapseDataPanel";
|
|
3040
3306
|
/**
|
|
3041
3307
|
* The **Choose sources** button on Search page.
|
|
@@ -3731,6 +3997,17 @@
|
|
|
3731
3997
|
* @version SDK: 1.25.0 | ThoughtSpot Cloud: 9.6.0.cl
|
|
3732
3998
|
*/
|
|
3733
3999
|
Action["EnableContextualChangeAnalysis"] = "enableContextualChangeAnalysis";
|
|
4000
|
+
/**
|
|
4001
|
+
* Action ID to hide or disable Iterative Change Analysis option
|
|
4002
|
+
* on contextual change analysis Inisght charts context menu
|
|
4003
|
+
*
|
|
4004
|
+
* @example
|
|
4005
|
+
* ```js
|
|
4006
|
+
* disabledActions: [Action.EnableIterativeChangeAnalysis]
|
|
4007
|
+
* ```
|
|
4008
|
+
* @version SDK: 1.41.0 | ThoughtSpot Cloud: 9.12.0.cl
|
|
4009
|
+
*/
|
|
4010
|
+
Action["EnableIterativeChangeAnalysis"] = "enableIterativeChangeAnalysis";
|
|
3734
4011
|
/**
|
|
3735
4012
|
* Action ID to hide or disable Natural Language Search query.
|
|
3736
4013
|
*
|
|
@@ -4100,6 +4377,39 @@
|
|
|
4100
4377
|
* @version SDK: 1.39.0 | ThoughtSpot Cloud: 10.10.0.cl
|
|
4101
4378
|
*/
|
|
4102
4379
|
Action["InConversationTraining"] = "InConversationTraining";
|
|
4380
|
+
/**
|
|
4381
|
+
* Action ID to hide the warnings banner in
|
|
4382
|
+
* Spotter results. It's an EA feature and
|
|
4383
|
+
* handled by LD.
|
|
4384
|
+
* @example
|
|
4385
|
+
* ```js
|
|
4386
|
+
* hiddenAction: [Action.SpotterWarningsBanner]
|
|
4387
|
+
* ```
|
|
4388
|
+
* @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl
|
|
4389
|
+
*/
|
|
4390
|
+
Action["SpotterWarningsBanner"] = "SpotterWarningsBanner";
|
|
4391
|
+
/**
|
|
4392
|
+
* Action ID to hide the warnings border on the knowledge
|
|
4393
|
+
* card in Spotter results. It's an EA feature and
|
|
4394
|
+
* handled by LD.
|
|
4395
|
+
* @example
|
|
4396
|
+
* ```js
|
|
4397
|
+
* hiddenAction: [Action.SpotterWarningsOnTokens]
|
|
4398
|
+
* ```
|
|
4399
|
+
* @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl
|
|
4400
|
+
*/
|
|
4401
|
+
Action["SpotterWarningsOnTokens"] = "SpotterWarningsOnTokens";
|
|
4402
|
+
/**
|
|
4403
|
+
* Action ID to disable the click event handler on knowledge
|
|
4404
|
+
* card in Spotter results. It's an EA feature and
|
|
4405
|
+
* handled by LD.
|
|
4406
|
+
* @example
|
|
4407
|
+
* ```js
|
|
4408
|
+
* hiddenAction: [Action.SpotterTokenQuickEdit]
|
|
4409
|
+
* ```
|
|
4410
|
+
* @version SDK: 1.41.0 | ThoughtSpot Cloud: 10.13.0.cl
|
|
4411
|
+
*/
|
|
4412
|
+
Action["SpotterTokenQuickEdit"] = "SpotterTokenQuickEdit";
|
|
4103
4413
|
})(exports.Action || (exports.Action = {}));
|
|
4104
4414
|
var PrefetchFeatures;
|
|
4105
4415
|
(function (PrefetchFeatures) {
|
|
@@ -15579,7 +15889,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15579
15889
|
return e;
|
|
15580
15890
|
}
|
|
15581
15891
|
|
|
15582
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
15892
|
+
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};
|
|
15583
15893
|
|
|
15584
15894
|
/**
|
|
15585
15895
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -15831,7 +16141,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15831
16141
|
this.updateAuthToken = async (_, responder) => {
|
|
15832
16142
|
const { authType } = this.embedConfig;
|
|
15833
16143
|
let { autoLogin } = this.embedConfig;
|
|
15834
|
-
// Default autoLogin: true for cookieless if undefined/null, otherwise
|
|
16144
|
+
// Default autoLogin: true for cookieless if undefined/null, otherwise
|
|
16145
|
+
// false
|
|
15835
16146
|
autoLogin = autoLogin !== null && autoLogin !== void 0 ? autoLogin : (authType === AuthType.TrustedAuthTokenCookieless);
|
|
15836
16147
|
if (autoLogin && authType === AuthType.TrustedAuthTokenCookieless) {
|
|
15837
16148
|
try {
|
|
@@ -15882,8 +16193,42 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15882
16193
|
this.on(exports.EmbedEvent.APP_INIT, this.appInitCb, { start: false }, true);
|
|
15883
16194
|
this.on(exports.EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
|
|
15884
16195
|
this.on(exports.EmbedEvent.IdleSessionTimeout, this.idleSessionTimeout, { start: false }, true);
|
|
16196
|
+
const embedListenerReadyHandler = this.createEmbedContainerHandler(exports.EmbedEvent.EmbedListenerReady);
|
|
16197
|
+
this.on(exports.EmbedEvent.EmbedListenerReady, embedListenerReadyHandler, { start: false }, true);
|
|
16198
|
+
const authInitHandler = this.createEmbedContainerHandler(exports.EmbedEvent.AuthInit);
|
|
16199
|
+
this.on(exports.EmbedEvent.AuthInit, authInitHandler, { start: false }, true);
|
|
15885
16200
|
};
|
|
15886
16201
|
this.showPreRenderByDefault = false;
|
|
16202
|
+
/**
|
|
16203
|
+
* @hidden
|
|
16204
|
+
* Internal state to track if the embed container is loaded.
|
|
16205
|
+
* This is used to trigger events after the embed container is loaded.
|
|
16206
|
+
*/
|
|
16207
|
+
this.isEmbedContainerLoaded = false;
|
|
16208
|
+
/**
|
|
16209
|
+
* @hidden
|
|
16210
|
+
* Internal state to track the callbacks to be executed after the embed container
|
|
16211
|
+
* is loaded.
|
|
16212
|
+
* This is used to trigger events after the embed container is loaded.
|
|
16213
|
+
*/
|
|
16214
|
+
this.embedContainerReadyCallbacks = [];
|
|
16215
|
+
this.createEmbedContainerHandler = (source) => () => {
|
|
16216
|
+
const processEmbedContainerReady = () => {
|
|
16217
|
+
logger$3.debug('processEmbedContainerReady');
|
|
16218
|
+
this.isEmbedContainerLoaded = true;
|
|
16219
|
+
this.executeEmbedContainerReadyCallbacks();
|
|
16220
|
+
};
|
|
16221
|
+
if (source === exports.EmbedEvent.AuthInit) {
|
|
16222
|
+
const AUTH_INIT_FALLBACK_DELAY = 1000;
|
|
16223
|
+
// Wait for 1 second to ensure the embed container is loaded
|
|
16224
|
+
// This is a workaround to ensure the embed container is loaded
|
|
16225
|
+
// this is needed until all clusters have EmbedListenerReady event
|
|
16226
|
+
setTimeout(processEmbedContainerReady, AUTH_INIT_FALLBACK_DELAY);
|
|
16227
|
+
}
|
|
16228
|
+
else if (source === exports.EmbedEvent.EmbedListenerReady) {
|
|
16229
|
+
processEmbedContainerReady();
|
|
16230
|
+
}
|
|
16231
|
+
};
|
|
15887
16232
|
this.validatePreRenderViewConfig = (viewConfig) => {
|
|
15888
16233
|
var _a;
|
|
15889
16234
|
const preRenderAllowedKeys = ['preRenderId', 'vizId', 'liveboardId'];
|
|
@@ -15917,10 +16262,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15917
16262
|
uploadMixpanelEvent(MIXPANEL_EVENT.VISUAL_SDK_EMBED_CREATE, {
|
|
15918
16263
|
...viewConfig,
|
|
15919
16264
|
});
|
|
16265
|
+
const embedConfig = getEmbedConfig();
|
|
16266
|
+
this.embedConfig = embedConfig;
|
|
15920
16267
|
this.hostEventClient = new HostEventClient(this.iFrame);
|
|
15921
16268
|
this.isReadyForRenderPromise = getInitPromise().then(async () => {
|
|
15922
|
-
const embedConfig = getEmbedConfig();
|
|
15923
|
-
this.embedConfig = embedConfig;
|
|
15924
16269
|
if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
|
|
15925
16270
|
this.embedConfig.authTriggerContainer = domSelector;
|
|
15926
16271
|
}
|
|
@@ -15953,7 +16298,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15953
16298
|
*/
|
|
15954
16299
|
getEventType(event) {
|
|
15955
16300
|
var _a, _b;
|
|
15956
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
15957
16301
|
return ((_a = event.data) === null || _a === void 0 ? void 0 : _a.type) || ((_b = event.data) === null || _b === void 0 ? void 0 : _b.__type);
|
|
15958
16302
|
}
|
|
15959
16303
|
/**
|
|
@@ -16106,6 +16450,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16106
16450
|
.join('/');
|
|
16107
16451
|
return `${basePath}#`;
|
|
16108
16452
|
}
|
|
16453
|
+
getUpdateEmbedParamsObject() {
|
|
16454
|
+
let queryParams = this.getEmbedParamsObject();
|
|
16455
|
+
queryParams = { ...this.viewConfig, ...queryParams };
|
|
16456
|
+
return queryParams;
|
|
16457
|
+
}
|
|
16109
16458
|
/**
|
|
16110
16459
|
* Common query params set for all the embed modes.
|
|
16111
16460
|
* @param queryParams
|
|
@@ -16255,9 +16604,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16255
16604
|
return path;
|
|
16256
16605
|
}
|
|
16257
16606
|
getEmbedParams() {
|
|
16258
|
-
const queryParams = this.
|
|
16607
|
+
const queryParams = this.getEmbedParamsObject();
|
|
16259
16608
|
return getQueryParamString(queryParams);
|
|
16260
16609
|
}
|
|
16610
|
+
getEmbedParamsObject() {
|
|
16611
|
+
const params = this.getBaseQueryParams();
|
|
16612
|
+
return params;
|
|
16613
|
+
}
|
|
16261
16614
|
getRootIframeSrc() {
|
|
16262
16615
|
const query = this.getEmbedParams();
|
|
16263
16616
|
return this.getEmbedBasePath(query);
|
|
@@ -16356,7 +16709,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16356
16709
|
}
|
|
16357
16710
|
});
|
|
16358
16711
|
}
|
|
16359
|
-
// Setup fullscreen change handler after iframe is
|
|
16712
|
+
// Setup fullscreen change handler after iframe is
|
|
16713
|
+
// loaded and ready
|
|
16360
16714
|
this.setupFullscreenChangeHandler();
|
|
16361
16715
|
});
|
|
16362
16716
|
this.iFrame.addEventListener('error', () => {
|
|
@@ -16458,7 +16812,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16458
16812
|
const div = document.createElement('div');
|
|
16459
16813
|
div.innerHTML = child;
|
|
16460
16814
|
div.id = TS_EMBED_ID;
|
|
16461
|
-
// eslint-disable-next-line no-param-reassign
|
|
16462
16815
|
child = div;
|
|
16463
16816
|
}
|
|
16464
16817
|
if (((_a = this.el.nextElementSibling) === null || _a === void 0 ? void 0 : _a.id) === TS_EMBED_ID) {
|
|
@@ -16637,6 +16990,43 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16637
16990
|
logger$3.log('Event Port is not defined');
|
|
16638
16991
|
}
|
|
16639
16992
|
}
|
|
16993
|
+
getPreRenderObj() {
|
|
16994
|
+
var _a;
|
|
16995
|
+
const embedObj = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
|
|
16996
|
+
if (embedObj === this) {
|
|
16997
|
+
logger$3.info('embedObj is same as this');
|
|
16998
|
+
}
|
|
16999
|
+
return embedObj;
|
|
17000
|
+
}
|
|
17001
|
+
checkEmbedContainerLoaded() {
|
|
17002
|
+
if (this.isEmbedContainerLoaded)
|
|
17003
|
+
return true;
|
|
17004
|
+
const preRenderObj = this.getPreRenderObj();
|
|
17005
|
+
if (preRenderObj && preRenderObj.isEmbedContainerLoaded) {
|
|
17006
|
+
this.isEmbedContainerLoaded = true;
|
|
17007
|
+
}
|
|
17008
|
+
return this.isEmbedContainerLoaded;
|
|
17009
|
+
}
|
|
17010
|
+
executeEmbedContainerReadyCallbacks() {
|
|
17011
|
+
logger$3.debug('executePendingEvents', this.embedContainerReadyCallbacks);
|
|
17012
|
+
this.embedContainerReadyCallbacks.forEach((callback) => {
|
|
17013
|
+
callback === null || callback === void 0 ? void 0 : callback();
|
|
17014
|
+
});
|
|
17015
|
+
this.embedContainerReadyCallbacks = [];
|
|
17016
|
+
}
|
|
17017
|
+
/**
|
|
17018
|
+
* Executes a callback after the embed container is loaded.
|
|
17019
|
+
* @param callback The callback to execute
|
|
17020
|
+
*/
|
|
17021
|
+
executeAfterEmbedContainerLoaded(callback) {
|
|
17022
|
+
if (this.checkEmbedContainerLoaded()) {
|
|
17023
|
+
callback === null || callback === void 0 ? void 0 : callback();
|
|
17024
|
+
}
|
|
17025
|
+
else {
|
|
17026
|
+
logger$3.debug('pushing callback to embedContainerReadyCallbacks', callback);
|
|
17027
|
+
this.embedContainerReadyCallbacks.push(callback);
|
|
17028
|
+
}
|
|
17029
|
+
}
|
|
16640
17030
|
/**
|
|
16641
17031
|
* Triggers an event to the embedded app
|
|
16642
17032
|
* @param {HostEvent} messageType The event type
|
|
@@ -16781,7 +17171,12 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16781
17171
|
return this.preRender(true);
|
|
16782
17172
|
}
|
|
16783
17173
|
this.validatePreRenderViewConfig(this.viewConfig);
|
|
17174
|
+
logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
|
|
17175
|
+
this.executeAfterEmbedContainerLoaded(() => {
|
|
17176
|
+
this.trigger(exports.HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
|
|
17177
|
+
});
|
|
16784
17178
|
}
|
|
17179
|
+
this.beforePrerenderVisible();
|
|
16785
17180
|
if (this.el) {
|
|
16786
17181
|
this.syncPreRenderStyle();
|
|
16787
17182
|
if (!this.viewConfig.doNotTrackPreRenderSize) {
|
|
@@ -16798,7 +17193,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16798
17193
|
this.resizeObserver.observe(this.el);
|
|
16799
17194
|
}
|
|
16800
17195
|
}
|
|
16801
|
-
this.beforePrerenderVisible();
|
|
16802
17196
|
removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
|
|
16803
17197
|
this.subscribeToEvents();
|
|
16804
17198
|
// Setup fullscreen change handler for prerendered components
|
|
@@ -16891,7 +17285,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16891
17285
|
const isFullscreen = !!document.fullscreenElement;
|
|
16892
17286
|
if (!isFullscreen) {
|
|
16893
17287
|
logger$3.info('Exited fullscreen mode - triggering ExitPresentMode');
|
|
16894
|
-
// Only trigger if iframe is available and contentWindow is
|
|
17288
|
+
// Only trigger if iframe is available and contentWindow is
|
|
17289
|
+
// accessible
|
|
16895
17290
|
if (this.iFrame && this.iFrame.contentWindow) {
|
|
16896
17291
|
this.trigger(exports.HostEvent.ExitPresentMode);
|
|
16897
17292
|
}
|
|
@@ -16925,7 +17320,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16925
17320
|
* Only for testing purposes.
|
|
16926
17321
|
* @hidden
|
|
16927
17322
|
*/
|
|
16928
|
-
// eslint-disable-next-line camelcase
|
|
16929
17323
|
this.test__executeCallbacks = this.executeCallbacks;
|
|
16930
17324
|
this.viewConfig = { excludeRuntimeFiltersfromURL: false, ...viewConfig };
|
|
16931
17325
|
}
|
|
@@ -16987,15 +17381,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16987
17381
|
this.embedComponentType = 'SearchBarEmbed';
|
|
16988
17382
|
this.viewConfig = viewConfig;
|
|
16989
17383
|
}
|
|
16990
|
-
|
|
16991
|
-
* Construct the URL of the embedded ThoughtSpot search to be
|
|
16992
|
-
* loaded in the iframe
|
|
16993
|
-
* @param dataSources A list of data source GUIDs
|
|
16994
|
-
*/
|
|
16995
|
-
getIFrameSrc() {
|
|
17384
|
+
getEmbedParamsObject() {
|
|
16996
17385
|
var _a;
|
|
16997
17386
|
const { searchOptions, dataSource, dataSources, useLastSelectedSources = false, excludeSearchTokenStringFromURL, } = this.viewConfig;
|
|
16998
|
-
const path = 'search-bar-embed';
|
|
16999
17387
|
const queryParams = this.getBaseQueryParams();
|
|
17000
17388
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
17001
17389
|
if (dataSources && dataSources.length) {
|
|
@@ -17017,6 +17405,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17017
17405
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
17018
17406
|
}
|
|
17019
17407
|
queryParams[Param.searchEmbed] = true;
|
|
17408
|
+
return queryParams;
|
|
17409
|
+
}
|
|
17410
|
+
/**
|
|
17411
|
+
* Construct the URL of the embedded ThoughtSpot search to be
|
|
17412
|
+
* loaded in the iframe
|
|
17413
|
+
* @param dataSources A list of data source GUIDs
|
|
17414
|
+
*/
|
|
17415
|
+
getIFrameSrc() {
|
|
17416
|
+
const queryParams = this.getEmbedParamsObject();
|
|
17417
|
+
const path = 'search-bar-embed';
|
|
17020
17418
|
let query = '';
|
|
17021
17419
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
17022
17420
|
if (queryParamsString) {
|
|
@@ -17067,12 +17465,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17067
17465
|
viewConfig.embedComponentType = 'SageEmbed';
|
|
17068
17466
|
super(domSelector, viewConfig);
|
|
17069
17467
|
}
|
|
17070
|
-
|
|
17071
|
-
* Constructs a map of parameters to be passed on to the
|
|
17072
|
-
* embedded Eureka or Sage search page.
|
|
17073
|
-
* @returns {string} query string
|
|
17074
|
-
*/
|
|
17075
|
-
getEmbedParams() {
|
|
17468
|
+
getEmbedParamsObject() {
|
|
17076
17469
|
const { disableWorksheetChange, hideWorksheetSelector, showObjectSuggestions, dataPanelV2, hideSampleQuestions, isProductTour, hideSageAnswerHeader, hideAutocompleteSuggestions, } = this.viewConfig;
|
|
17077
17470
|
const params = this.getBaseQueryParams();
|
|
17078
17471
|
params[Param.DataPanelV2Enabled] = !!dataPanelV2;
|
|
@@ -17087,6 +17480,15 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17087
17480
|
params[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
17088
17481
|
params[Param.IsProductTour] = !!isProductTour;
|
|
17089
17482
|
params[Param.HideSageAnswerHeader] = !!hideSageAnswerHeader;
|
|
17483
|
+
return params;
|
|
17484
|
+
}
|
|
17485
|
+
/**
|
|
17486
|
+
* Constructs a map of parameters to be passed on to the
|
|
17487
|
+
* embedded Eureka or Sage search page.
|
|
17488
|
+
* @returns {string} query string
|
|
17489
|
+
*/
|
|
17490
|
+
getEmbedParams() {
|
|
17491
|
+
const params = this.getEmbedParamsObject();
|
|
17090
17492
|
return getQueryParamString(params, true);
|
|
17091
17493
|
}
|
|
17092
17494
|
/**
|
|
@@ -17196,11 +17598,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17196
17598
|
const defaultAppInitData = await super.getAppInitData();
|
|
17197
17599
|
return { ...defaultAppInitData, ...this.getSearchInitData() };
|
|
17198
17600
|
}
|
|
17199
|
-
|
|
17601
|
+
getEmbedParamsObject() {
|
|
17200
17602
|
var _a;
|
|
17201
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
|
|
17202
|
-
/* eslint-disable-next-line max-len */
|
|
17203
|
-
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
|
|
17603
|
+
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
|
|
17204
17604
|
const queryParams = this.getBaseQueryParams();
|
|
17205
17605
|
queryParams[Param.HideActions] = [
|
|
17206
17606
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -17233,7 +17633,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17233
17633
|
queryParams[Param.HideSearchBar] = true;
|
|
17234
17634
|
}
|
|
17235
17635
|
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
17236
|
-
/* eslint-disable-next-line max-len */
|
|
17237
17636
|
queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
17238
17637
|
}
|
|
17239
17638
|
if (!focusSearchBarOnRender) {
|
|
@@ -17246,20 +17645,22 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17246
17645
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
17247
17646
|
}
|
|
17248
17647
|
queryParams[Param.searchEmbed] = true;
|
|
17249
|
-
/* eslint-disable-next-line max-len */
|
|
17250
17648
|
queryParams[Param.CollapseSearchBarInitially] = collapseSearchBarInitially || collapseSearchBar;
|
|
17251
17649
|
queryParams[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
17252
17650
|
if (dataPanelCustomGroupsAccordionInitialState
|
|
17253
17651
|
=== DataPanelCustomColumnGroupsAccordionState$1.COLLAPSE_ALL
|
|
17254
17652
|
|| dataPanelCustomGroupsAccordionInitialState
|
|
17255
17653
|
=== DataPanelCustomColumnGroupsAccordionState$1.EXPAND_FIRST) {
|
|
17256
|
-
/* eslint-disable-next-line max-len */
|
|
17257
17654
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
|
|
17258
17655
|
}
|
|
17259
17656
|
else {
|
|
17260
|
-
/* eslint-disable-next-line max-len */
|
|
17261
17657
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL;
|
|
17262
17658
|
}
|
|
17659
|
+
return queryParams;
|
|
17660
|
+
}
|
|
17661
|
+
getEmbedParams() {
|
|
17662
|
+
const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
|
|
17663
|
+
const queryParams = this.getEmbedParamsObject();
|
|
17263
17664
|
let query = '';
|
|
17264
17665
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
17265
17666
|
if (queryParamsString) {
|
|
@@ -17565,10 +17966,18 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17565
17966
|
else {
|
|
17566
17967
|
params[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL;
|
|
17567
17968
|
}
|
|
17969
|
+
// Set navigation to v2 by default to avoid problems like the app
|
|
17970
|
+
// switcher (9-dot menu) not showing when v3 navigation is turned on
|
|
17971
|
+
// at the cluster level.
|
|
17972
|
+
// To use v3 navigation, we must manually set the discoveryExperience
|
|
17973
|
+
// settings.
|
|
17974
|
+
params[Param.NavigationVersion] = 'v2';
|
|
17568
17975
|
if (discoveryExperience) {
|
|
17569
17976
|
// primaryNavbarVersion v3 will enabled the new left navigation
|
|
17570
17977
|
if (discoveryExperience.primaryNavbarVersion === PrimaryNavbarVersion.Sliding) {
|
|
17571
17978
|
params[Param.NavigationVersion] = discoveryExperience.primaryNavbarVersion;
|
|
17979
|
+
// Enable the modularHomeExperience when Sliding is enabled.
|
|
17980
|
+
params[Param.ModularHomeExperienceEnabled] = true;
|
|
17572
17981
|
}
|
|
17573
17982
|
// homePage v2 will enable the modular home page
|
|
17574
17983
|
// and it will override the modularHomeExperience value
|
|
@@ -17741,7 +18150,7 @@ query GetEurekaVizSnapshots(
|
|
|
17741
18150
|
return;
|
|
17742
18151
|
}
|
|
17743
18152
|
const previewStyles = `
|
|
17744
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community@32.0.2/styles/ag-grid.min.css">
|
|
18153
|
+
<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">
|
|
17745
18154
|
<style id="ts-preview-style">
|
|
17746
18155
|
.ts-viz-preview-loader {
|
|
17747
18156
|
position: absolute;
|
|
@@ -17852,6 +18261,16 @@ query GetEurekaVizSnapshots(
|
|
|
17852
18261
|
}
|
|
17853
18262
|
this.setIFrameHeight(frameHeight || this.defaultHeight);
|
|
17854
18263
|
};
|
|
18264
|
+
/**
|
|
18265
|
+
* @hidden
|
|
18266
|
+
* Internal state to track the current liveboard id.
|
|
18267
|
+
* This is used to navigate to the correct liveboard when the prerender is visible.
|
|
18268
|
+
*/
|
|
18269
|
+
this.currentLiveboardState = {
|
|
18270
|
+
liveboardId: this.viewConfig.liveboardId,
|
|
18271
|
+
vizId: this.viewConfig.vizId,
|
|
18272
|
+
activeTabId: this.viewConfig.activeTabId,
|
|
18273
|
+
};
|
|
17855
18274
|
if (this.viewConfig.fullHeight === true) {
|
|
17856
18275
|
if (this.viewConfig.vizId) {
|
|
17857
18276
|
logger$3.warn('Full height is currently only supported for Liveboard embeds.' +
|
|
@@ -17868,6 +18287,11 @@ query GetEurekaVizSnapshots(
|
|
|
17868
18287
|
* embedded Liveboard or visualization.
|
|
17869
18288
|
*/
|
|
17870
18289
|
getEmbedParams() {
|
|
18290
|
+
const params = this.getEmbedParamsObject();
|
|
18291
|
+
const queryParams = getQueryParamString(params, true);
|
|
18292
|
+
return queryParams;
|
|
18293
|
+
}
|
|
18294
|
+
getEmbedParamsObject() {
|
|
17871
18295
|
let params = {};
|
|
17872
18296
|
params = this.getBaseQueryParams(params);
|
|
17873
18297
|
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;
|
|
@@ -17937,8 +18361,27 @@ query GetEurekaVizSnapshots(
|
|
|
17937
18361
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
17938
18362
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
17939
18363
|
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
17940
|
-
|
|
17941
|
-
|
|
18364
|
+
if (oAuthPollingInterval !== undefined) {
|
|
18365
|
+
params[Param.OauthPollingInterval] = oAuthPollingInterval;
|
|
18366
|
+
}
|
|
18367
|
+
if (isForceRedirect) {
|
|
18368
|
+
params[Param.IsForceRedirect] = isForceRedirect;
|
|
18369
|
+
}
|
|
18370
|
+
if (dataSourceId !== undefined) {
|
|
18371
|
+
params[Param.DataSourceId] = dataSourceId;
|
|
18372
|
+
}
|
|
18373
|
+
if (isLiveboardStylingAndGroupingEnabled !== undefined) {
|
|
18374
|
+
params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
|
|
18375
|
+
}
|
|
18376
|
+
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
18377
|
+
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
18378
|
+
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
18379
|
+
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
|
|
18380
|
+
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
18381
|
+
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
18382
|
+
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
18383
|
+
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
18384
|
+
return params;
|
|
17942
18385
|
}
|
|
17943
18386
|
getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
|
|
17944
18387
|
let suffix = `/embed/viz/${liveboardId}`;
|
|
@@ -18000,16 +18443,17 @@ query GetEurekaVizSnapshots(
|
|
|
18000
18443
|
}
|
|
18001
18444
|
}
|
|
18002
18445
|
beforePrerenderVisible() {
|
|
18003
|
-
|
|
18004
|
-
|
|
18005
|
-
|
|
18006
|
-
|
|
18007
|
-
|
|
18008
|
-
|
|
18009
|
-
|
|
18010
|
-
|
|
18011
|
-
|
|
18012
|
-
|
|
18446
|
+
const embedObj = this.getPreRenderObj();
|
|
18447
|
+
this.executeAfterEmbedContainerLoaded(() => {
|
|
18448
|
+
this.navigateToLiveboard(this.viewConfig.liveboardId, this.viewConfig.vizId, this.viewConfig.activeTabId);
|
|
18449
|
+
if (embedObj) {
|
|
18450
|
+
embedObj.currentLiveboardState = {
|
|
18451
|
+
liveboardId: this.viewConfig.liveboardId,
|
|
18452
|
+
vizId: this.viewConfig.vizId,
|
|
18453
|
+
activeTabId: this.viewConfig.activeTabId,
|
|
18454
|
+
};
|
|
18455
|
+
}
|
|
18456
|
+
});
|
|
18013
18457
|
}
|
|
18014
18458
|
async handleRenderForPrerender() {
|
|
18015
18459
|
if (isUndefined$1(this.viewConfig.liveboardId)) {
|
|
@@ -18467,7 +18911,11 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18467
18911
|
return {
|
|
18468
18912
|
convId: this.conversationId,
|
|
18469
18913
|
messageId: responses[0].msgId,
|
|
18470
|
-
data:
|
|
18914
|
+
data: {
|
|
18915
|
+
...data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
|
|
18916
|
+
convId: this.conversationId,
|
|
18917
|
+
messageId: responses[0].msgId,
|
|
18918
|
+
},
|
|
18471
18919
|
error: null,
|
|
18472
18920
|
};
|
|
18473
18921
|
}
|
|
@@ -18491,13 +18939,17 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18491
18939
|
super(container, viewConfig);
|
|
18492
18940
|
this.viewConfig = viewConfig;
|
|
18493
18941
|
}
|
|
18494
|
-
|
|
18942
|
+
getEmbedParamsObject() {
|
|
18495
18943
|
var _a;
|
|
18496
|
-
const { sessionId, genNo, acSessionId, acGenNo, } = this.viewConfig;
|
|
18497
|
-
const path = 'conv-assist-answer';
|
|
18498
18944
|
const queryParams = this.getBaseQueryParams();
|
|
18499
18945
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
18500
18946
|
queryParams[Param.isSpotterAgentEmbed] = true;
|
|
18947
|
+
return queryParams;
|
|
18948
|
+
}
|
|
18949
|
+
getIframeSrc() {
|
|
18950
|
+
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
18951
|
+
const path = 'conv-assist-answer';
|
|
18952
|
+
const queryParams = this.getEmbedParamsObject();
|
|
18501
18953
|
let query = '';
|
|
18502
18954
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
18503
18955
|
if (queryParamsString) {
|
|
@@ -18508,6 +18960,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18508
18960
|
genNo,
|
|
18509
18961
|
acSessionId,
|
|
18510
18962
|
acGenNo,
|
|
18963
|
+
convId,
|
|
18964
|
+
messageId,
|
|
18511
18965
|
});
|
|
18512
18966
|
return `${this.getEmbedBasePath(query)}/embed/${path}${tsPostHashParams}`;
|
|
18513
18967
|
}
|
|
@@ -18551,6 +19005,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18551
19005
|
const container = document.createElement('div');
|
|
18552
19006
|
const embed = new ConversationMessage$1(container, {
|
|
18553
19007
|
...this.viewConfig,
|
|
19008
|
+
convId: data.convId,
|
|
19009
|
+
messageId: data.messageId,
|
|
18554
19010
|
sessionId: data.sessionId,
|
|
18555
19011
|
genNo: data.genNo,
|
|
18556
19012
|
acSessionId: data.stateKey.transactionId,
|
|
@@ -18571,6 +19027,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18571
19027
|
return { error };
|
|
18572
19028
|
}
|
|
18573
19029
|
return { data: {
|
|
19030
|
+
convId: data.convId,
|
|
19031
|
+
messageId: data.messageId,
|
|
18574
19032
|
sessionId: data.sessionId,
|
|
18575
19033
|
genNo: data.genNo,
|
|
18576
19034
|
acSessionId: data.stateKey.transactionId,
|
|
@@ -18647,9 +19105,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18647
19105
|
super(container, viewConfig);
|
|
18648
19106
|
this.viewConfig = viewConfig;
|
|
18649
19107
|
}
|
|
18650
|
-
|
|
18651
|
-
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, } = this.viewConfig;
|
|
18652
|
-
const path = 'insights/conv-assist';
|
|
19108
|
+
getEmbedParamsObject() {
|
|
19109
|
+
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
18653
19110
|
if (!worksheetId) {
|
|
18654
19111
|
this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
|
|
18655
19112
|
}
|
|
@@ -18670,11 +19127,25 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18670
19127
|
if (!isUndefined_1(hideSampleQuestions)) {
|
|
18671
19128
|
queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
18672
19129
|
}
|
|
19130
|
+
return queryParams;
|
|
19131
|
+
}
|
|
19132
|
+
getIframeSrc() {
|
|
19133
|
+
const { worksheetId, searchOptions, runtimeFilters, excludeRuntimeFiltersfromURL, runtimeParameters, excludeRuntimeParametersfromURL, } = this.viewConfig;
|
|
19134
|
+
const path = 'insights/conv-assist';
|
|
19135
|
+
const queryParams = this.getEmbedParamsObject();
|
|
18673
19136
|
let query = '';
|
|
18674
19137
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
18675
19138
|
if (queryParamsString) {
|
|
18676
19139
|
query = `?${queryParamsString}`;
|
|
18677
19140
|
}
|
|
19141
|
+
const filterQuery = getFilterQuery(runtimeFilters || []);
|
|
19142
|
+
if (filterQuery && !excludeRuntimeFiltersfromURL) {
|
|
19143
|
+
query += `&${filterQuery}`;
|
|
19144
|
+
}
|
|
19145
|
+
const parameterQuery = getRuntimeParameters(runtimeParameters || []);
|
|
19146
|
+
if (parameterQuery && !excludeRuntimeParametersfromURL) {
|
|
19147
|
+
query += `&${parameterQuery}`;
|
|
19148
|
+
}
|
|
18678
19149
|
const tsPostHashParams = this.getThoughtSpotPostUrlParams({
|
|
18679
19150
|
worksheet: worksheetId,
|
|
18680
19151
|
query: (searchOptions === null || searchOptions === void 0 ? void 0 : searchOptions.searchQuery) || '',
|