@thoughtspot/visual-embed-sdk 1.40.0 → 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 +3 -1
- package/cjs/src/embed/liveboard.d.ts.map +1 -1
- package/cjs/src/embed/liveboard.js +35 -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 +9 -0
- package/cjs/src/embed/ts-embed.d.ts.map +1 -1
- package/cjs/src/embed/ts-embed.js +65 -10
- package/cjs/src/embed/ts-embed.js.map +1 -1
- package/cjs/src/types.d.ts +33 -64
- package/cjs/src/types.d.ts.map +1 -1
- package/cjs/src/types.js +33 -64
- package/cjs/src/types.js.map +1 -1
- package/dist/{index-CAEHQGLc.js → index-CmEQfuE3.js} +1 -1
- package/dist/index-D1pyb7RG.js +7371 -0
- package/dist/index-DeFzsyFF.js +7371 -0
- package/dist/index-Dpf0rd6w.js +7371 -0
- package/dist/index-UuEbsISo.js +7447 -0
- package/dist/index-e3Uw3YFO.js +7371 -0
- package/dist/index-k7pkZMhx.js +7371 -0
- package/dist/src/embed/bodyless-conversation.d.ts +1 -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/types.d.ts +33 -64
- package/dist/src/types.d.ts.map +1 -1
- package/dist/tsembed-react.es.js +178 -117
- package/dist/tsembed-react.js +177 -116
- package/dist/tsembed.es.js +178 -117
- package/dist/tsembed.js +177 -116
- package/dist/visual-embed-sdk-react-full.d.ts +47 -65
- package/dist/visual-embed-sdk-react.d.ts +47 -65
- package/dist/visual-embed-sdk.d.ts +47 -65
- 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 +3 -1
- package/lib/src/embed/liveboard.d.ts.map +1 -1
- package/lib/src/embed/liveboard.js +35 -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 +9 -0
- package/lib/src/embed/ts-embed.d.ts.map +1 -1
- package/lib/src/embed/ts-embed.js +65 -10
- package/lib/src/embed/ts-embed.js.map +1 -1
- package/lib/src/types.d.ts +33 -64
- package/lib/src/types.d.ts.map +1 -1
- package/lib/src/types.js +33 -64
- package/lib/src/types.js.map +1 -1
- package/lib/src/visual-embed-sdk.d.ts +47 -65
- package/package.json +1 -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 +41 -14
- 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 +90 -24
- package/src/types.ts +34 -64
package/dist/tsembed-react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* @thoughtspot/visual-embed-sdk version 1.40.
|
|
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')) :
|
|
@@ -1245,7 +1245,7 @@
|
|
|
1245
1245
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
1246
1246
|
* @example
|
|
1247
1247
|
*```js
|
|
1248
|
-
* liveboardEmbed.on(EmbedEvent.
|
|
1248
|
+
* liveboardEmbed.on(EmbedEvent.AnswerChartSwitcher, payload => {
|
|
1249
1249
|
* console.log('Liveboard details', payload);
|
|
1250
1250
|
* })
|
|
1251
1251
|
*```
|
|
@@ -1620,58 +1620,58 @@
|
|
|
1620
1620
|
*/
|
|
1621
1621
|
EmbedEvent["RequestVisibleEmbedCoordinates"] = "requestVisibleEmbedCoordinates";
|
|
1622
1622
|
/**
|
|
1623
|
-
* Emitted when
|
|
1623
|
+
* Emitted when spotter response is text data
|
|
1624
1624
|
* @example
|
|
1625
1625
|
* ```js
|
|
1626
1626
|
* spotterEmbed.on(EmbedEvent.SpotterData, (payload) => {
|
|
1627
1627
|
* console.log('payload', payload);
|
|
1628
1628
|
* })
|
|
1629
1629
|
*```
|
|
1630
|
-
* @version SDK: 1.
|
|
1630
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1631
1631
|
*/
|
|
1632
1632
|
EmbedEvent["SpotterData"] = "SpotterData";
|
|
1633
1633
|
/**
|
|
1634
|
-
* Emitted when user opens up the worksheet preview modal in
|
|
1634
|
+
* Emitted when user opens up the worksheet preview modal in spotter embed.
|
|
1635
1635
|
* @example
|
|
1636
1636
|
* ```js
|
|
1637
1637
|
* spotterEmbed.on(EmbedEvent.PreviewSpotterData, (payload) => {
|
|
1638
1638
|
* console.log('payload', payload);
|
|
1639
1639
|
* })
|
|
1640
1640
|
*```
|
|
1641
|
-
* @version SDK: 1.
|
|
1641
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1642
1642
|
*/
|
|
1643
1643
|
EmbedEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
1644
1644
|
/**
|
|
1645
|
-
* Emitted when the
|
|
1645
|
+
* Emitted when the spotter query is triggered in spotter embed.
|
|
1646
1646
|
* @example
|
|
1647
1647
|
* ```js
|
|
1648
1648
|
* spotterEmbed.on(EmbedEvent.SpotterQueryTriggered, (payload) => {
|
|
1649
1649
|
* console.log('payload', payload);
|
|
1650
1650
|
* })
|
|
1651
1651
|
*```
|
|
1652
|
-
* @version SDK: 1.
|
|
1652
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1653
1653
|
*/
|
|
1654
1654
|
EmbedEvent["SpotterQueryTriggered"] = "SpotterQueryTriggered";
|
|
1655
1655
|
/**
|
|
1656
|
-
* Emitted when the last
|
|
1656
|
+
* Emitted when the last spotter query is edited in spotter embed.
|
|
1657
1657
|
* @example
|
|
1658
1658
|
* ```js
|
|
1659
1659
|
* spotterEmbed.on(EmbedEvent.LastPromptEdited, (payload) => {
|
|
1660
1660
|
* console.log('payload', payload);
|
|
1661
1661
|
* })
|
|
1662
1662
|
*```
|
|
1663
|
-
* @version SDK: 1.
|
|
1663
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1664
1664
|
*/
|
|
1665
1665
|
EmbedEvent["LastPromptEdited"] = "LastPromptEdited";
|
|
1666
1666
|
/**
|
|
1667
|
-
* Emitted when the last
|
|
1667
|
+
* Emitted when the last spotter query is deleted in spotter embed.
|
|
1668
1668
|
* @example
|
|
1669
1669
|
* ```js
|
|
1670
1670
|
* spotterEmbed.on(EmbedEvent.LastPromptDeleted, (payload) => {
|
|
1671
1671
|
* console.log('payload', payload);
|
|
1672
1672
|
* })
|
|
1673
1673
|
*```
|
|
1674
|
-
* @version SDK: 1.
|
|
1674
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1675
1675
|
*/
|
|
1676
1676
|
EmbedEvent["LastPromptDeleted"] = "LastPromptDeleted";
|
|
1677
1677
|
/**
|
|
@@ -1682,7 +1682,7 @@
|
|
|
1682
1682
|
* console.log('payload', payload);
|
|
1683
1683
|
* })
|
|
1684
1684
|
*```
|
|
1685
|
-
* @version SDK: 1.
|
|
1685
|
+
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1686
1686
|
*/
|
|
1687
1687
|
EmbedEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
1688
1688
|
/**
|
|
@@ -1695,7 +1695,7 @@
|
|
|
1695
1695
|
*```
|
|
1696
1696
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
1697
1697
|
*/
|
|
1698
|
-
EmbedEvent["SpotterInit"] = "
|
|
1698
|
+
EmbedEvent["SpotterInit"] = "SpotterInit";
|
|
1699
1699
|
})(exports.EmbedEvent || (exports.EmbedEvent = {}));
|
|
1700
1700
|
/**
|
|
1701
1701
|
* Event types that can be triggered by the host application
|
|
@@ -1785,7 +1785,6 @@
|
|
|
1785
1785
|
* done automatically on the most popular column.
|
|
1786
1786
|
* @param - vizId [TS >= 9.8.0] - Optional. The GUID of the visualization to drill
|
|
1787
1787
|
* in case of a Liveboard.
|
|
1788
|
-
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
1789
1788
|
* @example
|
|
1790
1789
|
* ```js
|
|
1791
1790
|
* searchEmbed.on(EmbedEvent.VizPointDoubleClick, (payload) => {
|
|
@@ -2105,21 +2104,12 @@
|
|
|
2105
2104
|
* Trigger the **Download PDF** action on an embedded Liveboard,
|
|
2106
2105
|
* visualization or Answer.
|
|
2107
2106
|
*
|
|
2108
|
-
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2109
|
-
*
|
|
2110
2107
|
* **NOTE**: The **Download** > **PDF** action is available on
|
|
2111
2108
|
* visualizations and Answers if the data is in tabular format.
|
|
2112
2109
|
* @example
|
|
2113
2110
|
* ```js
|
|
2114
2111
|
* liveboardEmbed.trigger(HostEvent.DownloadAsPdf)
|
|
2115
2112
|
* ```
|
|
2116
|
-
* @example
|
|
2117
|
-
* ```js
|
|
2118
|
-
* spotterEmbed.trigger(HostEvent.DownloadAsPdf, {
|
|
2119
|
-
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2120
|
-
* });
|
|
2121
|
-
* ```
|
|
2122
|
-
*
|
|
2123
2113
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2124
2114
|
*/
|
|
2125
2115
|
HostEvent["DownloadAsPdf"] = "downloadAsPdf";
|
|
@@ -2221,8 +2211,7 @@
|
|
|
2221
2211
|
* This event is not supported in visualization embed and search embed.
|
|
2222
2212
|
* @param - object - To trigger the action for a specific visualization
|
|
2223
2213
|
* in Liveboard embed, pass in `vizId` as a key.
|
|
2224
|
-
*
|
|
2225
|
-
*
|
|
2214
|
+
* **Required** in Spotter embed.
|
|
2226
2215
|
* @example
|
|
2227
2216
|
* ```js
|
|
2228
2217
|
* liveboardEmbed.trigger(HostEvent.Edit)
|
|
@@ -2237,12 +2226,6 @@
|
|
|
2237
2226
|
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2238
2227
|
* });
|
|
2239
2228
|
* ```
|
|
2240
|
-
* @example
|
|
2241
|
-
* ```js
|
|
2242
|
-
* const editResponse = await spotterEmbed.trigger(HostEvent.Edit, {
|
|
2243
|
-
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2244
|
-
* });
|
|
2245
|
-
* ```
|
|
2246
2229
|
* @version SDK: 1.15.0 | ThoughtSpot: 8.7.0.cl, 8.8.1.sw
|
|
2247
2230
|
*/
|
|
2248
2231
|
HostEvent["Edit"] = "edit";
|
|
@@ -2363,7 +2346,6 @@
|
|
|
2363
2346
|
/**
|
|
2364
2347
|
* Trigger the **Download** action on charts in
|
|
2365
2348
|
* the embedded view.
|
|
2366
|
-
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2367
2349
|
* @example
|
|
2368
2350
|
* ```js
|
|
2369
2351
|
* liveboardEmbed.trigger(HostEvent.Download, {vizId:
|
|
@@ -2372,11 +2354,6 @@
|
|
|
2372
2354
|
* ```js
|
|
2373
2355
|
* embed.trigger(HostEvent.Download)
|
|
2374
2356
|
* ```
|
|
2375
|
-
* ```js
|
|
2376
|
-
* spotterEmbed.trigger(HostEvent.Download, {
|
|
2377
|
-
* vizId:'730496d6-6903-4601-937e-2c691821af3c'
|
|
2378
|
-
* });
|
|
2379
|
-
* ```
|
|
2380
2357
|
* @deprecated from SDK: 1.21.0 | ThoughtSpot: 9.2.0.cl ,9.4.1.sw
|
|
2381
2358
|
* Use {@link DownloadAsPng}
|
|
2382
2359
|
* @version SDK: 1.19.0 | ThoughtSpot: 9.0.0.cl, 9.0.1.sw
|
|
@@ -2405,7 +2382,6 @@
|
|
|
2405
2382
|
/**
|
|
2406
2383
|
* Trigger the **Download** > **CSV** action on tables in
|
|
2407
2384
|
* the embedded view.
|
|
2408
|
-
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2409
2385
|
* @example
|
|
2410
2386
|
* ```js
|
|
2411
2387
|
* liveboardEmbed.trigger(HostEvent.DownloadAsCsv, {vizId:
|
|
@@ -2428,7 +2404,6 @@
|
|
|
2428
2404
|
/**
|
|
2429
2405
|
* Trigger the **Download** > **XLSX** action on tables
|
|
2430
2406
|
* in the embedded view.
|
|
2431
|
-
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2432
2407
|
* @example
|
|
2433
2408
|
* ```js
|
|
2434
2409
|
* liveboardEmbed.trigger(HostEvent.DownloadAsXlsx, {vizId:
|
|
@@ -2464,7 +2439,7 @@
|
|
|
2464
2439
|
/**
|
|
2465
2440
|
* Trigger the **Save** action on a Liveboard or Answer.
|
|
2466
2441
|
* Saves the changes.
|
|
2467
|
-
* @param - `vizId`
|
|
2442
|
+
* @param - `vizId` is required in Spotter Embed.
|
|
2468
2443
|
* @example
|
|
2469
2444
|
* ```js
|
|
2470
2445
|
* liveboardEmbed.trigger(HostEvent.Save)
|
|
@@ -2774,7 +2749,6 @@
|
|
|
2774
2749
|
HostEvent["UpdateParameters"] = "UpdateParameters";
|
|
2775
2750
|
/**
|
|
2776
2751
|
* Triggers GetParameters to fetch the runtime Parameters.
|
|
2777
|
-
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2778
2752
|
* ```js
|
|
2779
2753
|
* liveboardEmbed.trigger(HostEvent.GetParameters).then((parameter) => {
|
|
2780
2754
|
* console.log('parameters', parameter);
|
|
@@ -2818,7 +2792,7 @@
|
|
|
2818
2792
|
* @param - optional attributes to set Answer properties.
|
|
2819
2793
|
* `name` - Name string for the Answer.
|
|
2820
2794
|
* `description` - Description text for the Answer.
|
|
2821
|
-
*
|
|
2795
|
+
*
|
|
2822
2796
|
* @example
|
|
2823
2797
|
* ```js
|
|
2824
2798
|
* const saveAnswerResponse = await searchEmbed.trigger(HostEvent.SaveAnswer, {
|
|
@@ -2826,14 +2800,6 @@
|
|
|
2826
2800
|
* description: "Total sales by states in MidWest"
|
|
2827
2801
|
* });
|
|
2828
2802
|
* ```
|
|
2829
|
-
* @example
|
|
2830
|
-
* ```js
|
|
2831
|
-
* const saveAnswerResponse = await spotterEmbed.trigger(HostEvent.SaveAnswer, {
|
|
2832
|
-
* vizId: '730496d6-6903-4601-937e-2c691821af3c',
|
|
2833
|
-
* name: "Sales by states",
|
|
2834
|
-
* description: "Total sales by states in MidWest"
|
|
2835
|
-
* });
|
|
2836
|
-
* ```
|
|
2837
2803
|
* @version SDK: 1.36.0 | ThoughtSpot: 10.6.0.cl
|
|
2838
2804
|
*/
|
|
2839
2805
|
HostEvent["SaveAnswer"] = "saveAnswer";
|
|
@@ -2865,7 +2831,7 @@
|
|
|
2865
2831
|
/**
|
|
2866
2832
|
* Triggers a search operation with the search tokens specified in
|
|
2867
2833
|
* the search query string in spotter embed.
|
|
2868
|
-
* @param - `
|
|
2834
|
+
* @param - `queryString`: Text string in Natural Language format
|
|
2869
2835
|
* @param - `executeSearch`: Boolean to execute search and update search query
|
|
2870
2836
|
* @example
|
|
2871
2837
|
* ```js
|
|
@@ -2874,7 +2840,6 @@
|
|
|
2874
2840
|
* executeSearch: true,
|
|
2875
2841
|
* })
|
|
2876
2842
|
* ```
|
|
2877
|
-
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
2878
2843
|
*/
|
|
2879
2844
|
HostEvent["SpotterSearch"] = "SpotterSearch";
|
|
2880
2845
|
/**
|
|
@@ -2884,7 +2849,6 @@
|
|
|
2884
2849
|
* ```js
|
|
2885
2850
|
* spotterEmbed.trigger(HostEvent.EditLastPrompt, "revenue per year");
|
|
2886
2851
|
* ```
|
|
2887
|
-
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
2888
2852
|
*/
|
|
2889
2853
|
HostEvent["EditLastPrompt"] = "EditLastPrompt";
|
|
2890
2854
|
/**
|
|
@@ -2893,7 +2857,6 @@
|
|
|
2893
2857
|
* ```js
|
|
2894
2858
|
* spotterEmbed.trigger(HostEvent.PreviewSpotterData);
|
|
2895
2859
|
* ```
|
|
2896
|
-
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
2897
2860
|
*/
|
|
2898
2861
|
HostEvent["PreviewSpotterData"] = "PreviewSpotterData";
|
|
2899
2862
|
/**
|
|
@@ -2902,7 +2865,6 @@
|
|
|
2902
2865
|
* ```js
|
|
2903
2866
|
* spotterEmbed.trigger(HostEvent.ResetSpotterConversation);
|
|
2904
2867
|
* ```
|
|
2905
|
-
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
2906
2868
|
*/
|
|
2907
2869
|
HostEvent["ResetSpotterConversation"] = "ResetSpotterConversation";
|
|
2908
2870
|
/**
|
|
@@ -2911,19 +2873,17 @@
|
|
|
2911
2873
|
* ```js
|
|
2912
2874
|
* spotterEmbed.trigger(HostEvent.DeleteLastPrompt);
|
|
2913
2875
|
* ```
|
|
2914
|
-
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
2915
2876
|
*/
|
|
2916
2877
|
HostEvent["DeleteLastPrompt"] = "DeleteLastPrompt";
|
|
2917
2878
|
/**
|
|
2918
2879
|
* Toggle the visualization to chart or table view.
|
|
2919
|
-
* @param - `vizId `
|
|
2880
|
+
* @param - `vizId ` In Spotter Embed, vizId is required.
|
|
2920
2881
|
* @example
|
|
2921
2882
|
* ```js
|
|
2922
2883
|
* spotterEmbed.trigger(HostEvent.AnswerChartSwitcher, {
|
|
2923
|
-
* vizId:'b535c760-8bbe-4e6f-bb26-af56b4129a1e'
|
|
2884
|
+
* vizId:"'b535c760-8bbe-4e6f-bb26-af56b4129a1e'"
|
|
2924
2885
|
* });
|
|
2925
2886
|
*```
|
|
2926
|
-
* @version SDK: 1.40.0 | ThoughtSpot: 10.11.0.cl
|
|
2927
2887
|
*/
|
|
2928
2888
|
HostEvent["AnswerChartSwitcher"] = "answerChartSwitcher";
|
|
2929
2889
|
/**
|
|
@@ -2950,16 +2910,25 @@
|
|
|
2950
2910
|
*/
|
|
2951
2911
|
HostEvent["VisibleEmbedCoordinates"] = "visibleEmbedCoordinates";
|
|
2952
2912
|
/**
|
|
2953
|
-
* Trigger the *Ask
|
|
2954
|
-
* @param - `vizId` refers to the Answer ID in Spotter embed and is required in Spotter embed.
|
|
2913
|
+
* Trigger the *Ask Sage* action for visualizations
|
|
2955
2914
|
* @example
|
|
2956
2915
|
* ```js
|
|
2957
|
-
*
|
|
2958
|
-
* {
|
|
2916
|
+
* liveboardEmbed.trigger(HostEvent.AskSpotter,
|
|
2917
|
+
* {containerId:'730496d6-6903-4601-937e-2c691821af3c'})
|
|
2959
2918
|
* ```
|
|
2960
2919
|
* @version SDK: 1.41.0 | ThoughtSpot: 10.12.0.cl
|
|
2961
2920
|
*/
|
|
2962
|
-
HostEvent["AskSpotter"] = "
|
|
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";
|
|
2963
2932
|
})(exports.HostEvent || (exports.HostEvent = {}));
|
|
2964
2933
|
/**
|
|
2965
2934
|
* The different visual modes that the data sources panel within
|
|
@@ -15823,7 +15792,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
15823
15792
|
return e;
|
|
15824
15793
|
}
|
|
15825
15794
|
|
|
15826
|
-
var name="@thoughtspot/visual-embed-sdk";var version$1="1.40.
|
|
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};
|
|
15827
15796
|
|
|
15828
15797
|
/**
|
|
15829
15798
|
* Reloads the ThoughtSpot iframe.
|
|
@@ -16049,6 +16018,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16049
16018
|
*/
|
|
16050
16019
|
this.fullscreenChangeHandler = null;
|
|
16051
16020
|
this.subscribedListeners = {};
|
|
16021
|
+
this.isEmbedContainerLoaded = false;
|
|
16052
16022
|
/**
|
|
16053
16023
|
* Send Custom style as part of payload of APP_INIT
|
|
16054
16024
|
* @param _
|
|
@@ -16075,7 +16045,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16075
16045
|
this.updateAuthToken = async (_, responder) => {
|
|
16076
16046
|
const { authType } = this.embedConfig;
|
|
16077
16047
|
let { autoLogin } = this.embedConfig;
|
|
16078
|
-
// Default autoLogin: true for cookieless if undefined/null, otherwise
|
|
16048
|
+
// Default autoLogin: true for cookieless if undefined/null, otherwise
|
|
16049
|
+
// false
|
|
16079
16050
|
autoLogin = autoLogin !== null && autoLogin !== void 0 ? autoLogin : (authType === AuthType.TrustedAuthTokenCookieless);
|
|
16080
16051
|
if (autoLogin && authType === AuthType.TrustedAuthTokenCookieless) {
|
|
16081
16052
|
try {
|
|
@@ -16119,11 +16090,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16119
16090
|
});
|
|
16120
16091
|
notifyAuthFailure(AuthFailureType.IDLE_SESSION_TIMEOUT);
|
|
16121
16092
|
};
|
|
16093
|
+
this.pendingEvents = [];
|
|
16122
16094
|
/**
|
|
16123
16095
|
* Register APP_INIT event and sendback init payload
|
|
16124
16096
|
*/
|
|
16125
16097
|
this.registerAppInit = () => {
|
|
16126
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);
|
|
16127
16103
|
this.on(exports.EmbedEvent.AuthExpire, this.updateAuthToken, { start: false }, true);
|
|
16128
16104
|
this.on(exports.EmbedEvent.IdleSessionTimeout, this.idleSessionTimeout, { start: false }, true);
|
|
16129
16105
|
};
|
|
@@ -16149,6 +16125,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16149
16125
|
});
|
|
16150
16126
|
}
|
|
16151
16127
|
};
|
|
16128
|
+
this.id = Date.now().toString();
|
|
16152
16129
|
this.el = getDOMNode(domSelector);
|
|
16153
16130
|
this.eventHandlerMap = new Map();
|
|
16154
16131
|
this.isError = false;
|
|
@@ -16162,9 +16139,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16162
16139
|
...viewConfig,
|
|
16163
16140
|
});
|
|
16164
16141
|
this.hostEventClient = new HostEventClient(this.iFrame);
|
|
16142
|
+
const embedConfig = getEmbedConfig();
|
|
16143
|
+
this.embedConfig = embedConfig;
|
|
16165
16144
|
this.isReadyForRenderPromise = getInitPromise().then(async () => {
|
|
16166
|
-
const embedConfig = getEmbedConfig();
|
|
16167
|
-
this.embedConfig = embedConfig;
|
|
16168
16145
|
if (!embedConfig.authTriggerContainer && !embedConfig.useEventForSAMLPopup) {
|
|
16169
16146
|
this.embedConfig.authTriggerContainer = domSelector;
|
|
16170
16147
|
}
|
|
@@ -16197,7 +16174,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16197
16174
|
*/
|
|
16198
16175
|
getEventType(event) {
|
|
16199
16176
|
var _a, _b;
|
|
16200
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
16201
16177
|
return ((_a = event.data) === null || _a === void 0 ? void 0 : _a.type) || ((_b = event.data) === null || _b === void 0 ? void 0 : _b.__type);
|
|
16202
16178
|
}
|
|
16203
16179
|
/**
|
|
@@ -16336,6 +16312,43 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16336
16312
|
async getAppInitData() {
|
|
16337
16313
|
return this.getDefaultAppInitData();
|
|
16338
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
|
+
}
|
|
16339
16352
|
/**
|
|
16340
16353
|
* Constructs the base URL string to load the ThoughtSpot app.
|
|
16341
16354
|
* @param query
|
|
@@ -16350,6 +16363,11 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16350
16363
|
.join('/');
|
|
16351
16364
|
return `${basePath}#`;
|
|
16352
16365
|
}
|
|
16366
|
+
getUpdateEmbedParamsObject() {
|
|
16367
|
+
let queryParams = this.getEmbedParamsObject();
|
|
16368
|
+
queryParams = { ...this.viewConfig, ...queryParams };
|
|
16369
|
+
return queryParams;
|
|
16370
|
+
}
|
|
16353
16371
|
/**
|
|
16354
16372
|
* Common query params set for all the embed modes.
|
|
16355
16373
|
* @param queryParams
|
|
@@ -16499,9 +16517,13 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16499
16517
|
return path;
|
|
16500
16518
|
}
|
|
16501
16519
|
getEmbedParams() {
|
|
16502
|
-
const queryParams = this.
|
|
16520
|
+
const queryParams = this.getEmbedParamsObject();
|
|
16503
16521
|
return getQueryParamString(queryParams);
|
|
16504
16522
|
}
|
|
16523
|
+
getEmbedParamsObject() {
|
|
16524
|
+
const params = this.getBaseQueryParams();
|
|
16525
|
+
return params;
|
|
16526
|
+
}
|
|
16505
16527
|
getRootIframeSrc() {
|
|
16506
16528
|
const query = this.getEmbedParams();
|
|
16507
16529
|
return this.getEmbedBasePath(query);
|
|
@@ -16600,7 +16622,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16600
16622
|
}
|
|
16601
16623
|
});
|
|
16602
16624
|
}
|
|
16603
|
-
// Setup fullscreen change handler after iframe is
|
|
16625
|
+
// Setup fullscreen change handler after iframe is
|
|
16626
|
+
// loaded and ready
|
|
16604
16627
|
this.setupFullscreenChangeHandler();
|
|
16605
16628
|
});
|
|
16606
16629
|
this.iFrame.addEventListener('error', () => {
|
|
@@ -16702,7 +16725,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
16702
16725
|
const div = document.createElement('div');
|
|
16703
16726
|
div.innerHTML = child;
|
|
16704
16727
|
div.id = TS_EMBED_ID;
|
|
16705
|
-
// eslint-disable-next-line no-param-reassign
|
|
16706
16728
|
child = div;
|
|
16707
16729
|
}
|
|
16708
16730
|
if (((_a = this.el.nextElementSibling) === null || _a === void 0 ? void 0 : _a.id) === TS_EMBED_ID) {
|
|
@@ -17025,7 +17047,10 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17025
17047
|
return this.preRender(true);
|
|
17026
17048
|
}
|
|
17027
17049
|
this.validatePreRenderViewConfig(this.viewConfig);
|
|
17050
|
+
logger$3.debug('triggering UpdateEmbedParams', this.viewConfig);
|
|
17051
|
+
this.triggerAfterLoad(exports.HostEvent.UpdateEmbedParams, this.getUpdateEmbedParamsObject());
|
|
17028
17052
|
}
|
|
17053
|
+
this.beforePrerenderVisible();
|
|
17029
17054
|
if (this.el) {
|
|
17030
17055
|
this.syncPreRenderStyle();
|
|
17031
17056
|
if (!this.viewConfig.doNotTrackPreRenderSize) {
|
|
@@ -17042,7 +17067,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17042
17067
|
this.resizeObserver.observe(this.el);
|
|
17043
17068
|
}
|
|
17044
17069
|
}
|
|
17045
|
-
this.beforePrerenderVisible();
|
|
17046
17070
|
removeStyleProperties(this.preRenderWrapper, ['z-index', 'opacity', 'pointer-events']);
|
|
17047
17071
|
this.subscribeToEvents();
|
|
17048
17072
|
// Setup fullscreen change handler for prerendered components
|
|
@@ -17135,7 +17159,8 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17135
17159
|
const isFullscreen = !!document.fullscreenElement;
|
|
17136
17160
|
if (!isFullscreen) {
|
|
17137
17161
|
logger$3.info('Exited fullscreen mode - triggering ExitPresentMode');
|
|
17138
|
-
// Only trigger if iframe is available and contentWindow is
|
|
17162
|
+
// Only trigger if iframe is available and contentWindow is
|
|
17163
|
+
// accessible
|
|
17139
17164
|
if (this.iFrame && this.iFrame.contentWindow) {
|
|
17140
17165
|
this.trigger(exports.HostEvent.ExitPresentMode);
|
|
17141
17166
|
}
|
|
@@ -17169,7 +17194,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17169
17194
|
* Only for testing purposes.
|
|
17170
17195
|
* @hidden
|
|
17171
17196
|
*/
|
|
17172
|
-
// eslint-disable-next-line camelcase
|
|
17173
17197
|
this.test__executeCallbacks = this.executeCallbacks;
|
|
17174
17198
|
this.viewConfig = { excludeRuntimeFiltersfromURL: false, ...viewConfig };
|
|
17175
17199
|
}
|
|
@@ -17231,15 +17255,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17231
17255
|
this.embedComponentType = 'SearchBarEmbed';
|
|
17232
17256
|
this.viewConfig = viewConfig;
|
|
17233
17257
|
}
|
|
17234
|
-
|
|
17235
|
-
* Construct the URL of the embedded ThoughtSpot search to be
|
|
17236
|
-
* loaded in the iframe
|
|
17237
|
-
* @param dataSources A list of data source GUIDs
|
|
17238
|
-
*/
|
|
17239
|
-
getIFrameSrc() {
|
|
17258
|
+
getEmbedParamsObject() {
|
|
17240
17259
|
var _a;
|
|
17241
17260
|
const { searchOptions, dataSource, dataSources, useLastSelectedSources = false, excludeSearchTokenStringFromURL, } = this.viewConfig;
|
|
17242
|
-
const path = 'search-bar-embed';
|
|
17243
17261
|
const queryParams = this.getBaseQueryParams();
|
|
17244
17262
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
17245
17263
|
if (dataSources && dataSources.length) {
|
|
@@ -17261,6 +17279,16 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17261
17279
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
17262
17280
|
}
|
|
17263
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';
|
|
17264
17292
|
let query = '';
|
|
17265
17293
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
17266
17294
|
if (queryParamsString) {
|
|
@@ -17311,12 +17339,7 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17311
17339
|
viewConfig.embedComponentType = 'SageEmbed';
|
|
17312
17340
|
super(domSelector, viewConfig);
|
|
17313
17341
|
}
|
|
17314
|
-
|
|
17315
|
-
* Constructs a map of parameters to be passed on to the
|
|
17316
|
-
* embedded Eureka or Sage search page.
|
|
17317
|
-
* @returns {string} query string
|
|
17318
|
-
*/
|
|
17319
|
-
getEmbedParams() {
|
|
17342
|
+
getEmbedParamsObject() {
|
|
17320
17343
|
const { disableWorksheetChange, hideWorksheetSelector, showObjectSuggestions, dataPanelV2, hideSampleQuestions, isProductTour, hideSageAnswerHeader, hideAutocompleteSuggestions, } = this.viewConfig;
|
|
17321
17344
|
const params = this.getBaseQueryParams();
|
|
17322
17345
|
params[Param.DataPanelV2Enabled] = !!dataPanelV2;
|
|
@@ -17331,6 +17354,15 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17331
17354
|
params[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
17332
17355
|
params[Param.IsProductTour] = !!isProductTour;
|
|
17333
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();
|
|
17334
17366
|
return getQueryParamString(params, true);
|
|
17335
17367
|
}
|
|
17336
17368
|
/**
|
|
@@ -17440,11 +17472,9 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17440
17472
|
const defaultAppInitData = await super.getAppInitData();
|
|
17441
17473
|
return { ...defaultAppInitData, ...this.getSearchInitData() };
|
|
17442
17474
|
}
|
|
17443
|
-
|
|
17475
|
+
getEmbedParamsObject() {
|
|
17444
17476
|
var _a;
|
|
17445
|
-
const { hideResults, enableSearchAssist, forceTable, searchOptions, runtimeFilters, dataSource, dataSources, excludeRuntimeFiltersfromURL, hideSearchBar, dataPanelV2 = false, useLastSelectedSources = false, runtimeParameters, collapseSearchBarInitially = false, enableCustomColumnGroups = false, isOnBeforeGetVizDataInterceptEnabled = false,
|
|
17446
|
-
/* eslint-disable-next-line max-len */
|
|
17447
|
-
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;
|
|
17448
17478
|
const queryParams = this.getBaseQueryParams();
|
|
17449
17479
|
queryParams[Param.HideActions] = [
|
|
17450
17480
|
...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : []),
|
|
@@ -17477,7 +17507,6 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17477
17507
|
queryParams[Param.HideSearchBar] = true;
|
|
17478
17508
|
}
|
|
17479
17509
|
if (isOnBeforeGetVizDataInterceptEnabled) {
|
|
17480
|
-
/* eslint-disable-next-line max-len */
|
|
17481
17510
|
queryParams[Param.IsOnBeforeGetVizDataInterceptEnabled] = isOnBeforeGetVizDataInterceptEnabled;
|
|
17482
17511
|
}
|
|
17483
17512
|
if (!focusSearchBarOnRender) {
|
|
@@ -17490,20 +17519,22 @@ mutation GetUnsavedAnswerTML($session: BachSessionIdInput!, $exportDependencies:
|
|
|
17490
17519
|
queryParams[Param.UseLastSelectedDataSource] = false;
|
|
17491
17520
|
}
|
|
17492
17521
|
queryParams[Param.searchEmbed] = true;
|
|
17493
|
-
/* eslint-disable-next-line max-len */
|
|
17494
17522
|
queryParams[Param.CollapseSearchBarInitially] = collapseSearchBarInitially || collapseSearchBar;
|
|
17495
17523
|
queryParams[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
17496
17524
|
if (dataPanelCustomGroupsAccordionInitialState
|
|
17497
17525
|
=== DataPanelCustomColumnGroupsAccordionState$1.COLLAPSE_ALL
|
|
17498
17526
|
|| dataPanelCustomGroupsAccordionInitialState
|
|
17499
17527
|
=== DataPanelCustomColumnGroupsAccordionState$1.EXPAND_FIRST) {
|
|
17500
|
-
/* eslint-disable-next-line max-len */
|
|
17501
17528
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = dataPanelCustomGroupsAccordionInitialState;
|
|
17502
17529
|
}
|
|
17503
17530
|
else {
|
|
17504
|
-
/* eslint-disable-next-line max-len */
|
|
17505
17531
|
queryParams[Param.DataPanelCustomGroupsAccordionInitialState] = DataPanelCustomColumnGroupsAccordionState$1.EXPAND_ALL;
|
|
17506
17532
|
}
|
|
17533
|
+
return queryParams;
|
|
17534
|
+
}
|
|
17535
|
+
getEmbedParams() {
|
|
17536
|
+
const { runtimeParameters, runtimeFilters, excludeRuntimeParametersfromURL, excludeRuntimeFiltersfromURL, } = this.viewConfig;
|
|
17537
|
+
const queryParams = this.getEmbedParamsObject();
|
|
17507
17538
|
let query = '';
|
|
17508
17539
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
17509
17540
|
if (queryParamsString) {
|
|
@@ -18096,6 +18127,7 @@ query GetEurekaVizSnapshots(
|
|
|
18096
18127
|
}
|
|
18097
18128
|
this.setIFrameHeight(frameHeight || this.defaultHeight);
|
|
18098
18129
|
};
|
|
18130
|
+
this.currentLiveboardId = this.viewConfig.liveboardId;
|
|
18099
18131
|
if (this.viewConfig.fullHeight === true) {
|
|
18100
18132
|
if (this.viewConfig.vizId) {
|
|
18101
18133
|
logger$3.warn('Full height is currently only supported for Liveboard embeds.' +
|
|
@@ -18112,6 +18144,11 @@ query GetEurekaVizSnapshots(
|
|
|
18112
18144
|
* embedded Liveboard or visualization.
|
|
18113
18145
|
*/
|
|
18114
18146
|
getEmbedParams() {
|
|
18147
|
+
const params = this.getEmbedParamsObject();
|
|
18148
|
+
const queryParams = getQueryParamString(params, true);
|
|
18149
|
+
return queryParams;
|
|
18150
|
+
}
|
|
18151
|
+
getEmbedParamsObject() {
|
|
18115
18152
|
let params = {};
|
|
18116
18153
|
params = this.getBaseQueryParams(params);
|
|
18117
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;
|
|
@@ -18181,8 +18218,27 @@ query GetEurekaVizSnapshots(
|
|
|
18181
18218
|
params[Param.DataPanelV2Enabled] = dataPanelV2;
|
|
18182
18219
|
params[Param.EnableCustomColumnGroups] = enableCustomColumnGroups;
|
|
18183
18220
|
params[Param.CoverAndFilterOptionInPDF] = coverAndFilterOptionInPDF;
|
|
18184
|
-
|
|
18185
|
-
|
|
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;
|
|
18186
18242
|
}
|
|
18187
18243
|
getIframeSuffixSrc(liveboardId, vizId, activeTabId) {
|
|
18188
18244
|
let suffix = `/embed/viz/${liveboardId}`;
|
|
@@ -18244,16 +18300,12 @@ query GetEurekaVizSnapshots(
|
|
|
18244
18300
|
}
|
|
18245
18301
|
}
|
|
18246
18302
|
beforePrerenderVisible() {
|
|
18247
|
-
|
|
18248
|
-
const
|
|
18249
|
-
|
|
18250
|
-
|
|
18251
|
-
|
|
18252
|
-
|
|
18253
|
-
if (showDifferentLib) {
|
|
18254
|
-
const libId = this.viewConfig.liveboardId;
|
|
18255
|
-
this.navigateToLiveboard(libId);
|
|
18256
|
-
}
|
|
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
|
+
});
|
|
18257
18309
|
}
|
|
18258
18310
|
async handleRenderForPrerender() {
|
|
18259
18311
|
if (isUndefined$1(this.viewConfig.liveboardId)) {
|
|
@@ -18315,13 +18367,13 @@ query GetEurekaVizSnapshots(
|
|
|
18315
18367
|
this.postRender();
|
|
18316
18368
|
return this;
|
|
18317
18369
|
}
|
|
18318
|
-
navigateToLiveboard(liveboardId, vizId, activeTabId) {
|
|
18370
|
+
navigateToLiveboard(liveboardId, vizId, activeTabId, onNavigateCalled) {
|
|
18319
18371
|
const path = this.getIframeSuffixSrc(liveboardId, vizId, activeTabId);
|
|
18320
18372
|
this.viewConfig.liveboardId = liveboardId;
|
|
18321
18373
|
this.viewConfig.activeTabId = activeTabId;
|
|
18322
18374
|
this.viewConfig.vizId = vizId;
|
|
18323
18375
|
if (this.isRendered) {
|
|
18324
|
-
this.
|
|
18376
|
+
this.triggerAfterLoad(exports.HostEvent.Navigate, path.substring(1), onNavigateCalled);
|
|
18325
18377
|
}
|
|
18326
18378
|
else if (this.viewConfig.preRenderId) {
|
|
18327
18379
|
this.preRender(true);
|
|
@@ -18739,13 +18791,17 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18739
18791
|
super(container, viewConfig);
|
|
18740
18792
|
this.viewConfig = viewConfig;
|
|
18741
18793
|
}
|
|
18742
|
-
|
|
18794
|
+
getEmbedParamsObject() {
|
|
18743
18795
|
var _a;
|
|
18744
|
-
const { sessionId, genNo, acSessionId, acGenNo, convId, messageId, } = this.viewConfig;
|
|
18745
|
-
const path = 'conv-assist-answer';
|
|
18746
18796
|
const queryParams = this.getBaseQueryParams();
|
|
18747
18797
|
queryParams[Param.HideActions] = [...((_a = queryParams[Param.HideActions]) !== null && _a !== void 0 ? _a : [])];
|
|
18748
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();
|
|
18749
18805
|
let query = '';
|
|
18750
18806
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
18751
18807
|
if (queryParamsString) {
|
|
@@ -18901,9 +18957,8 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18901
18957
|
super(container, viewConfig);
|
|
18902
18958
|
this.viewConfig = viewConfig;
|
|
18903
18959
|
}
|
|
18904
|
-
|
|
18960
|
+
getEmbedParamsObject() {
|
|
18905
18961
|
const { worksheetId, searchOptions, disableSourceSelection, hideSourceSelection, dataPanelV2, showSpotterLimitations, hideSampleQuestions, } = this.viewConfig;
|
|
18906
|
-
const path = 'insights/conv-assist';
|
|
18907
18962
|
if (!worksheetId) {
|
|
18908
18963
|
this.handleError(ERROR_MESSAGE.SPOTTER_EMBED_WORKSHEED_ID_NOT_FOUND);
|
|
18909
18964
|
}
|
|
@@ -18924,6 +18979,12 @@ query SendMessage($params: Input_convassist_SendMessageRequest) {
|
|
|
18924
18979
|
if (!isUndefined_1(hideSampleQuestions)) {
|
|
18925
18980
|
queryParams[Param.HideSampleQuestions] = !!hideSampleQuestions;
|
|
18926
18981
|
}
|
|
18982
|
+
return queryParams;
|
|
18983
|
+
}
|
|
18984
|
+
getIframeSrc() {
|
|
18985
|
+
const { worksheetId, searchOptions, } = this.viewConfig;
|
|
18986
|
+
const path = 'insights/conv-assist';
|
|
18987
|
+
const queryParams = this.getEmbedParamsObject();
|
|
18927
18988
|
let query = '';
|
|
18928
18989
|
const queryParamsString = getQueryParamString(queryParams, true);
|
|
18929
18990
|
if (queryParamsString) {
|