@thoughtspot/visual-embed-sdk 1.40.1-alpha.1 → 1.40.1-alpha.2
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/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 +1 -0
- package/cjs/src/embed/conversation.d.ts.map +1 -1
- package/cjs/src/embed/conversation.js +7 -2
- package/cjs/src/embed/conversation.js.map +1 -1
- package/cjs/src/embed/liveboard.d.ts +1 -0
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +30 -14
- package/cjs/src/embed/liveboard.js.map +1 -1
- package/cjs/src/embed/liveboard.spec.js +29 -4
- 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 +2 -0
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +18 -17
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/dist/index-k7pkZMhx.js +7371 -0
- 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 +1 -0
- package/dist/src/embed/conversation.d.ts.map +1 -1
- package/dist/src/embed/liveboard.d.ts +3 -1
- 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 +9 -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 +220 -7
- 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 +375 -60
- package/dist/tsembed-react.js +374 -59
- package/dist/tsembed.es.js +375 -60
- package/dist/tsembed.js +374 -59
- package/dist/visual-embed-sdk-react-full.d.ts +240 -8
- package/dist/visual-embed-sdk-react.d.ts +240 -8
- package/dist/visual-embed-sdk.d.ts +238 -8
- package/lib/package.json +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 +1 -0
- package/lib/src/embed/conversation.d.ts.map +1 -1
- package/lib/src/embed/conversation.js +7 -2
- package/lib/src/embed/conversation.js.map +1 -1
- package/lib/src/embed/liveboard.d.ts +1 -0
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +30 -14
- package/lib/src/embed/liveboard.js.map +1 -1
- package/lib/src/embed/liveboard.spec.js +29 -4
- 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 +2 -0
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +18 -17
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +238 -8
- package/package.json +2 -1
- package/src/embed/bodyless-conversation.ts +9 -3
- package/src/embed/conversation.ts +13 -2
- package/src/embed/liveboard.spec.ts +32 -4
- package/src/embed/liveboard.ts +36 -16
- package/src/embed/sage.ts +11 -6
- package/src/embed/search-bar.tsx +14 -7
- package/src/embed/search.ts +18 -7
- package/src/embed/ts-embed.ts +21 -18
package/dist/tsembed-react.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.
|
|
1
|
+
/* @thoughtspot/visual-embed-sdk version 1.40.1-alpha.2 */
|
|
2
2
|
'use client';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { useRef, useCallback } from 'react';
|
|
@@ -1597,6 +1597,83 @@ var EmbedEvent;
|
|
|
1597
1597
|
* @hidden
|
|
1598
1598
|
*/
|
|
1599
1599
|
EmbedEvent["RequestVisibleEmbedCoordinates"] = "requestVisibleEmbedCoordinates";
|
|
1600
|
+
/**
|
|
1601
|
+
* Emitted when spotter response is text data
|
|
1602
|
+
* @example
|
|
1603
|
+
* ```js
|
|
1604
|
+
* spotterEmbed.on(EmbedEvent.SpotterData, (payload) => {
|
|
1605
|
+
* console.log('payload', payload);
|
|
1606
|
+
* })
|
|
1607
|
+
*```
|
|
1608
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1609
|
+
*/
|
|
1610
|
+
EmbedEvent["SpotterData"] = "SpotterData";
|
|
1611
|
+
/**
|
|
1612
|
+
* Emitted when user opens up the worksheet preview modal in spotter embed.
|
|
1613
|
+
* @example
|
|
1614
|
+
* ```js
|
|
1615
|
+
* spotterEmbed.on(EmbedEvent.PreviewSpotterData, (payload) => {
|
|
1616
|
+
* console.log('payload', payload);
|
|
1617
|
+
* })
|
|
1618
|
+
*```
|
|
1619
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1620
|
+
*/
|
|
1621
|
+
EmbedEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
1622
|
+
/**
|
|
1623
|
+
* Emitted when the spotter query is triggered in spotter embed.
|
|
1624
|
+
* @example
|
|
1625
|
+
* ```js
|
|
1626
|
+
* spotterEmbed.on(EmbedEvent.SpotterQueryTriggered, (payload) => {
|
|
1627
|
+
* console.log('payload', payload);
|
|
1628
|
+
* })
|
|
1629
|
+
*```
|
|
1630
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1631
|
+
*/
|
|
1632
|
+
EmbedEvent["SpotterQueryTriggered"] = "SpotterQueryTriggered";
|
|
1633
|
+
/**
|
|
1634
|
+
* Emitted when the last spotter query is edited in spotter embed.
|
|
1635
|
+
* @example
|
|
1636
|
+
* ```js
|
|
1637
|
+
* spotterEmbed.on(EmbedEvent.LastPromptEdited, (payload) => {
|
|
1638
|
+
* console.log('payload', payload);
|
|
1639
|
+
* })
|
|
1640
|
+
*```
|
|
1641
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1642
|
+
*/
|
|
1643
|
+
EmbedEvent["LastPromptEdited"] = "LastPromptEdited";
|
|
1644
|
+
/**
|
|
1645
|
+
* Emitted when the last spotter query is deleted in spotter embed.
|
|
1646
|
+
* @example
|
|
1647
|
+
* ```js
|
|
1648
|
+
* spotterEmbed.on(EmbedEvent.LastPromptDeleted, (payload) => {
|
|
1649
|
+
* console.log('payload', payload);
|
|
1650
|
+
* })
|
|
1651
|
+
*```
|
|
1652
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1653
|
+
*/
|
|
1654
|
+
EmbedEvent["LastPromptDeleted"] = "LastPromptDeleted";
|
|
1655
|
+
/**
|
|
1656
|
+
* Emitted when the coversation is reset in spotter embed.
|
|
1657
|
+
* @example
|
|
1658
|
+
* ```js
|
|
1659
|
+
* spotterEmbed.on(EmbedEvent.ResetSpotterConversation, (payload) => {
|
|
1660
|
+
* console.log('payload', payload);
|
|
1661
|
+
* })
|
|
1662
|
+
*```
|
|
1663
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1664
|
+
*/
|
|
1665
|
+
EmbedEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
1666
|
+
/**
|
|
1667
|
+
* Emitted when the *Spotter* is initialized.
|
|
1668
|
+
* @example
|
|
1669
|
+
* ```js
|
|
1670
|
+
* spotterEmbed.on(EmbedEvent.SpotterInit, (payload) => {
|
|
1671
|
+
* console.log('payload', payload);
|
|
1672
|
+
* })
|
|
1673
|
+
*```
|
|
1674
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1675
|
+
*/
|
|
1676
|
+
EmbedEvent["SpotterInit"] = "SpotterInit";
|
|
1600
1677
|
})(EmbedEvent || (EmbedEvent = {}));
|
|
1601
1678
|
/**
|
|
1602
1679
|
* Event types that can be triggered by the host application
|
|
@@ -1614,7 +1691,7 @@ var EmbedEvent;
|
|
|
1614
1691
|
* // create the liveboard embed.
|
|
1615
1692
|
*
|
|
1616
1693
|
* liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
|
|
1617
|
-
* { columnName: 'state, operator: RuntimeFilterOp.EQ, values: [
|
|
1694
|
+
* { columnName: 'state', operator: RuntimeFilterOp.EQ, values: ["california"]}
|
|
1618
1695
|
* ]);
|
|
1619
1696
|
* ```
|
|
1620
1697
|
* @example
|
|
@@ -1824,12 +1901,12 @@ var HostEvent;
|
|
|
1824
1901
|
* Works with Search and Liveboard embed.
|
|
1825
1902
|
* @param - { columnId: string,
|
|
1826
1903
|
* name: string,
|
|
1827
|
-
* type:
|
|
1828
|
-
* dataType:
|
|
1904
|
+
* type: ATTRIBUTE/MEASURE,
|
|
1905
|
+
* dataType: INT64/CHAR/DATE }
|
|
1829
1906
|
* @example
|
|
1830
1907
|
* ```js
|
|
1831
1908
|
* searchEmbed.trigger(HostEvent.OpenFilter,
|
|
1832
|
-
* {column: { columnId: '<column-GUID>', name: 'column name', type: '
|
|
1909
|
+
* {column: { columnId: '<column-GUID>', name: 'column name', type: 'ATTRIBUTE', dataType: 'INT64'}})
|
|
1833
1910
|
* ```
|
|
1834
1911
|
* @example
|
|
1835
1912
|
* ```js
|
|
@@ -1887,6 +1964,7 @@ var HostEvent;
|
|
|
1887
1964
|
* @param
|
|
1888
1965
|
* `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
|
|
1889
1966
|
* Optional when pinning a new chart or table generated from a Search query.
|
|
1967
|
+
* **Required** in Spotter Embed.
|
|
1890
1968
|
* @param
|
|
1891
1969
|
* `liveboardID` - GUID of the Liveboard to pin an Answer. If there is no Liveboard,
|
|
1892
1970
|
* specify the `newLiveboardName` parameter to create a new Liveboard.
|
|
@@ -1934,6 +2012,12 @@ var HostEvent;
|
|
|
1934
2012
|
* ```js
|
|
1935
2013
|
* appEmbed.trigger(HostEvent.Pin)
|
|
1936
2014
|
* ```
|
|
2015
|
+
* @example
|
|
2016
|
+
* ```js
|
|
2017
|
+
* const pinResponse = await spotterEmbed.trigger(HostEvent.Pin, {
|
|
2018
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2019
|
+
* });
|
|
2020
|
+
* ```
|
|
1937
2021
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1938
2022
|
*/
|
|
1939
2023
|
HostEvent["Pin"] = "pin";
|
|
@@ -2027,6 +2111,12 @@ var HostEvent;
|
|
|
2027
2111
|
* ```js
|
|
2028
2112
|
* searchEmbed.trigger(HostEvent.MakeACopy)
|
|
2029
2113
|
* ```
|
|
2114
|
+
* @example
|
|
2115
|
+
* ```js
|
|
2116
|
+
* const pinResponse = await spotterEmbed.trigger(HostEvent.MakeACopy, {
|
|
2117
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2118
|
+
* });
|
|
2119
|
+
* ```
|
|
2030
2120
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2031
2121
|
*/
|
|
2032
2122
|
HostEvent["MakeACopy"] = "makeACopy";
|
|
@@ -2099,6 +2189,7 @@ var HostEvent;
|
|
|
2099
2189
|
* This event is not supported in visualization embed and search embed.
|
|
2100
2190
|
* @param - object - To trigger the action for a specific visualization
|
|
2101
2191
|
* in Liveboard embed, pass in `vizId` as a key.
|
|
2192
|
+
* **Required** in Spotter embed.
|
|
2102
2193
|
* @example
|
|
2103
2194
|
* ```js
|
|
2104
2195
|
* liveboardEmbed.trigger(HostEvent.Edit)
|
|
@@ -2107,6 +2198,12 @@ var HostEvent;
|
|
|
2107
2198
|
* liveboardEmbed.trigger(HostEvent.Edit, {vizId:
|
|
2108
2199
|
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
2109
2200
|
* ```
|
|
2201
|
+
* @example
|
|
2202
|
+
* ```js
|
|
2203
|
+
* const pinResponse = await spotterEmbed.trigger(HostEvent.Edit, {
|
|
2204
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2205
|
+
* });
|
|
2206
|
+
* ```
|
|
2110
2207
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2111
2208
|
*/
|
|
2112
2209
|
HostEvent["Edit"] = "edit";
|
|
@@ -2154,6 +2251,16 @@ var HostEvent;
|
|
|
2154
2251
|
* );
|
|
2155
2252
|
* })
|
|
2156
2253
|
* ```
|
|
2254
|
+
* @example
|
|
2255
|
+
* ```js
|
|
2256
|
+
* spotterEmbed.trigger(HostEvent.GetTML, {
|
|
2257
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2258
|
+
* }).then((tml) => {
|
|
2259
|
+
* console.log(
|
|
2260
|
+
* tml.answer.search_query // TML representation of the search query
|
|
2261
|
+
* );
|
|
2262
|
+
* })
|
|
2263
|
+
* ```
|
|
2157
2264
|
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
|
|
2158
2265
|
* @important
|
|
2159
2266
|
*/
|
|
@@ -2241,7 +2348,12 @@ var HostEvent;
|
|
|
2241
2348
|
* vizEmbed.trigger(HostEvent.DownloadAsPng)
|
|
2242
2349
|
*
|
|
2243
2350
|
* searchEmbed.trigger(HostEvent.DownloadAsPng)
|
|
2351
|
+
*
|
|
2352
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPng, {
|
|
2353
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2354
|
+
* })
|
|
2244
2355
|
* ```
|
|
2356
|
+
*
|
|
2245
2357
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
|
|
2246
2358
|
*/
|
|
2247
2359
|
HostEvent["DownloadAsPng"] = "downloadAsPng";
|
|
@@ -2259,6 +2371,11 @@ var HostEvent;
|
|
|
2259
2371
|
* ```js
|
|
2260
2372
|
* searchEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
2261
2373
|
* ```
|
|
2374
|
+
* ```js
|
|
2375
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsCsv, {
|
|
2376
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2377
|
+
* })
|
|
2378
|
+
* ```
|
|
2262
2379
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2263
2380
|
*/
|
|
2264
2381
|
HostEvent["DownloadAsCsv"] = "downloadAsCSV";
|
|
@@ -2276,6 +2393,11 @@ var HostEvent;
|
|
|
2276
2393
|
* ```js
|
|
2277
2394
|
* searchEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
2278
2395
|
* ```
|
|
2396
|
+
* ```js
|
|
2397
|
+
* spotterEmbed.trigger(HostEvent.downloadAsXLSX, {
|
|
2398
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2399
|
+
* })
|
|
2400
|
+
* ```
|
|
2279
2401
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2280
2402
|
*/
|
|
2281
2403
|
HostEvent["DownloadAsXlsx"] = "downloadAsXLSX";
|
|
@@ -2295,6 +2417,7 @@ var HostEvent;
|
|
|
2295
2417
|
/**
|
|
2296
2418
|
* Trigger the **Save** action on a Liveboard or Answer.
|
|
2297
2419
|
* Saves the changes.
|
|
2420
|
+
* @param - `vizId` is required in Spotter Embed.
|
|
2298
2421
|
* @example
|
|
2299
2422
|
* ```js
|
|
2300
2423
|
* liveboardEmbed.trigger(HostEvent.Save)
|
|
@@ -2302,6 +2425,11 @@ var HostEvent;
|
|
|
2302
2425
|
* ```js
|
|
2303
2426
|
* searchEmbed.trigger(HostEvent.Save)
|
|
2304
2427
|
* ```
|
|
2428
|
+
* ```js
|
|
2429
|
+
* spotterEmbed.trigger(HostEvent.Save, {
|
|
2430
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2431
|
+
* })
|
|
2432
|
+
* ```
|
|
2305
2433
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2306
2434
|
*/
|
|
2307
2435
|
HostEvent["Save"] = "save";
|
|
@@ -2585,7 +2713,7 @@ var HostEvent;
|
|
|
2585
2713
|
HostEvent["ResetLiveboardPersonalisedView"] = "ResetLiveboardPersonalisedView";
|
|
2586
2714
|
/**
|
|
2587
2715
|
* Triggers an action to update Parameter values on embedded
|
|
2588
|
-
* Answers and
|
|
2716
|
+
* Answers, Liveboard and Spotter answer in Edit mode.
|
|
2589
2717
|
*
|
|
2590
2718
|
* @example
|
|
2591
2719
|
* ```js
|
|
@@ -2604,6 +2732,13 @@ var HostEvent;
|
|
|
2604
2732
|
* console.log('parameters', parameter);
|
|
2605
2733
|
* });
|
|
2606
2734
|
*```
|
|
2735
|
+
*```js
|
|
2736
|
+
* spotterEmbed.trigger(HostEvent.GetParameters, {
|
|
2737
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2738
|
+
* }).then((parameter) => {
|
|
2739
|
+
* console.log('parameters', parameter);
|
|
2740
|
+
* });
|
|
2741
|
+
*```
|
|
2607
2742
|
* @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
2608
2743
|
*/
|
|
2609
2744
|
HostEvent["GetParameters"] = "GetParameters";
|
|
@@ -2671,6 +2806,64 @@ var HostEvent;
|
|
|
2671
2806
|
* @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
|
|
2672
2807
|
*/
|
|
2673
2808
|
HostEvent["TransformTableVizData"] = "TransformTableVizData";
|
|
2809
|
+
/**
|
|
2810
|
+
* Triggers a search operation with the search tokens specified in
|
|
2811
|
+
* the search query string in spotter embed.
|
|
2812
|
+
* @param - `queryString`: Text string in Natural Language format
|
|
2813
|
+
* @param - `executeSearch`: Boolean to execute search and update search query
|
|
2814
|
+
* @example
|
|
2815
|
+
* ```js
|
|
2816
|
+
* spotterEmbed.trigger(HostEvent.SpotterSearch, {
|
|
2817
|
+
* query: 'revenue per year',
|
|
2818
|
+
* executeSearch: true,
|
|
2819
|
+
* })
|
|
2820
|
+
* ```
|
|
2821
|
+
*/
|
|
2822
|
+
HostEvent["SpotterSearch"] = "SpotterSearch";
|
|
2823
|
+
/**
|
|
2824
|
+
* Edits the last prompt in spotter embed.
|
|
2825
|
+
* @param - `query`: Text string
|
|
2826
|
+
* @example
|
|
2827
|
+
* ```js
|
|
2828
|
+
* spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year");
|
|
2829
|
+
* ```
|
|
2830
|
+
*/
|
|
2831
|
+
HostEvent["EditLastPrompt"] = "EditLastPrompt";
|
|
2832
|
+
/**
|
|
2833
|
+
* Opens the Worksheet preview modal in Spotter Embed.
|
|
2834
|
+
* @example
|
|
2835
|
+
* ```js
|
|
2836
|
+
* spotterEmbed.trigger(HostEvent.PreviewSpotterData);
|
|
2837
|
+
* ```
|
|
2838
|
+
*/
|
|
2839
|
+
HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
2840
|
+
/**
|
|
2841
|
+
* Resets the Spotter Embed Conversation.
|
|
2842
|
+
* @example
|
|
2843
|
+
* ```js
|
|
2844
|
+
* spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
|
|
2845
|
+
* ```
|
|
2846
|
+
*/
|
|
2847
|
+
HostEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
2848
|
+
/**
|
|
2849
|
+
* Deletes the last prompt in spotter embed.
|
|
2850
|
+
* @example
|
|
2851
|
+
* ```js
|
|
2852
|
+
* spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
|
|
2853
|
+
* ```
|
|
2854
|
+
*/
|
|
2855
|
+
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
2856
|
+
/**
|
|
2857
|
+
* Toggle the visualization to chart or table view.
|
|
2858
|
+
* @param - `vizId ` In Spotter Embed, vizId is required.
|
|
2859
|
+
* @example
|
|
2860
|
+
* ```js
|
|
2861
|
+
* spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {
|
|
2862
|
+
* vizId:"'b535c760-8bbe-4e6f-bb26-af56b4129a1e'"
|
|
2863
|
+
* });
|
|
2864
|
+
*```
|
|
2865
|
+
*/
|
|
2866
|
+
HostEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
|
|
2674
2867
|
/**
|
|
2675
2868
|
* @hidden
|
|
2676
2869
|
* Trigger exit from presentation mode when user exits fullscreen.
|
|
@@ -2694,6 +2887,26 @@ var HostEvent;
|
|
|
2694
2887
|
* @hidden
|
|
2695
2888
|
*/
|
|
2696
2889
|
HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
|
|
2890
|
+
/**
|
|
2891
|
+
* Trigger the *Ask Sage* action for visualizations
|
|
2892
|
+
* @example
|
|
2893
|
+
* ```js
|
|
2894
|
+
* liveboardEmbed.trigger(HostEvent.AskSpotter,
|
|
2895
|
+
* {containerId:'730496d6-6903-4601-937e-2c691821af3c'})
|
|
2896
|
+
* ```
|
|
2897
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
2898
|
+
*/
|
|
2899
|
+
HostEvent["AskSpotter"] = "askSpotter";
|
|
2900
|
+
/**
|
|
2901
|
+
* @hidden
|
|
2902
|
+
* Triggers the update of the embed params.
|
|
2903
|
+
*
|
|
2904
|
+
* @example
|
|
2905
|
+
* ```js
|
|
2906
|
+
* liveboardEmbed.trigger(HostEvent.UpdateEmbedParams, viewConfig);
|
|
2907
|
+
* ```
|
|
2908
|
+
*/
|
|
2909
|
+
HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
|
|
2697
2910
|
})(HostEvent || (HostEvent = {}));
|
|
2698
2911
|
/**
|
|
2699
2912
|
* The different visual modes that the data sources panel within
|
|
@@ -7823,7 +8036,7 @@ class AnswerService {
|
|
|
7823
8036
|
async getTML() {
|
|
7824
8037
|
const { object } = await this.executeQuery(getAnswerTML, {});
|
|
7825
8038
|
const edoc = object[0].edoc;
|
|
7826
|
-
const YAML = await import('./index-
|
|
8039
|
+
const YAML = await import('./index-k7pkZMhx.js');
|
|
7827
8040
|
const parsedDoc = YAML.parse(edoc);
|
|
7828
8041
|
return {
|
|
7829
8042
|
answer: {
|
|
@@ -15557,7 +15770,7 @@ function processEventData(type, e, thoughtSpotHost, containerEl) {
|
|
|
15557
15770
|
return e;
|
|
15558
15771
|
}
|
|
15559
15772
|
|
|
15560
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
15773
|
+
var name="@thoughtspot/visual-embed-sdk";var version$1="1.40.1-alpha.2";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};
|
|
15561
15774
|
|
|
15562
15775
|
/**
|
|
15563
15776
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -15783,6 +15996,7 @@ class TsEmbed {
|
|
|
15783
15996
|
*/
|
|
15784
15997
|
this.fullscreenChangeHandler = null;
|
|
15785
15998
|
this.subscribedListeners = {};
|
|
15999
|
+
this.isEmbedContainerLoaded = false;
|
|
15786
16000
|
/**
|
|
15787
16001
|
* Send Custom style as part of payload of APP_INIT
|
|
15788
16002
|
* @param _
|
|
@@ -15809,7 +16023,8 @@ class TsEmbed {
|
|
|
15809
16023
|
this.updateAuthToken = async (_, responder) => {
|
|
15810
16024
|
const { authType } = this.embedConfig;
|
|
15811
16025
|
let { autoLogin } = this.embedConfig;
|
|
15812
|
-
// Default autoLogin: true for cookieless if undefined/null, otherwise
|
|
16026
|
+
// Default autoLogin: true for cookieless if undefined/null, otherwise
|
|
16027
|
+
// false
|
|
15813
16028
|
autoLogin = autoLogin !== null && autoLogin !== void 0 ? autoLogin : (authType === AuthType.TrustedAuthTokenCookieless);
|
|
15814
16029
|
if (autoLogin && authType === AuthType.TrustedAuthTokenCookieless) {
|
|
15815
16030
|
try {
|
|
@@ -15853,11 +16068,16 @@ class TsEmbed {
|
|
|
15853
16068
|
});
|
|
15854
16069
|
notifyAuthFailure(AuthFailureType.IDLE_SESSION_TIMEOUT);
|
|
15855
16070
|
};
|
|
16071
|
+
this.pendingEvents = [];
|
|
15856
16072
|
/**
|
|
15857
16073
|
* Register APP_INIT event and sendback init payload
|
|
15858
16074
|
*/
|
|
15859
16075
|
this.registerAppInit = () => {
|
|
15860
16076
|
this.on(EmbedEvent.APP_INIT, this.appInitCb, { start: false }, true);
|
|
16077
|
+
this.on(EmbedEvent.AuthInit, () => {
|
|
16078
|
+
this.isEmbedContainerLoaded = true;
|
|
16079
|
+
this.executePendingEvents();
|
|
16080
|
+
}, { start: false }, true);
|
|
15861
16081
|
this.on(EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
|
|
15862
16082
|
this.on(EmbedEvent.IdleSessionTimeout, this.idleSessionTimeout, { start: false }, true);
|
|
15863
16083
|
};
|
|
@@ -15883,6 +16103,7 @@ class TsEmbed {
|
|
|
15883
16103
|
});
|
|
15884
16104
|
}
|
|
15885
16105
|
};
|
|
16106
|
+
this.id = Date.now().toString();
|
|
15886
16107
|
this.el = getDOMNode(domSelector);
|
|
15887
16108
|
this.eventHandlerMap = new Map();
|
|
15888
16109
|
this.isError = false;
|
|
@@ -15896,9 +16117,9 @@ class TsEmbed {
|
|
|
15896
16117
|
...viewConfig,
|
|
15897
16118
|
});
|
|
15898
16119
|
this.hostEventClient = new HostEventClient(this.iFrame);
|
|
16120
|
+
const embedConfig = getEmbedConfig();
|
|
16121
|
+
this.embedConfig = embedConfig;
|
|
15899
16122
|
this.isReadyForRenderPromise = getInitPromise().then(async () => {
|
|
15900
|
-
const embedConfig = getEmbedConfig();
|
|
15901
|
-
this.embedConfig = embedConfig;
|
|
15902
16123
|
if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
|
|
15903
16124
|
this.embedConfig.authTriggerContainer = domSelector;
|
|
15904
16125
|
}
|
|
@@ -15931,7 +16152,6 @@ class TsEmbed {
|
|
|
15931
16152
|
*/
|
|
15932
16153
|
getEventType(event) {
|
|
15933
16154
|
var _a, _b;
|
|
15934
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
15935
16155
|
return ((_a = event.data) === null || _a === void 0 ? void 0 : _a.type) || ((_b = event.data) === null || _b === void 0 ? void 0 : _b.__type);
|
|
15936
16156
|
}
|
|
15937
16157
|
/**
|
|
@@ -16070,6 +16290,43 @@ class TsEmbed {
|
|
|
16070
16290
|
async getAppInitData() {
|
|
16071
16291
|
return this.getDefaultAppInitData();
|
|
16072
16292
|
}
|
|
16293
|
+
getPreRenderObj() {
|
|
16294
|
+
var _a;
|
|
16295
|
+
const embedObj = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
|
|
16296
|
+
if (embedObj === this) {
|
|
16297
|
+
logger$3.info('embedObj is same as this');
|
|
16298
|
+
}
|
|
16299
|
+
return embedObj;
|
|
16300
|
+
}
|
|
16301
|
+
checkEmbedContainerLoaded() {
|
|
16302
|
+
if (this.isEmbedContainerLoaded)
|
|
16303
|
+
return true;
|
|
16304
|
+
const preRenderObj = this.getPreRenderObj();
|
|
16305
|
+
if (preRenderObj && preRenderObj.isEmbedContainerLoaded) {
|
|
16306
|
+
this.isEmbedContainerLoaded = true;
|
|
16307
|
+
}
|
|
16308
|
+
return this.isEmbedContainerLoaded;
|
|
16309
|
+
}
|
|
16310
|
+
executePendingEvents() {
|
|
16311
|
+
logger$3.debug('executePendingEvents', this.pendingEvents);
|
|
16312
|
+
setTimeout(() => {
|
|
16313
|
+
this.pendingEvents.forEach((event) => {
|
|
16314
|
+
var _a;
|
|
16315
|
+
this.trigger(event.eventType, event.data);
|
|
16316
|
+
(_a = event.onEventTriggered) === null || _a === void 0 ? void 0 : _a.call(event);
|
|
16317
|
+
});
|
|
16318
|
+
this.pendingEvents = [];
|
|
16319
|
+
}, 1000);
|
|
16320
|
+
}
|
|
16321
|
+
triggerAfterLoad(eventType, data, onEventTriggered) {
|
|
16322
|
+
if (this.checkEmbedContainerLoaded()) {
|
|
16323
|
+
this.trigger(eventType, data);
|
|
16324
|
+
onEventTriggered === null || onEventTriggered === void 0 ? void 0 : onEventTriggered();
|
|
16325
|
+
}
|
|
16326
|
+
else {
|
|
16327
|
+
this.pendingEvents.push({ eventType, data, onEventTriggered });
|
|
16328
|
+
}
|
|
16329
|
+
}
|
|
16073
16330
|
/**
|
|
16074
16331
|
* Constructs the base URL string to load the ThoughtSpot app.
|
|
16075
16332
|
* @param query
|
|
@@ -16084,6 +16341,11 @@ class TsEmbed {
|
|
|
16084
16341
|
.join('/');
|
|
16085
16342
|
return `${basePath}#`;
|
|
16086
16343
|
}
|
|
16344
|
+
getUpdateEmbedParamsObject() {
|
|
16345
|
+
let queryParams = this.getEmbedParamsObject();
|
|
16346
|
+
queryParams = { ...this.viewConfig, ...queryParams };
|
|
16347
|
+
return queryParams;
|
|
16348
|
+
}
|
|
16087
16349
|
/**
|
|
16088
16350
|
* Common query params set for all the embed modes.
|
|
16089
16351
|
* @param queryParams
|
|
@@ -16233,9 +16495,13 @@ class TsEmbed {
|
|
|
16233
16495
|
return path;
|
|
16234
16496
|
}
|
|
16235
16497
|
getEmbedParams() {
|
|
16236
|
-
const queryParams = this.
|
|
16498
|
+
const queryParams = this.getEmbedParamsObject();
|
|
16237
16499
|
return getQueryParamString(queryParams);
|
|
16238
16500
|
}
|
|
16501
|
+
getEmbedParamsObject() {
|
|
16502
|
+
const params = this.getBaseQueryParams();
|
|
16503
|
+
return params;
|
|
16504
|
+
}
|
|
16239
16505
|
getRootIframeSrc() {
|
|
16240
16506
|
const query = this.getEmbedParams();
|
|
16241
16507
|
return this.getEmbedBasePath(query);
|
|
@@ -16334,7 +16600,8 @@ class TsEmbed {
|
|
|
16334
16600
|
}
|
|
16335
16601
|
});
|
|
16336
16602
|
}
|
|
16337
|
-
// Setup fullscreen change handler after iframe is
|
|
16603
|
+
// Setup fullscreen change handler after iframe is
|
|
16604
|
+
// loaded and ready
|
|
16338
16605
|
this.setupFullscreenChangeHandler();
|
|
16339
16606
|
});
|
|
16340
16607
|
this.iFrame.addEventListener('error', () => {
|
|
@@ -16436,7 +16703,6 @@ class TsEmbed {
|
|
|
16436
16703
|
const div = document.createElement('div');
|
|
16437
16704
|
div.innerHTML = child;
|
|
16438
16705
|
div.id = TS_EMBED_ID;
|
|
16439
|
-
// eslint-disable-next-line no-param-reassign
|
|
16440
16706
|
child = div;
|
|
16441
16707
|
}
|
|
16442
16708
|
if (((_a = this.el.nextElementSibling) === null || _a === void 0 ? void 0 : _a.id) === TS_EMBED_ID) {
|
|
@@ -16759,7 +17025,10 @@ class TsEmbed {
|
|
|
16759
17025
|
return this.preRender(true);
|
|
16760
17026
|
}
|
|
16761
17027
|
this.validatePreRenderViewConfig(this.viewConfig);
|
|
17028
|
+
logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
|
|
17029
|
+
this.triggerAfterLoad(HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
|
|
16762
17030
|
}
|
|
17031
|
+
this.beforePrerenderVisible();
|
|
16763
17032
|
if (this.el) {
|
|
16764
17033
|
this.syncPreRenderStyle();
|
|
16765
17034
|
if (!this.viewConfig.doNotTrackPreRenderSize) {
|
|
@@ -16776,7 +17045,6 @@ class TsEmbed {
|
|
|
16776
17045
|
this.resizeObserver.observe(this.el);
|
|
16777
17046
|
}
|
|
16778
17047
|
}
|
|
16779
|
-
this.beforePrerenderVisible();
|
|
16780
17048
|
removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
|
|
16781
17049
|
this.subscribeToEvents();
|
|
16782
17050
|
// Setup fullscreen change handler for prerendered components
|
|
@@ -16869,7 +17137,8 @@ class TsEmbed {
|
|
|
16869
17137
|
const isFullscreen = !!document.fullscreenElement;
|
|
16870
17138
|
if (!isFullscreen) {
|
|
16871
17139
|
logger$3.info('Exited fullscreen mode - triggering ExitPresentMode');
|
|
16872
|
-
// Only trigger if iframe is available and contentWindow is
|
|
17140
|
+
// Only trigger if iframe is available and contentWindow is
|
|
17141
|
+
// accessible
|
|
16873
17142
|
if (this.iFrame && this.iFrame.contentWindow) {
|
|
16874
17143
|
this.trigger(HostEvent.ExitPresentMode);
|
|
16875
17144
|
}
|
|
@@ -16903,7 +17172,6 @@ class V1Embed extends TsEmbed {
|
|
|
16903
17172
|
* Only for testing purposes.
|
|
16904
17173
|
* @hidden
|
|
16905
17174
|
*/
|
|
16906
|
-
// eslint-disable-next-line camelcase
|
|
16907
17175
|
this.test__executeCallbacks = this.executeCallbacks;
|
|
16908
17176
|
this.viewConfig = { excludeRuntimeFiltersfromURL: false, ...viewConfig };
|
|
16909
17177
|
}
|
|
@@ -16965,15 +17233,9 @@ let SearchBarEmbed$1 = class SearchBarEmbed extends TsEmbed {
|
|
|
16965
17233
|
this.embedComponentType = 'SearchBarEmbed';
|
|
16966
17234
|
this.viewConfig = viewConfig;
|
|
16967
17235
|
}
|
|
16968
|
-
|
|
16969
|
-
* Construct the URL of the embedded ThoughtSpot search to be
|
|
16970
|
-
* loaded in the iframe
|
|
16971
|
-
* @param dataSources A list of data source GUIDs
|
|
16972
|
-
*/
|
|
16973
|
-
getIFrameSrc() {
|
|
17236
|
+
getEmbedParamsObject() {
|
|
16974
17237
|
var _a;
|
|
16975
17238
|
const { searchOptions, dataSource, dataSources, useLastSelectedSources = false, excludeSearchTokenStringFromURL, } = this.viewConfig;
|
|
16976
|
-
const path = 'search-bar-embed';
|
|
16977
17239
|
const queryParams = this.getBaseQueryParams();
|
|
16978
17240
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
16979
17241
|
if (dataSources && dataSources.length) {
|
|
@@ -16995,6 +17257,16 @@ let SearchBarEmbed$1 = class SearchBarEmbed extends TsEmbed {
|
|
|
16995
17257
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
16996
17258
|
}
|
|
16997
17259
|
queryParams[Param.searchEmbed] = true;
|
|
17260
|
+
return queryParams;
|
|
17261
|
+
}
|
|
17262
|
+
/**
|
|
17263
|
+
* Construct the URL of the embedded ThoughtSpot search to be
|
|
17264
|
+
* loaded in the iframe
|
|
17265
|
+
* @param dataSources A list of data source GUIDs
|
|
17266
|
+
*/
|
|
17267
|
+
getIFrameSrc() {
|
|
17268
|
+
const queryParams = this.getEmbedParamsObject();
|
|
17269
|
+
const path = 'search-bar-embed';
|
|
16998
17270
|
let query = '';
|
|
16999
17271
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
17000
17272
|
if (queryParamsString) {
|
|
@@ -17045,12 +17317,7 @@ let SageEmbed$1 = class SageEmbed extends V1Embed {
|
|
|
17045
17317
|
viewConfig.embedComponentType = 'SageEmbed';
|
|
17046
17318
|
super(domSelector, viewConfig);
|
|
17047
17319
|
}
|
|
17048
|
-
|
|
17049
|
-
* Constructs a map of parameters to be passed on to the
|
|
17050
|
-
* embedded Eureka or Sage search page.
|
|
17051
|
-
* @returns {string} query string
|
|
17052
|
-
*/
|
|
17053
|
-
getEmbedParams() {
|
|
17320
|
+
getEmbedParamsObject() {
|
|
17054
17321
|
const { disableWorksheetChange, hideWorksheetSelector, showObjectSuggestions, dataPanelV2, hideSampleQuestions, isProductTour, hideSageAnswerHeader, hideAutocompleteSuggestions, } = this.viewConfig;
|
|
17055
17322
|
const params = this.getBaseQueryParams();
|
|
17056
17323
|
params[Param.DataPanelV2Enabled] = !!dataPanelV2;
|
|
@@ -17065,6 +17332,15 @@ let SageEmbed$1 = class SageEmbed extends V1Embed {
|
|
|
17065
17332
|
params[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
17066
17333
|
params[Param.IsProductTour] = !!isProductTour;
|
|
17067
17334
|
params[Param.HideSageAnswerHeader] = !!hideSageAnswerHeader;
|
|
17335
|
+
return params;
|
|
17336
|
+
}
|
|
17337
|
+
/**
|
|
17338
|
+
* Constructs a map of parameters to be passed on to the
|
|
17339
|
+
* embedded Eureka or Sage search page.
|
|
17340
|
+
* @returns {string} query string
|
|
17341
|
+
*/
|
|
17342
|
+
getEmbedParams() {
|
|
17343
|
+
const params = this.getEmbedParamsObject();
|
|
17068
17344
|
return getQueryParamString(params, true);
|
|
17069
17345
|
}
|
|
17070
17346
|
/**
|
|
@@ -17174,11 +17450,9 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
|
|
|
17174
17450
|
const defaultAppInitData = await super.getAppInitData();
|
|
17175
17451
|
return { ...defaultAppInitData, ...this.getSearchInitData() };
|
|
17176
17452
|
}
|
|
17177
|
-
|
|
17453
|
+
getEmbedParamsObject() {
|
|
17178
17454
|
var _a;
|
|
17179
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
|
|
17180
|
-
/* eslint-disable-next-line max-len */
|
|
17181
|
-
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
|
|
17455
|
+
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;
|
|
17182
17456
|
const queryParams = this.getBaseQueryParams();
|
|
17183
17457
|
queryParams[Param.HideActions] = [
|
|
17184
17458
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -17211,7 +17485,6 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
|
|
|
17211
17485
|
queryParams[Param.HideSearchBar] = true;
|
|
17212
17486
|
}
|
|
17213
17487
|
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
17214
|
-
/* eslint-disable-next-line max-len */
|
|
17215
17488
|
queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
17216
17489
|
}
|
|
17217
17490
|
if (!focusSearchBarOnRender) {
|
|
@@ -17224,20 +17497,22 @@ let SearchEmbed$1 = class SearchEmbed extends TsEmbed {
|
|
|
17224
17497
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
17225
17498
|
}
|
|
17226
17499
|
queryParams[Param.searchEmbed] = true;
|
|
17227
|
-
/* eslint-disable-next-line max-len */
|
|
17228
17500
|
queryParams[Param.CollapseSearchBarInitially] = collapseSearchBarInitially || collapseSearchBar;
|
|
17229
17501
|
queryParams[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
17230
17502
|
if (dataPanelCustomGroupsAccordionInitialState
|
|
17231
17503
|
=== DataPanelCustomColumnGroupsAccordionState$1.COLLAPSE_ALL
|
|
17232
17504
|
|| dataPanelCustomGroupsAccordionInitialState
|
|
17233
17505
|
=== DataPanelCustomColumnGroupsAccordionState$1.EXPAND_FIRST) {
|
|
17234
|
-
/* eslint-disable-next-line max-len */
|
|
17235
17506
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
|
|
17236
17507
|
}
|
|
17237
17508
|
else {
|
|
17238
|
-
/* eslint-disable-next-line max-len */
|
|
17239
17509
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL;
|
|
17240
17510
|
}
|
|
17511
|
+
return queryParams;
|
|
17512
|
+
}
|
|
17513
|
+
getEmbedParams() {
|
|
17514
|
+
const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
|
|
17515
|
+
const queryParams = this.getEmbedParamsObject();
|
|
17241
17516
|
let query = '';
|
|
17242
17517
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
17243
17518
|
if (queryParamsString) {
|
|
@@ -17719,7 +17994,7 @@ const addPreviewStylesIfNotPresent = () => {
|
|
|
17719
17994
|
return;
|
|
17720
17995
|
}
|
|
17721
17996
|
const previewStyles = `
|
|
17722
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community@32.0.2/styles/ag-grid.min.css">
|
|
17997
|
+
<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">
|
|
17723
17998
|
<style id="ts-preview-style">
|
|
17724
17999
|
.ts-viz-preview-loader {
|
|
17725
18000
|
position: absolute;
|
|
@@ -17830,6 +18105,7 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
17830
18105
|
}
|
|
17831
18106
|
this.setIFrameHeight(frameHeight || this.defaultHeight);
|
|
17832
18107
|
};
|
|
18108
|
+
this.currentLiveboardId = this.viewConfig.liveboardId;
|
|
17833
18109
|
if (this.viewConfig.fullHeight === true) {
|
|
17834
18110
|
if (this.viewConfig.vizId) {
|
|
17835
18111
|
logger$3.warn('Full height is currently only supported for Liveboard embeds.' +
|
|
@@ -17846,6 +18122,11 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
17846
18122
|
* embedded Liveboard or visualization.
|
|
17847
18123
|
*/
|
|
17848
18124
|
getEmbedParams() {
|
|
18125
|
+
const params = this.getEmbedParamsObject();
|
|
18126
|
+
const queryParams = getQueryParamString(params, true);
|
|
18127
|
+
return queryParams;
|
|
18128
|
+
}
|
|
18129
|
+
getEmbedParamsObject() {
|
|
17849
18130
|
let params = {};
|
|
17850
18131
|
params = this.getBaseQueryParams(params);
|
|
17851
18132
|
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;
|
|
@@ -17915,8 +18196,27 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
17915
18196
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
17916
18197
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
17917
18198
|
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
17918
|
-
|
|
17919
|
-
|
|
18199
|
+
if (oAuthPollingInterval !== undefined) {
|
|
18200
|
+
params[Param.OauthPollingInterval] = oAuthPollingInterval;
|
|
18201
|
+
}
|
|
18202
|
+
if (isForceRedirect) {
|
|
18203
|
+
params[Param.IsForceRedirect] = isForceRedirect;
|
|
18204
|
+
}
|
|
18205
|
+
if (dataSourceId !== undefined) {
|
|
18206
|
+
params[Param.DataSourceId] = dataSourceId;
|
|
18207
|
+
}
|
|
18208
|
+
if (isLiveboardStylingAndGroupingEnabled !== undefined) {
|
|
18209
|
+
params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
|
|
18210
|
+
}
|
|
18211
|
+
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
18212
|
+
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
18213
|
+
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
18214
|
+
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
|
|
18215
|
+
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
18216
|
+
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
18217
|
+
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
18218
|
+
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
18219
|
+
return params;
|
|
17920
18220
|
}
|
|
17921
18221
|
getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
|
|
17922
18222
|
let suffix = `/embed/viz/${liveboardId}`;
|
|
@@ -17978,16 +18278,12 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
17978
18278
|
}
|
|
17979
18279
|
}
|
|
17980
18280
|
beforePrerenderVisible() {
|
|
17981
|
-
|
|
17982
|
-
const
|
|
17983
|
-
|
|
17984
|
-
|
|
17985
|
-
|
|
17986
|
-
|
|
17987
|
-
if (showDifferentLib) {
|
|
17988
|
-
const libId = this.viewConfig.liveboardId;
|
|
17989
|
-
this.navigateToLiveboard(libId);
|
|
17990
|
-
}
|
|
18281
|
+
const embedObj = this.getPreRenderObj();
|
|
18282
|
+
const libId = this.currentLiveboardId;
|
|
18283
|
+
this.navigateToLiveboard(libId, this.viewConfig.vizId, this.viewConfig.activeTabId, () => {
|
|
18284
|
+
if (embedObj)
|
|
18285
|
+
embedObj.currentLiveboardId = libId;
|
|
18286
|
+
});
|
|
17991
18287
|
}
|
|
17992
18288
|
async handleRenderForPrerender() {
|
|
17993
18289
|
if (isUndefined$1(this.viewConfig.liveboardId)) {
|
|
@@ -18049,13 +18345,13 @@ let LiveboardEmbed$1 = class LiveboardEmbed extends V1Embed {
|
|
|
18049
18345
|
this.postRender();
|
|
18050
18346
|
return this;
|
|
18051
18347
|
}
|
|
18052
|
-
navigateToLiveboard(liveboardId, vizId, activeTabId) {
|
|
18348
|
+
navigateToLiveboard(liveboardId, vizId, activeTabId, onNavigateCalled) {
|
|
18053
18349
|
const path = this.getIframeSuffixSrc(liveboardId, vizId, activeTabId);
|
|
18054
18350
|
this.viewConfig.liveboardId = liveboardId;
|
|
18055
18351
|
this.viewConfig.activeTabId = activeTabId;
|
|
18056
18352
|
this.viewConfig.vizId = vizId;
|
|
18057
18353
|
if (this.isRendered) {
|
|
18058
|
-
this.
|
|
18354
|
+
this.triggerAfterLoad(HostEvent.Navigate, path.substring(1), onNavigateCalled);
|
|
18059
18355
|
}
|
|
18060
18356
|
else if (this.viewConfig.preRenderId) {
|
|
18061
18357
|
this.preRender(true);
|
|
@@ -18445,7 +18741,11 @@ class Conversation {
|
|
|
18445
18741
|
return {
|
|
18446
18742
|
convId: this.conversationId,
|
|
18447
18743
|
messageId: responses[0].msgId,
|
|
18448
|
-
data:
|
|
18744
|
+
data: {
|
|
18745
|
+
...data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
|
|
18746
|
+
convId: this.conversationId,
|
|
18747
|
+
messageId: responses[0].msgId,
|
|
18748
|
+
},
|
|
18449
18749
|
error: null,
|
|
18450
18750
|
};
|
|
18451
18751
|
}
|
|
@@ -18469,13 +18769,17 @@ let ConversationMessage$1 = class ConversationMessage extends TsEmbed {
|
|
|
18469
18769
|
super(container, viewConfig);
|
|
18470
18770
|
this.viewConfig = viewConfig;
|
|
18471
18771
|
}
|
|
18472
|
-
|
|
18772
|
+
getEmbedParamsObject() {
|
|
18473
18773
|
var _a;
|
|
18474
|
-
const { sessionId, genNo, acSessionId, acGenNo, } = this.viewConfig;
|
|
18475
|
-
const path = 'conv-assist-answer';
|
|
18476
18774
|
const queryParams = this.getBaseQueryParams();
|
|
18477
18775
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
18478
18776
|
queryParams[Param.isSpotterAgentEmbed] = true;
|
|
18777
|
+
return queryParams;
|
|
18778
|
+
}
|
|
18779
|
+
getIframeSrc() {
|
|
18780
|
+
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
18781
|
+
const path = 'conv-assist-answer';
|
|
18782
|
+
const queryParams = this.getEmbedParamsObject();
|
|
18479
18783
|
let query = '';
|
|
18480
18784
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
18481
18785
|
if (queryParamsString) {
|
|
@@ -18486,6 +18790,8 @@ let ConversationMessage$1 = class ConversationMessage extends TsEmbed {
|
|
|
18486
18790
|
genNo,
|
|
18487
18791
|
acSessionId,
|
|
18488
18792
|
acGenNo,
|
|
18793
|
+
convId,
|
|
18794
|
+
messageId,
|
|
18489
18795
|
});
|
|
18490
18796
|
return `${this.getEmbedBasePath(query)}/embed/${path}${tsPostHashParams}`;
|
|
18491
18797
|
}
|
|
@@ -18529,6 +18835,8 @@ class SpotterAgentEmbed {
|
|
|
18529
18835
|
const container = document.createElement('div');
|
|
18530
18836
|
const embed = new ConversationMessage$1(container, {
|
|
18531
18837
|
...this.viewConfig,
|
|
18838
|
+
convId: data.convId,
|
|
18839
|
+
messageId: data.messageId,
|
|
18532
18840
|
sessionId: data.sessionId,
|
|
18533
18841
|
genNo: data.genNo,
|
|
18534
18842
|
acSessionId: data.stateKey.transactionId,
|
|
@@ -18549,6 +18857,8 @@ class SpotterAgentEmbed {
|
|
|
18549
18857
|
return { error };
|
|
18550
18858
|
}
|
|
18551
18859
|
return { data: {
|
|
18860
|
+
convId: data.convId,
|
|
18861
|
+
messageId: data.messageId,
|
|
18552
18862
|
sessionId: data.sessionId,
|
|
18553
18863
|
genNo: data.genNo,
|
|
18554
18864
|
acSessionId: data.stateKey.transactionId,
|
|
@@ -18625,9 +18935,8 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
|
|
|
18625
18935
|
super(container, viewConfig);
|
|
18626
18936
|
this.viewConfig = viewConfig;
|
|
18627
18937
|
}
|
|
18628
|
-
|
|
18938
|
+
getEmbedParamsObject() {
|
|
18629
18939
|
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, } = this.viewConfig;
|
|
18630
|
-
const path = 'insights/conv-assist';
|
|
18631
18940
|
if (!worksheetId) {
|
|
18632
18941
|
this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
|
|
18633
18942
|
}
|
|
@@ -18648,6 +18957,12 @@ let SpotterEmbed$1 = class SpotterEmbed extends TsEmbed {
|
|
|
18648
18957
|
if (!isUndefined_1(hideSampleQuestions)) {
|
|
18649
18958
|
queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
18650
18959
|
}
|
|
18960
|
+
return queryParams;
|
|
18961
|
+
}
|
|
18962
|
+
getIframeSrc() {
|
|
18963
|
+
const { worksheetId, searchOptions, } = this.viewConfig;
|
|
18964
|
+
const path = 'insights/conv-assist';
|
|
18965
|
+
const queryParams = this.getEmbedParamsObject();
|
|
18651
18966
|
let query = '';
|
|
18652
18967
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
18653
18968
|
if (queryParamsString) {
|