@thoughtspot/visual-embed-sdk 1.39.2 → 1.39.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/package.json +1 -1
- package/cjs/src/config.spec.js +9 -0
- package/cjs/src/config.spec.js.map +1 -1
- package/cjs/src/embed/app.d.ts +19 -15
- package/cjs/src/embed/app.d.ts.map +1 -1
- package/cjs/src/embed/app.js +23 -2
- package/cjs/src/embed/app.js.map +1 -1
- package/cjs/src/embed/app.spec.js +56 -8
- package/cjs/src/embed/app.spec.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.d.ts +23 -7
- package/cjs/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/cjs/src/embed/bodyless-conversation.js +31 -5
- package/cjs/src/embed/bodyless-conversation.js.map +1 -1
- package/cjs/src/embed/bodyless-conversation.spec.js +8 -190
- package/cjs/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/cjs/src/embed/conversation.spec.js +28 -0
- package/cjs/src/embed/conversation.spec.js.map +1 -1
- package/cjs/src/embed/embedConfig.d.ts +9 -7
- package/cjs/src/embed/embedConfig.d.ts.map +1 -1
- package/cjs/src/embed/embedConfig.js +9 -7
- package/cjs/src/embed/embedConfig.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +0 -17
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +2 -4
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +12 -11
- package/cjs/src/embed/liveboard.spec.js.map +1 -1
- package/cjs/src/errors.d.ts +1 -0
- package/cjs/src/errors.d.ts.map +1 -1
- package/cjs/src/errors.js +1 -0
- package/cjs/src/errors.js.map +1 -1
- package/cjs/src/index.d.ts +2 -2
- package/cjs/src/index.d.ts.map +1 -1
- package/cjs/src/index.js +2 -1
- package/cjs/src/index.js.map +1 -1
- package/cjs/src/react/all-types-export.d.ts +1 -1
- package/cjs/src/react/all-types-export.d.ts.map +1 -1
- package/cjs/src/react/all-types-export.js +3 -2
- package/cjs/src/react/all-types-export.js.map +1 -1
- package/cjs/src/react/index.d.ts +73 -20
- package/cjs/src/react/index.d.ts.map +1 -1
- package/cjs/src/react/index.js +79 -42
- package/cjs/src/react/index.js.map +1 -1
- package/cjs/src/react/index.spec.js +438 -100
- package/cjs/src/react/index.spec.js.map +1 -1
- package/cjs/src/types.d.ts +262 -6
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +228 -2
- package/cjs/src/types.js.map +1 -1
- package/cjs/src/utils/global-styles.js +1 -1
- package/cjs/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
- package/cjs/src/utils/graphql/nlsService/conversation-service.js +7 -1
- package/cjs/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
- package/cjs/src/utils.spec.js +25 -0
- package/cjs/src/utils.spec.js.map +1 -1
- package/dist/{index-CmEQfuE3.js → index-ZrE8YYq8.js} +1 -1
- package/dist/src/embed/app.d.ts +19 -15
- package/dist/src/embed/app.d.ts.map +1 -1
- package/dist/src/embed/bodyless-conversation.d.ts +23 -7
- package/dist/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/dist/src/embed/embedConfig.d.ts +9 -7
- package/dist/src/embed/embedConfig.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +0 -17
- package/dist/src/embed/liveboard.d.ts.map +1 -1
- package/dist/src/errors.d.ts +1 -0
- package/dist/src/errors.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/react/all-types-export.d.ts +1 -1
- package/dist/src/react/all-types-export.d.ts.map +1 -1
- package/dist/src/react/index.d.ts +73 -20
- package/dist/src/react/index.d.ts.map +1 -1
- package/dist/src/types.d.ts +262 -6
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +385 -71
- package/dist/tsembed-react.js +385 -69
- package/dist/tsembed.es.js +303 -24
- package/dist/tsembed.js +301 -22
- package/dist/visual-embed-sdk-react-full.d.ts +386 -72
- package/dist/visual-embed-sdk-react.d.ts +386 -72
- package/dist/visual-embed-sdk.d.ts +314 -53
- package/lib/package.json +1 -1
- package/lib/src/config.spec.js +9 -0
- package/lib/src/config.spec.js.map +1 -1
- package/lib/src/embed/app.d.ts +19 -15
- package/lib/src/embed/app.d.ts.map +1 -1
- package/lib/src/embed/app.js +22 -1
- package/lib/src/embed/app.js.map +1 -1
- package/lib/src/embed/app.spec.js +58 -10
- package/lib/src/embed/app.spec.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.d.ts +23 -7
- package/lib/src/embed/bodyless-conversation.d.ts.map +1 -1
- package/lib/src/embed/bodyless-conversation.js +30 -5
- package/lib/src/embed/bodyless-conversation.js.map +1 -1
- package/lib/src/embed/bodyless-conversation.spec.js +9 -191
- package/lib/src/embed/bodyless-conversation.spec.js.map +1 -1
- package/lib/src/embed/conversation.spec.js +30 -2
- package/lib/src/embed/conversation.spec.js.map +1 -1
- package/lib/src/embed/embedConfig.d.ts +9 -7
- package/lib/src/embed/embedConfig.d.ts.map +1 -1
- package/lib/src/embed/embedConfig.js +9 -7
- package/lib/src/embed/embedConfig.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +0 -17
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +2 -4
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +12 -11
- package/lib/src/embed/liveboard.spec.js.map +1 -1
- package/lib/src/errors.d.ts +1 -0
- package/lib/src/errors.d.ts.map +1 -1
- package/lib/src/errors.js +1 -0
- package/lib/src/errors.js.map +1 -1
- package/lib/src/index.d.ts +2 -2
- package/lib/src/index.d.ts.map +1 -1
- package/lib/src/index.js +2 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/react/all-types-export.d.ts +1 -1
- package/lib/src/react/all-types-export.d.ts.map +1 -1
- package/lib/src/react/all-types-export.js +1 -1
- package/lib/src/react/all-types-export.js.map +1 -1
- package/lib/src/react/index.d.ts +73 -20
- package/lib/src/react/index.d.ts.map +1 -1
- package/lib/src/react/index.js +79 -43
- package/lib/src/react/index.js.map +1 -1
- package/lib/src/react/index.spec.js +441 -103
- package/lib/src/react/index.spec.js.map +1 -1
- package/lib/src/types.d.ts +262 -6
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +228 -2
- package/lib/src/types.js.map +1 -1
- package/lib/src/utils/global-styles.js +1 -1
- package/lib/src/utils/graphql/nlsService/conversation-service.d.ts.map +1 -1
- package/lib/src/utils/graphql/nlsService/conversation-service.js +7 -1
- package/lib/src/utils/graphql/nlsService/conversation-service.js.map +1 -1
- package/lib/src/utils.spec.js +26 -1
- package/lib/src/utils.spec.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +315 -54
- package/package.json +1 -1
- package/src/config.spec.ts +11 -0
- package/src/embed/app.spec.ts +90 -23
- package/src/embed/app.ts +27 -15
- package/src/embed/bodyless-conversation.spec.ts +9 -203
- package/src/embed/bodyless-conversation.ts +34 -10
- package/src/embed/conversation.spec.ts +40 -2
- package/src/embed/embedConfig.ts +10 -8
- package/src/embed/liveboard.spec.ts +5 -4
- package/src/embed/liveboard.ts +2 -22
- package/src/errors.ts +1 -0
- package/src/index.ts +2 -0
- package/src/react/all-types-export.ts +2 -1
- package/src/react/index.spec.tsx +558 -157
- package/src/react/index.tsx +117 -51
- package/src/types.ts +301 -44
- package/src/utils/global-styles.ts +1 -1
- package/src/utils/graphql/nlsService/conversation-service.ts +7 -1
- package/src/utils.spec.ts +29 -0
package/dist/tsembed-react.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.39.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.39.3 */
|
|
2
2
|
'use client';
|
|
3
3
|
import * as React from 'react';
|
|
4
|
-
import React__default, { useRef } from 'react';
|
|
4
|
+
import React__default, { useRef, useCallback } from 'react';
|
|
5
5
|
|
|
6
6
|
function _mergeNamespaces(n, m) {
|
|
7
7
|
m.forEach(function (e) {
|
|
@@ -399,6 +399,12 @@ var HomeLeftNavItem;
|
|
|
399
399
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
400
400
|
*/
|
|
401
401
|
HomeLeftNavItem["Spotter"] = "spotter";
|
|
402
|
+
/**
|
|
403
|
+
* Favorites option in the insights left navigation,
|
|
404
|
+
* available when new navigation V3 is enabled.
|
|
405
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
406
|
+
*/
|
|
407
|
+
HomeLeftNavItem["Favorites"] = "favorites";
|
|
402
408
|
})(HomeLeftNavItem || (HomeLeftNavItem = {}));
|
|
403
409
|
/**
|
|
404
410
|
* A map of the supported runtime filter operations
|
|
@@ -1585,6 +1591,83 @@ var EmbedEvent;
|
|
|
1585
1591
|
* @version SDK : 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
1586
1592
|
*/
|
|
1587
1593
|
EmbedEvent["ExitPresentMode"] = "exitPresentMode";
|
|
1594
|
+
/**
|
|
1595
|
+
* Emitted when spotter response is text data
|
|
1596
|
+
* @example
|
|
1597
|
+
* ```js
|
|
1598
|
+
* spotterEmbed.on(EmbedEvent.SpotterData, (payload) => {
|
|
1599
|
+
* console.log('payload', payload);
|
|
1600
|
+
* })
|
|
1601
|
+
*```
|
|
1602
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1603
|
+
*/
|
|
1604
|
+
EmbedEvent["SpotterData"] = "SpotterData";
|
|
1605
|
+
/**
|
|
1606
|
+
* Emitted when user opens up the worksheet preview modal in spotter embed.
|
|
1607
|
+
* @example
|
|
1608
|
+
* ```js
|
|
1609
|
+
* spotterEmbed.on(EmbedEvent.PreviewSpotterData, (payload) => {
|
|
1610
|
+
* console.log('payload', payload);
|
|
1611
|
+
* })
|
|
1612
|
+
*```
|
|
1613
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1614
|
+
*/
|
|
1615
|
+
EmbedEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
1616
|
+
/**
|
|
1617
|
+
* Emitted when the spotter query is triggered in spotter embed.
|
|
1618
|
+
* @example
|
|
1619
|
+
* ```js
|
|
1620
|
+
* spotterEmbed.on(EmbedEvent.SpotterQueryTriggered, (payload) => {
|
|
1621
|
+
* console.log('payload', payload);
|
|
1622
|
+
* })
|
|
1623
|
+
*```
|
|
1624
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1625
|
+
*/
|
|
1626
|
+
EmbedEvent["SpotterQueryTriggered"] = "SpotterQueryTriggered";
|
|
1627
|
+
/**
|
|
1628
|
+
* Emitted when the last spotter query is edited in spotter embed.
|
|
1629
|
+
* @example
|
|
1630
|
+
* ```js
|
|
1631
|
+
* spotterEmbed.on(EmbedEvent.LastPromptEdited, (payload) => {
|
|
1632
|
+
* console.log('payload', payload);
|
|
1633
|
+
* })
|
|
1634
|
+
*```
|
|
1635
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1636
|
+
*/
|
|
1637
|
+
EmbedEvent["LastPromptEdited"] = "LastPromptEdited";
|
|
1638
|
+
/**
|
|
1639
|
+
* Emitted when the last spotter query is deleted in spotter embed.
|
|
1640
|
+
* @example
|
|
1641
|
+
* ```js
|
|
1642
|
+
* spotterEmbed.on(EmbedEvent.LastPromptDeleted, (payload) => {
|
|
1643
|
+
* console.log('payload', payload);
|
|
1644
|
+
* })
|
|
1645
|
+
*```
|
|
1646
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1647
|
+
*/
|
|
1648
|
+
EmbedEvent["LastPromptDeleted"] = "LastPromptDeleted";
|
|
1649
|
+
/**
|
|
1650
|
+
* Emitted when the coversation is reset in spotter embed.
|
|
1651
|
+
* @example
|
|
1652
|
+
* ```js
|
|
1653
|
+
* spotterEmbed.on(EmbedEvent.ResetSpotterConversation, (payload) => {
|
|
1654
|
+
* console.log('payload', payload);
|
|
1655
|
+
* })
|
|
1656
|
+
*```
|
|
1657
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1658
|
+
*/
|
|
1659
|
+
EmbedEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
1660
|
+
/**
|
|
1661
|
+
* Emitted when the *Spotter* is initialized.
|
|
1662
|
+
* @example
|
|
1663
|
+
* ```js
|
|
1664
|
+
* spotterEmbed.on(EmbedEvent.SpotterInit, (payload) => {
|
|
1665
|
+
* console.log('payload', payload);
|
|
1666
|
+
* })
|
|
1667
|
+
*```
|
|
1668
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1669
|
+
*/
|
|
1670
|
+
EmbedEvent["SpotterInit"] = "SpotterInit";
|
|
1588
1671
|
})(EmbedEvent || (EmbedEvent = {}));
|
|
1589
1672
|
/**
|
|
1590
1673
|
* Event types that can be triggered by the host application
|
|
@@ -1875,6 +1958,7 @@ var HostEvent;
|
|
|
1875
1958
|
* @param
|
|
1876
1959
|
* `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
|
|
1877
1960
|
* Optional when pinning a new chart or table generated from a Search query.
|
|
1961
|
+
* **Required** in Spotter Embed.
|
|
1878
1962
|
* @param
|
|
1879
1963
|
* `liveboardID` - GUID of the Liveboard to pin an Answer. If there is no Liveboard,
|
|
1880
1964
|
* specify the `newLiveboardName` parameter to create a new Liveboard.
|
|
@@ -1922,6 +2006,12 @@ var HostEvent;
|
|
|
1922
2006
|
* ```js
|
|
1923
2007
|
* appEmbed.trigger(HostEvent.Pin)
|
|
1924
2008
|
* ```
|
|
2009
|
+
* @example
|
|
2010
|
+
* ```js
|
|
2011
|
+
* const pinResponse = await spotterEmbed.trigger(HostEvent.Pin, {
|
|
2012
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2013
|
+
* });
|
|
2014
|
+
* ```
|
|
1925
2015
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1926
2016
|
*/
|
|
1927
2017
|
HostEvent["Pin"] = "pin";
|
|
@@ -2015,6 +2105,12 @@ var HostEvent;
|
|
|
2015
2105
|
* ```js
|
|
2016
2106
|
* searchEmbed.trigger(HostEvent.MakeACopy)
|
|
2017
2107
|
* ```
|
|
2108
|
+
* @example
|
|
2109
|
+
* ```js
|
|
2110
|
+
* const pinResponse = await spotterEmbed.trigger(HostEvent.MakeACopy, {
|
|
2111
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2112
|
+
* });
|
|
2113
|
+
* ```
|
|
2018
2114
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2019
2115
|
*/
|
|
2020
2116
|
HostEvent["MakeACopy"] = "makeACopy";
|
|
@@ -2087,6 +2183,7 @@ var HostEvent;
|
|
|
2087
2183
|
* This event is not supported in visualization embed and search embed.
|
|
2088
2184
|
* @param - object - To trigger the action for a specific visualization
|
|
2089
2185
|
* in Liveboard embed, pass in `vizId` as a key.
|
|
2186
|
+
* **Required** in Spotter embed.
|
|
2090
2187
|
* @example
|
|
2091
2188
|
* ```js
|
|
2092
2189
|
* liveboardEmbed.trigger(HostEvent.Edit)
|
|
@@ -2095,6 +2192,12 @@ var HostEvent;
|
|
|
2095
2192
|
* liveboardEmbed.trigger(HostEvent.Edit, {vizId:
|
|
2096
2193
|
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
2097
2194
|
* ```
|
|
2195
|
+
* @example
|
|
2196
|
+
* ```js
|
|
2197
|
+
* const pinResponse = await spotterEmbed.trigger(HostEvent.Edit, {
|
|
2198
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2199
|
+
* });
|
|
2200
|
+
* ```
|
|
2098
2201
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2099
2202
|
*/
|
|
2100
2203
|
HostEvent["Edit"] = "edit";
|
|
@@ -2142,6 +2245,16 @@ var HostEvent;
|
|
|
2142
2245
|
* );
|
|
2143
2246
|
* })
|
|
2144
2247
|
* ```
|
|
2248
|
+
* @example
|
|
2249
|
+
* ```js
|
|
2250
|
+
* spotterEmbed.trigger(HostEvent.GetTML, {
|
|
2251
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2252
|
+
* }).then((tml) => {
|
|
2253
|
+
* console.log(
|
|
2254
|
+
* tml.answer.search_query // TML representation of the search query
|
|
2255
|
+
* );
|
|
2256
|
+
* })
|
|
2257
|
+
* ```
|
|
2145
2258
|
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
|
|
2146
2259
|
* @important
|
|
2147
2260
|
*/
|
|
@@ -2229,7 +2342,12 @@ var HostEvent;
|
|
|
2229
2342
|
* vizEmbed.trigger(HostEvent.DownloadAsPng)
|
|
2230
2343
|
*
|
|
2231
2344
|
* searchEmbed.trigger(HostEvent.DownloadAsPng)
|
|
2345
|
+
*
|
|
2346
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPng, {
|
|
2347
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2348
|
+
* })
|
|
2232
2349
|
* ```
|
|
2350
|
+
*
|
|
2233
2351
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
|
|
2234
2352
|
*/
|
|
2235
2353
|
HostEvent["DownloadAsPng"] = "downloadAsPng";
|
|
@@ -2247,6 +2365,11 @@ var HostEvent;
|
|
|
2247
2365
|
* ```js
|
|
2248
2366
|
* searchEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
2249
2367
|
* ```
|
|
2368
|
+
* ```js
|
|
2369
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsCsv, {
|
|
2370
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2371
|
+
* })
|
|
2372
|
+
* ```
|
|
2250
2373
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2251
2374
|
*/
|
|
2252
2375
|
HostEvent["DownloadAsCsv"] = "downloadAsCSV";
|
|
@@ -2264,6 +2387,11 @@ var HostEvent;
|
|
|
2264
2387
|
* ```js
|
|
2265
2388
|
* searchEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
2266
2389
|
* ```
|
|
2390
|
+
* ```js
|
|
2391
|
+
* spotterEmbed.trigger(HostEvent.downloadAsXLSX, {
|
|
2392
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2393
|
+
* })
|
|
2394
|
+
* ```
|
|
2267
2395
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2268
2396
|
*/
|
|
2269
2397
|
HostEvent["DownloadAsXlsx"] = "downloadAsXLSX";
|
|
@@ -2283,6 +2411,7 @@ var HostEvent;
|
|
|
2283
2411
|
/**
|
|
2284
2412
|
* Trigger the **Save** action on a Liveboard or Answer.
|
|
2285
2413
|
* Saves the changes.
|
|
2414
|
+
* @param - `vizId` is required in Spotter Embed.
|
|
2286
2415
|
* @example
|
|
2287
2416
|
* ```js
|
|
2288
2417
|
* liveboardEmbed.trigger(HostEvent.Save)
|
|
@@ -2290,6 +2419,11 @@ var HostEvent;
|
|
|
2290
2419
|
* ```js
|
|
2291
2420
|
* searchEmbed.trigger(HostEvent.Save)
|
|
2292
2421
|
* ```
|
|
2422
|
+
* ```js
|
|
2423
|
+
* spotterEmbed.trigger(HostEvent.Save, {
|
|
2424
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2425
|
+
* })
|
|
2426
|
+
* ```
|
|
2293
2427
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2294
2428
|
*/
|
|
2295
2429
|
HostEvent["Save"] = "save";
|
|
@@ -2573,7 +2707,7 @@ var HostEvent;
|
|
|
2573
2707
|
HostEvent["ResetLiveboardPersonalisedView"] = "ResetLiveboardPersonalisedView";
|
|
2574
2708
|
/**
|
|
2575
2709
|
* Triggers an action to update Parameter values on embedded
|
|
2576
|
-
* Answers and
|
|
2710
|
+
* Answers, Liveboard and Spotter answer in Edit mode.
|
|
2577
2711
|
*
|
|
2578
2712
|
* @example
|
|
2579
2713
|
* ```js
|
|
@@ -2592,6 +2726,13 @@ var HostEvent;
|
|
|
2592
2726
|
* console.log('parameters', parameter);
|
|
2593
2727
|
* });
|
|
2594
2728
|
*```
|
|
2729
|
+
*```js
|
|
2730
|
+
* spotterEmbed.trigger(HostEvent.GetParameters, {
|
|
2731
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2732
|
+
* }).then((parameter) => {
|
|
2733
|
+
* console.log('parameters', parameter);
|
|
2734
|
+
* });
|
|
2735
|
+
*```
|
|
2595
2736
|
* @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
2596
2737
|
*/
|
|
2597
2738
|
HostEvent["GetParameters"] = "GetParameters";
|
|
@@ -2659,6 +2800,64 @@ var HostEvent;
|
|
|
2659
2800
|
* @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
|
|
2660
2801
|
*/
|
|
2661
2802
|
HostEvent["TransformTableVizData"] = "TransformTableVizData";
|
|
2803
|
+
/**
|
|
2804
|
+
* Triggers a search operation with the search tokens specified in
|
|
2805
|
+
* the search query string in spotter embed.
|
|
2806
|
+
* @param - `queryString`: Text string in Natural Language format
|
|
2807
|
+
* @param - `executeSearch`: Boolean to execute search and update search query
|
|
2808
|
+
* @example
|
|
2809
|
+
* ```js
|
|
2810
|
+
* spotterEmbed.trigger(HostEvent.SpotterSearch, {
|
|
2811
|
+
* query: 'revenue per year',
|
|
2812
|
+
* executeSearch: true,
|
|
2813
|
+
* })
|
|
2814
|
+
* ```
|
|
2815
|
+
*/
|
|
2816
|
+
HostEvent["SpotterSearch"] = "SpotterSearch";
|
|
2817
|
+
/**
|
|
2818
|
+
* Edits the last prompt in spotter embed.
|
|
2819
|
+
* @param - `query`: Text string
|
|
2820
|
+
* @example
|
|
2821
|
+
* ```js
|
|
2822
|
+
* spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year");
|
|
2823
|
+
* ```
|
|
2824
|
+
*/
|
|
2825
|
+
HostEvent["EditLastPrompt"] = "EditLastPrompt";
|
|
2826
|
+
/**
|
|
2827
|
+
* Opens the Worksheet preview modal in Spotter Embed.
|
|
2828
|
+
* @example
|
|
2829
|
+
* ```js
|
|
2830
|
+
* spotterEmbed.trigger(HostEvent.PreviewSpotterData);
|
|
2831
|
+
* ```
|
|
2832
|
+
*/
|
|
2833
|
+
HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
2834
|
+
/**
|
|
2835
|
+
* Resets the Spotter Embed Conversation.
|
|
2836
|
+
* @example
|
|
2837
|
+
* ```js
|
|
2838
|
+
* spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
|
|
2839
|
+
* ```
|
|
2840
|
+
*/
|
|
2841
|
+
HostEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
2842
|
+
/**
|
|
2843
|
+
* Deletes the last prompt in spotter embed.
|
|
2844
|
+
* @example
|
|
2845
|
+
* ```js
|
|
2846
|
+
* spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
|
|
2847
|
+
* ```
|
|
2848
|
+
*/
|
|
2849
|
+
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
2850
|
+
/**
|
|
2851
|
+
* Toggle the visualization to chart or table view.
|
|
2852
|
+
* @param - `vizId ` In Spotter Embed, vizId is required.
|
|
2853
|
+
* @example
|
|
2854
|
+
* ```js
|
|
2855
|
+
* spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {
|
|
2856
|
+
* vizId:"'b535c760-8bbe-4e6f-bb26-af56b4129a1e'"
|
|
2857
|
+
* });
|
|
2858
|
+
*```
|
|
2859
|
+
*/
|
|
2860
|
+
HostEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
|
|
2662
2861
|
/**
|
|
2663
2862
|
* @hidden
|
|
2664
2863
|
* Trigger exit from presentation mode when user exits fullscreen.
|
|
@@ -2669,6 +2868,16 @@ var HostEvent;
|
|
|
2669
2868
|
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
2670
2869
|
*/
|
|
2671
2870
|
HostEvent["ExitPresentMode"] = "exitPresentMode";
|
|
2871
|
+
/**
|
|
2872
|
+
* Trigger the *Ask Sage* action for visualizations
|
|
2873
|
+
* @example
|
|
2874
|
+
* ```js
|
|
2875
|
+
* liveboardEmbed.trigger(HostEvent.AskSpotter,
|
|
2876
|
+
* {containerId:'730496d6-6903-4601-937e-2c691821af3c'})
|
|
2877
|
+
* ```
|
|
2878
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
2879
|
+
*/
|
|
2880
|
+
HostEvent["AskSpotter"] = "askSpotter";
|
|
2672
2881
|
})(HostEvent || (HostEvent = {}));
|
|
2673
2882
|
/**
|
|
2674
2883
|
* The different visual modes that the data sources panel within
|
|
@@ -2774,6 +2983,7 @@ var Param;
|
|
|
2774
2983
|
Param["Query"] = "query";
|
|
2775
2984
|
Param["HideHomepageLeftNav"] = "hideHomepageLeftNav";
|
|
2776
2985
|
Param["ModularHomeExperienceEnabled"] = "modularHomeExperience";
|
|
2986
|
+
Param["ListPageVersion"] = "listpageVersion";
|
|
2777
2987
|
Param["PendoTrackingKey"] = "additionalPendoKey";
|
|
2778
2988
|
Param["LiveboardHeaderSticky"] = "isLiveboardHeaderSticky";
|
|
2779
2989
|
Param["IsProductTour"] = "isProductTour";
|
|
@@ -2808,7 +3018,7 @@ var Param;
|
|
|
2808
3018
|
Param["DataSourceId"] = "dataSourceId";
|
|
2809
3019
|
Param["preAuthCache"] = "preAuthCache";
|
|
2810
3020
|
Param["ShowSpotterLimitations"] = "showSpotterLimitations";
|
|
2811
|
-
Param["CoverAndFilterOptionInPDF"] = "
|
|
3021
|
+
Param["CoverAndFilterOptionInPDF"] = "arePdfCoverFilterPageCheckboxesEnabled";
|
|
2812
3022
|
Param["PrimaryAction"] = "primaryAction";
|
|
2813
3023
|
Param["isSpotterAgentEmbed"] = "isSpotterAgentEmbed";
|
|
2814
3024
|
Param["IsLiveboardStylingAndGroupingEnabled"] = "isLiveboardStylingAndGroupingEnabled";
|
|
@@ -4034,6 +4244,22 @@ var Action;
|
|
|
4034
4244
|
* @version SDK: 1.37.0 | ThoughtSpot Cloud: 10.8.0.cl
|
|
4035
4245
|
*/
|
|
4036
4246
|
Action["CoverAndFilterOptionInPDF"] = "coverAndFilterOptionInPDF";
|
|
4247
|
+
/**
|
|
4248
|
+
* Action ID for hide or disable the
|
|
4249
|
+
* Spotter in conversation training widget.
|
|
4250
|
+
* The Add to Coaching feature is currently in beta
|
|
4251
|
+
* and is disabled by default on embed deployments.
|
|
4252
|
+
* To enable this feature on your instance,
|
|
4253
|
+
* contact ThoughtSpot Support.
|
|
4254
|
+
* @example
|
|
4255
|
+
* ```js
|
|
4256
|
+
* hiddenAction: [Action.InConversationTraining]
|
|
4257
|
+
* disabledActions: [Action.InConversationTraining]
|
|
4258
|
+
*
|
|
4259
|
+
* ```
|
|
4260
|
+
* @version SDK: 1.39.0 | ThoughtSpot Cloud: 10.10.0.cl
|
|
4261
|
+
*/
|
|
4262
|
+
Action["InConversationTraining"] = "InConversationTraining";
|
|
4037
4263
|
})(Action || (Action = {}));
|
|
4038
4264
|
var PrefetchFeatures;
|
|
4039
4265
|
(function (PrefetchFeatures) {
|
|
@@ -6869,6 +7095,7 @@ const ERROR_MESSAGE = {
|
|
|
6869
7095
|
CSP_FRAME_HOST_VIOLATION_LOG_MESSAGE: 'Please set up CSP correctly for the application to start working. For more information, see https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts. \n If the issue persists, refer to https://developers.thoughtspot.com/docs/security-settings#csp-viz-embed-hosts',
|
|
6870
7096
|
MISSING_REPORTING_OBSERVER: 'ReportingObserver not supported',
|
|
6871
7097
|
RENDER_CALLED_BEFORE_INIT: 'Looks like render was called before calling init, the render won\'t start until init is called.\nFor more info check\n1. https://developers.thoughtspot.com/docs/Function_init#_init\n2.https://developers.thoughtspot.com/docs/getting-started#initSdk',
|
|
7098
|
+
SPOTTER_AGENT_NOT_INITIALIZED: 'SpotterAgent not initialized',
|
|
6872
7099
|
};
|
|
6873
7100
|
|
|
6874
7101
|
const EndPoints = {
|
|
@@ -7076,13 +7303,14 @@ const configKey = 'embedConfig';
|
|
|
7076
7303
|
*
|
|
7077
7304
|
* @example
|
|
7078
7305
|
* ```js
|
|
7306
|
+
* import { getInitConfig } from '@thoughtspot/visual-embed-sdk';
|
|
7307
|
+
* // Call the getInitConfig method to retrieve the embed configuration
|
|
7079
7308
|
* const config = getInitConfig();
|
|
7309
|
+
* // Log the configuration settings
|
|
7080
7310
|
* console.log(config);
|
|
7081
7311
|
* ```
|
|
7082
|
-
*
|
|
7083
|
-
*
|
|
7084
|
-
* Returns the `EmbedConfig` object, which
|
|
7085
|
-
* contains the configuration settings used to
|
|
7312
|
+
* Returns the link:https://developers.thoughtspot.com/docs/Interface_EmbedConfig[EmbedConfig]
|
|
7313
|
+
* object, which contains the configuration settings used to
|
|
7086
7314
|
* initialize the SDK, including the following:
|
|
7087
7315
|
*
|
|
7088
7316
|
* - `thoughtSpotHost` - ThoughtSpot host URL
|
|
@@ -7091,9 +7319,10 @@ const configKey = 'embedConfig';
|
|
|
7091
7319
|
* - `customizations` - Style, text, and icon customization settings
|
|
7092
7320
|
* that were applied during the SDK initialization.
|
|
7093
7321
|
*
|
|
7094
|
-
*
|
|
7095
|
-
*
|
|
7322
|
+
* The following JSON output shows the embed configuration
|
|
7323
|
+
* settings returned from the code in the previous example:
|
|
7096
7324
|
*
|
|
7325
|
+
* @example
|
|
7097
7326
|
* ```json
|
|
7098
7327
|
* {
|
|
7099
7328
|
* "thoughtSpotHost": "https://{ThoughtSpot-Host}",
|
|
@@ -7115,7 +7344,7 @@ const configKey = 'embedConfig';
|
|
|
7115
7344
|
* "authTriggerContainer": "#your-own-div"
|
|
7116
7345
|
* }
|
|
7117
7346
|
* ```
|
|
7118
|
-
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.
|
|
7347
|
+
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw, and later
|
|
7119
7348
|
* @group Global methods
|
|
7120
7349
|
*/
|
|
7121
7350
|
const getEmbedConfig = () => getValueFromWindow(configKey) || {};
|
|
@@ -7757,7 +7986,7 @@ class AnswerService {
|
|
|
7757
7986
|
async getTML() {
|
|
7758
7987
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
7759
7988
|
const edoc = object[0].edoc;
|
|
7760
|
-
const YAML = await import('./index-
|
|
7989
|
+
const YAML = await import('./index-ZrE8YYq8.js');
|
|
7761
7990
|
const parsedDoc = YAML.parse(edoc);
|
|
7762
7991
|
return {
|
|
7763
7992
|
answer: {
|
|
@@ -15491,7 +15720,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
|
15491
15720
|
return e;
|
|
15492
15721
|
}
|
|
15493
15722
|
|
|
15494
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.39.
|
|
15723
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.39.3";var description="ThoughtSpot Embed SDK";var module="lib/src/index.js";var main="dist/tsembed.js";var types="lib/src/index.d.ts";var files=["dist/**","lib/**","src/**","cjs/**"];var exports={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^8.2.6","@testing-library/dom":"^7.31.0","@testing-library/jest-dom":"^5.14.1","@testing-library/react":"^11.2.7","@testing-library/user-event":"^13.1.8","@types/jest":"^22.2.3","@types/lodash":"^4.17.0","@types/mixpanel-browser":"^2.35.6","@types/react-test-renderer":"^17.0.1","@typescript-eslint/eslint-plugin":"^8.28.0","@typescript-eslint/parser":"^8.28.0",asciidoctor:"^2.2.1","babel-jest":"^26.6.3","babel-preset-gatsby":"^1.10.0","command-line-args":"^5.1.1",coveralls:"^3.1.0",crypto:"^1.0.1","current-git-branch":"^1.1.0","dts-bundle":"^0.7.3",eslint:"^9.23.0","eslint-config-airbnb-base":"^15.0.0","eslint-config-prettier":"^10.1.1","eslint-import-resolver-typescript":"^4.2.5","eslint-plugin-comment-length":"2.2.1","eslint-plugin-import":"^2.31.0","eslint-plugin-jsdoc":"^50.6.9","eslint-plugin-prettier":"^5.2.5","eslint-plugin-react":"^7.37.5","eslint-plugin-react-hooks":"^5.2.0","fs-extra":"^10.0.0","gh-pages":"6.3.0",globals:"^16.0.0","highlight.js":"^10.6.0","html-to-text":"^8.0.0","identity-obj-proxy":"^3.0.0","istanbul-merge":"^1.1.1",jest:"^26.6.3","jest-fetch-mock":"^3.0.3",jsdom:"^17.0.0",prettier:"2.1.2",react:"^16.14.0","react-dom":"^16.14.0","react-resizable":"^1.11.0","react-resize-detector":"^6.6.0","react-test-renderer":"^17.0.2","react-use-flexsearch":"^0.1.1",rollup:"4.24.0","rollup-plugin-typescript2":"0.27.3","ts-jest":"^26.5.5","ts-loader":"8.0.4",typedoc:"0.21.6","typedoc-plugin-toc-group":"thoughtspot/typedoc-plugin-toc-group",typescript:"^4.9.4","typescript-eslint":"^8.29.1","url-search-params-polyfill":"^8.1.0",util:"^0.12.4",vite:"^6.3.5"};var author="ThoughtSpot";var email="support@thoughtspot.com";var license="ThoughtSpot Development Tools End User License Agreement";var directories={lib:"lib"};var repository={type:"git",url:"git+https://github.com/thoughtspot/visual-embed-sdk.git"};var publishConfig={registry:"https://registry.npmjs.org"};var keywords=["thoughtspot","everywhere","embedded","embed","sdk","analytics"];var bugs={url:"https://github.com/thoughtspot/visual-embed-sdk/issues"};var homepage="https://github.com/thoughtspot/visual-embed-sdk#readme";var globals={window:{}};var pkgInfo = {name:name,version:version$1,description:description,module:module,main:main,types:types,files:files,exports:exports,typesVersions:typesVersions,"size-limit":[{path:"dist/tsembed.es.js",limit:"31 kB"}],scripts:scripts,peerDependencies:peerDependencies,dependencies:dependencies,devDependencies:devDependencies,author:author,email:email,license:license,directories:directories,repository:repository,publishConfig:publishConfig,keywords:keywords,bugs:bugs,homepage:homepage,globals:globals};
|
|
15495
15724
|
|
|
15496
15725
|
/**
|
|
15497
15726
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -17313,6 +17542,22 @@ var HomePage;
|
|
|
17313
17542
|
*/
|
|
17314
17543
|
HomePage["Modular"] = "v2";
|
|
17315
17544
|
})(HomePage || (HomePage = {}));
|
|
17545
|
+
/**
|
|
17546
|
+
* Define the version of the list page
|
|
17547
|
+
* @version SDK: 1.40.0 | ThoughtSpot: 10.12.0.cl
|
|
17548
|
+
*/
|
|
17549
|
+
var ListPage;
|
|
17550
|
+
(function (ListPage) {
|
|
17551
|
+
/**
|
|
17552
|
+
* List (v2) is the traditional List Experience.
|
|
17553
|
+
* It serves as the foundational version of the list page.
|
|
17554
|
+
*/
|
|
17555
|
+
ListPage["List"] = "v2";
|
|
17556
|
+
/**
|
|
17557
|
+
* ListWithUXChanges (v3) introduces the new updated list page with UX changes.
|
|
17558
|
+
*/
|
|
17559
|
+
ListPage["ListWithUXChanges"] = "v3";
|
|
17560
|
+
})(ListPage || (ListPage = {}));
|
|
17316
17561
|
/**
|
|
17317
17562
|
* Embeds full ThoughtSpot experience in a host application.
|
|
17318
17563
|
* @group Embed components
|
|
@@ -17369,7 +17614,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
17369
17614
|
getEmbedParams() {
|
|
17370
17615
|
const { tag, hideObjects, liveboardV2, showPrimaryNavbar, disableProfileAndHelp, hideHamburger, hideObjectSearch, hideNotification, hideApplicationSwitcher, hideOrgSwitcher, enableSearchAssist, fullHeight, dataPanelV2 = false, hideLiveboardHeader = false, showLiveboardTitle = true, showLiveboardDescription = true, hideHomepageLeftNav = false, modularHomeExperience = false, isLiveboardHeaderSticky = true, enableAskSage, collapseSearchBarInitially = false, enable2ColumnLayout, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
|
|
17371
17616
|
/* eslint-disable-next-line max-len */
|
|
17372
|
-
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
|
|
17617
|
+
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState.EXPAND_ALL, collapseSearchBar = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, homePageSearchBarMode, isUnifiedSearchExperienceEnabled = true, enablePendoHelp = true, discoveryExperience, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
|
|
17373
17618
|
let params = {};
|
|
17374
17619
|
params[Param.PrimaryNavHidden] = !showPrimaryNavbar;
|
|
17375
17620
|
params[Param.HideProfleAndHelp] = !!disableProfileAndHelp;
|
|
@@ -17385,6 +17630,7 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
17385
17630
|
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
|
|
17386
17631
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
17387
17632
|
params[Param.IsUnifiedSearchExperienceEnabled] = isUnifiedSearchExperienceEnabled;
|
|
17633
|
+
params[Param.CoverAndFilterOptionInPDF] = !!coverAndFilterOptionInPDF;
|
|
17388
17634
|
params = this.getBaseQueryParams(params);
|
|
17389
17635
|
if (hideObjectSearch) {
|
|
17390
17636
|
params[Param.HideObjectSearch] = !!hideObjectSearch;
|
|
@@ -17455,6 +17701,10 @@ let AppEmbed$1 = class AppEmbed extends V1Embed {
|
|
|
17455
17701
|
if (discoveryExperience.homePage === HomePage.Modular) {
|
|
17456
17702
|
params[Param.ModularHomeExperienceEnabled] = true;
|
|
17457
17703
|
}
|
|
17704
|
+
// listPageVersion v3 will enable the new list page
|
|
17705
|
+
if (discoveryExperience.listPageVersion === ListPage.ListWithUXChanges) {
|
|
17706
|
+
params[Param.ListPageVersion] = discoveryExperience.listPageVersion;
|
|
17707
|
+
}
|
|
17458
17708
|
}
|
|
17459
17709
|
const queryParams = getQueryParamString(params, true);
|
|
17460
17710
|
return queryParams;
|
|
@@ -17592,7 +17842,7 @@ const addPreviewStylesIfNotPresent = () => {
|
|
|
17592
17842
|
return;
|
|
17593
17843
|
}
|
|
17594
17844
|
const previewStyles = `
|
|
17595
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community@32.0.2/styles/ag-grid.min.css">
|
|
17845
|
+
<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">
|
|
17596
17846
|
<style id="ts-preview-style">
|
|
17597
17847
|
.ts-viz-preview-loader {
|
|
17598
17848
|
position: absolute;
|
|
@@ -17704,7 +17954,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
17704
17954
|
getEmbedParams() {
|
|
17705
17955
|
let params = {};
|
|
17706
17956
|
params = this.getBaseQueryParams(params);
|
|
17707
|
-
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, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
|
|
17957
|
+
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;
|
|
17708
17958
|
const preventLiveboardFilterRemoval = this.viewConfig.preventLiveboardFilterRemoval
|
|
17709
17959
|
|| this.viewConfig.preventPinboardFilterRemoval;
|
|
17710
17960
|
if (fullHeight === true) {
|
|
@@ -17756,9 +18006,6 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
17756
18006
|
if (dataSourceId !== undefined) {
|
|
17757
18007
|
params[Param.DataSourceId] = dataSourceId;
|
|
17758
18008
|
}
|
|
17759
|
-
if (coverAndFilterOptionInPDF !== undefined) {
|
|
17760
|
-
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
17761
|
-
}
|
|
17762
18009
|
if (isLiveboardStylingAndGroupingEnabled !== undefined) {
|
|
17763
18010
|
params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
|
|
17764
18011
|
}
|
|
@@ -17769,6 +18016,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
17769
18016
|
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
17770
18017
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
17771
18018
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
18019
|
+
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
17772
18020
|
const queryParams = getQueryParamString(params, true);
|
|
17773
18021
|
return queryParams;
|
|
17774
18022
|
}
|
|
@@ -18272,7 +18520,13 @@ class Conversation {
|
|
|
18272
18520
|
});
|
|
18273
18521
|
const data = responses[0].data;
|
|
18274
18522
|
return {
|
|
18275
|
-
|
|
18523
|
+
convId: this.conversationId,
|
|
18524
|
+
messageId: responses[0].msgId,
|
|
18525
|
+
data: {
|
|
18526
|
+
...data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
|
|
18527
|
+
convId: this.conversationId,
|
|
18528
|
+
messageId: responses[0].msgId,
|
|
18529
|
+
},
|
|
18276
18530
|
error: null,
|
|
18277
18531
|
};
|
|
18278
18532
|
}
|
|
@@ -18290,7 +18544,7 @@ class Conversation {
|
|
|
18290
18544
|
}
|
|
18291
18545
|
}
|
|
18292
18546
|
|
|
18293
|
-
class ConversationMessage extends TsEmbed {
|
|
18547
|
+
let ConversationMessage$1 = class ConversationMessage extends TsEmbed {
|
|
18294
18548
|
constructor(container, viewConfig) {
|
|
18295
18549
|
viewConfig.embedComponentType = 'bodyless-conversation';
|
|
18296
18550
|
super(container, viewConfig);
|
|
@@ -18298,7 +18552,7 @@ class ConversationMessage extends TsEmbed {
|
|
|
18298
18552
|
}
|
|
18299
18553
|
getIframeSrc() {
|
|
18300
18554
|
var _a;
|
|
18301
|
-
const { sessionId, genNo, acSessionId, acGenNo, } = this.viewConfig;
|
|
18555
|
+
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
18302
18556
|
const path = 'conv-assist-answer';
|
|
18303
18557
|
const queryParams = this.getBaseQueryParams();
|
|
18304
18558
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
@@ -18313,6 +18567,8 @@ class ConversationMessage extends TsEmbed {
|
|
|
18313
18567
|
genNo,
|
|
18314
18568
|
acSessionId,
|
|
18315
18569
|
acGenNo,
|
|
18570
|
+
convId,
|
|
18571
|
+
messageId,
|
|
18316
18572
|
});
|
|
18317
18573
|
return `${this.getEmbedBasePath(query)}/embed/${path}${tsPostHashParams}`;
|
|
18318
18574
|
}
|
|
@@ -18322,7 +18578,7 @@ class ConversationMessage extends TsEmbed {
|
|
|
18322
18578
|
await this.renderIFrame(src);
|
|
18323
18579
|
return this;
|
|
18324
18580
|
}
|
|
18325
|
-
}
|
|
18581
|
+
};
|
|
18326
18582
|
/**
|
|
18327
18583
|
* Create a conversation embed, which can be integrated inside
|
|
18328
18584
|
* chatbots or other conversational interfaces.
|
|
@@ -18342,7 +18598,7 @@ class ConversationMessage extends TsEmbed {
|
|
|
18342
18598
|
* @group Embed components
|
|
18343
18599
|
* @version SDK: 1.37.0 | ThoughtSpot: 10.9.0.cl
|
|
18344
18600
|
*/
|
|
18345
|
-
|
|
18601
|
+
class SpotterAgentEmbed {
|
|
18346
18602
|
constructor(viewConfig) {
|
|
18347
18603
|
this.viewConfig = viewConfig;
|
|
18348
18604
|
const embedConfig = getEmbedConfig();
|
|
@@ -18354,11 +18610,10 @@ let SpotterAgentEmbed$1 = class SpotterAgentEmbed {
|
|
|
18354
18610
|
return { error };
|
|
18355
18611
|
}
|
|
18356
18612
|
const container = document.createElement('div');
|
|
18357
|
-
|
|
18358
|
-
container.className = this.viewConfig.containerClassName;
|
|
18359
|
-
}
|
|
18360
|
-
const embed = new ConversationMessage(container, {
|
|
18613
|
+
const embed = new ConversationMessage$1(container, {
|
|
18361
18614
|
...this.viewConfig,
|
|
18615
|
+
convId: data.convId,
|
|
18616
|
+
messageId: data.messageId,
|
|
18362
18617
|
sessionId: data.sessionId,
|
|
18363
18618
|
genNo: data.genNo,
|
|
18364
18619
|
acSessionId: data.stateKey.transactionId,
|
|
@@ -18367,7 +18622,31 @@ let SpotterAgentEmbed$1 = class SpotterAgentEmbed {
|
|
|
18367
18622
|
await embed.render();
|
|
18368
18623
|
return { container, viz: embed };
|
|
18369
18624
|
}
|
|
18370
|
-
|
|
18625
|
+
/**
|
|
18626
|
+
* Send a message to the conversation service and return only the data.
|
|
18627
|
+
* @param userMessage - The message to send to the conversation service.
|
|
18628
|
+
* @returns The data from the conversation service.
|
|
18629
|
+
*/
|
|
18630
|
+
async sendMessageData(userMessage) {
|
|
18631
|
+
try {
|
|
18632
|
+
const { data, error } = await this.conversationService.sendMessage(userMessage);
|
|
18633
|
+
if (error) {
|
|
18634
|
+
return { error };
|
|
18635
|
+
}
|
|
18636
|
+
return { data: {
|
|
18637
|
+
convId: data.convId,
|
|
18638
|
+
messageId: data.messageId,
|
|
18639
|
+
sessionId: data.sessionId,
|
|
18640
|
+
genNo: data.genNo,
|
|
18641
|
+
acSessionId: data.stateKey.transactionId,
|
|
18642
|
+
acGenNo: data.stateKey.generationNumber,
|
|
18643
|
+
} };
|
|
18644
|
+
}
|
|
18645
|
+
catch (error) {
|
|
18646
|
+
return { error: error };
|
|
18647
|
+
}
|
|
18648
|
+
}
|
|
18649
|
+
}
|
|
18371
18650
|
|
|
18372
18651
|
/**
|
|
18373
18652
|
*
|
|
@@ -18742,55 +19021,34 @@ const SpotterEmbed = componentFactory(SpotterEmbed$1);
|
|
|
18742
19021
|
* ```
|
|
18743
19022
|
*/
|
|
18744
19023
|
const ConversationEmbed = componentFactory(ConversationEmbed$1);
|
|
19024
|
+
const ConversationMessage = componentFactory(ConversationMessage$1);
|
|
18745
19025
|
/**
|
|
18746
|
-
* React component for
|
|
18747
|
-
*
|
|
19026
|
+
* React component for displaying individual conversation messages from SpotterAgent.
|
|
19027
|
+
*
|
|
19028
|
+
* This component renders a single message response from your ThoughtSpot conversation,
|
|
19029
|
+
* showing charts, visualizations, or text responses based on the user's query.
|
|
19030
|
+
*
|
|
18748
19031
|
* @example
|
|
18749
19032
|
* ```tsx
|
|
18750
|
-
*
|
|
18751
|
-
*
|
|
19033
|
+
* const { sendMessage } = useSpotterAgent({ worksheetId: 'worksheetId' });
|
|
19034
|
+
* const result = await sendMessage('show me sales by region');
|
|
18752
19035
|
*
|
|
18753
|
-
*
|
|
18754
|
-
*
|
|
18755
|
-
*
|
|
18756
|
-
* document.body.appendChild(container);
|
|
18757
|
-
* }
|
|
18758
|
-
* };
|
|
19036
|
+
* if (!result.error) {
|
|
19037
|
+
* // Simple usage - just pass the message data
|
|
19038
|
+
* <SpotterMessage message={result.message} />
|
|
18759
19039
|
*
|
|
18760
|
-
*
|
|
18761
|
-
*
|
|
18762
|
-
*
|
|
18763
|
-
*
|
|
18764
|
-
*
|
|
18765
|
-
* );
|
|
19040
|
+
* // With optional query for context
|
|
19041
|
+
* <SpotterMessage
|
|
19042
|
+
* message={result.message}
|
|
19043
|
+
* query={result.query}
|
|
19044
|
+
* />
|
|
18766
19045
|
* }
|
|
18767
19046
|
* ```
|
|
19047
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.11.0.cl
|
|
18768
19048
|
*/
|
|
18769
|
-
const
|
|
18770
|
-
const {
|
|
18771
|
-
|
|
18772
|
-
useDeepCompareEffect(() => {
|
|
18773
|
-
if (serviceRef.current) {
|
|
18774
|
-
serviceRef.current = null;
|
|
18775
|
-
}
|
|
18776
|
-
const configProps = {
|
|
18777
|
-
...restProps,
|
|
18778
|
-
...(className ? { containerClassName: className } : {})
|
|
18779
|
-
};
|
|
18780
|
-
serviceRef.current = new SpotterAgentEmbed$1(configProps);
|
|
18781
|
-
if (ref) {
|
|
18782
|
-
if (typeof ref === 'function') {
|
|
18783
|
-
ref(serviceRef.current);
|
|
18784
|
-
}
|
|
18785
|
-
else {
|
|
18786
|
-
ref.current = serviceRef.current;
|
|
18787
|
-
}
|
|
18788
|
-
}
|
|
18789
|
-
return () => {
|
|
18790
|
-
serviceRef.current = null;
|
|
18791
|
-
};
|
|
18792
|
-
}, [props]);
|
|
18793
|
-
return null;
|
|
19049
|
+
const SpotterMessage = React__default.forwardRef((props, ref) => {
|
|
19050
|
+
const { message, query: _, ...otherProps } = props;
|
|
19051
|
+
return (React__default.createElement(ConversationMessage, { ref: ref, ...message, ...otherProps }));
|
|
18794
19052
|
});
|
|
18795
19053
|
/**
|
|
18796
19054
|
* React component for PreRendered Conversation embed.
|
|
@@ -18850,6 +19108,62 @@ function useInit(config) {
|
|
|
18850
19108
|
ref.current = authEE;
|
|
18851
19109
|
}, [config]);
|
|
18852
19110
|
return ref;
|
|
19111
|
+
}
|
|
19112
|
+
/**
|
|
19113
|
+
* React hook for interacting with SpotterAgent AI conversations.
|
|
19114
|
+
*
|
|
19115
|
+
* This hook provides a sendMessage function that allows you to send natural language
|
|
19116
|
+
* queries to your data and get back AI-generated responses with visualizations.
|
|
19117
|
+
*
|
|
19118
|
+
* @param config - Configuration object containing worksheetId and other options
|
|
19119
|
+
* @returns Object with sendMessage function that returns conversation results
|
|
19120
|
+
* @example
|
|
19121
|
+
* ```tsx
|
|
19122
|
+
* const { sendMessage } = useSpotterAgent({ worksheetId: 'worksheetId' });
|
|
19123
|
+
*
|
|
19124
|
+
* const handleQuery = async () => {
|
|
19125
|
+
* const result = await sendMessage('show me sales by region');
|
|
19126
|
+
*
|
|
19127
|
+
* if (!result.error) {
|
|
19128
|
+
* // Display the message response
|
|
19129
|
+
* <SpotterMessage message={result.message} />
|
|
19130
|
+
* } else {
|
|
19131
|
+
* console.error('Error:', result.error);
|
|
19132
|
+
* }
|
|
19133
|
+
* };
|
|
19134
|
+
* ```
|
|
19135
|
+
* @version SDK: 1.39.0 | ThoughtSpot: 10.11.0.cl
|
|
19136
|
+
*/
|
|
19137
|
+
function useSpotterAgent(config) {
|
|
19138
|
+
const serviceRef = useRef(null);
|
|
19139
|
+
useDeepCompareEffect(() => {
|
|
19140
|
+
if (serviceRef.current) {
|
|
19141
|
+
serviceRef.current = null;
|
|
19142
|
+
}
|
|
19143
|
+
serviceRef.current = new SpotterAgentEmbed(config);
|
|
19144
|
+
return () => {
|
|
19145
|
+
serviceRef.current = null;
|
|
19146
|
+
};
|
|
19147
|
+
}, [config]);
|
|
19148
|
+
const sendMessage = useCallback(async (query) => {
|
|
19149
|
+
if (!serviceRef.current) {
|
|
19150
|
+
return { error: new Error(ERROR_MESSAGE.SPOTTER_AGENT_NOT_INITIALIZED) };
|
|
19151
|
+
}
|
|
19152
|
+
const result = await serviceRef.current.sendMessageData(query);
|
|
19153
|
+
if (result.error) {
|
|
19154
|
+
return { error: result.error };
|
|
19155
|
+
}
|
|
19156
|
+
return {
|
|
19157
|
+
query: query,
|
|
19158
|
+
message: {
|
|
19159
|
+
...result.data,
|
|
19160
|
+
worksheetId: config.worksheetId,
|
|
19161
|
+
},
|
|
19162
|
+
};
|
|
19163
|
+
}, [config.worksheetId]);
|
|
19164
|
+
return {
|
|
19165
|
+
sendMessage,
|
|
19166
|
+
};
|
|
18853
19167
|
}
|
|
18854
19168
|
|
|
18855
|
-
export { Action, AppEmbed, ConversationEmbed, EmbedEvent, HomeLeftNavItem, HomepageModule, HostEvent, ListPageColumns, LiveboardEmbed, LogLevel, Page, PinboardEmbed, PreRenderedAppEmbed, PreRenderedConversationEmbed, PreRenderedLiveboardEmbed, PreRenderedPinboardEmbed, PreRenderedSageEmbed, PreRenderedSearchBarEmbed, PreRenderedSearchEmbed, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed,
|
|
19169
|
+
export { Action, AppEmbed, ConversationEmbed, ConversationMessage, EmbedEvent, HomeLeftNavItem, HomepageModule, HostEvent, ListPageColumns, LiveboardEmbed, LogLevel, Page, PinboardEmbed, PreRenderedAppEmbed, PreRenderedConversationEmbed, PreRenderedLiveboardEmbed, PreRenderedPinboardEmbed, PreRenderedSageEmbed, PreRenderedSearchBarEmbed, PreRenderedSearchEmbed, RuntimeFilterOp, SageEmbed, SearchBarEmbed, SearchEmbed, SpotterEmbed, SpotterMessage, getSessionInfo, useEmbedRef, useInit, useSpotterAgent };
|