@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.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
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
|
|
@@ -1619,6 +1619,83 @@
|
|
|
1619
1619
|
* @hidden
|
|
1620
1620
|
*/
|
|
1621
1621
|
EmbedEvent["RequestVisibleEmbedCoordinates"] = "requestVisibleEmbedCoordinates";
|
|
1622
|
+
/**
|
|
1623
|
+
* Emitted when spotter response is text data
|
|
1624
|
+
* @example
|
|
1625
|
+
* ```js
|
|
1626
|
+
* spotterEmbed.on(EmbedEvent.SpotterData, (payload) => {
|
|
1627
|
+
* console.log('payload', payload);
|
|
1628
|
+
* })
|
|
1629
|
+
*```
|
|
1630
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1631
|
+
*/
|
|
1632
|
+
EmbedEvent["SpotterData"] = "SpotterData";
|
|
1633
|
+
/**
|
|
1634
|
+
* Emitted when user opens up the worksheet preview modal in spotter embed.
|
|
1635
|
+
* @example
|
|
1636
|
+
* ```js
|
|
1637
|
+
* spotterEmbed.on(EmbedEvent.PreviewSpotterData, (payload) => {
|
|
1638
|
+
* console.log('payload', payload);
|
|
1639
|
+
* })
|
|
1640
|
+
*```
|
|
1641
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1642
|
+
*/
|
|
1643
|
+
EmbedEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
1644
|
+
/**
|
|
1645
|
+
* Emitted when the spotter query is triggered in spotter embed.
|
|
1646
|
+
* @example
|
|
1647
|
+
* ```js
|
|
1648
|
+
* spotterEmbed.on(EmbedEvent.SpotterQueryTriggered, (payload) => {
|
|
1649
|
+
* console.log('payload', payload);
|
|
1650
|
+
* })
|
|
1651
|
+
*```
|
|
1652
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1653
|
+
*/
|
|
1654
|
+
EmbedEvent["SpotterQueryTriggered"] = "SpotterQueryTriggered";
|
|
1655
|
+
/**
|
|
1656
|
+
* Emitted when the last spotter query is edited in spotter embed.
|
|
1657
|
+
* @example
|
|
1658
|
+
* ```js
|
|
1659
|
+
* spotterEmbed.on(EmbedEvent.LastPromptEdited, (payload) => {
|
|
1660
|
+
* console.log('payload', payload);
|
|
1661
|
+
* })
|
|
1662
|
+
*```
|
|
1663
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1664
|
+
*/
|
|
1665
|
+
EmbedEvent["LastPromptEdited"] = "LastPromptEdited";
|
|
1666
|
+
/**
|
|
1667
|
+
* Emitted when the last spotter query is deleted in spotter embed.
|
|
1668
|
+
* @example
|
|
1669
|
+
* ```js
|
|
1670
|
+
* spotterEmbed.on(EmbedEvent.LastPromptDeleted, (payload) => {
|
|
1671
|
+
* console.log('payload', payload);
|
|
1672
|
+
* })
|
|
1673
|
+
*```
|
|
1674
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1675
|
+
*/
|
|
1676
|
+
EmbedEvent["LastPromptDeleted"] = "LastPromptDeleted";
|
|
1677
|
+
/**
|
|
1678
|
+
* Emitted when the coversation is reset in spotter embed.
|
|
1679
|
+
* @example
|
|
1680
|
+
* ```js
|
|
1681
|
+
* spotterEmbed.on(EmbedEvent.ResetSpotterConversation, (payload) => {
|
|
1682
|
+
* console.log('payload', payload);
|
|
1683
|
+
* })
|
|
1684
|
+
*```
|
|
1685
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1686
|
+
*/
|
|
1687
|
+
EmbedEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
1688
|
+
/**
|
|
1689
|
+
* Emitted when the *Spotter* is initialized.
|
|
1690
|
+
* @example
|
|
1691
|
+
* ```js
|
|
1692
|
+
* spotterEmbed.on(EmbedEvent.SpotterInit, (payload) => {
|
|
1693
|
+
* console.log('payload', payload);
|
|
1694
|
+
* })
|
|
1695
|
+
*```
|
|
1696
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1697
|
+
*/
|
|
1698
|
+
EmbedEvent["SpotterInit"] = "SpotterInit";
|
|
1622
1699
|
})(exports.EmbedEvent || (exports.EmbedEvent = {}));
|
|
1623
1700
|
/**
|
|
1624
1701
|
* Event types that can be triggered by the host application
|
|
@@ -1636,7 +1713,7 @@
|
|
|
1636
1713
|
* // create the liveboard embed.
|
|
1637
1714
|
*
|
|
1638
1715
|
* liveboardEmbed.trigger(HostEvent.UpdateRuntimeFilters, [
|
|
1639
|
-
* { columnName: 'state, operator: RuntimeFilterOp.EQ, values: [
|
|
1716
|
+
* { columnName: 'state', operator: RuntimeFilterOp.EQ, values: ["california"]}
|
|
1640
1717
|
* ]);
|
|
1641
1718
|
* ```
|
|
1642
1719
|
* @example
|
|
@@ -1846,12 +1923,12 @@
|
|
|
1846
1923
|
* Works with Search and Liveboard embed.
|
|
1847
1924
|
* @param - { columnId: string,
|
|
1848
1925
|
* name: string,
|
|
1849
|
-
* type:
|
|
1850
|
-
* dataType:
|
|
1926
|
+
* type: ATTRIBUTE/MEASURE,
|
|
1927
|
+
* dataType: INT64/CHAR/DATE }
|
|
1851
1928
|
* @example
|
|
1852
1929
|
* ```js
|
|
1853
1930
|
* searchEmbed.trigger(HostEvent.OpenFilter,
|
|
1854
|
-
* {column: { columnId: '<column-GUID>', name: 'column name', type: '
|
|
1931
|
+
* {column: { columnId: '<column-GUID>', name: 'column name', type: 'ATTRIBUTE', dataType: 'INT64'}})
|
|
1855
1932
|
* ```
|
|
1856
1933
|
* @example
|
|
1857
1934
|
* ```js
|
|
@@ -1909,6 +1986,7 @@
|
|
|
1909
1986
|
* @param
|
|
1910
1987
|
* `vizId`- GUID of the saved Answer or visualization to pin to a Liveboard.
|
|
1911
1988
|
* Optional when pinning a new chart or table generated from a Search query.
|
|
1989
|
+
* **Required** in Spotter Embed.
|
|
1912
1990
|
* @param
|
|
1913
1991
|
* `liveboardID` - GUID of the Liveboard to pin an Answer. If there is no Liveboard,
|
|
1914
1992
|
* specify the `newLiveboardName` parameter to create a new Liveboard.
|
|
@@ -1956,6 +2034,12 @@
|
|
|
1956
2034
|
* ```js
|
|
1957
2035
|
* appEmbed.trigger(HostEvent.Pin)
|
|
1958
2036
|
* ```
|
|
2037
|
+
* @example
|
|
2038
|
+
* ```js
|
|
2039
|
+
* const pinResponse = await spotterEmbed.trigger(HostEvent.Pin, {
|
|
2040
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2041
|
+
* });
|
|
2042
|
+
* ```
|
|
1959
2043
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1960
2044
|
*/
|
|
1961
2045
|
HostEvent["Pin"] = "pin";
|
|
@@ -2049,6 +2133,12 @@
|
|
|
2049
2133
|
* ```js
|
|
2050
2134
|
* searchEmbed.trigger(HostEvent.MakeACopy)
|
|
2051
2135
|
* ```
|
|
2136
|
+
* @example
|
|
2137
|
+
* ```js
|
|
2138
|
+
* const pinResponse = await spotterEmbed.trigger(HostEvent.MakeACopy, {
|
|
2139
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2140
|
+
* });
|
|
2141
|
+
* ```
|
|
2052
2142
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2053
2143
|
*/
|
|
2054
2144
|
HostEvent["MakeACopy"] = "makeACopy";
|
|
@@ -2121,6 +2211,7 @@
|
|
|
2121
2211
|
* This event is not supported in visualization embed and search embed.
|
|
2122
2212
|
* @param - object - To trigger the action for a specific visualization
|
|
2123
2213
|
* in Liveboard embed, pass in `vizId` as a key.
|
|
2214
|
+
* **Required** in Spotter embed.
|
|
2124
2215
|
* @example
|
|
2125
2216
|
* ```js
|
|
2126
2217
|
* liveboardEmbed.trigger(HostEvent.Edit)
|
|
@@ -2129,6 +2220,12 @@
|
|
|
2129
2220
|
* liveboardEmbed.trigger(HostEvent.Edit, {vizId:
|
|
2130
2221
|
* '730496d6-6903-4601-937e-2c691821af3c'})
|
|
2131
2222
|
* ```
|
|
2223
|
+
* @example
|
|
2224
|
+
* ```js
|
|
2225
|
+
* const pinResponse = await spotterEmbed.trigger(HostEvent.Edit, {
|
|
2226
|
+
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2227
|
+
* });
|
|
2228
|
+
* ```
|
|
2132
2229
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2133
2230
|
*/
|
|
2134
2231
|
HostEvent["Edit"] = "edit";
|
|
@@ -2176,6 +2273,16 @@
|
|
|
2176
2273
|
* );
|
|
2177
2274
|
* })
|
|
2178
2275
|
* ```
|
|
2276
|
+
* @example
|
|
2277
|
+
* ```js
|
|
2278
|
+
* spotterEmbed.trigger(HostEvent.GetTML, {
|
|
2279
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2280
|
+
* }).then((tml) => {
|
|
2281
|
+
* console.log(
|
|
2282
|
+
* tml.answer.search_query // TML representation of the search query
|
|
2283
|
+
* );
|
|
2284
|
+
* })
|
|
2285
|
+
* ```
|
|
2179
2286
|
* @version SDK: 1.18.0 | ThoughtSpot: 8.10.0.cl, 9.0.1.sw
|
|
2180
2287
|
* @important
|
|
2181
2288
|
*/
|
|
@@ -2263,7 +2370,12 @@
|
|
|
2263
2370
|
* vizEmbed.trigger(HostEvent.DownloadAsPng)
|
|
2264
2371
|
*
|
|
2265
2372
|
* searchEmbed.trigger(HostEvent.DownloadAsPng)
|
|
2373
|
+
*
|
|
2374
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsPng, {
|
|
2375
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2376
|
+
* })
|
|
2266
2377
|
* ```
|
|
2378
|
+
*
|
|
2267
2379
|
* @version SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl, 9.4.1.sw
|
|
2268
2380
|
*/
|
|
2269
2381
|
HostEvent["DownloadAsPng"] = "downloadAsPng";
|
|
@@ -2281,6 +2393,11 @@
|
|
|
2281
2393
|
* ```js
|
|
2282
2394
|
* searchEmbed.trigger(HostEvent.DownloadAsCsv)
|
|
2283
2395
|
* ```
|
|
2396
|
+
* ```js
|
|
2397
|
+
* spotterEmbed.trigger(HostEvent.DownloadAsCsv, {
|
|
2398
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2399
|
+
* })
|
|
2400
|
+
* ```
|
|
2284
2401
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2285
2402
|
*/
|
|
2286
2403
|
HostEvent["DownloadAsCsv"] = "downloadAsCSV";
|
|
@@ -2298,6 +2415,11 @@
|
|
|
2298
2415
|
* ```js
|
|
2299
2416
|
* searchEmbed.trigger(HostEvent.DownloadAsXlsx)
|
|
2300
2417
|
* ```
|
|
2418
|
+
* ```js
|
|
2419
|
+
* spotterEmbed.trigger(HostEvent.downloadAsXLSX, {
|
|
2420
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2421
|
+
* })
|
|
2422
|
+
* ```
|
|
2301
2423
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2302
2424
|
*/
|
|
2303
2425
|
HostEvent["DownloadAsXlsx"] = "downloadAsXLSX";
|
|
@@ -2317,6 +2439,7 @@
|
|
|
2317
2439
|
/**
|
|
2318
2440
|
* Trigger the **Save** action on a Liveboard or Answer.
|
|
2319
2441
|
* Saves the changes.
|
|
2442
|
+
* @param - `vizId` is required in Spotter Embed.
|
|
2320
2443
|
* @example
|
|
2321
2444
|
* ```js
|
|
2322
2445
|
* liveboardEmbed.trigger(HostEvent.Save)
|
|
@@ -2324,6 +2447,11 @@
|
|
|
2324
2447
|
* ```js
|
|
2325
2448
|
* searchEmbed.trigger(HostEvent.Save)
|
|
2326
2449
|
* ```
|
|
2450
|
+
* ```js
|
|
2451
|
+
* spotterEmbed.trigger(HostEvent.Save, {
|
|
2452
|
+
* vizId:"730496d6-6903-4601-937e-2c691821af3c"
|
|
2453
|
+
* })
|
|
2454
|
+
* ```
|
|
2327
2455
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
2328
2456
|
*/
|
|
2329
2457
|
HostEvent["Save"] = "save";
|
|
@@ -2607,7 +2735,7 @@
|
|
|
2607
2735
|
HostEvent["ResetLiveboardPersonalisedView"] = "ResetLiveboardPersonalisedView";
|
|
2608
2736
|
/**
|
|
2609
2737
|
* Triggers an action to update Parameter values on embedded
|
|
2610
|
-
* Answers and
|
|
2738
|
+
* Answers, Liveboard and Spotter answer in Edit mode.
|
|
2611
2739
|
*
|
|
2612
2740
|
* @example
|
|
2613
2741
|
* ```js
|
|
@@ -2626,6 +2754,13 @@
|
|
|
2626
2754
|
* console.log('parameters', parameter);
|
|
2627
2755
|
* });
|
|
2628
2756
|
*```
|
|
2757
|
+
*```js
|
|
2758
|
+
* spotterEmbed.trigger(HostEvent.GetParameters, {
|
|
2759
|
+
* vizId: '730496d6-6903-4601-937e-2c691821af3c'
|
|
2760
|
+
* }).then((parameter) => {
|
|
2761
|
+
* console.log('parameters', parameter);
|
|
2762
|
+
* });
|
|
2763
|
+
*```
|
|
2629
2764
|
* @version SDK: 1.29.0 | ThoughtSpot: 10.1.0.cl, 10.1.0.sw
|
|
2630
2765
|
*/
|
|
2631
2766
|
HostEvent["GetParameters"] = "GetParameters";
|
|
@@ -2693,6 +2828,64 @@
|
|
|
2693
2828
|
* @version SDK: 1.37.0 | ThoughtSpot: 10.8.0.cl
|
|
2694
2829
|
*/
|
|
2695
2830
|
HostEvent["TransformTableVizData"] = "TransformTableVizData";
|
|
2831
|
+
/**
|
|
2832
|
+
* Triggers a search operation with the search tokens specified in
|
|
2833
|
+
* the search query string in spotter embed.
|
|
2834
|
+
* @param - `queryString`: Text string in Natural Language format
|
|
2835
|
+
* @param - `executeSearch`: Boolean to execute search and update search query
|
|
2836
|
+
* @example
|
|
2837
|
+
* ```js
|
|
2838
|
+
* spotterEmbed.trigger(HostEvent.SpotterSearch, {
|
|
2839
|
+
* query: 'revenue per year',
|
|
2840
|
+
* executeSearch: true,
|
|
2841
|
+
* })
|
|
2842
|
+
* ```
|
|
2843
|
+
*/
|
|
2844
|
+
HostEvent["SpotterSearch"] = "SpotterSearch";
|
|
2845
|
+
/**
|
|
2846
|
+
* Edits the last prompt in spotter embed.
|
|
2847
|
+
* @param - `query`: Text string
|
|
2848
|
+
* @example
|
|
2849
|
+
* ```js
|
|
2850
|
+
* spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year");
|
|
2851
|
+
* ```
|
|
2852
|
+
*/
|
|
2853
|
+
HostEvent["EditLastPrompt"] = "EditLastPrompt";
|
|
2854
|
+
/**
|
|
2855
|
+
* Opens the Worksheet preview modal in Spotter Embed.
|
|
2856
|
+
* @example
|
|
2857
|
+
* ```js
|
|
2858
|
+
* spotterEmbed.trigger(HostEvent.PreviewSpotterData);
|
|
2859
|
+
* ```
|
|
2860
|
+
*/
|
|
2861
|
+
HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
2862
|
+
/**
|
|
2863
|
+
* Resets the Spotter Embed Conversation.
|
|
2864
|
+
* @example
|
|
2865
|
+
* ```js
|
|
2866
|
+
* spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
|
|
2867
|
+
* ```
|
|
2868
|
+
*/
|
|
2869
|
+
HostEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
2870
|
+
/**
|
|
2871
|
+
* Deletes the last prompt in spotter embed.
|
|
2872
|
+
* @example
|
|
2873
|
+
* ```js
|
|
2874
|
+
* spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
|
|
2875
|
+
* ```
|
|
2876
|
+
*/
|
|
2877
|
+
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
2878
|
+
/**
|
|
2879
|
+
* Toggle the visualization to chart or table view.
|
|
2880
|
+
* @param - `vizId ` In Spotter Embed, vizId is required.
|
|
2881
|
+
* @example
|
|
2882
|
+
* ```js
|
|
2883
|
+
* spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {
|
|
2884
|
+
* vizId:"'b535c760-8bbe-4e6f-bb26-af56b4129a1e'"
|
|
2885
|
+
* });
|
|
2886
|
+
*```
|
|
2887
|
+
*/
|
|
2888
|
+
HostEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
|
|
2696
2889
|
/**
|
|
2697
2890
|
* @hidden
|
|
2698
2891
|
* Trigger exit from presentation mode when user exits fullscreen.
|
|
@@ -2716,6 +2909,26 @@
|
|
|
2716
2909
|
* @hidden
|
|
2717
2910
|
*/
|
|
2718
2911
|
HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
|
|
2912
|
+
/**
|
|
2913
|
+
* Trigger the *Ask Sage* action for visualizations
|
|
2914
|
+
* @example
|
|
2915
|
+
* ```js
|
|
2916
|
+
* liveboardEmbed.trigger(HostEvent.AskSpotter,
|
|
2917
|
+
* {containerId:'730496d6-6903-4601-937e-2c691821af3c'})
|
|
2918
|
+
* ```
|
|
2919
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
2920
|
+
*/
|
|
2921
|
+
HostEvent["AskSpotter"] = "askSpotter";
|
|
2922
|
+
/**
|
|
2923
|
+
* @hidden
|
|
2924
|
+
* Triggers the update of the embed params.
|
|
2925
|
+
*
|
|
2926
|
+
* @example
|
|
2927
|
+
* ```js
|
|
2928
|
+
* liveboardEmbed.trigger(HostEvent.UpdateEmbedParams, viewConfig);
|
|
2929
|
+
* ```
|
|
2930
|
+
*/
|
|
2931
|
+
HostEvent["UpdateEmbedParams"] = "updateEmbedParams";
|
|
2719
2932
|
})(exports.HostEvent || (exports.HostEvent = {}));
|
|
2720
2933
|
/**
|
|
2721
2934
|
* The different visual modes that the data sources panel within
|
|
@@ -15579,7 +15792,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15579
15792
|
return e;
|
|
15580
15793
|
}
|
|
15581
15794
|
|
|
15582
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.
|
|
15795
|
+
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$1={".":{"import":"./lib/src/index.js",require:"./cjs/src/index.js",types:"./lib/src/index.d.ts"},"./react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"},"./lib/src/react":{"import":"./lib/src/react/all-types-export.js",require:"./cjs/src/react/all-types-export.js",types:"./lib/src/react/all-types-export.d.ts"}};var typesVersions={"*":{react:["./lib/src/react/all-types-export.d.ts"]}};var scripts={lint:"eslint 'src/**'","lint:fix":"eslint 'src/**/*.*' --fix",tsc:"tsc -p . --incremental false; tsc -p . --incremental false --module commonjs --outDir cjs","build-and-publish":"npm run build:gatsby && npm run publish","bundle-dts-file":"dts-bundle --name @thoughtspot/visual-embed-sdk --out visual-embed-sdk.d.ts --main lib/src/index.d.ts","bundle-dts":"dts-bundle --name ../../dist/visual-embed-sdk --main lib/src/index.d.ts --outputAsModuleFolder=true","bundle-dts-react":"dts-bundle --name ../../../dist/visual-embed-sdk-react --main lib/src/react/index.d.ts --outputAsModuleFolder=true","bundle-dts-react-full":"dts-bundle --name ../../../dist/visual-embed-sdk-react-full --main lib/src/react/all-types-export.d.ts --outputAsModuleFolder=true",build:"rollup -c",watch:"rollup -cw",docgen:"typedoc --tsconfig tsconfig.json --theme typedoc-theme --json static/typedoc/typedoc.json --disableOutputCheck","test-sdk":"jest -c jest.config.sdk.js --runInBand",test:"npm run test-sdk",posttest:"cat ./coverage/sdk/lcov.info | coveralls","is-publish-allowed":"node scripts/is-publish-allowed.js",prepublishOnly:"npm run is-publish-allowed && npm run test && npm run tsc && npm run bundle-dts-file && npm run bundle-dts && npm run bundle-dts-react && npm run bundle-dts-react-full && npm run build","check-size":"npm run build && size-limit","publish-dev":"npm publish --tag dev","publish-prod":"npm publish --tag latest",dev:"vite -c vite.local.config.ts"};var peerDependencies={react:"> 16.8.0","react-dom":"> 16.8.0"};var dependencies={classnames:"^2.3.1",eventemitter3:"^4.0.7",lodash:"^4.17.21","mixpanel-browser":"2.47.0","ts-deepmerge":"^6.0.2",tslib:"^2.5.3","use-deep-compare-effect":"^1.8.1",yaml:"^2.5.1"};var devDependencies={"@mdx-js/mdx":"^1.6.22","@mdx-js/react":"^1.6.22","@react-icons/all-files":"^4.1.0","@rollup/plugin-commonjs":"^18.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^11.2.1","@rollup/plugin-replace":"^5.0.2","@size-limit/preset-big-lib":"^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$1,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};
|
|
15583
15796
|
|
|
15584
15797
|
/**
|
|
15585
15798
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -15805,6 +16018,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15805
16018
|
*/
|
|
15806
16019
|
this.fullscreenChangeHandler = null;
|
|
15807
16020
|
this.subscribedListeners = {};
|
|
16021
|
+
this.isEmbedContainerLoaded = false;
|
|
15808
16022
|
/**
|
|
15809
16023
|
* Send Custom style as part of payload of APP_INIT
|
|
15810
16024
|
* @param _
|
|
@@ -15831,7 +16045,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15831
16045
|
this.updateAuthToken = async (_, responder) => {
|
|
15832
16046
|
const { authType } = this.embedConfig;
|
|
15833
16047
|
let { autoLogin } = this.embedConfig;
|
|
15834
|
-
// Default autoLogin: true for cookieless if undefined/null, otherwise
|
|
16048
|
+
// Default autoLogin: true for cookieless if undefined/null, otherwise
|
|
16049
|
+
// false
|
|
15835
16050
|
autoLogin = autoLogin !== null && autoLogin !== void 0 ? autoLogin : (authType === AuthType.TrustedAuthTokenCookieless);
|
|
15836
16051
|
if (autoLogin && authType === AuthType.TrustedAuthTokenCookieless) {
|
|
15837
16052
|
try {
|
|
@@ -15875,11 +16090,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15875
16090
|
});
|
|
15876
16091
|
notifyAuthFailure(AuthFailureType.IDLE_SESSION_TIMEOUT);
|
|
15877
16092
|
};
|
|
16093
|
+
this.pendingEvents = [];
|
|
15878
16094
|
/**
|
|
15879
16095
|
* Register APP_INIT event and sendback init payload
|
|
15880
16096
|
*/
|
|
15881
16097
|
this.registerAppInit = () => {
|
|
15882
16098
|
this.on(exports.EmbedEvent.APP_INIT, this.appInitCb, { start: false }, true);
|
|
16099
|
+
this.on(exports.EmbedEvent.AuthInit, () => {
|
|
16100
|
+
this.isEmbedContainerLoaded = true;
|
|
16101
|
+
this.executePendingEvents();
|
|
16102
|
+
}, { start: false }, true);
|
|
15883
16103
|
this.on(exports.EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
|
|
15884
16104
|
this.on(exports.EmbedEvent.IdleSessionTimeout, this.idleSessionTimeout, { start: false }, true);
|
|
15885
16105
|
};
|
|
@@ -15905,6 +16125,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15905
16125
|
});
|
|
15906
16126
|
}
|
|
15907
16127
|
};
|
|
16128
|
+
this.id = Date.now().toString();
|
|
15908
16129
|
this.el = getDOMNode(domSelector);
|
|
15909
16130
|
this.eventHandlerMap = new Map();
|
|
15910
16131
|
this.isError = false;
|
|
@@ -15918,9 +16139,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15918
16139
|
...viewConfig,
|
|
15919
16140
|
});
|
|
15920
16141
|
this.hostEventClient = new HostEventClient(this.iFrame);
|
|
16142
|
+
const embedConfig = getEmbedConfig();
|
|
16143
|
+
this.embedConfig = embedConfig;
|
|
15921
16144
|
this.isReadyForRenderPromise = getInitPromise().then(async () => {
|
|
15922
|
-
const embedConfig = getEmbedConfig();
|
|
15923
|
-
this.embedConfig = embedConfig;
|
|
15924
16145
|
if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
|
|
15925
16146
|
this.embedConfig.authTriggerContainer = domSelector;
|
|
15926
16147
|
}
|
|
@@ -15953,7 +16174,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15953
16174
|
*/
|
|
15954
16175
|
getEventType(event) {
|
|
15955
16176
|
var _a, _b;
|
|
15956
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
15957
16177
|
return ((_a = event.data) === null || _a === void 0 ? void 0 : _a.type) || ((_b = event.data) === null || _b === void 0 ? void 0 : _b.__type);
|
|
15958
16178
|
}
|
|
15959
16179
|
/**
|
|
@@ -16092,6 +16312,43 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16092
16312
|
async getAppInitData() {
|
|
16093
16313
|
return this.getDefaultAppInitData();
|
|
16094
16314
|
}
|
|
16315
|
+
getPreRenderObj() {
|
|
16316
|
+
var _a;
|
|
16317
|
+
const embedObj = (_a = this.insertedDomEl) === null || _a === void 0 ? void 0 : _a[this.embedNodeKey];
|
|
16318
|
+
if (embedObj === this) {
|
|
16319
|
+
logger$3.info('embedObj is same as this');
|
|
16320
|
+
}
|
|
16321
|
+
return embedObj;
|
|
16322
|
+
}
|
|
16323
|
+
checkEmbedContainerLoaded() {
|
|
16324
|
+
if (this.isEmbedContainerLoaded)
|
|
16325
|
+
return true;
|
|
16326
|
+
const preRenderObj = this.getPreRenderObj();
|
|
16327
|
+
if (preRenderObj && preRenderObj.isEmbedContainerLoaded) {
|
|
16328
|
+
this.isEmbedContainerLoaded = true;
|
|
16329
|
+
}
|
|
16330
|
+
return this.isEmbedContainerLoaded;
|
|
16331
|
+
}
|
|
16332
|
+
executePendingEvents() {
|
|
16333
|
+
logger$3.debug('executePendingEvents', this.pendingEvents);
|
|
16334
|
+
setTimeout(() => {
|
|
16335
|
+
this.pendingEvents.forEach((event) => {
|
|
16336
|
+
var _a;
|
|
16337
|
+
this.trigger(event.eventType, event.data);
|
|
16338
|
+
(_a = event.onEventTriggered) === null || _a === void 0 ? void 0 : _a.call(event);
|
|
16339
|
+
});
|
|
16340
|
+
this.pendingEvents = [];
|
|
16341
|
+
}, 1000);
|
|
16342
|
+
}
|
|
16343
|
+
triggerAfterLoad(eventType, data, onEventTriggered) {
|
|
16344
|
+
if (this.checkEmbedContainerLoaded()) {
|
|
16345
|
+
this.trigger(eventType, data);
|
|
16346
|
+
onEventTriggered === null || onEventTriggered === void 0 ? void 0 : onEventTriggered();
|
|
16347
|
+
}
|
|
16348
|
+
else {
|
|
16349
|
+
this.pendingEvents.push({ eventType, data, onEventTriggered });
|
|
16350
|
+
}
|
|
16351
|
+
}
|
|
16095
16352
|
/**
|
|
16096
16353
|
* Constructs the base URL string to load the ThoughtSpot app.
|
|
16097
16354
|
* @param query
|
|
@@ -16106,6 +16363,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16106
16363
|
.join('/');
|
|
16107
16364
|
return `${basePath}#`;
|
|
16108
16365
|
}
|
|
16366
|
+
getUpdateEmbedParamsObject() {
|
|
16367
|
+
let queryParams = this.getEmbedParamsObject();
|
|
16368
|
+
queryParams = { ...this.viewConfig, ...queryParams };
|
|
16369
|
+
return queryParams;
|
|
16370
|
+
}
|
|
16109
16371
|
/**
|
|
16110
16372
|
* Common query params set for all the embed modes.
|
|
16111
16373
|
* @param queryParams
|
|
@@ -16255,9 +16517,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16255
16517
|
return path;
|
|
16256
16518
|
}
|
|
16257
16519
|
getEmbedParams() {
|
|
16258
|
-
const queryParams = this.
|
|
16520
|
+
const queryParams = this.getEmbedParamsObject();
|
|
16259
16521
|
return getQueryParamString(queryParams);
|
|
16260
16522
|
}
|
|
16523
|
+
getEmbedParamsObject() {
|
|
16524
|
+
const params = this.getBaseQueryParams();
|
|
16525
|
+
return params;
|
|
16526
|
+
}
|
|
16261
16527
|
getRootIframeSrc() {
|
|
16262
16528
|
const query = this.getEmbedParams();
|
|
16263
16529
|
return this.getEmbedBasePath(query);
|
|
@@ -16356,7 +16622,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16356
16622
|
}
|
|
16357
16623
|
});
|
|
16358
16624
|
}
|
|
16359
|
-
// Setup fullscreen change handler after iframe is
|
|
16625
|
+
// Setup fullscreen change handler after iframe is
|
|
16626
|
+
// loaded and ready
|
|
16360
16627
|
this.setupFullscreenChangeHandler();
|
|
16361
16628
|
});
|
|
16362
16629
|
this.iFrame.addEventListener('error', () => {
|
|
@@ -16458,7 +16725,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16458
16725
|
const div = document.createElement('div');
|
|
16459
16726
|
div.innerHTML = child;
|
|
16460
16727
|
div.id = TS_EMBED_ID;
|
|
16461
|
-
// eslint-disable-next-line no-param-reassign
|
|
16462
16728
|
child = div;
|
|
16463
16729
|
}
|
|
16464
16730
|
if (((_a = this.el.nextElementSibling) === null || _a === void 0 ? void 0 : _a.id) === TS_EMBED_ID) {
|
|
@@ -16781,7 +17047,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16781
17047
|
return this.preRender(true);
|
|
16782
17048
|
}
|
|
16783
17049
|
this.validatePreRenderViewConfig(this.viewConfig);
|
|
17050
|
+
logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
|
|
17051
|
+
this.triggerAfterLoad(exports.HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
|
|
16784
17052
|
}
|
|
17053
|
+
this.beforePrerenderVisible();
|
|
16785
17054
|
if (this.el) {
|
|
16786
17055
|
this.syncPreRenderStyle();
|
|
16787
17056
|
if (!this.viewConfig.doNotTrackPreRenderSize) {
|
|
@@ -16798,7 +17067,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16798
17067
|
this.resizeObserver.observe(this.el);
|
|
16799
17068
|
}
|
|
16800
17069
|
}
|
|
16801
|
-
this.beforePrerenderVisible();
|
|
16802
17070
|
removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
|
|
16803
17071
|
this.subscribeToEvents();
|
|
16804
17072
|
// Setup fullscreen change handler for prerendered components
|
|
@@ -16891,7 +17159,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16891
17159
|
const isFullscreen = !!document.fullscreenElement;
|
|
16892
17160
|
if (!isFullscreen) {
|
|
16893
17161
|
logger$3.info('Exited fullscreen mode - triggering ExitPresentMode');
|
|
16894
|
-
// Only trigger if iframe is available and contentWindow is
|
|
17162
|
+
// Only trigger if iframe is available and contentWindow is
|
|
17163
|
+
// accessible
|
|
16895
17164
|
if (this.iFrame && this.iFrame.contentWindow) {
|
|
16896
17165
|
this.trigger(exports.HostEvent.ExitPresentMode);
|
|
16897
17166
|
}
|
|
@@ -16925,7 +17194,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16925
17194
|
* Only for testing purposes.
|
|
16926
17195
|
* @hidden
|
|
16927
17196
|
*/
|
|
16928
|
-
// eslint-disable-next-line camelcase
|
|
16929
17197
|
this.test__executeCallbacks = this.executeCallbacks;
|
|
16930
17198
|
this.viewConfig = { excludeRuntimeFiltersfromURL: false, ...viewConfig };
|
|
16931
17199
|
}
|
|
@@ -16987,15 +17255,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16987
17255
|
this.embedComponentType = 'SearchBarEmbed';
|
|
16988
17256
|
this.viewConfig = viewConfig;
|
|
16989
17257
|
}
|
|
16990
|
-
|
|
16991
|
-
* Construct the URL of the embedded ThoughtSpot search to be
|
|
16992
|
-
* loaded in the iframe
|
|
16993
|
-
* @param dataSources A list of data source GUIDs
|
|
16994
|
-
*/
|
|
16995
|
-
getIFrameSrc() {
|
|
17258
|
+
getEmbedParamsObject() {
|
|
16996
17259
|
var _a;
|
|
16997
17260
|
const { searchOptions, dataSource, dataSources, useLastSelectedSources = false, excludeSearchTokenStringFromURL, } = this.viewConfig;
|
|
16998
|
-
const path = 'search-bar-embed';
|
|
16999
17261
|
const queryParams = this.getBaseQueryParams();
|
|
17000
17262
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
17001
17263
|
if (dataSources && dataSources.length) {
|
|
@@ -17017,6 +17279,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17017
17279
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
17018
17280
|
}
|
|
17019
17281
|
queryParams[Param.searchEmbed] = true;
|
|
17282
|
+
return queryParams;
|
|
17283
|
+
}
|
|
17284
|
+
/**
|
|
17285
|
+
* Construct the URL of the embedded ThoughtSpot search to be
|
|
17286
|
+
* loaded in the iframe
|
|
17287
|
+
* @param dataSources A list of data source GUIDs
|
|
17288
|
+
*/
|
|
17289
|
+
getIFrameSrc() {
|
|
17290
|
+
const queryParams = this.getEmbedParamsObject();
|
|
17291
|
+
const path = 'search-bar-embed';
|
|
17020
17292
|
let query = '';
|
|
17021
17293
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
17022
17294
|
if (queryParamsString) {
|
|
@@ -17067,12 +17339,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17067
17339
|
viewConfig.embedComponentType = 'SageEmbed';
|
|
17068
17340
|
super(domSelector, viewConfig);
|
|
17069
17341
|
}
|
|
17070
|
-
|
|
17071
|
-
* Constructs a map of parameters to be passed on to the
|
|
17072
|
-
* embedded Eureka or Sage search page.
|
|
17073
|
-
* @returns {string} query string
|
|
17074
|
-
*/
|
|
17075
|
-
getEmbedParams() {
|
|
17342
|
+
getEmbedParamsObject() {
|
|
17076
17343
|
const { disableWorksheetChange, hideWorksheetSelector, showObjectSuggestions, dataPanelV2, hideSampleQuestions, isProductTour, hideSageAnswerHeader, hideAutocompleteSuggestions, } = this.viewConfig;
|
|
17077
17344
|
const params = this.getBaseQueryParams();
|
|
17078
17345
|
params[Param.DataPanelV2Enabled] = !!dataPanelV2;
|
|
@@ -17087,6 +17354,15 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17087
17354
|
params[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
17088
17355
|
params[Param.IsProductTour] = !!isProductTour;
|
|
17089
17356
|
params[Param.HideSageAnswerHeader] = !!hideSageAnswerHeader;
|
|
17357
|
+
return params;
|
|
17358
|
+
}
|
|
17359
|
+
/**
|
|
17360
|
+
* Constructs a map of parameters to be passed on to the
|
|
17361
|
+
* embedded Eureka or Sage search page.
|
|
17362
|
+
* @returns {string} query string
|
|
17363
|
+
*/
|
|
17364
|
+
getEmbedParams() {
|
|
17365
|
+
const params = this.getEmbedParamsObject();
|
|
17090
17366
|
return getQueryParamString(params, true);
|
|
17091
17367
|
}
|
|
17092
17368
|
/**
|
|
@@ -17196,11 +17472,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17196
17472
|
const defaultAppInitData = await super.getAppInitData();
|
|
17197
17473
|
return { ...defaultAppInitData, ...this.getSearchInitData() };
|
|
17198
17474
|
}
|
|
17199
|
-
|
|
17475
|
+
getEmbedParamsObject() {
|
|
17200
17476
|
var _a;
|
|
17201
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
|
|
17202
|
-
/* eslint-disable-next-line max-len */
|
|
17203
|
-
dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
|
|
17477
|
+
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false, dataPanelCustomGroupsAccordionInitialState = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL, focusSearchBarOnRender = true, excludeRuntimeParametersfromURL, excludeSearchTokenStringFromURL, collapseSearchBar = true, } = this.viewConfig;
|
|
17204
17478
|
const queryParams = this.getBaseQueryParams();
|
|
17205
17479
|
queryParams[Param.HideActions] = [
|
|
17206
17480
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -17233,7 +17507,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17233
17507
|
queryParams[Param.HideSearchBar] = true;
|
|
17234
17508
|
}
|
|
17235
17509
|
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
17236
|
-
/* eslint-disable-next-line max-len */
|
|
17237
17510
|
queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
17238
17511
|
}
|
|
17239
17512
|
if (!focusSearchBarOnRender) {
|
|
@@ -17246,20 +17519,22 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17246
17519
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
17247
17520
|
}
|
|
17248
17521
|
queryParams[Param.searchEmbed] = true;
|
|
17249
|
-
/* eslint-disable-next-line max-len */
|
|
17250
17522
|
queryParams[Param.CollapseSearchBarInitially] = collapseSearchBarInitially || collapseSearchBar;
|
|
17251
17523
|
queryParams[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
17252
17524
|
if (dataPanelCustomGroupsAccordionInitialState
|
|
17253
17525
|
=== DataPanelCustomColumnGroupsAccordionState$1.COLLAPSE_ALL
|
|
17254
17526
|
|| dataPanelCustomGroupsAccordionInitialState
|
|
17255
17527
|
=== DataPanelCustomColumnGroupsAccordionState$1.EXPAND_FIRST) {
|
|
17256
|
-
/* eslint-disable-next-line max-len */
|
|
17257
17528
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
|
|
17258
17529
|
}
|
|
17259
17530
|
else {
|
|
17260
|
-
/* eslint-disable-next-line max-len */
|
|
17261
17531
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL;
|
|
17262
17532
|
}
|
|
17533
|
+
return queryParams;
|
|
17534
|
+
}
|
|
17535
|
+
getEmbedParams() {
|
|
17536
|
+
const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
|
|
17537
|
+
const queryParams = this.getEmbedParamsObject();
|
|
17263
17538
|
let query = '';
|
|
17264
17539
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
17265
17540
|
if (queryParamsString) {
|
|
@@ -17741,7 +18016,7 @@ query GetEurekaVizSnapshots(
|
|
|
17741
18016
|
return;
|
|
17742
18017
|
}
|
|
17743
18018
|
const previewStyles = `
|
|
17744
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community@32.0.2/styles/ag-grid.min.css">
|
|
18019
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ag-grid-community@32.0.2/styles/ag-grid.min.css" integrity="sha384-PvEsKa6emq5KYa9mf+Q7eYF5C2OCacYzZ+hBngp21NA4o1A9iU9smnytEmqUFbEZ" crossorigin="anonymous">
|
|
17745
18020
|
<style id="ts-preview-style">
|
|
17746
18021
|
.ts-viz-preview-loader {
|
|
17747
18022
|
position: absolute;
|
|
@@ -17852,6 +18127,7 @@ query GetEurekaVizSnapshots(
|
|
|
17852
18127
|
}
|
|
17853
18128
|
this.setIFrameHeight(frameHeight || this.defaultHeight);
|
|
17854
18129
|
};
|
|
18130
|
+
this.currentLiveboardId = this.viewConfig.liveboardId;
|
|
17855
18131
|
if (this.viewConfig.fullHeight === true) {
|
|
17856
18132
|
if (this.viewConfig.vizId) {
|
|
17857
18133
|
logger$3.warn('Full height is currently only supported for Liveboard embeds.' +
|
|
@@ -17868,6 +18144,11 @@ query GetEurekaVizSnapshots(
|
|
|
17868
18144
|
* embedded Liveboard or visualization.
|
|
17869
18145
|
*/
|
|
17870
18146
|
getEmbedParams() {
|
|
18147
|
+
const params = this.getEmbedParamsObject();
|
|
18148
|
+
const queryParams = getQueryParamString(params, true);
|
|
18149
|
+
return queryParams;
|
|
18150
|
+
}
|
|
18151
|
+
getEmbedParamsObject() {
|
|
17871
18152
|
let params = {};
|
|
17872
18153
|
params = this.getBaseQueryParams(params);
|
|
17873
18154
|
const { enableVizTransformations, fullHeight, defaultHeight, visibleVizs, liveboardV2, vizId, hideTabPanel, activeTabId, hideLiveboardHeader, showLiveboardDescription, showLiveboardTitle, isLiveboardHeaderSticky = true, isLiveboardCompactHeaderEnabled = false, showLiveboardVerifiedBadge = true, showLiveboardReverifyBanner = true, hideIrrelevantChipsInLiveboardTabs = false, enableAskSage, enable2ColumnLayout, dataPanelV2 = false, enableCustomColumnGroups = false, oAuthPollingInterval, isForceRedirect, dataSourceId, coverAndFilterOptionInPDF = false, isLiveboardStylingAndGroupingEnabled, } = this.viewConfig;
|
|
@@ -17937,8 +18218,27 @@ query GetEurekaVizSnapshots(
|
|
|
17937
18218
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
17938
18219
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
17939
18220
|
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
17940
|
-
|
|
17941
|
-
|
|
18221
|
+
if (oAuthPollingInterval !== undefined) {
|
|
18222
|
+
params[Param.OauthPollingInterval] = oAuthPollingInterval;
|
|
18223
|
+
}
|
|
18224
|
+
if (isForceRedirect) {
|
|
18225
|
+
params[Param.IsForceRedirect] = isForceRedirect;
|
|
18226
|
+
}
|
|
18227
|
+
if (dataSourceId !== undefined) {
|
|
18228
|
+
params[Param.DataSourceId] = dataSourceId;
|
|
18229
|
+
}
|
|
18230
|
+
if (isLiveboardStylingAndGroupingEnabled !== undefined) {
|
|
18231
|
+
params[Param.IsLiveboardStylingAndGroupingEnabled] = isLiveboardStylingAndGroupingEnabled;
|
|
18232
|
+
}
|
|
18233
|
+
params[Param.LiveboardHeaderSticky] = isLiveboardHeaderSticky;
|
|
18234
|
+
params[Param.LiveboardHeaderV2] = isLiveboardCompactHeaderEnabled;
|
|
18235
|
+
params[Param.ShowLiveboardVerifiedBadge] = showLiveboardVerifiedBadge;
|
|
18236
|
+
params[Param.ShowLiveboardReverifyBanner] = showLiveboardReverifyBanner;
|
|
18237
|
+
params[Param.HideIrrelevantFiltersInTab] = hideIrrelevantChipsInLiveboardTabs;
|
|
18238
|
+
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
18239
|
+
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
18240
|
+
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
18241
|
+
return params;
|
|
17942
18242
|
}
|
|
17943
18243
|
getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
|
|
17944
18244
|
let suffix = `/embed/viz/${liveboardId}`;
|
|
@@ -18000,16 +18300,12 @@ query GetEurekaVizSnapshots(
|
|
|
18000
18300
|
}
|
|
18001
18301
|
}
|
|
18002
18302
|
beforePrerenderVisible() {
|
|
18003
|
-
|
|
18004
|
-
const
|
|
18005
|
-
|
|
18006
|
-
|
|
18007
|
-
|
|
18008
|
-
|
|
18009
|
-
if (showDifferentLib) {
|
|
18010
|
-
const libId = this.viewConfig.liveboardId;
|
|
18011
|
-
this.navigateToLiveboard(libId);
|
|
18012
|
-
}
|
|
18303
|
+
const embedObj = this.getPreRenderObj();
|
|
18304
|
+
const libId = this.currentLiveboardId;
|
|
18305
|
+
this.navigateToLiveboard(libId, this.viewConfig.vizId, this.viewConfig.activeTabId, () => {
|
|
18306
|
+
if (embedObj)
|
|
18307
|
+
embedObj.currentLiveboardId = libId;
|
|
18308
|
+
});
|
|
18013
18309
|
}
|
|
18014
18310
|
async handleRenderForPrerender() {
|
|
18015
18311
|
if (isUndefined$1(this.viewConfig.liveboardId)) {
|
|
@@ -18071,13 +18367,13 @@ query GetEurekaVizSnapshots(
|
|
|
18071
18367
|
this.postRender();
|
|
18072
18368
|
return this;
|
|
18073
18369
|
}
|
|
18074
|
-
navigateToLiveboard(liveboardId, vizId, activeTabId) {
|
|
18370
|
+
navigateToLiveboard(liveboardId, vizId, activeTabId, onNavigateCalled) {
|
|
18075
18371
|
const path = this.getIframeSuffixSrc(liveboardId, vizId, activeTabId);
|
|
18076
18372
|
this.viewConfig.liveboardId = liveboardId;
|
|
18077
18373
|
this.viewConfig.activeTabId = activeTabId;
|
|
18078
18374
|
this.viewConfig.vizId = vizId;
|
|
18079
18375
|
if (this.isRendered) {
|
|
18080
|
-
this.
|
|
18376
|
+
this.triggerAfterLoad(exports.HostEvent.Navigate, path.substring(1), onNavigateCalled);
|
|
18081
18377
|
}
|
|
18082
18378
|
else if (this.viewConfig.preRenderId) {
|
|
18083
18379
|
this.preRender(true);
|
|
@@ -18467,7 +18763,11 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18467
18763
|
return {
|
|
18468
18764
|
convId: this.conversationId,
|
|
18469
18765
|
messageId: responses[0].msgId,
|
|
18470
|
-
data:
|
|
18766
|
+
data: {
|
|
18767
|
+
...data.asstRespData.nlsAnsData.sageQuerySuggestions[0],
|
|
18768
|
+
convId: this.conversationId,
|
|
18769
|
+
messageId: responses[0].msgId,
|
|
18770
|
+
},
|
|
18471
18771
|
error: null,
|
|
18472
18772
|
};
|
|
18473
18773
|
}
|
|
@@ -18491,13 +18791,17 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18491
18791
|
super(container, viewConfig);
|
|
18492
18792
|
this.viewConfig = viewConfig;
|
|
18493
18793
|
}
|
|
18494
|
-
|
|
18794
|
+
getEmbedParamsObject() {
|
|
18495
18795
|
var _a;
|
|
18496
|
-
const { sessionId, genNo, acSessionId, acGenNo, } = this.viewConfig;
|
|
18497
|
-
const path = 'conv-assist-answer';
|
|
18498
18796
|
const queryParams = this.getBaseQueryParams();
|
|
18499
18797
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
18500
18798
|
queryParams[Param.isSpotterAgentEmbed] = true;
|
|
18799
|
+
return queryParams;
|
|
18800
|
+
}
|
|
18801
|
+
getIframeSrc() {
|
|
18802
|
+
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
18803
|
+
const path = 'conv-assist-answer';
|
|
18804
|
+
const queryParams = this.getEmbedParamsObject();
|
|
18501
18805
|
let query = '';
|
|
18502
18806
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
18503
18807
|
if (queryParamsString) {
|
|
@@ -18508,6 +18812,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18508
18812
|
genNo,
|
|
18509
18813
|
acSessionId,
|
|
18510
18814
|
acGenNo,
|
|
18815
|
+
convId,
|
|
18816
|
+
messageId,
|
|
18511
18817
|
});
|
|
18512
18818
|
return `${this.getEmbedBasePath(query)}/embed/${path}${tsPostHashParams}`;
|
|
18513
18819
|
}
|
|
@@ -18551,6 +18857,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18551
18857
|
const container = document.createElement('div');
|
|
18552
18858
|
const embed = new ConversationMessage$1(container, {
|
|
18553
18859
|
...this.viewConfig,
|
|
18860
|
+
convId: data.convId,
|
|
18861
|
+
messageId: data.messageId,
|
|
18554
18862
|
sessionId: data.sessionId,
|
|
18555
18863
|
genNo: data.genNo,
|
|
18556
18864
|
acSessionId: data.stateKey.transactionId,
|
|
@@ -18571,6 +18879,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18571
18879
|
return { error };
|
|
18572
18880
|
}
|
|
18573
18881
|
return { data: {
|
|
18882
|
+
convId: data.convId,
|
|
18883
|
+
messageId: data.messageId,
|
|
18574
18884
|
sessionId: data.sessionId,
|
|
18575
18885
|
genNo: data.genNo,
|
|
18576
18886
|
acSessionId: data.stateKey.transactionId,
|
|
@@ -18647,9 +18957,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18647
18957
|
super(container, viewConfig);
|
|
18648
18958
|
this.viewConfig = viewConfig;
|
|
18649
18959
|
}
|
|
18650
|
-
|
|
18960
|
+
getEmbedParamsObject() {
|
|
18651
18961
|
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, } = this.viewConfig;
|
|
18652
|
-
const path = 'insights/conv-assist';
|
|
18653
18962
|
if (!worksheetId) {
|
|
18654
18963
|
this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
|
|
18655
18964
|
}
|
|
@@ -18670,6 +18979,12 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18670
18979
|
if (!isUndefined_1(hideSampleQuestions)) {
|
|
18671
18980
|
queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
18672
18981
|
}
|
|
18982
|
+
return queryParams;
|
|
18983
|
+
}
|
|
18984
|
+
getIframeSrc() {
|
|
18985
|
+
const { worksheetId, searchOptions, } = this.viewConfig;
|
|
18986
|
+
const path = 'insights/conv-assist';
|
|
18987
|
+
const queryParams = this.getEmbedParamsObject();
|
|
18673
18988
|
let query = '';
|
|
18674
18989
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
18675
18990
|
if (queryParamsString) {
|